| Previous | 15994 Revisions | Next |
| r7501 Friday 5th March, 2010 at 12:28:32 UTC by Nathan Woods |
|---|
| Updating to MAME 0.136u4 core, some files don't compile... |
| [ROOT] | makefile |
| [docs] | messnew.txt |
| [src/emu] | drawgfx.c emualloc.c emualloc.h mame.c mconfig.c mconfig.h memory.h validity.c |
| [src/emu/cpu] | drcbex86.c |
| [src/emu/cpu/h83002] | h8_16.c h8_8.c h8ops.h h8priv.h |
| [src/emu/debug] | express.c |
| [src/emu/debugint] | debugint.c |
| [src/emu/machine] | pic8259.h z80dma.c z80pio.c z80pio.h |
| [src/emu/sound] | disc_mth.c es5506.c k051649.c mos6560.c sn76496.c sound.mak |
| [src/lib] | lib.mak |
| [src/lib/softfloat] | README.txt* mamesf.h* milieu.h* softfloat-macros* softfloat-specialize* softfloat.c* softfloat.h* |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | micro3d.c senjyo.c |
| [src/mame/drivers] | 1945kiii.c 2mindril.c 39in1.c 8080bw.c ace.c adp.c aeroboto.c aladbl.c albazc.c albazg.c arkanoid.c astinvad.c astrocorp.c asuka.c atarig1.c attckufo.c backfire.c beaminv.c big10.c bigfghtr.c bladestl.c boogwing.c boxer.c calorie.c cball.c cbuster.c chanbara.c chinsan.c chsuper.c circus.c cischeat.c clayshoo.c cninja.c cntsteer.c cps2.c cultures.c dacholer.c dassault.c dblewing.c ddayjlc.c ddealer.c deco156.c deniam.c destroyr.c dietgo.c discoboy.c diverboy.c dominob.c dorachan.c dotrikun.c dreamwld.c drtomy.c dunhuang.c dwarfd.c dynadice.c dynax.c egghunt.c embargo.c enigma2.c exerion.c f-32.c f1gp.c flyball.c funkyjet.c funworld.c galaga.c galaxi.c galaxian.c galdrvr.c go2000.c goldstar.c good.c gstream.c hotblock.c imolagp.c jangou.c jantotsu.c jollyjgr.c jongkyo.c kingdrby.c koikoi.c laserbas.c lastfght.c liberate.c lkage.c lockon.c looping.c lsasquad.c luckgrln.c m14.c m63.c m79amb.c macrossp.c macs.c madmotor.c marinedt.c markham.c matmania.c maygay1b.c mayumi.c mazerbla.c mcatadv.c mcr.c mediagx.c megadriv.c megatech.c megazone.c meijinsn.c meritm.c mermaid.c metlclsh.c metro.c mexico86.c mgolf.c mikie.c minivadr.c mirage.c mjsister.c model3.c mogura.c mole.c momoko.c mosaic.c mouser.c mrdo.c mrflea.c mrjong.c mugsmash.c munchmo.c mwarr.c namcond1.c namcops2.c namcos12.c namcos21.c namcos23.c naomi.c nemesis.c neodrvr.c news.c nightgal.c nitedrvr.c nmg5.c nycaptor.c nyny.c ohmygod.c ojankohs.c olibochu.c oneshot.c onetwo.c orbit.c othello.c othldrby.c othunder.c pachifev.c pktgaldx.c poo.c* pushman.c rgum.c* rohga.c safarir.c sbowling.c segas16b.c segas32.c senjyo.c sfbonus.c shougi.c simpl156.c skeetsht.c skyarmy.c skyfox.c sliver.c spaceg.c speglsht.c spoker.c spool99.c srmp5.c srmp6.c ssingles.c sstrangr.c sub.c suna8.c supbtime.c supdrapo.c superdq.c supertnk.c suprgolf.c system1.c tail2nos.c taito_b.c tmaster.c toaplan1.c toaplan2.c toratora.c tumbleb.c tumblep.c twincobr.c vamphalf.c vaportra.c vicdual.c wardner.c wc90.c zaxxon.c |
| [src/mame/includes] | 1942.h 1943.h 20pacgal.h 4enraya.h 88games.h actfancr.h aeroboto.h aerofgt.h airbustr.h ajax.h aliens.h alpha68k.h ambush.h amspdwy.h angelkds.h appoooh.h aquarium.h arabian.h arkanoid.h armedf.h ashnojoe.h asterix.h astrof.h asuka.h atarifb.h atarig1.h atarig42.h atarigt.h atarigx2.h atarisy1.h atarisy2.h avalnche.h badlands.h balsente.h bankp.h batman.h battlane.h battlex.h battlnts.h beathead.h bigevglf.h bigstrkb.h bionicc.h bishi.h bladestl.h blktiger.h blmbycar.h blockade.h blockhl.h blockout.h blstroid.h blueprnt.h bogeyman.h bombjack.h boogwing.h* bottom9.h brkthru.h bsktball.h btime.h bublbobl.h buggychl.h bwing.h cabal.h canyon.h capbowl.h carjmbre.h cave.h cbasebal.h cbuster.h* ccastles.h chaknpop.h champbas.h changela.h cheekyms.h chqflag.h cidelsa.h circus.h circusc.h citycon.h cloud9.h cninja.h combatsc.h commando.h compgolf.h contra.h cop01.h copsnrob.h cosmic.h cps1.h crgolf.h crimfght.h crospang.h crshrace.h cvs.h cyberbal.h darius.h dassault.h* dbz.h dcheese.h dday.h ddragon.h ddragon3.h ddribble.h dec8.h deniam.h dietgo.h* djboy.h dkong.h docastle.h dogfgt.h dragrace.h drgnmst.h dribling.h drmicro.h epos.h eprom.h equites.h esd16.h espial.h exedexes.h exerion.h exprraid.h f1gp.h fantland.h fastlane.h fcombat.h fgoal.h finalizr.h firetrap.h fitfight.h flkatck.h flstory.h foodf.h freekick.h fromanc2.h fromance.h funkybee.h funkyjet.h* funybubl.h fuukifg2.h fuukifg3.h gaelco.h gaiden.h galivan.h galspnbl.h gameplan.h gauntlet.h gberet.h gbusters.h gcpinbal.h gijoe.h ginganin.h glass.h gng.h goal92.h goindol.h goldstar.h gotcha.h gotya.h gradius3.h grchamp.h gumbo.h gundealr.h gunsmoke.h gyruss.h hanaawas.h harddriv.h hcastle.h higemaru.h himesiki.h hitme.h hnayayoi.h holeland.h homedata.h homerun.h hyprduel.h ikki.h inufuku.h iremz80.h ironhors.h jack.h jackal.h jailbrek.h jedi.h kangaroo.h karnov.h kchamp.h kickgoal.h kingobox.h klax.h kncljoe.h kopunch.h ksayakyu.h kyugo.h labyrunr.h ladybug.h ladyfrog.h laserbat.h lasso.h lastduel.h lazercmd.h lemmings.h lethal.h liberate.h lkage.h lockon.h lsasquad.h lwings.h m10.h macrossp.h* madmotor.h* mainevt.h malzak.h mappy.h mario.h markham.h* matmania.h mcatadv.h megadriv.h megazone.h* mermaid.h* metalmx.h metlclsh.h* mexico86.h micro3d.h mikie.h* mitchell.h mjkjidai.h momoko.h* moo.h mosaic.h* mouser.h* mrdo.h* mrflea.h* mrjong.h* mugsmash.h munchmo.h* mw8080bw.h mystston.h n8080.h naomi.h nemesis.h neogeo.h news.h ninjaw.h nitedrvr.h nycaptor.h offtwall.h ohmygod.h* ojankohs.h* oneshot.h opwolf.h orbit.h othldrby.h* othunder.h overdriv.h pandoras.h parodius.h pass.h pgm.h pktgaldx.h* popper.h psikyo.h psikyo4.h psikyosh.h qix.h rainbow.h rampart.h rastan.h relief.h rockrage.h rohga.h* rollerg.h rungun.h sbugger.h sderby.h segas16.h sf.h shadfrce.h shootout.h shuuz.h sidearms.h sidepckt.h silkroad.h simpl156.h* simpsons.h skullxbo.h skyfox.h* slapshot.h sonson.h spbactn.h spy.h srmp2.h sslam.h stactics.h stlforce.h supbtime.h* suprslam.h surpratk.h system16.h tail2nos.h taito_b.h taito_f2.h taito_h.h taito_l.h taito_o.h taito_z.h taitoair.h taitojc.h thunderj.h thunderx.h timeplt.h tmnt.h tnzs.h toaplipt.h* toobin.h topspeed.h toypop.h trackfld.h tumbleb.h tumblep.h* tunhunt.h turbo.h ultraman.h vaportra.h* vastar.h vendetta.h vindictr.h volfied.h warriorb.h welltris.h wgp.h wwfsstar.h xexex.h xmen.h xybots.h xyonix.h yunsun16.h yunsung8.h zaxxon.h zerozone.h |
| [src/mame/machine] | cps2crpt.c daikaiju.c decocass.h lkage.c lsasquad.c maniach.c mcr.c mexico86.c namco50.c namco51.c namco53.c naomi.c naomibd.c nitedrvr.c nycaptor.c slapstic.c snes.c |
| [src/mame/video] | arkanoid.c avgdvg.c boogwing.c cbuster.c cninja.c dassault.c deco16ic.c deco16ic.h* deco32.c dietgo.c funkyjet.c funworld.c hng64.c liberate.c lkage.c lockon.c lsasquad.c macrossp.c madmotor.c markham.c matmania.c mcatadv.c megazone.c mermaid.c metlclsh.c mexico86.c mikie.c momoko.c mosaic.c mouser.c mrdo.c mrflea.c mrjong.c mugsmash.c munchmo.c nemesis.c news.c nitedrvr.c nycaptor.c ohmygod.c ojankohs.c oneshot.c orbit.c othldrby.c pktgaldx.c rohga.c simpl156.c skyfox.c snes.c st0016.c supbtime.c tumbleb.c tumblep.c vaportra.c |
| [src/mess] | mess.mak |
| [src/osd/sdl] | gl_shader_mgr.c input.c main.c output.c sdlmisc_os2.c sdlsync_tc.c strconv.h video.c video.h |
| [src/osd/windows] | input.c winmisc.c wintime.c |
| [src/tools] | unidasm.c |
| r7500 | r7501 | |
|---|---|---|
| 214 | 214 | { |
| 215 | 215 | assert(device != NULL); |
| 216 | 216 | assert(device->token != NULL); |
| 217 | assert(device->type == SOUND_MICRO3D); | |
| 217 | assert(device->type == SOUND); | |
| 218 | assert(sound_get_type(device) == SOUND_MICRO3D); | |
| 218 | 219 | |
| 219 | 220 | return (noise_state *)device->token; |
| 220 | 221 | } |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | static INT16 *_single; |
| 11 | 11 | static int single_rate = 0; |
| 12 | 12 | static int single_volume = 0; |
| 13 | UINT8 senjyo_sound_cmd; | |
| 13 | 14 | |
| 14 | ||
| 15 | 15 | const z80_daisy_chain senjyo_daisy_chain[] = |
| 16 | 16 | { |
| 17 | 17 | { "z80ctc" }, |
| r7500 | r7501 | |
| 22 | 22 | |
| 23 | 23 | /* z80 pio */ |
| 24 | 24 | |
| 25 | ||
| 25 | READ | |
| 26 | 26 | { |
| 27 | return senjyo_sound_cmd; | |
| 28 | } | |
| 29 | ||
| 30 | Z80PIO_INTERFACE( senjyo_pio_intf ) | |
| 31 | { | |
| 27 | 32 | DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0), |
| 33 | DEVCB_HANDLER(pio_pa_r), | |
| 28 | 34 | DEVCB_NULL, |
| 29 | 35 | DEVCB_NULL, |
| 30 | 36 | DEVCB_NULL, |
| 31 | 37 | DEVCB_NULL, |
| 32 | DEVCB_NULL, | |
| 33 | 38 | DEVCB_NULL |
| 34 | 39 | }; |
| 35 | 40 |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/nycaptor.h" |
| 12 | 12 | |
| 13 | static UINT8 from_main,from_mcu; | |
| 14 | static int mcu_sent = 0,main_sent = 0; | |
| 15 | ||
| 16 | ||
| 17 | static UINT8 portA_in,portA_out,ddrA; | |
| 18 | ||
| 19 | READ8_HANDLER( nycaptor_68705_portA_r ) | |
| 13 | READ8_HANDLER( nycaptor_68705_port_a_r ) | |
| 20 | 14 | { |
| 21 | ||
| 22 | return (portA_out & ddrA) | (portA_in & ~ddrA); | |
| 15 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 16 | return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a); | |
| 23 | 17 | } |
| 24 | 18 | |
| 25 | WRITE8_HANDLER( nycaptor_68705_port | |
| 19 | WRITE8_HANDLER( nycaptor_68705_port_a_w ) | |
| 26 | 20 | { |
| 27 | ||
| 28 | portA_out = data; | |
| 21 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 22 | state->port_a_out = data; | |
| 29 | 23 | } |
| 30 | 24 | |
| 31 | WRITE8_HANDLER( nycaptor_68705_ddr | |
| 25 | WRITE8_HANDLER( nycaptor_68705_ddr_a_w ) | |
| 32 | 26 | { |
| 33 | ddrA = data; | |
| 27 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 28 | state->ddr_a = data; | |
| 34 | 29 | } |
| 35 | 30 | |
| 36 | 31 | /* |
| r7500 | r7501 | |
| 42 | 37 | * 2 W when 0->1, copies port A to the latch for the main CPU |
| 43 | 38 | */ |
| 44 | 39 | |
| 45 | static UINT8 portB_in,portB_out,ddrB; | |
| 46 | ||
| 47 | READ8_HANDLER( nycaptor_68705_portB_r ) | |
| 40 | READ8_HANDLER( nycaptor_68705_port_b_r ) | |
| 48 | 41 | { |
| 49 | return (portB_out & ddrB) | (portB_in & ~ddrB); | |
| 42 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 43 | return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b); | |
| 50 | 44 | } |
| 51 | 45 | |
| 52 | WRITE8_HANDLER( nycaptor_68705_port | |
| 46 | WRITE8_HANDLER( nycaptor_68705_port_b_w ) | |
| 53 | 47 | { |
| 48 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 54 | 49 | |
| 55 | ||
| 56 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) | |
| 50 | if (BIT(state->ddr_b, 1) && BIT(~data, 1) && BIT(state->port_b_out, 1)) | |
| 57 | 51 | { |
| 58 | portA_in = from_main; | |
| 59 | if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); | |
| 60 | main_sent = 0; | |
| 52 | state->port_a_in = state->from_main; | |
| 61 | 53 | |
| 54 | if (state->main_sent) | |
| 55 | cpu_set_input_line(state->mcu, 0, CLEAR_LINE); | |
| 56 | state->main_sent = 0; | |
| 57 | ||
| 62 | 58 | } |
| 63 | if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) | |
| 59 | ||
| 60 | if (BIT(state->ddr_b, 2) && BIT(data, 2) && BIT(~state->port_b_out, 2)) | |
| 64 | 61 | { |
| 65 | ||
| 66 | from_mcu = portA_out; | |
| 67 | mcu_sent = 1; | |
| 62 | state->from_mcu = state->port_a_out; | |
| 63 | state->mcu_sent = 1; | |
| 68 | 64 | } |
| 69 | 65 | |
| 70 | port | |
| 66 | state->port_b_out = data; | |
| 71 | 67 | } |
| 72 | 68 | |
| 73 | WRITE8_HANDLER( nycaptor_68705_ddr | |
| 69 | WRITE8_HANDLER( nycaptor_68705_ddr_b_w ) | |
| 74 | 70 | { |
| 75 | ddrB = data; | |
| 71 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 72 | state->ddr_b = data; | |
| 76 | 73 | } |
| 77 | 74 | |
| 78 | 75 | |
| 79 | static UINT8 portC_in,portC_out,ddrC; | |
| 80 | ||
| 81 | READ8_HANDLER( nycaptor_68705_portC_r ) | |
| 76 | READ8_HANDLER( nycaptor_68705_port_c_r ) | |
| 82 | 77 | { |
| 83 | portC_in = 0; | |
| 84 | if (main_sent) portC_in |= 0x01; | |
| 85 | if (!mcu_sent) portC_in |= 0x02; | |
| 78 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 79 | state->port_c_in = 0; | |
| 86 | 80 | |
| 87 | return (portC_out & ddrC) | (portC_in & ~ddrC); | |
| 81 | if (state->main_sent) | |
| 82 | state->port_c_in |= 0x01; | |
| 83 | if (!state->mcu_sent) | |
| 84 | state->port_c_in |= 0x02; | |
| 85 | ||
| 86 | return (state->port_c_out & state->ddr_c) | (state->port_c_in & ~state->ddr_c); | |
| 88 | 87 | } |
| 89 | 88 | |
| 90 | WRITE8_HANDLER( nycaptor_68705_port | |
| 89 | WRITE8_HANDLER( nycaptor_68705_port_c_w ) | |
| 91 | 90 | { |
| 92 | ||
| 93 | portC_out = data; | |
| 91 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 92 | state->port_c_out = data; | |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | WRITE8_HANDLER( nycaptor_68705_ddr | |
| 95 | WRITE8_HANDLER( nycaptor_68705_ddr_c_w ) | |
| 97 | 96 | { |
| 98 | ddrC = data; | |
| 97 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 98 | state->ddr_c = data; | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | WRITE8_HANDLER( nycaptor_mcu_w ) |
| 102 | 102 | { |
| 103 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 103 | 104 | |
| 104 | from_main = data; | |
| 105 | main_sent = 1; | |
| 106 | cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); | |
| 105 | state->from_main = data; | |
| 106 | state->main_sent = 1; | |
| 107 | cpu_set_input_line(state->mcu, 0, ASSERT_LINE); | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | READ8_HANDLER( nycaptor_mcu_r ) |
| 110 | 111 | { |
| 112 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 111 | 113 | |
| 112 | mcu_sent = 0; | |
| 113 | return from_mcu; | |
| 114 | state->mcu_sent = 0; | |
| 115 | return state->from_mcu; | |
| 114 | 116 | } |
| 115 | 117 | |
| 116 | 118 | READ8_HANDLER( nycaptor_mcu_status_r1 ) |
| 117 | 119 | { |
| 120 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 121 | ||
| 118 | 122 | /* bit 1 = when 1, mcu has sent data to the main cpu */ |
| 119 | ||
| 120 | return mcu_sent?2:0; | |
| 123 | return state->mcu_sent ? 2 : 0; | |
| 121 | 124 | } |
| 122 | 125 | |
| 123 | 126 | READ8_HANDLER( nycaptor_mcu_status_r2 ) |
| 124 | 127 | { |
| 128 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 129 | ||
| 125 | 130 | /* bit 0 = when 1, mcu is ready to receive data from main cpu */ |
| 126 | return main_sent?0:1; | |
| 127 | ||
| 131 | return state->main_sent ? 0 : 1; | |
| 128 | 132 | } |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | return naomi_ram64[0x2ad238/8]; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | static UINT8 asciihex_to_dec(UINT8 in) | |
| 26 | { | |
| 27 | if (in>=0x30 && in<=0x39) | |
| 28 | { | |
| 29 | return in - 0x30; | |
| 30 | } | |
| 31 | else | |
| 32 | if (in>=0x41 && in<=0x46) | |
| 33 | { | |
| 34 | return in - 0x37; | |
| 35 | } | |
| 36 | /* | |
| 37 | else | |
| 38 | if (in>=0x61 && in<=0x66) | |
| 39 | { | |
| 40 | return in - 0x57; | |
| 41 | } | |
| 42 | */ | |
| 43 | else | |
| 44 | { | |
| 45 | fatalerror("unexpected value in asciihex_to_dec"); | |
| 46 | } | |
| 47 | ||
| 48 | ||
| 49 | } | |
| 50 | ||
| 51 | // development helper function | |
| 52 | static void create_pic_from_retdat(running_machine* machine) | |
| 53 | { | |
| 54 | { | |
| 55 | UINT8* hexregion = memory_region(machine,"pichex"); | |
| 56 | UINT8* retregion = memory_region(machine,"picreturn"); | |
| 57 | UINT8* newregion = memory_region(machine,"pic"); | |
| 58 | int outcount = 0; | |
| 59 | ||
| 60 | if (hexregion && retregion && newregion) | |
| 61 | { | |
| 62 | int hexoffs = 0; | |
| 63 | int line; | |
| 64 | ||
| 65 | hexoffs += 0x11; // skip first line // :020000040000FA | |
| 66 | ||
| 67 | for (line=0;line<0x200;line++) | |
| 68 | { | |
| 69 | int offs2; | |
| 70 | ||
| 71 | hexoffs+= 0x1; // skip : | |
| 72 | hexoffs+= 0x8; // skip line # (:20xxxxxx incrementing in 0x2000) | |
| 73 | ||
| 74 | for (offs2=0;offs2<0x20;offs2++) | |
| 75 | { | |
| 76 | UINT8 ascii1 = hexregion[hexoffs+0]; | |
| 77 | UINT8 ascii2 = hexregion[hexoffs+1]; | |
| 78 | UINT8 dec1 = asciihex_to_dec(ascii1); | |
| 79 | UINT8 dec2 = asciihex_to_dec(ascii2); | |
| 80 | UINT8 val = dec1 << 4 | dec2; | |
| 81 | ||
| 82 | //printf("%02x%02x", ascii1, ascii2); | |
| 83 | ||
| 84 | printf("%02x", val); | |
| 85 | ||
| 86 | newregion[outcount] = val; | |
| 87 | ||
| 88 | hexoffs+=2; | |
| 89 | outcount++; | |
| 90 | } | |
| 91 | ||
| 92 | hexoffs+=0x4; // skip running checksum + newline | |
| 93 | ||
| 94 | printf("\n"); | |
| 95 | ||
| 96 | ||
| 97 | } | |
| 98 | ||
| 99 | { | |
| 100 | int i; | |
| 101 | printf("string 1 (key1)\n"); | |
| 102 | for (i=0;i<7;i++) | |
| 103 | { | |
| 104 | printf("%02x %02x\n", newregion[0x780+i*2], retregion[0x31+i]); | |
| 105 | ||
| 106 | newregion[0x780+i*2] = retregion[0x31+i]; // patch with extracted data | |
| 107 | } | |
| 108 | ||
| 109 | printf("string 2 (key2)\n"); | |
| 110 | for (i=0;i<7;i++) | |
| 111 | { | |
| 112 | printf("%02x %02x\n", newregion[0x7a0+i*2], retregion[0x29+i]); | |
| 113 | ||
| 114 | newregion[0x7a0+i*2] = retregion[0x29+i]; // patch with extracted data | |
| 115 | } | |
| 116 | ||
| 117 | printf("string 3 (filename)\n"); | |
| 118 | for (i=0;i<7;i++) | |
| 119 | { | |
| 120 | printf("%02x %02x\n", newregion[0x7c0+i*2], retregion[0x21+i]); | |
| 121 | ||
| 122 | newregion[0x7c0+i*2] = retregion[0x21+i]; // patch with extracted data | |
| 123 | } | |
| 124 | ||
| 125 | printf("string 4 (filename?)\n"); | |
| 126 | for (i=0;i<7;i++) | |
| 127 | { | |
| 128 | printf("%02x %02x\n", newregion[0x7e0+i*2], retregion[0x19+i]); | |
| 129 | ||
| 130 | newregion[0x7e0+i*2] = retregion[0x19+i]; // patch with extracted data | |
| 131 | } | |
| 132 | } | |
| 133 | ||
| 134 | ||
| 135 | { | |
| 136 | FILE *fp; | |
| 137 | char filename[256]; | |
| 138 | sprintf(filename,"picbin_%s", machine->gamedrv->name); | |
| 139 | fp=fopen(filename, "w+b"); | |
| 140 | if (fp) | |
| 141 | { | |
| 142 | fwrite(newregion, outcount, 1, fp); | |
| 143 | fclose(fp); | |
| 144 | } | |
| 145 | ||
| 146 | printf("wrote %04x bytes\n", outcount); | |
| 147 | } | |
| 148 | ||
| 149 | // hex dumps end with | |
| 150 | //:10400000000000000000000000000000000082002E | |
| 151 | //:00000001FF | |
| 152 | ||
| 153 | ||
| 154 | } | |
| 155 | } | |
| 156 | } | |
| 157 | ||
| 25 | 158 | DRIVER_INIT(naomi) |
| 26 | 159 | { |
| 27 | 160 | memory_install_read64_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc2ad238, 0xc2ad23f, 0, 0, naomi_bios_idle_skip_r); // rev e bios |
| 28 | 161 | jvsboard_type = JVSBD_DEFAULT; |
| 29 | 162 | actel_id = 0xffff; |
| 163 | ||
| 164 | create_pic_from_retdat(machine); | |
| 30 | 165 | } |
| 31 | 166 | |
| 167 | DRIVER_INIT(naomi2) | |
| 168 | { | |
| 169 | jvsboard_type = JVSBD_DEFAULT; | |
| 170 | actel_id = 0xffff; | |
| 171 | ||
| 172 | create_pic_from_retdat(machine); | |
| 173 | } | |
| 174 | ||
| 32 | 175 | DRIVER_INIT(naomi_mp) |
| 33 | 176 | { |
| 34 | 177 | memory_install_read64_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc2ad238, 0xc2ad23f, 0, 0, naomi_bios_idle_skip_r); // rev e bios |
| 35 | 178 | jvsboard_type = JVSBD_MAHJONG; |
| 36 | 179 | actel_id = 0xffff; |
| 180 | ||
| 181 | create_pic_from_retdat(machine); | |
| 37 | 182 | } |
| 38 | 183 | |
| 39 | 184 | static READ64_HANDLER( naomigd_ggxxsla_idle_skip_r ) |
| r7500 | r7501 | |
| 102 | 247 | |
| 103 | 248 | DRIVER_INIT( vf4evoct ) |
| 104 | 249 | { |
| 105 | ||
| 250 | | |
| 106 | 251 | actel_id = 0; //FIXME: correct value |
| 107 | 252 | } |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | typedef struct _decocass_state decocass_state; | |
| 19 | struct _decocass_state | |
| 18 | class decocass_state | |
| 20 | 19 | { |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, decocass_state(machine)); } | |
| 22 | ||
| 23 | decocass_state(running_machine &machine) { } | |
| 24 | ||
| 21 | 25 | /* memory pointers */ |
| 22 | 26 | UINT8 * rambase; |
| 23 | 27 | UINT8 * charram; |
| r7500 | r7501 | |
|---|---|---|
| 110 | 110 | #define MCU_CONTROLS1 0x36 |
| 111 | 111 | #define MCU_MESSAGE 0x40 |
| 112 | 112 | #define MCU_CONTROLS2 0x44 |
| 113 | #define MCU_ID | |
| 113 | #define MCU_ID 0x60 | |
| 114 | 114 | |
| 115 | 115 | #define MCU_ADDRESS1_LENGTH 2 |
| 116 | 116 | #define MCU_ADDRESS2_LENGTH 2 |
| 117 | 117 | #define MCU_CONTROLS1_LENGTH 2 |
| 118 | 118 | #define MCU_MESSAGE_LENGTH 3 |
| 119 | 119 | #define MCU_CONTROLS2_LENGTH 3 |
| 120 | #define MCU_ID_LENGTH | |
| 120 | #define MCU_ID_LENGTH 0 | |
| 121 | 121 | |
| 122 | #define SET_COMMAND(n) daikaiju_command=data; \ | |
| 123 | daikaiju_length=n;\ | |
| 124 | daikaiju_cnt=0;\ | |
| 125 | daikaiju_cntr=0; | |
| 122 | #define SET_COMMAND(n) state->daikaiju_command = data; \ | |
| 123 | state->daikaiju_length = n;\ | |
| 124 | state->daikaiju_cnt = 0;\ | |
| 125 | state->daikaiju_cntr = 0; | |
| 126 | 126 | |
| 127 | 127 | |
| 128 | static int daikaiju_xor, daikaiju_command, daikaiju_length, daikaiju_prev, daikaiju_cnt, daikaiju_cntr; | |
| 129 | ||
| 130 | static int daikaiju_buffer[256]; | |
| 131 | ||
| 132 | 128 | static const int xortable[]= |
| 133 | 129 | { |
| 134 | 130 | 0xF5, 0xD5, 0x6A, 0x26, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x16, 0x00, 0xCB, 0x23, 0x19, |
| 135 | 131 | 0x11, 0x00, 0xC0, 0x19, 0xD1, 0xF1, 0xC9, -1 |
| 136 | 132 | }; |
| 137 | 133 | |
| 138 | MACHINE_RESET(daikaiju) | |
| 139 | { | |
| 140 | daikaiju_xor=-1; | |
| 141 | daikaiju_command=0; | |
| 142 | daikaiju_length=0; | |
| 143 | } | |
| 144 | ||
| 145 | 134 | WRITE8_HANDLER( daikaiju_mcu_w ) |
| 146 | 135 | { |
| 147 | if(daikaiju_xor <0) | |
| 136 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 137 | ||
| 138 | if (state->daikaiju_xor < 0) | |
| 148 | 139 | { |
| 149 | 140 | //reset |
| 150 | daikaiju_xor=0; | |
| 151 | data^=0xc3; | |
| 141 | state->daikaiju_xor = 0; | |
| 142 | data ^= 0xc3; | |
| 152 | 143 | } |
| 153 | 144 | else |
| 154 | 145 | { |
| 155 | data^=xortable[daikaiju_xor]; | |
| 146 | data ^= xortable[state->daikaiju_xor]; | |
| 156 | 147 | //check for end of table |
| 157 | if(xortable[++daikaiju_xor]<0) | |
| 148 | if (xortable[++state->daikaiju_xor] < 0) | |
| 158 | 149 | { |
| 159 | daikaiju_xor=0; | |
| 150 | state->daikaiju_xor = 0; | |
| 160 | 151 | } |
| 161 | 152 | } |
| 162 | daikaiju_prev=data; | |
| 153 | state->daikaiju_prev = data; | |
| 163 | 154 | |
| 164 | if(daikaiju_length == 0) //new command | |
| 155 | if (state->daikaiju_length == 0) //new command | |
| 165 | 156 | { |
| 166 | 157 | switch(data) |
| 167 | 158 | { |
| r7500 | r7501 | |
| 172 | 163 | case MCU_CONTROLS1: SET_COMMAND(MCU_CONTROLS1_LENGTH); break; |
| 173 | 164 | case MCU_MESSAGE: SET_COMMAND(MCU_MESSAGE_LENGTH); break; |
| 174 | 165 | case MCU_CONTROLS2: SET_COMMAND(MCU_CONTROLS2_LENGTH); break; |
| 175 | case MCU_ID: | |
| 166 | case MCU_ID: | |
| 176 | 167 | default: |
| 177 | daikaiju_command=data; | |
| 168 | state->daikaiju_command = data; | |
| 178 | 169 | logerror("Unknown MCU command W %x %x \n",data,cpu_get_pc(space->cpu)); |
| 179 | 170 | } |
| 180 | 171 | } |
| 181 | 172 | else |
| 182 | 173 | { |
| 183 | --daikaiju_length; | |
| 184 | daikaiju_buffer[daikaiju_cnt++]=data; | |
| 174 | --state->daikaiju_length; | |
| 175 | state->daikaiju_buffer[state->daikaiju_cnt++] = data; | |
| 185 | 176 | } |
| 186 | 177 | } |
| 187 | 178 | |
| 188 | 179 | READ8_HANDLER( daikaiju_mcu_r ) |
| 189 | 180 | { |
| 190 | switch(daikaiju_command) | |
| 181 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 182 | ||
| 183 | switch (state->daikaiju_command) | |
| 191 | 184 | { |
| 192 | 185 | case MCU_ID: |
| 193 | 186 | return ID_DAIKAIJU; |
| r7500 | r7501 | |
| 195 | 188 | case MCU_CONTROLS1: |
| 196 | 189 | { |
| 197 | 190 | int n; |
| 198 | switch | |
| 191 | switch | |
| 199 | 192 | { |
| 200 | case 0x00: n = (daikaiju_buffer[1]&(~8))&0xf; break; | |
| 193 | case 0x00: n = (state->daikaiju_buffer[1] & (~8)) & 0xf; break; | |
| 201 | 194 | case 0x08: n = 0 | 8; break; |
| 202 | 195 | case 0x0a: n = 1 | 8; break; |
| 203 | 196 | case 0x02: n = 2 | 8; break; |
| r7500 | r7501 | |
| 210 | 203 | default: n = 0; break; |
| 211 | 204 | } |
| 212 | 205 | |
| 213 | if | |
| 206 | if | |
| 214 | 207 | { |
| 215 | if(daikaiju_buffer[1]&0x10) //previous status | |
| 208 | if (state->daikaiju_buffer[1] & 0x10) //previous status | |
| 216 | 209 | { |
| 217 | n|=0x40; // button 0->1 | |
| 210 | n |= 0x40; // button 0->1 | |
| 218 | 211 | } |
| 219 | 212 | else |
| 220 | 213 | { |
| 221 | n|=0; //button 1->1 | |
| 214 | n |= 0; //button 1->1 | |
| 222 | 215 | } |
| 223 | 216 | } |
| 224 | 217 | else |
| 225 | 218 | { |
| 226 | if(daikaiju_buffer[1]&0x10) //previous status | |
| 219 | if (state->daikaiju_buffer[1] & 0x10) //previous status | |
| 227 | 220 | { |
| 228 | n|=0x40+0x10; // button 0->0 | |
| 221 | n |= 0x40 + 0x10; // button 0->0 | |
| 229 | 222 | } |
| 230 | 223 | else |
| 231 | 224 | { |
| 232 | n|=0x10; //button 1->0 | |
| 225 | n |= 0x10; //button 1->0 | |
| 233 | 226 | } |
| 234 | 227 | } |
| 235 | 228 | |
| 236 | if | |
| 229 | if | |
| 237 | 230 | { |
| 238 | if(daikaiju_buffer[1]&0x20) //previous status | |
| 231 | if (state->daikaiju_buffer[1] & 0x20) //previous status | |
| 239 | 232 | { |
| 240 | n|=0x80; // button 0->1 | |
| 233 | n |= 0x80; // button 0->1 | |
| 241 | 234 | } |
| 242 | 235 | else |
| 243 | 236 | { |
| 244 | n|=0; //button 1->1 | |
| 237 | n |= 0; //button 1->1 | |
| 245 | 238 | } |
| 246 | 239 | } |
| 247 | 240 | else |
| 248 | 241 | { |
| 249 | if(daikaiju_buffer[1]&0x20) //previous status | |
| 242 | if (state->daikaiju_buffer[1] & 0x20) //previous status | |
| 250 | 243 | { |
| 251 | n|=0x80+0x20; // button 0->0 | |
| 244 | n |= 0x80 + 0x20; // button 0->0 | |
| 252 | 245 | } |
| 253 | 246 | else |
| 254 | 247 | { |
| 255 | n|=0x20; //button 1->0 | |
| 248 | n |= 0x20; //button 1->0 | |
| 256 | 249 | } |
| 257 | 250 | } |
| 258 | 251 | return n; |
| r7500 | r7501 | |
| 260 | 253 | |
| 261 | 254 | case MCU_ADDRESS1: |
| 262 | 255 | { |
| 263 | int address=daikaiju_buffer[1]*2+64*daikaiju_buffer[0]; | |
| 256 | int address = state->daikaiju_buffer[1] * 2 + 64 * state->daikaiju_buffer[0]; | |
| 264 | 257 | |
| 265 | address&=0x0fff; // ? | |
| 266 | address+=0xd000; | |
| 258 | address &= 0x0fff; // ? | |
| 259 | address += 0xd000; | |
| 267 | 260 | |
| 268 | if(daikaiju_cntr==0) | |
| 261 | if (state->daikaiju_cntr == 0) | |
| 269 | 262 | { |
| 270 | daikaiju_cntr++; | |
| 271 | return address&0xff; | |
| 263 | state->daikaiju_cntr++; | |
| 264 | return address & 0xff; | |
| 272 | 265 | } |
| 273 | 266 | else |
| 274 | 267 | { |
| 275 | return address>>8; | |
| 268 | return address >> 8; | |
| 276 | 269 | } |
| 277 | 270 | } |
| 278 | 271 | |
| 279 | 272 | case MCU_ADDRESS2: |
| 280 | 273 | { |
| 281 | int address=daikaiju_buffer[1]*2+64*daikaiju_buffer[0]; | |
| 274 | int address = state->daikaiju_buffer[1] * 2 + 64 * state->daikaiju_buffer[0]; | |
| 282 | 275 | |
| 283 | address&=0x1fff; // ? | |
| 284 | address+=0xc000; | |
| 276 | address &= 0x1fff; // ? | |
| 277 | address += 0xc000; | |
| 285 | 278 | |
| 286 | if(daikaiju_cntr==0) | |
| 279 | if (state->daikaiju_cntr == 0) | |
| 287 | 280 | { |
| 288 | daikaiju_cntr++; | |
| 289 | return address&0xff; | |
| 281 | state->daikaiju_cntr++; | |
| 282 | return address & 0xff; | |
| 290 | 283 | } |
| 291 | 284 | else |
| 292 | 285 | { |
| 293 | return address>>8; | |
| 286 | return address >> 8; | |
| 294 | 287 | } |
| 295 | 288 | } |
| 296 | 289 | |
| 297 | 290 | case MCU_MESSAGE: |
| 298 | return daikaiju_buffer[1]; | |
| 291 | return state->daikaiju_buffer[1]; | |
| 299 | 292 | |
| 300 | 293 | case MCU_CONTROLS2: |
| 301 | 294 | { |
| 302 | 295 | int n; |
| 303 | int dest=(daikaiju_buffer[0]&0x7)<<1; | |
| 304 | int prev=(daikaiju_buffer[1]&0xf); | |
| 296 | int dest = (state->daikaiju_buffer[0] & 0x7) << 1; | |
| 297 | int prev = (state->daikaiju_buffer[1] & 0xf); | |
| 305 | 298 | |
| 306 | if(daikaiju_buffer[2]==2) | |
| 299 | if (state->daikaiju_buffer[2] == 2) | |
| 307 | 300 | { |
| 308 | prev&=0xfe; | |
| 301 | prev &= 0xfe; | |
| 309 | 302 | } |
| 310 | if(prev!=dest) | |
| 303 | ||
| 304 | if (prev != dest) | |
| 311 | 305 | { |
| 312 | int diff=(dest-prev); | |
| 306 | int diff = (dest - prev); | |
| 313 | 307 | |
| 314 | if((diff> | |
| 308 | if ((diff > | |
| 315 | 309 | { |
| 316 | n=(prev-daikaiju_buffer[2])&0xf; | |
| 310 | n = (prev - state->daikaiju_buffer[2]) & 0xf; | |
| 317 | 311 | } |
| 318 | 312 | else |
| 319 | 313 | { |
| 320 | n=(prev+daikaiju_buffer[2])&0xf; | |
| 314 | n = (prev + state->daikaiju_buffer[2]) & 0xf; | |
| 321 | 315 | } |
| 322 | 316 | } |
| 323 | 317 | else |
| 324 | 318 | { |
| 325 | n=prev; | |
| 319 | n = prev; | |
| 326 | 320 | } |
| 327 | prev&=0xf; | |
| 328 | if(prev!=n) | |
| 321 | prev &= 0xf; | |
| 322 | ||
| 323 | if (prev != n) | |
| 329 | 324 | { |
| 330 | n|=0x10; | |
| 325 | n |= 0x10; | |
| 331 | 326 | } |
| 332 | 327 | return n; |
| 333 | 328 | } |
| 334 | 329 | } |
| 335 | logerror("Unknown MCU R %x %x %x %x\n",cpu_get_pc(space->cpu), daikaiju_command, daikaiju_length, daikaiju_prev); | |
| 330 | logerror("Unknown MCU R %x %x %x %x\n", cpu_get_pc(space->cpu), state->daikaiju_command, state->daikaiju_length, state->daikaiju_prev); | |
| 336 | 331 | return 0xff; |
| 337 | 332 | } |
| 338 | 333 | |
| 339 | 334 | READ8_HANDLER( daikaiju_mcu_status_r ) |
| 340 | 335 | { |
| 336 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 341 | 337 | int res = input_port_read(space->machine, "MCU?"); |
| 342 | 338 | |
| 343 | res^=mame_rand(space->machine)&3; | |
| 344 | res |=((lsasquad_sound_pending & 0x02)^2)<<3; //inverted flag | |
| 345 | lsasquad_sound_pending &= ~0x02; | |
| 339 | res ^= mame_rand(space->machine) & 3; | |
| 340 | res |= ((state->sound_pending & 0x02) ^ 2) << 3; //inverted flag | |
| 341 | state->sound_pending &= ~0x02; | |
| 346 | 342 | return res; |
| 347 | 343 | } |
| 348 |
| r7500 | r7501 | |
|---|---|---|
| 188 | 188 | devcb_resolve_read8(&state->in[2], &config->in[2], device); |
| 189 | 189 | devcb_resolve_read8(&state->in[3], &config->in[3], device); |
| 190 | 190 | devcb_resolve_write8(&state->p, &config->p, device); |
| 191 | ||
| 192 | state_save_register_device_item(device, 0, state->portO); | |
| 191 | 193 | } |
| 192 | 194 | |
| 193 | 195 |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | #include "deprecat.h" |
| 3 | 3 | #include "includes/mexico86.h" |
| 4 | 4 | |
| 5 | ||
| 6 | UINT8 *mexico86_protection_ram; | |
| 7 | ||
| 8 | ||
| 9 | static int kikikai_mcu_running, kikikai_mcu_initialised; | |
| 10 | ||
| 11 | ||
| 12 | 5 | /* |
| 13 | 6 | $f008 - write |
| 14 | 7 | bit 7 = ? (unused?) |
| r7500 | r7501 | |
| 22 | 15 | */ |
| 23 | 16 | WRITE8_HANDLER( mexico86_f008_w ) |
| 24 | 17 | { |
| 25 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 26 | if (devtag_get_device(space->machine, "mcu") != NULL) | |
| 18 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 19 | ||
| 20 | cpu_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 21 | ||
| 22 | if (state->mcu != NULL) | |
| 27 | 23 | { |
| 28 | 24 | // mexico 86, knight boy |
| 29 | cpu | |
| 25 | cpu | |
| 30 | 26 | } |
| 31 | 27 | else |
| 32 | 28 | { |
| 33 | 29 | // simulation for KiKi KaiKai |
| 34 | kikikai_mcu_running = data & 2; | |
| 35 | if (!kikikai_mcu_running) | |
| 36 | kikikai_mcu_initialised = 0; | |
| 30 | state->mcu_running = data & 2; | |
| 31 | ||
| 32 | if (!state->mcu_running) | |
| 33 | state->mcu_initialised = 0; | |
| 37 | 34 | } |
| 38 | 35 | } |
| 39 | 36 | |
| r7500 | r7501 | |
| 47 | 44 | |
| 48 | 45 | ***************************************************************************/ |
| 49 | 46 | |
| 50 | static void mcu_simulate(running_machine *machine) | |
| 47 | static void mcu_simulate( running_machine *machine ) | |
| 51 | 48 | { |
| 52 | if (!kikikai_mcu_initialised) | |
| 49 | mexico86_state *state = (mexico86_state *)machine->driver_data; | |
| 50 | ||
| 51 | if (!state->mcu_initialised) | |
| 53 | 52 | { |
| 54 | if ( | |
| 53 | if (state-> | |
| 55 | 54 | { |
| 56 | logerror("initialising MCU\n"); | |
| 57 | mexico86_protection_ram[0x04] = 0xfc; // coin inputs | |
| 58 | mexico86_protection_ram[0x02] = 0xff; // player 1 | |
| 59 | mexico86_protection_ram[0x03] = 0xff; // player 2 | |
| 60 | mexico86_protection_ram[0x1b] = 0xff; // active player | |
| 61 | mexico86_protection_ram[0x06] = 0xff; // must be FF otherwise PS4 ERROR | |
| 62 | mexico86_protection_ram[0x07] = 0x03; // must be 03 otherwise PS4 ERROR | |
| 63 | mexico86_protection_ram[0x00] = 0x00; | |
| 64 | kikikai_mcu_initialised = 1; | |
| 55 | logerror("initialising MCU\n"); | |
| 56 | state->protection_ram[0x04] = 0xfc; // coin inputs | |
| 57 | state->protection_ram[0x02] = 0xff; // player 1 | |
| 58 | state->protection_ram[0x03] = 0xff; // player 2 | |
| 59 | state->protection_ram[0x1b] = 0xff; // active player | |
| 60 | state->protection_ram[0x06] = 0xff; // must be FF otherwise PS4 ERROR | |
| 61 | state->protection_ram[0x07] = 0x03; // must be 03 otherwise PS4 ERROR | |
| 62 | state->protection_ram[0x00] = 0x00; | |
| 63 | state->mcu_initialised = 1; | |
| 65 | 64 | } |
| 66 | 65 | } |
| 67 | 66 | |
| 68 | if ( | |
| 67 | if (st | |
| 69 | 68 | { |
| 70 | 69 | int i; |
| 71 | static int coin_last; | |
| 72 | 70 | int coin_curr; |
| 73 | 71 | |
| 74 | ||
| 75 | 72 | coin_curr = ~input_port_read(machine, "IN0") & 1; |
| 76 | if (coin_curr && !coin_last && | |
| 73 | if (coin_curr && !state->coin_last && state-> | |
| 77 | 74 | { |
| 78 | mexico86_protection_ram[0x01]++; // increase credits counter | |
| 79 | mexico86_protection_ram[0x0a] = 0x01; // set flag (coin inserted sound is not played otherwise) | |
| 75 | state->protection_ram[0x01]++; // increase credits counter | |
| 76 | state->protection_ram[0x0a] = 0x01; // set flag (coin inserted sound is not played otherwise) | |
| 80 | 77 | } |
| 81 | coin_last = coin_curr; | |
| 78 | state->coin_last = coin_curr; | |
| 82 | 79 | |
| 83 | | |
| 80 | state-> | |
| 84 | 81 | |
| 85 | mexico86_protection_ram[0x02] = BITSWAP8(input_port_read(machine, "IN1"), 7,6,5,4,2,3,1,0); // player 1 | |
| 86 | mexico86_protection_ram[0x03] = BITSWAP8(input_port_read(machine, "IN2"), 7,6,5,4,2,3,1,0); // player 2 | |
| 82 | state->protection_ram[0x02] = BITSWAP8(input_port_read(machine, "IN1"), 7,6,5,4,2,3,1,0); // player 1 | |
| 83 | state->protection_ram[0x03] = BITSWAP8(input_port_read(machine, "IN2"), 7,6,5,4,2,3,1,0); // player 2 | |
| 87 | 84 | |
| 88 | if (mexico86_protection_ram[0x19] == 0xaa) // player 2 active | |
| 89 | mexico86_protection_ram[0x1b] = mexico86_protection_ram[0x03]; | |
| 85 | if (state->protection_ram[0x19] == 0xaa) // player 2 active | |
| 86 | state->protection_ram[0x1b] = state->protection_ram[0x03]; | |
| 90 | 87 | else |
| 91 | | |
| 88 | state-> | |
| 92 | 89 | |
| 93 | 90 | |
| 94 | 91 | for (i = 0; i < 0x10; i += 2) |
| 95 | | |
| 92 | state-> | |
| 96 | 93 | |
| 97 | 94 | for (i = 0; i < 0x0a; i++) |
| 98 | | |
| 95 | state-> | |
| 99 | 96 | |
| 100 | if ( | |
| 97 | if (state-> | |
| 101 | 98 | { |
| 102 | if ( | |
| 99 | if (state-> | |
| 103 | 100 | { |
| 104 | mexico86_protection_ram[0xd2] = 0x81; | |
| 105 | mexico86_protection_ram[0xd0] = 0xff; | |
| 101 | state->protection_ram[0xd2] = 0x81; | |
| 102 | state->protection_ram[0xd0] = 0xff; | |
| 106 | 103 | } |
| 107 | 104 | } |
| 108 | 105 | |
| 109 | ||
| 110 | if (mexico86_protection_ram[0xe0] > 0 && mexico86_protection_ram[0xe0] < 4) | |
| 106 | if (state->protection_ram[0xe0] > 0 && state->protection_ram[0xe0] < 4) | |
| 111 | 107 | { |
| 112 | 108 | static const UINT8 answers[3][16] = |
| 113 | 109 | { |
| r7500 | r7501 | |
| 115 | 111 | { 0x00,0x04,0x08,0x0C,0x10,0x14,0x18,0x1C,0x20,0x31,0x2B,0x35,0x00,0x00,0x00,0x00 }, |
| 116 | 112 | { 0x00,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x03,0x0A,0x0B,0x14,0x00,0x00,0x00,0x00 }, |
| 117 | 113 | }; |
| 118 | int table = | |
| 114 | int table = state-> | |
| 119 | 115 | |
| 120 | 116 | for (i = 1; i < 0x10; i++) |
| 121 | mexico86_protection_ram[0xe0 + i] = answers[table][i]; | |
| 122 | mexico86_protection_ram[0xe0] = 0xff; | |
| 117 | state->protection_ram[0xe0 + i] = answers[table][i]; | |
| 118 | state->protection_ram[0xe0] = 0xff; | |
| 123 | 119 | } |
| 124 | 120 | |
| 125 | if ( | |
| 121 | if (state-> | |
| 126 | 122 | { |
| 127 | mexico86_protection_ram[0xf1] = 0xb3; | |
| 128 | mexico86_protection_ram[0xf0] = 0xff; | |
| 123 | state->protection_ram[0xf1] = 0xb3; | |
| 124 | state->protection_ram[0xf0] = 0xff; | |
| 129 | 125 | } |
| 130 | 126 | |
| 131 | 127 | |
| r7500 | r7501 | |
| 133 | 129 | // this should be equivalent to the obfuscated kiki_clogic() below |
| 134 | 130 | { |
| 135 | 131 | static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; |
| 136 | UINT16 sy = mexico86_protection_ram[0xa0] + ((0x18)>>1); | |
| 137 | UINT16 sx = mexico86_protection_ram[0xa1] + ((0x18)>>1); | |
| 132 | UINT16 sy = state->protection_ram[0xa0] + ((0x18) >> 1); | |
| 133 | UINT16 sx = state->protection_ram[0xa1] + ((0x18) >> 1); | |
| 138 | 134 | |
| 139 | 135 | for (i = 0; i < 0x38; i += 8) |
| 140 | 136 | { |
| 141 | UINT8 hw = db[ | |
| 137 | UINT8 hw = db[state-> | |
| 142 | 138 | |
| 143 | 139 | if (hw) |
| 144 | 140 | { |
| 145 | UINT16 xdiff = sx - ((UINT16) | |
| 141 | UINT16 xdiff = sx - ((UINT16)state-> | |
| 146 | 142 | if (xdiff < hw) |
| 147 | 143 | { |
| 148 | UINT16 ydiff = sy - ((UINT16) | |
| 144 | UINT16 ydiff = sy - ((UINT16)state-> | |
| 149 | 145 | if (ydiff < hw) |
| 150 | | |
| 146 | state-> | |
| 151 | 147 | } |
| 152 | 148 | } |
| 153 | 149 | } |
| r7500 | r7501 | |
| 158 | 154 | |
| 159 | 155 | INTERRUPT_GEN( kikikai_interrupt ) |
| 160 | 156 | { |
| 161 | if (kikikai_mcu_running) | |
| 157 | mexico86_state *state = (mexico86_state *)device->machine->driver_data; | |
| 158 | ||
| 159 | if (state->mcu_running) | |
| 162 | 160 | mcu_simulate(device->machine); |
| 163 | 161 | |
| 164 | cpu_set_input_line_vector(device,0,mexico86_protection_ram[0]); | |
| 165 | cpu_set_input_line(device,0,HOLD_LINE); | |
| 162 | cpu_set_input_line_vector(device, 0, state->protection_ram[0]); | |
| 163 | cpu_set_input_line(device, 0, HOLD_LINE); | |
| 166 | 164 | } |
| 167 | 165 | |
| 168 | 166 | |
| r7500 | r7501 | |
| 179 | 177 | #define DCWIDTH 0 |
| 180 | 178 | #define DCHEIGHT 0 |
| 181 | 179 | |
| 182 | static void kiki_clogic(int address, int latch) | |
| 180 | static void kiki_clogic(running_machine *machine, int address, int latch) | |
| 183 | 181 | { |
| 182 | mexico86_state *state = (mexico86_state *)machine->driver_data; | |
| 184 | 183 | static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; |
| 185 | 184 | static UINT8 queue[64]; |
| 186 | 185 | static int qfront = 0, state = 0; |
| r7500 | r7501 | |
| 208 | 207 | diff1 = sy - (short)(queue[(qptr+4)&0x3f]<<8|queue[(qptr+5)&0x3f]) + DCHEIGHT; |
| 209 | 208 | diff2 = diff1 - (hw + DCHEIGHT); |
| 210 | 209 | if ((diff1^diff2)<0) |
| 211 | | |
| 210 | state-> | |
| 212 | 211 | } |
| 213 | 212 | } |
| 214 | 213 | } |
| r7500 | r7501 | |
| 229 | 228 | { |
| 230 | 229 | /* I don't know how to handle the interrupt line so I just toggle it every time. */ |
| 231 | 230 | if (cpu_getiloops(device) & 1) |
| 232 | cpu_set_input_line(device,0,CLEAR_LINE); | |
| 231 | cpu_set_input_line(device, 0, CLEAR_LINE); | |
| 233 | 232 | else |
| 234 | cpu_set_input_line(device,0,ASSERT_LINE); | |
| 233 | cpu_set_input_line(device, 0, ASSERT_LINE); | |
| 235 | 234 | } |
| 236 | 235 | |
| 237 | 236 | |
| 237 | READ8_HANDLER( mexico86_68705_port_a_r ) | |
| 238 | { | |
| 239 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 238 | 240 | |
| 239 | static UINT8 portA_in,portA_out,ddrA; | |
| 241 | //logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in); | |
| 242 | return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a); | |
| 243 | } | |
| 240 | 244 | |
| 241 | RE | |
| 245 | WRITE | |
| 242 | 246 | { |
| 243 | //logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),portA_in); | |
| 244 | return (portA_out & ddrA) | (portA_in & ~ddrA); | |
| 245 | } | |
| 247 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 246 | 248 | |
| 247 | WRITE8_HANDLER( mexico86_68705_portA_w ) | |
| 248 | { | |
| 249 | //logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data); | |
| 250 | portA_out = data; | |
| 249 | //logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data); | |
| 250 | state->port_a_out = data; | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | WRITE8_HANDLER( mexico86_68705_ddr | |
| 253 | WRITE8_HANDLER( mexico86_68705_ddr_a_w ) | |
| 254 | 254 | { |
| 255 | ddrA = data; | |
| 255 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 256 | state->ddr_a = data; | |
| 256 | 257 | } |
| 257 | 258 | |
| 258 | 259 | |
| r7500 | r7501 | |
| 273 | 274 | * 7 W not used? |
| 274 | 275 | */ |
| 275 | 276 | |
| 276 | static UINT8 portB_in,portB_out,ddrB; | |
| 277 | ||
| 278 | READ8_HANDLER( mexico86_68705_portB_r ) | |
| 277 | READ8_HANDLER( mexico86_68705_port_b_r ) | |
| 279 | 278 | { |
| 280 | return (portB_out & ddrB) | (portB_in & ~ddrB); | |
| 279 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 280 | return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | static int address,latch; | |
| 284 | ||
| 285 | WRITE8_HANDLER( mexico86_68705_portB_w ) | |
| 283 | WRITE8_HANDLER( mexico86_68705_port_b_w ) | |
| 286 | 284 | { |
| 287 | //logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(space->cpu),data); | |
| 285 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 286 | //logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data); | |
| 288 | 287 | |
| 289 | if ((ddr | |
| 288 | if (BIT(state->ddr_b, | |
| 290 | 289 | { |
| 291 | port | |
| 290 | state->port | |
| 292 | 291 | } |
| 293 | if ((ddrB & 0x02) && (data & 0x02) && (~portB_out & 0x02)) /* positive edge trigger */ | |
| 292 | ||
| 293 | if (BIT(state->ddr_b, 1) && BIT(data, 1) && BIT(~state->port_b_out, 1)) /* positive edge trigger */ | |
| 294 | 294 | { |
| 295 | address = portA_out; | |
| 296 | //if (address >= 0x80) logerror("%04x: 68705 address %02x\n",cpu_get_pc(space->cpu),portA_out); | |
| 295 | state->address = state->port_a_out; | |
| 296 | //if (state->address >= 0x80) logerror("%04x: 68705 address %02x\n", cpu_get_pc(space->cpu), state->port_a_out); | |
| 297 | 297 | } |
| 298 | if ((ddrB & 0x08) && (~data & 0x08) && (portB_out & 0x08)) | |
| 298 | ||
| 299 | if (BIT(state->ddr_b, 3) && BIT(~data, 3) && BIT(state->port_b_out, 3)) | |
| 299 | 300 | { |
| 300 | 301 | if (data & 0x10) /* read */ |
| 301 | 302 | { |
| 302 | 303 | if (data & 0x04) |
| 303 | 304 | { |
| 304 | //logerror("%04x: 68705 read %02x from address %04x\n",cpu_get_pc(space->cpu),shared[0x800+address],address); | |
| 305 | latch = mexico86_protection_ram[address]; | |
| 305 | //logerror("%04x: 68705 read %02x from address %04x\n", cpu_get_pc(space->cpu), state->protection_ram[state->address], state->address); | |
| 306 | state->latch = state->protection_ram[state->address]; | |
| 306 | 307 | } |
| 307 | 308 | else |
| 308 | 309 | { |
| 309 | //logerror("%04x: 68705 read input port %04x\n",cpu_get_pc(space->cpu),address); | |
| 310 | latch = input_port_read(space->machine, (address & 1) ? "IN2" : "IN1"); | |
| 310 | //logerror("%04x: 68705 read input port %04x\n", cpu_get_pc(space->cpu), state->address); | |
| 311 | state->latch = input_port_read(space->machine, (state->address & 1) ? "IN2" : "IN1"); | |
| 311 | 312 | } |
| 312 | 313 | } |
| 313 | 314 | else /* write */ |
| 314 | 315 | { |
| 315 | //logerror("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(space->cpu),portA_out,address); | |
| 316 | mexico86_protection_ram[address] = portA_out; | |
| 316 | //logerror("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(space->cpu), port_a_out, state->address); | |
| 317 | state->protection_ram[state->address] = state->port_a_out; | |
| 317 | 318 | } |
| 318 | 319 | } |
| 319 | if ((ddrB & 0x20) && (data & 0x20) && (~portB_out & 0x20)) | |
| 320 | ||
| 321 | if (BIT(state->ddr_b, 5) && BIT(data, 5) && BIT(~state->port_b_out, 5)) | |
| 320 | 322 | { |
| 321 | cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, mexico86_protection_ram[0]); | |
| 322 | cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1. | |
| 323 | cpu_set_input_line_vector(state->maincpu, 0, state->protection_ram[0]); | |
| 324 | cpu_set_input_line(state->maincpu, 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1. | |
| 323 | 325 | } |
| 324 | if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) | |
| 326 | ||
| 327 | if (BIT(state->ddr_b, 6) && BIT(~data, 6) && BIT(state->port_b_out, 6)) | |
| 325 | 328 | { |
| 326 | logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(space->cpu),data); | |
| 329 | logerror("%04x: 68705 unknown port B bit %02x\n", cpu_get_pc(space->cpu), data); | |
| 327 | 330 | } |
| 328 | if ((ddrB & 0x80) && (~data & 0x80) && (portB_out & 0x80)) | |
| 331 | ||
| 332 | if (BIT(state->ddr_b, 7) && BIT(~data, 7) && BIT(state->port_b_out, 7)) | |
| 329 | 333 | { |
| 330 | logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(space->cpu),data); | |
| 334 | logerror("%04x: 68705 unknown port B bit %02x\n", cpu_get_pc(space->cpu), data); | |
| 331 | 335 | } |
| 332 | 336 | |
| 333 | port | |
| 337 | state->port_b_out = data; | |
| 334 | 338 | } |
| 335 | 339 | |
| 336 | WRITE8_HANDLER( mexico86_68705_ddr | |
| 340 | WRITE8_HANDLER( mexico86_68705_ddr_b_w ) | |
| 337 | 341 | { |
| 338 | ddrB = data; | |
| 342 | mexico86_state *state = (mexico86_state *)space->machine->driver_data; | |
| 343 | state->ddr_b = data; | |
| 339 | 344 | } |
| r7500 | r7501 | |
|---|---|---|
| 295 | 295 | timer_adjust_oneshot(snes_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, nextscan, 0), 0); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | /* FIXME: multiplication should take 8 CPU cycles & division 16 CPU cycles, but | |
| 299 | using these timers breaks e.g. Chrono Trigger intro and Super Tennis gameplay. | |
| 298 | /* FIXME: multiplication should take 8 CPU cycles & division 16 CPU cycles, but | |
| 299 | using these timers breaks e.g. Chrono Trigger intro and Super Tennis gameplay. | |
| 300 | 300 | On the other hand, timers are needed for the translation of Breath of Fire 2 |
| 301 | 301 | to work. More weirdness: we might need to leave 8 CPU cycles for division at |
| 302 | 302 | first, since using 16 produces bugs (see e.g. Triforce pieces in Zelda 3 intro) */ |
| r7500 | r7501 | |
| 1329 | 1329 | break; |
| 1330 | 1330 | case WRMPYB: /* Multiplier B */ |
| 1331 | 1331 | snes_ram[WRMPYB] = data; |
| 1332 | // | |
| 1332 | // timer_adjust_oneshot(snes_mult_timer, cputag_clocks_to_attotime(space->machine, "maincpu", 8), 0); | |
| 1333 | 1333 | { |
| 1334 | 1334 | UINT32 c = snes_ram[WRMPYA] * snes_ram[WRMPYB]; |
| 1335 | 1335 | snes_ram[RDMPYL] = c & 0xff; |
| r7500 | r7501 | |
| 1341 | 1341 | break; |
| 1342 | 1342 | case WRDVDD: /* Divisor */ |
| 1343 | 1343 | snes_ram[WRDVDD] = data; |
| 1344 | // | |
| 1344 | // timer_adjust_oneshot(snes_div_timer, cputag_clocks_to_attotime(space->machine, "maincpu", 16), 0); | |
| 1345 | 1345 | { |
| 1346 | 1346 | UINT16 value, dividend, remainder; |
| 1347 | 1347 | dividend = remainder = 0; |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #include "includes/lkage.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static UINT8 from_main,from_mcu; | |
| 15 | static int mcu_sent = 0,main_sent = 0; | |
| 16 | ||
| 17 | ||
| 18 | 14 | /*************************************************************************** |
| 19 | 15 | |
| 20 | 16 | Legend of Kage 68705 protection interface |
| r7500 | r7501 | |
| 24 | 20 | |
| 25 | 21 | ***************************************************************************/ |
| 26 | 22 | |
| 27 | static UINT8 portA_in,portA_out,ddrA; | |
| 23 | READ8_HANDLER( lkage_68705_port_a_r ) | |
| 24 | { | |
| 25 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 28 | 26 | |
| 29 | READ8_HANDLER( lkage_68705_portA_r ) | |
| 30 | { | |
| 31 | //logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),portA_in); | |
| 32 | return (portA_out & ddrA) | (portA_in & ~ddrA); | |
| 27 | //logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in); | |
| 28 | return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a); | |
| 33 | 29 | } |
| 34 | 30 | |
| 35 | WRITE8_HANDLER( lkage_68705_port | |
| 31 | WRITE8_HANDLER( lkage_68705_port_a_w ) | |
| 36 | 32 | { |
| 37 | //logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data); | |
| 38 | portA_out = data; | |
| 33 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 34 | ||
| 35 | //logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data); | |
| 36 | state->port_a_out = data; | |
| 39 | 37 | } |
| 40 | 38 | |
| 41 | WRITE8_HANDLER( lkage_68705_ddr | |
| 39 | WRITE8_HANDLER( lkage_68705_ddr_a_w ) | |
| 42 | 40 | { |
| 43 | ddrA = data; | |
| 41 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 42 | state->ddr_a = data; | |
| 44 | 43 | } |
| 45 | 44 | |
| 46 | 45 | |
| r7500 | r7501 | |
| 54 | 53 | * 2 W when 0->1, copies port A to the latch for the main CPU |
| 55 | 54 | */ |
| 56 | 55 | |
| 57 | static UINT8 portB_in,portB_out,ddrB; | |
| 58 | ||
| 59 | READ8_HANDLER( lkage_68705_portB_r ) | |
| 56 | READ8_HANDLER( lkage_68705_port_b_r ) | |
| 60 | 57 | { |
| 61 | return (portB_out & ddrB) | (portB_in & ~ddrB); | |
| 58 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 59 | return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b); | |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | WRITE8_HANDLER( lkage_68705_port | |
| 62 | WRITE8_HANDLER( lkage_68705_port_b_w ) | |
| 65 | 63 | { |
| 66 | ||
| 64 | | |
| 67 | 65 | |
| 68 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) | |
| 66 | //logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data); | |
| 67 | ||
| 68 | if ((state->ddr_b & 0x02) && (~data & 0x02) && (state->port_b_out & 0x02)) | |
| 69 | 69 | { |
| 70 | portA_in = from_main; | |
| 71 | if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); | |
| 72 | main_sent = 0; | |
| 73 | logerror("read command %02x from main cpu\n",portA_in); | |
| 70 | state->port_a_in = state->from_main; | |
| 71 | if (state->main_sent) | |
| 72 | cpu_set_input_line(state->mcu, 0, CLEAR_LINE); | |
| 73 | ||
| 74 | state->main_sent = 0; | |
| 75 | logerror("read command %02x from main cpu\n", state->port_a_in); | |
| 74 | 76 | } |
| 75 | if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) | |
| 77 | ||
| 78 | if ((state->ddr_b & 0x04) && (data & 0x04) && (~state->port_b_out & 0x04)) | |
| 76 | 79 | { |
| 77 | logerror("send command %02x to main cpu\n",portA_out); | |
| 78 | from_mcu = portA_out; | |
| 79 | mcu_sent = 1; | |
| 80 | logerror("send command %02x to main cpu\n", state->port_a_out); | |
| 81 | state->from_mcu = state->port_a_out; | |
| 82 | state->mcu_sent = 1; | |
| 80 | 83 | } |
| 81 | 84 | |
| 82 | port | |
| 85 | state->port_b_out = data; | |
| 83 | 86 | } |
| 84 | 87 | |
| 85 | WRITE8_HANDLER( lkage_68705_ddr | |
| 88 | WRITE8_HANDLER( lkage_68705_ddr_b_w ) | |
| 86 | 89 | { |
| 87 | ddrB = data; | |
| 90 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 91 | state->ddr_b = data; | |
| 88 | 92 | } |
| 89 | 93 | |
| 90 | 94 | |
| 91 | static UINT8 portC_in,portC_out,ddrC; | |
| 92 | 95 | |
| 93 | READ8_HANDLER( lkage_68705_port | |
| 96 | READ8_HANDLER( lkage_68705_port_c_r ) | |
| 94 | 97 | { |
| 95 | portC_in = 0; | |
| 96 | if (main_sent) portC_in |= 0x01; | |
| 97 | if (!mcu_sent) portC_in |= 0x02; | |
| 98 | //logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(space->cpu),portC_in); | |
| 99 | return (portC_out & ddrC) | (portC_in & ~ddrC); | |
| 98 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 99 | ||
| 100 | state->port_c_in = 0; | |
| 101 | if (state->main_sent) | |
| 102 | state->port_c_in |= 0x01; | |
| 103 | if (!state->mcu_sent) | |
| 104 | state->port_c_in |= 0x02; | |
| 105 | ||
| 106 | //logerror("%04x: 68705 port C read %02x\n", cpu_get_pc(space->cpu), state->port_c_in); | |
| 107 | return (state->port_c_out & state->ddr_c) | (state->port_c_in & ~state->ddr_c); | |
| 100 | 108 | } |
| 101 | 109 | |
| 102 | WRITE8_HANDLER( lkage_68705_port | |
| 110 | WRITE8_HANDLER( lkage_68705_port_c_w ) | |
| 103 | 111 | { |
| 104 | logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(space->cpu),data); | |
| 105 | portC_out = data; | |
| 112 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 113 | ||
| 114 | logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data); | |
| 115 | state->port_c_out = data; | |
| 106 | 116 | } |
| 107 | 117 | |
| 108 | WRITE8_HANDLER( lkage_68705_ddr | |
| 118 | WRITE8_HANDLER( lkage_68705_ddr_c_w ) | |
| 109 | 119 | { |
| 110 | ddrC = data; | |
| 120 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 121 | state->ddr_c = data; | |
| 111 | 122 | } |
| 112 | 123 | |
| 113 | 124 | |
| 114 | 125 | WRITE8_HANDLER( lkage_mcu_w ) |
| 115 | 126 | { |
| 116 | logerror("%04x: mcu_w %02x\n",cpu_get_pc(space->cpu),data); | |
| 117 | from_main = data; | |
| 118 | main_sent = 1; | |
| 119 | cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); | |
| 127 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 128 | ||
| 129 | logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data); | |
| 130 | state->from_main = data; | |
| 131 | state->main_sent = 1; | |
| 132 | cpu_set_input_line(state->mcu, 0, ASSERT_LINE); | |
| 120 | 133 | } |
| 121 | 134 | |
| 122 | 135 | READ8_HANDLER( lkage_mcu_r ) |
| 123 | 136 | { |
| 124 | logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu),from_mcu); | |
| 125 | mcu_sent = 0; | |
| 126 | return from_mcu; | |
| 137 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 138 | ||
| 139 | logerror("%04x: mcu_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu); | |
| 140 | state->mcu_sent = 0; | |
| 141 | return state->from_mcu; | |
| 127 | 142 | } |
| 128 | 143 | |
| 129 | 144 | READ8_HANDLER( lkage_mcu_status_r ) |
| 130 | 145 | { |
| 146 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 131 | 147 | int res = 0; |
| 132 | 148 | |
| 133 | 149 | /* bit 0 = when 1, mcu is ready to receive data from main cpu */ |
| 134 | 150 | /* bit 1 = when 1, mcu has sent data to the main cpu */ |
| 135 | //logerror("%04x: mcu_status_r\n",cpu_get_pc(space->cpu)); | |
| 136 | if (!main_sent) res |= 0x01; | |
| 137 | if (mcu_sent) res |= 0x02; | |
| 151 | //logerror("%04x: mcu_status_r\n", cpu_get_pc(space->cpu)); | |
| 152 | if (!state->main_sent) | |
| 153 | res |= 0x01; | |
| 154 | if (state->mcu_sent) | |
| 155 | res |= 0x02; | |
| 138 | 156 | |
| 139 | 157 | return res; |
| 140 | 158 | } |
| r7500 | r7501 | |
|---|---|---|
| 286 | 286 | /* find our CPU */ |
| 287 | 287 | state->cpu = device->subdevice("mcu"); |
| 288 | 288 | assert(state->cpu != NULL); |
| 289 | ||
| 290 | state_save_register_device_item(device, 0, state->latched_cmd); | |
| 291 | state_save_register_device_item(device, 0, state->latched_rw); | |
| 292 | state_save_register_device_item(device, 0, state->portO); | |
| 289 | 293 | } |
| 290 | 294 | |
| 291 | 295 |
| r7500 | r7501 | |
|---|---|---|
| 196 | 196 | { |
| 197 | 197 | const char *name; |
| 198 | 198 | int reverse_bytes; |
| 199 | int live_key; | |
| 199 | 200 | UINT32 transtbl[MAX_PROT_REGIONS*3]; |
| 200 | 201 | }; |
| 201 | 202 | |
| r7500 | r7501 | |
| 219 | 220 | |
| 220 | 221 | const UINT32 *prot_translate; |
| 221 | 222 | int prot_reverse_bytes; |
| 223 | ||
| 224 | // live decrypt vars | |
| 225 | UINT32 dc_gamekey, dc_seqkey, dc_seed; | |
| 226 | UINT8 dc_cart_ram[128*1024]; // internal cartridge RAM | |
| 227 | INT32 dc_m3_ptr, dc_m2_ptr, dc_readback; | |
| 228 | ||
| 222 | 229 | #if NAOMIBD_PRINTF_PROTECTION |
| 223 | 230 | int prot_pio_count; |
| 224 | 231 | #endif |
| r7500 | r7501 | |
| 229 | 236 | // if key is not -1, it's used for the match instead of the address written. |
| 230 | 237 | static const naomibd_config_table naomibd_translate_tbl[] = |
| 231 | 238 | { |
| 232 | { "doa2", 0, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, | |
| 239 | // games where on-the-fly decryption works (many of these are fully playable in MAME, just slow) | |
| 240 | { "18wheelr", 0, 0x7cf54, { 0x1502, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 241 | { "alpilota", 0, 0x70e41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 242 | { "alpiltdx", 0, 0x70e41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 243 | { "capsnk", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 244 | { "capsnka", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 245 | { "crzytaxi", 0, 0xd2f45, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 246 | { "csmash", 1, 0x03347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 247 | { "csmasho", 1, 0x03347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 248 | { "cspike", 0, 0xe2010, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 249 | { "deathcox", 0, 0xb64d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 250 | { "dybb99", 0, 0x48a01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 251 | { "f355twin", 0, 0x6efd4, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 252 | { "f355twn2", 0, 0x666c6, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 253 | { "ggram2", 0, 0x74a61, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 254 | { "gwing2", 0, 0xb25d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 255 | { "hmgeo", 0, 0x38510, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 256 | { "jambo", 0, 0xfab95, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 257 | { "otrigger", 0, 0xfea94, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 258 | { "pjustic", 0, 0x725d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 259 | { "pstone", 0, 0xe69c1, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 260 | { "pstone2", 0, 0xb8dc0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 261 | { "samba", 0, 0xa8b5d, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 262 | { "slasho", 0, 0xa66ca, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 263 | { "smlg99", 0, 0x48a01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 264 | { "spawn", 0, 0x78d01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 265 | { "suchie3", 0, 0x368e1, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 266 | { "toyfight", 0, 0x2ca85, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 267 | { "vtennis", 0, 0x3eb15, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 268 | { "wwfroyal",0, 0x627c3, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 269 | { "zombrvn", 0, 0x12b41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 270 | ||
| 271 | // games where the encryption is stacked with the ASIC's compression | |
| 272 | { "doa2", 0, -1, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, // 0x8ad01, has compression | |
| 233 | 273 | -1, 0xa0514, 0xa0000, -1, 0xc0518, 0xc0000, -1, 0xe051c, 0xe0000, -1, 0x100520,0x100000, -1, 0x118a3a, 0x120000, |
| 234 | 274 | -1, 0x12c0d8, 0x140000, -1, 0x147e22, 0x160000, -1, 0x1645ce, 0x180000, -1, 0x17c6b2, 0x1a0000, |
| 235 | 275 | -1, 0x19902e, 0x1c0000, -1, 0x1b562a, 0x1e0000, -1, 0xffffffff, 0xffffffff } }, |
| 236 | { "doa2m", 0, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, | |
| 276 | { "doa2m", 0, -1, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, | |
| 237 | 277 | -1, 0xa0514, 0xa0000, -1, 0xc0518, 0xc0000, -1, 0xe051c, 0xe0000, -1, 0x100520,0x100000, -1, 0x11a5b4, 0x120000, |
| 238 | 278 | -1, 0x12e7c4, 0x140000, -1, 0x1471f6, 0x160000, -1, 0x1640c4, 0x180000, -1, 0x1806ca, 0x1a0000, |
| 239 | 279 | -1, 0x199df4, 0x1c0000, -1, 0x1b5d0a, 0x1e0000, 0xffffffff, 0xffffffff } }, |
| 240 | { "csmash", 1, { -1, 0x2000000, 0xbb614, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 241 | { "csmasho", 1, { -1, 0x2000000, 0xbb5b4, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 242 | { "capsnk", 0, { 0x8c2a, 0, 0, 0x3d3e, 0, 0x10000, 0x65b7, 0, 0x20000, 0x5896, 0, 0x30000, 0x16d2, 0, 0x40000, | |
| 243 | 0x9147, 0, 0x50000, 0x7ac, 0, 0x60000, 0xee67, 0, 0x70000, 0xeb63, 0, 0x80000, 0x2a04, 0, 0x90000, | |
| 244 | 0x3e41, 0, 0xa0000, 0xb7af, 0, 0xb0000, 0x9651, 0, 0xc0000, 0xd208, 0, 0xd0000, 0x4769, 0, 0xe0000, | |
| 245 | 0xad8c, 0, 0xf0000, 0x923d, 0, 0x100000, 0x4a65, 0, 0x110000, 0x9958, 0, 0x120000, 0x8216, 0, 0x130000, | |
| 246 | 0xaa91, 0, 0x140000, 0xd007, 0, 0x150000, 0xead, 0, 0x160000, 0x492, 0, 0x170000, | |
| 247 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 248 | { "capsnka", 0, { 0x8c2a, 0, 0, 0x3d3e, 0, 0x10000, 0x65b7, 0, 0x20000, 0x5896, 0, 0x30000, 0x16d2, 0, 0x40000, | |
| 249 | 0x9147, 0, 0x50000, 0x7ac, 0, 0x60000, 0xee67, 0, 0x70000, 0xeb63, 0, 0x80000, 0x2a04, 0, 0x90000, | |
| 250 | 0x3e41, 0, 0xa0000, 0xb7af, 0, 0xb0000, 0x9651, 0, 0xc0000, 0xd208, 0, 0xd0000, 0x4769, 0, 0xe0000, | |
| 251 | 0xad8c, 0, 0xf0000, 0x923d, 0, 0x100000, 0x4a65, 0, 0x110000, 0x9958, 0, 0x120000, 0x8216, 0, 0x130000, | |
| 252 | 0xaa91, 0, 0x140000, 0xd007, 0, 0x150000, 0xead, 0, 0x160000, 0x492, 0, 0x170000, | |
| 253 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 254 | { "pjustic", 0, { 0x923d, 0, 0, 0x3e41, 0, 0x10000, 0xb7af, 0, 0x20000, | |
| 255 | 0x9651, 0, 0x30000, 0xad8c, 0, 0x40000, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 256 | { "hmgeo", 0, { 0x6cc8, 0, 0x000000, 0x7b92, 0, 0x010000, 0x69bc, 0, 0x020000, | |
| 257 | 0x6d16, 0, 0x030000, 0x6134, 0, 0x040000, 0x1340, 0, 0x050000, | |
| 258 | 0x7716, 0, 0x060000, 0x2e1a, 0, 0x070000, 0x3030, 0, 0x080000, | |
| 259 | 0x0870, 0, 0x090000, 0x2856, 0, 0x0a0000, 0x4224, 0, 0x0b0000, | |
| 260 | 0x6df0, 0, 0x0c0000, 0x0dd8, 0, 0x0d0000, 0x576c, 0, 0x0e0000, | |
| 261 | 0x0534, 0, 0x0f0000, 0x0904, 0, 0x100000, 0x2f14, 0, 0x110000, | |
| 262 | 0x1792, 0, 0x120000, 0x6866, 0, 0x130000, 0x06fa, 0, 0x140000, | |
| 263 | 0x2842, 0, 0x150000, 0x7cc8, 0, 0x160000, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 264 | { "wwfroyal",0, { 0xaaaa, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 265 | { "gwing2", 0, { -1, 0x85ddc0, 0, 0xd567, 0, 0x10000, 0xe329, 0, 0x30000, 0xc112, 0, 0x50000, | |
| 266 | 0xabcd, 0, 0x70000, 0xef01, 0, 0x90000, 0x1234, 0, 0xb0000, 0x5678, 0, 0xd0000, | |
| 267 | 0x5555, 0, 0xf0000, 0x6666, 0, 0x110000, 0xa901, 0, 0x130000, 0xa802, 0, 0x150000, | |
| 268 | 0x3232, 0, 0x170000, 0x8989, 0, 0x190000, 0x6655, 0, 0x1a0000, | |
| 269 | 0x3944, 0, 0x1c0000, 0x655a, 0, 0x1d0000, 0xf513, 0, 0x1e0000, | |
| 270 | 0xb957, 0, 0, 0x37ca, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 271 | { "pstone2", 0, { -2, 0x14db3f4, 0x000000, -2, 0xfbd0179d, 0x010000, -2, 0x9827117, 0x020000, -2, 0x69358f, 0x030000, | |
| 272 | -2, 0x193954e, 0x040000, -2, 0xba50eb, 0x050000, -2, 0x9f1523, 0x060000, -2, 0xcb7b03, 0x070000, | |
| 273 | -2, 0x8f712b, 0x080000, -2, 0x120f246, 0x090000, -2, 0xacc9fc, 0x0a0000, -2, 0x4eb319, 0x0b0000, | |
| 274 | -2, 0x19d0c41, 0x0c0000, -2, 0x1077853, 0x0d0000, -2, 0x100019d, 0x0e0000, -2, 0xfd91596b, 0x0f0000, | |
| 275 | -2, 0x63bae7, 0x100000, -2, 0x3e3685, 0x110000, -2, 0x6d08a9, 0x120000, -2, 0xfff85c5d, 0x130000, | |
| 276 | -2, 0x5263bf, 0x140000, -2, 0x396180, 0x150000, -2, 0x73af6c, 0x160000, -2, 0xfffa8a76, 0x170000, | |
| 277 | -2, 0xc2d9e0, 0x180000, -2, 0x33be72, 0x190000, | |
| 278 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 279 | { "toyfight", 0,{ 0x0615, 0, 0x8f058, 0x1999, 0, 0x8ec58, 0x7510, 0, 0x8f458, 0x5736, 0, 0x8e858, | |
| 280 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 281 | { "ggx", 0,{ -1, 0x200000, 0x100000, -1, 0x210004, 0x110000, -1, 0x220008, 0x120000, -1, 0x228000, 0x130000, | |
| 280 | { "ggx", 0, -1, { -1, 0x200000, 0x100000, -1, 0x210004, 0x110000, -1, 0x220008, 0x120000, -1, 0x228000, 0x130000, // 0x76110, uses compression | |
| 282 | 281 | 0x3af9, 0, 0x000000, 0x2288, 0, 0x010000, 0xe5e6, 0, 0x020000, 0xebb0, 0, 0x030000, |
| 283 | 282 | 0x0228, 0, 0x040000, 0x872c, 0, 0x050000, 0xbba0, 0, 0x060000, 0x772f, 0, 0x070000, |
| 284 | 283 | 0x2924, 0, 0x080000, 0x3222, 0, 0x090000, 0x7954, 0, 0x0a0000, 0x5acd, 0, 0x0b0000, |
| 285 | 284 | 0xdd19, 0, 0x0c0000, 0x2428, 0, 0x0d0000, 0x3329, 0, 0x0e0000, 0x2142, 0, 0x0f0000, |
| 286 | 285 | 0xffffffff, 0xffffffff, 0xffffffff } }, |
| 287 | { "crzytaxi", 0,{ 0x0219, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 288 | { "jambo", 0,{ 0x0223, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 289 | { "18wheelr", 0,{ 0x1502, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 290 | { "sgtetris", 0,{ 0x1234, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 286 | { "sgtetris", 0, -1, { 0x1234, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, // 0x8ae51, uses compression | |
| 287 | // { "virnbao", 0, 0x68b58, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, // note: "virnba" set doesn't have protection | |
| 288 | // { "vs2_2k", 0, 0x88b08, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 291 | 289 | }; |
| 292 | 290 | |
| 291 | // forward declaration for decrypt function | |
| 292 | static void stream_decrypt(UINT32 game_key, UINT32 sequence_key, UINT16 seed, UINT8* ciphertext, UINT8* plaintext, int length); | |
| 293 | static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data); | |
| 294 | ||
| 293 | 295 | /*************************************************************************** |
| 294 | 296 | INLINE FUNCTIONS |
| 295 | 297 | ***************************************************************************/ |
| r7500 | r7501 | |
| 377 | 379 | static void soft_reset(naomibd_state *v) |
| 378 | 380 | { |
| 379 | 381 | v->prot_sum = 0; |
| 382 | ||
| 383 | v->dc_m3_ptr = 0; | |
| 384 | v->dc_seqkey = 0; | |
| 380 | 385 | } |
| 381 | 386 | |
| 382 | 387 | |
| r7500 | r7501 | |
| 406 | 411 | |
| 407 | 412 | if (v->rom_offset_flags & NAOMIBD_FLAG_SPECIAL_MODE) |
| 408 | 413 | { |
| 409 | if (v->rom_offset == 0x1fffe) | |
| 414 | // can we live-decrypt this game? | |
| 415 | if (v->dc_gamekey != -1) | |
| 410 | 416 | { |
| 411 | UINT8 *prot = (UINT8 *)v->protdata; | |
| 412 | UINT32 byte_offset = v->prot_offset*2; | |
| 417 | ret = (UINT64)(v->dc_cart_ram[v->dc_readback+1] | (v->dc_cart_ram[v->dc_readback]<<8)); | |
| 418 | v->dc_readback += 2; | |
| 419 | } | |
| 420 | else | |
| 421 | { | |
| 422 | if (v->rom_offset == 0x1fffe) | |
| 423 | { | |
| 424 | UINT8 *prot = (UINT8 *)v->protdata; | |
| 425 | UINT32 byte_offset = v->prot_offset*2; | |
| 413 | 426 | |
| 414 | // this is a good time to clear the prot_sum | |
| 415 | v->prot_sum = 0; | |
| 427 | // this is a good time to clear the prot_sum | |
| 428 | v->prot_sum = 0; | |
| 416 | 429 | |
| 417 | if (v->prot_translate == NULL) | |
| 418 | { | |
| 430 | if (v->prot_translate == NULL) | |
| 431 | { | |
| 432 | #if NAOMIBD_PRINTF_PROTECTION | |
| 433 | v->prot_pio_count += 2; | |
| 434 | printf("naomibd: reading protection data, but none was supplied (now %x bytes)\n", v->prot_pio_count); | |
| 435 | #endif | |
| 436 | return 0; | |
| 437 | } | |
| 438 | ||
| 419 | 439 | #if NAOMIBD_PRINTF_PROTECTION |
| 420 | 440 | v->prot_pio_count += 2; |
| 421 | printf("naomibd: read | |
| 441 | printf("naomibd: PIO read | |
| 422 | 442 | #endif |
| 423 | return 0; | |
| 424 | } | |
| 425 | 443 | |
| 426 | #if NAOMIBD_PRINTF_PROTECTION | |
| 427 | v->prot_pio_count += 2; | |
| 428 | printf("naomibd: PIO read count %x\n", v->prot_pio_count); | |
| 429 | #endif | |
| 444 | if (v->prot_reverse_bytes) | |
| 445 | { | |
| 446 | ret = (UINT64)(prot[byte_offset+1] | (prot[byte_offset]<<8)); | |
| 447 | } | |
| 448 | else | |
| 449 | { | |
| 450 | ret = (UINT64)(prot[byte_offset] | (prot[byte_offset+1]<<8)); | |
| 451 | } | |
| 430 | 452 | |
| 431 | if (v->prot_reverse_bytes) | |
| 432 | { | |
| 433 | ret = (UINT64)(prot[byte_offset+1] | (prot[byte_offset]<<8)); | |
| 453 | v->prot_offset++; | |
| 434 | 454 | } |
| 455 | #if NAOMIBD_PRINTF_PROTECTION | |
| 435 | 456 | else |
| 436 | 457 | { |
| 437 | r | |
| 458 | printf | |
| 438 | 459 | } |
| 439 | ||
| 440 | v->prot_offset++; | |
| 460 | #endif | |
| 441 | 461 | } |
| 442 | #if NAOMIBD_PRINTF_PROTECTION | |
| 443 | else | |
| 444 | { | |
| 445 | printf("Bad protection offset read %x\n", v->rom_offset); | |
| 446 | } | |
| 447 | #endif | |
| 448 | 462 | } |
| 449 | 463 | else |
| 450 | 464 | { |
| r7500 | r7501 | |
| 461 | 475 | else if ((offset == 2) && ACCESSING_BITS_32_63) |
| 462 | 476 | { |
| 463 | 477 | // Actel FPGA ID, used on some games for a "special" ROM test. |
| 478 | // | |
| 479 | // without this (by returning 0xffff) some games will do a rom test where | |
| 480 | // the IC numbers tested do not relate to the actual ROMs on the cart, | |
| 481 | // and a fake 'IC1' will be tested, which returns mirrored data from the | |
| 482 | // other roms in order to pass if enabled on the real hardware. | |
| 483 | // (certain bios / board combinations will also cause this, so it is | |
| 484 | // important that we mirror the data in the rom loading using ROM_COPY) | |
| 464 | 485 | |
| 486 | //return (UINT64)0xffff << 32; | |
| 465 | 487 | return (UINT64)actel_id << 32; |
| 466 | 488 | } |
| 467 | 489 | else if ((offset == 7) && ACCESSING_BITS_32_47) |
| r7500 | r7501 | |
| 513 | 535 | WRITE64_DEVICE_HANDLER( naomibd_w ) |
| 514 | 536 | { |
| 515 | 537 | naomibd_state *v = get_safe_token(device); |
| 516 | INT32 i; | |
| 517 | 538 | |
| 518 | 539 | // AW board |
| 519 | 540 | if (v->type == AW_ROM_BOARD) |
| r7500 | r7501 | |
| 657 | 678 | v->prot_pio_count = 0; |
| 658 | 679 | #endif |
| 659 | 680 | |
| 660 | // translate address if necessary | |
| 661 | if (v->prot_translate != NULL) | |
| 681 | // if dc_gamekey isn't -1, we can live-decrypt this one | |
| 682 | if (v->dc_gamekey != -1) | |
| 662 | 683 | { |
| 663 | i = 0; | |
| 664 | while (v->prot_translate[i+1] != 0xffffffff) | |
| 684 | UINT8 temp_ram[128*1024]; | |
| 685 | UINT8 *ROM = (UINT8 *)v->memory; | |
| 686 | ||
| 687 | v->dc_seed = 0; | |
| 688 | v->dc_readback = 0; | |
| 689 | v->dc_seqkey = v->prot_key; | |
| 690 | ||
| 691 | #if NAOMIBD_PRINTF_PROTECTION | |
| 692 | printf("M2/M3 decrypt: gamekey %x seqkey %x seed %x length %x\n", v->dc_gamekey, v->dc_seqkey, v->dc_seed, v->dc_m3_ptr); | |
| 693 | #endif | |
| 694 | ||
| 695 | // M2: just decrypt up to the size limit since we don't know the size in advance | |
| 696 | if (v->prot_offset != 0x2000000/2) | |
| 665 | 697 | { |
| 666 | // should we match by key, address, or sum? | |
| 667 | if (v->prot_translate[i] == -2) // match sum | |
| 698 | // decrypt to temp buffer | |
| 699 | stream_decrypt(v->dc_gamekey, v->dc_seqkey, v->prot_offset&0xffff, &ROM[v->prot_offset*2], temp_ram, 128*1024); | |
| 700 | } | |
| 701 | else | |
| 702 | { | |
| 703 | // decrypt cart ram to temp buffer | |
| 704 | stream_decrypt(v->dc_gamekey, v->dc_seqkey, v->dc_seed, v->dc_cart_ram, temp_ram, v->dc_m3_ptr); | |
| 705 | } | |
| 706 | ||
| 707 | #if NAOMIBD_PRINTF_PROTECTION | |
| 708 | printf("result: %02x %02x %02x %02x %02x %02x %02x %02x\n", | |
| 709 | temp_ram[0], temp_ram[1], temp_ram[2], temp_ram[3], | |
| 710 | temp_ram[4], temp_ram[5], temp_ram[6], temp_ram[7]); | |
| 711 | #endif | |
| 712 | ||
| 713 | // copy results to cart ram for readback | |
| 714 | memcpy(v->dc_cart_ram, temp_ram, 128*1024); | |
| 715 | ||
| 716 | v->dc_m3_ptr = 0; | |
| 717 | v->prot_sum = 0; | |
| 718 | } | |
| 719 | else | |
| 720 | { | |
| 721 | // translate address if necessary | |
| 722 | if (v->prot_translate != NULL) | |
| 723 | { | |
| 724 | int i = 0; | |
| 725 | while (v->prot_translate[i+1] != 0xffffffff) | |
| 668 | 726 | { |
| 669 | if (v->prot_translate[i+1] == v->prot_sum) | |
| 727 | // should we match by key, address, or sum? | |
| 728 | if (v->prot_translate[i] == -2) // match sum | |
| 670 | 729 | { |
| 671 | #if NAOMIBD_PRINTF_PROTECTION | |
| 672 | printf("Protection: got sum %x, translated to %x\n", v->prot_sum, v->prot_translate[i+2]); | |
| 673 | #endif | |
| 674 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 675 | break; | |
| 730 | if (v->prot_translate[i+1] == v->prot_sum) | |
| 731 | { | |
| 732 | #if NAOMIBD_PRINTF_PROTECTION | |
| 733 | printf("Protection: got sum %x, translated to %x\n", v->prot_sum, v->prot_translate[i+2]); | |
| 734 | #endif | |
| 735 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 736 | break; | |
| 737 | } | |
| 738 | else | |
| 739 | { | |
| 740 | i+= 3; | |
| 741 | } | |
| 676 | 742 | } |
| 677 | else | |
| 743 | else if (v->prot_translate[i] == -1) // match address | |
| 678 | 744 | { |
| 679 | i+= 3; | |
| 745 | if (v->prot_translate[i+1] == (v->prot_offset*2)) | |
| 746 | { | |
| 747 | #if NAOMIBD_PRINTF_PROTECTION | |
| 748 | printf("Protection: got offset %x, translated to %x\n", v->prot_offset, v->prot_translate[i+2]); | |
| 749 | #endif | |
| 750 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 751 | break; | |
| 752 | } | |
| 753 | else | |
| 754 | { | |
| 755 | i += 3; | |
| 756 | } | |
| 680 | 757 | } |
| 681 | } | |
| 682 | else if (v->prot_translate[i] == -1) // match address | |
| 683 | { | |
| 684 | if (v->prot_translate[i+1] == (v->prot_offset*2)) | |
| 758 | else // match key | |
| 685 | 759 | { |
| 686 | #if NAOMIBD_PRINTF_PROTECTION | |
| 687 | printf("Protection: got offset %x, translated to %x\n", v->prot_offset, v->prot_translate[i+2]); | |
| 688 | #endif | |
| 689 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 690 | break; | |
| 760 | if (v->prot_translate[i] == v->prot_key) | |
| 761 | { | |
| 762 | #if NAOMIBD_PRINTF_PROTECTION | |
| 763 | printf("Protection: got key %x, translated to %x\n", v->prot_key, v->prot_translate[i+2]); | |
| 764 | #endif | |
| 765 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 766 | break; | |
| 767 | } | |
| 768 | else | |
| 769 | { | |
| 770 | i+= 3; | |
| 771 | } | |
| 691 | 772 | } |
| 692 | else | |
| 693 | { | |
| 694 | i += 3; | |
| 695 | } | |
| 696 | 773 | } |
| 697 | else // match key | |
| 698 | { | |
| 699 | if (v->prot_translate[i] == v->prot_key) | |
| 700 | { | |
| 701 | #if NAOMIBD_PRINTF_PROTECTION | |
| 702 | printf("Protection: got key %x, translated to %x\n", v->prot_key, v->prot_translate[i+2]); | |
| 703 | #endif | |
| 704 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 705 | break; | |
| 706 | } | |
| 707 | else | |
| 708 | { | |
| 709 | i+= 3; | |
| 710 | } | |
| 711 | } | |
| 712 | 774 | } |
| 775 | #if NAOMIBD_PRINTF_PROTECTION | |
| 776 | else | |
| 777 | { | |
| 778 | printf("naomibd: protection not handled for this game\n"); | |
| 779 | } | |
| 780 | #endif | |
| 713 | 781 | } |
| 714 | #if NAOMIBD_PRINTF_PROTECTION | |
| 715 | else | |
| 716 | { | |
| 717 | printf("naomibd: protection not handled for this game\n"); | |
| 718 | } | |
| 719 | #endif | |
| 720 | 782 | break; |
| 721 | 783 | |
| 722 | 784 | case 0x2000000: |
| 723 | 785 | case 0x2020000: |
| 724 | 786 | #if NAOMIBD_PRINTF_PROTECTION |
| 725 | printf("Protection write %04x to upload\n", (UINT32)(data&0xffff)); | |
| 787 | printf("Protection write %04x to upload @ %x\n", (UINT32)(data&0xffff), v->dc_m3_ptr); | |
| 726 | 788 | #endif |
| 727 | 789 | v->prot_sum += (INT16)(data&0xffff); |
| 790 | ||
| 791 | v->dc_cart_ram[v->dc_m3_ptr] = (data&0xff); | |
| 792 | v->dc_cart_ram[v->dc_m3_ptr+1] = (data>>8)&0xff; | |
| 793 | v->dc_m3_ptr += 2; | |
| 728 | 794 | break; |
| 729 | 795 | |
| 730 | 796 | default: |
| r7500 | r7501 | |
| 813 | 879 | int pos,len,a; |
| 814 | 880 | char name[128]; |
| 815 | 881 | UINT64 key; |
| 882 | UINT8* realpic; // todo, add to device | |
| 816 | 883 | |
| 817 | 884 | memset(name,'\0',128); |
| 818 | memcpy(name, v->picdata+33, 7); | |
| 819 | memcpy(name+7, v->picdata+25, 7); | |
| 885 | ||
| 886 | realpic = memory_region(machine,"pic"); | |
| 887 | ||
| 888 | if (realpic) | |
| 889 | { | |
| 890 | //printf("Real PIC binary found\n"); | |
| 891 | int i; | |
| 892 | for (i=0;i<7;i++) | |
| 893 | { | |
| 894 | name[i] = realpic[0x7c0+i*2]; | |
| 895 | } | |
| 896 | for (i=0;i<7;i++) | |
| 897 | { | |
| 898 | name[i+7] = realpic[0x7e0+i*2]; | |
| 899 | } | |
| 900 | } | |
| 901 | else | |
| 902 | { | |
| 903 | // use extracted pic data | |
| 904 | logerror("This PIC key hasn't been converted to a proper PIC binary yet!\n"); | |
| 905 | memcpy(name, v->picdata+33, 7); | |
| 906 | memcpy(name+7, v->picdata+25, 7); | |
| 907 | } | |
| 908 | ||
| 820 | 909 | gdromfile = cdrom_open(v->gdromchd); |
| 821 | 910 | // primary volume descriptor |
| 822 | 911 | // read frame 0xb06e (frame=sector+150) |
| r7500 | r7501 | |
| 838 | 927 | // find data of file |
| 839 | 928 | start = 0; |
| 840 | 929 | size = 0; |
| 841 | | |
| 930 | logerror | |
| 842 | 931 | for (pos = 0;pos < 2048;pos += buffer[pos]) |
| 843 | 932 | { |
| 844 | 933 | a=0; |
| r7500 | r7501 | |
| 875 | 964 | (buffer[pos+12] << 16) | |
| 876 | 965 | (buffer[pos+13] << 24)); |
| 877 | 966 | |
| 878 | | |
| 967 | logerror | |
| 879 | 968 | break; |
| 880 | 969 | } |
| 881 | 970 | if (buffer[pos] == 0) |
| r7500 | r7501 | |
| 897 | 986 | start = 0; |
| 898 | 987 | size = 0; |
| 899 | 988 | |
| 900 | | |
| 989 | logerror | |
| 901 | 990 | for (pos = 0;pos < 2048;pos += buffer[pos]) |
| 902 | 991 | { |
| 903 | 992 | a = 0; |
| r7500 | r7501 | |
| 934 | 1023 | (buffer[pos+12] << 16) | |
| 935 | 1024 | (buffer[pos+13] << 24)); |
| 936 | 1025 | |
| 937 | | |
| 1026 | logerror | |
| 938 | 1027 | break; |
| 939 | 1028 | } |
| 940 | 1029 | if (buffer[pos] == 0) |
| r7500 | r7501 | |
| 955 | 1044 | } |
| 956 | 1045 | } |
| 957 | 1046 | // get des key |
| 958 | key =(((UINT64)v->picdata[0x31] << 56) | | |
| 959 | ((UINT64)v->picdata[0x32] << 48) | | |
| 960 | ((UINT64)v->picdata[0x33] << 40) | | |
| 961 | ((UINT64)v->picdata[0x34] << 32) | | |
| 962 | ((UINT64)v->picdata[0x35] << 24) | | |
| 963 | ((UINT64)v->picdata[0x36] << 16) | | |
| 964 | ((UINT64)v->picdata[0x37] << 8) | | |
| 965 | ((UINT64)v->picdata[0x29] << 0)); | |
| 1047 | realpic = memory_region(machine,"pic"); | |
| 966 | 1048 | |
| 967 | printf("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL)); | |
| 1049 | if (realpic) | |
| 1050 | { | |
| 1051 | int i; | |
| 1052 | key = 0; | |
| 1053 | for (i=0;i<7;i++) | |
| 1054 | { | |
| 1055 | key |= (UINT64)realpic[0x780+i*2] << (56 - i*8); | |
| 1056 | } | |
| 968 | 1057 | |
| 1058 | key |= (UINT64)realpic[0x7a0]; | |
| 1059 | } | |
| 1060 | else | |
| 1061 | { | |
| 1062 | key =(((UINT64)v->picdata[0x31] << 56) | | |
| 1063 | ((UINT64)v->picdata[0x32] << 48) | | |
| 1064 | ((UINT64)v->picdata[0x33] << 40) | | |
| 1065 | ((UINT64)v->picdata[0x34] << 32) | | |
| 1066 | ((UINT64)v->picdata[0x35] << 24) | | |
| 1067 | ((UINT64)v->picdata[0x36] << 16) | | |
| 1068 | ((UINT64)v->picdata[0x37] << 8) | | |
| 1069 | ((UINT64)v->picdata[0x29] << 0)); | |
| 1070 | } | |
| 1071 | ||
| 1072 | logerror("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL)); | |
| 1073 | ||
| 969 | 1074 | // decrypt loaded data |
| 970 | 1075 | naomi_game_decrypt(machine, key, v->memory, size); |
| 971 | 1076 | cdrom_close(gdromfile); |
| 972 | 1077 | } |
| 973 | 1078 | |
| 1079 | /*************************************************************************** | |
| 1080 | DECRYPTION EMULATION | |
| 974 | 1081 | |
| 1082 | By convention, we label the three known cart protection methods this way (using Deunan Knute's wording): | |
| 1083 | M1: DMA read of protected ROM area | |
| 1084 | M2: special read of ROM area which supplies decryption key first | |
| 1085 | M3: normal read followed by write to cart's decryption buffer (up to 64kB), followed by M2 but from buffer area | |
| 975 | 1086 | |
| 1087 | M1's working is still unclear (more on this later), so we will be speaking of M2 & M3 most of the time. | |
| 1088 | ||
| 1089 | The encryption is done by a stream cipher operating in counter mode, which use a 16-bits internal block cipher. | |
| 1090 | ||
| 1091 | There are 2 "control bits" at the start of the decrypted stream which control the mode of operation: bit #1 set to 1 means | |
| 1092 | that the decrypted stream needs to be decompressed after being decrypted. More on this later. | |
| 1093 | ||
| 1094 | The next 16-bits are part of the header (they don't belong to the plaintext), but his meaning is unclear. It has been | |
| 1095 | conjectured that it could stablish when to "reset" the process and start processing a new stream (based on some tests | |
| 1096 | on WWFROYAL, in which the decryption's output doesn't seem to be valid for more than some dozens of words), but some | |
| 1097 | more testing would be needed for clarifying that. | |
| 1098 | ||
| 1099 | After those 18 heading bits, we find the proper plaintext. It must be noted that, due to the initial 2 special bits, | |
| 1100 | the 16-bits words of the plaintext are shifted 2 bits respect to the word-boundaries of the output stream of the | |
| 1101 | internal block-cipher. So, at a given step, the internal block cipher will output 16-bits, 14 of which will go to a | |
| 1102 | given plaintext word, and the remaining 2 to the next plaintext word. | |
| 1103 | ||
| 1104 | The underlying block cipher consists of two 4-round Feistel Networks (FN): the first one takes the counter (16 bits), | |
| 1105 | the game-key (20 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key | |
| 1106 | for the second one. The second FN will take the encrypted word (16 bits), the game-key, the sequence-key and the result | |
| 1107 | from the first FN and will output the decrypted word (16 bits). | |
| 1108 | ||
| 1109 | Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input can be the | |
| 1110 | XOR of at most two "sources bits", being source bits the bits from the previous round and the bits from the different keys. | |
| 1111 | ||
| 1112 | The underlying block cipher has the same structure than the one used by the CPS-2 (Capcom Play System 2) and, | |
| 1113 | indeed, some of the used sboxes are exactly the same and appear in the same FN/round in both systems (this is not evident, | |
| 1114 | as you need to apply a bitswapping and some XORs to the input & output of the sboxes to get the same values due). However, | |
| 1115 | the key scheduling used by this implementation is much weaker than the CPS-2's one. Many s-boxes inputs are XORed with any | |
| 1116 | key bit and, indeed, the cart-specific key is just 20-bits long. | |
| 1117 | ||
| 1118 | Due to the small key-length, no sophisticated attacks are needed to recover the keys; a brute-force attack knowing just | |
| 1119 | one or two (encrypted word-decrypted word) pairs suffice. | |
| 1120 | ||
| 1121 | The only difference in the decryption process between M2 and M3 is the initialization of the counter. In M3, the counter is | |
| 1122 | always set to 0 at the beginning of the decryption while, in M2, the bits #1-#16 of the ciphertext's address are used | |
| 1123 | to initialize the counter. | |
| 1124 | ||
| 1125 | Due to the nature of the cipher, there are some degrees of freedom when choosing the s-boxes and keys values; by example, | |
| 1126 | you could apply a fixed bitswapping and XOR to the keys and the decryption would remain the same as long as you change | |
| 1127 | accordingly the s-boxes' definitions. So the order of the bits in the keys is arbitrary, and the s-boxes values have been | |
| 1128 | chosen so as to make the key for CAPSNK equal to 0. | |
| 1129 | ||
| 1130 | It can be observed that some sboxes have incomplete tables (a 255 value indicate an unknown value). In most of the cases, | |
| 1131 | they are apparently unused by the cipher (due to the weak key scheduling mentioned above). As of february/2010, the only | |
| 1132 | s-box which have a incomplete table which could be begin used is the 4th s-box of the 1st round of the 2nd FN. It's | |
| 1133 | incomplete because we haven't located any game using that part of the s-box till now, but definitively it could be being | |
| 1134 | used by some still-not-analyzed carts. | |
| 1135 | ||
| 1136 | When bit #1 of the heading control bits is set to 1, an additional decompression step seems to be carried out. As of | |
| 1137 | february/2010, Deunan Knute has put some work on analyzing the decompression algorithm, but probably much more work will | |
| 1138 | be needed to completely reverse engineer it. Interested devs with quick access to hardware tests are welcomed to join | |
| 1139 | the task. | |
| 1140 | ||
| 1141 | Guilty Gear X & Sega Tetris are examples of games using the decompression ingame. | |
| 1142 | ||
| 1143 | Due to technical details, it's more difficult to get custom decryption data from M1 carts, which hinders some types of | |
| 1144 | analysis. The only M1 cart which have received attention until now have been AH! MY GODDESS. The available data clearly | |
| 1145 | doesn't have the same structure than M2&M3 carts using only the decryption step. However, due to that some hardware tests | |
| 1146 | show cycled structures similar to the ones returned by M2&M3 carts using the decompression algo, it's conjectured that M1 | |
| 1147 | carts will be using the same decompression algorithm seen in M2&M3 ones. | |
| 1148 | ||
| 1149 | ****************************************************************************************/ | |
| 1150 | ||
| 1151 | struct sbox | |
| 1152 | { | |
| 1153 | UINT8 table[64]; | |
| 1154 | int inputs[6]; // positions of the inputs bits, -1 means no input except from key | |
| 1155 | int outputs[2]; // positions of the output bits | |
| 1156 | }; | |
| 1157 | ||
| 1158 | ||
| 1159 | static const struct sbox fn1_sboxes[4][4] = | |
| 1160 | { | |
| 1161 | { // 1st round | |
| 1162 | { | |
| 1163 | { | |
| 1164 | 0,3,2,2,1,3,1,2,3,2,1,2,1,2,3,1,3,2,2,0,2,1,3,0,0,3,2,3,2,1,2,0, | |
| 1165 | // unused | |
| 1166 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1167 | }, | |
| 1168 | {3,4,5,7,-1,-1}, | |
| 1169 | {0,4} | |
| 1170 | }, | |
| 1171 | ||
| 1172 | { | |
| 1173 | { | |
| 1174 | 2,2,2,0,3,3,0,1,2,2,3,2,3,0,2,2,1,1,0,3,3,2,0,2,0,1,0,1,2,3,1,1, | |
| 1175 | 0,1,3,3,1,3,3,1,2,3,2,0,0,0,2,2,0,3,1,3,0,3,2,2,0,3,0,3,1,1,0,2, | |
| 1176 | }, | |
| 1177 | {0,1,2,5,6,7}, | |
| 1178 | {1,6} | |
| 1179 | }, | |
| 1180 | ||
| 1181 | { | |
| 1182 | { | |
| 1183 | 0,1,3,0,3,1,1,1,1,2,3,1,3,0,2,3,3,2,0,2,1,1,2,1,1,3,1,0,0,2,0,1, | |
| 1184 | 1,3,1,0,0,3,2,3,2,0,3,3,0,0,0,0,1,2,3,3,2,0,3,2,1,0,0,0,2,2,3,3, | |
| 1185 | }, | |
| 1186 | {0,2,5,6,7,-1}, | |
| 1187 | {2,3} | |
| 1188 | }, | |
| 1189 | ||
| 1190 | { | |
| 1191 | { | |
| 1192 | 3,2,1,2,1,2,3,2,0,3,2,2,3,1,3,3,0,2,3,0,3,3,2,1,1,1,2,0,2,2,0,1, | |
| 1193 | 1,3,3,0,0,3,0,3,0,2,1,3,2,1,0,0,0,1,1,2,0,1,0,0,0,1,3,3,2,0,3,3, | |
| 1194 | }, | |
| 1195 | {1,2,3,4,6,7}, | |
| 1196 | {5,7} | |
| 1197 | }, | |
| 1198 | }, | |
| 1199 | { // 2nd round | |
| 1200 | { | |
| 1201 | { | |
| 1202 | 3,3,1,2,0,0,2,2,2,1,2,1,3,1,1,3,3,0,0,3,0,3,3,2,1,1,3,2,3,2,1,3, | |
| 1203 | 2,3,0,1,3,2,0,1,2,1,3,1,2,2,3,3,3,1,2,2,0,3,1,2,2,1,3,0,3,0,1,3, | |
| 1204 | }, | |
| 1205 | {0,1,3,4,5,7}, | |
| 1206 | {0,4} | |
| 1207 | }, | |
| 1208 | ||
| 1209 | { | |
| 1210 | { | |
| 1211 | 2,0,1,0,0,3,2,0,3,3,1,2,1,3,0,2,0,2,0,0,0,2,3,1,3,1,1,2,3,0,3,0, | |
| 1212 | // unused | |
| 1213 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1214 | }, | |
| 1215 | {0,1,3,4,6,-1}, | |
| 1216 | {1,5} | |
| 1217 | }, | |
| 1218 | ||
| 1219 | { | |
| 1220 | { | |
| 1221 | 2,2,2,3,1,1,0,1,0,1,2,2,3,3,0,2,0,3,2,3,3,0,2,1,0,3,1,0,0,2,3,2, | |
| 1222 | 3,2,0,3,2,0,1,0,3,3,1,1,2,2,2,0,2,1,3,1,1,1,1,2,2,2,3,0,1,3,0,0, | |
| 1223 | }, | |
| 1224 | {1,2,5,6,7,-1}, | |
| 1225 | {2,7} | |
| 1226 | }, | |
| 1227 | ||
| 1228 | { | |
| 1229 | { | |
| 1230 | 0,1,3,3,3,1,3,3,1,0,2,0,2,0,0,3,1,2,1,3,1,2,3,2,2,0,1,3,0,3,3,3, | |
| 1231 | 0,0,0,2,1,1,2,3,2,2,3,1,1,2,0,2,0,2,1,3,1,1,3,3,1,1,3,0,2,3,0,0, | |
| 1232 | }, | |
| 1233 | {2,3,4,5,6,7}, | |
| 1234 | {3,6} | |
| 1235 | }, | |
| 1236 | }, | |
| 1237 | { // 3rd round | |
| 1238 | { | |
| 1239 | { | |
| 1240 | 0,0,1,0,1,0,0,3,2,0,0,3,0,1,0,2,0,3,0,0,2,0,3,2,2,1,3,2,2,1,1,2, | |
| 1241 | 0,0,0,3,0,1,1,0,0,2,1,0,3,1,2,2,2,0,3,1,3,0,1,2,2,1,1,1,0,2,3,1, | |
| 1242 | }, | |
| 1243 | {1,2,3,4,5,7}, | |
| 1244 | {0,5} | |
| 1245 | }, | |
| 1246 | ||
| 1247 | { | |
| 1248 | { | |
| 1249 | 1,2,1,0,3,1,1,2,0,0,2,3,2,3,1,3,2,0,3,2,2,3,1,1,1,1,0,3,2,0,0,1, | |
| 1250 | 1,0,0,1,3,1,2,3,0,0,2,3,3,0,1,0,0,2,3,0,1,2,0,1,3,3,3,1,2,0,2,1, | |
| 1251 | }, | |
| 1252 | {0,2,4,5,6,7}, | |
| 1253 | {1,6} | |
| 1254 | }, | |
| 1255 | ||
| 1256 | { | |
| 1257 | { | |
| 1258 | 0,3,0,2,1,2,0,0,1,1,0,0,3,1,1,0,0,3,0,0,2,3,3,2,3,1,2,0,0,2,3,0, | |
| 1259 | // unused | |
| 1260 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1261 | }, | |
| 1262 | {0,2,4,6,7,-1}, | |
| 1263 | {2,3} | |
| 1264 | }, | |
| 1265 | ||
| 1266 | { | |
| 1267 | { | |
| 1268 | 0,0,1,0,0,1,0,2,3,3,0,3,3,2,3,0,2,2,2,0,3,2,0,3,1,0,0,3,3,0,0,0, | |
| 1269 | 2,2,1,0,2,0,3,2,0,0,3,1,3,3,0,0,2,1,1,2,1,0,1,1,0,3,1,2,0,2,0,3, | |
| 1270 | }, | |
| 1271 | {0,1,2,3,6,-1}, | |
| 1272 | {4,7} | |
| 1273 | }, | |
| 1274 | }, | |
| 1275 | { // 4th round | |
| 1276 | { | |
| 1277 | { | |
| 1278 | 0,3,3,3,3,3,2,0,0,1,2,0,2,2,2,2,1,1,0,2,2,1,3,2,3,2,0,1,2,3,2,1, | |
| 1279 | 3,2,2,3,1,0,1,0,0,2,0,1,2,1,2,3,1,2,1,1,2,2,1,0,1,3,2,3,2,0,3,1, | |
| 1280 | }, | |
| 1281 | {0,1,3,4,5,6}, | |
| 1282 | {0,5} | |
| 1283 | }, | |
| 1284 | ||
| 1285 | { | |
| 1286 | { | |
| 1287 | 0,3,0,0,2,0,3,1,1,1,2,2,2,1,3,1,2,2,1,3,2,2,3,3,0,3,1,0,3,2,0,1, | |
| 1288 | 3,0,2,0,1,0,2,1,3,3,1,2,2,0,2,3,3,2,3,0,1,1,3,3,0,2,1,3,0,2,2,3, | |
| 1289 | }, | |
| 1290 | {0,1,2,3,5,7}, | |
| 1291 | {1,7} | |
| 1292 | }, | |
| 1293 | ||
| 1294 | { | |
| 1295 | { | |
| 1296 | 0,1,2,3,3,3,3,1,2,0,2,3,2,1,0,1,2,2,1,2,0,3,2,0,1,1,0,1,3,1,3,1, | |
| 1297 | 3,1,0,0,1,0,0,0,0,1,2,2,1,1,3,3,1,2,3,3,3,2,3,0,2,2,1,3,3,0,2,0, | |
| 1298 | }, | |
| 1299 | {2,3,4,5,6,7}, | |
| 1300 | {2,3} | |
| 1301 | }, | |
| 1302 | ||
| 1303 | { | |
| 1304 | { | |
| 1305 | 0,2,1,1,3,2,0,3,1,0,1,0,3,2,1,1,2,2,0,3,1,0,1,2,2,2,3,3,0,0,0,0, | |
| 1306 | 1,2,1,0,2,1,2,2,2,3,2,3,0,1,3,0,0,1,3,0,0,1,1,0,1,0,0,0,0,2,0,1, | |
| 1307 | }, | |
| 1308 | {0,1,2,4,6,7}, | |
| 1309 | {4,6} | |
| 1310 | }, | |
| 1311 | }, | |
| 1312 | }; | |
| 1313 | ||
| 1314 | ||
| 1315 | static const struct sbox fn2_sboxes[4][4] = | |
| 1316 | { | |
| 1317 | { // 1st round | |
| 1318 | { | |
| 1319 | { | |
| 1320 | 3,3,0,1,0,1,0,0,0,3,0,0,1,3,1,2,0,3,3,3,2,1,0,1,1,1,2,2,2,3,2,2, | |
| 1321 | 2,1,3,3,1,3,1,1,0,0,1,2,0,2,2,1,1,2,3,1,2,1,3,1,2,2,0,1,3,0,2,2, | |
| 1322 | }, | |
| 1323 | {1,3,4,5,6,7}, | |
| 1324 | {0,7} | |
| 1325 | }, | |
| 1326 | ||
| 1327 | { | |
| 1328 | { | |
| 1329 | 0,2,3,2,1,1,0,0,2,1,0,3,3,0,0,0,3,2,0,2,1,1,2,1,0,0,3,1,2,2,3,1, | |
| 1330 | 3,1,3,0,0,0,1,3,1,0,0,3,2,2,3,1,1,3,0,0,2,1,3,3,1,3,1,2,3,1,2,1, | |
| 1331 | }, | |
| 1332 | {0,3,5,6,-1,-1}, | |
| 1333 | {1,2} | |
| 1334 | }, | |
| 1335 | ||
| 1336 | { | |
| 1337 | { | |
| 1338 | 0,2,2,1,0,1,2,1,2,0,1,2,3,3,0,1,3,1,1,2,1,2,1,3,3,2,3,3,2,1,0,1, | |
| 1339 | // unused | |
| 1340 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1341 | }, | |
| 1342 | {0,2,3,4,7,-1}, | |
| 1343 | {3,4} | |
| 1344 | }, | |
| 1345 | ||
| 1346 | { | |
| 1347 | { | |
| 1348 | 2,3,1,3,2,0,1,2,0,0,3,3,3,3,3,1,2,0,2,1,2,3,0,2,0,1,0,3,0,2,1,0, | |
| 1349 | 2,3,0,1,3,0,3,2,3,1,2,0,3,1,1,2, | |
| 1350 | // potentially used, but we haven't located any game using it | |
| 1351 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1352 | }, | |
| 1353 | {1,2,5,6,-1,-1}, | |
| 1354 | {5,6} | |
| 1355 | }, | |
| 1356 | }, | |
| 1357 | { // 2nd round | |
| 1358 | { | |
| 1359 | { | |
| 1360 | 2,3,1,3,1,0,3,3,3,2,3,3,2,0,0,3,2,3,0,3,1,1,2,3,1,1,2,2,0,1,0,0, | |
| 1361 | 2,1,0,1,2,0,1,2,0,3,1,1,2,3,1,2,0,2,0,1,3,0,1,0,2,2,3,0,3,2,3,0, | |
| 1362 | }, | |
| 1363 | {0,1,4,5,6,7}, | |
| 1364 | {0,7} | |
| 1365 | }, | |
| 1366 | ||
| 1367 | { | |
| 1368 | { | |
| 1369 | 0,2,2,0,2,2,0,3,2,3,2,1,3,2,3,3,1,1,0,0,3,0,2,1,1,3,3,2,3,2,0,1, | |
| 1370 | 1,2,3,0,1,0,3,0,3,1,0,2,1,2,0,3,2,3,1,2,2,0,3,2,3,0,0,1,2,3,3,3, | |
| 1371 | }, | |
| 1372 | {0,2,3,6,7,-1}, | |
| 1373 | {1,5} | |
| 1374 | }, | |
| 1375 | ||
| 1376 | { | |
| 1377 | { | |
| 1378 | 1,2,3,2,0,3,2,3,0,1,1,0,0,2,2,3,2,0,0,3,0,2,3,3,2,2,1,0,2,1,0,3, | |
| 1379 | 1,0,2,0,1,1,0,1,0,0,1,0,3,0,3,3,2,2,0,2,1,1,1,0,3,0,1,3,2,3,2,1, | |
| 1380 | }, | |
| 1381 | {2,3,4,6,7,-1}, | |
| 1382 | {2,3} | |
| 1383 | }, | |
| 1384 | ||
| 1385 | { | |
| 1386 | { | |
| 1387 | 2,3,1,3,1,1,2,3,3,1,1,0,1,0,2,3,2,1,0,0,2,2,0,1,0,2,2,2,0,2,1,0, | |
| 1388 | 3,1,2,3,1,3,0,2,1,0,1,0,0,1,2,2,3,2,3,1,3,2,1,1,2,0,2,1,3,3,1,0, | |
| 1389 | }, | |
| 1390 | {1,2,3,4,5,6}, | |
| 1391 | {4,6} | |
| 1392 | }, | |
| 1393 | }, | |
| 1394 | { // 3rd round | |
| 1395 | { | |
| 1396 | { | |
| 1397 | 0,3,0,1,0,2,3,3,1,0,1,3,2,2,1,1,3,3,3,0,2,0,2,0,0,0,2,3,1,1,0,0, | |
| 1398 | 3,3,0,3,3,0,0,2,1,1,1,0,2,2,2,0,3,0,3,1,2,2,0,3,0,0,3,2,0,3,2,1, | |
| 1399 | }, | |
| 1400 | {1,4,5,6,7,-1}, | |
| 1401 | {0,5} | |
| 1402 | }, | |
| 1403 | ||
| 1404 | { | |
| 1405 | { | |
| 1406 | 0,3,0,1,3,0,3,1,3,2,2,2,3,0,3,2,2,1,2,2,0,3,2,2,0,0,2,1,1,3,2,3, | |
| 1407 | 2,3,3,1,2,0,1,2,2,1,0,0,0,0,2,3,1,2,0,3,1,3,1,2,3,2,1,0,3,0,0,2, | |
| 1408 | }, | |
| 1409 | {0,2,3,4,6,7}, | |
| 1410 | {1,7} | |
| 1411 | }, | |
| 1412 | ||
| 1413 | { | |
| 1414 | { | |
| 1415 | 2,2,3,2,0,3,2,3,1,1,2,0,2,3,1,3,0,0,0,3,2,0,1,0,1,3,2,3,3,3,1,0, | |
| 1416 | // unused | |
| 1417 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, | |
| 1418 | }, | |
| 1419 | {1,2,4,7,-1,-1}, | |
| 1420 | {2,4} | |
| 1421 | }, | |
| 1422 | ||
| 1423 | { | |
| 1424 | { | |
| 1425 | 0,2,3,1,3,1,1,0,0,1,3,0,2,1,3,3,2,0,2,1,1,2,3,3,0,0,0,2,0,2,3,0, | |
| 1426 | 3,3,3,3,2,3,3,2,3,0,1,0,2,3,3,2,0,1,3,1,0,1,2,3,3,0,2,0,3,0,3,3, | |
| 1427 | }, | |
| 1428 | {0,1,2,3,5,7}, | |
| 1429 | {3,6} | |
| 1430 | }, | |
| 1431 | }, | |
| 1432 | { // 4th round | |
| 1433 | { | |
| 1434 | { | |
| 1435 | 0,1,1,0,0,1,0,2,3,3,0,1,2,3,0,2,1,0,3,3,2,0,3,0,0,2,1,0,1,0,1,3, | |
| 1436 | 0,3,3,1,2,0,3,0,1,3,2,0,3,3,1,3,0,2,3,3,2,1,1,2,2,1,2,1,2,0,1,1, | |
| 1437 | }, | |
| 1438 | {0,1,2,4,7,-1}, | |
| 1439 | {0,5} | |
| 1440 | }, | |
| 1441 | ||
| 1442 | { | |
| 1443 | { | |
| 1444 | 2,0,0,2,3,0,2,3,3,1,1,1,2,1,1,0,0,2,1,0,0,3,1,0,0,3,3,0,1,0,1,2, | |
| 1445 | 0,2,0,2,0,1,2,3,2,1,1,0,3,3,3,3,3,3,1,0,3,0,0,2,0,3,2,0,2,2,0,1, | |
| 1446 | }, | |
| 1447 | {0,1,3,5,6,-1}, | |
| 1448 | {1,3} | |
| 1449 | }, | |
| 1450 | ||
| 1451 | { | |
| 1452 | { | |
| 1453 | 0,1,1,2,1,3,1,1,0,0,3,1,1,1,2,0,3,2,0,1,1,2,3,3,3,0,3,0,0,2,0,3, | |
| 1454 | 3,2,0,0,3,2,3,1,2,3,0,3,2,0,1,2,2,2,0,2,0,1,2,2,3,1,2,2,1,1,1,1, | |
| 1455 | }, | |
| 1456 | {0,2,3,4,5,7}, | |
| 1457 | {2,7} | |
| 1458 | }, | |
| 1459 | ||
| 1460 | { | |
| 1461 | { | |
| 1462 | 0,1,2,0,3,3,0,3,2,1,3,3,0,3,1,1,3,2,3,2,3,0,0,0,3,0,2,2,3,2,2,3, | |
| 1463 | 2,2,3,1,2,3,1,2,0,3,0,2,3,1,0,0,3,2,1,2,1,2,1,3,1,0,2,3,3,1,3,2, | |
| 1464 | }, | |
| 1465 | {2,3,4,5,6,7}, | |
| 1466 | {4,6} | |
| 1467 | }, | |
| 1468 | }, | |
| 1469 | }; | |
| 1470 | ||
| 1471 | static const int fn1_game_key_scheduling[30][2] = | |
| 1472 | { | |
| 1473 | {1,29}, {1,71}, {1,81}, {2,4}, {2,54}, {3,8}, {4,56}, {4,73}, | |
| 1474 | {5,11}, {6,51}, {7,92}, {8,89}, {9,9}, {9,10}, {9,39}, {9,41}, | |
| 1475 | {9,58}, {9,59}, {9,86}, {10,90}, {11,6}, {12,64}, {13,49}, {14,44}, | |
| 1476 | {15,40}, {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, | |
| 1477 | }; | |
| 1478 | ||
| 1479 | static const int fn2_game_key_scheduling[27][2] = | |
| 1480 | { | |
| 1481 | {0,0}, {1,3}, {1,35}, {2,11}, {3,20}, {4,22}, {5,23}, {6,29}, | |
| 1482 | {7,38}, {8,39}, {9,47}, {9,55}, {9,86}, {9,87}, {9,90}, {10,50}, | |
| 1483 | {10,53}, {11,57}, {12,59}, {13,61}, {13,64}, {14,63}, {15,67}, {16,72}, | |
| 1484 | {17,83}, {18,88}, {19,94}, | |
| 1485 | }; | |
| 1486 | ||
| 1487 | static const int fn1_sequence_key_scheduling[20][2] = | |
| 1488 | { | |
| 1489 | {0,52}, {1,34}, {2,17}, {3,36}, {4,84}, {4,88}, {5,57}, {6,48}, | |
| 1490 | {6,68}, {7,76}, {8,83}, {9,30}, {10,22}, {10,41}, {11,38}, {12,55}, | |
| 1491 | {13,74}, {14,19}, {14,80}, {15,26} | |
| 1492 | }; | |
| 1493 | ||
| 1494 | static const int fn2_sequence_key_scheduling[16] = {77,34,8,42,36,27,69,66,13,9,79,31,49,7,24,64}; | |
| 1495 | ||
| 1496 | static const int fn2_middle_result_scheduling[16] = {1,10,44,68,74,78,81,95,2,4,30,40,41,51,53,58}; | |
| 1497 | ||
| 1498 | static int feistel_function(int input, const struct sbox* sboxes, UINT32 subkeys) | |
| 1499 | { | |
| 1500 | int k,m; | |
| 1501 | int aux; | |
| 1502 | int result=0; | |
| 1503 | ||
| 1504 | for (m=0; m<4; ++m) // 4 sboxes | |
| 1505 | { | |
| 1506 | for (k=0, aux=0; k<6; ++k) | |
| 1507 | { | |
| 1508 | if (sboxes[m].inputs[k]!=-1) | |
| 1509 | { | |
| 1510 | aux |= (BIT(input, sboxes[m].inputs[k])<<k); | |
| 1511 | } | |
| 1512 | } | |
| 1513 | ||
| 1514 | aux = sboxes[m].table[(aux^subkeys)&0x3f]; | |
| 1515 | ||
| 1516 | for (k=0; k<2; ++k) | |
| 1517 | { | |
| 1518 | result |= (BIT(aux,k)<<sboxes[m].outputs[k]); | |
| 1519 | } | |
| 1520 | ||
| 1521 | subkeys >>=6; | |
| 1522 | } | |
| 1523 | ||
| 1524 | return result; | |
| 1525 | } | |
| 1526 | ||
| 1527 | /************************** | |
| 1528 | This implementation is an "educational" version. It must be noted that it can be speed-optimized in a number of ways. | |
| 1529 | The most evident one is to factor out the parts of the key-scheduling that must only be done once (like the game-key & | |
| 1530 | sequence-key parts) as noted in the comments inlined in the function. More sophisticated speed-ups can be gained by | |
| 1531 | noticing that the weak key-scheduling would allow to create some pregenerated look-up tables for doing most of the work | |
| 1532 | of the function. Even so, it would still be pretty slow, so caching techniques could be a wiser option here. | |
| 1533 | **************************/ | |
| 1534 | ||
| 1535 | static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data) | |
| 1536 | { | |
| 1537 | int j; | |
| 1538 | int aux,aux2; | |
| 1539 | int A,B; | |
| 1540 | int middle_result; | |
| 1541 | UINT32 fn1_subkeys[4]; | |
| 1542 | UINT32 fn2_subkeys[4]; | |
| 1543 | ||
| 1544 | /* Game-key scheduling; this could be done just once per game at initialization time */ | |
| 1545 | memset(fn1_subkeys,0,sizeof(UINT32)*4); | |
| 1546 | memset(fn2_subkeys,0,sizeof(UINT32)*4); | |
| 1547 | ||
| 1548 | for (j=0; j<30; ++j) | |
| 1549 | { | |
| 1550 | if (BIT(game_key, fn1_game_key_scheduling[j][0])!=0) | |
| 1551 | { | |
| 1552 | aux = fn1_game_key_scheduling[j][1]%24; | |
| 1553 | aux2 = fn1_game_key_scheduling[j][1]/24; | |
| 1554 | fn1_subkeys[aux2] ^= (1<<aux); | |
| 1555 | } | |
| 1556 | } | |
| 1557 | ||
| 1558 | for (j=0; j<27; ++j) | |
| 1559 | { | |
| 1560 | if (BIT(game_key, fn2_game_key_scheduling[j][0])!=0) | |
| 1561 | { | |
| 1562 | aux = fn2_game_key_scheduling[j][1]%24; | |
| 1563 | aux2 = fn2_game_key_scheduling[j][1]/24; | |
| 1564 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 1565 | } | |
| 1566 | } | |
| 1567 | /********************************************************/ | |
| 1568 | ||
| 1569 | /* Sequence-key scheduling; this could be done just once per decryption run */ | |
| 1570 | for (j=0; j<20; ++j) | |
| 1571 | { | |
| 1572 | if (BIT(sequence_key,fn1_sequence_key_scheduling[j][0])!=0) | |
| 1573 | { | |
| 1574 | aux = fn1_sequence_key_scheduling[j][1]%24; | |
| 1575 | aux2 = fn1_sequence_key_scheduling[j][1]/24; | |
| 1576 | fn1_subkeys[aux2] ^= (1<<aux); | |
| 1577 | } | |
| 1578 | } | |
| 1579 | ||
| 1580 | for (j=0; j<16; ++j) | |
| 1581 | { | |
| 1582 | if (BIT(sequence_key,j)!=0) | |
| 1583 | { | |
| 1584 | aux = fn2_sequence_key_scheduling[j]%24; | |
| 1585 | aux2 = fn2_sequence_key_scheduling[j]/24; | |
| 1586 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 1587 | } | |
| 1588 | } | |
| 1589 | ||
| 1590 | // subkeys bits 10 & 41 | |
| 1591 | fn2_subkeys[0] ^= (BIT(sequence_key,2)<<10); | |
| 1592 | fn2_subkeys[1] ^= (BIT(sequence_key,4)<<17); | |
| 1593 | /**************************************************************/ | |
| 1594 | ||
| 1595 | // First Feistel Network | |
| 1596 | ||
| 1597 | aux = BITSWAP16(counter,5,12,14,13,9,3,6,4, 8,1,15,11,0,7,10,2); | |
| 1598 | ||
| 1599 | // 1st round | |
| 1600 | B = aux >> 8; | |
| 1601 | A = (aux & 0xff) ^ feistel_function(B,fn1_sboxes[0],fn1_subkeys[0]); | |
| 1602 | ||
| 1603 | // 2nd round | |
| 1604 | B = B ^ feistel_function(A,fn1_sboxes[1],fn1_subkeys[1]); | |
| 1605 | ||
| 1606 | // 3rd round | |
| 1607 | A = A ^ feistel_function(B,fn1_sboxes[2],fn1_subkeys[2]); | |
| 1608 | ||
| 1609 | // 4th round | |
| 1610 | B = B ^ feistel_function(A,fn1_sboxes[3],fn1_subkeys[3]); | |
| 1611 | ||
| 1612 | middle_result = (B<<8)|A; | |
| 1613 | ||
| 1614 | ||
| 1615 | /* Middle-result-key sheduling */ | |
| 1616 | for (j=0; j<16; ++j) | |
| 1617 | { | |
| 1618 | if (BIT(middle_result,j)!=0) | |
| 1619 | { | |
| 1620 | aux = fn2_middle_result_scheduling[j]%24; | |
| 1621 | aux2 = fn2_middle_result_scheduling[j]/24; | |
| 1622 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 1623 | } | |
| 1624 | } | |
| 1625 | /*********************/ | |
| 1626 | ||
| 1627 | // Second Feistel Network | |
| 1628 | ||
| 1629 | aux = BITSWAP16(data,14,3,8,12,13,7,15,4, 6,2,9,5,11,0,1,10); | |
| 1630 | ||
| 1631 | // 1st round | |
| 1632 | B = aux >> 8; | |
| 1633 | A = (aux & 0xff) ^ feistel_function(B,fn2_sboxes[0],fn2_subkeys[0]); | |
| 1634 | ||
| 1635 | // 2nd round | |
| 1636 | B = B ^ feistel_function(A,fn2_sboxes[1],fn2_subkeys[1]); | |
| 1637 | ||
| 1638 | // 3rd round | |
| 1639 | A = A ^ feistel_function(B,fn2_sboxes[2],fn2_subkeys[2]); | |
| 1640 | ||
| 1641 | // 4th round | |
| 1642 | B = B ^ feistel_function(A,fn2_sboxes[3],fn2_subkeys[3]); | |
| 1643 | ||
| 1644 | aux = (B<<8)|A; | |
| 1645 | ||
| 1646 | aux = BITSWAP16(aux,15,7,6,14,13,12,5,4, 3,2,11,10,9,1,0,8); | |
| 1647 | ||
| 1648 | return aux; | |
| 1649 | } | |
| 1650 | ||
| 1651 | static void stream_decrypt(UINT32 game_key, UINT32 sequence_key, UINT16 seed, UINT8* ciphertext, UINT8* plaintext, int length) | |
| 1652 | { | |
| 1653 | UINT16 counter = seed; | |
| 1654 | UINT16 last_word; | |
| 1655 | UINT16 plain_word; | |
| 1656 | UINT16 aux_word; | |
| 1657 | int control_bits; | |
| 1658 | UINT16 heading_word; | |
| 1659 | ||
| 1660 | last_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1661 | control_bits = last_word&3; | |
| 1662 | ++counter; ciphertext+=2; | |
| 1663 | ||
| 1664 | aux_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1665 | heading_word = (last_word&~3) | (aux_word&3); | |
| 1666 | last_word = aux_word; | |
| 1667 | ++counter; ciphertext+=2; | |
| 1668 | ||
| 1669 | if (BIT(control_bits,1)==0) // no decompression, just decryption | |
| 1670 | { | |
| 1671 | for (; length>0; length-=2, ++counter, ciphertext+=2) | |
| 1672 | { | |
| 1673 | aux_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1674 | plain_word = (last_word&~3) | (aux_word&3); | |
| 1675 | last_word = aux_word; | |
| 1676 | ||
| 1677 | *(plaintext++) = plain_word>>8; | |
| 1678 | *(plaintext++) = plain_word&0xff; | |
| 1679 | } | |
| 1680 | } | |
| 1681 | else // decryption plus decompression | |
| 1682 | { | |
| 1683 | fatalerror("NAOMI ASIC compression unsupported\n"); | |
| 1684 | return; // not implemented, decompression has not been fully reverse engineered as of february/2010 | |
| 1685 | } | |
| 1686 | } | |
| 1687 | ||
| 976 | 1688 | /*************************************************************************** |
| 977 | 1689 | DEVICE INTERFACE |
| 978 | 1690 | ***************************************************************************/ |
| r7500 | r7501 | |
| 1010 | 1722 | { |
| 1011 | 1723 | v->prot_translate = &naomibd_translate_tbl[i].transtbl[0]; |
| 1012 | 1724 | v->prot_reverse_bytes = naomibd_translate_tbl[i].reverse_bytes; |
| 1725 | v->dc_gamekey = naomibd_translate_tbl[i].live_key; | |
| 1013 | 1726 | break; |
| 1014 | 1727 | } |
| 1015 | 1728 | } |
| r7500 | r7501 | |
|---|---|---|
| 253 | 253 | }; |
| 254 | 254 | |
| 255 | 255 | |
| 256 | ||
| 256 | Z | |
| 257 | 257 | { |
| 258 | 258 | DEVCB_CPU_INPUT_LINE("ipu", INPUT_LINE_IRQ0), /* interrupt handler */ |
| 259 | 259 | DEVCB_NULL, |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #include "includes/matmania.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static UINT8 from_main,from_mcu; | |
| 15 | static int mcu_sent = 0,main_sent = 0; | |
| 16 | ||
| 17 | ||
| 18 | 14 | /*************************************************************************** |
| 19 | 15 | |
| 20 | 16 | Mania Challenge 68705 protection interface |
| r7500 | r7501 | |
| 23 | 19 | |
| 24 | 20 | ***************************************************************************/ |
| 25 | 21 | |
| 26 | static UINT8 portA_in,portA_out,ddrA; | |
| 22 | READ8_HANDLER( maniach_68705_port_a_r ) | |
| 23 | { | |
| 24 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 27 | 25 | |
| 28 | READ8_HANDLER( maniach_68705_portA_r ) | |
| 29 | { | |
| 30 | //logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),portA_in); | |
| 31 | return (portA_out & ddrA) | (portA_in & ~ddrA); | |
| 26 | //logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in); | |
| 27 | return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a); | |
| 32 | 28 | } |
| 33 | 29 | |
| 34 | WRITE8_HANDLER( maniach_68705_port | |
| 30 | WRITE8_HANDLER( maniach_68705_port_a_w ) | |
| 35 | 31 | { |
| 36 | //logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data); | |
| 37 | portA_out = data; | |
| 32 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 33 | ||
| 34 | //logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data); | |
| 35 | state->port_a_out = data; | |
| 38 | 36 | } |
| 39 | 37 | |
| 40 | WRITE8_HANDLER( maniach_68705_ddr | |
| 38 | WRITE8_HANDLER( maniach_68705_ddr_a_w ) | |
| 41 | 39 | { |
| 42 | ddrA = data; | |
| 40 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 41 | state->ddr_a = data; | |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | 44 | |
| r7500 | r7501 | |
| 53 | 52 | * 2 W when 0->1, copies port A to the latch for the main CPU |
| 54 | 53 | */ |
| 55 | 54 | |
| 56 | static UINT8 portB_in,portB_out,ddrB; | |
| 57 | ||
| 58 | READ8_HANDLER( maniach_68705_portB_r ) | |
| 55 | READ8_HANDLER( maniach_68705_port_b_r ) | |
| 59 | 56 | { |
| 60 | return (portB_out & ddrB) | (portB_in & ~ddrB); | |
| 57 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 58 | return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b); | |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | WRITE8_HANDLER( maniach_68705_port | |
| 61 | WRITE8_HANDLER( maniach_68705_port_b_w ) | |
| 64 | 62 | { |
| 65 | ||
| 63 | matmania_state | |
| 66 | 64 | |
| 67 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) | |
| 65 | //logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data); | |
| 66 | ||
| 67 | if (BIT(state->ddr_b, 1) && BIT(~data, 1) && BIT(state->port_b_out, 1)) | |
| 68 | 68 | { |
| 69 | portA_in = from_main; | |
| 70 | main_sent = 0; | |
| 71 | //logerror("read command %02x from main cpu\n",portA_in); | |
| 69 | state->port_a_in = state->from_main; | |
| 70 | state->main_sent = 0; | |
| 71 | //logerror("read command %02x from main cpu\n", state->port_a_in); | |
| 72 | 72 | } |
| 73 | if ((ddr | |
| 73 | if (BIT(state->ddr_b, 2 | |
| 74 | 74 | { |
| 75 | //logerror("send command %02x to main cpu\n",portA_out); | |
| 76 | from_mcu = portA_out; | |
| 77 | mcu_sent = 1; | |
| 75 | //logerror("send command %02x to main cpu\n", state->port_a_out); | |
| 76 | state->from_mcu = state->port_a_out; | |
| 77 | state->mcu_sent = 1; | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | port | |
| 80 | state->port_b_out = data; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | WRITE8_HANDLER( maniach_68705_ddr | |
| 83 | WRITE8_HANDLER( maniach_68705_ddr_b_w ) | |
| 84 | 84 | { |
| 85 | ddrB = data; | |
| 85 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 86 | state->ddr_b = data; | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | |
| 89 | static UINT8 portC_in,portC_out,ddrC; | |
| 90 | READ8_HANDLER( maniach_68705_port_c_r ) | |
| 91 | { | |
| 92 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 90 | 93 | |
| 91 | READ8_HANDLER( maniach_68705_portC_r ) | |
| 92 | { | |
| 93 | portC_in = 0; | |
| 94 | if (main_sent) portC_in |= 0x01; | |
| 95 | if (!mcu_sent) portC_in |= 0x02; | |
| 96 | //logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(space->cpu),portC_in); | |
| 97 | return (portC_out & ddrC) | (portC_in & ~ddrC); | |
| 94 | state->port_c_in = 0; | |
| 95 | ||
| 96 | if (state->main_sent) | |
| 97 | state->port_c_in |= 0x01; | |
| 98 | ||
| 99 | if (!state->mcu_sent) | |
| 100 | state->port_c_in |= 0x02; | |
| 101 | ||
| 102 | //logerror("%04x: 68705 port C read %02x\n",state->cpu_get_pc(space->cpu), state->port_c_in); | |
| 103 | ||
| 104 | return (state->port_c_out & state->ddr_c) | (state->port_c_in & ~state->ddr_c); | |
| 98 | 105 | } |
| 99 | 106 | |
| 100 | WRITE8_HANDLER( maniach_68705_port | |
| 107 | WRITE8_HANDLER( maniach_68705_port_c_w ) | |
| 101 | 108 | { |
| 102 | //logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(space->cpu),data); | |
| 103 | portC_out = data; | |
| 109 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 110 | ||
| 111 | //logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data); | |
| 112 | state->port_c_out = data; | |
| 104 | 113 | } |
| 105 | 114 | |
| 106 | WRITE8_HANDLER( maniach_68705_ddr | |
| 115 | WRITE8_HANDLER( maniach_68705_ddr_c_w ) | |
| 107 | 116 | { |
| 108 | ddrC = data; | |
| 117 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 118 | state->ddr_c = data; | |
| 109 | 119 | } |
| 110 | 120 | |
| 111 | 121 | |
| 112 | 122 | WRITE8_HANDLER( maniach_mcu_w ) |
| 113 | 123 | { |
| 114 | //logerror("%04x: 3040_w %02x\n",cpu_get_pc(space->cpu),data); | |
| 115 | from_main = data; | |
| 116 | main_sent = 1; | |
| 124 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 125 | ||
| 126 | //logerror("%04x: 3040_w %02x\n", cpu_get_pc(space->cpu), data); | |
| 127 | state->from_main = data; | |
| 128 | state->main_sent = 1; | |
| 117 | 129 | } |
| 118 | 130 | |
| 119 | 131 | READ8_HANDLER( maniach_mcu_r ) |
| 120 | 132 | { |
| 121 | //logerror("%04x: 3040_r %02x\n",cpu_get_pc(space->cpu),from_mcu); | |
| 122 | mcu_sent = 0; | |
| 123 | return from_mcu; | |
| 133 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 134 | ||
| 135 | //logerror("%04x: 3040_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu); | |
| 136 | state->mcu_sent = 0; | |
| 137 | return state->from_mcu; | |
| 124 | 138 | } |
| 125 | 139 | |
| 126 | 140 | READ8_HANDLER( maniach_mcu_status_r ) |
| 127 | 141 | { |
| 142 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 128 | 143 | int res = 0; |
| 129 | 144 | |
| 130 | 145 | /* bit 0 = when 0, mcu has sent data to the main cpu */ |
| 131 | 146 | /* bit 1 = when 1, mcu is ready to receive data from main cpu */ |
| 132 | //logerror("%04x: 3041_r\n",cpu_get_pc(space->cpu)); | |
| 133 | if (!mcu_sent) res |= 0x01; | |
| 134 | if (!main_sent) res |= 0x02; | |
| 147 | //logerror("%04x: 3041_r\n", cpu_get_pc(space->cpu)); | |
| 148 | if (!state->mcu_sent) | |
| 149 | res |= 0x01; | |
| 150 | if (!state->main_sent) | |
| 151 | res |= 0x02; | |
| 135 | 152 | |
| 136 | 153 | return res; |
| 137 | 154 | } |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | #include "cpu/z80/z80.h" |
| 3 | 3 | #include "includes/lsasquad.h" |
| 4 | 4 | |
| 5 | ||
| 6 | /* coin inputs are inverted in storming */ | |
| 7 | int lsasquad_invertcoin; | |
| 8 | ||
| 9 | ||
| 10 | 5 | /*************************************************************************** |
| 11 | 6 | |
| 12 | 7 | main <-> sound CPU communication |
| 13 | 8 | |
| 14 | 9 | ***************************************************************************/ |
| 15 | 10 | |
| 16 | static int sound_nmi_enable,pending_nmi,sound_cmd,sound_result; | |
| 17 | int lsasquad_sound_pending; | |
| 18 | ||
| 19 | 11 | static TIMER_CALLBACK( nmi_callback ) |
| 20 | 12 | { |
| 21 | if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 22 | else pending_nmi = 1; | |
| 13 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 14 | ||
| 15 | if (state->sound_nmi_enable) | |
| 16 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 17 | else | |
| 18 | state->pending_nmi = 1; | |
| 23 | 19 | } |
| 24 | 20 | |
| 25 | 21 | WRITE8_HANDLER( lsasquad_sh_nmi_disable_w ) |
| 26 | 22 | { |
| 27 | sound_nmi_enable = 0; | |
| 23 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 24 | state->sound_nmi_enable = 0; | |
| 28 | 25 | } |
| 29 | 26 | |
| 30 | 27 | WRITE8_HANDLER( lsasquad_sh_nmi_enable_w ) |
| 31 | 28 | { |
| 32 | sound_nmi_enable = 1; | |
| 33 | if (pending_nmi) | |
| 29 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 30 | ||
| 31 | state->sound_nmi_enable = 1; | |
| 32 | if (state->pending_nmi) | |
| 34 | 33 | { |
| 35 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | pending_nmi = 0; | |
| 34 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 35 | state->pending_nmi = 0; | |
| 37 | 36 | } |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | WRITE8_HANDLER( lsasquad_sound_command_w ) |
| 41 | 40 | { |
| 42 | lsasquad_sound_pending |= 0x01; | |
| 43 | sound_cmd = data; | |
| 44 | //logerror("%04x: sound cmd %02x\n",cpu_get_pc(space->cpu),data); | |
| 45 | timer_call_after_resynch(space->machine, NULL, data,nmi_callback); | |
| 41 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 42 | state->sound_pending |= 0x01; | |
| 43 | state->sound_cmd = data; | |
| 44 | ||
| 45 | //logerror("%04x: sound cmd %02x\n", cpu_get_pc(space->cpu), data); | |
| 46 | timer_call_after_resynch(space->machine, NULL, data, nmi_callback); | |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | READ8_HANDLER( lsasquad_sh_sound_command_r ) |
| 49 | 50 | { |
| 50 | lsasquad_sound_pending &= ~0x01; | |
| 51 | //logerror("%04x: read sound cmd %02x\n",cpu_get_pc(space->cpu),sound_cmd); | |
| 52 | return sound_cmd; | |
| 51 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 52 | state->sound_pending &= ~0x01; | |
| 53 | //logerror("%04x: read sound cmd %02x\n", cpu_get_pc(space->cpu), state->sound_cmd); | |
| 54 | return state->sound_cmd; | |
| 53 | 55 | } |
| 54 | 56 | |
| 55 | 57 | WRITE8_HANDLER( lsasquad_sh_result_w ) |
| 56 | 58 | { |
| 57 | lsasquad_sound_pending |= 0x02; | |
| 58 | //logerror("%04x: sound res %02x\n",cpu_get_pc(space->cpu),data); | |
| 59 | sound_result = data; | |
| 59 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 60 | state->sound_pending |= 0x02; | |
| 61 | //logerror("%04x: sound res %02x\n", cpu_get_pc(space->cpu), data); | |
| 62 | state->sound_result = data; | |
| 60 | 63 | } |
| 61 | 64 | |
| 62 | 65 | READ8_HANDLER( lsasquad_sound_result_r ) |
| 63 | 66 | { |
| 64 | lsasquad_sound_pending &= ~0x02; | |
| 65 | //logerror("%04x: read sound res %02x\n",cpu_get_pc(space->cpu),sound_result); | |
| 66 | return sound_result; | |
| 67 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 68 | state->sound_pending &= ~0x02; | |
| 69 | //logerror("%04x: read sound res %02x\n", cpu_get_pc(space->cpu), state->sound_result); | |
| 70 | return state->sound_result; | |
| 67 | 71 | } |
| 68 | 72 | |
| 69 | 73 | READ8_HANDLER( lsasquad_sound_status_r ) |
| 70 | 74 | { |
| 75 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 76 | ||
| 71 | 77 | /* bit 0: message pending for sound cpu */ |
| 72 | 78 | /* bit 1: message pending for main cpu */ |
| 73 | return | |
| 79 | return | |
| 74 | 80 | } |
| 75 | 81 | |
| 76 | 82 | |
| 77 | 83 | READ8_HANDLER( daikaiju_sh_sound_command_r ) |
| 78 | 84 | { |
| 79 | lsasquad_sound_pending &= ~0x01; | |
| 80 | lsasquad_sound_pending |= 0x02; | |
| 81 | //logerror("%04x: read sound cmd %02x\n",cpu_get_pc(space->cpu),sound_cmd); | |
| 82 | return sound_cmd; | |
| 85 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 86 | state->sound_pending &= ~0x01; | |
| 87 | state->sound_pending |= 0x02; | |
| 88 | //logerror("%04x: read sound cmd %02x\n", cpu_get_pc(space->cpu), state->sound_cmd); | |
| 89 | return state->sound_cmd; | |
| 83 | 90 | } |
| 84 | 91 | |
| 85 | 92 | READ8_HANDLER( daikaiju_sound_status_r ) |
| 86 | 93 | { |
| 94 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 95 | ||
| 87 | 96 | /* bit 0: message pending for sound cpu */ |
| 88 | 97 | /* bit 1: message pending for main cpu */ |
| 89 | return | |
| 98 | return | |
| 90 | 99 | } |
| 91 | 100 | |
| 92 | 101 | |
| r7500 | r7501 | |
| 98 | 107 | |
| 99 | 108 | ***************************************************************************/ |
| 100 | 109 | |
| 101 | static UINT8 from_main,from_mcu; | |
| 102 | static int mcu_sent = 0,main_sent = 0; | |
| 110 | READ8_HANDLER( lsasquad_68705_port_a_r ) | |
| 111 | { | |
| 112 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 103 | 113 | |
| 104 | static UINT8 portA_in,portA_out,ddrA; | |
| 114 | //logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in); | |
| 115 | return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a); | |
| 116 | } | |
| 105 | 117 | |
| 106 | RE | |
| 118 | WRITE | |
| 107 | 119 | { |
| 108 | //logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),portA_in); | |
| 109 | return (portA_out & ddrA) | (portA_in & ~ddrA); | |
| 110 | } | |
| 120 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 111 | 121 | |
| 112 | WRITE8_HANDLER( lsasquad_68705_portA_w ) | |
| 113 | { | |
| 114 | //logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data); | |
| 115 | portA_out = data; | |
| 122 | //logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data); | |
| 123 | state->port_a_out = data; | |
| 116 | 124 | } |
| 117 | 125 | |
| 118 | WRITE8_HANDLER( lsasquad_68705_ddr | |
| 126 | WRITE8_HANDLER( lsasquad_68705_ddr_a_w ) | |
| 119 | 127 | { |
| 120 | ddrA = data; | |
| 128 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 129 | state->ddr_a = data; | |
| 121 | 130 | } |
| 122 | 131 | |
| 123 | 132 | |
| r7500 | r7501 | |
| 131 | 140 | * 2 W when 0->1, copies port A to the latch for the main CPU |
| 132 | 141 | */ |
| 133 | 142 | |
| 134 | static UINT8 portB_in,portB_out,ddrB; | |
| 135 | ||
| 136 | READ8_HANDLER( lsasquad_68705_portB_r ) | |
| 143 | READ8_HANDLER( lsasquad_68705_port_b_r ) | |
| 137 | 144 | { |
| 138 | return (portB_out & ddrB) | (portB_in & ~ddrB); | |
| 145 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 146 | return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b); | |
| 139 | 147 | } |
| 140 | 148 | |
| 141 | WRITE8_HANDLER( lsasquad_68705_port | |
| 149 | WRITE8_HANDLER( lsasquad_68705_port_b_w ) | |
| 142 | 150 | { |
| 143 | ||
| 151 | | |
| 144 | 152 | |
| 145 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) | |
| 153 | //logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data); | |
| 154 | ||
| 155 | if ((state->ddr_b & 0x02) && (~data & 0x02) && (state->port_b_out & 0x02)) | |
| 146 | 156 | { |
| 147 | portA_in = from_main; | |
| 148 | if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); | |
| 149 | main_sent = 0; | |
| 150 | //logerror("read command %02x from main cpu\n",portA_in); | |
| 157 | state->port_a_in = state->from_main; | |
| 158 | if (state->main_sent) | |
| 159 | cpu_set_input_line(state->mcu, 0, CLEAR_LINE); | |
| 160 | state->main_sent = 0; | |
| 161 | //logerror("read command %02x from main cpu\n", state->port_a_in); | |
| 151 | 162 | } |
| 152 | if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) | |
| 163 | ||
| 164 | if ((state->ddr_b & 0x04) && (data & 0x04) && (~state->port_b_out & 0x04)) | |
| 153 | 165 | { |
| 154 | //logerror("send command %02x to main cpu\n",portA_out); | |
| 155 | from_mcu = portA_out; | |
| 156 | mcu_sent = 1; | |
| 166 | //logerror("send command %02x to main cpu\n", state->port_a_out); | |
| 167 | state->from_mcu = state->port_a_out; | |
| 168 | state->mcu_sent = 1; | |
| 157 | 169 | } |
| 158 | 170 | |
| 159 | port | |
| 171 | state->port_b_out = data; | |
| 160 | 172 | } |
| 161 | 173 | |
| 162 | WRITE8_HANDLER( lsasquad_68705_ddr | |
| 174 | WRITE8_HANDLER( lsasquad_68705_ddr_b_w ) | |
| 163 | 175 | { |
| 164 | ddrB = data; | |
| 176 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 177 | state->ddr_b = data; | |
| 165 | 178 | } |
| 166 | 179 | |
| 167 | 180 | WRITE8_HANDLER( lsasquad_mcu_w ) |
| 168 | 181 | { |
| 169 | //logerror("%04x: mcu_w %02x\n",cpu_get_pc(space->cpu),data); | |
| 170 | from_main = data; | |
| 171 | main_sent = 1; | |
| 172 | cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); | |
| 182 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 183 | ||
| 184 | //logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data); | |
| 185 | state->from_main = data; | |
| 186 | state->main_sent = 1; | |
| 187 | cpu_set_input_line(state->mcu, 0, ASSERT_LINE); | |
| 173 | 188 | } |
| 174 | 189 | |
| 175 | 190 | READ8_HANDLER( lsasquad_mcu_r ) |
| 176 | 191 | { |
| 177 | //logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu),from_mcu); | |
| 178 | mcu_sent = 0; | |
| 179 | return from_mcu; | |
| 192 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 193 | ||
| 194 | //logerror("%04x: mcu_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu); | |
| 195 | state->mcu_sent = 0; | |
| 196 | return state->from_mcu; | |
| 180 | 197 | } |
| 181 | 198 | |
| 182 | 199 | READ8_HANDLER( lsasquad_mcu_status_r ) |
| 183 | 200 | { |
| 201 | lsasquad_state *state = (lsasquad_state *)space->machine->driver_data; | |
| 184 | 202 | int res = input_port_read(space->machine, "MCU?"); |
| 185 | 203 | |
| 186 | 204 | /* bit 0 = when 1, mcu is ready to receive data from main cpu */ |
| 187 | 205 | /* bit 1 = when 0, mcu has sent data to the main cpu */ |
| 188 | //logerror("%04x: mcu_status_r\n",cpu_get_pc(space->cpu)); | |
| 189 | if (!main_sent) res |= 0x01; | |
| 190 | if (!mcu_sent) res |= 0x02; | |
| 206 | //logerror("%04x: mcu_status_r\n",cpu_get_pc(space->cpu)); | |
| 207 | if (!state->main_sent) | |
| 208 | res |= 0x01; | |
| 209 | if (!state->mcu_sent) | |
| 210 | res |= 0x02; | |
| 191 | 211 | |
| 192 | return res ^ | |
| 212 | return res ^ | |
| 193 | 213 | } |
| r7500 | r7501 | |
|---|---|---|
| 787 | 787 | { "xmcotaj", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 |
| 788 | 788 | { "xmcotaj1", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 |
| 789 | 789 | { "xmcotaj2", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 |
| 790 | { "xmcotaj3", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 | |
| 790 | 791 | { "xmcotajr", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 |
| 791 | 792 | { "xmcotaa", { 0x0795a4e2,0xdb3f861c }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0 |
| 792 | 793 | { "armwar", { 0x9e9d4c0b,0x8a39081f }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0 |
| r7500 | r7501 | |
|---|---|---|
| 396 | 396 | /* resolve our write callbacks */ |
| 397 | 397 | devcb_resolve_write8(&state->out[0], &config->out[0], device); |
| 398 | 398 | devcb_resolve_write8(&state->out[1], &config->out[1], device); |
| 399 | ||
| 399 | #if 0 | |
| 400 | INT32 lastcoins,lastbuttons; | |
| 401 | INT32 credits; | |
| 402 | INT32 coins[2]; | |
| 403 | INT32 coins_per_cred[2]; | |
| 404 | INT32 creds_per_coin[2]; | |
| 405 | INT32 in_count; | |
| 406 | INT32 mode,coincred_mode,remap_joy; | |
| 407 | #endif | |
| 400 | 408 | state_save_register_device_item(device, 0, state->lastcoins); |
| 401 | 409 | state_save_register_device_item(device, 0, state->lastbuttons); |
| 402 | 410 | state_save_register_device_item(device, 0, state->credits); |
| r7500 | r7501 | |
| 404 | 412 | state_save_register_device_item_array(device, 0, state->coins_per_cred); |
| 405 | 413 | state_save_register_device_item_array(device, 0, state->creds_per_coin); |
| 406 | 414 | state_save_register_device_item(device, 0, state->in_count); |
| 415 | state_save_register_device_item(device, 0, state->mode); | |
| 416 | state_save_register_device_item(device, 0, state->coincred_mode); | |
| 417 | state_save_register_device_item(device, 0, state->remap_joy); | |
| 407 | 418 | } |
| 408 | 419 | |
| 409 | 420 |
| r7500 | r7501 | |
|---|---|---|
| 615 | 615 | }; |
| 616 | 616 | |
| 617 | 617 | |
| 618 | /* slapstic 137412-114: | |
| 618 | /* slapstic 137412-114: Pit | |
| 619 | 619 | static const struct slapstic_data slapstic114 = |
| 620 | 620 | { |
| 621 | 621 | /* basic banking */ |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #include "includes/nitedrvr.h" |
| 9 | 9 | #include "sound/discrete.h" |
| 10 | 10 | |
| 11 | static UINT8 nitedrvr_gear; | |
| 12 | static UINT8 nitedrvr_track; | |
| 13 | static INT32 nitedrvr_steering_buf; | |
| 14 | static INT32 nitedrvr_steering_val; | |
| 15 | static UINT8 nitedrvr_crash_en; | |
| 16 | static UINT8 nitedrvr_crash_data; | |
| 17 | static UINT8 nitedrvr_crash_data_en; // IC D8 | |
| 18 | static UINT8 ac_line; | |
| 19 | static INT32 last_steering_val; | |
| 20 | ||
| 21 | 11 | /*************************************************************************** |
| 22 | 12 | Steering |
| 23 | 13 | |
| r7500 | r7501 | |
| 27 | 17 | because D6 and D7 are apparently checked at different times, and a |
| 28 | 18 | change in-between can affect the direction you move. |
| 29 | 19 | ***************************************************************************/ |
| 30 | static int nitedrvr_steering(running_machine *machine) | |
| 20 | ||
| 21 | static int nitedrvr_steering( running_machine *machine ) | |
| 31 | 22 | { |
| 32 | int this_val; | |
| 33 | int delta; | |
| 23 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 24 | int this_val = input_port_read(machine, "STEER"); | |
| 25 | int delta = this_val - state->last_steering_val; | |
| 34 | 26 | |
| 35 | t | |
| 27 | state->last_steering_val = | |
| 36 | 28 | |
| 37 | delta=this_val-last_steering_val; | |
| 38 | last_steering_val=this_val; | |
| 39 | if (delta>128) delta-=256; | |
| 40 | else if (delta<-128) delta+=256; | |
| 29 | if (delta > 128) | |
| 30 | delta -= 256; | |
| 31 | else if (delta < -128) | |
| 32 | delta += 256; | |
| 33 | ||
| 41 | 34 | /* Divide by four to make our steering less sensitive */ |
| 42 | | |
| 35 | s | |
| 43 | 36 | |
| 44 | if ( | |
| 37 | if (s | |
| 45 | 38 | { |
| 46 | nitedrvr_steering_buf--; | |
| 47 | nitedrvr_steering_val=0xC0; | |
| 39 | state->steering_buf--; | |
| 40 | state->steering_val = 0xc0; | |
| 48 | 41 | } |
| 49 | else if ( | |
| 42 | else if (s | |
| 50 | 43 | { |
| 51 | nitedrvr_steering_buf++; | |
| 52 | nitedrvr_steering_val=0x80; | |
| 44 | state->steering_buf++; | |
| 45 | state->steering_val = 0x80; | |
| 53 | 46 | } |
| 54 | 47 | else |
| 55 | 48 | { |
| 56 | | |
| 49 | s | |
| 57 | 50 | } |
| 58 | 51 | |
| 59 | return | |
| 52 | return s | |
| 60 | 53 | } |
| 61 | 54 | |
| 62 | 55 | /*************************************************************************** |
| 63 | 56 | nitedrvr_steering_reset |
| 64 | 57 | ***************************************************************************/ |
| 58 | ||
| 65 | 59 | READ8_HANDLER( nitedrvr_steering_reset_r ) |
| 66 | 60 | { |
| 67 | nitedrvr_steering_val = 0; | |
| 61 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 62 | state->steering_val = 0; | |
| 68 | 63 | return 0; |
| 69 | 64 | } |
| 70 | 65 | |
| 71 | 66 | WRITE8_HANDLER( nitedrvr_steering_reset_w ) |
| 72 | 67 | { |
| 73 | nitedrvr_steering_val = 0; | |
| 68 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 69 | state->steering_val = 0; | |
| 74 | 70 | } |
| 75 | 71 | |
| 76 | 72 | |
| r7500 | r7501 | |
| 104 | 100 | |
| 105 | 101 | READ8_HANDLER( nitedrvr_in0_r ) |
| 106 | 102 | { |
| 107 | int gear; | |
| 103 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 104 | int gear = input_port_read(space->machine, "GEARS"); | |
| 108 | 105 | |
| 109 | gear = input_port_read(space->machine, "GEARS"); | |
| 110 | if (gear & 0x10) nitedrvr_gear=1; | |
| 111 | else if (gear & 0x20) nitedrvr_gear=2; | |
| 112 | else if (gear & 0x40) nitedrvr_gear=3; | |
| 113 | else if (gear & 0x80) nitedrvr_gear=4; | |
| 106 | if (gear & 0x10) state->gear = 1; | |
| 107 | else if (gear & 0x20) state->gear = 2; | |
| 108 | else if (gear & 0x40) state->gear = 3; | |
| 109 | else if (gear & 0x80) state->gear = 4; | |
| 114 | 110 | |
| 115 | 111 | switch (offset & 0x03) |
| 116 | 112 | { |
| r7500 | r7501 | |
| 119 | 115 | case 0x01: /* No remapping necessary */ |
| 120 | 116 | return input_port_read(space->machine, "DSW1"); |
| 121 | 117 | case 0x02: /* Remap our gear shift */ |
| 122 | if (nitedrvr_gear==1) return 0xE0; | |
| 123 | else if (nitedrvr_gear==2) return 0xD0; | |
| 124 | else if (nitedrvr_gear==3) return 0xB0; | |
| 125 | else return 0x70; | |
| 118 | if (state->gear == 1) | |
| 119 | return 0xe0; | |
| 120 | else if (state->gear == 2) | |
| 121 | return 0xd0; | |
| 122 | else if (state->gear == 3) | |
| 123 | return 0xb0; | |
| 124 | else | |
| 125 | return 0x70; | |
| 126 | 126 | case 0x03: /* Remap our steering */ |
| 127 | 127 | return (input_port_read(space->machine, "DSW2") | nitedrvr_steering(space->machine)); |
| 128 | 128 | default: |
| 129 | return 0x | |
| 129 | return 0xff; | |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| r7500 | r7501 | |
| 164 | 164 | |
| 165 | 165 | READ8_HANDLER( nitedrvr_in1_r ) |
| 166 | 166 | { |
| 167 | int port; | |
| 167 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 168 | int port = input_port_read(space->machine, "IN0"); | |
| 168 | 169 | |
| 169 | ac_line=(ac_line+1) % 3; | |
| 170 | state->ac_line = (state->ac_line + 1) % 3; | |
| 170 | 171 | |
| 171 | port = input_port_read(space->machine, "IN0"); | |
| 172 | if (port & 0x10) nitedrvr_track=0; | |
| 173 | else if (port & 0x20) nitedrvr_track=1; | |
| 174 | else if (port & 0x40) nitedrvr_track=2; | |
| 172 | if (port & 0x10) state->track = 0; | |
| 173 | else if (port & 0x20) state->track = 1; | |
| 174 | else if (port & 0x40) state->track = 2; | |
| 175 | 175 | |
| 176 | 176 | switch (offset & 0x07) |
| 177 | 177 | { |
| r7500 | r7501 | |
| 184 | 184 | case 0x03: |
| 185 | 185 | return ((port & 0x08) << 4); |
| 186 | 186 | case 0x04: |
| 187 | if ( | |
| 187 | if (s | |
| 188 | 188 | case 0x05: |
| 189 | if ( | |
| 189 | if (s | |
| 190 | 190 | case 0x06: |
| 191 | 191 | /* TODO: fix alternating signal? */ |
| 192 | if (ac_line==0) return 0x80; else return 0x00; | |
| 192 | if (state->ac_line==0) return 0x80; else return 0x00; | |
| 193 | 193 | case 0x07: |
| 194 | 194 | return 0x00; |
| 195 | 195 | default: |
| 196 | return 0x | |
| 196 | return 0xff; | |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
| r7500 | r7501 | |
| 209 | 209 | D4 = SKID1 |
| 210 | 210 | D5 = SKID2 |
| 211 | 211 | ***************************************************************************/ |
| 212 | ||
| 212 | 213 | WRITE8_HANDLER( nitedrvr_out0_w ) |
| 213 | 214 | { |
| 214 | running_device *discrete = devtag_get_device(space->machine, "discrete"); | |
| 215 | discrete_sound_w(discrete, NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data | |
| 216 | discrete_sound_w(discrete, NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable | |
| 217 | discrete_sound_w(discrete, NITEDRVR_SKID2_EN, data & 0x20); // Skid2 enable | |
| 215 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 216 | ||
| 217 | discrete_sound_w(state->discrete, NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data | |
| 218 | discrete_sound_w(state->discrete, NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable | |
| 219 | discrete_sound_w(state->discrete, NITEDRVR_SKID2_EN, data & 0x20); // Skid2 enable | |
| 218 | 220 | } |
| 219 | 221 | |
| 220 | 222 | /*************************************************************************** |
| r7500 | r7501 | |
| 227 | 229 | D4 = LED START |
| 228 | 230 | D5 = Spare (Not used) |
| 229 | 231 | ***************************************************************************/ |
| 232 | ||
| 230 | 233 | WRITE8_HANDLER( nitedrvr_out1_w ) |
| 231 | 234 | { |
| 232 | | |
| 235 | | |
| 233 | 236 | |
| 234 | set_led_status(space->machine, 0,data & 0x10); | |
| 237 | set_led_status(space->machine, 0, data & 0x10); | |
| 235 | 238 | |
| 236 | nitedrvr_crash_en = data & 0x01; | |
| 237 | discrete_sound_w(discrete, NITEDRVR_CRASH_EN, nitedrvr_crash_en); // Crash enable | |
| 238 | discrete_sound_w(discrete, NITEDRVR_ATTRACT_EN, data & 0x02); // Attract enable (sound disable) | |
| 239 | state->crash_en = data & 0x01; | |
| 239 | 240 | |
| 240 | if (!nitedrvr_crash_en) | |
| 241 | discrete_sound_w(state->discrete, NITEDRVR_CRASH_EN, state->crash_en); // Crash enable | |
| 242 | discrete_sound_w(state->discrete, NITEDRVR_ATTRACT_EN, data & 0x02); // Attract enable (sound disable) | |
| 243 | ||
| 244 | if (!state->crash_en) | |
| 241 | 245 | { |
| 242 | 246 | /* Crash reset, set counter high and enable output */ |
| 243 | nitedrvr_crash_data_en = 1; | |
| 244 | nitedrvr_crash_data = 0x0f; | |
| 247 | state->crash_data_en = 1; | |
| 248 | state->crash_data = 0x0f; | |
| 245 | 249 | /* Invert video */ |
| 246 | palette_set_color(space->machine,1,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 247 | palette_set_color(space->machine,0,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 250 | palette_set_color(space->machine, 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 251 | palette_set_color(space->machine, 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 248 | 252 | } |
| 249 | discrete_sound_w(discrete, NITEDRVR_BANG_DATA, | |
| 253 | discrete_sound_w(state->discrete, NITEDRVR_BANG_DATA, s | |
| 250 | 254 | } |
| 251 | 255 | |
| 252 | 256 | |
| 253 | 257 | TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback ) |
| 254 | 258 | { |
| 255 | if (nitedrvr_crash_en && nitedrvr_crash_data_en) | |
| 259 | nitedrvr_state *state = (nitedrvr_state *)timer->machine->driver_data; | |
| 260 | ||
| 261 | if (state->crash_en && state->crash_data_en) | |
| 256 | 262 | { |
| 257 | running_device *discrete = devtag_get_device(timer->machine, "discrete"); | |
| 263 | state->crash_data--; | |
| 264 | discrete_sound_w(state->discrete, NITEDRVR_BANG_DATA, state->crash_data); // Crash Volume | |
| 265 | if (!state->crash_data) | |
| 266 | state->crash_data_en = 0; // Done counting? | |
| 258 | 267 | |
| 259 | nitedrvr_crash_data--; | |
| 260 | discrete_sound_w(discrete, NITEDRVR_BANG_DATA, nitedrvr_crash_data); // Crash Volume | |
| 261 | if (!nitedrvr_crash_data) nitedrvr_crash_data_en = 0; // Done counting? | |
| 262 | if (nitedrvr_crash_data & 0x01) | |
| 268 | if (state->crash_data & 0x01) | |
| 263 | 269 | { |
| 264 | 270 | /* Invert video */ |
| 265 | palette_set_color(timer->machine,1,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 266 | palette_set_color(timer->machine,0,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 271 | palette_set_color(timer->machine, 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 272 | palette_set_color(timer->machine, 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 267 | 273 | } |
| 268 | 274 | else |
| 269 | 275 | { |
| 270 | 276 | /* Normal video */ |
| 271 | palette_set_color(timer->machine,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 272 | palette_set_color(timer->machine,1,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 277 | palette_set_color(timer->machine, 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 278 | palette_set_color(timer->machine, 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 273 | 279 | } |
| 274 | 280 | } |
| 275 | 281 | } |
| 276 | 282 | |
| 277 | 283 | MACHINE_START( nitedrvr ) |
| 278 | 284 | { |
| 279 | state_save_register_global(machine, nitedrvr_gear); | |
| 280 | state_save_register_global(machine, nitedrvr_track); | |
| 281 | state_save_register_global(machine, nitedrvr_steering_buf); | |
| 282 | state_save_register_global(machine, nitedrvr_steering_val); | |
| 283 | state_save_register_global(machine, nitedrvr_crash_en); | |
| 284 | state_save_register_global(machine, nitedrvr_crash_data); | |
| 285 | state_save_register_global(machine, nitedrvr_crash_data_en); | |
| 286 | state_save_register_global(machine, ac_line); | |
| 287 | state_save_register_global(machine, last_steering_val); | |
| 285 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 286 | ||
| 287 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 288 | state->discrete = devtag_get_device(machine, "discrete"); | |
| 289 | ||
| 290 | state_save_register_global(machine, state->gear); | |
| 291 | state_save_register_global(machine, state->track); | |
| 292 | state_save_register_global(machine, state->steering_buf); | |
| 293 | state_save_register_global(machine, state->steering_val); | |
| 294 | state_save_register_global(machine, state->crash_en); | |
| 295 | state_save_register_global(machine, state->crash_data); | |
| 296 | state_save_register_global(machine, state->crash_data_en); | |
| 297 | state_save_register_global(machine, state->ac_line); | |
| 298 | state_save_register_global(machine, state->last_steering_val); | |
| 288 | 299 | } |
| 289 | 300 | |
| 290 | 301 | MACHINE_RESET( nitedrvr ) |
| 291 | 302 | { |
| 292 | nitedrvr_gear = 1; | |
| 293 | nitedrvr_track = 0; | |
| 294 | nitedrvr_steering_buf = 0; | |
| 295 | nitedrvr_steering_val = 0; | |
| 296 | nitedrvr_crash_en = 0; | |
| 297 | nitedrvr_crash_data = 0x0f; | |
| 298 | nitedrvr_crash_data_en = 0; | |
| 299 | ac_line = 0; | |
| 300 | last_steering_val = 0; | |
| 303 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 304 | ||
| 305 | state->gear = 1; | |
| 306 | state->track = 0; | |
| 307 | state->steering_buf = 0; | |
| 308 | state->steering_val = 0; | |
| 309 | state->crash_en = 0; | |
| 310 | state->crash_data = 0x0f; | |
| 311 | state->crash_data_en = 0; | |
| 312 | state->ac_line = 0; | |
| 313 | state->last_steering_val = 0; | |
| 301 | 314 | } |
| r7500 | r7501 | |
|---|---|---|
| 191 | 191 | DRIVER( mooncrstu ) /* (c) 1980 Nichibutsu USA */ |
| 192 | 192 | DRIVER( mooncrsto ) /* (c) 1980 Nichibutsu */ |
| 193 | 193 | DRIVER( mooncrstg ) /* (c) 1980 Gremlin */ |
| 194 | DRIVER( mooncrstuk )/* (c) 1980 Nichibutsu UK */ | |
| 194 | 195 | DRIVER( smooncrs ) /* Gremlin */ |
| 195 | 196 | DRIVER( mooncmw ) /* bootleg */ |
| 196 | 197 | DRIVER( mooncrsb ) /* bootleg */ |
| r7500 | r7501 | |
| 342 | 343 | DRIVER( scorpion ) /* (c) 1982 Zaccaria */ |
| 343 | 344 | DRIVER( scorpiona ) /* (c) 1982 Zaccaria */ |
| 344 | 345 | DRIVER( scorpionb ) /* (c) 1982 Zaccaria */ |
| 346 | DRIVER( aracnis ) /* bootleg */ | |
| 345 | 347 | DRIVER( ad2083 ) /* (c) 1983 Midcoin */ |
| 346 | 348 | DRIVER( turpins ) /* (c) 1981 bootleg */ |
| 347 | 349 | |
| r7500 | r7501 | |
| 928 | 930 | DRIVER( motoxgo ) /* (c) 1997 */ |
| 929 | 931 | DRIVER( timecrs2 ) /* (c) 1997 */ |
| 930 | 932 | DRIVER( timecrs2b ) /* (c) 1997 */ |
| 933 | DRIVER( timecrs2c ) /* (c) 1997 */ | |
| 931 | 934 | DRIVER( panicprk ) /* (c) 1998 */ |
| 932 | 935 | DRIVER( 500gp ) /* (c) 1999 */ |
| 933 | 936 | DRIVER( finfurl2 ) /* (c) 1999 */ |
| r7500 | r7501 | |
| 1294 | 1297 | DRIVER( indianbt ) /* (c) 1980 Taito */ |
| 1295 | 1298 | DRIVER( steelwkr ) /* (c) 1980 Taito */ |
| 1296 | 1299 | DRIVER( m79amb ) /* (c) 1977 RamTek */ |
| 1297 | DRIVER( alieninv ) /* bootleg */ | |
| 1300 | DRIVER( alieninv ) /* Margamatics */ | |
| 1301 | DRIVER( alieninvp2 ) /* bootleg */ | |
| 1298 | 1302 | DRIVER( tst_invd ) /* Test ROM */ |
| 1299 | 1303 | DRIVER( sitv ) /* (c) 1979 Taito */ |
| 1300 | 1304 | DRIVER( sicv ) /* (c) 1979 Taito */ |
| r7500 | r7501 | |
| 1821 | 1825 | DRIVER( arktayt2 ) /* bootleg */ |
| 1822 | 1826 | DRIVER( arkatour ) /* ??? (c) 1987 Taito America Corporation + Romstar license (US) */ |
| 1823 | 1827 | DRIVER( tetrsark ) /* ??? (c) D.R.Korea */ |
| 1828 | DRIVER( hexa ) /* D. R. Korea */ | |
| 1824 | 1829 | DRIVER( sqix ) /* B03 1987 */ |
| 1825 | 1830 | DRIVER( sqixr1 ) /* B03 1987 */ |
| 1826 | 1831 | DRIVER( sqixu ) /* B03 1987 */ |
| r7500 | r7501 | |
| 2318 | 2323 | DRIVER( batridj ) /* (c) 1998 Raizing/8ing */ |
| 2319 | 2324 | DRIVER( batridk ) /* (c) 1998 Raizing/8ing */ |
| 2320 | 2325 | DRIVER( batridja ) /* (c) 1998 Raizing/8ing */ |
| 2326 | DRIVER( batridta ) /* (c) 1998 Raizing/8ing */ | |
| 2321 | 2327 | DRIVER( bkraidu ) /* (c) 1999 8ing */ |
| 2322 | 2328 | DRIVER( bkraiduj ) /* (c) 1999 8ing */ |
| 2323 | 2329 | DRIVER( bkraidj ) /* (c) 1999 8ing */ |
| r7500 | r7501 | |
| 2771 | 2777 | DRIVER( xmcota ) /* 05/01/1995 (c) 1994 (Euro) */ |
| 2772 | 2778 | DRIVER( xmcotau ) /* 05/01/1995 (c) 1994 (US) */ |
| 2773 | 2779 | DRIVER( xmcotah ) /* 31/03/1995 (c) 1994 (Hispanic) */ |
| 2774 | DRIVER( xmcotaj ) /* 22/12/1994 (c) 1994 (Japan) */ | |
| 2775 | DRIVER( xmcotaj1 ) /* 19/12/1994 (c) 1994 (Japan) */ | |
| 2776 | DRIVER( xmcotaj2 ) /* 17/12/1994 (c) 1994 (Japan) */ | |
| 2780 | DRIVER( xmcotaj ) /* 05/01/1995 (c) 1994 (Japan) */ | |
| 2781 | DRIVER( xmcotaj1 ) /* 22/12/1994 (c) 1994 (Japan) */ | |
| 2782 | DRIVER( xmcotaj2 ) /* 19/12/1994 (c) 1994 (Japan) */ | |
| 2783 | DRIVER( xmcotaj3 ) /* 17/12/1994 (c) 1994 (Japan) */ | |
| 2777 | 2784 | DRIVER( xmcotaa ) /* 17/12/1994 (c) 1994 (Asia) */ |
| 2778 | 2785 | DRIVER( xmcotajr ) /* 08/12/1994 (c) 1994 (Japan Rent) */ |
| 2779 | 2786 | DRIVER( nwarr ) /* 16/03/1995 (c) 1995 (Euro) */ |
| r7500 | r7501 | |
| 3162 | 3169 | DRIVER( ehrgeizj ) /* 1998.05 Ehrgeiz (EG1, Japan) */ |
| 3163 | 3170 | DRIVER( sws98 ) /* 1998.06 Super World Stadium '98 (SS81/VER.A, Japan) */ |
| 3164 | 3171 | DRIVER( soulclbr ) /* 1998.?? Soul Calibur (SOC14/VER.C) */ |
| 3172 | DRIVER( soulclbrb ) /* 1998.?? Soul Calibur (SOC14/VER.B) */ | |
| 3165 | 3173 | DRIVER( soulclbrj ) /* 1998.07 Soul Calibur (SOC11/VER.C, Japan) */ |
| 3166 | DRIVER( soulclbrb ) /* 1998.?? Soul Calibur (SOC13/VER.B) */ | |
| 3174 | DRIVER( soulclbrb2 ) /* 1998.?? Soul Calibur (SOC13/VER.B) */ | |
| 3167 | 3175 | DRIVER( soulclbrjb )/* 1998.?? Soul Calibur (SOC11/VER.B, Japan) */ |
| 3168 | 3176 | DRIVER( soulclbrja )/* 1998.?? Soul Calibur (SOC11/VER.A2, Japan) */ |
| 3169 | 3177 | /* 1998.07 Techno Drive */ |
| r7500 | r7501 | |
| 3545 | 3553 | DRIVER( depthcho ) /* ? [1977 Gremlin?] */ |
| 3546 | 3554 | DRIVER( subhunt ) /* ? [1977 Taito] */ |
| 3547 | 3555 | DRIVER( safari ) /* 57-66 [1977 Gremlin?] */ |
| 3556 | DRIVER( safaria ) /* bootleg? */ | |
| 3548 | 3557 | DRIVER( frogs ) /* 112-119 [1978 Gremlin?] */ |
| 3549 | 3558 | DRIVER( sspaceat ) /* 155-162 (c) */ |
| 3550 | 3559 | DRIVER( sspaceat2 ) /* 155-162 (c) 1979 Sega */ |
| r7500 | r7501 | |
| 4267 | 4276 | |
| 4268 | 4277 | /* Step 2.1 */ |
| 4269 | 4278 | DRIVER( daytona2 ) /* 1998.06 Daytona USA 2 */ |
| 4270 | | |
| 4279 | DRIVER( oceanhun ) /* 1998.09 Ocean Hunter */ | |
| 4271 | 4280 | DRIVER( spikeout ) /* 1998.09 Spikeout */ |
| 4272 | 4281 | DRIVER( dirtdvls ) /* 1998.10 Dirt Devils */ |
| 4273 | 4282 | DRIVER( dirtdvlsa ) |
| 4274 | 4283 | DRIVER( swtrilgy ) /* 1998.11 Star Wars Trilogy Arcade */ |
| 4275 | 4284 | DRIVER( swtrilgya ) |
| 4276 | 4285 | /* 1998.11 Magical Torokko Adventure (Japan) */ |
| 4277 | | |
| 4286 | DRIVER( lamachin ) /* 1998.12 L.A. Machine Guns */ | |
| 4278 | 4287 | DRIVER( dayto2pe ) /* 1998.12 Daytone USA 2 Power Edition */ |
| 4279 | 4288 | /* 1998.12 Virtua Striker 2 ver.99 */ |
| 4280 | 4289 | DRIVER( spikeofe ) /* 1999.01 Spikeout Final Edition */ |
| r7500 | r7501 | |
| 4549 | 4558 | DRIVER( chocomk ) /* 2002.06 Musapey no Choco Marker */ |
| 4550 | 4559 | /* 2002.07 Mazan */ |
| 4551 | 4560 | /* 2002.09 Yonin Uchi Mahjong MJ */ |
| 4552 | | |
| 4561 | DRIVER( azumanga ) /* 2002.12 Azumanga Daiou Puzzle Bobble */ | |
| 4553 | 4562 | DRIVER( moeru ) /* 2002.12 Moeru Casinyo */ |
| 4554 | 4563 | DRIVER( quizqgd ) /* 2003.01 Quiz Keitai Q mode */ |
| 4555 | 4564 | /* 2003.03 Yonin Uchi Mahjong MJ Network Taisen ver. */ |
| r7500 | r7501 | |
| 5335 | 5344 | DRIVER( battlnts ) /* GX777 (c) 1987 */ |
| 5336 | 5345 | DRIVER( battlntsj ) /* GX777 (c) 1987 (Japan) */ |
| 5337 | 5346 | DRIVER( bladestl ) /* GX797 (c) 1987 */ |
| 5347 | DRIVER( bladestll ) /* GX797 (c) 1987 */ | |
| 5338 | 5348 | DRIVER( bladestle ) /* GX797 (c) 1987 */ |
| 5339 | 5349 | DRIVER( hcastle ) /* GX768 (c) 1988 */ |
| 5340 | 5350 | DRIVER( hcastleo ) /* GX768 (c) 1988 */ |
| r7500 | r7501 | |
| 5718 | 5728 | DRIVER( circusse ) /* bootleg */ |
| 5719 | 5729 | DRIVER( robotbwl ) /* no copyright notice */ |
| 5720 | 5730 | DRIVER( crash ) /* Exidy [1979?] */ |
| 5731 | DRIVER( smash ) /* bootleg */ | |
| 5721 | 5732 | DRIVER( ripcord ) /* Exidy [1977?] */ |
| 5722 | 5733 | DRIVER( starfire ) /* Exidy [1979?] */ |
| 5723 | 5734 | DRIVER( starfirea ) /* Exidy [1979?] */ |
| r7500 | r7501 | |
| 6155 | 6166 | DRIVER( hydrap ) /* (proto) (c) 1990 */ |
| 6156 | 6167 | DRIVER( hydrap2 ) /* (proto) (c) 1990 */ |
| 6157 | 6168 | DRIVER( pitfight ) /* 136081 (c) 1990 */ |
| 6169 | DRIVER( pitfight7 ) /* 136081 (c) 1990 */ | |
| 6158 | 6170 | DRIVER( pitfight6 ) /* 136081 (c) 1990 */ |
| 6159 | 6171 | DRIVER( pitfight5 ) /* 136081 (c) 1990 */ |
| 6160 | 6172 | DRIVER( pitfight4 ) /* 136081 (c) 1990 */ |
| r7500 | r7501 | |
| 6998 | 7010 | |
| 6999 | 7011 | /* Midway Touchmaster / Galaxy Games */ |
| 7000 | 7012 | DRIVER( tm ) /* (c) 1996 Midway Games */ |
| 7013 | DRIVER( tmdo ) /* (c) 1996 Midway Games */ | |
| 7001 | 7014 | DRIVER( tm2k ) /* (c) 1996 Midway Games */ |
| 7002 | 7015 | DRIVER( tm3k ) /* (c) 1997 Midway Games */ |
| 7003 | 7016 | DRIVER( tm3ka ) /* (c) 1997 Midway Games */ |
| 7004 | 7017 | DRIVER( tm4k ) /* (c) 1998 Midway Games */ |
| 7018 | DRIVER( tm4ka ) /* (c) 1998 Midway Games */ | |
| 7005 | 7019 | DRIVER( tm5k ) /* (c) 1998 Midway Games */ |
| 7006 | 7020 | DRIVER( tm5kca ) /* (c) 1998 Midway Games */ |
| 7007 | 7021 | DRIVER( tm5ka ) /* (c) 1998 Midway Games */ |
| r7500 | r7501 | |
| 7064 | 7078 | DRIVER( thepit ) /* (c) 1982 Taito */ |
| 7065 | 7079 | DRIVER( thepitc ) /* (c) 1982 Centuri */ |
| 7066 | 7080 | DRIVER( thepitb ) /* bootleg */ |
| 7081 | DRIVER( thepitm ) /* bootleg */ | |
| 7067 | 7082 | DRIVER( dockman ) /* (c) 1982 Taito Corp. */ |
| 7068 | 7083 | DRIVER( portman ) /* (c) 1982 Nova Games Ltd. */ |
| 7069 | 7084 | DRIVER( funnymou ) /* (c) 1982 Chuo Co. Ltd */ |
| r7500 | r7501 | |
| 7896 | 7911 | DRIVER( pushman ) /* (c) 1990 Comad */ |
| 7897 | 7912 | DRIVER( pushmana ) /* (c) 1990 Comad */ |
| 7898 | 7913 | DRIVER( pushmans ) /* (c) 1990 Comad + American Sammy license */ |
| 7914 | DRIVER( pushmant ) /* (c) 1990 Comad + Top Tronic license */ | |
| 7899 | 7915 | DRIVER( bballs ) /* (c) 1991 Comad */ |
| 7900 | 7916 | DRIVER( zerozone ) /* (c) 1993 Comad */ |
| 7901 | 7917 | DRIVER( lvgirl94 ) /* (c) 1994 Comad */ |
| r7500 | r7501 | |
| 8123 | 8139 | DRIVER( janptr96 ) /* 1996 Dynax */ |
| 8124 | 8140 | DRIVER( sprtmtch ) /* "31" (c) 1989 Dynax + Fabtek license */ |
| 8125 | 8141 | DRIVER( maya ) /* (c) 1994 Promat */ |
| 8142 | DRIVER( mayaa ) /* (c) 1994 Promat */ | |
| 8126 | 8143 | DRIVER( inca ) /* (c) 199? ???? */ |
| 8127 | 8144 | DRIVER( blktouch ) /* (c) Yang Gi Co Ltd. */ |
| 8128 | 8145 | DRIVER( mcnpshnt ) /* "33" Mahjong Campus Hunting 1990 Dynax */ |
| r7500 | r7501 | |
| 8657 | 8674 | DRIVER( monzagp ) /* (c) 1981 Olympia */ |
| 8658 | 8675 | DRIVER( dday ) /* (c) 1982 Olympia */ |
| 8659 | 8676 | DRIVER( ddayc ) /* (c) 1982 Olympia + Centuri license */ |
| 8660 | DRIVER( hexa ) /* D. R. Korea */ | |
| 8661 | 8677 | DRIVER( stactics ) /* [1981 Sega] */ |
| 8662 | 8678 | DRIVER( exterm ) /* (c) 1989 Premier Technology - a Gottlieb game */ |
| 8663 | 8679 | DRIVER( kingofb ) /* (c) 1985 Woodplace Inc. */ |
| r7500 | r7501 | |
| 9270 | 9286 | DRIVER( leader ) /* Bootleg? */ |
| 9271 | 9287 | DRIVER( livequiz ) /* (c) 1999 Andamiro */ |
| 9272 | 9288 | DRIVER( cowrace ) /* (c) 20?? hack */ |
| 9289 | DRIVER( kingdrbb ) /* (c) 199? hack */ | |
| 9273 | 9290 | DRIVER( discoboy ) /* (c) 1993 Soft Art Co. */ |
| 9274 | 9291 | DRIVER( pangofun ) /* (c) 1995 InfoCube */ |
| 9275 | 9292 | DRIVER( 2mindril ) /* (c) 1993 Taito */ |
| r7500 | r7501 | |
| 9426 | 9443 | DRIVER( cmv801 ) /* (c) 198? Corsica */ |
| 9427 | 9444 | DRIVER( cmv4 ) /* (c) 1992 Dyna Electronics */ |
| 9428 | 9445 | DRIVER( cmv4a ) /* (c) 1992 Dyna Electronics */ |
| 9446 | DRIVER( cmwm ) /* (c) 199? Dyna Electronics */ | |
| 9447 | DRIVER( cmfun ) /* (c) 1995 Dyna Electronics */ | |
| 9429 | 9448 | DRIVER( cmaster ) /* (c) 1991 Dyna Electronics */ |
| 9430 | 9449 | DRIVER( cmasterb ) /* (c) 1991 Dyna Electronics */ |
| 9431 | 9450 | DRIVER( cmasterc ) /* (c) 1991 Dyna Electronics */ |
| r7500 | r7501 | |
| 9477 | 9496 | |
| 9478 | 9497 | /* Eagle */ |
| 9479 | 9498 | DRIVER( janshi ) |
| 9499 | DRIVER( pinkiri8 ) | |
| 9480 | 9500 | |
| 9481 | 9501 | /* Wing */ |
| 9482 | 9502 | DRIVER( slotcarn ) /* (c) 1985 Wing Co. Ltd */ |
| r7500 | r7501 | |
| 9673 | 9693 | DRIVER( fb6sev2 ) /* (c) 200? Amcoe */ |
| 9674 | 9694 | DRIVER( version4 ) /* (c) 200? Amcoe - Version 4 ? */ |
| 9675 | 9695 | DRIVER( bugfever ) /* (c) 200? Amcoe - Bug Fever */ |
| 9696 | DRIVER( bugfevero ) /* (c) 200? Amcoe */ | |
| 9676 | 9697 | DRIVER( bugfeverd ) /* (c) 200? Amcoe */ |
| 9677 | 9698 | DRIVER( bugfeverv ) /* (c) 200? Amcoe */ |
| 9678 | DRIVER( bugfeverv2 )/* (c) 200? Amcoe */ | |
| 9699 | DRIVER( bugfeverv2 ) /* (c) 200? Amcoe */ | |
| 9679 | 9700 | DRIVER( dvisland ) /* (c) 200? Amcoe - Devil's Island */ |
| 9680 | 9701 | DRIVER( funriver ) /* (c) 200? Amcoe - Fun River */ |
| 9681 | 9702 | DRIVER( funriverv ) /* (c) 200? Amcoe */ |
| r7500 | r7501 | |
| 9744 | 9765 | |
| 9745 | 9766 | DRIVER( chsuper3 ) /* unknown */ |
| 9746 | 9767 | DRIVER( chsuper2 ) /* unknown */ |
| 9768 | DRIVER( chmpnum ) /* unknown */ | |
| 9747 | 9769 | DRIVER( 3super8 ) /* unknown */ |
| 9748 | 9770 | DRIVER( buster ) /* (c) 1987 Marian Electronics Ltd. */ |
| 9749 | 9771 | DRIVER( spielbud ) /* (c) 1985 ADP */ |
| r7500 | r7501 | |
| 10004 | 10026 | DRIVER( am_mg24 ) /* (c) Amatic 2000 */ |
| 10005 | 10027 | DRIVER( am_mg3 ) /* (c) Amatic 2000 */ |
| 10006 | 10028 | |
| 10007 | DRIVER( pinkiri8 ) | |
| 10008 | 10029 | DRIVER( neptunp2 ) |
| 10030 | DRIVER( rgum ) | |
| 10009 | 10031 | |
| 10032 | /* Diatec */ | |
| 10033 | DRIVER( unclepoo ) | |
| 10034 | ||
| 10010 | 10035 | #endif /* DRIVER_RECURSIVE */ |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | #define NITEDRVR_ATTRACT_EN NODE_06 |
| 16 | 16 | |
| 17 | 17 | |
| 18 | class nitedrvr_state | |
| 19 | { | |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nitedrvr_state(machine)); } | |
| 22 | ||
| 23 | nitedrvr_state(running_machine &machine) { } | |
| 24 | ||
| 25 | /* memory pointers */ | |
| 26 | UINT8 * hvc; | |
| 27 | UINT8 * videoram; | |
| 28 | ||
| 29 | /* video-related */ | |
| 30 | tilemap_t *bg_tilemap; | |
| 31 | ||
| 32 | /* input */ | |
| 33 | UINT8 gear; | |
| 34 | UINT8 track; | |
| 35 | INT32 steering_buf; | |
| 36 | INT32 steering_val; | |
| 37 | UINT8 crash_en; | |
| 38 | UINT8 crash_data; | |
| 39 | UINT8 crash_data_en; // IC D8 | |
| 40 | UINT8 ac_line; | |
| 41 | INT32 last_steering_val; | |
| 42 | ||
| 43 | /* devices */ | |
| 44 | running_device *maincpu; | |
| 45 | running_device *discrete; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 18 | 49 | /*----------- defined in machine/nitedrvr.c -----------*/ |
| 19 | 50 | |
| 20 | 51 | READ8_HANDLER( nitedrvr_in0_r ); |
| r7500 | r7501 | |
| 37 | 68 | |
| 38 | 69 | /*----------- defined in video/nitedrvr.c -----------*/ |
| 39 | 70 | |
| 40 | extern UINT8 *nitedrvr_hvc; | |
| 41 | ||
| 42 | 71 | WRITE8_HANDLER( nitedrvr_hvc_w ); |
| 43 | 72 | WRITE8_HANDLER( nitedrvr_videoram_w ); |
| 44 | 73 |
| r7500 | r7501 | |
|---|---|---|
| 27 | 27 | #define IREMM15_VBSTART (240) |
| 28 | 28 | #define IREMM15_VBEND (16) |
| 29 | 29 | |
| 30 | typedef struct _m10_state m10_state; | |
| 31 | struct _m10_state | |
| 30 | class m10_state | |
| 32 | 31 | { |
| 32 | public: | |
| 33 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, m10_state(machine)); } | |
| 34 | ||
| 35 | m10_state(running_machine &machine) { } | |
| 36 | ||
| 33 | 37 | /* memory pointers */ |
| 34 | 38 | UINT8 * chargen; |
| 35 | 39 | UINT8 * memory; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _sbugger_state sbugger_state; | |
| 2 | struct _sbugger_state | |
| 1 | class sbugger_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sbugger_state(machine)); } | |
| 5 | ||
| 6 | sbugger_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *videoram; |
| 5 | 9 | UINT8 *videoram_attr; |
| 6 | 10 |
| r7500 | r7501 | |
|---|---|---|
| 1 | /*----------- defined in drivers/nycaptor.c -----------*/ | |
| 2 | 1 | |
| 3 | extern UINT8 *nycaptor_sharedram; | |
| 4 | extern int nyc_gametype; | |
| 2 | class nycaptor_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nycaptor_state(machine)); } | |
| 5 | 6 | |
| 7 | nycaptor_state(running_machine &machine) { } | |
| 6 | 8 | |
| 9 | /* memory pointers */ | |
| 10 | UINT8 * sharedram; | |
| 11 | UINT8 * scrlram; | |
| 12 | UINT8 * videoram; | |
| 13 | UINT8 * spriteram; | |
| 14 | size_t videoram_size; | |
| 15 | ||
| 16 | /* video-related */ | |
| 17 | tilemap_t *bg_tilemap; | |
| 18 | int char_bank, palette_bank, gfxctrl; | |
| 19 | ||
| 20 | /* mcu */ | |
| 21 | UINT8 from_main, from_mcu; | |
| 22 | int mcu_sent, main_sent; | |
| 23 | UINT8 port_a_in, port_a_out, ddr_a; | |
| 24 | UINT8 port_b_in, port_b_out, ddr_b; | |
| 25 | UINT8 port_c_in, port_c_out, ddr_c; | |
| 26 | ||
| 27 | /* misc */ | |
| 28 | int generic_control_reg; | |
| 29 | int sound_nmi_enable, pending_nmi; | |
| 30 | UINT8 snd_data; | |
| 31 | int vol_ctrl[16]; | |
| 32 | int gametype; | |
| 33 | ||
| 34 | /* devices */ | |
| 35 | running_device *maincpu; | |
| 36 | running_device *audiocpu; | |
| 37 | running_device *subcpu; | |
| 38 | running_device *mcu; | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 7 | 42 | /*----------- defined in machine/nycaptor.c -----------*/ |
| 8 | 43 | |
| 9 | 44 | READ8_HANDLER( nycaptor_mcu_r ); |
| 10 | 45 | READ8_HANDLER( nycaptor_mcu_status_r1 ); |
| 11 | 46 | READ8_HANDLER( nycaptor_mcu_status_r2 ); |
| 12 | READ8_HANDLER( nycaptor_68705_portC_r ); | |
| 13 | READ8_HANDLER( nycaptor_68705_portB_r ); | |
| 14 | READ8_HANDLER( nycaptor_68705_portA_r ); | |
| 47 | READ8_HANDLER( nycaptor_68705_port_c_r ); | |
| 48 | READ8_HANDLER( nycaptor_68705_port_b_r ); | |
| 49 | READ8_HANDLER( nycaptor_68705_port_a_r ); | |
| 15 | 50 | |
| 16 | 51 | WRITE8_HANDLER( nycaptor_mcu_w ); |
| 17 | WRITE8_HANDLER( nycaptor_68705_portA_w ); | |
| 18 | WRITE8_HANDLER( nycaptor_68705_portB_w ); | |
| 19 | WRITE8_HANDLER( nycaptor_68705_portC_w ); | |
| 20 | WRITE8_HANDLER( nycaptor_68705_ddrA_w ); | |
| 21 | WRITE8_HANDLER( nycaptor_68705_ddrB_w ); | |
| 22 | WRITE8_HANDLER( nycaptor_68705_ddrC_w ); | |
| 52 | WRITE8_HANDLER( nycaptor_68705_port_a_w ); | |
| 53 | WRITE8_HANDLER( nycaptor_68705_port_b_w ); | |
| 54 | WRITE8_HANDLER( nycaptor_68705_port_c_w ); | |
| 55 | WRITE8_HANDLER( nycaptor_68705_ddr_a_w ); | |
| 56 | WRITE8_HANDLER( nycaptor_68705_ddr_b_w ); | |
| 57 | WRITE8_HANDLER( nycaptor_68705_ddr_c_w ); | |
| 23 | 58 | |
| 24 | 59 | |
| 25 | 60 | /*----------- defined in video/nycaptor.c -----------*/ |
| 26 | 61 | |
| 27 | extern UINT8 *nycaptor_scrlram; | |
| 28 | ||
| 29 | VIDEO_START( nycaptor ); | |
| 30 | VIDEO_UPDATE( nycaptor ); | |
| 31 | ||
| 32 | ||
| 33 | 62 | READ8_HANDLER( nycaptor_videoram_r ); |
| 34 | 63 | READ8_HANDLER( nycaptor_spriteram_r ); |
| 35 | 64 | READ8_HANDLER( nycaptor_palette_r ); |
| r7500 | r7501 | |
| 41 | 70 | WRITE8_HANDLER( nycaptor_palette_w ); |
| 42 | 71 | WRITE8_HANDLER( nycaptor_gfxctrl_w ); |
| 43 | 72 | WRITE8_HANDLER( nycaptor_scrlram_w ); |
| 73 | ||
| 74 | VIDEO_START( nycaptor ); | |
| 75 | VIDEO_UPDATE( nycaptor ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _rainbow_state rainbow_state; | |
| 8 | struct _rainbow_state | |
| 7 | class rainbow_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rainbow_state(machine)); } | |
| 11 | ||
| 12 | rainbow_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spriteram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _mitchell_state mitchell_state; | |
| 8 | struct _mitchell_state | |
| 7 | class mitchell_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mitchell_state(machine)); } | |
| 11 | ||
| 12 | mitchell_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | *************************************************************************/ |
| 7 | 7 | |
| 8 | typedef struct _galspnbl_state galspnbl_state; | |
| 9 | struct _galspnbl_state | |
| 8 | class galspnbl_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, galspnbl_state(machine)); } | |
| 12 | ||
| 13 | galspnbl_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT16 * videoram; |
| 13 | 17 | UINT16 * bgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _blktiger_state blktiger_state; | |
| 8 | struct _blktiger_state | |
| 7 | class blktiger_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blktiger_state(machine)); } | |
| 11 | ||
| 12 | blktiger_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * txvideoram; |
| 12 | 16 | // UINT8 * spriteram; // currently this uses generic buffer_spriteram_w |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _tunhunt_state tunhunt_state; | |
| 2 | struct _tunhunt_state | |
| 1 | class tunhunt_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tunhunt_state(machine)); } | |
| 5 | ||
| 6 | tunhunt_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 control; |
| 5 | 9 | UINT8 *workram; |
| 6 | 10 | UINT8 *spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _rungun_state rungun_state; | |
| 8 | struct _rungun_state | |
| 7 | class rungun_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rungun_state(machine)); } | |
| 11 | ||
| 12 | rungun_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * _936_videoram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mad Motor | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class madmotor_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, madmotor_state(machine)); } | |
| 11 | ||
| 12 | madmotor_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf1_data; | |
| 17 | UINT16 * pf2_data; | |
| 18 | UINT16 * pf3_data; | |
| 19 | UINT16 * pf1_control; | |
| 20 | UINT16 * pf2_control; | |
| 21 | UINT16 * pf3_control; | |
| 22 | UINT16 * spriteram; | |
| 23 | // UINT16 * paletteram; // this currently uses generic palette handlers | |
| 24 | size_t spriteram_size; | |
| 25 | ||
| 26 | /* video-related */ | |
| 27 | tilemap_t *pf1_tilemap, *pf2_tilemap, *pf3_tilemap, *pf3a_tilemap; | |
| 28 | int flipscreen; | |
| 29 | ||
| 30 | /* devices */ | |
| 31 | running_device *maincpu; | |
| 32 | running_device *audiocpu; | |
| 33 | }; | |
| 34 | ||
| 35 | ||
| 36 | /*----------- defined in video/madmotor.c -----------*/ | |
| 37 | ||
| 38 | WRITE16_HANDLER( madmotor_pf1_data_w ); | |
| 39 | WRITE16_HANDLER( madmotor_pf2_data_w ); | |
| 40 | WRITE16_HANDLER( madmotor_pf3_data_w ); | |
| 41 | ||
| 42 | VIDEO_START( madmotor ); | |
| 43 | VIDEO_UPDATE( madmotor ); |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _eprom_state eprom_state; | |
| 10 | struct _eprom_state | |
| 9 | class eprom_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, eprom_state(machine)); } | |
| 13 | ||
| 14 | eprom_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | int screen_intensity; |
| 14 | 18 | int video_disable; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Skyfox | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class skyfox_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, skyfox_state(machine)); } | |
| 11 | ||
| 12 | skyfox_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * spriteram; | |
| 16 | size_t spriteram_size; | |
| 17 | ||
| 18 | /* video-related */ | |
| 19 | UINT8 vreg[8]; | |
| 20 | int bg_pos, bg_ctrl; | |
| 21 | ||
| 22 | /* misc */ | |
| 23 | int palette_selected; | |
| 24 | ||
| 25 | /* devices */ | |
| 26 | running_device *maincpu; | |
| 27 | }; | |
| 28 | ||
| 29 | /*----------- defined in video/skyfox.c -----------*/ | |
| 30 | ||
| 31 | WRITE8_HANDLER( skyfox_vregs_w ); | |
| 32 | ||
| 33 | PALETTE_INIT( skyfox ); | |
| 34 | ||
| 35 | VIDEO_UPDATE( skyfox ); | |
| 36 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _bublbobl_state bublbobl_state; | |
| 3 | struct _bublbobl_state | |
| 2 | class bublbobl_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bublbobl_state(machine)); } | |
| 6 | ||
| 7 | bublbobl_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * mcu_sharedram; |
| 7 | 11 | UINT8 * videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _aerofgt_state aerofgt_state; | |
| 3 | struct _aerofgt_state | |
| 2 | class aerofgt_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, aerofgt_state(machine)); } | |
| 6 | ||
| 7 | aerofgt_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * bg1videoram; |
| 7 | 11 | UINT16 * bg2videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _fgoal_state fgoal_state; | |
| 4 | struct _fgoal_state | |
| 3 | class fgoal_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fgoal_state(machine)); } | |
| 7 | ||
| 8 | fgoal_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * video_ram; |
| 8 | 12 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _docastle_state docastle_state; | |
| 4 | struct _docastle_state | |
| 3 | class docastle_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, docastle_state(machine)); } | |
| 7 | ||
| 8 | docastle_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * videoram; |
| 8 | 12 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | #define MYSTSTON_MASTER_CLOCK (XTAL_12MHz) |
| 11 | 11 | |
| 12 | 12 | |
| 13 | typedef struct _mystston_state mystston_state; | |
| 14 | struct _mystston_state | |
| 13 | class mystston_state | |
| 15 | 14 | { |
| 15 | public: | |
| 16 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mystston_state(machine)); } | |
| 17 | ||
| 18 | mystston_state(running_machine &machine) { } | |
| 19 | ||
| 16 | 20 | /* machine state */ |
| 17 | 21 | UINT8 *ay8910_data; |
| 18 | 22 | UINT8 *ay8910_select; |
| r7500 | r7501 | |
|---|---|---|
| 12 | 12 | #define HITME_ENABLE_VAL NODE_03 |
| 13 | 13 | #define HITME_OUT1 NODE_04 |
| 14 | 14 | |
| 15 | typedef struct _hitme_state hitme_state; | |
| 16 | struct _hitme_state | |
| 15 | class hitme_state | |
| 17 | 16 | { |
| 17 | public: | |
| 18 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hitme_state(machine)); } | |
| 19 | ||
| 20 | hitme_state(running_machine &machine) { } | |
| 21 | ||
| 18 | 22 | /* memory pointers */ |
| 19 | 23 | UINT8 * videoram; |
| 20 | 24 |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | 9 | /* shared with arcadecl hardware */ |
| 10 | typedef struct _rampart_state rampart_state; | |
| 11 | struct _rampart_state | |
| 10 | class rampart_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rampart_state(machine)); } | |
| 14 | ||
| 15 | rampart_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | atarigen_state atarigen; |
| 14 | 18 | UINT16 * bitmap; |
| 15 | 19 | UINT8 has_mo; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _sonson_state sonson_state; | |
| 8 | struct _sonson_state | |
| 7 | class sonson_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sonson_state(machine)); } | |
| 11 | ||
| 12 | sonson_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _sslam_state sslam_state; | |
| 2 | struct _sslam_state | |
| 1 | class sslam_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sslam_state(machine)); } | |
| 5 | ||
| 6 | sslam_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | emu_timer *music_timer; |
| 5 | 9 | |
| 6 | 10 | int sound; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Simple 156 based board | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class simpl156_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, simpl156_state(machine)); } | |
| 11 | ||
| 12 | simpl156_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT32 * mainram; | |
| 18 | UINT32 * systemram; | |
| 19 | ||
| 20 | /* devices */ | |
| 21 | running_device *maincpu; | |
| 22 | running_device *deco16ic; | |
| 23 | running_device *eeprom; | |
| 24 | running_device *okimusic; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | /*----------- defined in video/simpl156.c -----------*/ | |
| 30 | ||
| 31 | VIDEO_START( simpl156 ); | |
| 32 | VIDEO_UPDATE( simpl156 ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _hcastle_state hcastle_state; | |
| 8 | struct _hcastle_state | |
| 7 | class hcastle_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hcastle_state(machine)); } | |
| 11 | ||
| 12 | hcastle_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * pf1_videoram; |
| 12 | 16 | UINT8 * pf2_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _copsnrob_state copsnrob_state; | |
| 8 | struct _copsnrob_state | |
| 7 | class copsnrob_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, copsnrob_state(machine)); } | |
| 11 | ||
| 12 | copsnrob_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * trucky; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _battlnts_state battlnts_state; | |
| 8 | struct _battlnts_state | |
| 7 | class battlnts_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, battlnts_state(machine)); } | |
| 11 | ||
| 12 | battlnts_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // this currently uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | typedef struct _arabian_state arabian_state; | |
| 10 | struct _arabian_state | |
| 9 | class arabian_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, arabian_state(machine)); } | |
| 13 | ||
| 14 | arabian_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * blitter; |
| 14 | 18 | UINT8 * custom_cpu_ram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _taitoo_state taitoo_state; | |
| 8 | struct _taitoo_state | |
| 7 | class taitoo_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitoo_state(machine)); } | |
| 11 | ||
| 12 | taitoo_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _labyrunr_state labyrunr_state; | |
| 8 | struct _labyrunr_state | |
| 7 | class labyrunr_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, labyrunr_state(machine)); } | |
| 11 | ||
| 12 | labyrunr_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram1; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ccastles_state ccastles_state; | |
| 8 | struct _ccastles_state | |
| 7 | class ccastles_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ccastles_state(machine)); } | |
| 11 | ||
| 12 | ccastles_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _ddragon3_state ddragon3_state; | |
| 9 | struct _ddragon3_state | |
| 8 | class ddragon3_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ddragon3_state(machine)); } | |
| 12 | ||
| 13 | ddragon3_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT16 * bg_videoram; |
| 13 | 17 | UINT16 * fg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | #define DRAGRACE_ATTRACT_EN NODE_09 |
| 23 | 23 | |
| 24 | 24 | |
| 25 | typedef struct _dragrace_state dragrace_state; | |
| 26 | struct _dragrace_state | |
| 25 | class dragrace_state | |
| 27 | 26 | { |
| 27 | public: | |
| 28 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dragrace_state(machine)); } | |
| 29 | ||
| 30 | dragrace_state(running_machine &machine) { } | |
| 31 | ||
| 28 | 32 | /* memory pointers */ |
| 29 | 33 | UINT8 * playfield_ram; |
| 30 | 34 | UINT8 * position_ram; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "sound/discrete.h" |
| 8 | 8 | |
| 9 | 9 | /* Discrete Sound Input Nodes */ |
| 10 | #define ORBIT_NOTE_FREQ NODE_01 | |
| 11 | #define ORBIT_ANOTE1_AMP NODE_02 | |
| 12 | #define ORBIT_ANOTE2_AMP NODE_03 | |
| 13 | #define ORBIT_NOISE1_AMP NODE_04 | |
| 14 | #define ORBIT_NOISE2_AMP NODE_05 | |
| 15 | #define ORBIT_WARNING_EN NODE_06 | |
| 16 | #define ORBIT_NOISE_EN NODE_07 | |
| 10 | #define ORBIT_NOTE_FREQ NODE_01 | |
| 11 | #define ORBIT_ANOTE1_AMP NODE_02 | |
| 12 | #define ORBIT_ANOTE2_AMP NODE_03 | |
| 13 | #define ORBIT_NOISE1_AMP NODE_04 | |
| 14 | #define ORBIT_NOISE2_AMP NODE_05 | |
| 15 | #define ORBIT_WARNING_EN NODE_06 | |
| 16 | #define ORBIT_NOISE_EN NODE_07 | |
| 17 | 17 | |
| 18 | class orbit_state | |
| 19 | { | |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, orbit_state(machine)); } | |
| 18 | 22 | |
| 23 | orbit_state(running_machine &machine) { } | |
| 24 | ||
| 25 | /* memory pointers */ | |
| 26 | UINT8 * playfield_ram; | |
| 27 | UINT8 * sprite_ram; | |
| 28 | ||
| 29 | /* video-related */ | |
| 30 | tilemap_t *bg_tilemap; | |
| 31 | int flip_screen; | |
| 32 | ||
| 33 | /* misc */ | |
| 34 | UINT8 misc_flags; | |
| 35 | ||
| 36 | /* devices */ | |
| 37 | running_device *maincpu; | |
| 38 | running_device *discrete; | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 19 | 42 | /*----------- defined in audio/orbit.c -----------*/ |
| 20 | 43 | |
| 21 | 44 | WRITE8_DEVICE_HANDLER( orbit_note_w ); |
| r7500 | r7501 | |
| 30 | 53 | VIDEO_START( orbit ); |
| 31 | 54 | VIDEO_UPDATE( orbit ); |
| 32 | 55 | |
| 33 | extern UINT8* orbit_playfield_ram; | |
| 34 | extern UINT8* orbit_sprite_ram; | |
| 35 | ||
| 36 | 56 | extern WRITE8_HANDLER( orbit_playfield_w ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ambush_state ambush_state; | |
| 8 | struct _ambush_state | |
| 7 | class ambush_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ambush_state(machine)); } | |
| 11 | ||
| 12 | ambush_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _drmicro_state drmicro_state; | |
| 9 | struct _drmicro_state | |
| 8 | class drmicro_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, drmicro_state(machine)); } | |
| 12 | ||
| 13 | drmicro_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * videoram; |
| 13 | 17 |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _exedexes_state exedexes_state; | |
| 9 | struct _exedexes_state | |
| 8 | class exedexes_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, exedexes_state(machine)); } | |
| 12 | ||
| 13 | exedexes_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * videoram; |
| 13 | 17 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #define JEDI_TMS5220_CLOCK (JEDI_AUDIO_CPU_OSC / 2 / 9) /* div by 9 is via a binary counter that counts from 7 to 16 */ |
| 15 | 15 | |
| 16 | 16 | |
| 17 | typedef struct _jedi_state jedi_state; | |
| 18 | struct _jedi_state | |
| 17 | class jedi_state | |
| 19 | 18 | { |
| 19 | public: | |
| 20 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jedi_state(machine)); } | |
| 21 | ||
| 22 | jedi_state(running_machine &machine) { } | |
| 23 | ||
| 20 | 24 | /* machine state */ |
| 21 | 25 | UINT8 a2d_select; |
| 22 | 26 | UINT8 nvram_enabled; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _flkatck_state flkatck_state; | |
| 8 | struct _flkatck_state | |
| 7 | class flkatck_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, flkatck_state(machine)); } | |
| 11 | ||
| 12 | flkatck_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * k007121_ram; |
| 12 | 16 | // UINT8 * paletteram; // this currently uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _shootout_state shootout_state; | |
| 2 | struct _shootout_state | |
| 1 | class shootout_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, shootout_state(machine)); } | |
| 5 | ||
| 6 | shootout_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *background; |
| 5 | 9 | tilemap_t *foreground; |
| 6 | 10 | UINT8 *spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _contra_state contra_state; | |
| 8 | struct _contra_state | |
| 7 | class contra_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, contra_state(machine)); } | |
| 11 | ||
| 12 | contra_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * spriteram; |
| 12 | 16 | UINT8 * spriteram_2; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _volfied_state volfied_state; | |
| 8 | struct _volfied_state | |
| 7 | class volfied_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, volfied_state(machine)); } | |
| 11 | ||
| 12 | volfied_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * video_ram; |
| 12 | 16 | UINT8 * cchip_ram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | |
| 9 | typedef struct _dribling_state dribling_state; | |
| 10 | struct _dribling_state | |
| 9 | class dribling_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dribling_state(machine)); } | |
| 13 | ||
| 14 | dribling_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * videoram; |
| 14 | 18 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 25 | 25 | #define POLY17_ADD 0x18000 |
| 26 | 26 | |
| 27 | 27 | |
| 28 | typedef struct _balsente_state balsente_state; | |
| 29 | struct _balsente_state | |
| 28 | class balsente_state | |
| 30 | 29 | { |
| 30 | public: | |
| 31 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, balsente_state(machine)); } | |
| 32 | ||
| 33 | balsente_state(running_machine &machine) { } | |
| 34 | ||
| 31 | 35 | /* global data */ |
| 32 | 36 | UINT8 shooter; |
| 33 | 37 | UINT8 shooter_x; |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | INPUT_PORTS_EXTERN( aladbl ); |
| 16 | 16 | INPUT_PORTS_EXTERN( megadri6 ); |
| 17 | 17 | INPUT_PORTS_EXTERN( ssf2ghw ); |
| 18 | INPUT_PORTS_EXTERN( mk3ghw ); | |
| 18 | 19 | INPUT_PORTS_EXTERN( megdsvp ); |
| 19 | 20 | |
| 20 | 21 | MACHINE_DRIVER_EXTERN( megadriv_timers ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | class mexico86_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mexico86_state(machine)); } | |
| 6 | ||
| 7 | mexico86_state(running_machine &machine) { } | |
| 8 | ||
| 9 | /* memory pointers */ | |
| 10 | UINT8 * protection_ram; | |
| 11 | UINT8 * videoram; | |
| 12 | UINT8 * objectram; | |
| 13 | size_t objectram_size; | |
| 14 | ||
| 15 | /* video-related */ | |
| 16 | int charbank; | |
| 17 | ||
| 18 | /* mcu */ | |
| 19 | /* mexico86 68705 protection */ | |
| 20 | UINT8 port_a_in, port_a_out, ddr_a; | |
| 21 | UINT8 port_b_in, port_b_out, ddr_b; | |
| 22 | int address, latch; | |
| 23 | /* kikikai mcu simulation */ | |
| 24 | int mcu_running, mcu_initialised; | |
| 25 | int coin_last; | |
| 26 | ||
| 27 | /* devices */ | |
| 28 | running_device *maincpu; | |
| 29 | running_device *audiocpu; | |
| 30 | running_device *subcpu; | |
| 31 | running_device *mcu; | |
| 32 | }; | |
| 33 | ||
| 34 | ||
| 1 | 35 | /*----------- defined in machine/mexico86.c -----------*/ |
| 2 | 36 | |
| 3 | extern UINT8 *mexico86_protection_ram; | |
| 4 | ||
| 5 | 37 | WRITE8_HANDLER( mexico86_f008_w ); |
| 6 | 38 | INTERRUPT_GEN( kikikai_interrupt ); |
| 7 | 39 | INTERRUPT_GEN( mexico86_m68705_interrupt ); |
| 8 | READ8_HANDLER( mexico86_68705_portA_r ); | |
| 9 | WRITE8_HANDLER( mexico86_68705_portA_w ); | |
| 10 | WRITE8_HANDLER( mexico86_68705_ddrA_w ); | |
| 11 | READ8_HANDLER( mexico86_68705_portB_r ); | |
| 12 | WRITE8_HANDLER( mexico86_68705_portB_w ); | |
| 13 | WRITE8_HANDLER( mexico86_68705_ddrB_w ); | |
| 40 | READ8_HANDLER( mexico86_68705_port_a_r ); | |
| 41 | WRITE8_HANDLER( mexico86_68705_port_a_w ); | |
| 42 | WRITE8_HANDLER( mexico86_68705_ddr_a_w ); | |
| 43 | READ8_HANDLER( mexico86_68705_port_b_r ); | |
| 44 | WRITE8_HANDLER( mexico86_68705_port_b_w ); | |
| 45 | WRITE8_HANDLER( mexico86_68705_ddr_b_w ); | |
| 14 | 46 | |
| 15 | 47 | |
| 16 | 48 | /*----------- defined in video/mexico86.c -----------*/ |
| 17 | 49 | |
| 18 | extern UINT8 *mexico86_videoram,*mexico86_objectram; | |
| 19 | extern size_t mexico86_objectram_size; | |
| 50 | WRITE8_HANDLER( mexico86_bankswitch_w ); | |
| 20 | 51 | |
| 21 | WRITE8_HANDLER( mexico86_bankswitch_w ); | |
| 22 | 52 | VIDEO_UPDATE( mexico86 ); |
| 23 | 53 | VIDEO_UPDATE( kikikai ); |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | #define MCU_INITIAL_SEED 0x81 |
| 4 | 4 | |
| 5 | 5 | |
| 6 | typedef struct _chaknpop_state chaknpop_state; | |
| 7 | struct _chaknpop_state | |
| 6 | class chaknpop_state | |
| 8 | 7 | { |
| 8 | public: | |
| 9 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chaknpop_state(machine)); } | |
| 10 | ||
| 11 | chaknpop_state(running_machine &machine) { } | |
| 12 | ||
| 9 | 13 | /* memory pointers */ |
| 10 | 14 | UINT8 * mcu_ram; |
| 11 | 15 | UINT8 * tx_ram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _fitfight_state fitfight_state; | |
| 3 | struct _fitfight_state | |
| 2 | class fitfight_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fitfight_state(machine)); } | |
| 6 | ||
| 7 | fitfight_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * fof_100000; |
| 7 | 11 | UINT16 * fof_600000; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ashnojoe_state ashnojoe_state; | |
| 8 | struct _ashnojoe_state | |
| 7 | class ashnojoe_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ashnojoe_state(machine)); } | |
| 11 | ||
| 12 | ashnojoe_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * tileram; |
| 12 | 16 | UINT16 * tileram_1; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ddribble_state ddribble_state; | |
| 8 | struct _ddribble_state | |
| 7 | class ddribble_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ddribble_state(machine)); } | |
| 11 | ||
| 12 | ddribble_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * sharedram; |
| 12 | 16 | UINT8 * snd_sharedram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mouser | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mouser_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mouser_state(machine)); } | |
| 11 | ||
| 12 | mouser_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * colorram; | |
| 17 | UINT8 * spriteram; | |
| 18 | size_t spriteram_size; | |
| 19 | ||
| 20 | /* misc */ | |
| 21 | UINT8 sound_byte; | |
| 22 | UINT8 nmi_enable; | |
| 23 | ||
| 24 | /* devices */ | |
| 25 | running_device *maincpu; | |
| 26 | running_device *audiocpu; | |
| 27 | }; | |
| 28 | ||
| 29 | /*----------- defined in video/mouser.c -----------*/ | |
| 30 | ||
| 31 | WRITE8_HANDLER( mouser_flip_screen_x_w ); | |
| 32 | WRITE8_HANDLER( mouser_flip_screen_y_w ); | |
| 33 | ||
| 34 | PALETTE_INIT( mouser ); | |
| 35 | VIDEO_UPDATE( mouser ); |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _malzak_state malzak_state; | |
| 9 | struct _malzak_state | |
| 8 | class malzak_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, malzak_state(machine)); } | |
| 12 | ||
| 13 | malzak_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* misc */ |
| 12 | 16 | // int playfield_x[256]; |
| 13 | 17 | // int playfield_y[256]; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "sound/discrete.h" |
| 8 | 8 | |
| 9 | typedef struct _grchamp_state grchamp_state; | |
| 10 | struct _grchamp_state | |
| 9 | class grchamp_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, grchamp_state(machine)); } | |
| 13 | ||
| 14 | grchamp_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | UINT8 cpu0_out[16]; |
| 13 | 17 | UINT8 cpu1_out[16]; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | class lkage_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lkage_state(machine)); } | |
| 6 | ||
| 7 | lkage_state(running_machine &machine) { } | |
| 8 | ||
| 9 | UINT8 * scroll; | |
| 10 | UINT8 * vreg; | |
| 11 | UINT8 * videoram; | |
| 12 | UINT8 * spriteram; | |
| 13 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 14 | ||
| 15 | /* video-related */ | |
| 16 | tilemap_t *bg_tilemap, *fg_tilemap, *tx_tilemap; | |
| 17 | UINT8 bg_tile_bank, fg_tile_bank; | |
| 18 | ||
| 19 | /* misc */ | |
| 20 | int sound_nmi_enable, pending_nmi; | |
| 21 | ||
| 22 | /* mcu */ | |
| 23 | UINT8 from_main, from_mcu; | |
| 24 | int mcu_sent, main_sent; | |
| 25 | UINT8 port_a_in, port_a_out, ddr_a; | |
| 26 | UINT8 port_b_in, port_b_out, ddr_b; | |
| 27 | UINT8 port_c_in, port_c_out, ddr_c; | |
| 28 | ||
| 29 | /* lkageb fake mcu */ | |
| 30 | UINT8 mcu_val; | |
| 31 | int mcu_ready; /* cpu data/mcu ready status */ | |
| 32 | ||
| 33 | /* devices */ | |
| 34 | running_device *maincpu; | |
| 35 | running_device *audiocpu; | |
| 36 | running_device *mcu; | |
| 37 | }; | |
| 38 | ||
| 1 | 39 | /*----------- defined in machine/lkage.c -----------*/ |
| 2 | 40 | |
| 3 | READ8_HANDLER( lkage_68705_portA_r ); | |
| 4 | WRITE8_HANDLER( lkage_68705_portA_w ); | |
| 5 | READ8_HANDLER( lkage_68705_portB_r ); | |
| 6 | WRITE8_HANDLER( lkage_68705_portB_w ); | |
| 7 | READ8_HANDLER( lkage_68705_portC_r ); | |
| 8 | WRITE8_HANDLER( lkage_68705_portC_w ); | |
| 9 | WRITE8_HANDLER( lkage_68705_ddrA_w ); | |
| 10 | WRITE8_HANDLER( lkage_68705_ddrB_w ); | |
| 11 | WRITE8_HANDLER( lkage_68705_ddrC_w ); | |
| 41 | READ8_HANDLER( lkage_68705_port_a_r ); | |
| 42 | WRITE8_HANDLER( lkage_68705_port_a_w ); | |
| 43 | READ8_HANDLER( lkage_68705_port_b_r ); | |
| 44 | WRITE8_HANDLER( lkage_68705_port_b_w ); | |
| 45 | READ8_HANDLER( lkage_68705_port_c_r ); | |
| 46 | WRITE8_HANDLER( lkage_68705_port_c_w ); | |
| 47 | WRITE8_HANDLER( lkage_68705_ddr_a_w ); | |
| 48 | WRITE8_HANDLER( lkage_68705_ddr_b_w ); | |
| 49 | WRITE8_HANDLER( lkage_68705_ddr_c_w ); | |
| 12 | 50 | WRITE8_HANDLER( lkage_mcu_w ); |
| 13 | 51 | READ8_HANDLER( lkage_mcu_r ); |
| 14 | 52 | READ8_HANDLER( lkage_mcu_status_r ); |
| r7500 | r7501 | |
| 16 | 54 | |
| 17 | 55 | /*----------- defined in video/lkage.c -----------*/ |
| 18 | 56 | |
| 19 | extern UINT8 *lkage_scroll, *lkage_vreg; | |
| 20 | 57 | WRITE8_HANDLER( lkage_videoram_w ); |
| 21 | 58 | VIDEO_START( lkage ); |
| 22 | 59 | VIDEO_UPDATE( lkage ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _zaxxon_state zaxxon_state; | |
| 8 | struct _zaxxon_state | |
| 7 | class zaxxon_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, zaxxon_state(machine)); } | |
| 11 | ||
| 12 | zaxxon_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | UINT8 *colorram; |
| 11 | 15 | UINT8 *videoram; |
| 12 | 16 | UINT8 *spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gaiden_state gaiden_state; | |
| 8 | struct _gaiden_state | |
| 7 | class gaiden_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gaiden_state(machine)); } | |
| 11 | ||
| 12 | gaiden_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #include "sound/msm5205.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | typedef struct _trackfld_state trackfld_state; | |
| 12 | struct _trackfld_state | |
| 11 | class trackfld_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, trackfld_state(machine)); } | |
| 15 | ||
| 16 | trackfld_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT8 * videoram; // trackfld, hyperspt, yiear, sbasketb |
| 16 | 20 | UINT8 * colorram; // trackfld, hyperspt, sbasketb |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _astrof_state astrof_state; | |
| 8 | struct _astrof_state | |
| 7 | class astrof_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astrof_state(machine)); } | |
| 11 | ||
| 12 | astrof_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* video-related */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _karnov_state karnov_state; | |
| 8 | struct _karnov_state | |
| 7 | class karnov_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, karnov_state(machine)); } | |
| 11 | ||
| 12 | karnov_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * ram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _lwings_state lwings_state; | |
| 3 | struct _lwings_state | |
| 2 | class lwings_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lwings_state(machine)); } | |
| 6 | ||
| 7 | lwings_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * fgvideoram; |
| 7 | 11 | UINT8 * bg1videoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kopunch_state kopunch_state; | |
| 8 | struct _kopunch_state | |
| 7 | class kopunch_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kopunch_state(machine)); } | |
| 11 | ||
| 12 | kopunch_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | class news_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, news_state(machine)); } | |
| 6 | ||
| 7 | news_state(running_machine &machine) { } | |
| 8 | ||
| 9 | /* memory pointers */ | |
| 10 | UINT8 * bgram; | |
| 11 | UINT8 * fgram; | |
| 12 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 13 | ||
| 14 | /* video-related */ | |
| 15 | tilemap_t *fg_tilemap, *bg_tilemap; | |
| 16 | int bgpic; | |
| 17 | }; | |
| 18 | ||
| 19 | ||
| 1 | 20 | /*----------- defined in video/news.c -----------*/ |
| 2 | 21 | |
| 3 | extern UINT8 *news_fgram; | |
| 4 | extern UINT8 *news_bgram; | |
| 5 | ||
| 6 | 22 | WRITE8_HANDLER( news_fgram_w ); |
| 7 | 23 | WRITE8_HANDLER( news_bgram_w ); |
| 8 | 24 | WRITE8_HANDLER( news_bgpic_w ); |
| 25 | ||
| 9 | 26 | VIDEO_START( news ); |
| 10 | 27 | VIDEO_UPDATE( news ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _finalizr_state finalizr_state; | |
| 8 | struct _finalizr_state | |
| 7 | class finalizr_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, finalizr_state(machine)); } | |
| 11 | ||
| 12 | finalizr_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _shuuz_state shuuz_state; | |
| 10 | struct _shuuz_state | |
| 9 | class shuuz_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, shuuz_state(machine)); } | |
| 13 | ||
| 14 | shuuz_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | }; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _foodf_state foodf_state; | |
| 10 | struct _foodf_state | |
| 9 | class foodf_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, foodf_state(machine)); } | |
| 13 | ||
| 14 | foodf_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | double rweights[3]; |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | |
| 5 | typedef struct _armedf_state armedf_state; | |
| 6 | struct _armedf_state | |
| 5 | class armedf_state | |
| 7 | 6 | { |
| 7 | public: | |
| 8 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, armedf_state(machine)); } | |
| 9 | ||
| 10 | armedf_state(running_machine &machine) { } | |
| 11 | ||
| 8 | 12 | /* memory pointers */ |
| 9 | 13 | UINT16 * text_videoram; |
| 10 | 14 | UINT16 * bg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 13 | 13 | #define BSKTBALL_BOUNCE_EN NODE_04 |
| 14 | 14 | |
| 15 | 15 | |
| 16 | typedef struct _bsktball_state bsktball_state; | |
| 17 | struct _bsktball_state | |
| 16 | class bsktball_state | |
| 18 | 17 | { |
| 18 | public: | |
| 19 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bsktball_state(machine)); } | |
| 20 | ||
| 21 | bsktball_state(running_machine &machine) { } | |
| 22 | ||
| 19 | 23 | /* memory pointers */ |
| 20 | 24 | UINT8 * videoram; |
| 21 | 25 | UINT8 * motion; |
| r7500 | r7501 | |
|---|---|---|
| 69 | 69 | #define DK3_PALETTE_LENGTH (256+256+8+1) /* (256) */ |
| 70 | 70 | #define RS_PALETTE_LENGTH (256+256+8+1) |
| 71 | 71 | |
| 72 | typedef struct _dkong_state dkong_state; | |
| 73 | struct _dkong_state | |
| 72 | class dkong_state | |
| 74 | 73 | { |
| 74 | public: | |
| 75 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dkong_state(machine)); } | |
| 76 | ||
| 77 | dkong_state(running_machine &machine) { } | |
| 78 | ||
| 75 | 79 | /* memory pointers */ |
| 76 | 80 | UINT8 * video_ram; |
| 77 | 81 | UINT8 * sprite_ram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _appoooh_state appoooh_state; | |
| 4 | struct _appoooh_state | |
| 3 | class appoooh_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, appoooh_state(machine)); } | |
| 7 | ||
| 8 | appoooh_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * bg_videoram; |
| 8 | 12 | UINT8 * bg_colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _aliens_state aliens_state; | |
| 8 | struct _aliens_state | |
| 7 | class aliens_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, aliens_state(machine)); } | |
| 11 | ||
| 12 | aliens_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Metal Clash | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class metlclsh_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, metlclsh_state(machine)); } | |
| 11 | ||
| 12 | metlclsh_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * bgram; | |
| 16 | UINT8 * fgram; | |
| 17 | UINT8 * scrollx; | |
| 18 | UINT8 * otherram; | |
| 19 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 20 | // UINT8 * paletteram2; // currently this uses generic palette handling | |
| 21 | UINT8 * spriteram; | |
| 22 | size_t spriteram_size; | |
| 23 | ||
| 24 | /* video-related */ | |
| 25 | tilemap_t *bg_tilemap,*fg_tilemap; | |
| 26 | UINT8 write_mask, gfxbank; | |
| 27 | ||
| 28 | /* devices */ | |
| 29 | running_device *maincpu; | |
| 30 | running_device *subcpu; | |
| 31 | }; | |
| 32 | ||
| 33 | ||
| 34 | /*----------- defined in video/metlclsh.c -----------*/ | |
| 35 | ||
| 36 | WRITE8_HANDLER( metlclsh_bgram_w ); | |
| 37 | WRITE8_HANDLER( metlclsh_fgram_w ); | |
| 38 | WRITE8_HANDLER( metlclsh_gfxbank_w ); | |
| 39 | WRITE8_HANDLER( metlclsh_rambank_w ); | |
| 40 | ||
| 41 | VIDEO_START( metlclsh ); | |
| 42 | VIDEO_UPDATE( metlclsh ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct __88games_state _88games_state; | |
| 8 | struct __88games_state | |
| 7 | class _88games_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _88games_state(machine)); } | |
| 11 | ||
| 12 | _88games_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | UINT8 * banked_rom; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _goldstar_state goldstar_state; | |
| 2 | struct _goldstar_state | |
| 1 | class goldstar_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, goldstar_state(machine)); } | |
| 5 | ||
| 6 | goldstar_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | int dataoffset; |
| 5 | 9 | |
| 6 | 10 | UINT8 *nvram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _dbz_state dbz_state; | |
| 8 | struct _dbz_state | |
| 7 | class dbz_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dbz_state(machine)); } | |
| 11 | ||
| 12 | dbz_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bg1_videoram; |
| 12 | 16 | UINT16 * bg2_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _gauntlet_state gauntlet_state; | |
| 10 | struct _gauntlet_state | |
| 9 | class gauntlet_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gauntlet_state(machine)); } | |
| 13 | ||
| 14 | gauntlet_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | UINT16 sound_reset_val; |
| 14 | 18 | UINT8 vindctr2_screen_refresh; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | |
| 10 | typedef struct __20pacgal_state _20pacgal_state; | |
| 11 | struct __20pacgal_state | |
| 10 | class _20pacgal_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _20pacgal_state(machine)); } | |
| 14 | ||
| 15 | _20pacgal_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT8 *char_gfx_ram; |
| 15 | 19 | UINT8 *sprite_gfx_ram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _spbactn_state spbactn_state; | |
| 2 | struct _spbactn_state | |
| 1 | class spbactn_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, spbactn_state(machine)); } | |
| 5 | ||
| 6 | spbactn_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT16 *bgvideoram; |
| 5 | 9 | UINT16 *fgvideoram; |
| 6 | 10 | UINT16 *spvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | // later, this might be merged with segas1x_state in segas16.h |
| 3 | 3 | |
| 4 | typedef struct _segas1x_bootleg_state segas1x_bootleg_state; | |
| 5 | struct _segas1x_bootleg_state | |
| 4 | class segas1x_bootleg_state | |
| 6 | 5 | { |
| 6 | public: | |
| 7 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, segas1x_bootleg_state(machine)); } | |
| 8 | ||
| 9 | segas1x_bootleg_state(running_machine &machine) { } | |
| 10 | ||
| 7 | 11 | UINT16 * bg0_tileram; |
| 8 | 12 | UINT16 * bg1_tileram; |
| 9 | 13 | UINT16 * textram; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _deniam_state deniam_state; | |
| 9 | struct _deniam_state | |
| 8 | class deniam_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, deniam_state(machine)); } | |
| 12 | ||
| 13 | deniam_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT16 * videoram; |
| 13 | 17 | UINT16 * textram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _simpsons_state simpsons_state; | |
| 3 | struct _simpsons_state | |
| 2 | class simpsons_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, simpsons_state(machine)); } | |
| 6 | ||
| 7 | simpsons_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * ram; |
| 7 | 11 | UINT8 * xtraram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _wwfsstar_state wwfsstar_state; | |
| 2 | struct _wwfsstar_state | |
| 1 | class wwfsstar_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, wwfsstar_state(machine)); } | |
| 5 | ||
| 6 | wwfsstar_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | int vblank; |
| 5 | 9 | int scrollx; |
| 6 | 10 | int scrolly; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _actfancr_state actfancr_state; | |
| 8 | struct _actfancr_state | |
| 7 | class actfancr_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, actfancr_state(machine)); } | |
| 11 | ||
| 12 | actfancr_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * pf1_data; |
| 12 | 16 | UINT8 * pf2_data; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _taitob_state taitob_state; | |
| 3 | struct _taitob_state | |
| 2 | class taitob_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitob_state(machine)); } | |
| 6 | ||
| 7 | taitob_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * spriteram; |
| 7 | 11 | UINT16 * pixelram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | |
| 7 | typedef struct _jackal_state jackal_state; | |
| 8 | struct _jackal_state | |
| 7 | class jackal_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jackal_state(machine)); } | |
| 11 | ||
| 12 | jackal_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoctrl; |
| 12 | 16 | UINT8 * scrollram; |
| r7500 | r7501 | |
|---|---|---|
| 30 | 30 | #define MW8080BW_HPIXCOUNT (MW8080BW_HBSTART + 4) |
| 31 | 31 | |
| 32 | 32 | |
| 33 | typedef struct _mw8080bw_state mw8080bw_state; | |
| 34 | struct _mw8080bw_state | |
| 33 | class mw8080bw_state | |
| 35 | 34 | { |
| 35 | public: | |
| 36 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mw8080bw_state(machine)); } | |
| 37 | ||
| 38 | mw8080bw_state(running_machine &machine) { } | |
| 39 | ||
| 36 | 40 | /* memory pointers */ |
| 37 | 41 | UINT8 * main_ram; |
| 38 | 42 | UINT8 * colorram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Vapour Trail | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class vaportra_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, vaportra_state(machine)); } | |
| 11 | ||
| 12 | vaportra_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * pf3_rowscroll; | |
| 18 | UINT16 * pf4_rowscroll; | |
| 19 | ||
| 20 | /* misc */ | |
| 21 | UINT16 priority[2]; | |
| 22 | ||
| 23 | /* devices */ | |
| 24 | running_device *maincpu; | |
| 25 | running_device *audiocpu; | |
| 26 | running_device *deco16ic; | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/vaportra.c -----------*/ | |
| 32 | ||
| 33 | WRITE16_HANDLER( vaportra_priority_w ); | |
| 34 | WRITE16_HANDLER( vaportra_palette_24bit_rg_w ); | |
| 35 | WRITE16_HANDLER( vaportra_palette_24bit_b_w ); | |
| 36 | ||
| 37 | VIDEO_UPDATE( vaportra ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _btime_state btime_state; | |
| 3 | struct _btime_state | |
| 2 | class btime_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, btime_state(machine)); } | |
| 6 | ||
| 7 | btime_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * videoram; |
| 7 | 11 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | 59 | |
| 60 | typedef struct _cps_state cps_state; | |
| 61 | struct _cps_state | |
| 60 | class cps_state | |
| 62 | 61 | { |
| 62 | public: | |
| 63 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cps_state(machine)); } | |
| 64 | ||
| 65 | cps_state(running_machine &machine) { } | |
| 66 | ||
| 63 | 67 | /* memory pointers */ |
| 64 | 68 | // cps1 |
| 65 | 69 | UINT16 * gfxram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _yunsun16_state yunsun16_state; | |
| 8 | struct _yunsun16_state | |
| 7 | class yunsun16_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, yunsun16_state(machine)); } | |
| 11 | ||
| 12 | yunsun16_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * vram_0; |
| 12 | 16 | UINT16 * vram_1; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | |
| 10 | typedef struct _stactics_state stactics_state; | |
| 11 | struct _stactics_state | |
| 10 | class stactics_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, stactics_state(machine)); } | |
| 14 | ||
| 15 | stactics_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* machine state */ |
| 14 | 18 | int vert_pos; |
| 15 | 19 | int horiz_pos; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mermaid | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mermaid_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mermaid_state(machine)); } | |
| 11 | ||
| 12 | mermaid_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * colorram; | |
| 17 | UINT8 * videoram2; | |
| 18 | UINT8 * spriteram; | |
| 19 | UINT8 * bg_scrollram; | |
| 20 | UINT8 * fg_scrollram; | |
| 21 | UINT8 * ay8910_enable; | |
| 22 | size_t spriteram_size; | |
| 23 | ||
| 24 | /* video-related */ | |
| 25 | tilemap_t *bg_tilemap, *fg_tilemap; | |
| 26 | bitmap_t* helper; | |
| 27 | bitmap_t* helper2; | |
| 28 | int coll_bit0, coll_bit1, coll_bit2, coll_bit3, coll_bit6; | |
| 29 | int rougien_gfxbank1, rougien_gfxbank2; | |
| 30 | ||
| 31 | /* devices */ | |
| 32 | running_device *maincpu; | |
| 33 | running_device *ay1; | |
| 34 | running_device *ay2; | |
| 35 | }; | |
| 36 | ||
| 37 | ||
| 38 | ||
| 39 | /*----------- defined in video/mermaid.c -----------*/ | |
| 40 | ||
| 41 | WRITE8_HANDLER( mermaid_videoram2_w ); | |
| 42 | WRITE8_HANDLER( mermaid_videoram_w ); | |
| 43 | WRITE8_HANDLER( mermaid_colorram_w ); | |
| 44 | WRITE8_HANDLER( mermaid_flip_screen_x_w ); | |
| 45 | WRITE8_HANDLER( mermaid_flip_screen_y_w ); | |
| 46 | WRITE8_HANDLER( mermaid_bg_scroll_w ); | |
| 47 | WRITE8_HANDLER( mermaid_fg_scroll_w ); | |
| 48 | WRITE8_HANDLER( rougien_gfxbankswitch1_w ); | |
| 49 | WRITE8_HANDLER( rougien_gfxbankswitch2_w ); | |
| 50 | READ8_HANDLER( mermaid_collision_r ); | |
| 51 | ||
| 52 | PALETTE_INIT( mermaid ); | |
| 53 | VIDEO_START( mermaid ); | |
| 54 | VIDEO_UPDATE( mermaid ); | |
| 55 | VIDEO_EOF( mermaid ); |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "sound/discrete.h" |
| 8 | 8 | |
| 9 | 9 | |
| 10 | typedef struct _avalnche_state avalnche_state; | |
| 11 | struct _avalnche_state | |
| 10 | class avalnche_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, avalnche_state(machine)); } | |
| 14 | ||
| 15 | avalnche_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* video-related */ |
| 14 | 18 | UINT8 * videoram; |
| 15 | 19 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kickgoal_state kickgoal_state; | |
| 8 | struct _kickgoal_state | |
| 7 | class kickgoal_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kickgoal_state(machine)); } | |
| 11 | ||
| 12 | kickgoal_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * fgram; |
| 12 | 16 | UINT16 * bgram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Othello Derby | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | #define OTHLDRBY_VREG_SIZE 18 | |
| 8 | ||
| 9 | class othldrby_state | |
| 10 | { | |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, othldrby_state(machine)); } | |
| 13 | ||
| 14 | othldrby_state(running_machine &machine) { } | |
| 15 | ||
| 16 | /* memory pointers */ | |
| 17 | UINT16 * vram; | |
| 18 | UINT16 * buf_spriteram; | |
| 19 | UINT16 * buf_spriteram2; | |
| 20 | ||
| 21 | /* video-related */ | |
| 22 | tilemap_t *bg_tilemap[3]; | |
| 23 | UINT16 vreg[OTHLDRBY_VREG_SIZE]; | |
| 24 | UINT32 vram_addr, vreg_addr; | |
| 25 | ||
| 26 | /* misc */ | |
| 27 | int toggle; | |
| 28 | }; | |
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/othldrby.c -----------*/ | |
| 32 | ||
| 33 | WRITE16_HANDLER( othldrby_videoram_addr_w ); | |
| 34 | READ16_HANDLER( othldrby_videoram_r ); | |
| 35 | WRITE16_HANDLER( othldrby_videoram_w ); | |
| 36 | WRITE16_HANDLER( othldrby_vreg_addr_w ); | |
| 37 | WRITE16_HANDLER( othldrby_vreg_w ); | |
| 38 | ||
| 39 | VIDEO_START( othldrby ); | |
| 40 | VIDEO_EOF( othldrby ); | |
| 41 | VIDEO_UPDATE( othldrby ); |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | #define FIRST_VISIBLE_LINE 0 |
| 3 | 3 | #define LAST_VISIBLE_LINE 223 |
| 4 | 4 | |
| 5 | typedef struct _hyprduel_state hyprduel_state; | |
| 6 | struct _hyprduel_state | |
| 5 | class hyprduel_state | |
| 7 | 6 | { |
| 7 | public: | |
| 8 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hyprduel_state(machine)); } | |
| 9 | ||
| 10 | hyprduel_state(running_machine &machine) { } | |
| 11 | ||
| 8 | 12 | /* memory pointers */ |
| 9 | 13 | UINT16 * videoregs; |
| 10 | 14 | UINT16 * screenctrl; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _flstory_state flstory_state; | |
| 3 | struct _flstory_state | |
| 2 | class flstory_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, flstory_state(machine)); } | |
| 6 | ||
| 7 | flstory_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * videoram; |
| 7 | 11 | UINT8 * workram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _suprslam_state suprslam_state; | |
| 8 | struct _suprslam_state | |
| 7 | class suprslam_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, suprslam_state(machine)); } | |
| 11 | ||
| 12 | suprslam_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * screen_videoram; |
| 12 | 16 | UINT16 * bg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #define Z80_MASTER_CLOCK XTAL_10_816MHz |
| 9 | 9 | |
| 10 | 10 | |
| 11 | typedef struct _cosmic_state cosmic_state; | |
| 12 | struct _cosmic_state | |
| 11 | class cosmic_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cosmic_state(machine)); } | |
| 15 | ||
| 16 | cosmic_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT8 * videoram; |
| 16 | 20 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kyugo_state kyugo_state; | |
| 8 | struct _kyugo_state | |
| 7 | class kyugo_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kyugo_state(machine)); } | |
| 11 | ||
| 12 | kyugo_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * fgvideoram; |
| 12 | 16 | UINT8 * bgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #define MARKER_HORZ_ADJ -1 |
| 18 | 18 | #define MARKER_VERT_ADJ -10 |
| 19 | 19 | |
| 20 | typedef struct _lazercmd_state lazercmd_state; | |
| 21 | struct _lazercmd_state | |
| 20 | class lazercmd_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lazercmd_state(machine)); } | |
| 24 | ||
| 25 | lazercmd_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* memory pointers */ |
| 24 | 28 | UINT8 * videoram; |
| 25 | 29 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct __4enraya_state _4enraya_state; | |
| 8 | struct __4enraya_state | |
| 7 | class _4enraya_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _4enraya_state(machine)); } | |
| 11 | ||
| 12 | _4enraya_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "sound/discrete.h" |
| 2 | 2 | #include "sound/samples.h" |
| 3 | 3 | |
| 4 | typedef struct _blockade_state blockade_state; | |
| 5 | struct _blockade_state | |
| 4 | class blockade_state | |
| 6 | 5 | { |
| 6 | public: | |
| 7 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blockade_state(machine)); } | |
| 8 | ||
| 9 | blockade_state(running_machine &machine) { } | |
| 10 | ||
| 7 | 11 | UINT8 * videoram; |
| 8 | 12 | |
| 9 | 13 | /* video-related */ |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _compgolf_state compgolf_state; | |
| 8 | struct _compgolf_state | |
| 7 | class compgolf_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, compgolf_state(machine)); } | |
| 11 | ||
| 12 | compgolf_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * bg_ram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _lemmings_state lemmings_state; | |
| 3 | struct _lemmings_state | |
| 2 | class lemmings_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lemmings_state(machine)); } | |
| 6 | ||
| 7 | lemmings_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * pixel_0_data; |
| 7 | 11 | UINT16 * pixel_1_data; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _zerozone_state zerozone_state; | |
| 8 | struct _zerozone_state | |
| 7 | class zerozone_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, zerozone_state(machine)); } | |
| 11 | ||
| 12 | zerozone_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _espial_state espial_state; | |
| 8 | struct _espial_state | |
| 7 | class espial_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, espial_state(machine)); } | |
| 11 | ||
| 12 | espial_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | UINT8 * videoram; // espial, zodiack, marineb |
| 11 | 15 | UINT8 * colorram; // espial, marineb |
| 12 | 16 | UINT8 * attributeram; // espial, zodiack |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _hnayayoi_state hnayayoi_state; | |
| 8 | struct _hnayayoi_state | |
| 7 | class hnayayoi_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hnayayoi_state(machine)); } | |
| 11 | ||
| 12 | hnayayoi_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* video-related */ |
| 11 | 15 | UINT8 *pixmap[8]; |
| 12 | 16 | int palbank; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _tmnt_state tmnt_state; | |
| 3 | struct _tmnt_state | |
| 2 | class tmnt_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tmnt_state(machine)); } | |
| 6 | ||
| 7 | tmnt_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | INT16 * sampledata; |
| 7 | 11 | UINT16 * tmnt2_1c0800; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "video/poly.h" |
| 2 | 2 | |
| 3 | typedef struct _taitojc_state taitojc_state; | |
| 4 | struct _taitojc_state | |
| 3 | class taitojc_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitojc_state(machine)); } | |
| 7 | ||
| 8 | taitojc_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | int texture_x; |
| 7 | 11 | int texture_y; |
| 8 | 12 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _bionicc_state bionicc_state; | |
| 8 | struct _bionicc_state | |
| 7 | class bionicc_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bionicc_state(machine)); } | |
| 11 | ||
| 12 | bionicc_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bgvideoram; |
| 12 | 16 | UINT16 * fgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _citycon_state citycon_state; | |
| 8 | struct _citycon_state | |
| 7 | class citycon_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, citycon_state(machine)); } | |
| 11 | ||
| 12 | citycon_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * linecolor; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _spy_state spy_state; | |
| 8 | struct _spy_state | |
| 7 | class spy_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, spy_state(machine)); } | |
| 11 | ||
| 12 | spy_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | UINT8 * pmcram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _psikyo_state psikyo_state; | |
| 8 | struct _psikyo_state | |
| 7 | class psikyo_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, psikyo_state(machine)); } | |
| 11 | ||
| 12 | psikyo_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT32 * vram_0; |
| 12 | 16 | UINT32 * vram_1; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _esd16_state esd16_state; | |
| 8 | struct _esd16_state | |
| 7 | class esd16_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, esd16_state(machine)); } | |
| 11 | ||
| 12 | esd16_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * vram_0; |
| 12 | 16 | UINT16 * vram_1; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _pgm_state pgm_state; | |
| 3 | struct _pgm_state | |
| 2 | class pgm_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pgm_state(machine)); } | |
| 6 | ||
| 7 | pgm_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | // UINT16 * mainram; // currently this is also used by nvram handler |
| 7 | 11 | UINT16 * bg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | #define LEPRECHAUN_MAIN_CPU_CLOCK (LEPRECHAUN_MAIN_MASTER_CLOCK / 4) |
| 22 | 22 | |
| 23 | 23 | |
| 24 | typedef struct _gameplan_state gameplan_state; | |
| 25 | struct _gameplan_state | |
| 24 | class gameplan_state | |
| 26 | 25 | { |
| 26 | public: | |
| 27 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gameplan_state(machine)); } | |
| 28 | ||
| 29 | gameplan_state(running_machine &machine) { } | |
| 30 | ||
| 27 | 31 | /* machine state */ |
| 28 | 32 | UINT8 current_port; |
| 29 | 33 | UINT8 *trvquest_question; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define DARIUS_VOL_MAX (3*2 + 2) |
| 8 | 8 | #define DARIUS_PAN_MAX (2 + 2 + 1) /* FM 2port + PSG 2port + DA 1port */ |
| 9 | 9 | |
| 10 | typedef struct _darius_state darius_state; | |
| 11 | struct _darius_state | |
| 10 | class darius_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, darius_state(machine)); } | |
| 14 | ||
| 15 | darius_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT16 * spriteram; |
| 15 | 19 | UINT16 * fg_ram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _capbowl_state capbowl_state; | |
| 8 | struct _capbowl_state | |
| 7 | class capbowl_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, capbowl_state(machine)); } | |
| 11 | ||
| 12 | capbowl_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * rowaddress; |
| 12 | 16 | // UINT8 * nvram; // currently this uses generic_nvram |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ikki_state ikki_state; | |
| 8 | struct _ikki_state | |
| 7 | class ikki_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ikki_state(machine)); } | |
| 11 | ||
| 12 | ikki_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _cbasebal_state cbasebal_state; | |
| 8 | struct _cbasebal_state | |
| 7 | class cbasebal_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cbasebal_state(machine)); } | |
| 11 | ||
| 12 | cbasebal_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * spriteram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _beathead_state beathead_state; | |
| 10 | struct _beathead_state | |
| 9 | class beathead_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, beathead_state(machine)); } | |
| 13 | ||
| 14 | beathead_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT32 * vram_bulk_latch; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Funky Jet | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class funkyjet_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, funkyjet_state(machine)); } | |
| 11 | ||
| 12 | funkyjet_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * spriteram; | |
| 18 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | /* devices */ | |
| 22 | running_device *maincpu; | |
| 23 | running_device *audiocpu; | |
| 24 | running_device *deco16ic; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | /*----------- defined in video/funkyjet.c -----------*/ | |
| 30 | ||
| 31 | VIDEO_UPDATE( funkyjet ); |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #define QIX_CHARACTER_CLOCK (20000000/2/16) |
| 18 | 18 | |
| 19 | 19 | |
| 20 | typedef struct _qix_state qix_state; | |
| 21 | struct _qix_state | |
| 20 | class qix_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, qix_state(machine)); } | |
| 24 | ||
| 25 | qix_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* machine state */ |
| 24 | 28 | UINT8 *_68705_port_out; |
| 25 | 29 | UINT8 *_68705_ddr; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ksayakyu_state ksayakyu_state; | |
| 8 | struct _ksayakyu_state | |
| 7 | class ksayakyu_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ksayakyu_state(machine)); } | |
| 11 | ||
| 12 | ksayakyu_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _xexex_state xexex_state; | |
| 8 | struct _xexex_state | |
| 7 | class xexex_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, xexex_state(machine)); } | |
| 11 | ||
| 12 | xexex_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * workram; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _himesiki_state himesiki_state; | |
| 8 | struct _himesiki_state | |
| 7 | class himesiki_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, himesiki_state(machine)); } | |
| 11 | ||
| 12 | himesiki_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bg_ram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _skullxbo_state skullxbo_state; | |
| 10 | struct _skullxbo_state | |
| 9 | class skullxbo_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, skullxbo_state(machine)); } | |
| 13 | ||
| 14 | skullxbo_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | }; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _battlex_state battlex_state; | |
| 8 | struct _battlex_state | |
| 7 | class battlex_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, battlex_state(machine)); } | |
| 11 | ||
| 12 | battlex_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ironhors_state ironhors_state; | |
| 8 | struct _ironhors_state | |
| 7 | class ironhors_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ironhors_state(machine)); } | |
| 11 | ||
| 12 | ironhors_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mr. Flea | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mrflea_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mrflea_state(machine)); } | |
| 11 | ||
| 12 | mrflea_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * spriteram; | |
| 17 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 18 | ||
| 19 | /* video-related */ | |
| 20 | int gfx_bank; | |
| 21 | ||
| 22 | /* misc */ | |
| 23 | int io; | |
| 24 | int main; | |
| 25 | int status; | |
| 26 | int select1; | |
| 27 | ||
| 28 | /* devices */ | |
| 29 | running_device *maincpu; | |
| 30 | running_device *subcpu; | |
| 31 | }; | |
| 32 | ||
| 33 | ||
| 34 | /*----------- defined in video/mrflea.c -----------*/ | |
| 35 | ||
| 36 | WRITE8_HANDLER( mrflea_gfx_bank_w ); | |
| 37 | WRITE8_HANDLER( mrflea_videoram_w ); | |
| 38 | WRITE8_HANDLER( mrflea_spriteram_w ); | |
| 39 | ||
| 40 | VIDEO_UPDATE( mrflea ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | **************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _epos_state epos_state; | |
| 8 | struct _epos_state | |
| 7 | class epos_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, epos_state(machine)); } | |
| 11 | ||
| 12 | epos_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _glass_state glass_state; | |
| 8 | struct _glass_state | |
| 7 | class glass_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, glass_state(machine)); } | |
| 11 | ||
| 12 | glass_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * vregs; |
| r7500 | r7501 | |
|---|---|---|
| 1 | /*----------- defined in drivers/mcatadv.c -----------*/ | |
| 2 | 1 | |
| 3 | extern UINT16 *mcatadv_videoram1, *mcatadv_videoram2; | |
| 4 | extern UINT16 *mcatadv_scroll, *mcatadv_scroll2; | |
| 5 | extern UINT16 *mcatadv_vidregs; | |
| 2 | class mcatadv_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mcatadv_state(machine)); } | |
| 6 | 6 | |
| 7 | mcatadv_state(running_machine &machine) { } | |
| 7 | 8 | |
| 9 | /* memory pointers */ | |
| 10 | UINT16 * videoram1; | |
| 11 | UINT16 * videoram2; | |
| 12 | UINT16 * scroll1; | |
| 13 | UINT16 * scroll2; | |
| 14 | UINT16 * spriteram; | |
| 15 | UINT16 * spriteram_old; | |
| 16 | UINT16 * vidregs; | |
| 17 | UINT16 * vidregs_old; | |
| 18 | // UINT16 * paletteram; // this currently uses generic palette handlers | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | /* video-related */ | |
| 22 | tilemap_t *tilemap1, *tilemap2; | |
| 23 | int palette_bank1, palette_bank2; | |
| 24 | ||
| 25 | /* devices */ | |
| 26 | running_device *maincpu; | |
| 27 | running_device *soundcpu; | |
| 28 | }; | |
| 29 | ||
| 8 | 30 | /*----------- defined in video/mcatadv.c -----------*/ |
| 9 | 31 | |
| 10 | 32 | VIDEO_UPDATE( mcatadv ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _mjkjidai_state mjkjidai_state; | |
| 2 | struct _mjkjidai_state | |
| 1 | class mjkjidai_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mjkjidai_state(machine)); } | |
| 5 | ||
| 6 | mjkjidai_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *videoram; |
| 5 | 9 | UINT8 *spriteram1; |
| 6 | 10 | UINT8 *spriteram2; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define MASTER_CLOCK XTAL_18_432MHz |
| 8 | 8 | #define VOICE_CLOCK XTAL_3_579545MHz |
| 9 | 9 | |
| 10 | typedef struct _jailbrek_state jailbrek_state; | |
| 11 | struct _jailbrek_state | |
| 10 | class jailbrek_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jailbrek_state(machine)); } | |
| 14 | ||
| 15 | jailbrek_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT8 * videoram; |
| 15 | 19 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gaelco_state gaelco_state; | |
| 8 | struct _gaelco_state | |
| 7 | class gaelco_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gaelco_state(machine)); } | |
| 11 | ||
| 12 | gaelco_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 9 | 9 | #define BANKP_CPU_CLOCK (BANKP_MASTER_CLOCK/6) |
| 10 | 10 | #define BANKP_SN76496_CLOCK (BANKP_MASTER_CLOCK/6) |
| 11 | 11 | |
| 12 | typedef struct _bankp_state bankp_state; | |
| 13 | struct _bankp_state | |
| 12 | class bankp_state | |
| 14 | 13 | { |
| 14 | public: | |
| 15 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bankp_state(machine)); } | |
| 16 | ||
| 17 | bankp_state(running_machine &machine) { } | |
| 18 | ||
| 15 | 19 | /* memory pointers */ |
| 16 | 20 | UINT8 * videoram; |
| 17 | 21 | UINT8 * colorram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Munch Mobile | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class munchmo_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, munchmo_state(machine)); } | |
| 11 | ||
| 12 | munchmo_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * vreg; | |
| 16 | UINT8 * status_vram; | |
| 17 | UINT8 * sprite_xpos; | |
| 18 | UINT8 * sprite_attr; | |
| 19 | UINT8 * sprite_tile; | |
| 20 | UINT8 * videoram; | |
| 21 | ||
| 22 | /* video-related */ | |
| 23 | bitmap_t *tmpbitmap; | |
| 24 | int palette_bank; | |
| 25 | int flipscreen; | |
| 26 | ||
| 27 | /* misc */ | |
| 28 | int nmi_enable; | |
| 29 | int which; | |
| 30 | ||
| 31 | /* devices */ | |
| 32 | running_device *maincpu; | |
| 33 | running_device *audiocpu; | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | /*----------- defined in video/munchmo.c -----------*/ | |
| 38 | ||
| 39 | WRITE8_HANDLER( mnchmobl_palette_bank_w ); | |
| 40 | WRITE8_HANDLER( mnchmobl_flipscreen_w ); | |
| 41 | ||
| 42 | PALETTE_INIT( mnchmobl ); | |
| 43 | VIDEO_START( mnchmobl ); | |
| 44 | VIDEO_UPDATE( mnchmobl ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _funkybee_state funkybee_state; | |
| 4 | struct _funkybee_state | |
| 3 | class funkybee_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, funkybee_state(machine)); } | |
| 7 | ||
| 8 | funkybee_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * videoram; |
| 8 | 12 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _lastduel_state lastduel_state; | |
| 8 | struct _lastduel_state | |
| 7 | class lastduel_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lastduel_state(machine)); } | |
| 11 | ||
| 12 | lastduel_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * vram; |
| 12 | 16 | UINT16 * scroll1; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _alpha68k_state alpha68k_state; | |
| 8 | struct _alpha68k_state | |
| 7 | class alpha68k_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, alpha68k_state(machine)); } | |
| 11 | ||
| 12 | alpha68k_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _drgnmst_state drgnmst_state; | |
| 3 | struct _drgnmst_state | |
| 2 | class drgnmst_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, drgnmst_state(machine)); } | |
| 6 | ||
| 7 | drgnmst_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * vidregs; |
| 7 | 11 | UINT16 * fg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _freekick_state freekick_state; | |
| 4 | struct _freekick_state | |
| 3 | class freekick_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, freekick_state(machine)); } | |
| 7 | ||
| 8 | freekick_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * videoram; |
| 8 | 12 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _xybots_state xybots_state; | |
| 10 | struct _xybots_state | |
| 9 | class xybots_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, xybots_state(machine)); } | |
| 13 | ||
| 14 | xybots_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 h256; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _atarisy1_state atarisy1_state; | |
| 10 | struct _atarisy1_state | |
| 9 | class atarisy1_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarisy1_state(machine)); } | |
| 13 | ||
| 14 | atarisy1_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 * bankselect; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _wgp_state wgp_state; | |
| 8 | struct _wgp_state | |
| 7 | class wgp_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, wgp_state(machine)); } | |
| 11 | ||
| 12 | wgp_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spritemap; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _welltris_state welltris_state; | |
| 2 | struct _welltris_state | |
| 1 | class welltris_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, welltris_state(machine)); } | |
| 5 | ||
| 6 | welltris_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | int pending_command; |
| 5 | 9 | |
| 6 | 10 | UINT16 *spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gumbo_state gumbo_state; | |
| 8 | struct _gumbo_state | |
| 7 | class gumbo_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gumbo_state(machine)); } | |
| 11 | ||
| 12 | gumbo_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bg_videoram; |
| 12 | 16 | UINT16 * fg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | |
| 20 | typedef struct _taitoair_state taitoair_state; | |
| 21 | struct _taitoair_state | |
| 20 | class taitoair_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitoair_state(machine)); } | |
| 24 | ||
| 25 | taitoair_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* memory pointers */ |
| 24 | 28 | UINT16 * m68000_mainram; |
| 25 | 29 | UINT16 * line_ram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _atarig42_state atarig42_state; | |
| 10 | struct _atarig42_state | |
| 9 | class atarig42_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarig42_state(machine)); } | |
| 13 | ||
| 14 | atarig42_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | UINT16 playfield_base; |
| 14 | 18 | UINT16 motion_object_base; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _vindictr_state vindictr_state; | |
| 10 | struct _vindictr_state | |
| 9 | class vindictr_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, vindictr_state(machine)); } | |
| 13 | ||
| 14 | vindictr_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT8 playfield_tile_bank; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _cop01_state cop01_state; | |
| 8 | struct _cop01_state | |
| 7 | class cop01_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cop01_state(machine)); } | |
| 11 | ||
| 12 | cop01_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bgvideoram; |
| 12 | 16 | UINT8 * fgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _hanaawas_state hanaawas_state; | |
| 8 | struct _hanaawas_state | |
| 7 | class hanaawas_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hanaawas_state(machine)); } | |
| 11 | ||
| 12 | hanaawas_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | 3 | |
| 4 | typedef struct _aquarium_state aquarium_state; | |
| 5 | struct _aquarium_state | |
| 4 | class aquarium_state | |
| 6 | 5 | { |
| 6 | public: | |
| 7 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, aquarium_state(machine)); } | |
| 8 | ||
| 9 | aquarium_state(running_machine &machine) { } | |
| 10 | ||
| 7 | 11 | /* memory pointers */ |
| 8 | 12 | UINT16 * scroll; |
| 9 | 13 | UINT16 * txt_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _angelkds_state angelkds_state; | |
| 8 | struct _angelkds_state | |
| 7 | class angelkds_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, angelkds_state(machine)); } | |
| 11 | ||
| 12 | angelkds_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * paletteram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _circusc_state circusc_state; | |
| 8 | struct _circusc_state | |
| 7 | class circusc_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, circusc_state(machine)); } | |
| 11 | ||
| 12 | circusc_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mikie | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mikie_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mikie_state(machine)); } | |
| 11 | ||
| 12 | mikie_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * colorram; | |
| 17 | UINT8 * spriteram; | |
| 18 | size_t spriteram_size; | |
| 19 | ||
| 20 | /* video-related */ | |
| 21 | tilemap_t *bg_tilemap; | |
| 22 | int palettebank; | |
| 23 | ||
| 24 | /* misc */ | |
| 25 | int last_irq; | |
| 26 | ||
| 27 | /* devices */ | |
| 28 | running_device *maincpu; | |
| 29 | running_device *audiocpu; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | /*----------- defined in video/mikie.c -----------*/ | |
| 34 | ||
| 35 | WRITE8_HANDLER( mikie_videoram_w ); | |
| 36 | WRITE8_HANDLER( mikie_colorram_w ); | |
| 37 | WRITE8_HANDLER( mikie_palettebank_w ); | |
| 38 | WRITE8_HANDLER( mikie_flipscreen_w ); | |
| 39 | ||
| 40 | PALETTE_INIT( mikie ); | |
| 41 | VIDEO_START( mikie ); | |
| 42 | VIDEO_UPDATE( mikie ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _opwolf_state opwolf_state; | |
| 8 | struct _opwolf_state | |
| 7 | class opwolf_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, opwolf_state(machine)); } | |
| 11 | ||
| 12 | opwolf_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * cchip_ram; |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _surpratk_state surpratk_state; | |
| 8 | struct _surpratk_state | |
| 7 | class surpratk_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, surpratk_state(machine)); } | |
| 11 | ||
| 12 | surpratk_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _shadfrce_state shadfrce_state; | |
| 2 | struct _shadfrce_state | |
| 1 | class shadfrce_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, shadfrce_state(machine)); } | |
| 5 | ||
| 6 | shadfrce_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *fgtilemap; |
| 5 | 9 | tilemap_t *bg0tilemap; |
| 6 | 10 | tilemap_t *bg1tilemap; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _bigevglf_state bigevglf_state; | |
| 3 | struct _bigevglf_state | |
| 2 | class bigevglf_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigevglf_state(machine)); } | |
| 6 | ||
| 7 | bigevglf_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * paletteram; |
| 7 | 11 | UINT8 * spriteram1; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _inufuku_state inufuku_state; | |
| 3 | struct _inufuku_state | |
| 2 | class inufuku_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, inufuku_state(machine)); } | |
| 6 | ||
| 7 | inufuku_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * bg_videoram; |
| 7 | 11 | UINT16 * bg_rasterram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _commando_state commando_state; | |
| 8 | struct _commando_state | |
| 7 | class commando_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, commando_state(machine)); } | |
| 11 | ||
| 12 | commando_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _atarisy2_state atarisy2_state; | |
| 10 | struct _atarisy2_state | |
| 9 | class atarisy2_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarisy2_state(machine)); } | |
| 13 | ||
| 14 | atarisy2_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 * slapstic_base; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _yunsung8_state yunsung8_state; | |
| 8 | struct _yunsung8_state | |
| 7 | class yunsung8_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, yunsung8_state(machine)); } | |
| 11 | ||
| 12 | yunsung8_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Crude Buster | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class cbuster_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cbuster_state(machine)); } | |
| 11 | ||
| 12 | cbuster_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * pf3_rowscroll; | |
| 18 | UINT16 * pf4_rowscroll; | |
| 19 | UINT16 * ram; | |
| 20 | ||
| 21 | /* misc */ | |
| 22 | UINT16 prot; | |
| 23 | int pri; | |
| 24 | ||
| 25 | /* devices */ | |
| 26 | running_device *maincpu; | |
| 27 | running_device *audiocpu; | |
| 28 | running_device *deco16ic; | |
| 29 | }; | |
| 30 | ||
| 31 | ||
| 32 | ||
| 33 | /*----------- defined in video/cbuster.c -----------*/ | |
| 34 | ||
| 35 | WRITE16_HANDLER( twocrude_palette_24bit_rg_w ); | |
| 36 | WRITE16_HANDLER( twocrude_palette_24bit_b_w ); | |
| 37 | ||
| 38 | VIDEO_UPDATE( twocrude ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gng_state gng_state; | |
| 8 | struct _gng_state | |
| 7 | class gng_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gng_state(machine)); } | |
| 11 | ||
| 12 | gng_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bgvideoram; |
| 12 | 16 | UINT8 * fgvideoram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Ojanko High School & other Video System mahjong series | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class ojankohs_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ojankohs_state(machine)); } | |
| 11 | ||
| 12 | ojankohs_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * colorram; | |
| 17 | UINT8 * paletteram; | |
| 18 | ||
| 19 | /* video-related */ | |
| 20 | tilemap_t *tilemap; | |
| 21 | bitmap_t *tmpbitmap; | |
| 22 | int gfxreg; | |
| 23 | int flipscreen, flipscreen_old; | |
| 24 | int scrollx, scrolly; | |
| 25 | int screen_refresh; | |
| 26 | ||
| 27 | /* misc */ | |
| 28 | int portselect; | |
| 29 | int adpcm_reset; | |
| 30 | int adpcm_data; | |
| 31 | int vclk_left; | |
| 32 | ||
| 33 | /* devices */ | |
| 34 | running_device *maincpu; | |
| 35 | running_device *msm; | |
| 36 | }; | |
| 37 | ||
| 38 | ||
| 39 | /*----------- defined in video/ojankohs.c -----------*/ | |
| 40 | ||
| 41 | WRITE8_HANDLER( ojankohs_palette_w ); | |
| 42 | WRITE8_HANDLER( ccasino_palette_w ); | |
| 43 | WRITE8_HANDLER( ojankohs_videoram_w ); | |
| 44 | WRITE8_HANDLER( ojankohs_colorram_w ); | |
| 45 | WRITE8_HANDLER( ojankohs_gfxreg_w ); | |
| 46 | WRITE8_HANDLER( ojankohs_flipscreen_w ); | |
| 47 | WRITE8_HANDLER( ojankoc_palette_w ); | |
| 48 | WRITE8_HANDLER( ojankoc_videoram_w ); | |
| 49 | ||
| 50 | PALETTE_INIT( ojankoy ); | |
| 51 | ||
| 52 | VIDEO_START( ojankohs ); | |
| 53 | VIDEO_START( ojankoy ); | |
| 54 | VIDEO_START( ojankoc ); | |
| 55 | ||
| 56 | VIDEO_UPDATE( ojankohs ); | |
| 57 | VIDEO_UPDATE( ojankoc ); | |
| 58 | ||
| 59 | void ojankoc_flipscreen(const address_space *space, int data); | |
| 60 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _n8080_state n8080_state; | |
| 3 | struct _n8080_state | |
| 2 | class n8080_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, n8080_state(machine)); } | |
| 6 | ||
| 7 | n8080_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * videoram; |
| 7 | 11 | UINT8 * colorram; // for helifire |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kncljoe_state kncljoe_state; | |
| 8 | struct _kncljoe_state | |
| 7 | class kncljoe_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kncljoe_state(machine)); } | |
| 11 | ||
| 12 | kncljoe_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _holeland_state holeland_state; | |
| 8 | struct _holeland_state | |
| 7 | class holeland_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, holeland_state(machine)); } | |
| 11 | ||
| 12 | holeland_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _liberate_state liberate_state; | |
| 2 | struct _liberate_state | |
| 1 | class liberate_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, liberate_state(machine)); } | |
| 5 | ||
| 6 | liberate_state(running_machine &machine) { } | |
| 7 | ||
| 8 | UINT8 *videoram; | |
| 9 | UINT8 *colorram; | |
| 10 | UINT8 *paletteram; | |
| 11 | UINT8 *spriteram; | |
| 12 | UINT8 *scratchram; | |
| 13 | UINT8 *charram; /* prosoccr */ | |
| 14 | UINT8 *bg_vram; /* prosport */ | |
| 15 | ||
| 16 | UINT8 io_ram[16]; | |
| 17 | ||
| 4 | 18 | int bank; |
| 5 | 19 | int latch; |
| 6 | 20 | UINT8 gfx_rom_readback; |
| 7 | 21 | int background_color; |
| 8 | 22 | int background_disable; |
| 9 | tilemap_t *background_tilemap; | |
| 23 | ||
| 24 | tilemap_t *back_tilemap; | |
| 10 | 25 | tilemap_t *fix_tilemap; |
| 11 | UINT8 io_ram[16]; | |
| 12 | UINT8 *videoram; | |
| 13 | UINT8 *colorram; | |
| 14 | UINT8 *scratchram; | |
| 15 | UINT8 *charram; /* prosoccr */ | |
| 16 | UINT8 *bg_vram; /* prosport */ | |
| 26 | ||
| 27 | running_device *maincpu; | |
| 28 | running_device *audiocpu; | |
| 17 | 29 | }; |
| 18 | 30 | |
| 19 | 31 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gunsmoke_state gunsmoke_state; | |
| 8 | struct _gunsmoke_state | |
| 7 | class gunsmoke_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gunsmoke_state(machine)); } | |
| 11 | ||
| 12 | gunsmoke_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | int x, y, code; |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | typedef struct _cvs_state cvs_state; | |
| 20 | struct _cvs_state | |
| 19 | class cvs_state | |
| 21 | 20 | { |
| 21 | public: | |
| 22 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cvs_state(machine)); } | |
| 23 | ||
| 24 | cvs_state(running_machine &machine) { } | |
| 25 | ||
| 22 | 26 | /* memory pointers */ |
| 23 | 27 | UINT8 * video_ram; |
| 24 | 28 | UINT8 * bullet_ram; |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #define TURBO_X_SCALE 2 |
| 12 | 12 | |
| 13 | 13 | |
| 14 | typedef struct _i8279_state i8279_state; | |
| 15 | struct _i8279_state | |
| 14 | struct i8279_state | |
| 16 | 15 | { |
| 17 | 16 | UINT8 command; |
| 18 | 17 | UINT8 mode; |
| r7500 | r7501 | |
| 23 | 22 | }; |
| 24 | 23 | |
| 25 | 24 | |
| 26 | typedef struct _turbo_state turbo_state; | |
| 27 | struct _turbo_state | |
| 25 | class turbo_state | |
| 28 | 26 | { |
| 27 | public: | |
| 28 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, turbo_state(machine)); } | |
| 29 | ||
| 30 | turbo_state(running_machine &machine) { } | |
| 31 | ||
| 29 | 32 | /* memory pointers */ |
| 30 | 33 | UINT8 * videoram; |
| 31 | 34 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _laserbat_state laserbat_state; | |
| 8 | struct _laserbat_state | |
| 7 | class laserbat_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, laserbat_state(machine)); } | |
| 11 | ||
| 12 | laserbat_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* video-related */ |
| 11 | 15 | tilemap_t *bg_tilemap; |
| 12 | 16 | UINT8 *videoram; |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | MCU_TNZS |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | typedef struct _tnzs_state tnzs_state; | |
| 19 | struct _tnzs_state | |
| 18 | class tnzs_state | |
| 20 | 19 | { |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tnzs_state(machine)); } | |
| 22 | ||
| 23 | tnzs_state(running_machine &machine) { } | |
| 24 | ||
| 21 | 25 | /* memory pointers */ |
| 22 | 26 | UINT8 * objram; |
| 23 | 27 | UINT8 * vdcram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Data East 'Rohga' era hardware | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class rohga_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rohga_state(machine)); } | |
| 11 | ||
| 12 | rohga_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * pf3_rowscroll; | |
| 18 | UINT16 * pf4_rowscroll; | |
| 19 | UINT16 * spriteram; | |
| 20 | ||
| 21 | /* devices */ | |
| 22 | running_device *maincpu; | |
| 23 | running_device *audiocpu; | |
| 24 | running_device *deco16ic; | |
| 25 | running_device *oki1; | |
| 26 | running_device *oki2; | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/rohga.c -----------*/ | |
| 32 | ||
| 33 | WRITE16_HANDLER( rohga_buffer_spriteram16_w ); | |
| 34 | ||
| 35 | VIDEO_START( rohga ); | |
| 36 | ||
| 37 | VIDEO_UPDATE( rohga ); | |
| 38 | VIDEO_UPDATE( schmeisr ); | |
| 39 | VIDEO_UPDATE( wizdfire ); | |
| 40 | VIDEO_UPDATE( nitrobal ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _higemaru_state higemaru_state; | |
| 8 | struct _higemaru_state | |
| 7 | class higemaru_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, higemaru_state(machine)); } | |
| 11 | ||
| 12 | higemaru_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _batman_state batman_state; | |
| 10 | struct _batman_state | |
| 9 | class batman_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, batman_state(machine)); } | |
| 13 | ||
| 14 | batman_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 latch_data; |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | extern DRIVER_INIT( naomi ); |
| 23 | 23 | extern DRIVER_INIT( naomi_mp ); |
| 24 | extern DRIVER_INIT( naomi2 ); | |
| 24 | 25 | |
| 25 | 26 | extern DRIVER_INIT( ggxxsla ); |
| 26 | 27 | extern DRIVER_INIT( ggxxrl ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | /*----------- defined in drivers/nemesis.c -----------*/ | |
| 1 | class nemesis_state | |
| 2 | { | |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nemesis_state(machine)); } | |
| 2 | 5 | |
| 3 | extern int nemesis_irq_on; | |
| 4 | extern int nemesis_irq2_on; | |
| 5 | extern UINT16 hcrash_selected_ip; | |
| 6 | nemesis_state(running_machine &machine) { } | |
| 6 | 7 | |
| 8 | /* memory pointers */ | |
| 9 | UINT16 * videoram1; | |
| 10 | UINT16 * videoram2; | |
| 11 | UINT16 * colorram1; | |
| 12 | UINT16 * colorram2; | |
| 13 | UINT16 * charram; | |
| 14 | UINT16 * spriteram; | |
| 15 | UINT16 * paletteram; | |
| 16 | UINT16 * xscroll1; | |
| 17 | UINT16 * xscroll2; | |
| 18 | UINT16 * yscroll1; | |
| 19 | UINT16 * yscroll2; | |
| 20 | UINT8 * gx400_shared_ram; | |
| 21 | ||
| 22 | size_t charram_size; | |
| 23 | size_t spriteram_size; | |
| 24 | ||
| 25 | /* video-related */ | |
| 26 | tilemap_t *background, *foreground; | |
| 27 | int spriteram_words; | |
| 28 | int tilemap_flip; | |
| 29 | int flipscreen; | |
| 30 | UINT8 irq_port_last; | |
| 31 | UINT8 blank_tile[8*8]; | |
| 32 | ||
| 33 | /* misc */ | |
| 34 | int irq_on; | |
| 35 | int irq1_on; | |
| 36 | int irq2_on; | |
| 37 | int irq4_on; | |
| 38 | UINT16 selected_ip; /* Copied from WEC Le Mans 24 driver, explicity needed for Hyper Crash */ | |
| 39 | int gx400_irq1_cnt; | |
| 40 | UINT8 frame_counter; | |
| 41 | ||
| 42 | /* devices */ | |
| 43 | running_device *maincpu; | |
| 44 | running_device *audiocpu; | |
| 45 | running_device *vlm; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 7 | 49 | /*----------- defined in video/nemesis.c -----------*/ |
| 8 | 50 | |
| 9 | extern UINT16 *nemesis_videoram1; | |
| 10 | extern UINT16 *nemesis_videoram2; | |
| 11 | extern UINT16 *nemesis_colorram1; | |
| 12 | extern UINT16 *nemesis_colorram2; | |
| 13 | extern UINT16 *nemesis_characterram; | |
| 14 | extern size_t nemesis_characterram_size; | |
| 15 | extern UINT16 *nemesis_xscroll1, *nemesis_xscroll2; | |
| 16 | extern UINT16 *nemesis_yscroll1, *nemesis_yscroll2; | |
| 51 | WRITE16_HANDLER( nemesis_gfx_flipx_word_w ); | |
| 52 | WRITE16_HANDLER( nemesis_gfx_flipy_word_w ); | |
| 53 | WRITE16_HANDLER( salamand_control_port_word_w ); | |
| 54 | WRITE16_HANDLER( salamander_palette_word_w ); | |
| 55 | WRITE16_HANDLER( nemesis_palette_word_w ); | |
| 17 | 56 | |
| 18 | 57 | WRITE16_HANDLER( nemesis_videoram1_word_w ); |
| 19 | 58 | WRITE16_HANDLER( nemesis_videoram2_word_w ); |
| 20 | 59 | WRITE16_HANDLER( nemesis_colorram1_word_w ); |
| 21 | 60 | WRITE16_HANDLER( nemesis_colorram2_word_w ); |
| 22 | WRITE16_HANDLER( nemesis_characterram_word_w ); | |
| 61 | WRITE16_HANDLER( nemesis_charram_word_w ); | |
| 62 | ||
| 23 | 63 | VIDEO_START( nemesis ); |
| 24 | 64 | VIDEO_UPDATE( nemesis ); |
| 25 | ||
| 26 | WRITE16_HANDLER( nemesis_gfx_flipx_word_w ); | |
| 27 | WRITE16_HANDLER( nemesis_gfx_flipy_word_w ); | |
| 28 | WRITE16_HANDLER( salamand_control_port_word_w ); | |
| 29 | WRITE16_HANDLER( salamander_palette_word_w ); | |
| 30 | WRITE16_HANDLER( nemesis_palette_word_w ); |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _cheekyms_state cheekyms_state; | |
| 9 | struct _cheekyms_state | |
| 8 | class cheekyms_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cheekyms_state(machine)); } | |
| 12 | ||
| 13 | cheekyms_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * videoram; |
| 13 | 17 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _warriorb_state warriorb_state; | |
| 8 | struct _warriorb_state | |
| 7 | class warriorb_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, warriorb_state(machine)); } | |
| 11 | ||
| 12 | warriorb_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spriteram; |
| 12 | 16 | size_t spriteram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _goal92_state goal92_state; | |
| 8 | struct _goal92_state | |
| 7 | class goal92_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, goal92_state(machine)); } | |
| 11 | ||
| 12 | goal92_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bg_data; |
| 12 | 16 | UINT16 * fg_data; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define CPU_CLOCK (XTAL_24MHz / 2) /* 68000 clock */ |
| 8 | 8 | #define SOUND_CLOCK XTAL_16_9344MHz /* YMZ280 clock */ |
| 9 | 9 | |
| 10 | typedef struct _bishi_state bishi_state; | |
| 11 | struct _bishi_state | |
| 10 | class bishi_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bishi_state(machine)); } | |
| 14 | ||
| 15 | bishi_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT8 * ram; |
| 15 | 19 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct __1942_state _1942_state; | |
| 8 | struct __1942_state | |
| 7 | class _1942_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _1942_state(machine)); } | |
| 11 | ||
| 12 | _1942_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * fg_videoram; |
| 12 | 16 | UINT8 * bg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _fromanc2_state fromanc2_state; | |
| 3 | struct _fromanc2_state | |
| 2 | class fromanc2_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fromanc2_state(machine)); } | |
| 6 | ||
| 7 | fromanc2_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 *paletteram[2]; |
| 7 | 11 | UINT16 *videoram[2][4]; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _bombjack_state bombjack_state; | |
| 8 | struct _bombjack_state | |
| 7 | class bombjack_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bombjack_state(machine)); } | |
| 11 | ||
| 12 | bombjack_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _blockhl_state blockhl_state; | |
| 8 | struct _blockhl_state | |
| 7 | class blockhl_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blockhl_state(machine)); } | |
| 11 | ||
| 12 | blockhl_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _gcpinbal_state gcpinbal_state; | |
| 3 | struct _gcpinbal_state | |
| 2 | class gcpinbal_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gcpinbal_state(machine)); } | |
| 6 | ||
| 7 | gcpinbal_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * tilemapram; |
| 7 | 11 | UINT16 * ioc_ram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _carjmbre_state carjmbre_state; | |
| 8 | struct _carjmbre_state | |
| 7 | class carjmbre_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, carjmbre_state(machine)); } | |
| 11 | ||
| 12 | carjmbre_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _bottom9_state bottom9_state; | |
| 8 | struct _bottom9_state | |
| 7 | class bottom9_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bottom9_state(machine)); } | |
| 11 | ||
| 12 | bottom9_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gundealr_state gundealr_state; | |
| 8 | struct _gundealr_state | |
| 7 | class gundealr_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gundealr_state(machine)); } | |
| 11 | ||
| 12 | gundealr_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bg_videoram; |
| 12 | 16 | UINT8 * fg_videoram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mr. Do | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mrdo_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mrdo_state(machine)); } | |
| 11 | ||
| 12 | mrdo_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * bgvideoram; | |
| 16 | UINT8 * fgvideoram; | |
| 17 | UINT8 * spriteram; | |
| 18 | size_t spriteram_size; | |
| 19 | ||
| 20 | /* video-related */ | |
| 21 | tilemap_t *bg_tilemap, *fg_tilemap; | |
| 22 | int flipscreen; | |
| 23 | }; | |
| 24 | ||
| 25 | ||
| 26 | /*----------- defined in video/mrdo.c -----------*/ | |
| 27 | ||
| 28 | WRITE8_HANDLER( mrdo_bgvideoram_w ); | |
| 29 | WRITE8_HANDLER( mrdo_fgvideoram_w ); | |
| 30 | WRITE8_HANDLER( mrdo_scrollx_w ); | |
| 31 | WRITE8_HANDLER( mrdo_scrolly_w ); | |
| 32 | WRITE8_HANDLER( mrdo_flipscreen_w ); | |
| 33 | ||
| 34 | PALETTE_INIT( mrdo ); | |
| 35 | VIDEO_START( mrdo ); | |
| 36 | VIDEO_UPDATE( mrdo ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _mainevt_state mainevt_state; | |
| 8 | struct _mainevt_state | |
| 7 | class mainevt_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mainevt_state(machine)); } | |
| 11 | ||
| 12 | mainevt_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Megazone | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class megazone_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, megazone_state(machine)); } | |
| 11 | ||
| 12 | megazone_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * scrollx; | |
| 16 | UINT8 * scrolly; | |
| 17 | UINT8 * videoram; | |
| 18 | UINT8 * colorram; | |
| 19 | UINT8 * videoram2; | |
| 20 | UINT8 * colorram2; | |
| 21 | UINT8 * spriteram; | |
| 22 | size_t spriteram_size; | |
| 23 | size_t videoram_size; | |
| 24 | size_t videoram2_size; | |
| 25 | ||
| 26 | /* video-related */ | |
| 27 | bitmap_t *tmpbitmap; | |
| 28 | int flipscreen; | |
| 29 | ||
| 30 | /* misc */ | |
| 31 | int i8039_status; | |
| 32 | ||
| 33 | /* devices */ | |
| 34 | running_device *maincpu; | |
| 35 | running_device *audiocpu; | |
| 36 | running_device *daccpu; | |
| 37 | }; | |
| 38 | ||
| 39 | ||
| 40 | ||
| 41 | /*----------- defined in video/megazone.c -----------*/ | |
| 42 | ||
| 43 | WRITE8_HANDLER( megazone_flipscreen_w ); | |
| 44 | ||
| 45 | PALETTE_INIT( megazone ); | |
| 46 | VIDEO_START( megazone ); | |
| 47 | VIDEO_UPDATE( megazone ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _pass_state pass_state; | |
| 2 | struct _pass_state | |
| 1 | class pass_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pass_state(machine)); } | |
| 5 | ||
| 6 | pass_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *bg_tilemap; |
| 5 | 9 | tilemap_t *fg_tilemap; |
| 6 | 10 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _lasso_state lasso_state; | |
| 8 | struct _lasso_state | |
| 7 | class lasso_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lasso_state(machine)); } | |
| 11 | ||
| 12 | lasso_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _taitoh_state taitoh_state; | |
| 8 | struct _taitoh_state | |
| 7 | class taitoh_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitoh_state(machine)); } | |
| 11 | ||
| 12 | taitoh_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * m68000_mainram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | typedef struct _othunder_state othunder_state; | |
| 19 | struct _othunder_state | |
| 18 | class othunder_state | |
| 20 | 19 | { |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, othunder_state(machine)); } | |
| 22 | ||
| 23 | othunder_state(running_machine &machine) { } | |
| 24 | ||
| 21 | 25 | /* memory pointers */ |
| 22 | 26 | UINT16 * spriteram; |
| 23 | 27 | size_t spriteram_size; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ginganin_state ginganin_state; | |
| 8 | struct _ginganin_state | |
| 7 | class ginganin_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ginganin_state(machine)); } | |
| 11 | ||
| 12 | ginganin_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * fgram; |
| 12 | 16 | UINT16 * txtram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _tail2nos_state tail2nos_state; | |
| 8 | struct _tail2nos_state | |
| 7 | class tail2nos_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tail2nos_state(machine)); } | |
| 11 | ||
| 12 | tail2nos_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bgvideoram; |
| 12 | 16 | UINT16 * spriteram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mr. Jong | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mrjong_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mrjong_state(machine)); } | |
| 11 | ||
| 12 | mrjong_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * colorram; | |
| 17 | ||
| 18 | /* video-related */ | |
| 19 | tilemap_t *bg_tilemap; | |
| 20 | }; | |
| 21 | ||
| 22 | ||
| 23 | /*----------- defined in video/mrjong.c -----------*/ | |
| 24 | ||
| 25 | WRITE8_HANDLER( mrjong_videoram_w ); | |
| 26 | WRITE8_HANDLER( mrjong_colorram_w ); | |
| 27 | WRITE8_HANDLER( mrjong_flipscreen_w ); | |
| 28 | ||
| 29 | PALETTE_INIT( mrjong ); | |
| 30 | VIDEO_START( mrjong ); | |
| 31 | VIDEO_UPDATE( mrjong ); |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | int primask; |
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | typedef struct _slapshot_state slapshot_state; | |
| 18 | struct _slapshot_state | |
| 17 | class slapshot_state | |
| 19 | 18 | { |
| 19 | public: | |
| 20 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, slapshot_state(machine)); } | |
| 21 | ||
| 22 | slapshot_state(running_machine &machine) { } | |
| 23 | ||
| 20 | 24 | /* memory pointers */ |
| 21 | 25 | UINT16 * color_ram; |
| 22 | 26 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _xyonix_state xyonix_state; | |
| 2 | struct _xyonix_state | |
| 1 | class xyonix_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, xyonix_state(machine)); } | |
| 5 | ||
| 6 | xyonix_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *vidram; |
| 5 | 9 | tilemap_t *tilemap; |
| 6 | 10 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct __1943_state _1943_state; | |
| 8 | struct __1943_state | |
| 7 | class _1943_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _1943_state(machine)); } | |
| 11 | ||
| 12 | _1943_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Caveman Ninja (and other DECO 16bit titles) | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class cninja_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cninja_state(machine)); } | |
| 11 | ||
| 12 | cninja_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * ram; | |
| 16 | UINT16 * pf1_rowscroll; | |
| 17 | UINT16 * pf2_rowscroll; | |
| 18 | UINT16 * pf3_rowscroll; | |
| 19 | UINT16 * pf4_rowscroll; | |
| 20 | ||
| 21 | /* misc */ | |
| 22 | int scanline, irq_mask; | |
| 23 | ||
| 24 | /* devices */ | |
| 25 | running_device *maincpu; | |
| 26 | running_device *audiocpu; | |
| 27 | running_device *deco16ic; | |
| 28 | running_device *raster_irq_timer; | |
| 29 | running_device *oki2; | |
| 30 | }; | |
| 31 | ||
| 1 | 32 | /*----------- defined in video/cninja.c -----------*/ |
| 2 | 33 | |
| 3 | VIDEO_START( cninja ); | |
| 4 | VIDEO_START( edrandy ); | |
| 5 | VIDEO_START( robocop2 ); | |
| 6 | 34 | VIDEO_START( stoneage ); |
| 7 | ||
| 35 | ||
| 8 | 36 | VIDEO_UPDATE( cninja ); |
| 9 | 37 | VIDEO_UPDATE( cninjabl ); |
| 10 | 38 | VIDEO_UPDATE( edrandy ); |
| 11 | 39 | VIDEO_UPDATE( robocop2 ); |
| 12 | 40 | VIDEO_UPDATE( mutantf ); |
| 13 | VIDEO_EOF( cninja ); |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define MASTER_CLOCK 57272700 // main oscillator frequency |
| 8 | 8 | |
| 9 | 9 | |
| 10 | typedef struct _psikyo4_state psikyo4_state; | |
| 11 | struct _psikyo4_state | |
| 10 | class psikyo4_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, psikyo4_state(machine)); } | |
| 14 | ||
| 15 | psikyo4_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT32 * vidregs; |
| 15 | 19 | UINT32 * paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _popper_state popper_state; | |
| 8 | struct _popper_state | |
| 7 | class popper_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, popper_state(machine)); } | |
| 11 | ||
| 12 | popper_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * ol_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #define PROT_OUTPUT_BUFFER_SIZE 8 |
| 8 | 8 | |
| 9 | typedef struct _djboy_state djboy_state; | |
| 10 | struct _djboy_state | |
| 9 | class djboy_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, djboy_state(machine)); } | |
| 13 | ||
| 14 | djboy_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * videoram; |
| 14 | 18 | UINT8 * paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ladyfrog_state ladyfrog_state; | |
| 8 | struct _ladyfrog_state | |
| 7 | class ladyfrog_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ladyfrog_state(machine)); } | |
| 11 | ||
| 12 | ladyfrog_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _sidearms_state sidearms_state; | |
| 2 | struct _sidearms_state | |
| 1 | class sidearms_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sidearms_state(machine)); } | |
| 5 | ||
| 6 | sidearms_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | int gameid; |
| 5 | 9 | |
| 6 | 10 | UINT8 *videoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _jack_state jack_state; | |
| 8 | struct _jack_state | |
| 7 | class jack_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jack_state(machine)); } | |
| 11 | ||
| 12 | jack_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Tumble Pop | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class tumblep_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tumblep_state(machine)); } | |
| 11 | ||
| 12 | tumblep_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * spriteram; | |
| 18 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | /* devices */ | |
| 22 | running_device *maincpu; | |
| 23 | running_device *audiocpu; | |
| 24 | running_device *deco16ic; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | /*----------- defined in video/tumblep.c -----------*/ | |
| 30 | ||
| 31 | VIDEO_UPDATE( tumblep ); |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | #define BITMAPRAM_SIZE 0x6000 |
| 4 | 4 | |
| 5 | 5 | |
| 6 | typedef struct _dogfgt_state dogfgt_state; | |
| 7 | struct _dogfgt_state | |
| 6 | class dogfgt_state | |
| 8 | 7 | { |
| 8 | public: | |
| 9 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dogfgt_state(machine)); } | |
| 10 | ||
| 11 | dogfgt_state(running_machine &machine) { } | |
| 12 | ||
| 9 | 13 | /* memory pointers */ |
| 10 | 14 | UINT8 * bgvideoram; |
| 11 | 15 | UINT8 * spriteram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Diet Go Go | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class dietgo_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dietgo_state(machine)); } | |
| 11 | ||
| 12 | dietgo_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * spriteram; | |
| 18 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | /* devices */ | |
| 22 | running_device *maincpu; | |
| 23 | running_device *audiocpu; | |
| 24 | running_device *deco16ic; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | /*----------- defined in video/dietgo.c -----------*/ | |
| 30 | ||
| 31 | VIDEO_UPDATE( dietgo ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kingofb_state kingofb_state; | |
| 8 | struct _kingofb_state | |
| 7 | class kingofb_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kingofb_state(machine)); } | |
| 11 | ||
| 12 | kingofb_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _galivan_state galivan_state; | |
| 8 | struct _galivan_state | |
| 7 | class galivan_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, galivan_state(machine)); } | |
| 11 | ||
| 12 | galivan_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _blockout_state blockout_state; | |
| 8 | struct _blockout_state | |
| 7 | class blockout_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blockout_state(machine)); } | |
| 11 | ||
| 12 | blockout_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * frontvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | typedef struct _canyon_state canyon_state; | |
| 21 | struct _canyon_state | |
| 20 | class canyon_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, canyon_state(machine)); } | |
| 24 | ||
| 25 | canyon_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* memory pointers */ |
| 24 | 28 | UINT8 * videoram; |
| 25 | 29 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _f1gp_state f1gp_state; | |
| 3 | struct _f1gp_state | |
| 2 | class f1gp_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, f1gp_state(machine)); } | |
| 6 | ||
| 7 | f1gp_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * sharedram; |
| 7 | 11 | UINT16 * spr1vram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Desert Assault | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class dassault_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dassault_state(machine)); } | |
| 11 | ||
| 12 | dassault_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf2_rowscroll; | |
| 16 | UINT16 * pf4_rowscroll; | |
| 17 | UINT16 * ram; | |
| 18 | UINT16 * ram2; | |
| 19 | UINT16 * shared_ram; | |
| 20 | ||
| 21 | /* devices */ | |
| 22 | running_device *maincpu; | |
| 23 | running_device *audiocpu; | |
| 24 | running_device *subcpu; | |
| 25 | running_device *deco16ic; | |
| 26 | running_device *oki2; | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/dassault.c -----------*/ | |
| 32 | ||
| 33 | VIDEO_UPDATE( dassault ); |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _blstroid_state blstroid_state; | |
| 10 | struct _blstroid_state | |
| 9 | class blstroid_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blstroid_state(machine)); } | |
| 13 | ||
| 14 | blstroid_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 * priorityram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _gotya_state gotya_state; | |
| 3 | struct _gotya_state | |
| 2 | class gotya_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gotya_state(machine)); } | |
| 6 | ||
| 7 | gotya_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * videoram; |
| 7 | 11 | UINT8 * videoram2; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Super Burger Time & China Town | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class supbtime_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, supbtime_state(machine)); } | |
| 11 | ||
| 12 | supbtime_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * spriteram; | |
| 18 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | /* video-related */ | |
| 22 | ||
| 23 | /* devices */ | |
| 24 | running_device *maincpu; | |
| 25 | running_device *audiocpu; | |
| 26 | running_device *deco16ic; | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/supbtime.c -----------*/ | |
| 32 | ||
| 33 | VIDEO_UPDATE( supbtime ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _blmbycar_state blmbycar_state; | |
| 8 | struct _blmbycar_state | |
| 7 | class blmbycar_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blmbycar_state(machine)); } | |
| 11 | ||
| 12 | blmbycar_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * vram_0; |
| 12 | 16 | UINT16 * scroll_0; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gbusters_state gbusters_state; | |
| 8 | struct _gbusters_state | |
| 7 | class gbusters_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gbusters_state(machine)); } | |
| 11 | ||
| 12 | gbusters_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _bogeyman_state bogeyman_state; | |
| 8 | struct _bogeyman_state | |
| 7 | class bogeyman_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bogeyman_state(machine)); } | |
| 11 | ||
| 12 | bogeyman_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "cpu/tms34010/tms34010.h" |
| 8 | 8 | #include "machine/atarigen.h" |
| 9 | 9 | |
| 10 | typedef struct _harddriv_state harddriv_state; | |
| 11 | struct _harddriv_state | |
| 10 | class harddriv_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, harddriv_state(machine)); } | |
| 14 | ||
| 15 | harddriv_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | atarigen_state atarigen; |
| 14 | 18 | |
| 15 | 19 | running_device * maincpu; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _srmp2_state srmp2_state; | |
| 2 | struct _srmp2_state | |
| 1 | class srmp2_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, srmp2_state(machine)); } | |
| 5 | ||
| 6 | srmp2_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | int color_bank; |
| 5 | 9 | int gfx_bank; |
| 6 | 10 |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Oh My God! | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class ohmygod_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ohmygod_state(machine)); } | |
| 11 | ||
| 12 | ohmygod_state(running_machine &machine) { } | |
| 13 | ||
| 14 | ||
| 15 | /* memory pointers */ | |
| 16 | UINT16 * videoram; | |
| 17 | UINT16 * spriteram; | |
| 18 | size_t spriteram_size; | |
| 19 | ||
| 20 | /* video-related */ | |
| 21 | tilemap_t *bg_tilemap; | |
| 22 | int spritebank; | |
| 23 | UINT16 scrollx, scrolly; | |
| 24 | ||
| 25 | /* misc */ | |
| 26 | int adpcm_bank_shift; | |
| 27 | int sndbank; | |
| 28 | }; | |
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/ohmygod.c -----------*/ | |
| 32 | ||
| 33 | WRITE16_HANDLER( ohmygod_videoram_w ); | |
| 34 | WRITE16_HANDLER( ohmygod_spritebank_w ); | |
| 35 | WRITE16_HANDLER( ohmygod_scrollx_w ); | |
| 36 | WRITE16_HANDLER( ohmygod_scrolly_w ); | |
| 37 | ||
| 38 | VIDEO_START( ohmygod ); | |
| 39 | VIDEO_UPDATE( ohmygod ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _aeroboto_state aeroboto_state; | |
| 8 | struct _aeroboto_state | |
| 7 | class aeroboto_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, aeroboto_state(machine)); } | |
| 11 | ||
| 12 | aeroboto_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * mainram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _firetrap_state firetrap_state; | |
| 8 | struct _firetrap_state | |
| 7 | class firetrap_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, firetrap_state(machine)); } | |
| 11 | ||
| 12 | firetrap_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bg1videoram; |
| 12 | 16 | UINT8 * bg2videoram; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define MASTER_CLOCK 18432000 |
| 8 | 8 | |
| 9 | 9 | |
| 10 | typedef struct _crgolf_state crgolf_state; | |
| 11 | struct _crgolf_state | |
| 10 | class crgolf_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, crgolf_state(machine)); } | |
| 14 | ||
| 15 | crgolf_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT8 * videoram_a; |
| 15 | 19 | UINT8 * videoram_b; |
| r7500 | r7501 | |
|---|---|---|
| 1 | /*----------- defined in drivers/oneshot.c -----------*/ | |
| 2 | 1 | |
| 3 | extern UINT16 *oneshot_sprites; | |
| 4 | extern UINT16 *oneshot_bg_videoram; | |
| 5 | extern UINT16 *oneshot_mid_videoram; | |
| 6 | extern UINT16 *oneshot_fg_videoram; | |
| 7 | extern UINT16 *oneshot_scroll; | |
| 2 | class oneshot_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, oneshot_state(machine)); } | |
| 8 | 6 | |
| 9 | extern int gun_x_p1,gun_y_p1,gun_x_p2,gun_y_p2; | |
| 10 | extern int gun_x_shift; | |
| 7 | oneshot_state(running_machine &machine) { } | |
| 11 | 8 | |
| 9 | /* memory pointers */ | |
| 10 | UINT16 * sprites; | |
| 11 | UINT16 * bg_videoram; | |
| 12 | UINT16 * mid_videoram; | |
| 13 | UINT16 * fg_videoram; | |
| 14 | UINT16 * scroll; | |
| 12 | 15 | |
| 16 | /* video-related */ | |
| 17 | tilemap_t *bg_tilemap, *mid_tilemap, *fg_tilemap; | |
| 18 | ||
| 19 | /* misc */ | |
| 20 | int gun_x_p1, gun_y_p1, gun_x_p2, gun_y_p2; | |
| 21 | int gun_x_shift; | |
| 22 | int p1_wobble, p2_wobble; | |
| 23 | ||
| 24 | /* devices */ | |
| 25 | running_device *maincpu; | |
| 26 | running_device *audiocpu; | |
| 27 | }; | |
| 28 | ||
| 13 | 29 | /*----------- defined in video/oneshot.c -----------*/ |
| 14 | 30 | |
| 15 | 31 | WRITE16_HANDLER( oneshot_bg_videoram_w ); |
| 16 | 32 | WRITE16_HANDLER( oneshot_mid_videoram_w ); |
| 17 | 33 | WRITE16_HANDLER( oneshot_fg_videoram_w ); |
| 34 | ||
| 18 | 35 | VIDEO_START( oneshot ); |
| 19 | 36 | VIDEO_UPDATE( oneshot ); |
| 20 | 37 | VIDEO_UPDATE( maddonna ); |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _stlforce_state stlforce_state; | |
| 2 | struct _stlforce_state | |
| 1 | class stlforce_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, stlforce_state(machine)); } | |
| 5 | ||
| 6 | stlforce_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *bg_tilemap; |
| 5 | 9 | tilemap_t *mlow_tilemap; |
| 6 | 10 | tilemap_t *mhigh_tilemap; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _topspeed_state topspeed_state; | |
| 8 | struct _topspeed_state | |
| 7 | class topspeed_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, topspeed_state(machine)); } | |
| 11 | ||
| 12 | topspeed_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spritemap; |
| 12 | 16 | UINT16 * raster_ctrl; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _amspdwy_state amspdwy_state; | |
| 8 | struct _amspdwy_state | |
| 7 | class amspdwy_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, amspdwy_state(machine)); } | |
| 11 | ||
| 12 | amspdwy_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _fantland_state fantland_state; | |
| 4 | struct _fantland_state | |
| 3 | class fantland_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fantland_state(machine)); } | |
| 7 | ||
| 8 | fantland_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | // UINT8 * spriteram; // currently directly used in a 16bit map... |
| 8 | 12 | // UINT8 * spriteram_2; // currently directly used in a 16bit map... |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _atarig1_state atarig1_state; | |
| 10 | struct _atarig1_state | |
| 9 | class atarig1_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarig1_state(machine)); } | |
| 13 | ||
| 14 | atarig1_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | UINT8 is_pitfight; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _bladestl_state bladestl_state; | |
| 8 | struct _bladestl_state | |
| 7 | class bladestl_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bladestl_state(machine)); } | |
| 11 | ||
| 12 | bladestl_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * paletteram; |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _toobin_state toobin_state; | |
| 10 | struct _toobin_state | |
| 9 | class toobin_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, toobin_state(machine)); } | |
| 13 | ||
| 14 | toobin_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 * interrupt_scan; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _overdriv_state overdriv_state; | |
| 8 | struct _overdriv_state | |
| 7 | class overdriv_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, overdriv_state(machine)); } | |
| 11 | ||
| 12 | overdriv_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _thunderx_state thunderx_state; | |
| 8 | struct _thunderx_state | |
| 7 | class thunderx_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, thunderx_state(machine)); } | |
| 11 | ||
| 12 | thunderx_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | UINT8 * pmcram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _xmen_state xmen_state; | |
| 3 | struct _xmen_state | |
| 2 | class xmen_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, xmen_state(machine)); } | |
| 6 | ||
| 7 | xmen_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | // UINT16 * paletteram; // currently this uses generic palette handling |
| 7 | 11 |
| r7500 | r7501 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | #define MARIO_PALETTE_LENGTH (256) |
| 32 | 32 | |
| 33 | typedef struct _mario_state mario_state; | |
| 34 | struct _mario_state | |
| 33 | class mario_state | |
| 35 | 34 | { |
| 35 | public: | |
| 36 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mario_state(machine)); } | |
| 37 | ||
| 38 | mario_state(running_machine &machine) { } | |
| 39 | ||
| 36 | 40 | /* memory pointers */ |
| 37 | 41 | |
| 38 | 42 | /* machine states */ |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | #define ATARIFB_HIT_EN NODE_05 |
| 16 | 16 | |
| 17 | 17 | |
| 18 | typedef struct _atarifb_state atarifb_state; | |
| 19 | struct _atarifb_state | |
| 18 | class atarifb_state | |
| 20 | 19 | { |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarifb_state(machine)); } | |
| 22 | ||
| 23 | atarifb_state(running_machine &machine) { } | |
| 24 | ||
| 21 | 25 | /* video-related */ |
| 22 | 26 | UINT8 * alphap1_videoram; |
| 23 | 27 | UINT8 * alphap2_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _silkroad_state silkroad_state; | |
| 2 | struct _silkroad_state | |
| 1 | class silkroad_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, silkroad_state(machine)); } | |
| 5 | ||
| 6 | silkroad_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT32 *vidram; |
| 5 | 9 | UINT32 *vidram2; |
| 6 | 10 | UINT32 *vidram3; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _lethal_state lethal_state; | |
| 8 | struct _lethal_state | |
| 7 | class lethal_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lethal_state(machine)); } | |
| 11 | ||
| 12 | lethal_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _exprraid_state exprraid_state; | |
| 9 | struct _exprraid_state | |
| 8 | class exprraid_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, exprraid_state(machine)); } | |
| 12 | ||
| 13 | exprraid_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * main_ram; |
| 13 | 17 | UINT8 * videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _toypop_state toypop_state; | |
| 2 | struct _toypop_state | |
| 1 | class toypop_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, toypop_state(machine)); } | |
| 5 | ||
| 6 | toypop_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *videoram; |
| 5 | 9 | UINT8 *spriteram; |
| 6 | 10 | UINT16 *bg_image; |
| r7500 | r7501 | |
|---|---|---|
| 1 | /*----------- defined in drivers/tumbleb.c -----------*/ | |
| 2 | 1 | |
| 3 | extern UINT16* jumppop_control; | |
| 4 | extern UINT16* suprtrio_control; | |
| 2 | class tumbleb_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, tumbleb_state(machine)); } | |
| 5 | 6 | |
| 7 | tumbleb_state(running_machine &machine) { } | |
| 6 | 8 | |
| 9 | /* memory pointers */ | |
| 10 | UINT16 * pf1_data; | |
| 11 | UINT16 * pf2_data; | |
| 12 | UINT16 * mainram; | |
| 13 | UINT16 * spriteram; | |
| 14 | UINT16 * control; | |
| 15 | size_t spriteram_size; | |
| 16 | // UINT16 * paletteram; // currently this uses generic palette handling | |
| 17 | ||
| 18 | /* misc */ | |
| 19 | int music_command; | |
| 20 | int music_bank; | |
| 21 | int music_is_playing; | |
| 22 | ||
| 23 | /* video-related */ | |
| 24 | tilemap_t *pf1_tilemap,*pf1_alt_tilemap,*pf2_tilemap,*pf2_alt_tilemap; | |
| 25 | UINT16 control_0[8]; | |
| 26 | int flipscreen; | |
| 27 | UINT16 tilebank; | |
| 28 | int sprite_xoffset; | |
| 29 | int sprite_yoffset; | |
| 30 | ||
| 31 | /* devices */ | |
| 32 | running_device *maincpu; | |
| 33 | running_device *audiocpu; | |
| 34 | running_device *oki; | |
| 35 | }; | |
| 36 | ||
| 7 | 37 | /*----------- defined in video/tumbleb.c -----------*/ |
| 8 | 38 | |
| 9 | extern UINT16 *tumblepb_pf1_data,*tumblepb_pf2_data; | |
| 39 | WRITE16_HANDLER( tumblepb_pf1_data_w ); | |
| 40 | WRITE16_HANDLER( tumblepb_pf2_data_w ); | |
| 41 | WRITE16_HANDLER( fncywld_pf1_data_w ); | |
| 42 | WRITE16_HANDLER( fncywld_pf2_data_w ); | |
| 43 | WRITE16_HANDLER( tumblepb_control_0_w ); | |
| 44 | WRITE16_HANDLER( pangpang_pf1_data_w ); | |
| 45 | WRITE16_HANDLER( pangpang_pf2_data_w ); | |
| 10 | 46 | |
| 47 | WRITE16_HANDLER( bcstory_tilebank_w ); | |
| 48 | WRITE16_HANDLER( suprtrio_tilebank_w ); | |
| 49 | WRITE16_HANDLER( chokchok_tilebank_w ); | |
| 50 | WRITE16_HANDLER( wlstar_tilebank_w ); | |
| 51 | ||
| 11 | 52 | VIDEO_START( tumblepb ); |
| 12 | 53 | VIDEO_START( fncywld ); |
| 13 | 54 | VIDEO_START( jumppop ); |
| 14 | 55 | VIDEO_START( sdfight ); |
| 56 | VIDEO_START( suprtrio ); | |
| 57 | VIDEO_START( pangpang ); | |
| 58 | ||
| 15 | 59 | VIDEO_UPDATE( tumblepb ); |
| 16 | 60 | VIDEO_UPDATE( jumpkids ); |
| 17 | 61 | VIDEO_UPDATE( fncywld ); |
| r7500 | r7501 | |
| 20 | 64 | VIDEO_UPDATE( semicom_altoffsets ); |
| 21 | 65 | VIDEO_UPDATE( bcstory ); |
| 22 | 66 | VIDEO_UPDATE(semibase ); |
| 23 | VIDEO_START( suprtrio ); | |
| 24 | 67 | VIDEO_UPDATE( suprtrio ); |
| 25 | VIDEO_START( pangpang ); | |
| 26 | 68 | VIDEO_UPDATE( pangpang ); |
| 27 | 69 | VIDEO_UPDATE( sdfight ); |
| 28 | ||
| 29 | WRITE16_HANDLER( tumblepb_pf1_data_w ); | |
| 30 | WRITE16_HANDLER( tumblepb_pf2_data_w ); | |
| 31 | WRITE16_HANDLER( fncywld_pf1_data_w ); | |
| 32 | WRITE16_HANDLER( fncywld_pf2_data_w ); | |
| 33 | WRITE16_HANDLER( tumblepb_control_0_w ); | |
| 34 | WRITE16_HANDLER( pangpang_pf1_data_w ); | |
| 35 | WRITE16_HANDLER( pangpang_pf2_data_w ); | |
| 36 | ||
| 37 | WRITE16_HANDLER( bcstory_tilebank_w ); | |
| 38 | WRITE16_HANDLER( suprtrio_tilebank_w ); | |
| 39 | WRITE16_HANDLER( chokchok_tilebank_w ); | |
| 40 | WRITE16_HANDLER( wlstar_tilebank_w ); |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #define VGB_MONITOR_DISPLAY 0 |
| 12 | 12 | #define DRMATH_MONITOR_DISPLAY 1 |
| 13 | 13 | |
| 14 | typedef struct _micro3d_state micro3d_state; | |
| 15 | struct _micro3d_state | |
| 14 | class micro3d_state | |
| 16 | 15 | { |
| 16 | public: | |
| 17 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, micro3d_state(machine)); } | |
| 18 | ||
| 19 | micro3d_state(running_machine &machine) { } | |
| 20 | ||
| 17 | 21 | struct |
| 18 | 22 | { |
| 19 | 23 | union |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Momoko 120% | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class momoko_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, momoko_state(machine)); } | |
| 11 | ||
| 12 | momoko_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * bg_scrollx; | |
| 16 | UINT8 * bg_scrolly; | |
| 17 | UINT8 * videoram; | |
| 18 | UINT8 * spriteram; | |
| 19 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 20 | size_t spriteram_size; | |
| 21 | size_t videoram_size; | |
| 22 | ||
| 23 | /* video-related */ | |
| 24 | UINT8 fg_scrollx; | |
| 25 | UINT8 fg_scrolly; | |
| 26 | UINT8 fg_select; | |
| 27 | UINT8 text_scrolly; | |
| 28 | UINT8 text_mode; | |
| 29 | UINT8 bg_select; | |
| 30 | UINT8 bg_priority; | |
| 31 | UINT8 bg_mask; | |
| 32 | UINT8 fg_mask; | |
| 33 | UINT8 flipscreen; | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | /*----------- defined in video/momoko.c -----------*/ | |
| 38 | ||
| 39 | WRITE8_HANDLER( momoko_fg_scrollx_w ); | |
| 40 | WRITE8_HANDLER( momoko_fg_scrolly_w ); | |
| 41 | WRITE8_HANDLER( momoko_text_scrolly_w ); | |
| 42 | WRITE8_HANDLER( momoko_text_mode_w ); | |
| 43 | WRITE8_HANDLER( momoko_bg_scrollx_w ); | |
| 44 | WRITE8_HANDLER( momoko_bg_scrolly_w ); | |
| 45 | WRITE8_HANDLER( momoko_flipscreen_w ); | |
| 46 | WRITE8_HANDLER( momoko_fg_select_w); | |
| 47 | WRITE8_HANDLER( momoko_bg_select_w); | |
| 48 | WRITE8_HANDLER( momoko_bg_priority_w); | |
| 49 | ||
| 50 | VIDEO_UPDATE( momoko ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _kchamp_state kchamp_state; | |
| 8 | struct _kchamp_state | |
| 7 | class kchamp_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kchamp_state(machine)); } | |
| 11 | ||
| 12 | kchamp_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _taitoz_state taitoz_state; | |
| 8 | struct _taitoz_state | |
| 7 | class taitoz_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitoz_state(machine)); } | |
| 11 | ||
| 12 | taitoz_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spriteram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Markham | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class markham_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, markham_state(machine)); } | |
| 11 | ||
| 12 | markham_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * videoram; | |
| 16 | UINT8 * spriteram; | |
| 17 | UINT8 * xscroll; | |
| 18 | size_t spriteram_size; | |
| 19 | ||
| 20 | /* video-related */ | |
| 21 | tilemap_t *bg_tilemap; | |
| 22 | }; | |
| 23 | ||
| 24 | ||
| 25 | /*----------- defined in video/markham.c -----------*/ | |
| 26 | ||
| 27 | WRITE8_HANDLER( markham_videoram_w ); | |
| 28 | WRITE8_HANDLER( markham_flipscreen_w ); | |
| 29 | ||
| 30 | PALETTE_INIT( markham ); | |
| 31 | VIDEO_START( markham ); | |
| 32 | VIDEO_UPDATE( markham ); |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _dday_state dday_state; | |
| 9 | struct _dday_state | |
| 8 | class dday_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dday_state(machine)); } | |
| 12 | ||
| 13 | dday_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * bgvideoram; |
| 13 | 17 | UINT8 * fgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _cyberbal_state cyberbal_state; | |
| 10 | struct _cyberbal_state | |
| 9 | class cyberbal_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cyberbal_state(machine)); } | |
| 13 | ||
| 14 | cyberbal_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT16 * paletteram_0; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | /* Calculated from CRT controller writes */ |
| 8 | #define PIXEL_CLOCK (XTAL_21MHz / 3) | |
| 9 | #define FRAMEBUFFER_CLOCK XTAL_10MHz | |
| 10 | #define HBSTART 320 | |
| 11 | #define HBEND 0 | |
| 12 | #define HTOTAL 448 | |
| 13 | #define VBSTART 240 | |
| 14 | #define VBEND 0 | |
| 15 | #define VTOTAL 280 | |
| 8 | #define PIXEL_CLOCK (XTAL_21MHz / 3) | |
| 9 | #define FRAMEBUFFER_CLOCK XTAL_10MHz | |
| 10 | #define HBSTART 320 | |
| 11 | #define HBEND 0 | |
| 12 | #define HTOTAL 448 | |
| 13 | #define VBSTART 240 | |
| 14 | #define VBEND 0 | |
| 15 | #define VTOTAL 280 | |
| 16 | 16 | |
| 17 | /*----------- defined in drivers/lockon.c -----------*/ | |
| 18 | extern UINT8 lockon_ctrl_reg; | |
| 19 | extern UINT32 lockon_main_inten; | |
| 20 | 17 | |
| 18 | class lockon_state | |
| 19 | { | |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lockon_state(machine)); } | |
| 22 | ||
| 23 | lockon_state(running_machine &machine) { } | |
| 24 | ||
| 25 | /* memory pointers */ | |
| 26 | UINT16 *char_ram; | |
| 27 | UINT16 *hud_ram; | |
| 28 | UINT16 *scene_ram; | |
| 29 | UINT16 *ground_ram; | |
| 30 | UINT16 *object_ram; | |
| 31 | ||
| 32 | size_t hudram_size; | |
| 33 | size_t objectram_size; | |
| 34 | size_t groundram_size; | |
| 35 | ||
| 36 | /* video-related */ | |
| 37 | tilemap_t *tilemap; | |
| 38 | UINT8 ground_ctrl; | |
| 39 | UINT16 scroll_h; | |
| 40 | UINT16 scroll_v; | |
| 41 | bitmap_t *front_buffer; | |
| 42 | bitmap_t *back_buffer; | |
| 43 | emu_timer *bufend_timer; | |
| 44 | emu_timer *cursor_timer; | |
| 45 | ||
| 46 | /* Rotation Control */ | |
| 47 | UINT16 xsal; | |
| 48 | UINT16 x0ll; | |
| 49 | UINT16 dx0ll; | |
| 50 | UINT16 dxll; | |
| 51 | UINT16 ysal; | |
| 52 | UINT16 y0ll; | |
| 53 | UINT16 dy0ll; | |
| 54 | UINT16 dyll; | |
| 55 | ||
| 56 | /* Object palette RAM control */ | |
| 57 | UINT32 iden; | |
| 58 | UINT8 * obj_pal_ram; | |
| 59 | UINT32 obj_pal_latch; | |
| 60 | UINT32 obj_pal_addr; | |
| 61 | ||
| 62 | /* misc */ | |
| 63 | UINT8 ctrl_reg; | |
| 64 | UINT32 main_inten; | |
| 65 | ||
| 66 | /* devices */ | |
| 67 | running_device *maincpu; | |
| 68 | running_device *audiocpu; | |
| 69 | running_device *ground; | |
| 70 | running_device *object; | |
| 71 | running_device *f2203_1l; | |
| 72 | running_device *f2203_2l; | |
| 73 | running_device *f2203_3l; | |
| 74 | running_device *f2203_1r; | |
| 75 | running_device *f2203_2r; | |
| 76 | running_device *f2203_3r; | |
| 77 | }; | |
| 78 | ||
| 79 | ||
| 21 | 80 | /*----------- defined in video/lockon.c -----------*/ |
| 81 | ||
| 22 | 82 | PALETTE_INIT( lockon ); |
| 23 | 83 | VIDEO_START( lockon ); |
| 24 | 84 | VIDEO_UPDATE( lockon ); |
| r7500 | r7501 | |
| 35 | 95 | WRITE16_HANDLER( lockon_tza112_w ); |
| 36 | 96 | READ16_HANDLER( lockon_obj_4000_r ); |
| 37 | 97 | WRITE16_HANDLER( lockon_obj_4000_w ); |
| 38 | ||
| 39 | extern UINT16 *lockon_char_ram; | |
| 40 | extern UINT16 *lockon_scene_ram; | |
| 41 | extern UINT16 *lockon_object_ram; | |
| 42 | extern UINT16 *lockon_hud_ram; | |
| 43 | extern UINT16 *lockon_ground_ram; | |
| 44 | ||
| 45 | extern size_t lockon_hudram_size; | |
| 46 | extern size_t lockon_objectram_size; | |
| 47 | extern size_t lockon_groundram_size; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _mappy_state mappy_state; | |
| 2 | struct _mappy_state | |
| 1 | class mappy_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mappy_state(machine)); } | |
| 5 | ||
| 6 | mappy_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *videoram; |
| 5 | 9 | UINT8 *spriteram; |
| 6 | 10 | tilemap_t *bg_tilemap; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _rastan_state rastan_state; | |
| 8 | struct _rastan_state | |
| 7 | class rastan_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rastan_state(machine)); } | |
| 11 | ||
| 12 | rastan_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // this currently uses generic palette handlers |
| 12 | 16 |
| r0 | r7501 | |
|---|---|---|
| 1 | /******************************************************************************* | |
| 2 | ||
| 3 | Input port macros used by many games in multiple Toaplan drivers | |
| 4 | (similar to Taito but bits are ACTIVE_HIGH instead of ACTIVE_LOW) | |
| 5 | ||
| 6 | *******************************************************************************/ | |
| 7 | ||
| 8 | ||
| 9 | /**************************** Machine Dip Switches ****************************/ | |
| 10 | ||
| 11 | /* with location */ | |
| 12 | #define TOAPLAN_DSWA_BITS_2_TO_3_LOC(DIPBANK) \ | |
| 13 | PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_HIGH, #DIPBANK":3" ) \ | |
| 14 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION(#DIPBANK":4") \ | |
| 15 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) \ | |
| 16 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 17 | ||
| 18 | #define TOAPLAN_DSWA_BITS_1_TO_3_LOC(DIPBANK) \ | |
| 19 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION(#DIPBANK":2") \ | |
| 20 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 21 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) \ | |
| 22 | TOAPLAN_DSWA_BITS_2_TO_3_LOC(DIPBANK) | |
| 23 | ||
| 24 | #define TOAPLAN_MACHINE_COCKTAIL_LOC(DIPBANK) \ | |
| 25 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(#DIPBANK":1") \ | |
| 26 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) \ | |
| 27 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) \ | |
| 28 | TOAPLAN_DSWA_BITS_1_TO_3_LOC(DIPBANK) | |
| 29 | ||
| 30 | #define TOAPLAN_MACHINE_NO_COCKTAIL_LOC(DIPBANK) \ | |
| 31 | PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_HIGH, #DIPBANK":1" ) \ | |
| 32 | TOAPLAN_DSWA_BITS_1_TO_3_LOC(DIPBANK) | |
| 33 | ||
| 34 | ||
| 35 | /* without location */ | |
| 36 | #define TOAPLAN_DSWA_BITS_2_TO_3 \ | |
| 37 | PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) \ | |
| 38 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) \ | |
| 39 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) \ | |
| 40 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 41 | ||
| 42 | #define TOAPLAN_DSWA_BITS_1_TO_3 \ | |
| 43 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) \ | |
| 44 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 45 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) \ | |
| 46 | TOAPLAN_DSWA_BITS_2_TO_3 | |
| 47 | ||
| 48 | #define TOAPLAN_MACHINE_COCKTAIL \ | |
| 49 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) \ | |
| 50 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) \ | |
| 51 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) \ | |
| 52 | TOAPLAN_DSWA_BITS_1_TO_3 | |
| 53 | ||
| 54 | #define TOAPLAN_MACHINE_NO_COCKTAIL \ | |
| 55 | PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH ) \ | |
| 56 | TOAPLAN_DSWA_BITS_1_TO_3 | |
| 57 | ||
| 58 | ||
| 59 | /**************************** Coinage Dip Swicthes ****************************/ | |
| 60 | ||
| 61 | /* with location */ | |
| 62 | #define TOAPLAN_COINAGE_JAPAN_OLD_COIN_A_LOC(DIPBANK) \ | |
| 63 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":5,6") \ | |
| 64 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ | |
| 65 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 66 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) \ | |
| 67 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 68 | ||
| 69 | #define TOAPLAN_COINAGE_JAPAN_OLD_COIN_B_LOC(DIPBANK) \ | |
| 70 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":7,8") \ | |
| 71 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 72 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 73 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) \ | |
| 74 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 75 | ||
| 76 | #define TOAPLAN_COINAGE_JAPAN_NEW_COIN_A_LOC(DIPBANK) \ | |
| 77 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":5,6") \ | |
| 78 | PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) ) \ | |
| 79 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ | |
| 80 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 81 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 82 | ||
| 83 | #define TOAPLAN_COINAGE_JAPAN_NEW_COIN_B_LOC(DIPBANK) \ | |
| 84 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":7,8") \ | |
| 85 | PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) \ | |
| 86 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 87 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 88 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 89 | ||
| 90 | #define TOAPLAN_COINAGE_WORLD_COIN_A_LOC(DIPBANK) \ | |
| 91 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":5,6") \ | |
| 92 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) \ | |
| 93 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) \ | |
| 94 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 95 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 96 | ||
| 97 | #define TOAPLAN_COINAGE_WORLD_COIN_B_LOC(DIPBANK) \ | |
| 98 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":7,8") \ | |
| 99 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) \ | |
| 100 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) \ | |
| 101 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) \ | |
| 102 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 103 | ||
| 104 | #define TOAPLAN_COINAGE_US_COIN_START_LOC(DIPBANK) \ | |
| 105 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION(#DIPBANK":5,6") \ | |
| 106 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) \ | |
| 107 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) \ | |
| 108 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 109 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 110 | ||
| 111 | #define TOAPLAN_COINAGE_US_COIN_CONT_LOC(DIPBANK) \ | |
| 112 | PORT_DIPNAME( 0xc0, 0x00, "Price to Continue" ) PORT_DIPLOCATION(#DIPBANK":7,8") \ | |
| 113 | PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) \ | |
| 114 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 115 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) ) \ | |
| 116 | PORT_DIPSETTING( 0x00, "Same as Start" ) | |
| 117 | ||
| 118 | #define TOAPLAN_COINAGE_JAPAN_OLD_LOC(DIPBANK) \ | |
| 119 | TOAPLAN_COINAGE_JAPAN_OLD_COIN_A_LOC(DIPBANK) \ | |
| 120 | TOAPLAN_COINAGE_JAPAN_OLD_COIN_B_LOC(DIPBANK) | |
| 121 | ||
| 122 | #define TOAPLAN_COINAGE_JAPAN_NEW_LOC(DIPBANK) \ | |
| 123 | TOAPLAN_COINAGE_JAPAN_NEW_COIN_A_LOC(DIPBANK) \ | |
| 124 | TOAPLAN_COINAGE_JAPAN_NEW_COIN_B_LOC(DIPBANK) | |
| 125 | ||
| 126 | #define TOAPLAN_COINAGE_WORLD_LOC(DIPBANK) \ | |
| 127 | TOAPLAN_COINAGE_WORLD_COIN_A_LOC(DIPBANK) \ | |
| 128 | TOAPLAN_COINAGE_WORLD_COIN_B_LOC(DIPBANK) | |
| 129 | ||
| 130 | #define TOAPLAN_COINAGE_US_LOC(DIPBANK) \ | |
| 131 | TOAPLAN_COINAGE_US_COIN_START_LOC(DIPBANK) \ | |
| 132 | TOAPLAN_COINAGE_US_COIN_CONT_LOC(DIPBANK) | |
| 133 | ||
| 134 | #define TOAPLAN_COINAGE_DUAL_LOC(DIP, MASK, WORLD, DIPBANK) \ | |
| 135 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":5,6") \ | |
| 136 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 137 | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 138 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 139 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 140 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 141 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 142 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 143 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 144 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":7,8") \ | |
| 145 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 146 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 147 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 148 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 149 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 150 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 151 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 152 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) | |
| 153 | ||
| 154 | /* without location */ | |
| 155 | #define TOAPLAN_COINAGE_JAPAN_OLD_COIN_A \ | |
| 156 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \ | |
| 157 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ | |
| 158 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 159 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) \ | |
| 160 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 161 | ||
| 162 | #define TOAPLAN_COINAGE_JAPAN_OLD_COIN_B \ | |
| 163 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 164 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 165 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 166 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) \ | |
| 167 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 168 | ||
| 169 | #define TOAPLAN_COINAGE_JAPAN_NEW_COIN_A \ | |
| 170 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \ | |
| 171 | PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) ) \ | |
| 172 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ | |
| 173 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 174 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 175 | ||
| 176 | #define TOAPLAN_COINAGE_JAPAN_NEW_COIN_B \ | |
| 177 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 178 | PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) \ | |
| 179 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 180 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 181 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 182 | ||
| 183 | #define TOAPLAN_COINAGE_WORLD_COIN_A \ | |
| 184 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \ | |
| 185 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) \ | |
| 186 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) \ | |
| 187 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 188 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 189 | ||
| 190 | #define TOAPLAN_COINAGE_WORLD_COIN_B \ | |
| 191 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 192 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) \ | |
| 193 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) \ | |
| 194 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) \ | |
| 195 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 196 | ||
| 197 | #define TOAPLAN_COINAGE_US_COIN_START \ | |
| 198 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) \ | |
| 199 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) \ | |
| 200 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) \ | |
| 201 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 202 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 203 | ||
| 204 | #define TOAPLAN_COINAGE_US_COIN_CONT \ | |
| 205 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Continue_Price ) ) \ | |
| 206 | PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) \ | |
| 207 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 208 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) ) \ | |
| 209 | PORT_DIPSETTING( 0x00, "Same as Start" ) | |
| 210 | ||
| 211 | #define TOAPLAN_COINAGE_JAPAN_OLD \ | |
| 212 | TOAPLAN_COINAGE_JAPAN_OLD_COIN_A \ | |
| 213 | TOAPLAN_COINAGE_JAPAN_OLD_COIN_B | |
| 214 | ||
| 215 | #define TOAPLAN_COINAGE_JAPAN_NEW \ | |
| 216 | TOAPLAN_COINAGE_JAPAN_NEW_COIN_A \ | |
| 217 | TOAPLAN_COINAGE_JAPAN_NEW_COIN_B | |
| 218 | ||
| 219 | #define TOAPLAN_COINAGE_WORLD \ | |
| 220 | TOAPLAN_COINAGE_WORLD_COIN_A \ | |
| 221 | TOAPLAN_COINAGE_WORLD_COIN_B | |
| 222 | ||
| 223 | #define TOAPLAN_COINAGE_US \ | |
| 224 | TOAPLAN_COINAGE_US_COIN_START \ | |
| 225 | TOAPLAN_COINAGE_US_COIN_CONT | |
| 226 | ||
| 227 | #define TOAPLAN_COINAGE_DUAL(DIP, MASK, WORLD) \ | |
| 228 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \ | |
| 229 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 230 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 231 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 232 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 233 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 234 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 235 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 236 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 237 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 238 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 239 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 240 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 241 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \ | |
| 242 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 243 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 244 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \ | |
| 245 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) | |
| 246 | ||
| 247 | ||
| 248 | /************************** Difficulty Dip Switches ***************************/ | |
| 249 | ||
| 250 | /* with location */ | |
| 251 | #define TOAPLAN_DIFFICULTY_LOC(DIPBANK) \ | |
| 252 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION(#DIPBANK":1,2") \ | |
| 253 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) \ | |
| 254 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) \ | |
| 255 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) \ | |
| 256 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 257 | ||
| 258 | /* without location */ | |
| 259 | #define TOAPLAN_DIFFICULTY \ | |
| 260 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) \ | |
| 261 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) \ | |
| 262 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) \ | |
| 263 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) \ | |
| 264 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 265 | ||
| 266 | ||
| 267 | /************************** Joysticks and buttons *****************************/ | |
| 268 | ||
| 269 | /* generic (might be moved elsewhere) */ | |
| 270 | #define INPUT_GENERIC_JOY_LOW_NIBBLE(PL, STATE, WAY, B01, B02, B04, B08) \ | |
| 271 | PORT_BIT( 0x01, STATE, IPT_JOYSTICK_##B01 ) WAY PORT_PLAYER(PL) \ | |
| 272 | PORT_BIT( 0x02, STATE, IPT_JOYSTICK_##B02 ) WAY PORT_PLAYER(PL) \ | |
| 273 | PORT_BIT( 0x04, STATE, IPT_JOYSTICK_##B04 ) WAY PORT_PLAYER(PL) \ | |
| 274 | PORT_BIT( 0x08, STATE, IPT_JOYSTICK_##B08 ) WAY PORT_PLAYER(PL) | |
| 275 | ||
| 276 | ||
| 277 | /* Toaplan generic (more might be needed) */ | |
| 278 | #define TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 279 | INPUT_GENERIC_JOY_LOW_NIBBLE(PL, IP_ACTIVE_HIGH, PORT_8WAY, UP, DOWN, LEFT, RIGHT) | |
| 280 | ||
| 281 | ||
| 282 | #define TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, STATE, BUTTON_A, BUTTON_B) \ | |
| 283 | PORT_BIT( 0x10, STATE, IPT_##BUTTON_A ) PORT_PLAYER(PL) \ | |
| 284 | PORT_BIT( 0x20, STATE, IPT_##BUTTON_B ) PORT_PLAYER(PL) \ | |
| 285 | /* DO NOT fill bit 6 as it may be defined as START button ! */ | |
| 286 | ||
| 287 | #define TOAPLAN_GENERIC_1_BUTTON(PL) \ | |
| 288 | TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, IP_ACTIVE_HIGH, BUTTON1, UNKNOWN) \ | |
| 289 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 290 | ||
| 291 | #define TOAPLAN_GENERIC_2_BUTTONS(PL) \ | |
| 292 | TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, IP_ACTIVE_HIGH, BUTTON1, BUTTON2) \ | |
| 293 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 294 | ||
| 295 | #define TOAPLAN_GENERIC_3_BUTTONS(PL) \ | |
| 296 | TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, IP_ACTIVE_HIGH, BUTTON1, BUTTON2) \ | |
| 297 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(PL) \ | |
| 298 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 299 | ||
| 300 | #define TOAPLAN_GENERIC_1_BUTTON_START(PL) \ | |
| 301 | TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, IP_ACTIVE_HIGH, BUTTON1, UNKNOWN) \ | |
| 302 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START##PL ) \ | |
| 303 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 304 | ||
| 305 | #define TOAPLAN_GENERIC_2_BUTTONS_START(PL) \ | |
| 306 | TOAPLAN_GENERIC_BUTTONS_HIGH_NIBBLE(PL, IP_ACTIVE_HIGH, BUTTON1, BUTTON2) \ | |
| 307 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START##PL ) \ | |
| 308 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 309 | ||
| 310 | ||
| 311 | /* Toaplan games (more might be needed) */ | |
| 312 | #define TOAPLAN_JOY_UDLR_1_BUTTON(PL) \ | |
| 313 | TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 314 | TOAPLAN_GENERIC_1_BUTTON(PL) | |
| 315 | ||
| 316 | #define TOAPLAN_JOY_UDLR_2_BUTTONS(PL) \ | |
| 317 | TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 318 | TOAPLAN_GENERIC_2_BUTTONS(PL) | |
| 319 | ||
| 320 | #define TOAPLAN_JOY_UDLR_3_BUTTONS(PL) \ | |
| 321 | TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 322 | TOAPLAN_GENERIC_3_BUTTONS(PL) | |
| 323 | ||
| 324 | ||
| 325 | #define TOAPLAN_JOY_UDLR_1_BUTTON_START(PL) \ | |
| 326 | TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 327 | TOAPLAN_GENERIC_1_BUTTON_START(PL) | |
| 328 | ||
| 329 | #define TOAPLAN_JOY_UDLR_2_BUTTONS_START(PL) \ | |
| 330 | TOAPLAN_GENERIC_JOY_MONO_UDLR(PL) \ | |
| 331 | TOAPLAN_GENERIC_2_BUTTONS_START(PL) | |
| 332 | ||
| 333 | ||
| 334 | /******************************* Test switch **********************************/ | |
| 335 | ||
| 336 | /* Set to 0 if you want to see the "TEST" switch as a standard input | |
| 337 | Set to 1 if you want to see the "TEST" switch as a fake Dip Switch */ | |
| 338 | ||
| 339 | #define SHOW_TEST_AS_DIP 1 | |
| 340 | ||
| 341 | #if SHOW_TEST_AS_DIP | |
| 342 | #define TOAPLAN_TEST_SWITCH(MASK, STATE) \ | |
| 343 | PORT_DIPNAME( MASK, MASK & STATE, "Test Switch" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE \ | |
| 344 | PORT_DIPSETTING( MASK & STATE, DEF_STR( Off ) ) \ | |
| 345 | PORT_DIPSETTING( MASK & ~STATE, DEF_STR( On ) ) | |
| 346 | #else | |
| 347 | #define TOAPLAN_TEST_SWITCH(MASK, STATE) \ | |
| 348 | PORT_BIT( MASK, MASK & STATE, IPT_SPECIAL ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F1) | |
| 349 | #endif | |
| 350 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gijoe_state gijoe_state; | |
| 8 | struct _gijoe_state | |
| 7 | class gijoe_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gijoe_state(machine)); } | |
| 11 | ||
| 12 | gijoe_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * workram; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _metalmx_state metalmx_state; | |
| 2 | struct _metalmx_state | |
| 1 | class metalmx_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, metalmx_state(machine)); } | |
| 5 | ||
| 6 | metalmx_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | running_device *maincpu; |
| 5 | 9 | running_device *gsp; |
| 6 | 10 | running_device *adsp; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _badlands_state badlands_state; | |
| 10 | struct _badlands_state | |
| 9 | class badlands_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, badlands_state(machine)); } | |
| 13 | ||
| 14 | badlands_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT8 pedal_value[2]; |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | #define SPRITE_PRI(n) (((state->vidregs[2] << (4*n)) & 0xf0000000 ) >> 28) |
| 17 | 17 | |
| 18 | 18 | |
| 19 | typedef struct _psikyosh_state psikyosh_state; | |
| 20 | struct _psikyosh_state | |
| 19 | class psikyosh_state | |
| 21 | 20 | { |
| 21 | public: | |
| 22 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, psikyosh_state(machine)); } | |
| 23 | ||
| 24 | psikyosh_state(running_machine &machine) { } | |
| 25 | ||
| 22 | 26 | /* memory pointers */ |
| 23 | 27 | UINT32 * bgram; |
| 24 | 28 | UINT32 * zoomram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Boogie Wings | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class boogwing_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, boogwing_state(machine)); } | |
| 11 | ||
| 12 | boogwing_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * pf3_rowscroll; | |
| 18 | UINT16 * pf4_rowscroll; | |
| 19 | ||
| 20 | /* devices */ | |
| 21 | running_device *maincpu; | |
| 22 | running_device *audiocpu; | |
| 23 | running_device *deco16ic; | |
| 24 | running_device *oki1; | |
| 25 | running_device *oki2; | |
| 26 | }; | |
| 27 | ||
| 28 | ||
| 29 | /*----------- defined in video/boogwing.c -----------*/ | |
| 30 | ||
| 31 | VIDEO_UPDATE( boogwing ); | |
| 32 |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _offtwall_state offtwall_state; | |
| 10 | struct _offtwall_state | |
| 9 | class offtwall_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, offtwall_state(machine)); } | |
| 13 | ||
| 14 | offtwall_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | }; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | #define POPDRUMKIT 0 |
| 3 | 3 | |
| 4 | 4 | |
| 5 | typedef struct _equites_state equites_state; | |
| 6 | struct _equites_state | |
| 5 | class equites_state | |
| 7 | 6 | { |
| 7 | public: | |
| 8 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, equites_state(machine)); } | |
| 9 | ||
| 10 | equites_state(running_machine &machine) { } | |
| 11 | ||
| 8 | 12 | /* memory pointers */ |
| 9 | 13 | UINT16 * bg_videoram; |
| 10 | 14 | UINT8 * fg_videoram; // 8bits |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gradius3_state gradius3_state; | |
| 8 | struct _gradius3_state | |
| 7 | class gradius3_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gradius3_state(machine)); } | |
| 11 | ||
| 12 | gradius3_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * gfxram; |
| 12 | 16 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | typedef struct _fromance_state fromance_state; | |
| 11 | struct _fromance_state | |
| 10 | class fromance_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fromance_state(machine)); } | |
| 14 | ||
| 15 | fromance_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers (used by pipedrm) */ |
| 14 | 18 | UINT8 * videoram; |
| 15 | 19 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _klax_state klax_state; | |
| 10 | struct _klax_state | |
| 9 | class klax_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, klax_state(machine)); } | |
| 13 | ||
| 14 | klax_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | }; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | |
| 31 | typedef struct _neogeo_state neogeo_state; | |
| 32 | struct _neogeo_state | |
| 31 | class neogeo_state | |
| 33 | 32 | { |
| 33 | public: | |
| 34 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, neogeo_state(machine)); } | |
| 35 | ||
| 36 | neogeo_state(running_machine &machine) { } | |
| 37 | ||
| 34 | 38 | /* memory pointers */ |
| 35 | 39 | // UINT8 *memcard_data; // this currently uses generic handlers |
| 36 | 40 | // UINT16 *save_ram; // this currently uses generic handlers |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _thunderj_state thunderj_state; | |
| 10 | struct _thunderj_state | |
| 9 | class thunderj_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, thunderj_state(machine)); } | |
| 13 | ||
| 14 | thunderj_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | UINT8 alpha_tile_bank; |
| 14 | 18 | }; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ultraman_state ultraman_state; | |
| 8 | struct _ultraman_state | |
| 7 | class ultraman_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ultraman_state(machine)); } | |
| 11 | ||
| 12 | ultraman_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _parodius_state parodius_state; | |
| 8 | struct _parodius_state | |
| 7 | class parodius_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, parodius_state(machine)); } | |
| 11 | ||
| 12 | parodius_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | *************************************************************************/ |
| 8 | 8 | |
| 9 | typedef struct _ladybug_state ladybug_state; | |
| 10 | struct _ladybug_state | |
| 9 | class ladybug_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ladybug_state(machine)); } | |
| 13 | ||
| 14 | ladybug_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * videoram; |
| 14 | 18 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _blueprnt_state blueprnt_state; | |
| 8 | struct _blueprnt_state | |
| 7 | class blueprnt_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, blueprnt_state(machine)); } | |
| 11 | ||
| 12 | blueprnt_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _combatsc_state combatsc_state; | |
| 8 | struct _combatsc_state | |
| 7 | class combatsc_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, combatsc_state(machine)); } | |
| 11 | ||
| 12 | combatsc_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * scrollram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _rockrage_state rockrage_state; | |
| 8 | struct _rockrage_state | |
| 7 | class rockrage_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rockrage_state(machine)); } | |
| 11 | ||
| 12 | rockrage_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * paletteram; |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | 40love.c, bking.c and msisaac.c |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | typedef struct _buggychl_state buggychl_state; | |
| 7 | struct _buggychl_state | |
| 6 | class buggychl_state | |
| 8 | 7 | { |
| 8 | public: | |
| 9 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, buggychl_state(machine)); } | |
| 10 | ||
| 11 | buggychl_state(running_machine &machine) { } | |
| 12 | ||
| 9 | 13 | /* memory pointers */ |
| 10 | 14 | UINT8 * videoram; // buggychl, 40love, msisaac |
| 11 | 15 | UINT8 * videoram2; // msisaac |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gotcha_state gotcha_state; | |
| 8 | struct _gotcha_state | |
| 7 | class gotcha_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gotcha_state(machine)); } | |
| 11 | ||
| 12 | gotcha_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * fgvideoram; |
| 12 | 16 | UINT16 * bgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _bigstrkb_state bigstrkb_state; | |
| 2 | struct _bigstrkb_state | |
| 1 | class bigstrkb_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigstrkb_state(machine)); } | |
| 5 | ||
| 6 | bigstrkb_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *tilemap; |
| 5 | 9 | tilemap_t *tilemap2; |
| 6 | 10 | tilemap_t *tilemap3; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _pandoras_state pandoras_state; | |
| 8 | struct _pandoras_state | |
| 7 | class pandoras_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pandoras_state(machine)); } | |
| 11 | ||
| 12 | pandoras_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | int primask; |
| 9 | 9 | }; |
| 10 | 10 | |
| 11 | typedef struct _taitof2_state taitof2_state; | |
| 12 | struct _taitof2_state | |
| 11 | class taitof2_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitof2_state(machine)); } | |
| 15 | ||
| 16 | taitof2_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT16 * sprite_extension; |
| 16 | 20 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gberet_state gberet_state; | |
| 8 | struct _gberet_state | |
| 7 | class gberet_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gberet_state(machine)); } | |
| 11 | ||
| 12 | gberet_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _segas1x_state segas1x_state; | |
| 3 | struct _segas1x_state | |
| 2 | class segas1x_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, segas1x_state(machine)); } | |
| 6 | ||
| 7 | segas1x_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | // UINT16 * workram; // this is used in the nvram handler, hence it cannot be added here |
| 7 | 11 | // UINT16 * paletteram; // this is used in the segaic16 mapper, hence it cannot be added here (yet) |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _ddragon_state ddragon_state; | |
| 9 | struct _ddragon_state | |
| 8 | class ddragon_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ddragon_state(machine)); } | |
| 12 | ||
| 13 | ddragon_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* memory pointers */ |
| 12 | 16 | UINT8 * rambase; |
| 13 | 17 | UINT8 * bgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _asterix_state asterix_state; | |
| 8 | struct _asterix_state | |
| 7 | class asterix_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, asterix_state(machine)); } | |
| 11 | ||
| 12 | asterix_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _homedata_state homedata_state; | |
| 3 | struct _homedata_state | |
| 2 | class homedata_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, homedata_state(machine)); } | |
| 6 | ||
| 7 | homedata_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * vreg; |
| 7 | 11 | UINT8 * videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _mugsmash_state mugsmash_state; | |
| 2 | struct _mugsmash_state | |
| 1 | ||
| 2 | class mugsmash_state | |
| 3 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mugsmash_state(machine)); } | |
| 6 | ||
| 7 | mugsmash_state(running_machine &machine) { } | |
| 8 | ||
| 4 | 9 | UINT16 *videoram1; |
| 5 | 10 | UINT16 *videoram2; |
| 6 | 11 | UINT16 *spriteram; |
| 7 | 12 | UINT16 *regs1; |
| 8 | 13 | UINT16 *regs2; |
| 14 | ||
| 9 | 15 | tilemap_t *tilemap1; |
| 10 | 16 | tilemap_t *tilemap2; |
| 17 | ||
| 18 | running_device *maincpu; | |
| 19 | running_device *audiocpu; | |
| 11 | 20 | }; |
| 12 | 21 | |
| 13 | 22 |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Macross Plus | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class macrossp_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, macrossp_state(machine)); } | |
| 11 | ||
| 12 | macrossp_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT32 * mainram; | |
| 16 | UINT32 * scra_videoram; | |
| 17 | UINT32 * scra_videoregs; | |
| 18 | UINT32 * scrb_videoram; | |
| 19 | UINT32 * scrb_videoregs; | |
| 20 | UINT32 * scrc_videoram; | |
| 21 | UINT32 * scrc_videoregs; | |
| 22 | UINT32 * text_videoram; | |
| 23 | UINT32 * text_videoregs; | |
| 24 | UINT32 * spriteram; | |
| 25 | UINT32 * spriteram_old; | |
| 26 | UINT32 * spriteram_old2; | |
| 27 | UINT32 * paletteram; | |
| 28 | size_t spriteram_size; | |
| 29 | ||
| 30 | /* video-related */ | |
| 31 | tilemap_t *scra_tilemap, *scrb_tilemap, *scrc_tilemap, *text_tilemap; | |
| 32 | ||
| 33 | /* misc */ | |
| 34 | int sndpending; | |
| 35 | int snd_toggle; | |
| 36 | INT32 fade_effect, old_fade; | |
| 37 | ||
| 38 | /* devices */ | |
| 39 | running_device *maincpu; | |
| 40 | running_device *audiocpu; | |
| 41 | }; | |
| 42 | ||
| 43 | /*----------- defined in video/macrossp.c -----------*/ | |
| 44 | ||
| 45 | WRITE32_HANDLER( macrossp_scra_videoram_w ); | |
| 46 | WRITE32_HANDLER( macrossp_scrb_videoram_w ); | |
| 47 | WRITE32_HANDLER( macrossp_scrc_videoram_w ); | |
| 48 | WRITE32_HANDLER( macrossp_text_videoram_w ); | |
| 49 | ||
| 50 | VIDEO_START(macrossp); | |
| 51 | VIDEO_UPDATE(macrossp); | |
| 52 | VIDEO_EOF(macrossp); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _moo_state moo_state; | |
| 8 | struct _moo_state | |
| 7 | class moo_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, moo_state(machine)); } | |
| 11 | ||
| 12 | moo_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * workram; |
| 12 | 16 | UINT16 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _goindol_state goindol_state; | |
| 8 | struct _goindol_state | |
| 7 | class goindol_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, goindol_state(machine)); } | |
| 11 | ||
| 12 | goindol_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * bg_videoram; |
| 12 | 16 | UINT8 * fg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | #define TAITOL_SPRITERAM_SIZE 0x400 |
| 3 | 3 | |
| 4 | typedef struct _taitol_state taitol_state; | |
| 5 | struct _taitol_state | |
| 4 | class taitol_state | |
| 6 | 5 | { |
| 6 | public: | |
| 7 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, taitol_state(machine)); } | |
| 8 | ||
| 9 | taitol_state(running_machine &machine) { } | |
| 10 | ||
| 7 | 11 | /* memory pointers */ |
| 8 | 12 | UINT8 * rambanks; |
| 9 | 13 | UINT8 * palette_ram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _gyruss_state gyruss_state; | |
| 8 | struct _gyruss_state | |
| 7 | class gyruss_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gyruss_state(machine)); } | |
| 11 | ||
| 12 | gyruss_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _fastlane_state fastlane_state; | |
| 8 | struct _fastlane_state | |
| 7 | class fastlane_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fastlane_state(machine)); } | |
| 11 | ||
| 12 | fastlane_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram1; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | /* These share sound hardware (in audio/irem.h) and hence driver data */ |
| 8 | 8 | |
| 9 | typedef struct _irem_z80_state irem_z80_state; | |
| 10 | struct _irem_z80_state | |
| 9 | class irem_z80_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, irem_z80_state(machine)); } | |
| 13 | ||
| 14 | irem_z80_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * videoram; // m52, m57, m58 |
| 14 | 18 | UINT8 * spriteram; // m52, m57, m58, m62 |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | typedef struct _kangaroo_state kangaroo_state; | |
| 10 | struct _kangaroo_state | |
| 9 | class kangaroo_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kangaroo_state(machine)); } | |
| 13 | ||
| 14 | kangaroo_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * video_control; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _cabal_state cabal_state; | |
| 2 | struct _cabal_state | |
| 1 | class cabal_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cabal_state(machine)); } | |
| 5 | ||
| 6 | cabal_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT16 *spriteram; |
| 5 | 9 | UINT16 *colorram; |
| 6 | 10 | UINT16 *videoram; |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #define DRACO_PAGERAM_MASK 0x7ff |
| 25 | 25 | #define CIDELSA_CHARRAM_MASK 0x7ff |
| 26 | 26 | |
| 27 | typedef struct _cidelsa_state cidelsa_state; | |
| 27 | class cidelsa_state | |
| 28 | { | |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cidelsa_state(machine)); } | |
| 28 | 31 | |
| 29 | struct _cidelsa_state | |
| 30 | { | |
| 32 | cidelsa_state(running_machine &machine) { } | |
| 33 | ||
| 31 | 34 | /* cpu state */ |
| 32 | 35 | cdp1802_control_mode cdp1802_mode; |
| 33 | 36 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _vendetta_state vendetta_state; | |
| 8 | struct _vendetta_state | |
| 7 | class vendetta_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, vendetta_state(machine)); } | |
| 11 | ||
| 12 | vendetta_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | #define VISIBLE_Y_MAX (30*8) |
| 23 | 23 | |
| 24 | 24 | |
| 25 | typedef struct _fcombat_state fcombat_state; | |
| 26 | struct _fcombat_state | |
| 25 | class fcombat_state | |
| 27 | 26 | { |
| 27 | public: | |
| 28 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fcombat_state(machine)); } | |
| 29 | ||
| 30 | fcombat_state(running_machine &machine) { } | |
| 31 | ||
| 28 | 32 | /* memory pointers */ |
| 29 | 33 | UINT8 * videoram; |
| 30 | 34 | UINT8 * spriteram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Pocket Gal Deluxe | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class pktgaldx_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pktgaldx_state(machine)); } | |
| 11 | ||
| 12 | pktgaldx_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT16 * pf1_rowscroll; | |
| 16 | UINT16 * pf2_rowscroll; | |
| 17 | UINT16 * spriteram; | |
| 18 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 19 | size_t spriteram_size; | |
| 20 | ||
| 21 | UINT16* pktgaldb_fgram; | |
| 22 | UINT16* pktgaldb_sprites; | |
| 23 | ||
| 24 | /* devices */ | |
| 25 | running_device *maincpu; | |
| 26 | running_device *deco16ic; | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | /*----------- defined in video/pktgaldx.c -----------*/ | |
| 32 | ||
| 33 | VIDEO_UPDATE( pktgaldx ); | |
| 34 | VIDEO_UPDATE( pktgaldb ); |
| r7500 | r7501 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | #define JUNGLER_MAX_STARS 1000 |
| 21 | 21 | |
| 22 | typedef struct _timeplt_state timeplt_state; | |
| 23 | struct _timeplt_state | |
| 22 | class timeplt_state | |
| 24 | 23 | { |
| 24 | public: | |
| 25 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, timeplt_state(machine)); } | |
| 26 | ||
| 27 | timeplt_state(running_machine &machine) { } | |
| 28 | ||
| 25 | 29 | /* memory pointers */ |
| 26 | 30 | UINT8 * videoram; // timeplt, tutankham, junofrst, rocnrope, pooyan, rallyx |
| 27 | 31 | UINT8 * colorram; // timeplt, rocnrope, pooyan |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _atarigx2_state atarigx2_state; | |
| 10 | struct _atarigx2_state | |
| 9 | class atarigx2_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarigx2_state(machine)); } | |
| 13 | ||
| 14 | atarigx2_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | UINT16 playfield_base; |
| 14 | 18 | UINT16 motion_object_base; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _fuuki16_state fuuki16_state; | |
| 4 | struct _fuuki16_state | |
| 3 | class fuuki16_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fuuki16_state(machine)); } | |
| 7 | ||
| 8 | fuuki16_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT16 * vram_0; |
| 8 | 12 | UINT16 * vram_1; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | #define GAME_IS_RIPCORD (state->game_id == 4) |
| 7 | 7 | |
| 8 | 8 | |
| 9 | typedef struct _circus_state circus_state; | |
| 10 | struct _circus_state | |
| 9 | class circus_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, circus_state(machine)); } | |
| 13 | ||
| 14 | circus_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | /* memory pointers */ |
| 13 | 17 | UINT8 * videoram; |
| 14 | 18 |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _sderby_state sderby_state; | |
| 2 | struct _sderby_state | |
| 1 | class sderby_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sderby_state(machine)); } | |
| 5 | ||
| 6 | sderby_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT16 *spriteram; |
| 5 | 9 | size_t spriteram_size; |
| 6 | 10 |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _vastar_state vastar_state; | |
| 2 | struct _vastar_state | |
| 1 | class vastar_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, vastar_state(machine)); } | |
| 5 | ||
| 6 | vastar_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | UINT8 *spriteram1; |
| 5 | 9 | UINT8 *spriteram2; |
| 6 | 10 | UINT8 *spriteram3; |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/atarigen.h" |
| 8 | 8 | |
| 9 | typedef struct _relief_state relief_state; | |
| 10 | struct _relief_state | |
| 9 | class relief_state | |
| 11 | 10 | { |
| 11 | public: | |
| 12 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, relief_state(machine)); } | |
| 13 | ||
| 14 | relief_state(running_machine &machine) { } | |
| 15 | ||
| 12 | 16 | atarigen_state atarigen; |
| 13 | 17 | |
| 14 | 18 | UINT8 ym2413_volume; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _homerun_state homerun_state; | |
| 8 | struct _homerun_state | |
| 7 | class homerun_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, homerun_state(machine)); } | |
| 11 | ||
| 12 | homerun_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #define CPUTAG_MCU "mcu" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | typedef struct _champbas_state champbas_state; | |
| 12 | struct _champbas_state | |
| 11 | class champbas_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, champbas_state(machine)); } | |
| 15 | ||
| 16 | champbas_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT8 * bg_videoram; |
| 16 | 20 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _ninjaw_state ninjaw_state; | |
| 8 | struct _ninjaw_state | |
| 7 | class ninjaw_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ninjaw_state(machine)); } | |
| 11 | ||
| 12 | ninjaw_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * spriteram; |
| 12 | 16 | size_t spriteram_size; |
| r7500 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | class matmania_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, matmania_state(machine)); } | |
| 6 | ||
| 7 | matmania_state(running_machine &machine) { } | |
| 8 | ||
| 9 | /* memory pointers */ | |
| 10 | UINT8 * videoram; | |
| 11 | UINT8 * videoram2; | |
| 12 | UINT8 * videoram3; | |
| 13 | UINT8 * colorram; | |
| 14 | UINT8 * colorram2; | |
| 15 | UINT8 * colorram3; | |
| 16 | UINT8 * scroll; | |
| 17 | UINT8 * pageselect; | |
| 18 | UINT8 * spriteram; | |
| 19 | UINT8 * paletteram; | |
| 20 | size_t videoram_size; | |
| 21 | size_t videoram2_size; | |
| 22 | size_t videoram3_size; | |
| 23 | size_t spriteram_size; | |
| 24 | ||
| 25 | /* video-related */ | |
| 26 | bitmap_t *tmpbitmap; | |
| 27 | bitmap_t *tmpbitmap2; | |
| 28 | ||
| 29 | /* mcu */ | |
| 30 | /* maniach 68705 protection */ | |
| 31 | UINT8 port_a_in, port_a_out, ddr_a; | |
| 32 | UINT8 port_b_in, port_b_out, ddr_b; | |
| 33 | UINT8 port_c_in, port_c_out, ddr_c; | |
| 34 | UINT8 from_main, from_mcu; | |
| 35 | int mcu_sent, main_sent; | |
| 36 | ||
| 37 | /* devices */ | |
| 38 | running_device *maincpu; | |
| 39 | running_device *audiocpu; | |
| 40 | running_device *mcu; | |
| 41 | }; | |
| 42 | ||
| 1 | 43 | /*----------- defined in machine/maniach.c -----------*/ |
| 2 | 44 | |
| 3 | READ8_HANDLER( maniach_68705_portA_r ); | |
| 4 | WRITE8_HANDLER( maniach_68705_portA_w ); | |
| 5 | READ8_HANDLER( maniach_68705_portB_r ); | |
| 6 | WRITE8_HANDLER( maniach_68705_portB_w ); | |
| 7 | READ8_HANDLER( maniach_68705_portC_r ); | |
| 8 | WRITE8_HANDLER( maniach_68705_portC_w ); | |
| 9 | WRITE8_HANDLER( maniach_68705_ddrA_w ); | |
| 10 | WRITE8_HANDLER( maniach_68705_ddrB_w ); | |
| 11 | WRITE8_HANDLER( maniach_68705_ddrC_w ); | |
| 45 | READ8_HANDLER( maniach_68705_port_a_r ); | |
| 46 | WRITE8_HANDLER( maniach_68705_port_a_w ); | |
| 47 | READ8_HANDLER( maniach_68705_port_b_r ); | |
| 48 | WRITE8_HANDLER( maniach_68705_port_b_w ); | |
| 49 | READ8_HANDLER( maniach_68705_port_c_r ); | |
| 50 | WRITE8_HANDLER( maniach_68705_port_c_w ); | |
| 51 | WRITE8_HANDLER( maniach_68705_ddr_a_w ); | |
| 52 | WRITE8_HANDLER( maniach_68705_ddr_b_w ); | |
| 53 | WRITE8_HANDLER( maniach_68705_ddr_c_w ); | |
| 12 | 54 | WRITE8_HANDLER( maniach_mcu_w ); |
| 13 | 55 | READ8_HANDLER( maniach_mcu_r ); |
| 14 | 56 | READ8_HANDLER( maniach_mcu_status_r ); |
| r7500 | r7501 | |
| 16 | 58 | |
| 17 | 59 | /*----------- defined in video/matmania.c -----------*/ |
| 18 | 60 | |
| 19 | extern UINT8 *matmania_videoram,*matmania_colorram; | |
| 20 | extern size_t matmania_videoram_size; | |
| 21 | extern UINT8 *matmania_videoram2,*matmania_colorram2; | |
| 22 | extern size_t matmania_videoram2_size; | |
| 23 | extern UINT8 *matmania_videoram3,*matmania_colorram3; | |
| 24 | extern size_t matmania_videoram3_size; | |
| 25 | extern UINT8 *matmania_scroll; | |
| 26 | extern UINT8 *matmania_pageselect; | |
| 27 | ||
| 28 | 61 | WRITE8_HANDLER( matmania_paletteram_w ); |
| 29 | 62 | PALETTE_INIT( matmania ); |
| 30 | 63 | VIDEO_UPDATE( maniach ); |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | PADDLE2 |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | typedef struct _arkanoid_state arkanoid_state; | |
| 14 | struct _arkanoid_state | |
| 13 | class arkanoid_state | |
| 15 | 14 | { |
| 15 | public: | |
| 16 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, arkanoid_state(machine)); } | |
| 17 | ||
| 18 | arkanoid_state(running_machine &machine) { } | |
| 19 | ||
| 16 | 20 | /* memory pointers */ |
| 17 | 21 | UINT8 * videoram; |
| 18 | 22 | UINT8 * spriteram; |
| 19 | 23 | size_t spriteram_size; |
| 24 | size_t videoram_size; | |
| 20 | 25 | |
| 21 | 26 | /* video-related */ |
| 22 | 27 | tilemap_t *bg_tilemap; |
| r7500 | r7501 | |
| 44 | 49 | |
| 45 | 50 | extern WRITE8_HANDLER( arkanoid_d008_w ); |
| 46 | 51 | extern WRITE8_HANDLER( tetrsark_d008_w ); |
| 52 | extern WRITE8_HANDLER( hexa_d008_w ); | |
| 47 | 53 | |
| 48 | 54 | extern VIDEO_START( arkanoid ); |
| 49 | 55 | extern VIDEO_UPDATE( arkanoid ); |
| 56 | extern VIDEO_UPDATE( hexa ); | |
| 50 | 57 | |
| 51 | 58 | |
| 52 | 59 | /*----------- defined in machine/arkanoid.c -----------*/ |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _crshrace_state crshrace_state; | |
| 3 | struct _crshrace_state | |
| 2 | class crshrace_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, crshrace_state(machine)); } | |
| 6 | ||
| 7 | crshrace_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT16 * videoram1; |
| 7 | 11 | UINT16 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _airbustr_state airbustr_state; | |
| 8 | struct _airbustr_state | |
| 7 | class airbustr_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, airbustr_state(machine)); } | |
| 11 | ||
| 12 | airbustr_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | **************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | |
| 8 | typedef struct _dcheese_state dcheese_state; | |
| 9 | struct _dcheese_state | |
| 8 | class dcheese_state | |
| 10 | 9 | { |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dcheese_state(machine)); } | |
| 12 | ||
| 13 | dcheese_state(running_machine &machine) { } | |
| 14 | ||
| 11 | 15 | /* video-related */ |
| 12 | 16 | UINT16 blitter_color[2]; |
| 13 | 17 | UINT16 blitter_xparam[16]; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _chqflag_state chqflag_state; | |
| 8 | struct _chqflag_state | |
| 7 | class chqflag_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chqflag_state(machine)); } | |
| 11 | ||
| 12 | chqflag_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * ram; |
| 12 | 16 | // UINT8 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #define BW_DEBUG 0 |
| 8 | 8 | #define MAX_SOUNDS 16 |
| 9 | 9 | |
| 10 | typedef struct _bwing_state bwing_state; | |
| 11 | struct _bwing_state | |
| 10 | class bwing_state | |
| 12 | 11 | { |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bwing_state(machine)); } | |
| 14 | ||
| 15 | bwing_state(running_machine &machine) { } | |
| 16 | ||
| 13 | 17 | /* memory pointers */ |
| 14 | 18 | UINT8 * videoram; |
| 15 | 19 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _sf_state sf_state; | |
| 8 | struct _sf_state | |
| 7 | class sf_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sf_state(machine)); } | |
| 11 | ||
| 12 | sf_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * videoram; |
| 12 | 16 | UINT16 * objectram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | class lsasquad_state | |
| 3 | { | |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lsasquad_state(machine)); } | |
| 6 | ||
| 7 | lsasquad_state(running_machine &machine) { } | |
| 8 | ||
| 9 | /* memory pointers */ | |
| 10 | UINT8 * scrollram; | |
| 11 | UINT8 * videoram; | |
| 12 | UINT8 * spriteram; | |
| 13 | size_t spriteram_size; | |
| 14 | size_t videoram_size; | |
| 15 | ||
| 16 | /* misc */ | |
| 17 | int invertcoin; | |
| 18 | int sound_pending; | |
| 19 | int sound_nmi_enable, pending_nmi, sound_cmd, sound_result; | |
| 20 | ||
| 21 | /* daikaiju */ | |
| 22 | int daikaiju_xor, daikaiju_command, daikaiju_length, daikaiju_prev, daikaiju_cnt, daikaiju_cntr; | |
| 23 | int daikaiju_buffer[256]; | |
| 24 | ||
| 25 | /* mcu */ | |
| 26 | UINT8 from_main, from_mcu; | |
| 27 | int mcu_sent, main_sent; | |
| 28 | UINT8 port_a_in, port_a_out, ddr_a; | |
| 29 | UINT8 port_b_in, port_b_out, ddr_b; | |
| 30 | ||
| 31 | /* devices */ | |
| 32 | running_device *maincpu; | |
| 33 | running_device *audiocpu; | |
| 34 | running_device *mcu; | |
| 35 | }; | |
| 36 | ||
| 37 | ||
| 1 | 38 | /*----------- defined in machine/daikaiju.c -----------*/ |
| 2 | 39 | |
| 3 | 40 | READ8_HANDLER( daikaiju_mcu_r); |
| r7500 | r7501 | |
| 4 | 41 | WRITE8_HANDLER( daikaiju_mcu_w); |
| 5 | 42 | READ8_HANDLER( daikaiju_mcu_status_r); |
| 6 | 43 | |
| 7 | MACHINE_RESET(daikaiju); | |
| 8 | ||
| 9 | ||
| 10 | 44 | /*----------- defined in machine/lsasquad.c -----------*/ |
| 11 | 45 | |
| 12 | extern int lsasquad_invertcoin; | |
| 13 | extern int lsasquad_sound_pending; | |
| 14 | ||
| 15 | 46 | WRITE8_HANDLER( lsasquad_sh_nmi_disable_w ); |
| 16 | 47 | WRITE8_HANDLER( lsasquad_sh_nmi_enable_w ); |
| 17 | 48 | WRITE8_HANDLER( lsasquad_sound_command_w ); |
| r7500 | r7501 | |
| 20 | 51 | READ8_HANDLER( lsasquad_sound_result_r ); |
| 21 | 52 | READ8_HANDLER( lsasquad_sound_status_r ); |
| 22 | 53 | |
| 23 | READ8_HANDLER( lsasquad_68705_portA_r ); | |
| 24 | WRITE8_HANDLER( lsasquad_68705_portA_w ); | |
| 25 | WRITE8_HANDLER( lsasquad_68705_ddrA_w ); | |
| 26 | READ8_HANDLER( lsasquad_68705_portB_r ); | |
| 27 | WRITE8_HANDLER( lsasquad_68705_portB_w ); | |
| 28 | WRITE8_HANDLER( lsasquad_68705_ddrB_w ); | |
| 54 | READ8_HANDLER( lsasquad_68705_port_a_r ); | |
| 55 | WRITE8_HANDLER( lsasquad_68705_port_a_w ); | |
| 56 | WRITE8_HANDLER( lsasquad_68705_ddr_a_w ); | |
| 57 | READ8_HANDLER( lsasquad_68705_port_b_r ); | |
| 58 | WRITE8_HANDLER( lsasquad_68705_port_b_w ); | |
| 59 | WRITE8_HANDLER( lsasquad_68705_ddr_b_w ); | |
| 29 | 60 | WRITE8_HANDLER( lsasquad_mcu_w ); |
| 30 | 61 | READ8_HANDLER( lsasquad_mcu_r ); |
| 31 | 62 | READ8_HANDLER( lsasquad_mcu_status_r ); |
| r7500 | r7501 | |
| 36 | 67 | |
| 37 | 68 | /*----------- defined in video/lsasquad.c -----------*/ |
| 38 | 69 | |
| 39 | extern UINT8 *lsasquad_scrollram; | |
| 40 | ||
| 41 | 70 | VIDEO_UPDATE( lsasquad ); |
| 42 | 71 | VIDEO_UPDATE( daikaiju ); |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | #define MAX_PRIORITY 4 |
| 22 | 22 | #define MAX_SPRITE_NUM 0x400 |
| 23 | 23 | |
| 24 | typedef struct _cave_state cave_state; | |
| 25 | struct _cave_state | |
| 24 | class cave_state | |
| 26 | 25 | { |
| 26 | public: | |
| 27 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cave_state(machine)); } | |
| 28 | ||
| 29 | cave_state(running_machine &machine) { } | |
| 30 | ||
| 27 | 31 | /* memory pointers */ |
| 28 | 32 | UINT16 * videoregs; |
| 29 | 33 | UINT16 * vram_0; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _brkthru_state brkthru_state; | |
| 8 | struct _brkthru_state | |
| 7 | class brkthru_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, brkthru_state(machine)); } | |
| 11 | ||
| 12 | brkthru_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 9 | 9 | /* NOTE: YMF278B_STD_CLOCK is defined in /src/emu/sound/ymf278b.h */ |
| 10 | 10 | |
| 11 | 11 | |
| 12 | typedef struct _fuuki32_state fuuki32_state; | |
| 13 | struct _fuuki32_state | |
| 12 | class fuuki32_state | |
| 14 | 13 | { |
| 14 | public: | |
| 15 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, fuuki32_state(machine)); } | |
| 16 | ||
| 17 | fuuki32_state(running_machine &machine) { } | |
| 18 | ||
| 15 | 19 | /* memory pointers */ |
| 16 | 20 | UINT32 * vram_0; |
| 17 | 21 | UINT32 * vram_1; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _dec8_state dec8_state; | |
| 3 | struct _dec8_state | |
| 2 | class dec8_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dec8_state(machine)); } | |
| 6 | ||
| 7 | dec8_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | UINT8 * videoram; |
| 7 | 11 | UINT8 * pf0_data; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _battlane_state battlane_state; | |
| 8 | struct _battlane_state | |
| 7 | class battlane_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, battlane_state(machine)); } | |
| 11 | ||
| 12 | battlane_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * tileram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #define TRAM_ENTRIES 0x4000 |
| 12 | 12 | #define MRAM_ENTRIES 0x8000 |
| 13 | 13 | |
| 14 | typedef struct _atarigt_state atarigt_state; | |
| 15 | struct _atarigt_state | |
| 14 | class atarigt_state | |
| 16 | 15 | { |
| 16 | public: | |
| 17 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atarigt_state(machine)); } | |
| 18 | ||
| 19 | atarigt_state(running_machine &machine) { } | |
| 20 | ||
| 17 | 21 | atarigen_state atarigen; |
| 18 | 22 | UINT8 is_primrage; |
| 19 | 23 | UINT16 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _cloud9_state cloud9_state; | |
| 8 | struct _cloud9_state | |
| 7 | class cloud9_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cloud9_state(machine)); } | |
| 11 | ||
| 12 | cloud9_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT8 * videoram; |
| 12 | 16 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _changela_state changela_state; | |
| 4 | struct _changela_state | |
| 3 | class changela_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, changela_state(machine)); } | |
| 7 | ||
| 8 | changela_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * videoram; |
| 8 | 12 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _crimfght_state crimfght_state; | |
| 8 | struct _crimfght_state | |
| 7 | class crimfght_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, crimfght_state(machine)); } | |
| 11 | ||
| 12 | crimfght_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _asuka_state asuka_state; | |
| 8 | struct _asuka_state | |
| 7 | class asuka_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, asuka_state(machine)); } | |
| 11 | ||
| 12 | asuka_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT16 * paletteram; // this currently uses generic palette handlers |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 1 | typedef struct _sidepckt_state sidepckt_state; | |
| 2 | struct _sidepckt_state | |
| 1 | class sidepckt_state | |
| 3 | 2 | { |
| 3 | public: | |
| 4 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sidepckt_state(machine)); } | |
| 5 | ||
| 6 | sidepckt_state(running_machine &machine) { } | |
| 7 | ||
| 4 | 8 | tilemap_t *bg_tilemap; |
| 5 | 9 | UINT8 *colorram; |
| 6 | 10 | UINT8 *videoram; |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _rollerg_state rollerg_state; | |
| 8 | struct _rollerg_state | |
| 7 | class rollerg_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, rollerg_state(machine)); } | |
| 11 | ||
| 12 | rollerg_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 12 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 18 | 18 | #define EXERION_VBSTART (240) |
| 19 | 19 | |
| 20 | 20 | |
| 21 | typedef struct _exerion_state exerion_state; | |
| 22 | struct _exerion_state | |
| 21 | class exerion_state | |
| 23 | 22 | { |
| 23 | public: | |
| 24 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, exerion_state(machine)); } | |
| 25 | ||
| 26 | exerion_state(running_machine &machine) { } | |
| 27 | ||
| 24 | 28 | /* memory pointers */ |
| 25 | 29 | UINT8 * main_ram; |
| 26 | 30 | UINT8 * videoram; |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | Mosaic | |
| 4 | ||
| 5 | *************************************************************************/ | |
| 6 | ||
| 7 | class mosaic_state | |
| 8 | { | |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mosaic_state(machine)); } | |
| 11 | ||
| 12 | mosaic_state(running_machine &machine) { } | |
| 13 | ||
| 14 | /* memory pointers */ | |
| 15 | UINT8 * fgvideoram; | |
| 16 | UINT8 * bgvideoram; | |
| 17 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 18 | ||
| 19 | /* video-related */ | |
| 20 | tilemap_t *bg_tilemap,*fg_tilemap; | |
| 21 | ||
| 22 | /* misc */ | |
| 23 | int prot_val; | |
| 24 | }; | |
| 25 | ||
| 26 | ||
| 27 | /*----------- defined in video/mosaic.c -----------*/ | |
| 28 | ||
| 29 | WRITE8_HANDLER( mosaic_fgvideoram_w ); | |
| 30 | WRITE8_HANDLER( mosaic_bgvideoram_w ); | |
| 31 | ||
| 32 | VIDEO_START( mosaic ); | |
| 33 | VIDEO_UPDATE( mosaic ); |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | typedef struct _crospang_state crospang_state; | |
| 8 | struct _crospang_state | |
| 7 | class crospang_state | |
| 9 | 8 | { |
| 9 | public: | |
| 10 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, crospang_state(machine)); } | |
| 11 | ||
| 12 | crospang_state(running_machine &machine) { } | |
| 13 | ||
| 10 | 14 | /* memory pointers */ |
| 11 | 15 | UINT16 * bg_videoram; |
| 12 | 16 | UINT16 * fg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | typedef struct _ajax_state ajax_state; | |
| 3 | struct _ajax_state | |
| 2 | class ajax_state | |
| 4 | 3 | { |
| 4 | public: | |
| 5 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ajax_state(machine)); } | |
| 6 | ||
| 7 | ajax_state(running_machine &machine) { } | |
| 8 | ||
| 5 | 9 | /* memory pointers */ |
| 6 | 10 | // UINT8 * paletteram; // currently this uses generic palette handling |
| 7 | 11 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | typedef struct _funybubl_state funybubl_state; | |
| 4 | struct _funybubl_state | |
| 3 | class funybubl_state | |
| 5 | 4 | { |
| 5 | public: | |
| 6 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, funybubl_state(machine)); } | |
| 7 | ||
| 8 | funybubl_state(running_machine &machine) { } | |
| 9 | ||
| 6 | 10 | /* memory pointers */ |
| 7 | 11 | UINT8 * banked_vram; |
| 8 | 12 | UINT8 * paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 221 | 221 | SOUNDS += CDP1863 |
| 222 | 222 | SOUNDS += CDP1864 |
| 223 | 223 | SOUNDS += ZSG2 |
| 224 | SOUNDS += MOS656X | |
| 224 | 225 | |
| 225 | 226 | #------------------------------------------------- |
| 226 | 227 | # this is the list of driver libraries that |
| r7500 | r7501 | |
| 1094 | 1095 | $(DRIVERS)/chinsan.o \ |
| 1095 | 1096 | $(DRIVERS)/drmicro.o $(VIDEO)/drmicro.o \ |
| 1096 | 1097 | $(DRIVERS)/jantotsu.o \ |
| 1097 | $(DRIVERS)/mayumi.o | |
| 1098 | $(DRIVERS)/mayumi.o | |
| 1098 | 1099 | $(DRIVERS)/mermaid.o $(VIDEO)/mermaid.o \ |
| 1099 | 1100 | $(DRIVERS)/mjkjidai.o $(VIDEO)/mjkjidai.o \ |
| 1100 | 1101 | |
| r7500 | r7501 | |
| 1255 | 1256 | |
| 1256 | 1257 | $(MAMEOBJ)/taito.a: \ |
| 1257 | 1258 | $(DRIVERS)/40love.o $(VIDEO)/40love.o \ |
| 1258 | $(DRIVERS)/arkanoid.o $(MACHINE)/arkanoid.o $(VIDEO)/arkanoid.o | |
| 1259 | $(DRIVERS)/arkanoid.o $(MACHINE)/arkanoid.o $(VIDEO)/arkanoid.o | |
| 1259 | 1260 | $(DRIVERS)/ashnojoe.o $(VIDEO)/ashnojoe.o \ |
| 1260 | 1261 | $(DRIVERS)/asuka.o $(MACHINE)/bonzeadv.o $(VIDEO)/asuka.o \ |
| 1261 | 1262 | $(DRIVERS)/bigevglf.o $(MACHINE)/bigevglf.o $(VIDEO)/bigevglf.o \ |
| r7500 | r7501 | |
| 1393 | 1394 | $(DRIVERS)/timelimt.o $(VIDEO)/timelimt.o \ |
| 1394 | 1395 | |
| 1395 | 1396 | $(MAMEOBJ)/toaplan.a: \ |
| 1396 | $(DRIVERS)/mjsister.o | |
| 1397 | $(DRIVERS)/mjsister.o | |
| 1397 | 1398 | $(DRIVERS)/slapfght.o $(MACHINE)/slapfght.o $(VIDEO)/slapfght.o \ |
| 1398 | 1399 | $(DRIVERS)/snowbros.o $(VIDEO)/kan_pand.o $(VIDEO)/kan_panb.o \ |
| 1399 | 1400 | $(DRIVERS)/toaplan1.o $(MACHINE)/toaplan1.o $(VIDEO)/toaplan1.o \ |
| r7500 | r7501 | |
| 1485 | 1486 | $(DRIVERS)/amspdwy.o $(VIDEO)/amspdwy.o \ |
| 1486 | 1487 | $(DRIVERS)/artmagic.o $(VIDEO)/artmagic.o \ |
| 1487 | 1488 | $(DRIVERS)/astrocorp.o \ |
| 1488 | $(DRIVERS)/attckufo.o | |
| 1489 | $(DRIVERS)/attckufo.o | |
| 1489 | 1490 | $(DRIVERS)/aztarac.o $(AUDIO)/aztarac.o $(VIDEO)/aztarac.o \ |
| 1490 | 1491 | $(DRIVERS)/beaminv.o \ |
| 1491 | 1492 | $(DRIVERS)/big10.o \ |
| r7500 | r7501 | |
| 1503 | 1504 | $(DRIVERS)/coinmvga.o \ |
| 1504 | 1505 | $(DRIVERS)/comebaby.o \ |
| 1505 | 1506 | $(DRIVERS)/coolpool.o \ |
| 1506 | $(DRIVERS)/cowrace.o \ | |
| 1507 | 1507 | $(DRIVERS)/crystal.o $(DRIVERS)/psattack.o $(VIDEO)/vrender0.o \ |
| 1508 | 1508 | $(DRIVERS)/cubeqst.o \ |
| 1509 | 1509 | $(DRIVERS)/cybertnk.o \ |
| r7500 | r7501 | |
| 1536 | 1536 | $(DRIVERS)/gstream.o \ |
| 1537 | 1537 | $(DRIVERS)/gumbo.o $(VIDEO)/gumbo.o \ |
| 1538 | 1538 | $(DRIVERS)/gunpey.o \ |
| 1539 | $(DRIVERS)/hexa.o $(VIDEO)/hexa.o \ | |
| 1540 | 1539 | $(DRIVERS)/highvdeo.o \ |
| 1541 | 1540 | $(DRIVERS)/himesiki.o $(VIDEO)/himesiki.o \ |
| 1542 | 1541 | $(DRIVERS)/hitpoker.o \ |
| r7500 | r7501 | |
| 1576 | 1575 | $(DRIVERS)/mirage.o \ |
| 1577 | 1576 | $(DRIVERS)/mirax.o \ |
| 1578 | 1577 | $(DRIVERS)/mirderby.o \ |
| 1579 | $(DRIVERS)/mole.o | |
| 1578 | $(DRIVERS)/mole.o | |
| 1580 | 1579 | $(DRIVERS)/mosaic.o $(VIDEO)/mosaic.o \ |
| 1581 | 1580 | $(DRIVERS)/mrjong.o $(VIDEO)/mrjong.o \ |
| 1582 | 1581 | $(DRIVERS)/multfish.o \ |
| r7500 | r7501 | |
| 1606 | 1605 | $(DRIVERS)/pntnpuzl.o \ |
| 1607 | 1606 | $(DRIVERS)/policetr.o $(VIDEO)/policetr.o \ |
| 1608 | 1607 | $(DRIVERS)/polyplay.o $(AUDIO)/polyplay.o $(VIDEO)/polyplay.o \ |
| 1608 | $(DRIVERS)/poo.o \ | |
| 1609 | 1609 | $(DRIVERS)/quakeat.o \ |
| 1610 | 1610 | $(DRIVERS)/queen.o \ |
| 1611 | 1611 | $(DRIVERS)/quizo.o \ |
| r7500 | r7501 | |
| 1613 | 1613 | $(DRIVERS)/rbmk.o \ |
| 1614 | 1614 | $(DRIVERS)/rcorsair.o \ |
| 1615 | 1615 | $(DRIVERS)/re900.o \ |
| 1616 | $(DRIVERS)/rgum.o \ | |
| 1616 | 1617 | $(DRIVERS)/roul.o \ |
| 1617 | 1618 | $(DRIVERS)/sfbonus.o \ |
| 1618 | 1619 | $(DRIVERS)/shangkid.o $(VIDEO)/shangkid.o \ |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #define NYCAPTOR_DEBUG 0 |
| 12 | 12 | |
| 13 | 13 | #if NYCAPTOR_DEBUG |
| 14 | static int nycaptor_mask=0; | |
| 14 | static int nycaptor_mask = 0; | |
| 15 | 15 | #endif |
| 16 | 16 | |
| 17 | static tilemap_t *bg_tilemap; | |
| 18 | static int char_bank,palette_bank,gfxctrl; | |
| 19 | 17 | |
| 20 | UINT8 *nycaptor_scrlram; | |
| 21 | ||
| 22 | static UINT8 *nycaptor_spriteram; | |
| 23 | ||
| 24 | 18 | /* |
| 25 | 19 | 298 (e298) - spot (0-3) , 299 (e299) - lives |
| 26 | 20 | spot number isn't set to 0 in main menu ; lives - yes |
| 27 | 21 | sprites in main menu req priority 'type' 0 |
| 28 | 22 | */ |
| 29 | static int nycaptor_spot( | |
| 23 | static int nycaptor_spot( running_machine *machine ) | |
| 30 | 24 | { |
| 31 | if(nyc_gametype==0 || nyc_gametype==2) | |
| 32 | return nycaptor_sharedram[0x299]?nycaptor_sharedram[0x298]:0; | |
| 25 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 26 | ||
| 27 | if (state->gametype == 0 || state->gametype == 2) | |
| 28 | return state->sharedram[0x299] ? state->sharedram[0x298] : 0; | |
| 33 | 29 | else |
| 34 | 30 | return 0; |
| 35 | 31 | } |
| 36 | 32 | |
| 37 | 33 | WRITE8_HANDLER(nycaptor_spriteram_w) |
| 38 | 34 | { |
| 39 | nycaptor_spriteram[offset]=data; | |
| 35 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 36 | state->spriteram[offset] = data; | |
| 40 | 37 | } |
| 41 | 38 | |
| 42 | 39 | READ8_HANDLER(nycaptor_spriteram_r) |
| 43 | 40 | { |
| 44 | return nycaptor_spriteram[offset]; | |
| 41 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 42 | return state->spriteram[offset]; | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | 45 | static TILE_GET_INFO( get_tile_info ) |
| 48 | 46 | { |
| 49 | int pal; | |
| 50 | tileinfo->category = (machine->generic.videoram.u8[tile_index*2 + 1] & 0x30)>>4; | |
| 51 | pal=machine->generic.videoram.u8[tile_index*2+1]&0x0f; | |
| 52 | tileinfo->group=0; | |
| 53 | if((!nycaptor_spot())&&(pal==6))tileinfo->group=1; | |
| 54 | if(((nycaptor_spot()==3)&&(pal==8))||((nycaptor_spot()==1)&&(pal==0xc)))tileinfo->group=2; | |
| 55 | if((nycaptor_spot()==1)&&(tileinfo->category==2))tileinfo->group=3; | |
| 47 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 48 | int pal = state->videoram[tile_index * 2 + 1] & 0x0f; | |
| 49 | tileinfo->category = (state->videoram[tile_index * 2 + 1] & 0x30) >> 4; | |
| 50 | ||
| 51 | tileinfo->group = 0; | |
| 52 | ||
| 53 | if ((!nycaptor_spot(machine)) && (pal == 6)) | |
| 54 | tileinfo->group = 1; | |
| 55 | ||
| 56 | if (((nycaptor_spot(machine) == 3) && (pal == 8)) || ((nycaptor_spot(machine) == 1) && (pal == 0xc))) | |
| 57 | tileinfo->group = 2; | |
| 58 | ||
| 59 | if ((nycaptor_spot(machine) == 1) && (tileinfo->category == 2)) | |
| 60 | tileinfo->group = 3; | |
| 61 | ||
| 56 | 62 | #if NYCAPTOR_DEBUG |
| 57 | if(nycaptor_mask&(1<<tileinfo->category)) | |
| 58 | { | |
| 59 | if(nycaptor_spot())pal=0xe;else pal=4; | |
| 60 | } | |
| 63 | if (nycaptor_mask & (1 << tileinfo->category)) | |
| 64 | { | |
| 65 | if (nycaptor_spot(machine)) | |
| 66 | pal = 0xe; | |
| 67 | else | |
| 68 | pal = 4; | |
| 69 | } | |
| 61 | 70 | #endif |
| 62 | 71 | |
| 63 | 72 | SET_TILE_INFO( |
| 64 | 73 | 0, |
| 65 | machine->generic.videoram.u8[tile_index*2] + ((machine->generic.videoram.u8[tile_index*2+1] & 0xc0) << 2) +0x400 * char_bank, | |
| 66 | pal,0 | |
| 74 | state->videoram[tile_index * 2] + ((state->videoram[tile_index * 2 + 1] & 0xc0) << 2) + 0x400 * state->char_bank, | |
| 75 | pal, 0 | |
| 67 | 76 | ); |
| 68 | 77 | } |
| 69 | 78 | |
| 70 | 79 | |
| 71 | 80 | VIDEO_START( nycaptor ) |
| 72 | 81 | { |
| 73 | nycaptor_spriteram = auto_alloc_array(machine, UINT8, 160); | |
| 74 | bg_tilemap = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,32,32 ); | |
| 82 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 75 | 83 | |
| 76 | tilemap_set_transmask(bg_tilemap,0,0xf800,0x7ff); //split 0 | |
| 77 | tilemap_set_transmask(bg_tilemap,1,0xfe00,0x01ff);//split 1 | |
| 78 | tilemap_set_transmask(bg_tilemap,2,0xfffc,0x0003);//split 2 | |
| 79 | tilemap_set_transmask(bg_tilemap,3,0xfff0,0x000f);//split 3 | |
| 84 | state->spriteram = auto_alloc_array(machine, UINT8, 160); | |
| 85 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32 ); | |
| 80 | 86 | |
| 87 | tilemap_set_transmask(state->bg_tilemap, 0, 0xf800, 0x7ff); //split 0 | |
| 88 | tilemap_set_transmask(state->bg_tilemap, 1, 0xfe00, 0x01ff);//split 1 | |
| 89 | tilemap_set_transmask(state->bg_tilemap, 2, 0xfffc, 0x0003);//split 2 | |
| 90 | tilemap_set_transmask(state->bg_tilemap, 3, 0xfff0, 0x000f);//split 3 | |
| 91 | ||
| 81 | 92 | machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200); |
| 82 | 93 | machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200); |
| 83 | tilemap_set_scroll_cols(bg_tilemap,32); | |
| 94 | tilemap_set_scroll_cols(state->bg_tilemap, 32); | |
| 95 | ||
| 96 | state_save_register_global_pointer(machine, state->spriteram, 160); | |
| 97 | state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200); | |
| 98 | state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200); | |
| 84 | 99 | } |
| 85 | 100 | |
| 86 | 101 | WRITE8_HANDLER( nycaptor_videoram_w ) |
| 87 | 102 | { |
| 88 | space->machine->generic.videoram.u8[offset] = data; | |
| 89 | tilemap_mark_tile_dirty(bg_tilemap,offset>>1); | |
| 103 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 104 | state->videoram[offset] = data; | |
| 105 | tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1); | |
| 90 | 106 | } |
| 91 | 107 | |
| 92 | 108 | READ8_HANDLER( nycaptor_videoram_r ) |
| 93 | 109 | { |
| 94 | return space->machine->generic.videoram.u8[offset]; | |
| 110 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 111 | return state->videoram[offset]; | |
| 95 | 112 | } |
| 96 | 113 | |
| 97 | 114 | WRITE8_HANDLER( nycaptor_palette_w ) |
| 98 | 115 | { |
| 99 | if(nyc_gametype==2) //colt | |
| 116 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 117 | ||
| 118 | if (state->gametype == 2) //colt | |
| 100 | 119 | return; |
| 101 | 120 | |
| 102 | 121 | if (offset & 0x100) |
| 103 | paletteram_xxxxBBBBGGGGRRRR_split2_w(space, (offset & 0xff) + (palette_bank << 8),data); | |
| 122 | paletteram_xxxxBBBBGGGGRRRR_split2_w(space, (offset & 0xff) + (state->palette_bank << 8), data); | |
| 104 | 123 | else |
| 105 | paletteram_xxxxBBBBGGGGRRRR_split1_w(space, (offset & 0xff) + (palette_bank << 8),data); | |
| 124 | paletteram_xxxxBBBBGGGGRRRR_split1_w(space, (offset & 0xff) + (state->palette_bank << 8), data); | |
| 106 | 125 | } |
| 107 | 126 | |
| 108 | 127 | READ8_HANDLER( nycaptor_palette_r ) |
| 109 | 128 | { |
| 129 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 130 | ||
| 110 | 131 | if (offset & 0x100) |
| 111 | return space->machine->generic.paletteram2.u8[ | |
| 132 | return space->machine->generic.paletteram2.u8[ | |
| 112 | 133 | else |
| 113 | return space->machine->generic.paletteram.u8 | |
| 134 | return space->machine->generic.paletteram.u8 | |
| 114 | 135 | } |
| 115 | 136 | |
| 116 | 137 | WRITE8_HANDLER( nycaptor_gfxctrl_w ) |
| 117 | 138 | { |
| 118 | if (gfxctrl == data) | |
| 139 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 140 | ||
| 141 | if (state->gfxctrl == data) | |
| 119 | 142 | return; |
| 120 | gfxctrl = data; | |
| 121 | 143 | |
| 122 | if(char_bank != ((data & 0x18) >> 3)) | |
| 144 | state->gfxctrl = data; | |
| 145 | ||
| 146 | if (state->char_bank != ((data & 0x18) >> 3)) | |
| 123 | 147 | { |
| 124 | char_bank=((data & 0x18) >> 3); | |
| 125 | tilemap_mark_all_tiles_dirty( bg_tilemap ); | |
| 148 | state->char_bank = ((data & 0x18) >> 3); | |
| 149 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 126 | 150 | } |
| 127 | palette_bank = (data & 0x20) >> 5; | |
| 128 | 151 | |
| 152 | state->palette_bank = BIT(data, 5); | |
| 153 | ||
| 129 | 154 | } |
| 130 | 155 | |
| 131 | 156 | READ8_HANDLER( nycaptor_gfxctrl_r ) |
| 132 | 157 | { |
| 133 | return gfxctrl; | |
| 158 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 159 | return state->gfxctrl; | |
| 134 | 160 | } |
| 135 | 161 | |
| 136 | 162 | READ8_HANDLER( nycaptor_scrlram_r ) |
| 137 | 163 | { |
| 138 | return nycaptor_scrlram[offset]; | |
| 164 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 165 | return state->scrlram[offset]; | |
| 139 | 166 | } |
| 140 | 167 | |
| 141 | 168 | WRITE8_HANDLER( nycaptor_scrlram_w ) |
| 142 | 169 | { |
| 143 | nycaptor_scrlram[offset] = data; | |
| 144 | tilemap_set_scrolly(bg_tilemap, offset, data ); | |
| 170 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 171 | state->scrlram[offset] = data; | |
| 172 | tilemap_set_scrolly(state->bg_tilemap, offset, data); | |
| 145 | 173 | } |
| 146 | 174 | |
| 147 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,int pri) | |
| 175 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri ) | |
| 148 | 176 | { |
| 177 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 149 | 178 | int i; |
| 150 | for (i=0;i<0x20;i++) | |
| 179 | ||
| 180 | for (i = 0; i < 0x20; i++) | |
| 151 | 181 | { |
| 152 | int pr = | |
| 182 | int pr = st | |
| 153 | 183 | int offs = (pr & 0x1f) * 4; |
| 154 | int code,sx,sy,flipx,flipy,pal,priori; | |
| 184 | int code, sx, sy, flipx, flipy, pal, priori; | |
| 155 | 185 | |
| 156 | code = nycaptor_spriteram[offs+2] + ((nycaptor_spriteram[offs+1] & 0x10) << 4);//1 bit wolny = 0x20 | |
| 157 | pal=nycaptor_spriteram[offs+1] & 0x0f; | |
| 158 | sx = nycaptor_spriteram[offs+3]; | |
| 159 | sy = 240-nycaptor_spriteram[offs+0]; | |
| 160 | priori=(pr&0xe0)>>5; | |
| 161 | if(priori==pri) | |
| 186 | code = state->spriteram[offs + 2] + ((state->spriteram[offs + 1] & 0x10) << 4);//1 bit wolny = 0x20 | |
| 187 | pal = state->spriteram[offs + 1] & 0x0f; | |
| 188 | sx = state->spriteram[offs + 3]; | |
| 189 | sy = 240 - state->spriteram[offs + 0]; | |
| 190 | priori = (pr & 0xe0) >> 5; | |
| 191 | ||
| 192 | if (priori == pri) | |
| 162 | 193 | { |
| 163 | 194 | #if NYCAPTOR_DEBUG |
| 164 | if(nycaptor_mask&(1<<(pri+4)))pal=0xd; | |
| 195 | if (nycaptor_mask & (1 << (pri + 4))) pal = 0xd; | |
| 165 | 196 | #endif |
| 166 | flipx = ((nycaptor_spriteram[offs+1]&0x40)>>6); | |
| 167 | flipy = ((nycaptor_spriteram[offs+1]&0x80)>>7); | |
| 197 | flipx = BIT(state->spriteram[offs + 1], 6); | |
| 198 | flipy = BIT(state->spriteram[offs + 1], 7); | |
| 168 | 199 | |
| 169 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 200 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 170 | 201 | code, |
| 171 | 202 | pal, |
| 172 | 203 | flipx,flipy, |
| 173 | 204 | sx,sy,15); |
| 174 | 205 | |
| 175 | if( | |
| 206 | if (st | |
| 176 | 207 | { |
| 177 | sx = (nycaptor_spriteram[offs+3]-256); | |
| 178 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 179 | code, | |
| 180 | pal, | |
| 181 | flipx,flipy, | |
| 182 | sx,sy,15); | |
| 208 | sx = (state->spriteram[offs + 3] - 256); | |
| 209 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 210 | code, | |
| 211 | pal, | |
| 212 | flipx,flipy, | |
| 213 | sx,sy,15); | |
| 183 | 214 | } |
| 184 | 215 | } |
| 185 | 216 | } |
| r7500 | r7501 | |
| 198 | 229 | x - no bg/sprite pri. |
| 199 | 230 | */ |
| 200 | 231 | |
| 201 | #define mKEY_MASK(x,y) if (input_code_pressed_once(machine, x)){nycaptor_mask|=y;tilemap_mark_all_tiles_dirty( | |
| 232 | #define mKEY_MASK(x,y) if (input_code_pressed_once(machine, x)) { nycaptor_mask |= y; tilemap_mark_all_tiles_dirty(state->bg_tilemap | |
| 202 | 233 | |
| 203 | static void nycaptor_setmask(running_machine *machine) | |
| 234 | static void nycaptor_setmask( running_machine *machine ) | |
| 204 | 235 | { |
| 205 | mKEY_MASK(KEYCODE_Q,1); /* bg */ | |
| 206 | mKEY_MASK(KEYCODE_W,2); | |
| 207 | mKEY_MASK(KEYCODE_E,4); | |
| 208 | mKEY_MASK(KEYCODE_R,8); | |
| 236 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 209 | 237 | |
| 210 | mKEY_MASK(KEYCODE_A,0x10); /* sprites */ | |
| 211 | mKEY_MASK(KEYCODE_S,0x20); | |
| 212 | mKEY_MASK(KEYCODE_D,0x40); | |
| 213 | mKEY_MASK(KEYCODE_F,0x80); | |
| 214 | mKEY_MASK(KEYCODE_G,0x100); | |
| 215 | mKEY_MASK(KEYCODE_H,0x200); | |
| 216 | mKEY_MASK(KEYCODE_J,0x400); | |
| 217 | mKEY_MASK(KEYCODE_K,0x800); | |
| 238 | mKEY_MASK(KEYCODE_Q, 1); /* bg */ | |
| 239 | mKEY_MASK(KEYCODE_W, 2); | |
| 240 | mKEY_MASK(KEYCODE_E, 4); | |
| 241 | mKEY_MASK(KEYCODE_R, 8); | |
| 218 | 242 | |
| 219 | if (input_code_pressed_once(machine, KEYCODE_Z)){nycaptor_mask=0;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* disable */ | |
| 220 | if (input_code_pressed_once(machine, KEYCODE_X)){nycaptor_mask|=0x1000;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* no layers */ | |
| 243 | mKEY_MASK(KEYCODE_A, 0x10); /* sprites */ | |
| 244 | mKEY_MASK(KEYCODE_S, 0x20); | |
| 245 | mKEY_MASK(KEYCODE_D, 0x40); | |
| 246 | mKEY_MASK(KEYCODE_F, 0x80); | |
| 247 | mKEY_MASK(KEYCODE_G, 0x100); | |
| 248 | mKEY_MASK(KEYCODE_H, 0x200); | |
| 249 | mKEY_MASK(KEYCODE_J, 0x400); | |
| 250 | mKEY_MASK(KEYCODE_K, 0x800); | |
| 251 | ||
| 252 | if (input_code_pressed_once(machine, KEYCODE_Z)){nycaptor_mask = 0; tilemap_mark_all_tiles_dirty(state->bg_tilemap);} /* disable */ | |
| 253 | if (input_code_pressed_once(machine, KEYCODE_X)){nycaptor_mask |= 0x1000; tilemap_mark_all_tiles_dirty(state->bg_tilemap);} /* no layers */ | |
| 221 | 254 | } |
| 222 | 255 | #endif |
| 223 | 256 | |
| 224 | 257 | VIDEO_UPDATE( nycaptor ) |
| 225 | 258 | { |
| 259 | nycaptor_state *state = (nycaptor_state *)screen->machine->driver_data; | |
| 260 | ||
| 226 | 261 | #if NYCAPTOR_DEBUG |
| 227 | nycaptor_setmask(screen->machine); | |
| 228 | if(nycaptor_mask&0x1000) | |
| 229 | { | |
| 230 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 231 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0); | |
| 232 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0); | |
| 233 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0); | |
| 234 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 235 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 236 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 237 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 238 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 239 | draw_sprites(screen->machine, bitmap,cliprect,1); | |
| 240 | draw_sprites(screen->machine, bitmap,cliprect,2); | |
| 241 | draw_sprites(screen->machine, bitmap,cliprect,3); | |
| 242 | draw_sprites(screen->machine, bitmap,cliprect,4); | |
| 243 | draw_sprites(screen->machine, bitmap,cliprect,5); | |
| 244 | draw_sprites(screen->machine, bitmap,cliprect,6); | |
| 245 | draw_sprites(screen->machine, bitmap,cliprect,7); | |
| 246 | } | |
| 247 | else | |
| 248 | #endif | |
| 249 | switch (nycaptor_spot()&3) | |
| 250 | { | |
| 251 | case 0: | |
| 252 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 253 | draw_sprites(screen->machine, bitmap,cliprect,6); | |
| 254 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0); | |
| 255 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0); | |
| 256 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0); | |
| 257 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 258 | draw_sprites(screen->machine, bitmap,cliprect,3); | |
| 259 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 260 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 261 | draw_sprites(screen->machine, bitmap,cliprect,2); | |
| 262 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 263 | draw_sprites(screen->machine, bitmap,cliprect,1); | |
| 264 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 265 | break; | |
| 262 | nycaptor_setmask(screen->machine); | |
| 263 | if (nycaptor_mask & 0x1000) | |
| 264 | { | |
| 265 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); | |
| 266 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); | |
| 267 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); | |
| 268 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); | |
| 269 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); | |
| 270 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); | |
| 271 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); | |
| 272 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); | |
| 273 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 274 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 275 | draw_sprites(screen->machine, bitmap, cliprect, 2); | |
| 276 | draw_sprites(screen->machine, bitmap, cliprect, 3); | |
| 277 | draw_sprites(screen->machine, bitmap, cliprect, 4); | |
| 278 | draw_sprites(screen->machine, bitmap, cliprect, 5); | |
| 279 | draw_sprites(screen->machine, bitmap, cliprect, 6); | |
| 280 | draw_sprites(screen->machine, bitmap, cliprect, 7); | |
| 281 | } | |
| 282 | else | |
| 283 | #endif | |
| 284 | switch (nycaptor_spot(screen->machine) & 3) | |
| 285 | { | |
| 286 | case 0: | |
| 287 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); | |
| 288 | draw_sprites(screen->machine, bitmap, cliprect, 6); | |
| 289 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); | |
| 290 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); | |
| 291 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); | |
| 292 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); | |
| 293 | draw_sprites(screen->machine, bitmap, cliprect, 3); | |
| 294 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); | |
| 295 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 296 | draw_sprites(screen->machine, bitmap, cliprect, 2); | |
| 297 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); | |
| 298 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 299 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); | |
| 300 | break; | |
| 266 | 301 | |
| 267 | case 1: | |
| 268 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 269 | draw_sprites(screen->machine, bitmap,cliprect,3); | |
| 270 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0); | |
| 271 | draw_sprites(screen->machine, bitmap,cliprect,2); | |
| 272 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0); | |
| 273 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 274 | draw_sprites(screen->machine, bitmap,cliprect,1); | |
| 275 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 276 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0); | |
| 277 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 278 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 279 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 280 | break; | |
| 302 | case 1: | |
| 303 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); | |
| 304 | draw_sprites(screen->machine, bitmap, cliprect, 3); | |
| 305 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); | |
| 306 | draw_sprites(screen->machine, bitmap, cliprect, 2); | |
| 307 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); | |
| 308 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); | |
| 309 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 310 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); | |
| 311 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); | |
| 312 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 313 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); | |
| 314 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); | |
| 315 | break; | |
| 281 | 316 | |
| 282 | case 2: | |
| 283 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 284 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0); | |
| 285 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 286 | draw_sprites(screen->machine, bitmap,cliprect,1); | |
| 287 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 288 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0); | |
| 289 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0); | |
| 290 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 291 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 292 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 293 | break; | |
| 317 | case 2: | |
| 318 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); | |
| 319 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); | |
| 320 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); | |
| 321 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 322 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); | |
| 323 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); | |
| 324 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); | |
| 325 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 326 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); | |
| 327 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); | |
| 328 | break; | |
| 294 | 329 | |
| 295 | case 3: | |
| 296 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 297 | draw_sprites(screen->machine, bitmap,cliprect,1); | |
| 298 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 299 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 300 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 301 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 302 | break; | |
| 303 | } | |
| 330 | case 3: | |
| 331 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); | |
| 332 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 333 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); | |
| 334 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 335 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); | |
| 336 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); | |
| 337 | break; | |
| 338 | } | |
| 339 | ||
| 304 | 340 | return 0; |
| 305 | 341 | } |
| 306 | 342 |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "includes/madmotor.h" | |
| 10 | 11 | |
| 11 | UINT16 *madmotor_pf1_rowscroll; | |
| 12 | UINT16 *madmotor_pf1_data,*madmotor_pf2_data,*madmotor_pf3_data; | |
| 13 | 12 | |
| 14 | UINT16 *madmotor_pf1_control; | |
| 15 | UINT16 *madmotor_pf2_control; | |
| 16 | UINT16 *madmotor_pf3_control; | |
| 17 | ||
| 18 | static int flipscreen; | |
| 19 | static tilemap_t *madmotor_pf1_tilemap,*madmotor_pf2_tilemap,*madmotor_pf3_tilemap,*madmotor_pf3a_tilemap; | |
| 20 | ||
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | 13 | /* 512 by 512 playfield, 8 by 8 tiles */ |
| 25 | 14 | static TILEMAP_MAPPER( pf1_scan ) |
| 26 | 15 | { |
| r7500 | r7501 | |
| 30 | 19 | |
| 31 | 20 | static TILE_GET_INFO( get_pf1_tile_info ) |
| 32 | 21 | { |
| 33 | int tile,color; | |
| 22 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 23 | int tile = state->pf1_data[tile_index]; | |
| 24 | int color = tile >> 12; | |
| 34 | 25 | |
| 35 | tile=madmotor_pf1_data[tile_index]; | |
| 36 | color=tile >> 12; | |
| 37 | tile=tile&0xfff; | |
| 26 | tile = tile & 0xfff; | |
| 38 | 27 | |
| 39 | 28 | SET_TILE_INFO( |
| 40 | 29 | 0, |
| r7500 | r7501 | |
| 52 | 41 | |
| 53 | 42 | static TILE_GET_INFO( get_pf2_tile_info ) |
| 54 | 43 | { |
| 55 | int tile,color; | |
| 44 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 45 | int tile = state->pf2_data[tile_index]; | |
| 46 | int color = tile >> 12; | |
| 56 | 47 | |
| 57 | tile=madmotor_pf2_data[tile_index]; | |
| 58 | color=tile >> 12; | |
| 59 | tile=tile&0xfff; | |
| 48 | tile = tile & 0xfff; | |
| 60 | 49 | |
| 61 | 50 | SET_TILE_INFO( |
| 62 | 51 | 1, |
| r7500 | r7501 | |
| 74 | 63 | |
| 75 | 64 | static TILE_GET_INFO( get_pf3_tile_info ) |
| 76 | 65 | { |
| 77 | int tile,color; | |
| 66 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 67 | int tile = state->pf3_data[tile_index]; | |
| 68 | int color = tile >> 12; | |
| 78 | 69 | |
| 79 | tile=madmotor_pf3_data[tile_index]; | |
| 80 | color=tile >> 12; | |
| 81 | tile=tile&0xfff; | |
| 70 | tile = tile & 0xfff; | |
| 82 | 71 | |
| 83 | 72 | SET_TILE_INFO( |
| 84 | 73 | 2, |
| r7500 | r7501 | |
| 96 | 85 | |
| 97 | 86 | static TILE_GET_INFO( get_pf3a_tile_info ) |
| 98 | 87 | { |
| 99 | int tile,color; | |
| 88 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 89 | int tile = state->pf3_data[tile_index]; | |
| 90 | int color = tile >> 12; | |
| 100 | 91 | |
| 101 | tile=madmotor_pf3_data[tile_index]; | |
| 102 | color=tile >> 12; | |
| 103 | tile=tile&0xfff; | |
| 92 | tile = tile & 0xfff; | |
| 104 | 93 | |
| 105 | 94 | SET_TILE_INFO( |
| 106 | 95 | 2, |
| r7500 | r7501 | |
| 113 | 102 | |
| 114 | 103 | VIDEO_START( madmotor ) |
| 115 | 104 | { |
| 116 | madmotor_pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, pf1_scan, 8, 8, 64,64); | |
| 117 | madmotor_pf2_tilemap = tilemap_create(machine, get_pf2_tile_info, pf2_scan, 16,16, 32,32); | |
| 118 | madmotor_pf3_tilemap = tilemap_create(machine, get_pf3_tile_info, pf3_scan, 16,16, 32,64); | |
| 119 | madmotor_pf3a_tilemap= tilemap_create(machine, get_pf3a_tile_info,pf3a_scan, 16,16,128,16); | |
| 105 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 120 | 106 | |
| 121 | tilemap_set_transparent_pen(madmotor_pf1_tilemap,0); | |
| 122 | tilemap_set_transparent_pen(madmotor_pf2_tilemap,0); | |
| 123 | tilemap_set_scroll_rows(madmotor_pf1_tilemap,512); | |
| 107 | state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, pf1_scan, 8, 8, 64, 64); | |
| 108 | state->pf2_tilemap = tilemap_create(machine, get_pf2_tile_info, pf2_scan, 16, 16, 32, 32); | |
| 109 | state->pf3_tilemap = tilemap_create(machine, get_pf3_tile_info, pf3_scan, 16, 16, 32, 64); | |
| 110 | state->pf3a_tilemap= tilemap_create(machine, get_pf3a_tile_info, pf3a_scan, 16, 16, 128, 16); | |
| 111 | ||
| 112 | tilemap_set_transparent_pen(state->pf1_tilemap, 0); | |
| 113 | tilemap_set_transparent_pen(state->pf2_tilemap, 0); | |
| 114 | tilemap_set_scroll_rows(state->pf1_tilemap, 512); | |
| 124 | 115 | } |
| 125 | 116 | |
| 126 | 117 | /******************************************************************************/ |
| 127 | 118 | |
| 128 | 119 | WRITE16_HANDLER( madmotor_pf1_data_w ) |
| 129 | 120 | { |
| 130 | COMBINE_DATA(&madmotor_pf1_data[offset]); | |
| 131 | tilemap_mark_tile_dirty(madmotor_pf1_tilemap,offset); | |
| 121 | madmotor_state *state = (madmotor_state *)space->machine->driver_data; | |
| 122 | ||
| 123 | COMBINE_DATA(&state->pf1_data[offset]); | |
| 124 | tilemap_mark_tile_dirty(state->pf1_tilemap, offset); | |
| 132 | 125 | } |
| 133 | 126 | |
| 134 | 127 | WRITE16_HANDLER( madmotor_pf2_data_w ) |
| 135 | 128 | { |
| 136 | COMBINE_DATA(&madmotor_pf2_data[offset]); | |
| 137 | tilemap_mark_tile_dirty(madmotor_pf2_tilemap,offset); | |
| 129 | madmotor_state *state = (madmotor_state *)space->machine->driver_data; | |
| 130 | ||
| 131 | COMBINE_DATA(&state->pf2_data[offset]); | |
| 132 | tilemap_mark_tile_dirty(state->pf2_tilemap, offset); | |
| 138 | 133 | } |
| 139 | 134 | |
| 140 | 135 | WRITE16_HANDLER( madmotor_pf3_data_w ) |
| 141 | 136 | { |
| 142 | | |
| 137 | madmotor_state *state = ( | |
| 143 | 138 | |
| 139 | COMBINE_DATA(&state->pf3_data[offset]); | |
| 140 | ||
| 144 | 141 | /* Mark the dirty position on the 512 x 1024 version */ |
| 145 | tilemap_mark_tile_dirty( | |
| 142 | tilemap_mark_tile_dirty(sta | |
| 146 | 143 | |
| 147 | 144 | /* Mark the dirty position on the 2048 x 256 version */ |
| 148 | tilemap_mark_tile_dirty( | |
| 145 | tilemap_mark_tile_dirty(sta | |
| 149 | 146 | } |
| 150 | 147 | |
| 151 | 148 | /******************************************************************************/ |
| 152 | 149 | |
| 153 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri_mask,int pri_val) | |
| 150 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask, int pri_val ) | |
| 154 | 151 | { |
| 155 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 152 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 153 | UINT16 *spriteram = state->spriteram; | |
| 156 | 154 | int offs; |
| 157 | 155 | |
| 158 | 156 | offs = 0; |
| 159 | while (offs < | |
| 157 | while (offs < stat | |
| 160 | 158 | { |
| 161 | int sx,sy,code,color,w,h,flipx,flipy,incy,flash,mult,x,y; | |
| 159 | int sx, sy, code, color, w, h, flipx, flipy, incy, flash, mult, x, y; | |
| 162 | 160 | |
| 163 | sy = spriteram16[offs]; | |
| 164 | sx = spriteram16[offs+2]; | |
| 161 | sy = spriteram[offs]; | |
| 162 | sx = spriteram[offs + 2]; | |
| 165 | 163 | color = sx >> 12; |
| 166 | 164 | |
| 167 | flash=sx&0x800; | |
| 165 | flash = sx & 0x800; | |
| 168 | 166 | |
| 169 | 167 | flipx = sy & 0x2000; |
| 170 | 168 | flipy = sy & 0x4000; |
| r7500 | r7501 | |
| 172 | 170 | w = (1 << ((sy & 0x0600) >> 9)); /* 1x, 2x, 4x, 8x width */ |
| 173 | 171 | /* multi width used only on the title screen? */ |
| 174 | 172 | |
| 175 | code = spriteram | |
| 173 | code = spriteram | |
| 176 | 174 | |
| 177 | 175 | sx = sx & 0x01ff; |
| 178 | 176 | sy = sy & 0x01ff; |
| r7500 | r7501 | |
| 190 | 188 | incy = 1; |
| 191 | 189 | } |
| 192 | 190 | |
| 193 | if (flipscreen) { | |
| 194 | sy=240-sy; | |
| 195 | sx=240-sx; | |
| 196 | if (flipx) flipx=0; else flipx=1; | |
| 197 | if (flipy) flipy=0; else flipy=1; | |
| 198 | mult=16; | |
| 191 | if (state->flipscreen) | |
| 192 | { | |
| 193 | sy = 240 - sy; | |
| 194 | sx = 240 - sx; | |
| 195 | if (flipx) flipx = 0; else flipx = 1; | |
| 196 | if (flipy) flipy = 0; else flipy = 1; | |
| 197 | mult = 16; | |
| 199 | 198 | } |
| 200 | else mult=-16; | |
| 199 | else | |
| 200 | mult = -16; | |
| 201 | 201 | |
| 202 | for (x = 0;x < w;x++) | |
| 202 | for (x = 0; x < w; x++) | |
| 203 | 203 | { |
| 204 | for (y = 0;y < h;y++) | |
| 204 | for (y = 0; y < h; y++) | |
| 205 | 205 | { |
| 206 | 206 | if ((color & pri_mask) == pri_val && |
| 207 | 207 | (!flash || (video_screen_get_frame_number(machine->primary_screen) & 1))) |
| r7500 | r7501 | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | offs += 4; |
| 216 | if (offs >= machine->generic.spriteram_size/2 || | |
| 217 | spriteram16[offs] & 0x8000) // seems the expected behaviour on the title screen | |
| 216 | if (offs >= state->spriteram_size / 2 || spriteram[offs] & 0x8000) // seems the expected behaviour on the title screen | |
| 218 | 217 | break; |
| 219 | 218 | } |
| 220 | 219 | } |
| r7500 | r7501 | |
| 225 | 224 | |
| 226 | 225 | VIDEO_UPDATE( madmotor ) |
| 227 | 226 | { |
| 227 | madmotor_state *state = (madmotor_state *)screen->machine->driver_data; | |
| 228 | 228 | int offs; |
| 229 | 229 | |
| 230 | 230 | /* Update flipscreen */ |
| 231 | if (madmotor_pf1_control[0]&0x80) | |
| 232 | flipscreen=1; | |
| 231 | if (state->pf1_control[0] & 0x80) | |
| 232 | state->flipscreen = 1; | |
| 233 | 233 | else |
| 234 | flipscreen=0; | |
| 235 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 234 | state->flipscreen = 0; | |
| 236 | 235 | |
| 236 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 237 | ||
| 237 | 238 | /* Setup scroll registers */ |
| 238 | for (offs = 0;offs < 512;offs++) | |
| 239 | tilemap_set_scrollx( madmotor_pf1_tilemap,offs, madmotor_pf1_control[0x08] + madmotor_pf1_rowscroll[0x200+offs] ); | |
| 240 | tilemap_set_scrolly( madmotor_pf1_tilemap,0, madmotor_pf1_control[0x09] ); | |
| 241 | tilemap_set_scrollx( madmotor_pf2_tilemap,0, madmotor_pf2_control[0x08] ); | |
| 242 | tilemap_set_scrolly( madmotor_pf2_tilemap,0, madmotor_pf2_control[0x09] ); | |
| 243 | tilemap_set_scrollx( madmotor_pf3_tilemap,0, madmotor_pf3_control[0x08] ); | |
| 244 | tilemap_set_scrolly( madmotor_pf3_tilemap,0, madmotor_pf3_control[0x09] ); | |
| 245 | tilemap_set_scrollx( madmotor_pf3a_tilemap,0, madmotor_pf3_control[0x08] ); | |
| 246 | tilemap_set_scrolly( madmotor_pf3a_tilemap,0, madmotor_pf3_control[0x09] ); | |
| 239 | for (offs = 0; offs < 512; offs++) | |
| 240 | tilemap_set_scrollx(state->pf1_tilemap, offs, state->pf1_control[0x08] + state->pf1_rowscroll[0x200 + offs]); | |
| 247 | 241 | |
| 242 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->pf1_control[0x09]); | |
| 243 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->pf2_control[0x08]); | |
| 244 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->pf2_control[0x09]); | |
| 245 | tilemap_set_scrollx(state->pf3_tilemap, 0, state->pf3_control[0x08]); | |
| 246 | tilemap_set_scrolly(state->pf3_tilemap, 0, state->pf3_control[0x09]); | |
| 247 | tilemap_set_scrollx(state->pf3a_tilemap, 0, state->pf3_control[0x08]); | |
| 248 | tilemap_set_scrolly(state->pf3a_tilemap, 0, state->pf3_control[0x09]); | |
| 249 | ||
| 248 | 250 | /* Draw playfields & sprites */ |
| 249 | if (madmotor_pf3_control[0x03]==2) | |
| 250 | tilemap_draw(bitmap,cliprect,madmotor_pf3_tilemap,0,0); | |
| 251 | if (state->pf3_control[0x03] == 2) | |
| 252 | tilemap_draw(bitmap, cliprect, state->pf3_tilemap, 0, 0); | |
| 251 | 253 | else |
| 252 | tilemap_draw(bitmap,cliprect,madmotor_pf3a_tilemap,0,0); | |
| 253 | tilemap_draw(bitmap,cliprect,madmotor_pf2_tilemap,0,0); | |
| 254 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); | |
| 255 | tilemap_draw(bitmap,cliprect,madmotor_pf1_tilemap,0,0); | |
| 254 | tilemap_draw(bitmap, cliprect, state->pf3a_tilemap, 0, 0); | |
| 255 | ||
| 256 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 257 | draw_sprites(screen->machine, bitmap, cliprect, 0x00, 0x00); | |
| 258 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 256 | 259 | return 0; |
| 257 | 260 | } |
| r7500 | r7501 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | ***************************************************************************/ |
| 37 | ||
| 37 | 38 | #include "emu.h" |
| 39 | #include "includes/skyfox.h" | |
| 38 | 40 | |
| 39 | /* Variables only used here: */ | |
| 40 | 41 | |
| 41 | static UINT8 vreg[8]; | |
| 42 | ||
| 43 | ||
| 44 | /* Variables that driver has access to: */ | |
| 45 | ||
| 46 | int skyfox_bg_pos, skyfox_bg_ctrl; | |
| 47 | ||
| 48 | ||
| 49 | ||
| 50 | 42 | /*************************************************************************** |
| 51 | 43 | |
| 52 | 44 | Memory Handlers |
| r7500 | r7501 | |
| 56 | 48 | #ifdef UNUSED_FUNCTION |
| 57 | 49 | READ8_HANDLER( skyfox_vregs_r ) // for debug |
| 58 | 50 | { |
| 59 | return vreg[offset]; | |
| 51 | skyfox_state *state = (skyfox_state *)space->machine->driver_data; | |
| 52 | return state->vreg[offset]; | |
| 60 | 53 | } |
| 61 | 54 | #endif |
| 62 | 55 | |
| 63 | 56 | WRITE8_HANDLER( skyfox_vregs_w ) |
| 64 | 57 | { |
| 65 | | |
| 58 | sky | |
| 66 | 59 | |
| 60 | state->vreg[offset] = data; | |
| 61 | ||
| 67 | 62 | switch (offset) |
| 68 | 63 | { |
| 69 | case 0: skyfox_bg_ctrl = data; break; | |
| 70 | case 1: soundlatch_w(space,0,data); break; | |
| 64 | case 0: state->bg_ctrl = data; break; | |
| 65 | case 1: soundlatch_w(space, 0, data); break; | |
| 71 | 66 | case 2: break; |
| 72 | 67 | case 3: break; |
| 73 | 68 | case 4: break; |
| r7500 | r7501 | |
| 98 | 93 | { |
| 99 | 94 | int i; |
| 100 | 95 | |
| 101 | for (i = 0;i < 256;i++) | |
| 96 | for (i = 0; i < 256; i++) | |
| 102 | 97 | { |
| 103 | int bit0,bit1,bit2,bit3,r,g,b; | |
| 98 | int bit0, bit1, bit2, bit3, r, g, b; | |
| 104 | 99 | |
| 105 | 100 | /* red component */ |
| 106 | 101 | bit0 = (color_prom[i] >> 0) & 0x01; |
| r7500 | r7501 | |
| 121 | 116 | bit3 = (color_prom[i + 2*256] >> 3) & 0x01; |
| 122 | 117 | b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 123 | 118 | |
| 124 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); | |
| 119 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 125 | 120 | } |
| 126 | 121 | |
| 127 | 122 | /* Grey scale for the background??? */ |
| 128 | 123 | for (i = 0; i < 256; i++) |
| 129 | 124 | { |
| 130 | palette_set_color(machine,i+256,MAKE_RGB(i,i,i)); | |
| 125 | palette_set_color(machine,i + 256, MAKE_RGB(i, i, i)); | |
| 131 | 126 | } |
| 132 | 127 | } |
| 133 | 128 | |
| r7500 | r7501 | |
| 164 | 159 | |
| 165 | 160 | ***************************************************************************/ |
| 166 | 161 | |
| 167 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 162 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 168 | 163 | { |
| 169 | | |
| 164 | skyfox_state *s | |
| 170 | 165 | int offs; |
| 171 | 166 | |
| 172 | 167 | int width = video_screen_get_width(machine->primary_screen); |
| 173 | 168 | int height = video_screen_get_height(machine->primary_screen); |
| 174 | 169 | |
| 175 | 170 | /* The 32x32 tiles in the 80-ff range are bankswitched */ |
| 176 | int shift | |
| 171 | int shift = | |
| 177 | 172 | |
| 178 | for (offs = 0; offs < | |
| 173 | for (offs = 0; offs < stat | |
| 179 | 174 | { |
| 180 | 175 | int xstart, ystart, xend, yend; |
| 181 | 176 | int xinc, yinc, dx, dy; |
| 182 | 177 | int low_code, high_code, n; |
| 183 | 178 | |
| 184 | int y = spriteram[offs+0]; | |
| 185 | int x = spriteram[offs+1]; | |
| 186 | int code = spriteram[offs+2] + spriteram[offs+3] * 256; | |
| 187 | int flipx = code & 0x2; | |
| 188 | int flipy = code & 0x4; | |
| 179 | int y = state->spriteram[offs + 0]; | |
| 180 | int x = state->spriteram[offs + 1]; | |
| 181 | int code = state->spriteram[offs + 2] + state->spriteram[offs + 3] * 256; | |
| 182 | int flipx = code & 0x2; | |
| 183 | int flipy = code & 0x4; | |
| 189 | 184 | |
| 190 | 185 | x = x * 2 + (code & 1); // add the least significant bit |
| 191 | 186 | |
| 192 | high_code = ((code >> 4) & 0x7f0) + | |
| 193 | ((code & 0x8000) >> shift); | |
| 187 | high_code = ((code >> 4) & 0x7f0) + ((code & 0x8000) >> shift); | |
| 194 | 188 | |
| 195 | 189 | switch( code & 0x88 ) |
| 196 | 190 | { |
| 197 | case 0x88: n = 4; low_code = 0; break; | |
| 198 | case 0x08: n = 2; low_code = ((code&0x20)?8:0) + ((code&0x10)?2:0); break; | |
| 199 | default: n = 1; low_code = (code >> 4) & 0xf; | |
| 191 | case 0x88: n = 4; low_code = 0; break; | |
| 192 | case 0x08: n = 2; low_code = ((code & 0x20) ? 8 : 0) + ((code & 0x10) ? 2 : 0); break; | |
| 193 | default: n = 1; low_code = (code >> 4) & 0xf; | |
| 200 | 194 | } |
| 201 | 195 | |
| 202 | 196 | #define DRAW_SPRITE(DX,DY,CODE) \ |
| r7500 | r7501 | |
| 207 | 201 | flipx,flipy, \ |
| 208 | 202 | x + (DX),y + (DY), 0xff); \ |
| 209 | 203 | |
| 210 | if (s | |
| 204 | if (state->bg_ctrl & 1) // flipscreen | |
| 211 | 205 | { |
| 212 | x = width - x - (n-1)*8; | |
| 213 | y = height - y - (n-1)*8; | |
| 206 | x = width - x - (n - 1) * 8; | |
| 207 | y = height - y - (n - 1) * 8; | |
| 214 | 208 | flipx = !flipx; |
| 215 | 209 | flipy = !flipy; |
| 216 | 210 | } |
| 217 | 211 | |
| 218 | if (flipx) { xstart = n-1; xend = -1; xinc = -1; } | |
| 219 | else { xstart = 0; xend = n; xinc = +1; } | |
| 212 | if (flipx) { xstart = n - 1; xend = -1; xinc = -1; } | |
| 213 | else { xstart = 0; xend = n; xinc = +1; } | |
| 220 | 214 | |
| 221 | if (flipy) { ystart = n-1; yend = -1; yinc = -1; } | |
| 222 | else { ystart = 0; yend = n; yinc = +1; } | |
| 215 | if (flipy) { ystart = n - 1; yend = -1; yinc = -1; } | |
| 216 | else { ystart = 0; yend = n; yinc = +1; } | |
| 223 | 217 | |
| 224 | 218 | |
| 225 | 219 | code = low_code + high_code; |
| r7500 | r7501 | |
| 227 | 221 | for (dy = ystart; dy != yend; dy += yinc) |
| 228 | 222 | { |
| 229 | 223 | for (dx = xstart; dx != xend; dx += xinc) |
| 230 | DRAW_SPRITE( | |
| 224 | DRAW_SPRITE( | |
| 231 | 225 | |
| 232 | if (n==2) code+=2; | |
| 226 | if (n == 2) code += 2; | |
| 233 | 227 | } |
| 234 | 228 | } |
| 235 | 229 | } |
| r7500 | r7501 | |
| 246 | 240 | |
| 247 | 241 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 248 | 242 | { |
| 249 | UINT8 *RAM = memory_region(machine, "gfx2"); | |
| 250 | int x,y,i; | |
| 243 | skyfox_state *state = (skyfox_state *)machine->driver_data; | |
| 244 | UINT8 *RAM = memory_region(machine, "gfx2"); | |
| 245 | int x, y, i; | |
| 251 | 246 | |
| 252 | 247 | /* The foreground stars (sprites) move at twice this speed when |
| 253 | 248 | the bg scroll rate [e.g. (skyfox_bg_reg >> 1) & 7] is 4 */ |
| 254 | int pos = (s | |
| 249 | int pos = (state->bg_pos >> 4) & (512 * 2 - 1); | |
| 255 | 250 | |
| 256 | 251 | for (i = 0 ; i < 0x1000; i++) |
| 257 | 252 | { |
| 258 | int pen,offs,j; | |
| 253 | int pen, offs, j; | |
| 259 | 254 | |
| 260 | offs = | |
| 255 | offs = (i * 2 + ((state->bg_ctrl >> 4) & 0x3) * 0x2000) % 0x8000; | |
| 261 | 256 | |
| 262 | pen = RAM[offs]; | |
| 263 | x = RAM[offs+1]*2 + (i&1) + pos + ((i & 8)?512:0); | |
| 264 | y = ((i/8)/2)*8 + (i%8); | |
| 257 | pen = RAM[offs]; | |
| 258 | x = RAM[offs + 1] * 2 + (i & 1) + pos + ((i & 8) ? 512 : 0); | |
| 259 | y = ((i / 8) / 2) * 8 + (i % 8); | |
| 265 | 260 | |
| 266 | if (s | |
| 261 | if (state->bg_ctrl & 1) // flipscreen | |
| 267 | 262 | { |
| 268 | x = 512 * 2 - (x%(512*2)); | |
| 269 | y = 256 - (y%256); | |
| 263 | x = 512 * 2 - (x % (512 * 2)); | |
| 264 | y = 256 - (y % 256); | |
| 270 | 265 | } |
| 271 | 266 | |
| 272 | for (j = 0 ; j <= ((pen&0x80)?0:3); j++) | |
| 267 | for (j = 0 ; j <= ((pen & 0x80) ? 0 : 3); j++) | |
| 273 | 268 | *BITMAP_ADDR16(bitmap, |
| 274 | ( ((j/2)&1) + y ) % 256, | |
| 275 | ( (j&1) + x ) % 512) = 256+(pen&0x7f); | |
| 269 | (((j / 2) & 1) + y) % 256, | |
| 270 | ((j & 1) + x) % 512) = 256 + (pen & 0x7f); | |
| 276 | 271 | } |
| 277 | 272 | } |
| 278 | 273 | |
| r7500 | r7501 | |
| 288 | 283 | |
| 289 | 284 | VIDEO_UPDATE( skyfox ) |
| 290 | 285 | { |
| 291 | bitmap_fill(bitmap,cliprect,255); // the bg is black | |
| 286 | bitmap_fill(bitmap, cliprect, 255); // the bg is black | |
| 292 | 287 | draw_background(screen->machine, bitmap, cliprect); |
| 293 | 288 | draw_sprites(screen->machine, bitmap, cliprect); |
| 294 | 289 | return 0; |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include "emu.h" |
| 6 | #include "includes/deco16ic.h" | |
| 6 | #include "includes/simpl156.h" | |
| 7 | #include "video/deco16ic.h" | |
| 7 | 8 | |
| 8 | 9 | /* |
| 9 | 10 | |
| r7500 | r7501 | |
| 35 | 36 | |
| 36 | 37 | /* spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps |
| 37 | 38 | its the same sprite chip Data East used on many, many 16-bit era titles */ |
| 38 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 39 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect ) | |
| 39 | 40 | { |
| 40 | UINT32 *spriteram | |
| 41 | UINT32 *spriteram | |
| 41 | 42 | int offs; |
| 42 | 43 | |
| 43 | 44 | //FIXME: flip_screen_x should not be written! |
| 44 | 45 | flip_screen_set_no_update(machine, 1); |
| 45 | 46 | |
| 46 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien | |
| 47 | for (offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) // 0x1400 for charlien | |
| 47 | 48 | { |
| 48 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult, pri; | |
| 49 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri; | |
| 49 | 50 | |
| 50 | sprite = spriteram | |
| 51 | sprite = spriteram | |
| 51 | 52 | |
| 52 | y = spriteram32[offs]&0xffff; | |
| 53 | flash=y&0x1000; | |
| 54 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 53 | y = spriteram[offs] & 0xffff; | |
| 54 | flash = y & 0x1000; | |
| 55 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 56 | continue; | |
| 55 | 57 | |
| 56 | x = spriteram32[offs+2]&0xffff; | |
| 57 | colour = (x >>9) & 0x1f; | |
| 58 | x = spriteram[offs + 2] & 0xffff; | |
| 59 | colour = (x >> 9) & 0x1f; | |
| 58 | 60 | |
| 59 | pri = (x&0xc000); // 2 bits or 1? | |
| 61 | pri = (x & 0xc000); // 2 bits or 1? | |
| 60 | 62 | |
| 61 | switch (pri&0xc000) { | |
| 62 | case 0x0000: pri=0; break; | |
| 63 | case 0x4000: pri=0xf0; break; | |
| 64 | case 0x8000: pri=0xf0|0xcc; break; | |
| 65 | case 0xc000: pri=0xf0|0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 63 | switch (pri & 0xc000) | |
| 64 | { | |
| 65 | case 0x0000: pri = 0; break; | |
| 66 | case 0x4000: pri = 0xf0; break; | |
| 67 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 68 | case 0xc000: pri = 0xf0 | 0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 66 | 69 | } |
| 67 | 70 | |
| 68 | 71 | fx = y & 0x2000; |
| r7500 | r7501 | |
| 74 | 77 | if (x >= 320) x -= 512; |
| 75 | 78 | if (y >= 256) y -= 512; |
| 76 | 79 | y = 240 - y; |
| 77 | ||
| 80 | | |
| 78 | 81 | |
| 79 | if (x>320) continue; | |
| 82 | if (x > 320) | |
| 83 | continue; | |
| 80 | 84 | |
| 81 | 85 | sprite &= ~multi; |
| 82 | 86 | if (fy) |
| r7500 | r7501 | |
| 89 | 93 | |
| 90 | 94 | if (flip_screen_get(machine)) |
| 91 | 95 | { |
| 92 | y=240-y; | |
| 93 | x=304-x; | |
| 94 | if (fx) fx=0; else fx=1; | |
| 95 | if (fy) fy=0; else fy=1; | |
| 96 | mult=16; | |
| 96 | y = 240 - y; | |
| 97 | x = 304 - x; | |
| 98 | if (fx) fx = 0; else fx = 1; | |
| 99 | if (fy) fy = 0; else fy = 1; | |
| 100 | mult = 16; | |
| 97 | 101 | } |
| 98 | else mult=-16; | |
| 102 | else | |
| 103 | mult = -16; | |
| 99 | 104 | |
| 100 | 105 | while (multi >= 0) |
| 101 | 106 | { |
| r7500 | r7501 | |
| 112 | 117 | } |
| 113 | 118 | |
| 114 | 119 | |
| 115 | VIDEO_ | |
| 120 | VIDEO_ST | |
| 116 | 121 | { |
| 117 | | |
| 122 | si | |
| 118 | 123 | |
| 119 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 124 | /* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */ | |
| 125 | state->pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 126 | state->pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 127 | machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2); | |
| 120 | 128 | |
| 121 | bitmap_fill(bitmap,cliprect,256); | |
| 122 | ||
| 123 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 124 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,4); | |
| 125 | ||
| 126 | draw_sprites(screen->machine, bitmap,cliprect); | |
| 127 | return 0; | |
| 129 | /* and register the allocated ram so that save states still work */ | |
| 130 | state_save_register_global_pointer(machine, state->pf1_rowscroll, 0x800/2); | |
| 131 | state_save_register_global_pointer(machine, state->pf2_rowscroll, 0x800/2); | |
| 132 | state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000/2); | |
| 128 | 133 | } |
| 129 | 134 | |
| 130 | ||
| 135 | VIDEO_UPDATE( | |
| 131 | 136 | { |
| 132 | return ((bank>>4)&0x7) * 0x1000; | |
| 133 | } | |
| 137 | simpl156_state *state = (simpl156_state *)screen->machine->driver_data; | |
| 134 | 138 | |
| 139 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 135 | 140 | |
| 136 | VIDEO_START( simpl156 ) | |
| 137 | { | |
| 138 | /* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */ | |
| 139 | deco16_pf1_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 140 | deco16_pf2_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 141 | deco16_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 142 | deco16_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 143 | deco16_pf12_control = auto_alloc_array(machine, UINT16, 0x10/2); | |
| 144 | machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2); | |
| 141 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 145 | 142 | |
| 146 | /* and register the allocated ram so that save states still work */ | |
| 147 | state_save_register_global_pointer(machine, deco16_pf1_data, 0x2000/2); | |
| 148 | state_save_register_global_pointer(machine, deco16_pf2_data, 0x2000/2); | |
| 149 | state_save_register_global_pointer(machine, deco16_pf1_rowscroll, 0x800/2); | |
| 150 | state_save_register_global_pointer(machine, deco16_pf2_rowscroll, 0x800/2); | |
| 151 | state_save_register_global_pointer(machine, deco16_pf12_control, 0x10/2); | |
| 152 | state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000/2); | |
| 143 | bitmap_fill(bitmap, cliprect, 256); | |
| 153 | 144 | |
| 154 | deco16_1_video_init(machine); | |
| 145 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 146 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 155 | 147 | |
| 156 | deco16_set_tilemap_bank_callback(0, simpl156_bank_callback); | |
| 157 | deco16_set_tilemap_bank_callback(1, simpl156_bank_callback); | |
| 148 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 149 | return 0; | |
| 158 | 150 | } |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/orbit.h" |
| 9 | 9 | |
| 10 | UINT8* orbit_playfield_ram; | |
| 11 | UINT8* orbit_sprite_ram; | |
| 12 | ||
| 13 | static tilemap_t* bg_tilemap; | |
| 14 | ||
| 15 | static int orbit_flip_screen; | |
| 16 | ||
| 17 | ||
| 18 | 10 | WRITE8_HANDLER( orbit_playfield_w ) |
| 19 | 11 | { |
| 20 | orbit_playfield_ram[offset] = data; | |
| 21 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 12 | orbit_state *state = (orbit_state *)space->machine->driver_data; | |
| 13 | state->playfield_ram[offset] = data; | |
| 14 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 22 | 15 | } |
| 23 | 16 | |
| 24 | 17 | |
| 25 | 18 | static TILE_GET_INFO( get_tile_info ) |
| 26 | 19 | { |
| 27 | UINT8 code = orbit_playfield_ram[tile_index]; | |
| 28 | ||
| 20 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 21 | UINT8 code = state->playfield_ram[tile_index]; | |
| 29 | 22 | int flags = 0; |
| 30 | 23 | |
| 31 | if (code | |
| 24 | if (BIT(code, 6) | |
| 32 | 25 | flags |= TILE_FLIPX; |
| 33 | if ( | |
| 26 | if (s | |
| 34 | 27 | flags |= TILE_FLIPY; |
| 35 | 28 | |
| 36 | 29 | SET_TILE_INFO(3, code & 0x3f, 0, flags); |
| r7500 | r7501 | |
| 39 | 32 | |
| 40 | 33 | VIDEO_START( orbit ) |
| 41 | 34 | { |
| 42 | bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 32, 30); | |
| 35 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 36 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 32, 30); | |
| 43 | 37 | } |
| 44 | 38 | |
| 45 | 39 | |
| 46 | static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect) | |
| 40 | static void draw_sprites( running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect ) | |
| 47 | 41 | { |
| 48 | const UINT8* p = orbit_sprite_ram; | |
| 42 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 43 | const UINT8* p = state->sprite_ram; | |
| 49 | 44 | |
| 50 | 45 | int i; |
| 51 | 46 | |
| r7500 | r7501 | |
| 60 | 55 | ((flag & 0xc0) == 0x80) ? 1 : |
| 61 | 56 | ((flag & 0xc0) == 0xc0) ? 2 : 0; |
| 62 | 57 | |
| 63 | int flip_x = code & 0x40; | |
| 64 | int flip_y = code & 0x80; | |
| 58 | int flip_x = BIT(code, 6); | |
| 59 | int flip_y = BIT(code, 7); | |
| 65 | 60 | |
| 66 | 61 | int zoom_x = 0x10000; |
| 67 | 62 | int zoom_y = 0x10000; |
| r7500 | r7501 | |
| 86 | 81 | |
| 87 | 82 | VIDEO_UPDATE( orbit ) |
| 88 | 83 | { |
| 89 | orbit_ | |
| 84 | orbit_ | |
| 90 | 85 | |
| 91 | t | |
| 86 | st | |
| 92 | 87 | |
| 88 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 89 | ||
| 93 | 90 | draw_sprites(screen->machine, bitmap, cliprect); |
| 94 | 91 | return 0; |
| 95 | 92 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/mexico86.h" |
| 3 | 3 | |
| 4 | UINT8 *mexico86_videoram,*mexico86_objectram; | |
| 5 | size_t mexico86_objectram_size; | |
| 6 | static int charbank; | |
| 7 | 4 | |
| 8 | ||
| 9 | ||
| 10 | 5 | WRITE8_HANDLER( mexico86_bankswitch_w ) |
| 11 | 6 | { |
| 12 | | |
| 7 | mexico86_state *state = (mexico86_state *) | |
| 13 | 8 | |
| 14 | 9 | if ((data & 7) > 5) |
| 15 | popmessage( | |
| 10 | popmessage( | |
| 16 | 11 | |
| 17 | memory_set_bank | |
| 12 | memory_set_bank | |
| 18 | 13 | |
| 19 | charbank = (data | |
| 14 | state->charbank = BIT(data, | |
| 20 | 15 | } |
| 21 | 16 | |
| 22 | 17 | |
| 23 | 18 | |
| 24 | 19 | VIDEO_UPDATE( mexico86 ) |
| 25 | 20 | { |
| 21 | mexico86_state *state = (mexico86_state *)screen->machine->driver_data; | |
| 26 | 22 | int offs; |
| 27 | int sx,sy,xc,yc; | |
| 28 | int gfx_num,gfx_attr,gfx_offs; | |
| 23 | int sx, sy, xc, yc; | |
| 24 | int gfx_num, gfx_attr, gfx_offs; | |
| 29 | 25 | |
| 30 | 26 | |
| 31 | 27 | /* Bubble Bobble doesn't have a real video RAM. All graphics (characters */ |
| 32 | 28 | /* and sprites) are stored in the same memory region, and information on */ |
| 33 | 29 | /* the background character columns is stored inthe area dd00-dd3f */ |
| 30 | bitmap_fill(bitmap, cliprect, 255); | |
| 34 | 31 | |
| 35 | | |
| 32 | sx = 0 | |
| 36 | 33 | |
| 37 | sx = 0; | |
| 38 | /* the score display seems to be outside of the main objectram. */ | |
| 39 | for (offs = 0;offs < mexico86_objectram_size+0x200;offs += 4) | |
| 34 | /* the score display seems to be outside of the main objectram. */ | |
| 35 | for (offs = 0; offs < state->objectram_size + 0x200; offs += 4) | |
| 40 | 36 | { |
| 41 | 37 | int height; |
| 42 | 38 | |
| 43 | if (offs >= mexico86_objectram_size && offs < mexico86_objectram_size+0x180) continue; | |
| 44 | if (offs >= mexico86_objectram_size+0x1c0) continue; | |
| 39 | if (offs >= state->objectram_size && offs < state->objectram_size + 0x180) | |
| 40 | continue; | |
| 45 | 41 | |
| 42 | if (offs >= state->objectram_size + 0x1c0) | |
| 43 | continue; | |
| 44 | ||
| 46 | 45 | /* skip empty sprites */ |
| 47 | 46 | /* this is dword aligned so the UINT32 * cast shouldn't give problems */ |
| 48 | 47 | /* on any architecture */ |
| 49 | if (*(UINT32 *)(& | |
| 48 | if (*(UINT32 *)(&state-> | |
| 50 | 49 | continue; |
| 51 | 50 | |
| 52 | gfx_num = mexico86_objectram[offs + 1]; | |
| 53 | gfx_attr = mexico86_objectram[offs + 3]; | |
| 51 | gfx_num = state->objectram[offs + 1]; | |
| 52 | gfx_attr = state->objectram[offs + 3]; | |
| 54 | 53 | |
| 55 | if ((gfx_num | |
| 54 | if (!BIT(gfx_num, 7 | |
| 56 | 55 | { |
| 57 | 56 | gfx_offs = ((gfx_num & 0x1f) * 0x80) + ((gfx_num & 0x60) >> 1) + 12; |
| 58 | 57 | height = 2; |
| r7500 | r7501 | |
| 67 | 66 | sx += 16; |
| 68 | 67 | else |
| 69 | 68 | { |
| 70 | sx = mexico86_objectram[offs + 2]; | |
| 71 | // if (gfx_attr & 0x40) sx -= 256; | |
| 69 | sx = state->objectram[offs + 2]; | |
| 70 | //if (gfx_attr & 0x40) sx -= 256; | |
| 72 | 71 | } |
| 73 | sy = 256 - height*8 - ( | |
| 72 | sy = 256 - height * 8 - (state-> | |
| 74 | 73 | |
| 75 | for (xc = 0;xc < 2;xc++) | |
| 74 | for (xc = 0; xc < 2; xc++) | |
| 76 | 75 | { |
| 77 | for (yc = 0;yc < height;yc++) | |
| 76 | for (yc = 0; yc < height; yc++) | |
| 78 | 77 | { |
| 79 | int goffs,code,color,flipx,flipy,x,y; | |
| 78 | int goffs, code, color, flipx, flipy, x, y; | |
| 80 | 79 | |
| 81 | 80 | goffs = gfx_offs + xc * 0x40 + yc * 0x02; |
| 82 | code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x07) << 8) | |
| 83 | + ((mexico86_videoram[goffs + 1] & 0x80) << 4) + (charbank << 12); | |
| 84 | color = ((mexico86_videoram[goffs + 1] & 0x38) >> 3) + ((gfx_attr & 0x02) << 2); | |
| 85 | flipx = mexico86_videoram[goffs + 1] & 0x40; | |
| 81 | code = state->videoram[goffs] + ((state->videoram[goffs + 1] & 0x07) << 8) | |
| 82 | + ((state->videoram[goffs + 1] & 0x80) << 4) + (state->charbank << 12); | |
| 83 | color = ((state->videoram[goffs + 1] & 0x38) >> 3) + ((gfx_attr & 0x02) << 2); | |
| 84 | flipx = state->videoram[goffs + 1] & 0x40; | |
| 86 | 85 | flipy = 0; |
| 87 | // x = sx + xc * 8; | |
| 86 | ||
| 87 | //x = sx + xc * 8; | |
| 88 | 88 | x = (sx + xc * 8) & 0xff; |
| 89 | 89 | y = (sy + yc * 8) & 0xff; |
| 90 | 90 | |
| r7500 | r7501 | |
| 101 | 101 | |
| 102 | 102 | VIDEO_UPDATE( kikikai ) |
| 103 | 103 | { |
| 104 | mexico86_state *state = (mexico86_state *)screen->machine->driver_data; | |
| 104 | 105 | int offs; |
| 105 | int sx,sy,yc; | |
| 106 | int gfx_num,gfx_attr,gfx_offs; | |
| 106 | int sx, sy, yc; | |
| 107 | int gfx_num, gfx_attr, gfx_offs; | |
| 107 | 108 | int height; |
| 108 | int goffs,code,color,y; | |
| 109 | int goffs, code, color, y; | |
| 109 | 110 | int tx, ty; |
| 110 | 111 | |
| 111 | 112 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 112 | 113 | sx = 0; |
| 113 | for (offs=0; offs< | |
| 114 | for (offs = 0; offs < state-> | |
| 114 | 115 | { |
| 115 | if (*(UINT32*)(mexico86_objectram + offs) == 0) continue; | |
| 116 | if (*(UINT32*)(state->objectram + offs) == 0) | |
| 117 | continue; | |
| 116 | 118 | |
| 117 | ty = mexico86_objectram[offs]; | |
| 118 | gfx_num = mexico86_objectram[offs + 1]; | |
| 119 | tx = mexico86_objectram[offs + 2]; | |
| 120 | gfx_attr = mexico86_objectram[offs + 3]; | |
| 119 | ty = state->objectram[offs]; | |
| 120 | gfx_num = state->objectram[offs + 1]; | |
| 121 | tx = state->objectram[offs + 2]; | |
| 122 | gfx_attr = state->objectram[offs + 3]; | |
| 121 | 123 | |
| 122 | 124 | if (gfx_num & 0x80) |
| 123 | 125 | { |
| r7500 | r7501 | |
| 133 | 135 | height = 2; |
| 134 | 136 | sx = tx; |
| 135 | 137 | } |
| 138 | ||
| 136 | 139 | sy = 256 - (height << 3) - ty; |
| 137 | 140 | |
| 138 | 141 | height <<= 1; |
| 139 | for (yc=0; yc<height; yc+=2) | |
| 142 | for (yc = 0; yc < height; yc += 2) | |
| 140 | 143 | { |
| 141 | 144 | y = (sy + (yc << 2)) & 0xff; |
| 142 | 145 | goffs = gfx_offs + yc; |
| 143 | code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x1f) << 8); | |
| 144 | color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5; | |
| 146 | code = state->videoram[goffs] + ((state->videoram[goffs + 1] & 0x1f) << 8); | |
| 147 | color = (state->videoram[goffs + 1] & 0xe0) >> 5; | |
| 145 | 148 | goffs += 0x40; |
| 146 | 149 | |
| 147 | 150 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], |
| r7500 | r7501 | |
| 150 | 153 | 0,0, |
| 151 | 154 | sx&0xff,y,15); |
| 152 | 155 | |
| 153 | code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x1f) << 8); | |
| 154 | color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5; | |
| 156 | code = state->videoram[goffs] + ((state->videoram[goffs + 1] & 0x1f) << 8); | |
| 157 | color = (state->videoram[goffs + 1] & 0xe0) >> 5; | |
| 155 | 158 | |
| 156 | 159 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], |
| 157 | 160 | code, |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | *******************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "emu.h" |
| 17 | #include "includes/mouser.h" | |
| 17 | 18 | |
| 18 | UINT8 *mouser_videoram; | |
| 19 | UINT8 *mouser_colorram; | |
| 20 | ||
| 21 | 19 | PALETTE_INIT( mouser ) |
| 22 | 20 | { |
| 23 | 21 | int i; |
| 24 | 22 | |
| 25 | for (i = 0;i < machine->config->total_colors;i++) | |
| 23 | for (i = 0; i < machine->config->total_colors; i++) | |
| 26 | 24 | { |
| 27 | int bit0,bit1,bit2,r,g,b; | |
| 25 | int bit0, bit1, bit2, r, g, b; | |
| 28 | 26 | |
| 29 | 27 | /* red component */ |
| 30 | bit0 = BIT(*color_prom,0); | |
| 31 | bit1 = BIT(*color_prom,1); | |
| 32 | bit2 = BIT(*color_prom,2); | |
| 28 | bit0 = BIT(*color_prom, 0); | |
| 29 | bit1 = BIT(*color_prom, 1); | |
| 30 | bit2 = BIT(*color_prom, 2); | |
| 33 | 31 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 34 | 32 | /* green component */ |
| 35 | bit0 = BIT(*color_prom,3); | |
| 36 | bit1 = BIT(*color_prom,4); | |
| 37 | bit2 = BIT(*color_prom,5); | |
| 33 | bit0 = BIT(*color_prom, 3); | |
| 34 | bit1 = BIT(*color_prom, 4); | |
| 35 | bit2 = BIT(*color_prom, 5); | |
| 38 | 36 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 39 | 37 | /* blue component */ |
| 40 | bit0 = BIT(*color_prom,6); | |
| 41 | bit1 = BIT(*color_prom,7); | |
| 38 | bit0 = BIT(*color_prom, 6); | |
| 39 | bit1 = BIT(*color_prom, 7); | |
| 42 | 40 | b = 0x4f * bit0 + 0xa8 * bit1; |
| 43 | 41 | |
| 44 | 42 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); |
| r7500 | r7501 | |
| 58 | 56 | |
| 59 | 57 | VIDEO_UPDATE( mouser ) |
| 60 | 58 | { |
| 61 | UINT8 *spriteram = screen->machine->generic.spriteram.u8; | |
| 59 | mouser_state *state = (mouser_state *)screen->machine->driver_data; | |
| 60 | UINT8 *spriteram = state->spriteram; | |
| 62 | 61 | int offs; |
| 63 | int sx,sy; | |
| 64 | int flipx,flipy; | |
| 62 | int sx, sy; | |
| 63 | int flipx, flipy; | |
| 65 | 64 | |
| 66 | 65 | /* for every character in the Video RAM */ |
| 67 | 66 | for (offs = 0x3ff; offs >= 0; offs--) |
| r7500 | r7501 | |
| 89 | 88 | /* Ideally we would merge these on a pixel-by-pixel basis, but it's ok to do this char-by-char, */ |
| 90 | 89 | /* Since it's only for the MOUSER logo and it looks fine */ |
| 91 | 90 | /* Note: this is _not_ dependant on flipping */ |
| 92 | color_offs = offs%32 + ((256 + 8*(offs/32) - spriteram[offs%32])%256)/8*32; | |
| 91 | color_offs = offs % 32 + ((256 + 8 * (offs / 32) - spriteram[offs % 32] )% 256) / 8 * 32; | |
| 93 | 92 | |
| 94 | 93 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], |
| 95 | mouser_videoram[offs] | (mouser_colorram[color_offs]>>5)*256 | ((mouser_colorram[color_offs]>>4)&1)*512, | |
| 96 | mouser_colorram[color_offs]%16, | |
| 94 | state->videoram[offs] | (state->colorram[color_offs] >> 5) * 256 | ((state->colorram[color_offs] >> 4) & 1) * 512, | |
| 95 | state->colorram[color_offs]%16, | |
| 97 | 96 | flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine), |
| 98 | 97 | 8*sx,scrolled_y_position); |
| 99 | 98 | } |
| r7500 | r7501 | |
| 103 | 102 | /* This is the first set of 7 sprites */ |
| 104 | 103 | for(offs = 0x0084; offs < 0x00A0; offs += 4) |
| 105 | 104 | { |
| 106 | sx = spriteram[offs+3]; | |
| 107 | sy = 0xef-spriteram[offs+2]; | |
| 105 | sx = spriteram[offs + 3]; | |
| 106 | sy = 0xef - spriteram[offs + 2]; | |
| 108 | 107 | |
| 109 | flipx = (spriteram[offs]&0x40)>>6; | |
| 110 | flipy = (spriteram[offs]&0x80)>>7; | |
| 108 | flipx = BIT(spriteram[offs], 6); | |
| 109 | flipy = BIT(spriteram[offs], 7); | |
| 111 | 110 | |
| 112 | 111 | if (flip_screen_x_get(screen->machine)) |
| 113 | 112 | { |
| r7500 | r7501 | |
| 121 | 120 | sy = 238 - sy; |
| 122 | 121 | } |
| 123 | 122 | |
| 124 | if ((spriteram[offs+1] | |
| 123 | if (BIT(spriteram[offs + 1], | |
| 125 | 124 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)], |
| 126 | 125 | spriteram[offs]&0x3f, |
| 127 | 126 | spriteram[offs+1]%16, |
| r7500 | r7501 | |
| 130 | 129 | } |
| 131 | 130 | |
| 132 | 131 | /* This is the second set of 8 sprites */ |
| 133 | for(offs = 0x00C4; offs < 0x00 | |
| 132 | for(offs = 0x00C4; offs < 0x00e4; offs += 4) | |
| 134 | 133 | { |
| 135 | sx = spriteram[offs+3]; | |
| 136 | sy = 0xef-spriteram[offs+2]; | |
| 134 | sx = spriteram[offs + 3]; | |
| 135 | sy = 0xef - spriteram[offs + 2]; | |
| 137 | 136 | |
| 138 | flipx = (spriteram[offs]&0x40)>>6; | |
| 139 | flipy = (spriteram[offs]&0x80)>>7; | |
| 137 | flipx = BIT(spriteram[offs], 6); | |
| 138 | flipy = BIT(spriteram[offs], 7); | |
| 140 | 139 | |
| 141 | 140 | if (flip_screen_x_get(screen->machine)) |
| 142 | 141 | { |
| r7500 | r7501 | |
| 150 | 149 | sy = 238 - sy; |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | if ((spriteram[offs+1] | |
| 152 | if (BIT(spriteram[offs + 1], | |
| 154 | 153 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)], |
| 155 | 154 | spriteram[offs]&0x3f, |
| 156 | 155 | spriteram[offs+1]%16, |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/deco16ic.h" | |
| 3 | 2 | #include "includes/deco32.h" |
| 4 | 3 | |
| 5 | 4 | UINT32 *deco32_pf1_data,*deco32_pf2_data,*deco32_pf3_data,*deco32_pf4_data; |
| r7500 | r7501 | |
| 23 | 22 | int deco32_raster_display_position; |
| 24 | 23 | UINT16 *deco32_raster_display_list; |
| 25 | 24 | |
| 25 | /****************************************************************************** | |
| 26 | ||
| 27 | This sprite_priority_bitmap handling is the same as in deco16ic.c | |
| 28 | ||
| 29 | ******************************************************************************/ | |
| 30 | ||
| 31 | static bitmap_t *sprite_priority_bitmap; | |
| 32 | ||
| 33 | static void deco16_clear_sprite_priority_bitmap(void) | |
| 34 | { | |
| 35 | if (sprite_priority_bitmap) | |
| 36 | bitmap_fill(sprite_priority_bitmap,NULL,0); | |
| 37 | } | |
| 38 | ||
| 39 | /* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */ | |
| 40 | static void deco16_pdrawgfx( | |
| 41 | bitmap_t *dest,const rectangle *clip,const gfx_element *gfx, | |
| 42 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, | |
| 43 | int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha) | |
| 44 | { | |
| 45 | int ox,oy,cx,cy; | |
| 46 | int x_index,y_index,x,y; | |
| 47 | bitmap_t *priority_bitmap = gfx->machine->priority_bitmap; | |
| 48 | const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 49 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 50 | ||
| 51 | /* check bounds */ | |
| 52 | ox = sx; | |
| 53 | oy = sy; | |
| 54 | ||
| 55 | if (sx>319 || sy>247 || sx<-15 || sy<-7) | |
| 56 | return; | |
| 57 | ||
| 58 | if (sy<0) sy=0; | |
| 59 | if (sx<0) sx=0; | |
| 60 | if (sx>319) cx=319; | |
| 61 | else cx=ox+16; | |
| 62 | ||
| 63 | cy=(sy-oy); | |
| 64 | ||
| 65 | if (flipy) y_index=15-cy; else y_index=cy; | |
| 66 | ||
| 67 | for( y=0; y<16-cy; y++ ) | |
| 68 | { | |
| 69 | const UINT8 *source = code_base + (y_index * gfx->line_modulo); | |
| 70 | UINT32 *destb = BITMAP_ADDR32(dest, sy, 0); | |
| 71 | UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0); | |
| 72 | UINT8 *spri = BITMAP_ADDR8(sprite_priority_bitmap, sy, 0); | |
| 73 | ||
| 74 | if (sy >= 0 && sy < 248) | |
| 75 | { | |
| 76 | if (flipx) { source+=15-(sx-ox); x_index=-1; } else { x_index=1; source+=(sx-ox); } | |
| 77 | ||
| 78 | for (x=sx; x<cx; x++) | |
| 79 | { | |
| 80 | int c = *source; | |
| 81 | if( c != transparent_color && x >= 0 && x < 320 ) | |
| 82 | { | |
| 83 | if (pri_mask>pri[x] && sprite_mask>spri[x]) { | |
| 84 | if (alpha != 0xff) | |
| 85 | destb[x] = alpha_blend_r32(destb[x], pal[c], alpha); | |
| 86 | else | |
| 87 | destb[x] = pal[c]; | |
| 88 | if (write_pri) | |
| 89 | pri[x] |= pri_mask; | |
| 90 | } | |
| 91 | spri[x]|=sprite_mask; | |
| 92 | } | |
| 93 | source+=x_index; | |
| 94 | } | |
| 95 | } | |
| 96 | ||
| 97 | sy++; | |
| 98 | if (sy>247) | |
| 99 | return; | |
| 100 | if (flipy) y_index--; else y_index++; | |
| 101 | } | |
| 102 | } | |
| 103 | ||
| 26 | 104 | /******************************************************************************/ |
| 27 | 105 | |
| 28 | 106 | WRITE32_HANDLER( deco32_pf1_data_w ) |
| r7500 | r7501 | |
| 992 | 1070 | pf1a_tilemap =0; |
| 993 | 1071 | dirty_palette = auto_alloc_array(machine, UINT8, 4096); |
| 994 | 1072 | |
| 995 | deco_allocate_sprite_bitmap(machine); | |
| 1073 | /* Allow sprite bitmap */ | |
| 1074 | int width = video_screen_get_width(machine->primary_screen); | |
| 1075 | int height = video_screen_get_height(machine->primary_screen); | |
| 1076 | sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 ); | |
| 996 | 1077 | |
| 997 | 1078 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 998 | 1079 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| r7500 | r7501 | |
|---|---|---|
| 1 | #include "emu.h" | |
| 2 | #include "includes/lkage.h" | |
| 1 | /*************************************************************************** | |
| 3 | 2 | |
| 4 | static tilemap_t *bg_tilemap, *fg_tilemap, *tx_tilemap; | |
| 5 | static UINT8 bg_tile_bank, fg_tile_bank; | |
| 6 | UINT8 *lkage_scroll, *lkage_vreg; | |
| 3 | video/lkage.c | |
| 7 | 4 | |
| 8 | ||
| 5 | ||
| 9 | 6 | lkage_scroll[0x00]: text layer horizontal scroll |
| 10 | 7 | lkage_scroll[0x01]: text layer vertical scroll |
| 11 | 8 | lkage_scroll[0x02]: foreground layer horizontal scroll |
| r7500 | r7501 | |
| 35 | 32 | 04 1e f3 : attract#2 110 |
| 36 | 33 | 04 1e f3 : attract#3 110 |
| 37 | 34 | 00 4e f3 : attract#4 110 |
| 38 | */ | |
| 39 | 35 | |
| 36 | ||
| 37 | ***************************************************************************/ | |
| 38 | ||
| 39 | #include "emu.h" | |
| 40 | #include "includes/lkage.h" | |
| 41 | ||
| 42 | ||
| 40 | 43 | WRITE8_HANDLER( lkage_videoram_w ) |
| 41 | 44 | { |
| 42 | space->machine-> | |
| 45 | lkage_state *state = (lkage_state *)space->machine->d | |
| 43 | 46 | |
| 44 | switch( offset/0x400 ) | |
| 47 | state->videoram[offset] = data; | |
| 48 | ||
| 49 | switch (offset / 0x400) | |
| 45 | 50 | { |
| 46 | 51 | case 0: |
| 47 | tilemap_mark_tile_dirty(tx_tilemap,offset & 0x3ff); | |
| 52 | tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x3ff); | |
| 48 | 53 | break; |
| 49 | 54 | |
| 50 | 55 | case 1: |
| 51 | tilemap_mark_tile_dirty(fg_tilemap,offset & 0x3ff); | |
| 56 | tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff); | |
| 52 | 57 | break; |
| 53 | 58 | |
| 54 | 59 | case 2: |
| 55 | tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff); | |
| 60 | tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff); | |
| 56 | 61 | break; |
| 57 | 62 | |
| 58 | 63 | default: |
| 59 | 64 | break; |
| 60 | 65 | } |
| 61 | } | |
| 66 | } | |
| 62 | 67 | |
| 63 | 68 | static TILE_GET_INFO( get_bg_tile_info ) |
| 64 | 69 | { |
| 65 | int code = machine->generic.videoram.u8[tile_index + 0x800] + 256 * (bg_tile_bank?5:1); | |
| 70 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 71 | int code = state->videoram[tile_index + 0x800] + 256 * (state->bg_tile_bank ? 5 : 1); | |
| 66 | 72 | SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/ ); |
| 67 | 73 | } |
| 68 | 74 | |
| 69 | 75 | static TILE_GET_INFO( get_fg_tile_info ) |
| 70 | 76 | { |
| 71 | int code = machine->generic.videoram.u8[tile_index + 0x400] + 256 * (fg_tile_bank?1:0); | |
| 77 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 78 | int code = state->videoram[tile_index + 0x400] + 256 * (state->fg_tile_bank ? 1 : 0); | |
| 72 | 79 | SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/); |
| 73 | 80 | } |
| 74 | 81 | |
| 75 | 82 | static TILE_GET_INFO( get_tx_tile_info ) |
| 76 | 83 | { |
| 77 | int code = machine->generic.videoram.u8[tile_index]; | |
| 84 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 85 | int code = state->videoram[tile_index]; | |
| 78 | 86 | SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/); |
| 79 | 87 | } |
| 80 | 88 | |
| 81 | 89 | VIDEO_START( lkage ) |
| 82 | 90 | { |
| 83 | | |
| 91 | lkage_state *state = (lkage_state *)machine->driver_data | |
| 84 | 92 | |
| 85 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8,8,32,32); | |
| 86 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 87 | tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 93 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 94 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 95 | state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 88 | 96 | |
| 89 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 90 | tilemap_set_transparent_pen(tx_tilemap,0); | |
| 97 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 98 | tilemap_set_transparent_pen(state->tx_tilemap, 0); | |
| 91 | 99 | |
| 92 | tilemap_set_scrolldx(bg_tilemap,-5,-5+24); | |
| 93 | tilemap_set_scrolldx(fg_tilemap,-3,-3+24); | |
| 94 | tilemap_set_scrolldx(tx_tilemap,-1,-1+24); | |
| 95 | } /* VIDEO_START( lkage ) */ | |
| 100 | tilemap_set_scrolldx(state->bg_tilemap, -5, -5 + 24); | |
| 101 | tilemap_set_scrolldx(state->fg_tilemap, -3, -3 + 24); | |
| 102 | tilemap_set_scrolldx(state->tx_tilemap, -1, -1 + 24); | |
| 103 | } | |
| 96 | 104 | |
| 97 | 105 | |
| 98 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 106 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 99 | 107 | { |
| 100 | const UINT8 *source = machine->generic.spriteram.u8; | |
| 101 | const UINT8 *finish = source+0x60; | |
| 102 | while( source<finish ) | |
| 108 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 109 | const UINT8 *source = state->spriteram; | |
| 110 | const UINT8 *finish = source + 0x60; | |
| 111 | ||
| 112 | while (source < finish) | |
| 103 | 113 | { |
| 104 | 114 | int attributes = source[2]; |
| 105 | 115 | /* 0x01: horizontal flip |
| r7500 | r7501 | |
| 110 | 120 | * 0x80: priority |
| 111 | 121 | */ |
| 112 | 122 | int priority_mask = 0; |
| 113 | int color = (attributes>>4)&7; | |
| 114 | int flipx = attributes&0x01; | |
| 115 | int flipy = attributes&0x02; | |
| 116 | int height = (attributes&0x08) ? 2 : 1; | |
| 117 | int sx = source[0]-15; | |
| 118 | int sy = 256-16*height-source[1]; | |
| 123 | int color = (attributes >> 4) & 7; | |
| 124 | int flipx = attributes & 0x01; | |
| 125 | int flipy = attributes & 0x02; | |
| 126 | int height = (attributes & 0x08) ? 2 : 1; | |
| 127 | int sx = source[0] - 15; | |
| 128 | int sy = 256 - 16 * height - source[1]; | |
| 119 | 129 | int sprite_number = source[3] + ((attributes & 0x04) << 6); |
| 120 | 130 | int y; |
| 121 | 131 | |
| 122 | if | |
| 132 | if | |
| 123 | 133 | { |
| 124 | priority_mask = (0xf0|0xcc | |
| 134 | priority_mask = (0xf0 | 0xcc | |
| 125 | 135 | } |
| 126 | 136 | else |
| 127 | 137 | { |
| 128 | priority_mask = | |
| 138 | priority_mask = | |
| 129 | 139 | } |
| 130 | 140 | |
| 131 | 141 | if (flip_screen_x_get(machine)) |
| r7500 | r7501 | |
| 133 | 143 | sx = 239 - sx - 24; |
| 134 | 144 | flipx = !flipx; |
| 135 | 145 | } |
| 136 | if | |
| 146 | if | |
| 137 | 147 | { |
| 138 | sy = 254 - 16*height - sy; | |
| 148 | sy = 254 - 16 * height - sy; | |
| 139 | 149 | flipy = !flipy; |
| 140 | 150 | } |
| 141 | 151 | if (height == 2 && !flipy) |
| r7500 | r7501 | |
| 143 | 153 | sprite_number ^= 1; |
| 144 | 154 | } |
| 145 | 155 | |
| 146 | for (y = 0;y < height;y++) | |
| 156 | for (y = 0; y < height; y++) | |
| 147 | 157 | { |
| 148 | 158 | pdrawgfx_transpen( |
| 149 | 159 | bitmap, |
| r7500 | r7501 | |
| 157 | 167 | machine->priority_bitmap, |
| 158 | 168 | priority_mask,0 ); |
| 159 | 169 | } |
| 160 | source+=4; | |
| 170 | source += 4; | |
| 161 | 171 | } |
| 162 | } | |
| 172 | } | |
| 163 | 173 | |
| 164 | 174 | VIDEO_UPDATE( lkage ) |
| 165 | 175 | { |
| 176 | lkage_state *state = (lkage_state *)screen->machine->driver_data; | |
| 166 | 177 | int bank; |
| 167 | 178 | |
| 168 | flip_screen_x_set(screen->machine, ~lkage_vreg[2] & 0x01); | |
| 169 | flip_screen_y_set(screen->machine, ~lkage_vreg[2] & 0x02); | |
| 179 | flip_screen_x_set(screen->machine, ~state->vreg[2] & 0x01); | |
| 180 | flip_screen_y_set(screen->machine, ~state->vreg[2] & 0x02); | |
| 170 | 181 | |
| 171 | bank = lkage_vreg[1]&0x08; | |
| 172 | if( bg_tile_bank != bank ) | |
| 182 | bank = state->vreg[1] & 0x08; | |
| 183 | if (state->bg_tile_bank != bank) | |
| 173 | 184 | { |
| 174 | bg_tile_bank = bank; | |
| 175 | tilemap_mark_all_tiles_dirty( bg_tilemap ); | |
| 185 | state->bg_tile_bank = bank; | |
| 186 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 176 | 187 | } |
| 177 | 188 | |
| 178 | bank = lkage_vreg[0]&0x04; | |
| 179 | if( fg_tile_bank != bank ) | |
| 189 | bank = state->vreg[0]&0x04; | |
| 190 | if (state->fg_tile_bank != bank) | |
| 180 | 191 | { |
| 181 | fg_tile_bank = bank; | |
| 182 | tilemap_mark_all_tiles_dirty( fg_tilemap ); | |
| 192 | state->fg_tile_bank = bank; | |
| 193 | tilemap_mark_all_tiles_dirty(state->fg_tilemap); | |
| 183 | 194 | } |
| 184 | 195 | |
| 185 | tilemap_set_palette_offset( bg_tilemap, 0x300 + (lkage_vreg[1]&0xf0) ); | |
| 186 | tilemap_set_palette_offset( fg_tilemap, 0x200 + (lkage_vreg[1]&0xf0) ); | |
| 187 | tilemap_set_palette_offset( tx_tilemap, 0x110 ); | |
| 196 | tilemap_set_palette_offset(state->bg_tilemap, 0x300 + (state->vreg[1] & 0xf0)); | |
| 197 | tilemap_set_palette_offset(state->fg_tilemap, 0x200 + (state->vreg[1] & 0xf0)); | |
| 198 | tilemap_set_palette_offset(state->tx_tilemap, 0x110); | |
| 188 | 199 | |
| 189 | tilemap_set_scrollx(tx_tilemap,0,lkage_scroll[0]); | |
| 190 | tilemap_set_scrolly(tx_tilemap,0,lkage_scroll[1]); | |
| 200 | tilemap_set_scrollx(state->tx_tilemap, 0, state->scroll[0]); | |
| 201 | tilemap_set_scrolly(state->tx_tilemap, 0, state->scroll[1]); | |
| 191 | 202 | |
| 192 | tilemap_set_scrollx(fg_tilemap,0,lkage_scroll[2]); | |
| 193 | tilemap_set_scrolly(fg_tilemap,0,lkage_scroll[3]); | |
| 203 | tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[2]); | |
| 204 | tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll[3]); | |
| 194 | 205 | |
| 195 | tilemap_set_scrollx(bg_tilemap,0,lkage_scroll[4]); | |
| 196 | tilemap_set_scrolly(bg_tilemap,0,lkage_scroll[5]); | |
| 206 | tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll[4]); | |
| 207 | tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll[5]); | |
| 197 | 208 | |
| 198 | 209 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); |
| 199 | if (( | |
| 210 | if ((state->vreg[2] & 0xf0) == 0xf0) | |
| 200 | 211 | { |
| 201 | tilemap_draw( bitmap,cliprect,bg_tilemap,0,1 ); | |
| 202 | tilemap_draw( bitmap,cliprect,fg_tilemap,0,(lkage_vreg[1]&2)?2:4 ); | |
| 203 | tilemap_draw( bitmap,cliprect,tx_tilemap,0,4 ); | |
| 212 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1); | |
| 213 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, (state->vreg[1] & 2) ? 2 : 4); | |
| 214 | tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4); | |
| 204 | 215 | } |
| 205 | 216 | else |
| 206 | 217 | { |
| 207 | tilemap_draw( | |
| 218 | tilemap_draw( | |
| 208 | 219 | } |
| 209 | draw_sprites(screen->machine, bitmap,cliprect | |
| 220 | draw_sprites(screen->machine, bitmap, cliprect | |
| 210 | 221 | return 0; |
| 211 | 222 | } |
| r7500 | r7501 | |
|---|---|---|
| 2 | 2 | #include "includes/news.h" |
| 3 | 3 | |
| 4 | 4 | |
| 5 | UINT8 *news_fgram; | |
| 6 | UINT8 *news_bgram; | |
| 7 | ||
| 8 | static int bgpic; | |
| 9 | static tilemap_t *fg_tilemap, *bg_tilemap; | |
| 10 | ||
| 11 | ||
| 12 | ||
| 13 | 5 | /*************************************************************************** |
| 14 | 6 | |
| 15 | 7 | Callbacks for the TileMap code |
| r7500 | r7501 | |
| 18 | 10 | |
| 19 | 11 | static TILE_GET_INFO( get_fg_tile_info ) |
| 20 | 12 | { |
| 21 | int code = (news_fgram[tile_index*2] << 8) | news_fgram[tile_index*2+1]; | |
| 13 | news_state *state = (news_state *)machine->driver_data; | |
| 14 | int code = (state->fgram[tile_index * 2] << 8) | state->fgram[tile_index * 2 + 1]; | |
| 22 | 15 | SET_TILE_INFO( |
| 23 | 16 | 0, |
| 24 | 17 | code & 0x0fff, |
| r7500 | r7501 | |
| 28 | 21 | |
| 29 | 22 | static TILE_GET_INFO( get_bg_tile_info ) |
| 30 | 23 | { |
| 31 | int code = (news_bgram[tile_index*2] << 8) | news_bgram[tile_index*2+1]; | |
| 24 | news_state *state = (news_state *)machine->driver_data; | |
| 25 | int code = (state->bgram[tile_index * 2] << 8) | state->bgram[tile_index * 2 + 1]; | |
| 32 | 26 | int color = (code & 0xf000) >> 12; |
| 33 | 27 | |
| 34 | 28 | code &= 0x0fff; |
| 35 | if ((code & 0x0e00) == 0x0e00) code = (code & 0x1ff) | (bgpic << 9); | |
| 29 | if ((code & 0x0e00) == 0x0e00) | |
| 30 | code = (code & 0x1ff) | (state->bgpic << 9); | |
| 36 | 31 | |
| 37 | 32 | SET_TILE_INFO( |
| 38 | 33 | 0, |
| r7500 | r7501 | |
| 51 | 46 | |
| 52 | 47 | VIDEO_START( news ) |
| 53 | 48 | { |
| 49 | news_state *state = (news_state *)machine->driver_data; | |
| 54 | 50 | |
| 55 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32, 32); | |
| 56 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 51 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 52 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 57 | 53 | |
| 58 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,32, 32); | |
| 54 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 59 | 55 | } |
| 60 | 56 | |
| 61 | 57 | |
| r7500 | r7501 | |
| 68 | 64 | |
| 69 | 65 | WRITE8_HANDLER( news_fgram_w ) |
| 70 | 66 | { |
| 71 | news_fgram[offset] = data; | |
| 72 | tilemap_mark_tile_dirty(fg_tilemap,offset/2); | |
| 67 | news_state *state = (news_state *)space->machine->driver_data; | |
| 68 | ||
| 69 | state->fgram[offset] = data; | |
| 70 | tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2); | |
| 73 | 71 | } |
| 74 | 72 | |
| 75 | 73 | WRITE8_HANDLER( news_bgram_w ) |
| 76 | 74 | { |
| 77 | news_bgram[offset] = data; | |
| 78 | tilemap_mark_tile_dirty(bg_tilemap,offset/2); | |
| 75 | news_state *state = (news_state *)space->machine->driver_data; | |
| 76 | ||
| 77 | state->bgram[offset] = data; | |
| 78 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | WRITE8_HANDLER( news_bgpic_w ) |
| 82 | 82 | { |
| 83 | if (bgpic != data) | |
| 83 | news_state *state = (news_state *)space->machine->driver_data; | |
| 84 | ||
| 85 | if (state->bgpic != data) | |
| 84 | 86 | { |
| 85 | bgpic = data; | |
| 86 | tilemap_mark_all_tiles_dirty(bg_tilemap); | |
| 87 | state->bgpic = data; | |
| 88 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 87 | 89 | } |
| 88 | 90 | } |
| 89 | 91 | |
| r7500 | r7501 | |
| 97 | 99 | |
| 98 | 100 | VIDEO_UPDATE( news ) |
| 99 | 101 | { |
| 100 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 101 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 102 | news_state *state = (news_state *)screen->machine->driver_data; | |
| 103 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 104 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 102 | 105 | return 0; |
| 103 | 106 | } |
| r7500 | r7501 | |
|---|---|---|
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "emu.h" |
| 22 | #include "includes/metlclsh.h" | |
| 22 | 23 | |
| 23 | /* Local variables: */ | |
| 24 | 24 | |
| 25 | static tilemap_t *bg_tilemap,*fg_tilemap; | |
| 26 | ||
| 27 | static UINT8 metlclsh_write_mask, *metlclsh_otherram; | |
| 28 | ||
| 29 | /* Variables that driver has access to: */ | |
| 30 | ||
| 31 | UINT8 *metlclsh_bgram, *metlclsh_fgram, *metlclsh_scrollx; | |
| 32 | ||
| 33 | /* Functions that driver has access to: */ | |
| 34 | ||
| 35 | 25 | WRITE8_HANDLER( metlclsh_rambank_w ) |
| 36 | 26 | { |
| 27 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 28 | ||
| 37 | 29 | if (data & 1) |
| 38 | 30 | { |
| 39 | metlclsh_write_mask = 0; | |
| 40 | memory_set_bankptr(space->machine, "bank1", metlclsh_bgram); | |
| 31 | state->write_mask = 0; | |
| 32 | memory_set_bankptr(space->machine, "bank1", state->bgram); | |
| 41 | 33 | } |
| 42 | 34 | else |
| 43 | 35 | { |
| 44 | metlclsh_write_mask = 1 << (data >> 1); | |
| 45 | memory_set_bankptr(space->machine, "bank1", metlclsh_otherram); | |
| 36 | state->write_mask = 1 << (data >> 1); | |
| 37 | memory_set_bankptr(space->machine, "bank1", state->otherram); | |
| 46 | 38 | } |
| 47 | 39 | } |
| 48 | 40 | |
| 49 | static UINT8 metlclsh_gfxbank; | |
| 50 | 41 | WRITE8_HANDLER( metlclsh_gfxbank_w ) |
| 51 | 42 | { |
| 52 | if (!(data & 4) && (metlclsh_gfxbank != data)) | |
| 43 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 44 | ||
| 45 | if (!(data & 4) && (state->gfxbank != data)) | |
| 53 | 46 | { |
| 54 | tilemap_mark_all_tiles_dirty(bg_tilemap); | |
| 55 | metlclsh_gfxbank = data & 3; | |
| 47 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 48 | state->gfxbank = data & 3; | |
| 56 | 49 | } |
| 57 | 50 | } |
| 58 | 51 | |
| r7500 | r7501 | |
| 80 | 73 | |
| 81 | 74 | static TILE_GET_INFO( get_bg_tile_info ) |
| 82 | 75 | { |
| 83 | SET_TILE_INFO(1, metlclsh_bgram[tile_index] + (metlclsh_gfxbank << 7),0,0); | |
| 76 | metlclsh_state *state = (metlclsh_state *)machine->driver_data; | |
| 77 | SET_TILE_INFO(1, state->bgram[tile_index] + (state->gfxbank << 7), 0, 0); | |
| 84 | 78 | } |
| 85 | 79 | |
| 86 | 80 | WRITE8_HANDLER( metlclsh_bgram_w ) |
| 87 | 81 | { |
| 82 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 83 | ||
| 88 | 84 | /* This ram is banked: it's either the tilemap (e401 = 1) |
| 89 | 85 | or bit n of another area (e401 = n << 1)? (that I don't understand) */ |
| 90 | if ( | |
| 86 | if ( | |
| 91 | 87 | { |
| 92 | 88 | /* unknown area - the following is almost surely wrong */ |
| 93 | 89 | // 405b (e401 = e c a 8 6 4 2 0) writes d400++ |
| r7500 | r7501 | |
| 95 | 91 | // 4085 (e401 = e a 6 2) writes d000++ |
| 96 | 92 | // 405b (e401 = e a 6 2) writes d000++ |
| 97 | 93 | |
| 98 | // metlclsh_otherram[offset] |= (data & metlclsh_write_mask); | |
| 99 | metlclsh_otherram[offset] = (metlclsh_otherram[offset] & ~metlclsh_write_mask) | (data & metlclsh_write_mask); | |
| 94 | // state->otherram[offset] |= (data & state->write_mask); | |
| 95 | state->otherram[offset] = (state->otherram[offset] & ~state->write_mask) | (data & state->write_mask); | |
| 100 | 96 | } |
| 101 | 97 | else |
| 102 | 98 | { |
| 103 | 99 | /* tilemap */ |
| 104 | metlclsh_bgram[offset] = data; | |
| 105 | tilemap_mark_tile_dirty(bg_tilemap,offset & 0x1ff); | |
| 100 | state->bgram[offset] = data; | |
| 101 | tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x1ff); | |
| 106 | 102 | } |
| 107 | 103 | } |
| 108 | 104 | |
| r7500 | r7501 | |
| 121 | 117 | |
| 122 | 118 | static TILE_GET_INFO( get_fg_tile_info ) |
| 123 | 119 | { |
| 124 | UINT8 code = metlclsh_fgram[tile_index + 0x000]; | |
| 125 | UINT8 attr = metlclsh_fgram[tile_index + 0x400]; | |
| 120 | metlclsh_state *state = (metlclsh_state *)machine->driver_data; | |
| 121 | UINT8 code = state->fgram[tile_index + 0x000]; | |
| 122 | UINT8 attr = state->fgram[tile_index + 0x400]; | |
| 126 | 123 | SET_TILE_INFO(2, code + ((attr & 0x03) << 8), (attr >> 5) & 3, 0); |
| 127 | 124 | tileinfo->category = ((attr & 0x80) ? 1 : 2); |
| 128 | 125 | } |
| 129 | 126 | |
| 130 | 127 | WRITE8_HANDLER( metlclsh_fgram_w ) |
| 131 | 128 | { |
| 132 | metlclsh_fgram[offset] = data; | |
| 133 | tilemap_mark_tile_dirty(fg_tilemap,offset & 0x3ff); | |
| 129 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 130 | state->fgram[offset] = data; | |
| 131 | tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff); | |
| 134 | 132 | } |
| 135 | 133 | |
| 136 | 134 | |
| r7500 | r7501 | |
| 142 | 140 | |
| 143 | 141 | VIDEO_START( metlclsh ) |
| 144 | 142 | { |
| 145 | metlclsh_ | |
| 143 | metlclsh_state *state = (met | |
| 146 | 144 | |
| 147 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,metlclsh_bgtilemap_scan,16,16,32,16); | |
| 148 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 145 | state->otherram = auto_alloc_array(machine, UINT8, 0x800); // banked ram | |
| 149 | 146 | |
| 150 | tilemap_set_transparent_pen( bg_tilemap, 0 ); | |
| 151 | tilemap_set_transparent_pen( fg_tilemap, 0 ); | |
| 147 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, metlclsh_bgtilemap_scan, 16, 16, 32, 16); | |
| 148 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 149 | ||
| 150 | tilemap_set_transparent_pen(state->bg_tilemap, 0); | |
| 151 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 152 | ||
| 153 | state_save_register_global_pointer(machine, state->otherram, 0x800); | |
| 152 | 154 | } |
| 153 | 155 | |
| 154 | 156 | |
| r7500 | r7501 | |
| 172 | 174 | |
| 173 | 175 | ***************************************************************************/ |
| 174 | 176 | |
| 175 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 177 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 176 | 178 | { |
| 177 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 179 | metlclsh_state *state = (metlclsh_state *)machine->driver_data; | |
| 180 | UINT8 *spriteram = state->spriteram; | |
| 178 | 181 | gfx_element *gfx = machine->gfx[0]; |
| 179 | 182 | int offs; |
| 180 | 183 | |
| 181 | for (offs = 0;offs < | |
| 184 | for (offs = 0; offs < stat | |
| 182 | 185 | { |
| 183 | int attr,code,color,sx,sy,flipx,flipy,wrapy,sizey; | |
| 186 | int attr, code, color, sx, sy, flipx, flipy, wrapy, sizey; | |
| 184 | 187 | |
| 185 | attr = spriteram[offs]; | |
| 186 | if (!(attr & 0x01)) continue; // enable | |
| 188 | attr = spriteram[offs]; | |
| 189 | if (!(attr & 0x01)) | |
| 190 | continue; // enable | |
| 187 | 191 | |
| 188 | flipy = (attr & 0x02); | |
| 189 | flipx = (attr & 0x04); | |
| 190 | color = (attr & 0x08) >> 3; | |
| 191 | sizey = (attr & 0x10); // double height | |
| 192 | code = ((attr & 0x60) << 3) + spriteram[offs+1]; | |
| 192 | flipy = (attr & 0x02); | |
| 193 | flipx = (attr & 0x04); | |
| 194 | color = (attr & 0x08) >> 3; | |
| 195 | sizey = (attr & 0x10); // double height | |
| 196 | code = ((attr & 0x60) << 3) + spriteram[offs + 1]; | |
| 193 | 197 | |
| 194 | sx = 240 - spriteram[offs+3]; | |
| 195 | if (sx < -7) sx += 256; | |
| 196 | sy = 240 - spriteram[offs+2]; | |
| 198 | sx = 240 - spriteram[offs + 3]; | |
| 199 | if (sx < -7) | |
| 200 | sx += 256; | |
| 197 | 201 | |
| 202 | sy = 240 - spriteram[offs + 2]; | |
| 203 | ||
| 198 | 204 | if (flip_screen_get(machine)) |
| 199 | 205 | { |
| 200 | 206 | sx = 240 - sx; flipx = !flipx; |
| 201 | sy = 240 - sy; flipy = !flipy; if (sizey) sy+=16; | |
| 207 | sy = 240 - sy; flipy = !flipy; if (sizey) sy += 16; | |
| 202 | 208 | if (sy > 240) sy -= 256; |
| 203 | 209 | } |
| 204 | 210 | |
| 205 | 211 | /* Draw twice, at sy and sy + 256 (wrap around) */ |
| 206 | for ( | |
| 212 | for ( | |
| 207 | 213 | { |
| 208 | 214 | if (sizey) |
| 209 | 215 | { |
| r7500 | r7501 | |
| 238 | 244 | |
| 239 | 245 | VIDEO_UPDATE( metlclsh ) |
| 240 | 246 | { |
| 241 | | |
| 247 | | |
| 242 | 248 | |
| 243 | tilemap_draw(bitmap,cliprect,fg_tilemap,1,0); // low priority tiles of foreground | |
| 244 | if (metlclsh_scrollx[0] & 0x08) // background (if enabled) | |
| 249 | bitmap_fill(bitmap, cliprect, 0x10); | |
| 250 | ||
| 251 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 1, 0); // low priority tiles of foreground | |
| 252 | ||
| 253 | if (state->scrollx[0] & 0x08) // background (if enabled) | |
| 245 | 254 | { |
| 246 | 255 | /* The background seems to be always flipped along x */ |
| 247 | tilemap_set_flip(bg_tilemap, (flip_screen_get(screen->machine) ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); | |
| 248 | tilemap_set_scrollx(bg_tilemap, 0,metlclsh_scrollx[1] + ((metlclsh_scrollx[0]&0x02)<<7) ); | |
| 249 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 256 | tilemap_set_flip(state->bg_tilemap, (flip_screen_get(screen->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); | |
| 257 | tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[1] + ((state->scrollx[0] & 0x02) << 7) ); | |
| 258 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 250 | 259 | } |
| 251 | draw_sprites(screen->machine,bitmap,cliprect); // sprites | |
| 252 | tilemap_draw(bitmap,cliprect,fg_tilemap,2,0); // high priority tiles of foreground | |
| 260 | draw_sprites(screen->machine, bitmap, cliprect); // sprites | |
| 261 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 2, 0); // high priority tiles of foreground | |
| 253 | 262 | |
| 254 | // popmessage("%02X", | |
| 263 | // popmessage("%02X", | |
| 255 | 264 | return 0; |
| 256 | 265 | } |
| 257 | 266 |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | #include "includes/deco16ic.h" | |
| 13 | #include "video/deco16ic.h" | |
| 14 | #include "includes/vaportra.h" | |
| 14 | 15 | |
| 15 | static UINT16 vaportra_priority[2]; | |
| 16 | ||
| 17 | 16 | /******************************************************************************/ |
| 18 | 17 | |
| 19 | static int vaportra_bank_callback(const int bank) | |
| 20 | { | |
| 21 | return ((bank>>4)&0x7) * 0x1000; | |
| 22 | } | |
| 23 | ||
| 24 | ||
| 25 | VIDEO_START( vaportra ) | |
| 26 | { | |
| 27 | deco16_2_video_init(machine, 0); | |
| 28 | ||
| 29 | deco16_pf1_rowscroll = 0; | |
| 30 | deco16_pf2_rowscroll = 0; | |
| 31 | deco16_pf3_rowscroll = 0; | |
| 32 | deco16_pf4_rowscroll = 0; | |
| 33 | ||
| 34 | deco16_set_tilemap_bank_callback(0, vaportra_bank_callback); | |
| 35 | deco16_set_tilemap_bank_callback(1, vaportra_bank_callback); | |
| 36 | deco16_set_tilemap_bank_callback(2, vaportra_bank_callback); | |
| 37 | deco16_set_tilemap_bank_callback(3, vaportra_bank_callback); | |
| 38 | ||
| 39 | deco16_pf1_colour_bank=0x00; | |
| 40 | deco16_pf2_colour_bank=0x20; | |
| 41 | deco16_pf4_colour_bank=0x40; | |
| 42 | deco16_pf3_colour_bank=0x30; | |
| 43 | } | |
| 44 | ||
| 45 | /******************************************************************************/ | |
| 46 | ||
| 47 | ||
| 48 | 18 | WRITE16_HANDLER( vaportra_priority_w ) |
| 49 | 19 | { |
| 50 | COMBINE_DATA(&vaportra_priority[offset]); | |
| 20 | vaportra_state *state = (vaportra_state *)space->machine->driver_data; | |
| 21 | COMBINE_DATA(&state->priority[offset]); | |
| 51 | 22 | } |
| 52 | 23 | |
| 53 | 24 | /******************************************************************************/ |
| 54 | 25 | |
| 55 | static void update_24bitcol(running_machine *machine, int offset) | |
| 26 | static void update_24bitcol( running_machine *machine, int offset ) | |
| 56 | 27 | { |
| 57 | UINT8 r,g,b; | |
| 28 | UINT8 r, g, b; | |
| 58 | 29 | |
| 59 | 30 | r = (machine->generic.paletteram.u16[offset] >> 0) & 0xff; |
| 60 | 31 | g = (machine->generic.paletteram.u16[offset] >> 8) & 0xff; |
| 61 | 32 | b = (machine->generic.paletteram2.u16[offset] >> 0) & 0xff; |
| 62 | 33 | |
| 63 | palette_set_color(machine,offset,MAKE_RGB(r,g,b)); | |
| 34 | palette_set_color(machine, offset, MAKE_RGB(r,g,b)); | |
| 64 | 35 | } |
| 65 | 36 | |
| 66 | 37 | WRITE16_HANDLER( vaportra_palette_24bit_rg_w ) |
| r7500 | r7501 | |
| 77 | 48 | |
| 78 | 49 | /******************************************************************************/ |
| 79 | 50 | |
| 80 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri) | |
| 51 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri ) | |
| 81 | 52 | { |
| 82 | UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16; | |
| 83 | int offs,priority_value; | |
| 53 | vaportra_state *state = (vaportra_state *)machine->driver_data; | |
| 54 | UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16; | |
| 55 | int offs; | |
| 56 | int priority_value = state->priority[1]; | |
| 84 | 57 | |
| 85 | priority_value=vaportra_priority[1]; | |
| 86 | ||
| 87 | for (offs = 0;offs < 0x400;offs += 4) | |
| 58 | for (offs = 0; offs < 0x400; offs += 4) | |
| 88 | 59 | { |
| 89 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 60 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 90 | 61 | |
| 91 | y = buffered_spriteram16[offs]; | |
| 92 | if ((y&0x8000) == 0) continue; | |
| 62 | y = buffered_spriteram[offs]; | |
| 63 | if ((y & 0x8000) == 0) | |
| 64 | continue; | |
| 93 | 65 | |
| 94 | sprite = buffered_spriteram16[offs+1] & 0x1fff; | |
| 95 | x = buffered_spriteram16[offs+2]; | |
| 96 | colour = (x >> 12) &0xf; | |
| 97 | if (pri && (colour>=priority_value)) continue; | |
| 98 | if (!pri && !(colour>=priority_value)) continue; | |
| 66 | sprite = buffered_spriteram[offs + 1] & 0x1fff; | |
| 67 | x = buffered_spriteram[offs + 2]; | |
| 68 | colour = (x >> 12) & 0xf; | |
| 69 | if (pri && (colour >= priority_value)) | |
| 70 | continue; | |
| 71 | if (!pri && !(colour >= priority_value)) | |
| 72 | continue; | |
| 99 | 73 | |
| 100 | flash=x&0x800; | |
| 101 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 74 | flash = x & 0x800; | |
| 75 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 76 | continue; | |
| 102 | 77 | |
| 103 | 78 | fx = y & 0x2000; |
| 104 | 79 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 111 | 86 | x = 240 - x; |
| 112 | 87 | y = 240 - y; |
| 113 | 88 | |
| 114 | if (x>256) continue; /* Speedup */ | |
| 89 | if (x > 256) | |
| 90 | continue; /* Speedup */ | |
| 115 | 91 | |
| 116 | 92 | sprite &= ~multi; |
| 117 | 93 | if (fy) |
| r7500 | r7501 | |
| 124 | 100 | |
| 125 | 101 | if (flip_screen_get(machine)) |
| 126 | 102 | { |
| 127 | y=240-y; | |
| 128 | x=240-x; | |
| 129 | if (fx) fx=0; else fx=1; | |
| 130 | if (fy) fy=0; else fy=1; | |
| 131 | mult=16; | |
| 103 | y = 240 - y; | |
| 104 | x = 240 - x; | |
| 105 | if (fx) fx = 0; else fx = 1; | |
| 106 | if (fy) fy = 0; else fy = 1; | |
| 107 | mult = 16; | |
| 132 | 108 | } |
| 133 | else mult=-16; | |
| 109 | else mult = -16; | |
| 134 | 110 | |
| 135 | 111 | while (multi >= 0) |
| 136 | 112 | { |
| r7500 | r7501 | |
| 148 | 124 | |
| 149 | 125 | VIDEO_UPDATE( vaportra ) |
| 150 | 126 | { |
| 151 | int pri=vaportra_priority[0] & 0x03; | |
| 127 | vaportra_state *state = (vaportra_state *)screen->machine->driver_data; | |
| 128 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 129 | int pri = state->priority[0] & 0x03; | |
| 152 | 130 | |
| 153 | flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) ); | |
| 131 | flip_screen_set(screen->machine, !BIT(flip, 7)); | |
| 132 | deco16ic_pf12_update(state->deco16ic, 0, 0); | |
| 133 | deco16ic_pf34_update(state->deco16ic, 0, 0); | |
| 154 | 134 | |
| 155 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 156 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 157 | ||
| 158 | 135 | /* Draw playfields */ |
| 159 | if (pri==0) { | |
| 160 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 161 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,0); | |
| 162 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 163 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 136 | if (pri == 0) | |
| 137 | { | |
| 138 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 139 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 140 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 141 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 164 | 142 | } |
| 165 | else if (pri==1) { | |
| 166 | deco16_tilemap_3_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 167 | deco16_tilemap_4_draw(screen,bitmap,cliprect,0,0); | |
| 168 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 169 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 143 | else if (pri == 1) | |
| 144 | { | |
| 145 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 146 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 147 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 148 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 170 | 149 | } |
| 171 | else if (pri==2) { | |
| 172 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 173 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 174 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 175 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,0); | |
| 150 | else if (pri == 2) | |
| 151 | { | |
| 152 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 153 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 154 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 155 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 176 | 156 | } |
| 177 | else { | |
| 178 | deco16_tilemap_3_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 179 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 180 | draw_sprites(screen->machine, bitmap,cliprect,0); | |
| 181 | deco16_tilemap_4_draw(screen,bitmap,cliprect,0,0); | |
| 157 | else | |
| 158 | { | |
| 159 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 160 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 161 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 162 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 182 | 163 | } |
| 183 | 164 | |
| 184 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 185 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 165 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 166 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 186 | 167 | return 0; |
| 187 | 168 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/mermaid.h" | |
| 2 | 3 | |
| 3 | static tilemap_t *bg_tilemap, *fg_tilemap; | |
| 4 | 4 | |
| 5 | UINT8* mermaid_videoram; | |
| 6 | UINT8* mermaid_colorram; | |
| 7 | UINT8* mermaid_videoram2; | |
| 8 | UINT8* mermaid_bg_scrollram; | |
| 9 | UINT8* mermaid_fg_scrollram; | |
| 10 | ||
| 11 | static bitmap_t* helper; | |
| 12 | static bitmap_t* helper2; | |
| 13 | static int coll_bit0,coll_bit1,coll_bit2,coll_bit3,coll_bit6; | |
| 14 | ||
| 15 | static int rougien_gfxbank1, rougien_gfxbank2; | |
| 16 | ||
| 17 | 5 | static const rectangle spritevisiblearea = |
| 18 | 6 | { |
| 19 | 0*8, 26*8-1, | |
| 20 | 2*8, 30*8-1 | |
| 7 | 0 * 8, 26 * 8 - 1, | |
| 8 | 2 * 8, 30 * 8 - 1 | |
| 21 | 9 | }; |
| 22 | 10 | |
| 23 | 11 | static const rectangle flip_spritevisiblearea = |
| 24 | 12 | { |
| 25 | 6*8, 31*8-1, | |
| 26 | 2*8, 30*8-1 | |
| 13 | 6 * 8, 31 * 8 - 1, | |
| 14 | 2 * 8, 30 * 8 - 1 | |
| 27 | 15 | }; |
| 28 | 16 | |
| 29 | 17 | PALETTE_INIT( mermaid ) |
| r7500 | r7501 | |
| 58 | 46 | |
| 59 | 47 | WRITE8_HANDLER( mermaid_videoram2_w ) |
| 60 | 48 | { |
| 61 | mermaid_videoram2[offset] = data; | |
| 62 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 49 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 50 | state->videoram2[offset] = data; | |
| 51 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 63 | 52 | } |
| 64 | 53 | |
| 65 | 54 | WRITE8_HANDLER( mermaid_videoram_w ) |
| 66 | 55 | { |
| 67 | mermaid_videoram[offset] = data; | |
| 68 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 56 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 57 | state->videoram[offset] = data; | |
| 58 | tilemap_mark_tile_dirty(state->fg_tilemap, offset); | |
| 69 | 59 | } |
| 70 | 60 | |
| 71 | 61 | WRITE8_HANDLER( mermaid_colorram_w ) |
| 72 | 62 | { |
| 73 | mermaid_colorram[offset] = data; | |
| 74 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 63 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 64 | state->colorram[offset] = data; | |
| 65 | tilemap_mark_tile_dirty(state->fg_tilemap, offset); | |
| 75 | 66 | } |
| 76 | 67 | |
| 77 | 68 | WRITE8_HANDLER( mermaid_flip_screen_x_w ) |
| r7500 | r7501 | |
| 86 | 77 | |
| 87 | 78 | WRITE8_HANDLER( mermaid_bg_scroll_w ) |
| 88 | 79 | { |
| 89 | mermaid_bg_scrollram[offset] = data; | |
| 90 | tilemap_set_scrolly(bg_tilemap, offset, data); | |
| 80 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 81 | state->bg_scrollram[offset] = data; | |
| 82 | tilemap_set_scrolly(state->bg_tilemap, offset, data); | |
| 91 | 83 | } |
| 92 | 84 | |
| 93 | 85 | WRITE8_HANDLER( mermaid_fg_scroll_w ) |
| 94 | 86 | { |
| 95 | mermaid_fg_scrollram[offset] = data; | |
| 96 | tilemap_set_scrolly(fg_tilemap, offset, data); | |
| 87 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 88 | state->fg_scrollram[offset] = data; | |
| 89 | tilemap_set_scrolly(state->fg_tilemap, offset, data); | |
| 97 | 90 | } |
| 98 | 91 | |
| 99 | 92 | WRITE8_HANDLER( rougien_gfxbankswitch1_w ) |
| 100 | 93 | { |
| 101 | rougien_gfxbank1 = data & 0x01; | |
| 94 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 95 | state->rougien_gfxbank1 = data & 0x01; | |
| 102 | 96 | } |
| 103 | 97 | |
| 104 | 98 | WRITE8_HANDLER( rougien_gfxbankswitch2_w ) |
| 105 | 99 | { |
| 106 | rougien_gfxbank2 = data & 0x01; | |
| 100 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 101 | state->rougien_gfxbank2 = data & 0x01; | |
| 107 | 102 | } |
| 108 | 103 | |
| 109 | 104 | READ8_HANDLER( mermaid_collision_r ) |
| r7500 | r7501 | |
| 123 | 118 | Bit 7 |
| 124 | 119 | */ |
| 125 | 120 | |
| 121 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 126 | 122 | int collision = 0xff; |
| 127 | 123 | |
| 128 | if(coll_bit0) collision &= 0xfe; | |
| 129 | if(coll_bit1) collision &= 0xfd; | |
| 130 | if(coll_bit2) collision &= 0xfb; | |
| 131 | if(coll_bit3) collision &= 0xf7; | |
| 132 | if(coll_bit6) collision &= 0xbf; | |
| 124 | if (state->coll_bit0) collision &= 0xfe; | |
| 125 | if (state->coll_bit1) collision &= 0xfd; | |
| 126 | if (state->coll_bit2) collision &= 0xfb; | |
| 127 | if (state->coll_bit3) collision &= 0xf7; | |
| 128 | if (state->coll_bit6) collision &= 0xbf; | |
| 133 | 129 | |
| 134 | 130 | return collision; |
| 135 | 131 | } |
| 136 | 132 | |
| 137 | 133 | static TILE_GET_INFO( get_bg_tile_info ) |
| 138 | 134 | { |
| 139 | int code = mermaid_videoram2[tile_index]; | |
| 135 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 136 | int code = state->videoram2[tile_index]; | |
| 140 | 137 | int sx = tile_index % 32; |
| 141 | 138 | int color = (sx >= 26) ? 0 : 1; |
| 142 | 139 | |
| r7500 | r7501 | |
| 145 | 142 | |
| 146 | 143 | static TILE_GET_INFO( get_fg_tile_info ) |
| 147 | 144 | { |
| 148 | int attr = mermaid_colorram[tile_index]; | |
| 149 | int code = mermaid_videoram[tile_index] + ((attr & 0x30) << 4); | |
| 145 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 146 | int attr = state->colorram[tile_index]; | |
| 147 | int code = state->videoram[tile_index] + ((attr & 0x30) << 4); | |
| 150 | 148 | int color = attr & 0x0f; |
| 151 | 149 | int flags = TILE_FLIPYX((attr & 0xc0) >> 6); |
| 152 | 150 | |
| 153 | code |= rougien_gfxbank1 * 0x2800; | |
| 154 | code |= rougien_gfxbank2 * 0x2400; | |
| 151 | code |= state->rougien_gfxbank1 * 0x2800; | |
| 152 | code |= state->rougien_gfxbank2 * 0x2400; | |
| 155 | 153 | |
| 156 | 154 | SET_TILE_INFO(0, code, color, flags); |
| 157 | 155 | } |
| 158 | 156 | |
| 159 | 157 | VIDEO_START( mermaid ) |
| 160 | 158 | { |
| 161 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 162 | tilemap_set_scroll_cols(bg_tilemap, 32); | |
| 159 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 163 | 160 | |
| 164 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 165 | tilemap_set_scroll_cols(fg_tilemap, 32); | |
| 166 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 161 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 162 | tilemap_set_scroll_cols(state->bg_tilemap, 32); | |
| 167 | 163 | |
| 168 | helper = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 169 | helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 164 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 165 | tilemap_set_scroll_cols(state->fg_tilemap, 32); | |
| 166 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 167 | ||
| 168 | state->helper = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 169 | state->helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 172 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 173 | 173 | { |
| 174 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 174 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 175 | UINT8 *spriteram = state->spriteram; | |
| 175 | 176 | int offs; |
| 176 | 177 | |
| 177 | for (offs = | |
| 178 | for (offs = stat | |
| 178 | 179 | { |
| 179 | 180 | int attr = spriteram[offs + 2]; |
| 180 | 181 | int bank = (attr & 0x30) >> 4; |
| r7500 | r7501 | |
| 187 | 188 | |
| 188 | 189 | if (sx >= 0xf0) sx -= 256; |
| 189 | 190 | |
| 190 | code |= rougien_gfxbank1 * 0x2800; | |
| 191 | code |= rougien_gfxbank2 * 0x2400; | |
| 191 | code |= state->rougien_gfxbank1 * 0x2800; | |
| 192 | code |= state->rougien_gfxbank2 * 0x2400; | |
| 192 | 193 | |
| 193 | 194 | if (flip_screen_x_get(machine)) |
| 194 | 195 | { |
| r7500 | r7501 | |
| 209 | 210 | |
| 210 | 211 | VIDEO_UPDATE( mermaid ) |
| 211 | 212 | { |
| 212 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 213 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 213 | mermaid_state *state = (mermaid_state *)screen->machine->driver_data; | |
| 214 | ||
| 215 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 216 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 214 | 217 | draw_sprites(screen->machine, bitmap, cliprect); |
| 215 | 218 | return 0; |
| 216 | 219 | } |
| 217 | 220 | |
| 218 | static UINT8 collision_check( | |
| 221 | static UINT8 collision_check( | |
| 219 | 222 | { |
| 223 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 220 | 224 | UINT8 data = 0; |
| 221 | 225 | |
| 222 | 226 | int x; |
| r7500 | r7501 | |
| 225 | 229 | for (y = rect->min_y; y <= rect->max_y; y++) |
| 226 | 230 | for (x = rect->min_x; x <= rect->max_x; x++) |
| 227 | 231 | { |
| 228 | UINT16 a = colortable_entry_get_value(colortable, *BITMAP_ADDR16(helper, y, x)); | |
| 229 | UINT16 b = colortable_entry_get_value(colortable, *BITMAP_ADDR16(helper2, y, x)); | |
| 232 | UINT16 a = colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper, y, x)); | |
| 233 | UINT16 b = colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper2, y, x)); | |
| 230 | 234 | |
| 231 | 235 | if (b != 0) |
| 232 | 236 | if ((a != 0) & (a != 0x40)) |
| r7500 | r7501 | |
| 238 | 242 | |
| 239 | 243 | VIDEO_EOF( mermaid ) |
| 240 | 244 | { |
| 245 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 241 | 246 | const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen); |
| 242 | UINT8 *spriteram = | |
| 247 | UINT8 *spriteram = stat | |
| 243 | 248 | |
| 244 | int offs,offs2; | |
| 249 | int offs, offs2; | |
| 245 | 250 | |
| 246 | coll_bit1 = 0; | |
| 247 | coll_bit2 = 0; | |
| 248 | coll_bit3 = 0; | |
| 249 | coll_bit6 = 0; | |
| 250 | coll_bit0 = 0; | |
| 251 | state->coll_bit1 = 0; | |
| 252 | state->coll_bit2 = 0; | |
| 253 | state->coll_bit3 = 0; | |
| 254 | state->coll_bit6 = 0; | |
| 255 | state->coll_bit0 = 0; | |
| 251 | 256 | |
| 252 | 257 | // check for bit 0 (sprite-sprite), 1 (sprite-foreground), 2 (sprite-background) |
| 253 | 258 | |
| 254 | for (offs = | |
| 259 | for (offs = stat | |
| 255 | 260 | { |
| 256 | 261 | int attr = spriteram[offs + 2]; |
| 257 | 262 | int bank = (attr & 0x30) >> 4; |
| r7500 | r7501 | |
| 266 | 271 | |
| 267 | 272 | if (coll != 1) continue; |
| 268 | 273 | |
| 269 | code |= rougien_gfxbank1 * 0x2800; | |
| 270 | code |= rougien_gfxbank2 * 0x2400; | |
| 274 | code |= state->rougien_gfxbank1 * 0x2800; | |
| 275 | code |= state->rougien_gfxbank2 * 0x2400; | |
| 271 | 276 | |
| 272 | 277 | if (flip_screen_x_get(machine)) |
| 273 | 278 | { |
| r7500 | r7501 | |
| 297 | 302 | |
| 298 | 303 | // check collision sprite - background |
| 299 | 304 | |
| 300 | bitmap_fill(helper,&rect,0); | |
| 301 | bitmap_fill(helper2,&rect,0); | |
| 305 | bitmap_fill(state->helper, &rect, 0); | |
| 306 | bitmap_fill(state->helper2, &rect, 0); | |
| 302 | 307 | |
| 303 | tilemap_draw(helper, &rect, bg_tilemap, 0, 0); | |
| 308 | tilemap_draw(state->helper, &rect, state->bg_tilemap, 0, 0); | |
| 304 | 309 | |
| 305 | drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 310 | drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 306 | 311 | |
| 307 | coll_bit2 |= collision_check(machin | |
| 312 | state->coll_bit2 |= collision_check(machin | |
| 308 | 313 | |
| 309 | 314 | // check collision sprite - foreground |
| 310 | 315 | |
| 311 | bitmap_fill(helper,&rect,0); | |
| 312 | bitmap_fill(helper2,&rect,0); | |
| 316 | bitmap_fill(state->helper, &rect, 0); | |
| 317 | bitmap_fill(state->helper2, &rect, 0); | |
| 313 | 318 | |
| 314 | tilemap_draw(helper, &rect, fg_tilemap, 0, 0); | |
| 319 | tilemap_draw(state->helper, &rect, state->fg_tilemap, 0, 0); | |
| 315 | 320 | |
| 316 | drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 321 | drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 317 | 322 | |
| 318 | coll_bit1 |= collision_check(machin | |
| 323 | state->coll_bit1 |= collision_check(machin | |
| 319 | 324 | |
| 320 | 325 | // check collision sprite - sprite |
| 321 | 326 | |
| 322 | bitmap_fill(helper,&rect,0); | |
| 323 | bitmap_fill(helper2,&rect,0); | |
| 327 | bitmap_fill(state->helper, &rect, 0); | |
| 328 | bitmap_fill(state->helper2, &rect, 0); | |
| 324 | 329 | |
| 325 | for (offs2 = | |
| 330 | for (offs2 = stat | |
| 326 | 331 | if (offs != offs2) |
| 327 | 332 | { |
| 328 | 333 | int attr2 = spriteram[offs2 + 2]; |
| r7500 | r7501 | |
| 336 | 341 | |
| 337 | 342 | if (coll2 != 0) continue; |
| 338 | 343 | |
| 339 | code2 |= rougien_gfxbank1 * 0x2800; | |
| 340 | code2 |= rougien_gfxbank2 * 0x2400; | |
| 344 | code2 |= state->rougien_gfxbank1 * 0x2800; | |
| 345 | code2 |= state->rougien_gfxbank2 * 0x2400; | |
| 341 | 346 | |
| 342 | 347 | if (flip_screen_x_get(machine)) |
| 343 | 348 | { |
| r7500 | r7501 | |
| 351 | 356 | sy2 = 240 - sy2; |
| 352 | 357 | } |
| 353 | 358 | |
| 354 | drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 359 | drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 355 | 360 | } |
| 356 | 361 | |
| 357 | drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 362 | drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 358 | 363 | |
| 359 | coll_bit0 |= collision_check(machin | |
| 364 | state->coll_bit0 |= collision_check(machin | |
| 360 | 365 | } |
| 361 | 366 | |
| 362 | 367 | // check for bit 3 (sprite-sprite) |
| 363 | 368 | |
| 364 | for (offs = | |
| 369 | for (offs = stat | |
| 365 | 370 | { |
| 366 | 371 | int attr = spriteram[offs + 2]; |
| 367 | 372 | int bank = (attr & 0x30) >> 4; |
| r7500 | r7501 | |
| 376 | 381 | |
| 377 | 382 | if (coll != 2) continue; |
| 378 | 383 | |
| 379 | code |= rougien_gfxbank1 * 0x2800; | |
| 380 | code |= rougien_gfxbank2 * 0x2400; | |
| 384 | code |= state->rougien_gfxbank1 * 0x2800; | |
| 385 | code |= state->rougien_gfxbank2 * 0x2400; | |
| 381 | 386 | |
| 382 | 387 | if (flip_screen_x_get(machine)) |
| 383 | 388 | { |
| r7500 | r7501 | |
| 407 | 412 | |
| 408 | 413 | // check collision sprite - sprite |
| 409 | 414 | |
| 410 | bitmap_fill(helper,&rect,0); | |
| 411 | bitmap_fill(helper2,&rect,0); | |
| 415 | bitmap_fill(state->helper, &rect, 0); | |
| 416 | bitmap_fill(state->helper2, &rect, 0); | |
| 412 | 417 | |
| 413 | for (offs2 = | |
| 418 | for (offs2 = stat | |
| 414 | 419 | if (offs != offs2) |
| 415 | 420 | { |
| 416 | 421 | int attr2 = spriteram[offs2 + 2]; |
| r7500 | r7501 | |
| 424 | 429 | |
| 425 | 430 | if (coll2 != 0) continue; |
| 426 | 431 | |
| 427 | code2 |= rougien_gfxbank1 * 0x2800; | |
| 428 | code2 |= rougien_gfxbank2 * 0x2400; | |
| 432 | code2 |= state->rougien_gfxbank1 * 0x2800; | |
| 433 | code2 |= state->rougien_gfxbank2 * 0x2400; | |
| 429 | 434 | |
| 430 | 435 | if (flip_screen_x_get(machine)) |
| 431 | 436 | { |
| r7500 | r7501 | |
| 439 | 444 | sy2 = 240 - sy2; |
| 440 | 445 | } |
| 441 | 446 | |
| 442 | drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 447 | drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 443 | 448 | } |
| 444 | 449 | |
| 445 | drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 450 | drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 446 | 451 | |
| 447 | coll_bit3 |= collision_check(machin | |
| 452 | state->coll_bit3 |= collision_check(machin | |
| 448 | 453 | } |
| 449 | 454 | |
| 450 | 455 | // check for bit 6 |
| 451 | 456 | |
| 452 | for (offs = | |
| 457 | for (offs = stat | |
| 453 | 458 | { |
| 454 | 459 | int attr = spriteram[offs + 2]; |
| 455 | 460 | int bank = (attr & 0x30) >> 4; |
| r7500 | r7501 | |
| 464 | 469 | |
| 465 | 470 | if (coll != 1) continue; |
| 466 | 471 | |
| 467 | code |= rougien_gfxbank1 * 0x2800; | |
| 468 | code |= rougien_gfxbank2 * 0x2400; | |
| 472 | code |= state->rougien_gfxbank1 * 0x2800; | |
| 473 | code |= state->rougien_gfxbank2 * 0x2400; | |
| 469 | 474 | |
| 470 | 475 | if (flip_screen_x_get(machine)) |
| 471 | 476 | { |
| r7500 | r7501 | |
| 495 | 500 | |
| 496 | 501 | // check collision sprite - sprite |
| 497 | 502 | |
| 498 | bitmap_fill(helper,&rect,0); | |
| 499 | bitmap_fill(helper2,&rect,0); | |
| 503 | bitmap_fill(state->helper, &rect, 0); | |
| 504 | bitmap_fill(state->helper2, &rect, 0); | |
| 500 | 505 | |
| 501 | for (offs2 = | |
| 506 | for (offs2 = stat | |
| 502 | 507 | if (offs != offs2) |
| 503 | 508 | { |
| 504 | 509 | int attr2 = spriteram[offs2 + 2]; |
| r7500 | r7501 | |
| 512 | 517 | |
| 513 | 518 | if (coll2 != 2) continue; |
| 514 | 519 | |
| 515 | code2 |= rougien_gfxbank1 * 0x2800; | |
| 516 | code2 |= rougien_gfxbank2 * 0x2400; | |
| 520 | code2 |= state->rougien_gfxbank1 * 0x2800; | |
| 521 | code2 |= state->rougien_gfxbank2 * 0x2400; | |
| 517 | 522 | |
| 518 | 523 | if (flip_screen_x_get(machine)) |
| 519 | 524 | { |
| r7500 | r7501 | |
| 527 | 532 | sy2 = 240 - sy2; |
| 528 | 533 | } |
| 529 | 534 | |
| 530 | drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 535 | drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); | |
| 531 | 536 | } |
| 532 | 537 | |
| 533 | drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 538 | drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0); | |
| 534 | 539 | |
| 535 | coll_bit6 |= collision_check(machin | |
| 540 | state->coll_bit6 |= collision_check(machin | |
| 536 | 541 | } |
| 537 | 542 | |
| 538 | 543 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/othldrby.h" | |
| 2 | 3 | |
| 3 | 4 | |
| 5 | #define VIDEORAM_SIZE 0x1c00 | |
| 6 | #define SPRITERAM_START 0x1800 | |
| 7 | #define SPRITERAM_SIZE (VIDEORAM_SIZE - SPRITERAM_START) | |
| 4 | 8 | |
| 5 | #define VIDEORAM_SIZE 0x1c00 | |
| 6 | #define SPRITERAM_START 0x1800 | |
| 7 | #define SPRITERAM_SIZE (VIDEORAM_SIZE-SPRITERAM_START) | |
| 8 | 9 | |
| 9 | static UINT16 *vram,*buf_spriteram,*buf_spriteram2; | |
| 10 | ||
| 11 | #define VREG_SIZE 18 | |
| 12 | static UINT16 vreg[VREG_SIZE]; | |
| 13 | ||
| 14 | static tilemap_t *bg_tilemap[3]; | |
| 15 | ||
| 16 | ||
| 17 | 10 | /*************************************************************************** |
| 18 | 11 | |
| 19 | 12 | Callbacks for the TileMap code |
| 20 | 13 | |
| 21 | 14 | ***************************************************************************/ |
| 22 | 15 | |
| 23 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int plane) | |
| 16 | INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int plane ) | |
| 24 | 17 | { |
| 18 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 25 | 19 | UINT16 attr; |
| 26 | 20 | |
| 27 | tile_index = 2*tile_index + 0x800*plane; | |
| 28 | attr = vram[tile_index]; | |
| 21 | tile_index = 2 * tile_index + 0x800 * plane; | |
| 22 | attr = state->vram[tile_index]; | |
| 29 | 23 | SET_TILE_INFO( |
| 30 | 24 | 1, |
| 31 | vram[tile_index+1], | |
| 25 | state->vram[tile_index + 1], | |
| 32 | 26 | attr & 0x7f, |
| 33 | 27 | 0); |
| 34 | 28 | tileinfo->category = (attr & 0x0600) >> 9; |
| r7500 | r7501 | |
| 36 | 30 | |
| 37 | 31 | static TILE_GET_INFO( get_tile_info0 ) |
| 38 | 32 | { |
| 39 | get_tile_info(machine,tileinfo,tile_index,0); | |
| 33 | get_tile_info(machine, tileinfo, tile_index, 0); | |
| 40 | 34 | } |
| 41 | 35 | |
| 42 | 36 | static TILE_GET_INFO( get_tile_info1 ) |
| 43 | 37 | { |
| 44 | get_tile_info(machine,tileinfo,tile_index,1); | |
| 38 | get_tile_info(machine, tileinfo, tile_index, 1); | |
| 45 | 39 | } |
| 46 | 40 | |
| 47 | 41 | static TILE_GET_INFO( get_tile_info2 ) |
| 48 | 42 | { |
| 49 | get_tile_info(machine,tileinfo,tile_index,2); | |
| 43 | get_tile_info(machine, tileinfo, tile_index, 2); | |
| 50 | 44 | } |
| 51 | 45 | |
| 52 | 46 | |
| r7500 | r7501 | |
| 59 | 53 | |
| 60 | 54 | VIDEO_START( othldrby ) |
| 61 | 55 | { |
| 62 | bg_tilemap[0] = tilemap_create(machine, get_tile_info0,tilemap_scan_rows,16,16,32,32); | |
| 63 | bg_tilemap[1] = tilemap_create(machine, get_tile_info1,tilemap_scan_rows,16,16,32,32); | |
| 64 | bg_tilemap[2] = tilemap_create(machine, get_tile_info2,tilemap_scan_rows,16,16,32,32); | |
| 56 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 65 | 57 | |
| 66 | vram = auto_alloc_array(machine, UINT16, VIDEORAM_SIZE); | |
| 67 | buf_spriteram = auto_alloc_array(machine, UINT16, 2*SPRITERAM_SIZE); | |
| 58 | state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 16, 16, 32, 32); | |
| 59 | state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 16, 16, 32, 32); | |
| 60 | state->bg_tilemap[2] = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 16, 16, 32, 32); | |
| 68 | 61 | |
| 69 | buf_spriteram2 = buf_spriteram + SPRITERAM_SIZE; | |
| 62 | state->vram = auto_alloc_array(machine, UINT16, VIDEORAM_SIZE); | |
| 63 | state->buf_spriteram = auto_alloc_array(machine, UINT16, 2 * SPRITERAM_SIZE); | |
| 64 | state->buf_spriteram2 = state->buf_spriteram + SPRITERAM_SIZE; | |
| 70 | 65 | |
| 71 | tilemap_set_transparent_pen(bg_tilemap[0],0); | |
| 72 | tilemap_set_transparent_pen(bg_tilemap[1],0); | |
| 73 | tilemap_set_transparent_pen(bg_tilemap[2],0); | |
| 66 | tilemap_set_transparent_pen(state->bg_tilemap[0], 0); | |
| 67 | tilemap_set_transparent_pen(state->bg_tilemap[1], 0); | |
| 68 | tilemap_set_transparent_pen(state->bg_tilemap[2], 0); | |
| 69 | ||
| 70 | state_save_register_global_pointer(machine, state->vram, VIDEORAM_SIZE); | |
| 71 | state_save_register_global_pointer(machine, state->buf_spriteram, 2 * SPRITERAM_SIZE); | |
| 74 | 72 | } |
| 75 | 73 | |
| 76 | 74 | |
| r7500 | r7501 | |
| 81 | 79 | |
| 82 | 80 | ***************************************************************************/ |
| 83 | 81 | |
| 84 | static UINT32 vram_addr,vreg_addr; | |
| 85 | ||
| 86 | 82 | WRITE16_HANDLER( othldrby_videoram_addr_w ) |
| 87 | 83 | { |
| 88 | vram_addr = data; | |
| 84 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 85 | state->vram_addr = data; | |
| 89 | 86 | } |
| 90 | 87 | |
| 91 | 88 | READ16_HANDLER( othldrby_videoram_r ) |
| 92 | 89 | { |
| 93 | if (vram_addr < VIDEORAM_SIZE) | |
| 94 | return vram[vram_addr++]; | |
| 90 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 91 | ||
| 92 | if (state->vram_addr < VIDEORAM_SIZE) | |
| 93 | return state->vram[state->vram_addr++]; | |
| 95 | 94 | else |
| 96 | 95 | { |
| 97 | popmessage("GFXRAM OUT OF BOUNDS %04x",vram_addr); | |
| 96 | popmessage("GFXRAM OUT OF BOUNDS %04x", state->vram_addr); | |
| 98 | 97 | return 0; |
| 99 | 98 | } |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | WRITE16_HANDLER( othldrby_videoram_w ) |
| 103 | 102 | { |
| 104 | if (vram_addr < VIDEORAM_SIZE) | |
| 103 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 104 | ||
| 105 | if (state->vram_addr < VIDEORAM_SIZE) | |
| 105 | 106 | { |
| 106 | if (vram_addr < SPRITERAM_START) | |
| 107 | tilemap_mark_tile_dirty(bg_tilemap[vram_addr/0x800],(vram_addr&0x7ff)/2); | |
| 108 | vram[vram_addr++] = data; | |
| 107 | if (state->vram_addr < SPRITERAM_START) | |
| 108 | tilemap_mark_tile_dirty(state->bg_tilemap[state->vram_addr / 0x800], (state->vram_addr & 0x7ff) / 2); | |
| 109 | state->vram[state->vram_addr++] = data; | |
| 109 | 110 | } |
| 110 | 111 | else |
| 111 | popmessage("GFXRAM OUT OF BOUNDS %04x",vram_addr); | |
| 112 | popmessage("GFXRAM OUT OF BOUNDS %04x", state->vram_addr); | |
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 115 | WRITE16_HANDLER( othldrby_vreg_addr_w ) |
| 115 | 116 | { |
| 116 | vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */ | |
| 117 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 118 | state->vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */ | |
| 117 | 119 | } |
| 118 | 120 | |
| 119 | 121 | WRITE16_HANDLER( othldrby_vreg_w ) |
| 120 | 122 | { |
| 121 | if (vreg_addr < VREG_SIZE) | |
| 122 | vreg[vreg_addr++] = data; | |
| 123 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 124 | ||
| 125 | if (state->vreg_addr < OTHLDRBY_VREG_SIZE) | |
| 126 | state->vreg[state->vreg_addr++] = data; | |
| 123 | 127 | else |
| 124 | popmessage("%06x: VREG OUT OF BOUNDS %04x",cpu_get_pc(space->cpu),vreg_addr); | |
| 128 | popmessage("%06x: VREG OUT OF BOUNDS %04x", cpu_get_pc(space->cpu), state->vreg_addr); | |
| 125 | 129 | } |
| 126 | 130 | |
| 127 | 131 | |
| r7500 | r7501 | |
| 132 | 136 | |
| 133 | 137 | ***************************************************************************/ |
| 134 | 138 | |
| 135 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int priority) | |
| 139 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority ) | |
| 136 | 140 | { |
| 141 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 137 | 142 | int offs; |
| 138 | 143 | |
| 139 | for (offs = 0;offs < SPRITERAM_SIZE;offs += 4) | |
| 144 | for (offs = 0; offs < SPRITERAM_SIZE; offs += 4) | |
| 140 | 145 | { |
| 141 | int x,y,color,code,sx,sy,flipx,flipy,sizex,sizey,pri; | |
| 146 | int x, y, color, code, sx, sy, flipx, flipy, sizex, sizey, pri; | |
| 142 | 147 | |
| 148 | pri = (state->buf_spriteram[offs] & 0x0600) >> 9; | |
| 149 | if (pri != priority) | |
| 150 | continue; | |
| 143 | 151 | |
| 144 | pri = (buf_spriteram[offs] & 0x0600) >> 9; | |
| 145 | if (pri != priority) continue; | |
| 146 | ||
| 147 | flipx = buf_spriteram[offs] & 0x1000; | |
| 152 | flipx = state->buf_spriteram[offs] & 0x1000; | |
| 148 | 153 | flipy = 0; |
| 149 | color = (buf_spriteram[offs] & 0x01fc) >> 2; | |
| 150 | code = buf_spriteram[offs+1] | ((buf_spriteram[offs] & 0x0003) << 16); | |
| 151 | sx = (buf_spriteram[offs+2] >> 7); | |
| 152 | sy = (buf_spriteram[offs+3] >> 7); | |
| 153 | sizex = (buf_spriteram[offs+2] & 0x000f) + 1; | |
| 154 | sizey = (buf_spriteram[offs+3] & 0x000f) + 1; | |
| 154 | color = (state->buf_spriteram[offs] & 0x01fc) >> 2; | |
| 155 | code = state->buf_spriteram[offs + 1] | ((state->buf_spriteram[offs] & 0x0003) << 16); | |
| 156 | sx = (state->buf_spriteram[offs + 2] >> 7); | |
| 157 | sy = (state->buf_spriteram[offs + 3] >> 7); | |
| 158 | sizex = (state->buf_spriteram[offs + 2] & 0x000f) + 1; | |
| 159 | sizey = (state->buf_spriteram[offs + 3] & 0x000f) + 1; | |
| 155 | 160 | |
| 156 | 161 | if (flip_screen_get(machine)) |
| 157 | 162 | { |
| r7500 | r7501 | |
| 161 | 166 | sy = 16 - sy; |
| 162 | 167 | } |
| 163 | 168 | |
| 164 | for (y = 0;y < sizey;y++) | |
| 169 | for (y = 0; y < sizey; y++) | |
| 165 | 170 | { |
| 166 | for (x = 0;x < sizex;x++) | |
| 171 | for (x = 0; x < sizex; x++) | |
| 167 | 172 | { |
| 168 | 173 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], |
| 169 | 174 | code + x + sizex * y, |
| 170 | 175 | color, |
| 171 | 176 | flipx,flipy, |
| 172 | (sx + (flipx ? (-8*(x+1)+1) : 8*x) - vreg[6]+44) & 0x1ff,(sy + (flipy ? (-8*(y+1)+1) : 8*y) - vreg[7]-9) & 0x1ff,0); | |
| 177 | (sx + (flipx ? (-8*(x+1)+1) : 8*x) - state->vreg[6]+44) & 0x1ff,(sy + (flipy ? (-8*(y+1)+1) : 8*y) - state->vreg[7]-9) & 0x1ff,0); | |
| 173 | 178 | } |
| 174 | 179 | } |
| 175 | 180 | } |
| r7500 | r7501 | |
| 177 | 182 | |
| 178 | 183 | VIDEO_UPDATE( othldrby ) |
| 179 | 184 | { |
| 185 | othldrby_state *state = (othldrby_state *)screen->machine->driver_data; | |
| 180 | 186 | int layer; |
| 181 | 187 | |
| 188 | flip_screen_set(screen->machine, state->vreg[0x0f] & 0x80); | |
| 182 | 189 | |
| 183 | flip_screen_set(screen->machine, vreg[0x0f] & 0x80); | |
| 184 | ||
| 185 | for (layer = 0;layer < 3;layer++) | |
| 190 | for (layer = 0; layer < 3; layer++) | |
| 186 | 191 | { |
| 187 | 192 | if (flip_screen_get(screen->machine)) |
| 188 | 193 | { |
| 189 | tilemap_set_scrollx(bg_tilemap[layer],0,vreg[2*layer]+59); | |
| 190 | tilemap_set_scrolly(bg_tilemap[layer],0,vreg[2*layer+1]+248); | |
| 194 | tilemap_set_scrollx(state->bg_tilemap[layer], 0, state->vreg[2 * layer] + 59); | |
| 195 | tilemap_set_scrolly(state->bg_tilemap[layer], 0, state->vreg[2 * layer + 1] + 248); | |
| 191 | 196 | } |
| 192 | 197 | else |
| 193 | 198 | { |
| 194 | tilemap_set_scrollx(bg_tilemap[layer],0,vreg[2*layer]-58); | |
| 195 | tilemap_set_scrolly(bg_tilemap[layer],0,vreg[2*layer+1]+9); | |
| 199 | tilemap_set_scrollx(state->bg_tilemap[layer], 0, state->vreg[2 * layer] - 58); | |
| 200 | tilemap_set_scrolly(state->bg_tilemap[layer], 0, state->vreg[2 * layer+1] + 9); | |
| 196 | 201 | } |
| 197 | 202 | } |
| 198 | 203 | |
| 199 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 204 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 200 | 205 | |
| 201 | bitmap_fill(bitmap,cliprect,0); | |
| 206 | bitmap_fill(bitmap, cliprect, 0); | |
| 202 | 207 | |
| 203 | for (layer = 0;layer < 3;layer++) | |
| 204 | tilemap_draw(bitmap,cliprect,bg_tilemap[layer],0,0); | |
| 205 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 206 | for (layer = 0;layer < 3;layer++) | |
| 207 | tilemap_draw(bitmap,cliprect,bg_tilemap[layer],1,0); | |
| 208 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 209 | for (layer = 0;layer < 3;layer++) | |
| 210 | tilemap_draw(bitmap,cliprect,bg_tilemap[layer],2,0); | |
| 211 | draw_sprites(screen->machine,bitmap,cliprect,2); | |
| 212 | for (layer = 0;layer < 3;layer++) | |
| 213 | tilemap_draw(bitmap,cliprect,bg_tilemap[layer],3,0); | |
| 214 | draw_sprites(screen->machine,bitmap,cliprect,3); | |
| 208 | for (layer = 0; layer < 3; layer++) | |
| 209 | tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 0, 0); | |
| 210 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 211 | ||
| 212 | for (layer = 0; layer < 3; layer++) | |
| 213 | tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 1, 0); | |
| 214 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 215 | ||
| 216 | for (layer = 0; layer < 3; layer++) | |
| 217 | tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 2, 0); | |
| 218 | draw_sprites(screen->machine, bitmap, cliprect, 2); | |
| 219 | ||
| 220 | for (layer = 0; layer < 3; layer++) | |
| 221 | tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 3, 0); | |
| 222 | draw_sprites(screen->machine, bitmap, cliprect, 3); | |
| 223 | ||
| 215 | 224 | return 0; |
| 216 | 225 | } |
| 217 | 226 | |
| 218 | 227 | VIDEO_EOF( othldrby ) |
| 219 | 228 | { |
| 229 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 230 | ||
| 220 | 231 | /* sprites need to be delayed two frames */ |
| 221 | memcpy(buf_spriteram,buf_spriteram2,SPRITERAM_SIZE*sizeof(buf_spriteram[0])); | |
| 222 | memcpy(buf_spriteram2,&vram[SPRITERAM_START],SPRITERAM_SIZE*sizeof(buf_spriteram[0])); | |
| 232 | memcpy(state->buf_spriteram, state->buf_spriteram2, SPRITERAM_SIZE * sizeof(state->buf_spriteram[0])); | |
| 233 | memcpy(state->buf_spriteram2, &state->vram[SPRITERAM_START], SPRITERAM_SIZE * sizeof(state->buf_spriteram[0])); | |
| 223 | 234 | } |
| r7500 | r7501 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | UINT32 st0016_game; |
| 15 | 15 | |
| 16 | extern UINT8 macs_cart_slot; | |
| 17 | ||
| 16 | 18 | static INT32 st0016_spr_bank,st0016_spr2_bank,st0016_pal_bank,st0016_char_bank; |
| 17 | 19 | static int spr_dx,spr_dy; |
| 18 | 20 | |
| r7500 | r7501 | |
| 191 | 193 | UINT32 length=((st0016_vregs[0xa6]|(st0016_vregs[0xa7]<<8)|((st0016_vregs[0xa8]&0x1f)<<16))+1)<<1; |
| 192 | 194 | UINT32 srclen = (memory_region_length(space->machine, "maincpu")-0x10000); |
| 193 | 195 | UINT8 *mem = memory_region(space->machine, "maincpu"); |
| 196 | ||
| 197 | srcadr += macs_cart_slot*0x400000; | |
| 198 | ||
| 194 | 199 | while(length>0) |
| 195 | 200 | { |
| 196 | 201 | if( srcadr < srclen && (dstadr < ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE)) |
| r7500 | r7501 | |
| 654 | 659 | } |
| 655 | 660 | else |
| 656 | 661 | { |
| 657 | if(ISMACS1) | |
| 658 | { | |
| 659 | if(!(input_port_read(screen->machine, "SYS1")&1)) //fake coins - MACS2 system | |
| 660 | { | |
| 661 | macs_ram2[0]++; | |
| 662 | } | |
| 663 | } | |
| 664 | ||
| 665 | 662 | bitmap_fill(bitmap,cliprect,UNUSED_PEN); |
| 666 | 663 | draw_bgmap(screen->machine, bitmap,cliprect,0); |
| 667 | 664 | draw_sprites(screen->machine, bitmap,cliprect); |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "includes/deco16ic.h" | |
| 8 | #include "includes/funkyjet.h" | |
| 9 | #include "video/deco16ic.h" | |
| 9 | 10 | |
| 10 | 11 | /******************************************************************************/ |
| 11 | 12 | |
| 12 | ||
| 13 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 13 | 14 | { |
| 14 | deco16_1_video_init(machine); | |
| 15 | } | |
| 16 | ||
| 17 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 18 | { | |
| 19 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 15 | funkyjet_state *state = (funkyjet_state *)machine->driver_data; | |
| 16 | UINT16 *spriteram = state->spriteram; | |
| 20 | 17 | int offs; |
| 21 | 18 | |
| 22 | for (offs = 0;offs < 0x400;offs += 4) | |
| 19 | for (offs = 0; offs < 0x400; offs += 4) | |
| 23 | 20 | { |
| 24 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 21 | int x, y,sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 25 | 22 | |
| 26 | sprite = spriteram | |
| 23 | sprite = spriteram | |
| 27 | 24 | |
| 28 | y = spriteram16[offs]; | |
| 29 | flash=y&0x1000; | |
| 30 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 25 | y = spriteram[offs]; | |
| 26 | flash = y & 0x1000; | |
| 27 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 28 | continue; | |
| 31 | 29 | |
| 32 | x = spriteram16[offs+2]; | |
| 33 | colour = (x >>9) & 0x1f; | |
| 30 | x = spriteram[offs + 2]; | |
| 31 | colour = (x >> 9) & 0x1f; | |
| 34 | 32 | |
| 35 | 33 | fx = y & 0x2000; |
| 36 | 34 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 41 | 39 | if (x >= 320) x -= 512; |
| 42 | 40 | if (y >= 256) y -= 512; |
| 43 | 41 | y = 240 - y; |
| 44 | ||
| 42 | | |
| 45 | 43 | |
| 46 | if (x>320) continue; | |
| 44 | if (x > 320) | |
| 45 | continue; | |
| 47 | 46 | |
| 48 | 47 | sprite &= ~multi; |
| 49 | 48 | if (fy) |
| r7500 | r7501 | |
| 56 | 55 | |
| 57 | 56 | if (flip_screen_get(machine)) |
| 58 | 57 | { |
| 59 | y=240-y; | |
| 60 | x=304-x; | |
| 61 | if (fx) fx=0; else fx=1; | |
| 62 | if (fy) fy=0; else fy=1; | |
| 63 | mult=16; | |
| 58 | y = 240 - y; | |
| 59 | x = 304 - x; | |
| 60 | if (fx) fx = 0; else fx = 1; | |
| 61 | if (fy) fy = 0; else fy = 1; | |
| 62 | mult = 16; | |
| 64 | 63 | } |
| 65 | else mult=-16; | |
| 64 | else | |
| 65 | mult = -16; | |
| 66 | 66 | |
| 67 | 67 | while (multi >= 0) |
| 68 | 68 | { |
| r7500 | r7501 | |
| 79 | 79 | |
| 80 | 80 | VIDEO_UPDATE( funkyjet ) |
| 81 | 81 | { |
| 82 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 83 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 82 | funkyjet_state *state = (funkyjet_state *)screen->machine->driver_data; | |
| 83 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 84 | 84 | |
| 85 | bitmap_fill(bitmap,cliprect,768); | |
| 86 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 87 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 88 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 85 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 86 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 87 | ||
| 88 | bitmap_fill(bitmap, cliprect, 768); | |
| 89 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 90 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 91 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 89 | 92 | return 0; |
| 90 | 93 | } |
| r7500 | r7501 | |
|---|---|---|
| 6 | 6 | ******************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "emu.h" |
| 9 | #include "includes/mrflea.h" | |
| 9 | 10 | |
| 10 | static int mrflea_gfx_bank; | |
| 11 | WRITE8_HANDLER( mrflea_gfx_bank_w ) | |
| 12 | { | |
| 13 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 14 | state->gfx_bank = data; | |
| 11 | 15 | |
| 12 | WRITE8_HANDLER( mrflea_gfx_bank_w ){ | |
| 13 | mrflea_gfx_bank = data; | |
| 14 | if( data & ~0x14 ){ | |
| 15 | logerror( "unknown gfx bank: 0x%02x\n", data ); | |
| 16 | } | |
| 16 | if (data & ~0x14) | |
| 17 | logerror("unknown gfx bank: 0x%02x\n", data); | |
| 17 | 18 | } |
| 18 | 19 | |
| 19 | WRITE8_HANDLER( mrflea_videoram_w ){ | |
| 20 | int bank = offset/0x400; | |
| 20 | WRITE8_HANDLER( mrflea_videoram_w ) | |
| 21 | { | |
| 22 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 23 | int bank = offset / 0x400; | |
| 24 | ||
| 21 | 25 | offset &= 0x3ff; |
| 22 | space->machine->generic.videoram.u8[offset] = data; | |
| 23 | space->machine->generic.videoram.u8[offset+0x400] = bank; | |
| 24 | /* the address range that tile data is written to sets one bit of | |
| 25 | ** the bank select. The remaining bits are from a video register. | |
| 26 | */ | |
| 26 | state->videoram[offset] = data; | |
| 27 | state->videoram[offset + 0x400] = bank; | |
| 28 | /* the address range that tile data is written to sets one bit of | |
| 29 | the bank select. The remaining bits are from a video register. */ | |
| 27 | 30 | } |
| 28 | 31 | |
| 29 | WRITE8_HANDLER( mrflea_spriteram_w ){ | |
| 30 | if( offset&2 ){ /* tile_number */ | |
| 31 | space->machine->generic.spriteram.u8[offset|1] = offset&1; | |
| 32 | WRITE8_HANDLER( mrflea_spriteram_w ) | |
| 33 | { | |
| 34 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 35 | ||
| 36 | if (offset & 2) | |
| 37 | { | |
| 38 | /* tile_number */ | |
| 39 | state->spriteram[offset | 1] = offset & 1; | |
| 32 | 40 | offset &= ~1; |
| 33 | 41 | } |
| 34 | space->machine->generic.spriteram.u8[offset] = data; | |
| 42 | ||
| 43 | state->spriteram[offset] = data; | |
| 35 | 44 | } |
| 36 | 45 | |
| 37 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 46 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 38 | 47 | { |
| 48 | mrflea_state *state = (mrflea_state *)machine->driver_data; | |
| 39 | 49 | const gfx_element *gfx = machine->gfx[0]; |
| 40 | const UINT8 *source = machine->generic.spriteram.u8; | |
| 41 | const UINT8 *finish = source+0x100; | |
| 50 | const UINT8 *source = state->spriteram; | |
| 51 | const UINT8 *finish = source + 0x100; | |
| 42 | 52 | rectangle clip = *video_screen_get_visible_area(machine->primary_screen); |
| 53 | ||
| 43 | 54 | clip.max_x -= 24; |
| 44 | 55 | clip.min_x += 16; |
| 45 | while( source<finish ){ | |
| 46 | int xpos = source[1]-3; | |
| 47 | int ypos = source[0]-16+3; | |
| 48 | int tile_number = source[2]+source[3]*0x100; | |
| 49 | 56 | |
| 57 | while (source < finish) | |
| 58 | { | |
| 59 | int xpos = source[1] - 3; | |
| 60 | int ypos = source[0] - 16 + 3; | |
| 61 | int tile_number = source[2] + source[3] * 0x100; | |
| 62 | ||
| 50 | 63 | drawgfx_transpen( bitmap, &clip,gfx, |
| 51 | 64 | tile_number, |
| 52 | 65 | 0, /* color */ |
| r7500 | r7501 | |
| 57 | 70 | 0, /* color */ |
| 58 | 71 | 0,0, /* no flip */ |
| 59 | 72 | xpos,256+ypos,0 ); |
| 60 | source+=4; | |
| 73 | source += 4; | |
| 61 | 74 | } |
| 62 | 75 | } |
| 63 | 76 | |
| 64 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 77 | static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 65 | 78 | { |
| 66 | const UINT8 *source = machine->generic.videoram.u8; | |
| 79 | mrflea_state *state = (mrflea_state *)machine->driver_data; | |
| 80 | const UINT8 *source = state->videoram; | |
| 67 | 81 | const gfx_element *gfx = machine->gfx[1]; |
| 68 | int sx,sy; | |
| 82 | int sx, sy; | |
| 69 | 83 | int base = 0; |
| 70 | if( mrflea_gfx_bank&0x04 ) base |= 0x400; | |
| 71 | if( mrflea_gfx_bank&0x10 ) base |= 0x200; | |
| 72 | for( sy=0; sy<256; sy+=8 ){ | |
| 73 | for( sx=0; sx<256; sx+=8 ){ | |
| 74 | int tile_number = base+source[0]+source[0x400]*0x100; | |
| 84 | ||
| 85 | if (BIT(state->gfx_bank, 2)) | |
| 86 | base |= 0x400; | |
| 87 | ||
| 88 | if (BIT(state->gfx_bank, 4)) | |
| 89 | base |= 0x200; | |
| 90 | ||
| 91 | for (sy = 0; sy < 256; sy += 8) | |
| 92 | { | |
| 93 | for (sx = 0; sx < 256; sx += 8) | |
| 94 | { | |
| 95 | int tile_number = base + source[0] + source[0x400] * 0x100; | |
| 75 | 96 | source++; |
| 76 | 97 | drawgfx_opaque( bitmap, cliprect, |
| 77 | 98 | gfx, |
| r7500 | r7501 | |
| 83 | 104 | } |
| 84 | 105 | } |
| 85 | 106 | |
| 86 | VIDEO_START( mrflea ){ | |
| 87 | } | |
| 88 | ||
| 89 | 107 | VIDEO_UPDATE( mrflea ) |
| 90 | 108 | { |
| 91 | 109 | draw_background(screen->machine, bitmap, cliprect); |
| r7500 | r7501 | |
|---|---|---|
| 108 | 108 | { (96*32), (96*32)+32, (96*32)+64, (96*32)+96, (96*32)+128, (96*32)+160, (96*32)+192, (96*32)+224 }, |
| 109 | 109 | { (112*32), (112*32)+32, (112*32)+64, (112*32)+96, (112*32)+128, (112*32)+160, (112*32)+192, (112*32)+224 } |
| 110 | 110 | }; |
| 111 | /* Scroll tables 32x32 64x32 32x64 64x64 */ | |
| 112 | static const UINT16 table_hscroll[4][4] = { {0,0,0,0}, {0,0x800,0,0x800}, {0,0,0,0}, {0,0x800,0,0x800} }; | |
| 113 | static const UINT16 table_vscroll[4][4] = { {0,0,0,0}, {0,0,0,0}, {0,0x800,0,0x800}, {0,0x1000,0,0x1000} }; | |
| 111 | 114 | |
| 112 | 115 | struct SCANLINE |
| 113 | 116 | { |
| 114 | int enable, clip; | |
| 115 | ||
| 116 | UINT16 buffer[(SNES_SCR_WIDTH * 2)]; | |
| 117 | UINT8 priority[(SNES_SCR_WIDTH * 2)]; | |
| 118 | UINT8 layer[(SNES_SCR_WIDTH * 2)]; | |
| 119 | UINT8 blend_exception[(SNES_SCR_WIDTH * 2)]; | |
| 117 | UINT16 buffer[(SNES_SCR_WIDTH * 2) + 16]; | |
| 118 | UINT8 priority[(SNES_SCR_WIDTH * 2) + 16]; | |
| 119 | UINT8 layer[(SNES_SCR_WIDTH * 2) + 16]; | |
| 120 | UINT8 blend_exception[(SNES_SCR_WIDTH * 2) + 16]; | |
| 120 | 121 | }; |
| 121 | 122 | |
| 122 | 123 | static struct SCANLINE scanlines[2]; |
| r7500 | r7501 | |
| 135 | 136 | * Routine for additive/subtractive blending |
| 136 | 137 | * between the main and sub screens. |
| 137 | 138 | *****************************************/ |
| 138 | ||
| 139 | INLINE void snes_draw_blend( UINT16 offset, UINT16 *colour, UINT8 clip, UINT8 black_pen_clip ) | |
| 139 | INLINE void snes_draw_blend(UINT16 offset, UINT16 *colour, UINT8 factor, UINT8 clip, UINT8 black_pen_clip ) | |
| 140 | 140 | { |
| 141 | 141 | if ((black_pen_clip == SNES_CLIP_ALL2) || |
| 142 | (black_pen_clip == SNES_CLIP_IN && snes_ppu.clipmasks[SNES_COLOR][offset]) || | |
| 143 | (black_pen_clip == SNES_CLIP_OUT && !snes_ppu.clipmasks[SNES_COLOR][offset])) | |
| 142 | (black_pen_clip == SNES_CLIP_IN && snes_ppu.clipmasks[SNES_COLOR][offset / factor]) || | |
| 143 | (black_pen_clip == SNES_CLIP_OUT && !snes_ppu.clipmasks[SNES_COLOR][offset / factor])) | |
| 144 | 144 | *colour = 0; //clip to black before color math |
| 145 | 145 | |
| 146 | 146 | if (clip == SNES_CLIP_ALL2) // blending mode 3 == always OFF |
| r7500 | r7501 | |
| 150 | 150 | if (!debug_options.transparency_disabled) |
| 151 | 151 | #endif /* SNES_LAYER_DEBUG */ |
| 152 | 152 | if ((clip == SNES_CLIP_ALL) || |
| 153 | (clip == SNES_CLIP_IN && !snes_ppu.clipmasks[SNES_COLOR][offset]) || | |
| 154 | (clip == SNES_CLIP_OUT && snes_ppu.clipmasks[SNES_COLOR][offset])) | |
| 153 | (clip == SNES_CLIP_IN && !snes_ppu.clipmasks[SNES_COLOR][offset / factor]) || | |
| 154 | (clip == SNES_CLIP_OUT && snes_ppu.clipmasks[SNES_COLOR][offset / factor])) | |
| 155 | 155 | { |
| 156 | 156 | UINT16 r, g, b; |
| 157 | 157 | int clip_max = 0; // if add then clip to 0x1f, if sub then clip to 0 |
| r7500 | r7501 | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | INLINE void snes_draw_blend_lores(UINT16 offset, UINT16 *colour, UINT8 clip, UINT8 black_pen_clip ) | |
| 229 | { | |
| 230 | snes_draw_blend(offset, colour, 1, clip, black_pen_clip); | |
| 231 | } | |
| 232 | ||
| 233 | INLINE void snes_draw_blend_hires(UINT16 offset, UINT16 *colour, UINT8 clip, UINT8 black_pen_clip ) | |
| 234 | { | |
| 235 | snes_draw_blend(offset, colour, 2, clip, black_pen_clip); | |
| 236 | } | |
| 237 | ||
| 228 | 238 | /***************************************** |
| 229 | 239 | * snes_draw_tile() |
| 230 | 240 | * |
| 231 | 241 | * Draw tiles with variable bit planes |
| 232 | 242 | *****************************************/ |
| 233 | ||
| 234 | INLINE void snes_draw_tile( UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 direct_colors, UINT8 hires ) | |
| 243 | INLINE void snes_draw_tile(UINT8 screen, UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 direct_colors ) | |
| 235 | 244 | { |
| 236 | UINT8 mask, plane[8]; | |
| 245 | UINT8 mask, plane[8], window_enabled = 0; | |
| 237 | 246 | UINT16 c; |
| 238 | 247 | INT16 ii, jj; |
| 239 | 248 | |
| r7500 | r7501 | |
| 266 | 275 | mask >>= 1; |
| 267 | 276 | } |
| 268 | 277 | |
| 269 | ||
| 270 | if (!hires) | |
| 271 | { | |
| 272 | if (scanlines[SNES_MAINSCREEN].enable) | |
| 273 | { | |
| 274 | ||
| 275 | 278 | #ifdef SNES_LAYER_DEBUG |
| 276 | | |
| 279 | | |
| 277 | 280 | #endif /* SNES_LAYER_DEBUG */ |
| 278 | /* Clip to windows */ | |
| 279 | if (scanlines[SNES_MAINSCREEN].clip) | |
| 280 | colour &= snes_ppu.clipmasks[layer][ii]; | |
| 281 | /* Clip to windows */ | |
| 282 | window_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.layer[layer].main_window_enabled : snes_ppu.layer[layer].sub_window_enabled; | |
| 283 | if (window_enabled) | |
| 284 | colour &= snes_ppu.clipmasks[layer][ii]; | |
| 281 | 285 | |
| 282 | /* Only draw if we have a colour (0 == transparent) */ | |
| 283 | if (colour) | |
| 284 | { | |
| 285 | if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0)) | |
| 286 | { | |
| 287 | if (direct_colors) | |
| 288 | { | |
| 289 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ | |
| 290 | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 291 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); | |
| 292 | } | |
| 293 | else | |
| 294 | c = snes_cgram[pal + colour]; | |
| 295 | ||
| 296 | if (snes_ppu.layer[SNES_MAINSCREEN].mosaic_enabled) // handle horizontal mosaic | |
| 297 | { | |
| 298 | int x_mos; | |
| 299 | ||
| 300 | //TODO: 512 modes has the h values doubled. | |
| 301 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) | |
| 302 | { | |
| 303 | scanlines[SNES_MAINSCREEN].buffer[ii + x_mos] = c; | |
| 304 | scanlines[SNES_MAINSCREEN].priority[ii + x_mos] = priority; | |
| 305 | scanlines[SNES_MAINSCREEN].layer[ii + x_mos] = layer; | |
| 306 | } | |
| 307 | ||
| 308 | ii += x_mos - 1; | |
| 309 | } | |
| 310 | else | |
| 311 | { | |
| 312 | scanlines[SNES_MAINSCREEN].buffer[ii] = c; | |
| 313 | scanlines[SNES_MAINSCREEN].priority[ii] = priority; | |
| 314 | scanlines[SNES_MAINSCREEN].layer[ii] = layer; | |
| 315 | } | |
| 316 | } | |
| 317 | } | |
| 318 | } | |
| 319 | ||
| 320 | if (scanlines[SNES_SUBSCREEN].enable) | |
| 286 | /* Only draw if we have a colour (0 == transparent) */ | |
| 287 | if (colour) | |
| 288 | { | |
| 289 | if ((scanlines[screen].priority[ii] <= priority) && (ii >= 0)) | |
| 321 | 290 | { |
| 322 | #ifdef SNES_LAYER_DEBUG | |
| 323 | if (!debug_options.windows_disabled) | |
| 324 | #endif /* SNES_LAYER_DEBUG */ | |
| 325 | /* Clip to windows */ | |
| 326 | if (scanlines[SNES_SUBSCREEN].clip) | |
| 327 | colour &= snes_ppu.clipmasks[layer][ii]; | |
| 328 | ||
| 329 | /* Only draw if we have a colour (0 == transparent) */ | |
| 330 | if (colour) | |
| 291 | if (direct_colors) | |
| 331 | 292 | { |
| 332 | if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0)) | |
| 333 | { | |
| 334 | if (direct_colors) | |
| 335 | { | |
| 336 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ | |
| 337 | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 338 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); | |
| 339 | } | |
| 340 | else | |
| 341 | c = snes_cgram[pal + colour]; | |
| 342 | ||
| 343 | if (snes_ppu.layer[SNES_SUBSCREEN].mosaic_enabled) // handle horizontal mosaic | |
| 344 | { | |
| 345 | int x_mos; | |
| 346 | ||
| 347 | //TODO: 512 modes has the h values doubled. | |
| 348 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) | |
| 349 | { | |
| 350 | scanlines[SNES_SUBSCREEN].buffer[ii + x_mos] = c; | |
| 351 | scanlines[SNES_SUBSCREEN].priority[ii + x_mos] = priority; | |
| 352 | scanlines[SNES_SUBSCREEN].layer[ii + x_mos] = layer; | |
| 353 | } | |
| 354 | ||
| 355 | ii += x_mos - 1; | |
| 356 | } | |
| 357 | else | |
| 358 | { | |
| 359 | scanlines[SNES_SUBSCREEN].buffer[ii] = c; | |
| 360 | scanlines[SNES_SUBSCREEN].priority[ii] = priority; | |
| 361 | scanlines[SNES_SUBSCREEN].layer[ii] = layer; | |
| 362 | } | |
| 363 | } | |
| 293 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ | |
| 294 | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 295 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); | |
| 364 | 296 | } |
| 365 | } | |
| 366 | } | |
| 297 | else | |
| 298 | c = snes_cgram[pal + colour]; | |
| 367 | 299 | |
| 368 | else /* hires */ | |
| 369 | { | |
| 370 | #ifdef SNES_LAYER_DEBUG | |
| 371 | if (!debug_options.windows_disabled) | |
| 372 | #endif /* SNES_LAYER_DEBUG */ | |
| 373 | /* Clip to windows */ | |
| 374 | if (scanlines[SNES_MAINSCREEN].clip) | |
| 375 | colour &= snes_ppu.clipmasks[layer][ii >> hires]; | |
| 376 | ||
| 377 | /* Only draw if we have a colour (0 == transparent) */ | |
| 378 | if (colour) | |
| 379 | { | |
| 380 | if ((scanlines[SNES_MAINSCREEN].priority[ii >> hires] <= priority) && (ii >= 0)) | |
| 300 | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic | |
| 381 | 301 | { |
| 382 | if (direct_colors) | |
| 383 | { | |
| 384 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ | |
| 385 | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 386 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); | |
| 387 | } | |
| 388 | else | |
| 389 | c = snes_cgram[pal + colour]; | |
| 302 | int x_mos; | |
| 390 | 303 | |
| 391 | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic | |
| 304 | //TODO: 512 modes has the h values doubled. | |
| 305 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) | |
| 392 | 306 | { |
| 393 | int x_mos; | |
| 394 | ||
| 395 | //TODO: 512 modes has the h values doubled. | |
| 396 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) | |
| 397 | { | |
| 398 | if ((ii & 1) && scanlines[SNES_MAINSCREEN].enable) | |
| 399 | { | |
| 400 | scanlines[SNES_MAINSCREEN].buffer[(ii + x_mos) >> 1] = c; | |
| 401 | scanlines[SNES_MAINSCREEN].priority[(ii + x_mos) >> 1] = priority; | |
| 402 | scanlines[SNES_MAINSCREEN].layer[(ii + x_mos) >> 1] = layer; | |
| 403 | } | |
| 404 | else if (scanlines[SNES_SUBSCREEN].enable) | |
| 405 | { | |
| 406 | scanlines[SNES_SUBSCREEN].buffer[(ii + x_mos) >> 1] = c; | |
| 407 | scanlines[SNES_SUBSCREEN].priority[(ii + x_mos) >> 1] = priority; | |
| 408 | scanlines[SNES_SUBSCREEN].layer[(ii + x_mos) >> 1] = layer; | |
| 409 | } | |
| 410 | } | |
| 411 | ii += x_mos - 1; | |
| 307 | scanlines[screen].buffer[ii + x_mos] = c; | |
| 308 | scanlines[screen].priority[ii + x_mos] = priority; | |
| 309 | scanlines[screen].layer[ii + x_mos] = layer; | |
| 412 | 310 | } |
| 413 | else | |
| 414 | { | |
| 415 | if ((ii & 1) && scanlines[SNES_MAINSCREEN].enable) | |
| 416 | { | |
| 417 | scanlines[SNES_MAINSCREEN].buffer[ii >> 1] = c; | |
| 418 | scanlines[SNES_MAINSCREEN].priority[ii >> 1] = priority; | |
| 419 | scanlines[SNES_MAINSCREEN].layer[ii >> 1] = layer; | |
| 420 | } | |
| 421 | else if (scanlines[SNES_SUBSCREEN].enable) | |
| 422 | { | |
| 423 | scanlines[SNES_SUBSCREEN].buffer[ii >> 1] = c; | |
| 424 | scanlines[SNES_SUBSCREEN].priority[ii >> 1] = priority; | |
| 425 | scanlines[SNES_SUBSCREEN].layer[ii >> 1] = layer; | |
| 426 | } | |
| 427 | } | |
| 311 | ii += x_mos - 1; | |
| 428 | 312 | } |
| 313 | else | |
| 314 | { | |
| 315 | scanlines[screen].buffer[ii] = c; | |
| 316 | scanlines[screen].priority[ii] = priority; | |
| 317 | scanlines[screen].layer[ii] = layer; | |
| 318 | } | |
| 429 | 319 | } |
| 430 | 320 | } |
| 431 | 321 | } |
| r7500 | r7501 | |
| 436 | 326 | * |
| 437 | 327 | * Draw 2 tiles with variable bit planes |
| 438 | 328 | *****************************************/ |
| 439 | ||
| 440 | INLINE void snes_draw_tile_x2( UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 direct_colors, UINT8 hires ) | |
| 329 | INLINE void snes_draw_tile_x2(UINT8 screen, UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 direct_colors ) | |
| 441 | 330 | { |
| 442 | 331 | if (flip) |
| 443 | 332 | { |
| 444 | snes_draw_tile(planes, layer, tileaddr + (8 * planes), x, priority, flip, pal, direct_colors, hires); | |
| 445 | snes_draw_tile(planes, layer, tileaddr, x + 8, priority, flip, pal, direct_colors, hires); | |
| 333 | snes_draw_tile(screen, planes, layer, tileaddr + (8 * planes), x, priority, flip, pal, direct_colors); | |
| 334 | snes_draw_tile(screen, planes, layer, tileaddr, x + 8, priority, flip, pal, direct_colors); | |
| 446 | 335 | } |
| 447 | 336 | else |
| 448 | 337 | { |
| 449 | snes_draw_tile(planes, layer, tileaddr, x, priority, flip, pal, direct_colors, hires); | |
| 450 | snes_draw_tile(planes, layer, tileaddr + (8 * planes), x + 8, priority, flip, pal, direct_colors, hires); | |
| 338 | snes_draw_tile(screen, planes, layer, tileaddr, x, priority, flip, pal, direct_colors); | |
| 339 | snes_draw_tile(screen, planes, layer, tileaddr + (8 * planes), x + 8, priority, flip, pal, direct_colors); | |
| 451 | 340 | } |
| 452 | 341 | } |
| 453 | 342 | |
| r7500 | r7501 | |
| 458 | 347 | * The same as snes_draw_tile_4() except |
| 459 | 348 | * that it takes a blend parameter. |
| 460 | 349 | *****************************************/ |
| 461 | ||
| 462 | INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 blend ) | |
| 350 | INLINE void snes_draw_tile_object(UINT8 screen, UINT16 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT16 pal, UINT8 blend, UINT8 wide ) | |
| 463 | 351 | { |
| 464 | UINT8 mask, plane[4]; | |
| 352 | UINT8 mask, plane[4], window_enabled = 0; | |
| 465 | 353 | UINT16 c; |
| 466 | 354 | INT16 ii; |
| 355 | UINT8 x_shift = wide ? 1 : 0; | |
| 356 | UINT8 size = wide ? 16 : 8; | |
| 357 | UINT8 step = wide ? 1 : 0; | |
| 467 | 358 | |
| 468 | 359 | plane[0] = snes_vram[tileaddr]; |
| 469 | 360 | plane[1] = snes_vram[tileaddr + 1]; |
| r7500 | r7501 | |
| 475 | 366 | else |
| 476 | 367 | mask = 0x80; |
| 477 | 368 | |
| 478 | for (ii = x; ii < (x + 8); ii++) | |
| 369 | x <<= x_shift; | |
| 370 | for (ii = x; ii < (x + size); ii += 1 + step) | |
| 479 | 371 | { |
| 480 | 372 | UINT8 colour; |
| 481 | 373 | if (flip) |
| r7500 | r7501 | |
| 491 | 383 | mask >>= 1; |
| 492 | 384 | } |
| 493 | 385 | |
| 494 | if (scanlines[SNES_MAINSCREEN].enable) | |
| 495 | { | |
| 496 | ||
| 497 | 386 | #ifdef SNES_LAYER_DEBUG |
| 498 | | |
| 387 | | |
| 499 | 388 | #endif /* SNES_LAYER_DEBUG */ |
| 500 | /* Clip to windows */ | |
| 501 | if (scanlines[SNES_MAINSCREEN].clip) | |
| 502 | colour &= snes_ppu.clipmasks[SNES_OAM][ii]; | |
| 389 | /* Clip to windows */ | |
| 390 | window_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.layer[SNES_OAM].main_window_enabled : snes_ppu.layer[SNES_OAM].sub_window_enabled; | |
| 391 | if (window_enabled) | |
| 392 | colour &= snes_ppu.clipmasks[SNES_OAM][ii]; | |
| 503 | 393 | |
| 504 | /* Only draw if we have a colour (0 == transparent) */ | |
| 505 | if (colour) | |
| 506 | { | |
| 507 | if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0)) | |
| 508 | { | |
| 509 | c = snes_cgram[pal + colour]; | |
| 510 | ||
| 511 | scanlines[SNES_MAINSCREEN].buffer[ii] = c; | |
| 512 | scanlines[SNES_MAINSCREEN].priority[ii] = priority; | |
| 513 | scanlines[SNES_MAINSCREEN].layer[ii] = SNES_OAM; | |
| 514 | scanlines[SNES_MAINSCREEN].blend_exception[ii] = blend; | |
| 515 | } | |
| 516 | } | |
| 517 | } | |
| 518 | ||
| 519 | if (scanlines[SNES_SUBSCREEN].enable) | |
| 394 | /* Only draw if we have a colour (0 == transparent) */ | |
| 395 | if (colour) | |
| 520 | 396 | { |
| 521 | ||
| 522 | #ifdef SNES_LAYER_DEBUG | |
| 523 | if (!debug_options.windows_disabled) | |
| 524 | #endif /* SNES_LAYER_DEBUG */ | |
| 525 | /* Clip to windows */ | |
| 526 | if (scanlines[SNES_SUBSCREEN].clip) | |
| 527 | colour &= snes_ppu.clipmasks[SNES_OAM][ii]; | |
| 528 | ||
| 529 | /* Only draw if we have a colour (0 == transparent) */ | |
| 530 | if (colour) | |
| 397 | if ((scanlines[screen].priority[ii] <= priority) && (ii >= 0)) | |
| 531 | 398 | { |
| 532 | if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0)) | |
| 533 | { | |
| 534 | c = snes_cgram[pal + colour]; | |
| 399 | c = snes_cgram[pal + colour]; | |
| 535 | 400 | |
| 536 | scanlines[SNES_SUBSCREEN].buffer[ii] = c; | |
| 537 | scanlines[SNES_SUBSCREEN].priority[ii] = priority; | |
| 538 | scanlines[SNES_SUBSCREEN].layer[ii] = SNES_OAM; | |
| 539 | scanlines[SNES_SUBSCREEN].blend_exception[ii] = blend; | |
| 401 | scanlines[screen].buffer[ii] = c; | |
| 402 | scanlines[screen].priority[ii] = priority; | |
| 403 | scanlines[screen].layer[ii] = SNES_OAM; | |
| 404 | scanlines[screen].blend_exception[ii] = blend; | |
| 405 | if (wide) | |
| 406 | { | |
| 407 | scanlines[screen].buffer[ii + 1] = c; | |
| 408 | scanlines[screen].priority[ii + 1] = priority; | |
| 409 | scanlines[screen].layer[ii + 1] = SNES_OAM; | |
| 410 | scanlines[screen].blend_exception[ii + 1] = blend; | |
| 540 | 411 | } |
| 541 | 412 | } |
| 542 | 413 | } |
| r7500 | r7501 | |
| 548 | 419 | * |
| 549 | 420 | * Update an entire line of tiles. |
| 550 | 421 | *********************************************/ |
| 551 | ||
| 552 | INLINE UINT32 snes_get_tmap( UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y ) | |
| 422 | INLINE void snes_update_line( UINT8 screen, UINT8 color_depth, UINT8 hires, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline, UINT8 offset_per_tile, UINT8 direct_colors ) | |
| 553 | 423 | { |
| 554 | UINT32 res = base; | |
| 555 | x >>= (3 + tile_size); | |
| 556 | y >>= (3 + tile_size); | |
| 557 | ||
| 558 | res += (snes_ppu.layer[layer].tilemap_size & 2) ? ((y & 0x20) << ((snes_ppu.layer[layer].tilemap_size & 1) ? 7 : 6)) : 0; | |
| 559 | /* Scroll vertically */ | |
| 560 | res += (y & 0x1f) << 6; | |
| 561 | /* Offset horizontally */ | |
| 562 | res += (snes_ppu.layer[layer].tilemap_size & 1) ? ((x & 0x20) << 6) : 0; | |
| 563 | /* Scroll horizontally */ | |
| 564 | res += (x & 0x1f) << 1; | |
| 565 | ||
| 566 | return res; | |
| 567 | } | |
| 568 | ||
| 569 | INLINE void snes_update_line( UINT8 color_depth, UINT8 hires, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline, UINT8 offset_per_tile, UINT8 direct_colors ) | |
| 570 | { | |
| 571 | UINT32 tmap, tile, xoff, yoff; | |
| 572 | UINT16 ii = 0, vflip, hflip, pal; | |
| 424 | UINT32 tmap, tile; | |
| 425 | UINT16 ii, vflip, hflip, pal; | |
| 573 | 426 | INT8 tile_line; |
| 574 | 427 | UINT8 priority; |
| 575 | 428 | /* scrolling */ |
| 576 | UINT32 charaddr; | |
| 429 | UINT32 basevmap, charaddr; | |
| 577 | 430 | UINT16 vscroll, hscroll; |
| 578 | UINT16 opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0; | |
| 431 | // UINT16 offset_per_tile_valid; | |
| 432 | // UINT8 offset_per_tile_mode; | |
| 579 | 433 | UINT8 vshift, hshift, tile_size; |
| 580 | 434 | /* variables depending on color_depth */ |
| 581 | 435 | UINT8 color_shift = 0; |
| 582 | 436 | UINT8 color_planes = 2; |
| 583 | 437 | UINT8 tile_divider = 1; |
| 438 | UINT8 wrap_around_x; //helper for wrap-around | |
| 584 | 439 | |
| 585 | 440 | #ifdef SNES_LAYER_DEBUG |
| 586 | 441 | if (debug_options.bg_disabled[layer]) |
| 587 | 442 | return; |
| 588 | #endif /* SNES_LAYER_DEBUG */ | |
| 589 | 443 | |
| 590 | scanlines[SNES_MAINSCREEN].enable = snes_ppu.main_bg_enabled[layer]; | |
| 591 | scanlines[SNES_SUBSCREEN].enable = snes_ppu.sub_bg_enabled[layer]; | |
| 592 | scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[layer].main_window_enabled; | |
| 593 | scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[layer].sub_window_enabled; | |
| 594 | ||
| 595 | if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) | |
| 444 | if (debug_options.mode_disabled[snes_ppu.mode]) | |
| 596 | 445 | return; |
| 446 | #endif /* SNES_LAYER_DEBUG */ | |
| 597 | 447 | |
| 598 | 448 | /* Handle Mosaic effects */ |
| 599 | 449 | if (snes_ppu.layer[layer].mosaic_enabled) |
| r7500 | r7501 | |
| 611 | 461 | vscroll = ((snes_ppu.layer[layer].voffs & 0x3ff) + curline) >> (3 + tile_size); |
| 612 | 462 | vshift = ((snes_ppu.layer[layer].voffs & 0x3ff) + curline) & ((8 << tile_size) - 1); |
| 613 | 463 | |
| 614 | xoff = snes_ppu.layer[layer].hoffs; | |
| 615 | yoff = snes_ppu.layer[layer].voffs; | |
| 616 | ||
| 617 | 464 | /* figure out which line to draw */ |
| 618 | 465 | if (vshift > ((8 << tile_size) - 1)) /* scrolled into the next tile */ |
| 619 | 466 | { |
| r7500 | r7501 | |
| 627 | 474 | tmap = snes_ppu.layer[layer].tilemap << 9; |
| 628 | 475 | charaddr = snes_ppu.layer[layer].charmap << 13; |
| 629 | 476 | |
| 477 | /* Offset vertically */ | |
| 478 | tmap += (snes_ppu.layer[layer].tilemap_size & 2) ? ((vscroll & 0x20) << ((snes_ppu.layer[layer].tilemap_size & 1) ? 7 : 6)) : 0; | |
| 479 | /* Scroll vertically */ | |
| 480 | tmap += (vscroll & 0x1f) << 6; | |
| 481 | /* Remember this position */ | |
| 482 | basevmap = tmap; | |
| 483 | /* Offset horizontally */ | |
| 484 | tmap += (snes_ppu.layer[layer].tilemap_size & 1) ? ((hscroll & 0x20) << 6) : 0; | |
| 485 | /* Scroll horizontally */ | |
| 486 | tmap += (hscroll & 0x1f) << 1; | |
| 487 | ||
| 630 | 488 | /* set a couple of variables depending on color_dept */ |
| 631 | 489 | switch (color_depth) |
| 632 | 490 | { |
| r7500 | r7501 | |
| 647 | 505 | break; |
| 648 | 506 | } |
| 649 | 507 | |
| 650 | while (ii < 256) | |
| 508 | wrap_around_x = 1; | |
| 509 | ||
| 510 | for (ii = 0; ii < (66*(hires+1) >> tile_size); ii += 2) | |
| 651 | 511 | { |
| 512 | /* Have we scrolled into the next map? */ | |
| 513 | if (wrap_around_x && ((ii >> 1) >= 32 - (hscroll & 0x1f))) | |
| 514 | { | |
| 515 | tmap = basevmap + table_hscroll[snes_ppu.layer[layer].tilemap_size & 3][((hscroll >> 5) + 1) & 3]; | |
| 516 | tmap -= ii; | |
| 517 | wrap_around_x = 0; /* Make sure we don't do this again */ | |
| 518 | } | |
| 519 | //if (tmap > 0x10000) | |
| 520 | // tmap %= 0x10000; | |
| 521 | ||
| 652 | 522 | /* |
| 653 | 523 | Tilemap format |
| 654 | 524 | vhopppcc cccccccc |
| r7500 | r7501 | |
| 658 | 528 | ppp = Tile palette. The number of entries in the palette depends on the Mode and the BG. |
| 659 | 529 | cccccccccc = Tile number. |
| 660 | 530 | */ |
| 661 | ||
| 662 | // determine the horizontal position (Bishojo Janshi Suchi Pai & Desert Figther have tile_size & hires == 1) | |
| 663 | UINT32 xpos = xoff + (ii << (tile_size * hires)); | |
| 664 | UINT32 ypos = yoff + curline; | |
| 665 | ||
| 666 | if (offset_per_tile != SNES_OPT_NONE) | |
| 667 | { | |
| 668 | int opt_x = ii + (xoff & 7); | |
| 669 | UINT32 haddr = 0, vaddr = 0; | |
| 670 | UINT16 hval = 0, vval = 0; | |
| 671 | ||
| 672 | if (opt_x >= 8) | |
| 673 | { | |
| 674 | switch (offset_per_tile) | |
| 675 | { | |
| 676 | case SNES_OPT_MODE2: | |
| 677 | case SNES_OPT_MODE6: | |
| 678 | haddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); | |
| 679 | vaddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff) + 8); | |
| 680 | hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); | |
| 681 | vval = snes_vram[vaddr] | (snes_vram[vaddr + 1] << 8); | |
| 682 | if (BIT(hval, opt_bit)) | |
| 683 | xpos = opt_x + (hval & ~7); | |
| 684 | if (BIT(vval, opt_bit)) | |
| 685 | ypos = curline + vval; | |
| 686 | break; | |
| 687 | case SNES_OPT_MODE4: | |
| 688 | haddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); | |
| 689 | hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); | |
| 690 | if (BIT(hval, opt_bit)) | |
| 691 | { | |
| 692 | if (!BIT(hval, 15)) | |
| 693 | xpos = opt_x + (hval & ~7); | |
| 694 | else | |
| 695 | ypos = curline + hval; | |
| 696 | } | |
| 697 | break; | |
| 698 | } | |
| 699 | ||
| 700 | } | |
| 701 | } | |
| 702 | ||
| 703 | UINT32 addr = snes_get_tmap(layer, tile_size, tmap, xpos, ypos); | |
| 704 | UINT16 tilemap = snes_vram[addr] | (snes_vram[addr + 1] << 8); | |
| 531 | UINT16 tilemap = snes_vram[tmap + ii] | (snes_vram[tmap + ii + 1] << 8); | |
| 705 | 532 | vflip = BIT(tilemap, 15); |
| 706 | 533 | hflip = BIT(tilemap, 14); |
| 707 | 534 | priority = BIT(tilemap, 13) ? priority_b : priority_a; |
| r7500 | r7501 | |
| 741 | 568 | tile_line <<= 1; |
| 742 | 569 | |
| 743 | 570 | /* below, only color_planes depends on color_depth */ |
| 744 | if ( | |
| 571 | if (tile_s | |
| 745 | 572 | { |
| 746 | snes_draw_tile_x2(color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ii * 2, priority, hflip, pal, direct_colors, hires); | |
| 747 | ii += 8; | |
| 573 | snes_draw_tile_x2(screen, color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ((ii >> 1) * (8 << tile_size)) - hshift, priority, hflip, pal, direct_colors); | |
| 748 | 574 | } |
| 749 | 575 | else /* tile_size = 0 */ |
| 750 | 576 | { |
| 751 | if (tile_size) | |
| 752 | { | |
| 753 | snes_draw_tile_x2(color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ii, priority, hflip, pal, direct_colors, hires); | |
| 754 | ii += 16; | |
| 755 | } | |
| 577 | if (hires) /* Hi-Res: 2bpp & 4bpp */ | |
| 578 | snes_draw_tile_x2(screen, color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ((ii >> 1) * (8 << (tile_size + 1))) - (hshift << 1), priority, hflip, pal, direct_colors); | |
| 756 | 579 | else /* No Hi-Res: 2bpp, 4bpp & 8bpp */ |
| 757 | { | |
| 758 | snes_draw_tile(color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ii, priority, hflip, pal, direct_colors, hires); | |
| 759 | ii += 8; | |
| 760 | } | |
| 580 | snes_draw_tile(screen, color_planes, layer, charaddr + (tile * 8 * color_planes) + tile_line, ((ii >> 1) * (8 << tile_size)) - hshift, priority, hflip, pal, direct_colors); | |
| 761 | 581 | } |
| 762 | 582 | } |
| 763 | 583 | } |
| r7500 | r7501 | |
| 768 | 588 | * |
| 769 | 589 | * Update an entire line of mode7 tiles. |
| 770 | 590 | *********************************************/ |
| 771 | ||
| 772 | 591 | #define MODE7_CLIP(x) (((x) & 0x2000) ? ((x) | ~0x03ff) : ((x) & 0x03ff)) |
| 773 | 592 | |
| 774 | static void snes_update_line_mode7( UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline ) | |
| 593 | static void snes_update_line_mode7(UINT8 screen, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline ) | |
| 775 | 594 | { |
| 776 | 595 | UINT32 tiled; |
| 777 | 596 | INT16 ma, mb, mc, md; |
| 778 | 597 | INT32 xc, yc, tx, ty, sx, sy, hs, vs, xpos, xdir, x0, y0; |
| 779 | 598 | UINT8 priority = priority_a; |
| 780 | UINT8 colour = 0; | |
| 599 | UINT8 colour = 0, window_enabled = 0; | |
| 781 | 600 | UINT16 *mosaic_x, *mosaic_y; |
| 782 | 601 | |
| 783 | 602 | #ifdef SNES_LAYER_DEBUG |
| 784 | 603 | if (debug_options.bg_disabled[layer]) |
| 785 | 604 | return; |
| 786 | #endif /* SNES_LAYER_DEBUG */ | |
| 787 | 605 | |
| 788 | scanlines[SNES_MAINSCREEN].enable = snes_ppu.main_bg_enabled[layer]; | |
| 789 | scanlines[SNES_SUBSCREEN].enable = snes_ppu.sub_bg_enabled[layer]; | |
| 790 | scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[layer].main_window_enabled; | |
| 791 | scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[layer].sub_window_enabled; | |
| 792 | ||
| 793 | if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) | |
| 606 | if (debug_options.mode_disabled[snes_ppu.mode]) | |
| 794 | 607 | return; |
| 608 | #endif /* SNES_LAYER_DEBUG */ | |
| 795 | 609 | |
| 796 | 610 | ma = snes_ppu.mode7.matrix_a; |
| 797 | 611 | mb = snes_ppu.mode7.matrix_b; |
| r7500 | r7501 | |
| 887 | 701 | colour &= 0x7f; |
| 888 | 702 | } |
| 889 | 703 | |
| 890 | if (scanlines[SNES_MAINSCREEN].enable) | |
| 891 | { | |
| 892 | if (scanlines[SNES_MAINSCREEN].clip) | |
| 893 | colour &= snes_ppu.clipmasks[layer][xpos]; | |
| 704 | window_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.layer[layer].main_window_enabled : snes_ppu.layer[layer].sub_window_enabled; | |
| 705 | if (window_enabled) | |
| 706 | colour &= snes_ppu.clipmasks[layer][xpos]; | |
| 894 | 707 | |
| 895 | /* Draw pixel if appropriate */ | |
| 896 | if (scanlines[SNES_MAINSCREEN].priority[xpos] <= priority && colour > 0) | |
| 897 | { | |
| 898 | UINT16 clr; | |
| 899 | /* Direct select, but only outside EXTBG! */ | |
| 900 | if (snes_ppu.direct_color && layer == 0) | |
| 901 | { | |
| 902 | /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ | |
| 903 | clr = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 904 | } | |
| 905 | else | |
| 906 | clr = snes_cgram[colour]; | |
| 907 | ||
| 908 | scanlines[SNES_MAINSCREEN].buffer[xpos] = clr; | |
| 909 | scanlines[SNES_MAINSCREEN].priority[xpos] = priority; | |
| 910 | scanlines[SNES_MAINSCREEN].layer[xpos] = layer; | |
| 911 | } | |
| 912 | } | |
| 913 | ||
| 914 | if (scanlines[SNES_SUBSCREEN].enable) | |
| 708 | /* Draw pixel if appropriate */ | |
| 709 | if (scanlines[screen].priority[xpos] <= priority && colour > 0) | |
| 915 | 710 | { |
| 916 | if (scanlines[SNES_SUBSCREEN].clip) | |
| 917 | colour &= snes_ppu.clipmasks[layer][xpos]; | |
| 918 | ||
| 919 | /* Draw pixel if appropriate */ | |
| 920 | if (scanlines[SNES_SUBSCREEN].priority[xpos] <= priority && colour > 0) | |
| 711 | UINT16 clr; | |
| 712 | /* Direct select, but only outside EXTBG! */ | |
| 713 | if (snes_ppu.direct_color && layer == 0) | |
| 921 | 714 | { |
| 922 | UINT16 clr; | |
| 923 | /* Direct select, but only outside EXTBG! */ | |
| 924 | if (snes_ppu.direct_color && layer == 0) | |
| 925 | { | |
| 926 | /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ | |
| 927 | clr = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 928 | } | |
| 929 | else | |
| 930 | clr = snes_cgram[colour]; | |
| 931 | ||
| 932 | scanlines[SNES_SUBSCREEN].buffer[xpos] = clr; | |
| 933 | scanlines[SNES_SUBSCREEN].priority[xpos] = priority; | |
| 934 | scanlines[SNES_SUBSCREEN].layer[xpos] = layer; | |
| 715 | /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ | |
| 716 | clr = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); | |
| 935 | 717 | } |
| 718 | else | |
| 719 | clr = snes_cgram[colour]; | |
| 720 | ||
| 721 | scanlines[screen].buffer[xpos] = clr; | |
| 722 | scanlines[screen].priority[xpos] = priority; | |
| 723 | scanlines[screen].layer[xpos] = layer; | |
| 936 | 724 | } |
| 937 | 725 | } |
| 938 | 726 | } |
| r7500 | r7501 | |
| 943 | 731 | * Update an entire line of sprites. |
| 944 | 732 | * FIXME: We need to support high priority bit |
| 945 | 733 | *********************************************/ |
| 946 | ||
| 947 | static void snes_update_objects( UINT8 priority_tbl, UINT16 curline ) | |
| 734 | static void snes_update_objects( UINT8 screen, UINT8 priority_tbl, UINT16 curline ) | |
| 948 | 735 | { |
| 949 | 736 | INT8 xs, ys; |
| 950 | UINT8 line; | |
| 737 | UINT8 line, widemode = 0; | |
| 951 | 738 | UINT16 oam_extra, extra; |
| 952 | 739 | INT16 oam; |
| 953 | 740 | UINT8 range_over = 0, time_over = 0; |
| r7500 | r7501 | |
| 970 | 757 | }; |
| 971 | 758 | |
| 972 | 759 | #ifdef SNES_LAYER_DEBUG |
| 973 | if (debug_options.bg_disabled[ | |
| 760 | if (debug_options.bg_disabled[4 | |
| 974 | 761 | return; |
| 975 | 762 | #endif /* SNES_LAYER_DEBUG */ |
| 976 | 763 | |
| 977 | scanlines[SNES_MAINSCREEN].enable = snes_ppu.main_bg_enabled[SNES_OAM]; | |
| 978 | scanlines[SNES_SUBSCREEN].enable = snes_ppu.sub_bg_enabled[SNES_OAM]; | |
| 979 | scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[SNES_OAM].main_window_enabled; | |
| 980 | scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[SNES_OAM].sub_window_enabled; | |
| 764 | if (snes_ppu.mode == 5 || snes_ppu.mode == 6) | |
| 765 | widemode = 1; | |
| 981 | 766 | |
| 982 | if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) | |
| 983 | return; | |
| 984 | ||
| 985 | 767 | curline /= snes_ppu.interlace; |
| 986 | 768 | curline *= snes_ppu.obj_interlace; |
| 987 | 769 | |
| r7500 | r7501 | |
| 1007 | 789 | extra <<= 1; |
| 1008 | 790 | x |= ((extra & 0x80) << 1); |
| 1009 | 791 | extra <<= 1; |
| 1010 | y | |
| 792 | y | |
| 1011 | 793 | |
| 1012 | 794 | /* Adjust if past maximum position */ |
| 1013 | 795 | if (y >= snes_ppu.beam.last_visible_line*snes_ppu.interlace) |
| r7500 | r7501 | |
| 1040 | 822 | { |
| 1041 | 823 | if ((x + (count << 3) < SNES_SCR_WIDTH + 8)) |
| 1042 | 824 | { |
| 1043 | snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (count++ << 3), priority, hflip, pal, blend); | |
| 825 | if (widemode) | |
| 826 | snes_draw_tile_object(screen, charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (count++ << 3), priority, hflip, pal, blend, 1); | |
| 827 | else | |
| 828 | snes_draw_tile_object(screen, charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (count++ << 3), priority, hflip, pal, blend, 0); | |
| 1044 | 829 | } |
| 1045 | 830 | time_over++; /* Increase time_over. Should we stop drawing if exceeded 34 tiles? */ |
| 1046 | 831 | } |
| r7500 | r7501 | |
| 1051 | 836 | { |
| 1052 | 837 | if ((x + (xs << 3) < SNES_SCR_WIDTH + 8)) |
| 1053 | 838 | { |
| 1054 | snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (xs << 3), priority, hflip, pal, blend); | |
| 839 | if (widemode) | |
| 840 | snes_draw_tile_object(screen, charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (xs << 3), priority, hflip, pal, blend, 1); | |
| 841 | else | |
| 842 | snes_draw_tile_object(screen, charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (xs << 3), priority, hflip, pal, blend, 0); | |
| 1055 | 843 | } |
| 1056 | 844 | time_over++; /* Increase time_over. Should we stop drawing if exceeded 34 tiles? */ |
| 1057 | 845 | } |
| r7500 | r7501 | |
| 1082 | 870 | * |
| 1083 | 871 | * Update Mode X line. |
| 1084 | 872 | *********************************************/ |
| 1085 | ||
| 1086 | static void snes_update_mode_0( UINT16 curline ) | |
| 873 | static void snes_update_mode_0( UINT8 screen, UINT16 curline ) | |
| 1087 | 874 | { |
| 1088 | #ifdef SNES_LAYER_DEBUG | |
| 1089 | if (debug_options.mode_disabled[0]) | |
| 1090 | return; | |
| 1091 | #endif /* SNES_LAYER_DEBUG */ | |
| 875 | UINT8 *bg_enabled; | |
| 876 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1092 | 877 | |
| 1093 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 3, SNES_BG4, curline, SNES_OPT_NONE, 0); | |
| 1094 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 1, 4, SNES_BG3, curline, SNES_OPT_NONE, 0); | |
| 1095 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 6, 9, SNES_BG2, curline, SNES_OPT_NONE, 0); | |
| 1096 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 7, 10, SNES_BG1, curline, SNES_OPT_NONE, 0); | |
| 1097 | snes_update_objects(0, curline); | |
| 878 | if (bg_enabled[4]) snes_update_objects(screen, 0, curline); | |
| 879 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 7, 10, SNES_BG1, curline, 0, 0); | |
| 880 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 6, 9, SNES_BG2, curline, 0, 0); | |
| 881 | if (bg_enabled[2]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 1, 4, SNES_BG3, curline, 0, 0); | |
| 882 | if (bg_enabled[3]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 0, 3, SNES_BG4, curline, 0, 0); | |
| 1098 | 883 | } |
| 1099 | 884 | |
| 1100 | static void snes_update_mode_1( UINT16 curline ) | |
| 885 | static void snes_update_mode_1( UINT8 screen, UINT16 curline ) | |
| 1101 | 886 | { |
| 1102 | #ifdef SNES_LAYER_DEBUG | |
| 1103 | if (debug_options.mode_disabled[1]) | |
| 1104 | return; | |
| 1105 | #endif /* SNES_LAYER_DEBUG */ | |
| 887 | UINT8 *bg_enabled; | |
| 888 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1106 | 889 | |
| 1107 | 890 | if (!snes_ppu.bg3_priority_bit) |
| 1108 | 891 | { |
| 1109 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 2, SNES_BG3, curline, SNES_OPT_NONE, 0); | |
| 1110 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG2, curline, SNES_OPT_NONE, 0); | |
| 1111 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 5, 8, SNES_BG1, curline, SNES_OPT_NONE, 0); | |
| 1112 | snes_update_objects(1, curline); | |
| 892 | if (bg_enabled[4]) snes_update_objects(screen, 1, curline); | |
| 893 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 5, 8, SNES_BG1, curline, 0, 0); | |
| 894 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG2, curline, 0, 0); | |
| 895 | if (bg_enabled[2]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 0, 2, SNES_BG3, curline, 0, 0); | |
| 1113 | 896 | } |
| 1114 | 897 | else |
| 1115 | 898 | { |
| 1116 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 9, SNES_BG3, curline, SNES_OPT_NONE, 0); | |
| 1117 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 3, 6, SNES_BG2, curline, SNES_OPT_NONE, 0); | |
| 1118 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG1, curline, SNES_OPT_NONE, 0); | |
| 1119 | snes_update_objects(9, curline); | |
| 899 | if (bg_enabled[4]) snes_update_objects(screen, 9, curline); | |
| 900 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG1, curline, 0, 0); | |
| 901 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 3, 6, SNES_BG2, curline, 0, 0); | |
| 902 | if (bg_enabled[2]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 0, 9, SNES_BG3, curline, 0, 0); | |
| 1120 | 903 | } |
| 1121 | 904 | } |
| 1122 | 905 | |
| 1123 | static void snes_update_mode_2( UINT16 curline ) | |
| 906 | static void snes_update_mode_2( UINT8 screen, UINT16 curline ) | |
| 1124 | 907 | { |
| 1125 | #ifdef SNES_LAYER_DEBUG | |
| 1126 | if (debug_options.mode_disabled[2]) | |
| 1127 | return; | |
| 1128 | #endif /* SNES_LAYER_DEBUG */ | |
| 908 | UINT8 *bg_enabled; | |
| 909 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1129 | 910 | |
| 1130 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_MODE2, 0); | |
| 1131 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_MODE2, 0); | |
| 1132 | snes_update_objects(2, curline); | |
| 911 | if (bg_enabled[4]) snes_update_objects(screen, 2, curline); | |
| 912 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 2, 6, SNES_BG1, curline, 1, 0); | |
| 913 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, 1, 0); | |
| 1133 | 914 | } |
| 1134 | 915 | |
| 1135 | static void snes_update_mode_3( UINT16 curline ) | |
| 916 | static void snes_update_mode_3( UINT8 screen, UINT16 curline ) | |
| 1136 | 917 | { |
| 1137 | #ifdef SNES_LAYER_DEBUG | |
| 1138 | if (debug_options.mode_disabled[3]) | |
| 1139 | return; | |
| 1140 | #endif /* SNES_LAYER_DEBUG */ | |
| 918 | UINT8 *bg_enabled; | |
| 919 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1141 | 920 | |
| 1142 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_NONE, 0); | |
| 1143 | snes_update_line(SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_NONE, snes_ppu.direct_color); | |
| 1144 | snes_update_objects(3, curline); | |
| 921 | if (bg_enabled[4]) snes_update_objects(screen, 3, curline); | |
| 922 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, 0, snes_ppu.direct_color); | |
| 923 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, 0, 0); | |
| 1145 | 924 | } |
| 1146 | 925 | |
| 1147 | static void snes_update_mode_4( UINT16 curline ) | |
| 926 | static void snes_update_mode_4( UINT8 screen, UINT16 curline ) | |
| 1148 | 927 | { |
| 1149 | #ifdef SNES_LAYER_DEBUG | |
| 1150 | if (debug_options.mode_disabled[4]) | |
| 1151 | return; | |
| 1152 | #endif /* SNES_LAYER_DEBUG */ | |
| 928 | UINT8 *bg_enabled; | |
| 929 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1153 | 930 | |
| 1154 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_MODE4, 0); | |
| 1155 | snes_update_line(SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_MODE4, snes_ppu.direct_color); | |
| 1156 | snes_update_objects(4, curline); | |
| 931 | if (bg_enabled[4]) snes_update_objects(screen, 4, curline); | |
| 932 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, 0, snes_ppu.direct_color); | |
| 933 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 0, 0, 4, SNES_BG2, curline, 0, 0); | |
| 1157 | 934 | } |
| 1158 | 935 | |
| 1159 | static void snes_update_mode_5( UINT16 curline ) | |
| 936 | static void snes_update_mode_5( UINT8 screen, UINT16 curline ) | |
| 1160 | 937 | { |
| 1161 | #ifdef SNES_LAYER_DEBUG | |
| 1162 | if (debug_options.mode_disabled[5]) | |
| 1163 | return; | |
| 1164 | #endif /* SNES_LAYER_DEBUG */ | |
| 938 | UINT8 *bg_enabled; | |
| 939 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1165 | 940 | |
| 1166 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 1, 2, 6, SNES_BG1, curline, SNES_OPT_NONE, 0); | |
| 1167 | snes_update_line(SNES_COLOR_DEPTH_2BPP, 1, 0, 4, SNES_BG2, curline, SNES_OPT_NONE, 0); | |
| 1168 | snes_update_objects(5, curline); | |
| 941 | if (bg_enabled[4]) snes_update_objects(screen, 5, curline); | |
| 942 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 1, 2, 6, SNES_BG1, curline, 0, 0); | |
| 943 | if (bg_enabled[1]) snes_update_line(screen, SNES_COLOR_DEPTH_2BPP, 1, 0, 4, SNES_BG2, curline, 0, 0); | |
| 1169 | 944 | } |
| 1170 | 945 | |
| 1171 | static void snes_update_mode_6( UINT16 curline ) | |
| 946 | static void snes_update_mode_6( UINT8 screen, UINT16 curline ) | |
| 1172 | 947 | { |
| 1173 | #ifdef SNES_LAYER_DEBUG | |
| 1174 | if (debug_options.mode_disabled[6]) | |
| 1175 | return; | |
| 1176 | #endif /* SNES_LAYER_DEBUG */ | |
| 948 | UINT8 *bg_enabled; | |
| 949 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1177 | 950 | |
| 1178 | snes_update_line(SNES_COLOR_DEPTH_4BPP, 1, 1, 4, SNES_BG1, curline, SNES_OPT_MODE6, 0); | |
| 1179 | snes_update_objects(6, curline); | |
| 951 | if (bg_enabled[4]) snes_update_objects(screen, 6, curline); | |
| 952 | if (bg_enabled[0]) snes_update_line(screen, SNES_COLOR_DEPTH_4BPP, 1, 1, 4, SNES_BG1, curline, 1, 0); | |
| 1180 | 953 | } |
| 1181 | 954 | |
| 1182 | static void snes_update_mode_7( UINT16 curline ) | |
| 955 | static void snes_update_mode_7( UINT8 screen, UINT16 curline ) | |
| 1183 | 956 | { |
| 1184 | #ifdef SNES_LAYER_DEBUG | |
| 1185 | if (debug_options.mode_disabled[7]) | |
| 1186 | return; | |
| 1187 | #endif /* SNES_LAYER_DEBUG */ | |
| 957 | UINT8 *bg_enabled; | |
| 958 | bg_enabled = (screen == SNES_MAINSCREEN) ? snes_ppu.main_bg_enabled : snes_ppu.sub_bg_enabled; | |
| 1188 | 959 | |
| 1189 | 960 | if (!snes_ppu.mode7.extbg) |
| 1190 | 961 | { |
| 1191 | snes_update_line_mode7(1, 1, SNES_BG1, curline); | |
| 1192 | snes_update_objects(7, curline); | |
| 962 | if (bg_enabled[4]) snes_update_objects(screen, 7, curline); | |
| 963 | if (bg_enabled[0]) snes_update_line_mode7(screen, 1, 1, SNES_BG1, curline); | |
| 1193 | 964 | } |
| 1194 | 965 | else |
| 1195 | 966 | { |
| 1196 | snes_update_line_mode7(0, 4, SNES_BG2, curline); | |
| 1197 | snes_update_line_mode7(2, 2, SNES_BG1, curline); | |
| 1198 | snes_update_objects(8, curline); | |
| 967 | if (bg_enabled[4]) snes_update_objects(screen, 8, curline); | |
| 968 | if (bg_enabled[0]) snes_update_line_mode7(screen, 2, 2, SNES_BG1, curline); | |
| 969 | if (bg_enabled[1]) snes_update_line_mode7(screen, 0, 4, SNES_BG2, curline); | |
| 1199 | 970 | } |
| 1200 | 971 | } |
| 1201 | 972 | |
| 1202 | 973 | /********************************************* |
| 1203 | * snes_draw_screen | |
| 974 | * snes_draw_screen | |
| 1204 | 975 | * |
| 1205 | 976 | * Draw the whole screen (Mode 0 -> 7). |
| 1206 | 977 | *********************************************/ |
| 1207 | ||
| 1208 | static void snes_draw_screens( UINT16 curline ) | |
| 978 | static void snes_draw_screen( UINT8 screen, UINT16 curline ) | |
| 1209 | 979 | { |
| 1210 | 980 | switch (snes_ppu.mode) |
| 1211 | 981 | { |
| 1212 | case 0: snes_update_mode_0(curline); break; /* Mode 0 */ | |
| 1213 | case 1: snes_update_mode_1(curline); break; /* Mode 1 */ | |
| 1214 | case 2: snes_update_mode_2(curline); break; /* Mode 2 - Supports offset per tile */ | |
| 1215 | case 3: snes_update_mode_3(curline); break; /* Mode 3 - Supports direct colour */ | |
| 1216 | case 4: snes_update_mode_4(curline); break; /* Mode 4 - Supports offset per tile and direct colour */ | |
| 1217 | case 5: snes_update_mode_5(curline); break; /* Mode 5 - Supports hires */ | |
| 1218 | case 6: snes_update_mode_6(curline); break; /* Mode 6 - Supports offset per tile and hires */ | |
| 1219 | case 7: snes_update_mode_7(curline); break; /* Mode 7 - Supports direct colour */ | |
| 982 | case 0: snes_update_mode_0(screen, curline); break; /* Mode 0 */ | |
| 983 | case 1: snes_update_mode_1(screen, curline); break; /* Mode 1 */ | |
| 984 | case 2: snes_update_mode_2(screen, curline); break; /* Mode 2 - Supports offset per tile */ | |
| 985 | case 3: snes_update_mode_3(screen, curline); break; /* Mode 3 - Supports direct colour */ | |
| 986 | case 4: snes_update_mode_4(screen, curline); break; /* Mode 4 - Supports offset per tile and direct colour */ | |
| 987 | case 5: snes_update_mode_5(screen, curline); break; /* Mode 5 - Supports hires */ | |
| 988 | case 6: snes_update_mode_6(screen, curline); break; /* Mode 6 - Supports offset per tile and hires */ | |
| 989 | case 7: snes_update_mode_7(screen, curline); break; /* Mode 7 - Supports direct colour */ | |
| 1220 | 990 | } |
| 1221 | 991 | } |
| 1222 | 992 | |
| r7500 | r7501 | |
| 1232 | 1002 | * XOR: ...###..###... ###...##...### |
| 1233 | 1003 | * XNOR: ###...##...### ...###..###... |
| 1234 | 1004 | *********************************************/ |
| 1235 | ||
| 1236 | static void snes_update_windowmasks( void ) | |
| 1005 | static void snes_update_windowmasks(void) | |
| 1237 | 1006 | { |
| 1238 | 1007 | UINT16 ii, jj; |
| 1239 | 1008 | INT8 w1, w2; |
| r7500 | r7501 | |
| 1304 | 1073 | * |
| 1305 | 1074 | * Update the offsets with the latest changes. |
| 1306 | 1075 | *********************************************/ |
| 1307 | ||
| 1308 | static void snes_update_offsets( void ) | |
| 1076 | static void snes_update_offsets(void) | |
| 1309 | 1077 | { |
| 1310 | 1078 | int ii; |
| 1311 | 1079 | for (ii = 0; ii < 4; ii++) |
| r7500 | r7501 | |
| 1319 | 1087 | * |
| 1320 | 1088 | * Redraw the current line. |
| 1321 | 1089 | *********************************************/ |
| 1322 | ||
| 1323 | 1090 | static void snes_refresh_scanline( running_machine *machine, bitmap_t *bitmap, UINT16 curline ) |
| 1324 | 1091 | { |
| 1325 | 1092 | UINT16 ii; |
| r7500 | r7501 | |
| 1366 | 1133 | scanlines[SNES_MAINSCREEN].buffer[ii] = snes_cgram[0]; |
| 1367 | 1134 | } |
| 1368 | 1135 | |
| 1369 | /* Draw screens */ | |
| 1370 | snes_draw_screens(curline); | |
| 1136 | /* Draw SNES_SUBSCREEN */ | |
| 1137 | snes_draw_screen(SNES_SUBSCREEN, curline); | |
| 1371 | 1138 | |
| 1139 | /* Draw SNES_MAINSCREEN */ | |
| 1140 | snes_draw_screen(SNES_MAINSCREEN, curline); | |
| 1141 | ||
| 1372 | 1142 | #ifdef SNES_LAYER_DEBUG |
| 1373 | 1143 | if (snes_dbg_video(machine, bitmap, curline)) |
| 1374 | 1144 | { |
| r7500 | r7501 | |
| 1386 | 1156 | /* Phew! Draw the line to screen */ |
| 1387 | 1157 | fade = snes_ppu.screen_brightness; |
| 1388 | 1158 | |
| 1389 | for (x = 0; x < SNES_SCR_WIDTH * 2; x+ | |
| 1159 | for (x = 0; x < SNES_SCR_WIDTH * 2; x += 2) | |
| 1390 | 1160 | { |
| 1391 | int r, g, b, hires; | |
| 1392 | UINT16 temp_col; | |
| 1393 | hires = (snes_ppu.mode != 5 && snes_ppu.mode != 6) ? 0 : 1; | |
| 1394 | c = scanline->buffer[x]; | |
| 1395 | temp_col = scanline->buffer[x]; | |
| 1161 | if (snes_ppu.mode != 5 && snes_ppu.mode != 6) | |
| 1162 | { | |
| 1163 | int r, g, b; | |
| 1164 | c = scanline->buffer[x]; | |
| 1396 | 1165 | |
| 1397 | /* perform color math if the layer wants it (except if it's an object > 192) */ | |
| 1398 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) | |
| 1399 | snes_draw_blend(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1166 | /* perform color math if the layer wants it (except if it's an object > 192) */ | |
| 1167 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) | |
| 1168 | snes_draw_blend_lores(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1400 | 1169 | |
| 1401 | r = ((c & 0x1f) * fade) >> 4; | |
| 1402 | g = (((c & 0x3e0) >> 5) * fade) >> 4; | |
| 1403 | b = (((c & 0x7c00) >> 10) * fade) >> 4; | |
| 1170 | r = ((c & 0x1f) * fade) >> 4; | |
| 1171 | g = (((c & 0x3e0) >> 5) * fade) >> 4; | |
| 1172 | b = (((c & 0x7c00) >> 10) * fade) >> 4; | |
| 1404 | 1173 | |
| 1405 | *BITMAP_ADDR32(bitmap, curline, x * 2 + 0) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 1406 | ||
| 1407 | if (!hires) | |
| 1174 | *BITMAP_ADDR32(bitmap, curline, x * 2 + 0) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 1408 | 1175 | *BITMAP_ADDR32(bitmap, curline, x * 2 + 1) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); |
| 1176 | ||
| 1177 | c = scanline->buffer[x + 1]; | |
| 1178 | ||
| 1179 | /* perform color math if the layer wants it (except if it's an object > 192) */ | |
| 1180 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x + 1] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x + 1]].color_math) | |
| 1181 | snes_draw_blend_lores(x + 1, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1182 | ||
| 1183 | r = ((c & 0x1f) * fade) >> 4; | |
| 1184 | g = (((c & 0x3e0) >> 5) * fade) >> 4; | |
| 1185 | b = (((c & 0x7c00) >> 10) * fade) >> 4; | |
| 1186 | ||
| 1187 | *BITMAP_ADDR32(bitmap, curline, (x + 1) * 2 + 0) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 1188 | *BITMAP_ADDR32(bitmap, curline, (x + 1) * 2 + 1) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 1189 | ||
| 1190 | } | |
| 1409 | 1191 | else |
| 1410 | 1192 | { |
| 1193 | int r, g, b; | |
| 1194 | UINT16 temp_col; | |
| 1195 | c = scanline->buffer[x]; | |
| 1196 | temp_col = scanline->buffer[x]; | |
| 1197 | ||
| 1198 | /* perform color math if the layer wants it (except if it's an object > 192) */ | |
| 1199 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) | |
| 1200 | snes_draw_blend_hires(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1201 | ||
| 1202 | r = ((c & 0x1f) * fade) >> 4; | |
| 1203 | g = (((c & 0x3e0) >> 5) * fade) >> 4; | |
| 1204 | b = (((c & 0x7c00) >> 10) * fade) >> 4; | |
| 1205 | ||
| 1206 | *BITMAP_ADDR32(bitmap, curline, x) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 1207 | ||
| 1411 | 1208 | c = scanlines[SNES_SUBSCREEN].buffer[x]; |
| 1412 | 1209 | scanlines[SNES_SUBSCREEN].buffer[x] = temp_col; |
| 1413 | 1210 | |
| 1414 | if (!scanlines[SNES_SUBSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) | |
| 1415 | snes_draw_blend(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1211 | /* perform color math only if it's been done on the previous pixel */ | |
| 1212 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) | |
| 1213 | snes_draw_blend_hires(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); | |
| 1416 | 1214 | |
| 1417 | 1215 | r = ((c & 0x1f) * fade) >> 4; |
| 1418 | 1216 | g = (((c & 0x3e0) >> 5) * fade) >> 4; |
| 1419 | 1217 | b = (((c & 0x7c00) >> 10) * fade) >> 4; |
| 1420 | 1218 | |
| 1421 | *BITMAP_ADDR32(bitmap, curline, x | |
| 1219 | *BITMAP_ADDR32(bitmap, curline, x | |
| 1422 | 1220 | } |
| 1423 | 1221 | } |
| 1424 | 1222 | } |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #include "profiler.h" |
| 15 | 15 | #include "includes/mcatadv.h" |
| 16 | 16 | |
| 17 | static tilemap_t *mcatadv_tilemap1, *mcatadv_tilemap2; | |
| 18 | static UINT16 *spriteram_old, *vidregs_old; | |
| 19 | static int palette_bank1, palette_bank2; | |
| 20 | ||
| 21 | ||
| 22 | 17 | static TILE_GET_INFO( get_mcatadv_tile_info1 ) |
| 23 | 18 | { |
| 24 | int tileno, colour, pri; | |
| 19 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 20 | int tileno = state->videoram1[tile_index * 2 + 1]; | |
| 21 | int colour = (state->videoram1[tile_index * 2] & 0x3f00) >> 8; | |
| 22 | int pri = (state->videoram1[tile_index * 2] & 0xc000) >> 14; | |
| 25 | 23 | |
| 26 | tileno = mcatadv_videoram1[tile_index*2+1]; | |
| 27 | colour = (mcatadv_videoram1[tile_index*2] & 0x3f00)>>8; | |
| 28 | pri = (mcatadv_videoram1[tile_index*2] & 0xc000)>>14; | |
| 29 | ||
| 30 | SET_TILE_INFO(0,tileno,colour + palette_bank1*0x40,0); | |
| 24 | SET_TILE_INFO(0,tileno,colour + state->palette_bank1 * 0x40, 0); | |
| 31 | 25 | tileinfo->category = pri; |
| 32 | 26 | } |
| 33 | 27 | |
| 34 | 28 | WRITE16_HANDLER( mcatadv_videoram1_w ) |
| 35 | 29 | { |
| 36 | COMBINE_DATA(&mcatadv_videoram1[offset]); | |
| 37 | tilemap_mark_tile_dirty(mcatadv_tilemap1,offset/2); | |
| 30 | mcatadv_state *state = (mcatadv_state *)space->machine->driver_data; | |
| 31 | ||
| 32 | COMBINE_DATA(&state->videoram1[offset]); | |
| 33 | tilemap_mark_tile_dirty(state->tilemap1, offset / 2); | |
| 38 | 34 | } |
| 39 | 35 | |
| 40 | 36 | static TILE_GET_INFO( get_mcatadv_tile_info2 ) |
| 41 | 37 | { |
| 42 | int tileno, colour, pri; | |
| 38 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 39 | int tileno = state->videoram2[tile_index * 2 + 1]; | |
| 40 | int colour = (state->videoram2[tile_index * 2] & 0x3f00) >> 8; | |
| 41 | int pri = (state->videoram2[tile_index * 2] & 0xc000) >> 14; | |
| 43 | 42 | |
| 44 | tileno = mcatadv_videoram2[tile_index*2+1]; | |
| 45 | colour = (mcatadv_videoram2[tile_index*2] & 0x3f00)>>8; | |
| 46 | pri = (mcatadv_videoram2[tile_index*2] & 0xc000)>>14; | |
| 47 | ||
| 48 | SET_TILE_INFO(1,tileno,colour + palette_bank2*0x40,0); | |
| 43 | SET_TILE_INFO(1, tileno, colour + state->palette_bank2 * 0x40, 0); | |
| 49 | 44 | tileinfo->category = pri; |
| 50 | 45 | } |
| 51 | 46 | |
| 52 | 47 | WRITE16_HANDLER( mcatadv_videoram2_w ) |
| 53 | 48 | { |
| 54 | COMBINE_DATA(&mcatadv_videoram2[offset]); | |
| 55 | tilemap_mark_tile_dirty(mcatadv_tilemap2,offset/2); | |
| 49 | mcatadv_state *state = (mcatadv_state *)space->machine->driver_data; | |
| 50 | ||
| 51 | COMBINE_DATA(&state->videoram2[offset]); | |
| 52 | tilemap_mark_tile_dirty(state->tilemap2, offset / 2); | |
| 56 | 53 | } |
| 57 | 54 | |
| 58 | 55 | |
| 59 | 56 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 60 | 57 | { |
| 61 | UINT16 *source = spriteram_old; | |
| 62 | UINT16 *finish = source + (machine->generic.spriteram_size/2)/2; | |
| 63 | int global_x = mcatadv_vidregs[0]-0x184; | |
| 64 | int global_y = mcatadv_vidregs[1]-0x1f1; | |
| 58 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 59 | UINT16 *source = state->spriteram_old; | |
| 60 | UINT16 *finish = source + (state->spriteram_size / 2) / 2; | |
| 61 | int global_x = state->vidregs[0] - 0x184; | |
| 62 | int global_y = state->vidregs[1] - 0x1f1; | |
| 65 | 63 | |
| 66 | 64 | UINT16 *destline; |
| 67 | 65 | UINT8 *priline; |
| 68 | UINT8 *sprdata = memory_region | |
| 66 | UINT8 *sprdata = memory_region | |
| 69 | 67 | |
| 70 | 68 | int xstart, xend, xinc; |
| 71 | 69 | int ystart, yend, yinc; |
| 72 | 70 | |
| 73 | if | |
| 71 | if | |
| 74 | 72 | { |
| 75 | source += (machine->generic.spriteram_size/2)/2; | |
| 76 | finish += (machine->generic.spriteram_size/2)/2; | |
| 73 | source += (state->spriteram_size / 2) / 2; | |
| 74 | finish += (state->spriteram_size / 2) / 2; | |
| 77 | 75 | } |
| 78 | else if | |
| 76 | else if | |
| 79 | 77 | { |
| 80 | 78 | logerror("Spritebank != 0/1\n"); |
| 81 | 79 | } |
| 82 | 80 | |
| 83 | while ( | |
| 81 | while ( | |
| 84 | 82 | { |
| 85 | int pen = (source[0]&0x3f00)>>8; | |
| 86 | int tileno = source[1]&0xffff; | |
| 87 | int pri = (source[0]&0xc000)>>14; | |
| 88 | int x = source[2]&0x3ff; | |
| 89 | int y = source[3]&0x3ff; | |
| 83 | int pen = (source[0] & 0x3f00) >> 8; | |
| 84 | int tileno = source[1] & 0xffff; | |
| 85 | int pri = (source[0] & 0xc000) >> 14; | |
| 86 | int x = source[2] & 0x3ff; | |
| 87 | int y = source[3] & 0x3ff; | |
| 90 | 88 | int flipy = source[0] & 0x0040; |
| 91 | 89 | int flipx = source[0] & 0x0080; |
| 92 | 90 | |
| 93 | int height = ((source[3]&0xf000)>>12)*16; | |
| 94 | int width = ((source[2]&0xf000)>>12)*16; | |
| 91 | int height = ((source[3] & 0xf000) >> 12) * 16; | |
| 92 | int width = ((source[2] & 0xf000) >> 12) * 16; | |
| 95 | 93 | int offset = tileno * 256; |
| 96 | 94 | |
| 97 | 95 | int drawxpos, drawypos; |
| 98 | int xcnt,ycnt; | |
| 96 | int xcnt, ycnt; | |
| 99 | 97 | int pix; |
| 100 | 98 | |
| 101 | 99 | if (x & 0x200) x-=0x400; |
| 102 | 100 | if (y & 0x200) y-=0x400; |
| 103 | 101 | |
| 104 | 102 | #if 0 // For Flipscreen/Cocktail |
| 105 | if( | |
| 103 | if(s | |
| 106 | 104 | { |
| 107 | 105 | flipx = !flipx; |
| 108 | 106 | } |
| 109 | if( | |
| 107 | if(s | |
| 110 | 108 | { |
| 111 | 109 | flipy = !flipy; |
| 112 | 110 | } |
| r7500 | r7501 | |
| 119 | 117 | if(!flipy) { ystart = 0; yend = height; yinc = 1; } |
| 120 | 118 | else { ystart = height-1; yend = -1; yinc = -1; } |
| 121 | 119 | |
| 122 | for (ycnt = ystart; ycnt != yend; ycnt += yinc) { | |
| 123 | drawypos = y+ycnt-global_y; | |
| 120 | for (ycnt = ystart; ycnt != yend; ycnt += yinc) | |
| 121 | { | |
| 122 | drawypos = y + ycnt - global_y; | |
| 124 | 123 | |
| 125 | if ((drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y)) { | |
| 124 | if ((drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y)) | |
| 125 | { | |
| 126 | 126 | destline = BITMAP_ADDR16(bitmap, drawypos, 0); |
| 127 | 127 | priline = BITMAP_ADDR8(machine->priority_bitmap, drawypos, 0); |
| 128 | 128 | |
| 129 | for (xcnt = xstart; xcnt != xend; xcnt += xinc) { | |
| 130 | drawxpos = x+xcnt-global_x; | |
| 129 | for (xcnt = xstart; xcnt != xend; xcnt += xinc) | |
| 130 | { | |
| 131 | drawxpos = x + xcnt - global_x; | |
| 131 | 132 | |
| 132 | if((priline[drawxpos] < pri)) { | |
| 133 | if (offset >= 0x500000*2) offset = 0; | |
| 134 | pix = sprdata[offset/2]; | |
| 133 | if((priline[drawxpos] < pri)) | |
| 134 | { | |
| 135 | if (offset >= 0x500000 * 2) | |
| 136 | offset = 0; | |
| 137 | pix = sprdata[offset / 2]; | |
| 135 | 138 | |
| 136 | if (offset & 1) pix = pix >> 4; | |
| 139 | if (offset & 1) | |
| 140 | pix = pix >> 4; | |
| 137 | 141 | pix &= 0x0f; |
| 138 | 142 | |
| 139 | 143 | if ((drawxpos >= cliprect->min_x) && (drawxpos <= cliprect->max_x) && pix) |
| r7500 | r7501 | |
| 142 | 146 | offset++; |
| 143 | 147 | } |
| 144 | 148 | } |
| 145 | else { | |
| 149 | else | |
| 150 | { | |
| 146 | 151 | offset += width; |
| 147 | 152 | } |
| 148 | 153 | } |
| 149 | 154 | } |
| 150 | source+=4; | |
| 155 | source += 4; | |
| 151 | 156 | } |
| 152 | 157 | } |
| 153 | 158 | |
| 154 | static void mcatadv_draw_tilemap_part(UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle *cliprect) | |
| 159 | static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 155 | 160 | { |
| 156 | 161 | int flip; |
| 157 | 162 | UINT32 drawline; |
| r7500 | r7501 | |
| 160 | 165 | clip.min_x = cliprect->min_x; |
| 161 | 166 | clip.max_x = cliprect->max_x; |
| 162 | 167 | |
| 163 | for(drawline = cliprect->min_y; drawline <= cliprect->max_y;drawline++) | |
| 168 | for (drawline = cliprect->min_y; drawline <= cliprect->max_y; drawline++) | |
| 164 | 169 | { |
| 165 | 170 | int scrollx, scrolly; |
| 166 | 171 | |
| 167 | 172 | clip.min_y = drawline; |
| 168 | 173 | clip.max_y = drawline; |
| 169 | 174 | |
| 170 | scrollx = (current_scroll[0]&0x1ff)-0x194; | |
| 171 | scrolly = (current_scroll[1]&0x1ff)-0x1df; | |
| 175 | scrollx = (current_scroll[0] & 0x1ff) - 0x194; | |
| 176 | scrolly = (current_scroll[1] & 0x1ff) - 0x1df; | |
| 172 | 177 | |
| 173 | if ((current_scroll[1]&0x4000)==0x4000) | |
| 178 | if ((current_scroll[1] & 0x4000) == 0x4000) | |
| 174 | 179 | { |
| 175 | int rowselect; | |
| 176 | rowselect = current_videoram1[0x1000/2 + (((drawline+scrolly)&0x1ff) * 2) + 1]; | |
| 180 | int rowselect = current_videoram1[0x1000 / 2 + (((drawline + scrolly) & 0x1ff) * 2) + 1]; | |
| 177 | 181 | scrolly = rowselect - drawline; |
| 178 | 182 | } |
| 179 | 183 | |
| 180 | if ((current_scroll[0]&0x4000)==0x4000) | |
| 184 | if ((current_scroll[0] & 0x4000) == 0x4000) | |
| 181 | 185 | { |
| 182 | int rowscroll; | |
| 183 | rowscroll = current_videoram1[0x1000/2 + (((drawline+scrolly)&0x1ff) * 2) + 0]; | |
| 186 | int rowscroll = current_videoram1[0x1000 / 2 + (((drawline + scrolly) & 0x1ff) * 2) + 0]; | |
| 184 | 187 | scrollx += rowscroll; |
| 185 | 188 | } |
| 186 | 189 | |
| 187 | 190 | /* Global Flip */ |
| 188 | if(!(current_scroll[0]&0x8000)) scrollx -= 0x19; | |
| 189 | if(!(current_scroll[1]&0x8000)) scrolly -= 0x141; | |
| 190 | flip = ((current_scroll[0]&0x8000)?0:TILEMAP_FLIPX) | ((current_scroll[1]&0x8000)?0:TILEMAP_FLIPY); | |
| 191 | if (!(current_scroll[0] & 0x8000)) scrollx -= 0x19; | |
| 192 | if (!(current_scroll[1] & 0x8000)) scrolly -= 0x141; | |
| 193 | flip = ((current_scroll[0] & 0x8000) ? 0 : TILEMAP_FLIPX) | ((current_scroll[1] & 0x8000) ? 0 : TILEMAP_FLIPY); | |
| 191 | 194 | |
| 192 | 195 | tilemap_set_scrollx(current_tilemap, 0, scrollx); |
| 193 | 196 | tilemap_set_scrolly(current_tilemap, 0, scrolly); |
| r7500 | r7501 | |
| 199 | 202 | |
| 200 | 203 | VIDEO_UPDATE( mcatadv ) |
| 201 | 204 | { |
| 205 | mcatadv_state *state = (mcatadv_state *)screen->machine->driver_data; | |
| 202 | 206 | int i; |
| 203 | 207 | |
| 204 | 208 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 205 | 209 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); |
| 206 | 210 | |
| 207 | if(mcatadv_scroll[2] != palette_bank1) { | |
| 208 | palette_bank1 = mcatadv_scroll[2]; | |
| 209 | tilemap_mark_all_tiles_dirty(mcatadv_tilemap1); | |
| 211 | if (state->scroll1[2] != state->palette_bank1) | |
| 212 | { | |
| 213 | state->palette_bank1 = state->scroll1[2]; | |
| 214 | tilemap_mark_all_tiles_dirty(state->tilemap1); | |
| 210 | 215 | } |
| 211 | 216 | |
| 212 | if(mcatadv_scroll2[2] != palette_bank2) { | |
| 213 | palette_bank2 = mcatadv_scroll2[2]; | |
| 214 | tilemap_mark_all_tiles_dirty(mcatadv_tilemap2); | |
| 217 | if (state->scroll2[2] != state->palette_bank2) | |
| 218 | { | |
| 219 | state->palette_bank2 = state->scroll2[2]; | |
| 220 | tilemap_mark_all_tiles_dirty(state->tilemap2); | |
| 215 | 221 | } |
| 216 | 222 | |
| 217 | 223 | /* |
| 218 | 224 | popmessage("%02x %02x %02x %02x", |
| 219 | (mcatadv_scroll[0]&0x4000)>>8, | |
| 220 | (mcatadv_scroll[1]&0x4000)>>8, | |
| 221 | (mcatadv_scroll2[0]&0x4000)>>8, | |
| 222 | (mcatadv_scroll2[1]&0x4000)>>8); | |
| 225 | (mcatadv_scroll1[0] & 0x4000) >> 8, | |
| 226 | (mcatadv_scroll1[1] & 0x4000) >> 8, | |
| 227 | (mcatadv_scroll2[0] & 0x4000) >> 8, | |
| 228 | (mcatadv_scroll2[1] & 0x4000) >> 8); | |
| 223 | 229 | */ |
| 224 | 230 | |
| 225 | for (i=0; i<=3; i++) | |
| 231 | for (i = 0; i <= 3; i++) | |
| 226 | 232 | { |
| 227 | 233 | #ifdef MAME_DEBUG |
| 228 | 234 | if (!input_code_pressed(screen->machine, KEYCODE_Q)) |
| 229 | 235 | #endif |
| 230 | mcatadv_draw_tilemap_part( | |
| 236 | mcatadv_draw_tilemap_part(s | |
| 231 | 237 | |
| 232 | 238 | #ifdef MAME_DEBUG |
| 233 | 239 | if (!input_code_pressed(screen->machine, KEYCODE_W)) |
| 234 | 240 | #endif |
| 235 | mcatadv_draw_tilemap_part( | |
| 241 | mcatadv_draw_tilemap_part(s | |
| 236 | 242 | } |
| 237 | 243 | |
| 238 | 244 | profiler_mark_start(PROFILER_USER1); |
| r7500 | r7501 | |
| 246 | 252 | |
| 247 | 253 | VIDEO_START( mcatadv ) |
| 248 | 254 | { |
| 249 | mcatadv_tilemap1 = tilemap_create(machine, get_mcatadv_tile_info1,tilemap_scan_rows, 16, 16,32,32); | |
| 250 | tilemap_set_transparent_pen(mcatadv_tilemap1,0); | |
| 255 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 256 | state->tilemap1 = tilemap_create(machine, get_mcatadv_tile_info1, tilemap_scan_rows, 16, 16, 32, 32); | |
| 257 | tilemap_set_transparent_pen(state->tilemap1, 0); | |
| 251 | 258 | |
| 252 | mcatadv_tilemap2 = tilemap_create(machine, get_mcatadv_tile_info2,tilemap_scan_rows, 16, 16,32,32); | |
| 253 | tilemap_set_transparent_pen(mcatadv_tilemap2,0); | |
| 259 | state->tilemap2 = tilemap_create(machine, get_mcatadv_tile_info2, tilemap_scan_rows, 16, 16, 32, 32); | |
| 260 | tilemap_set_transparent_pen(state->tilemap2, 0); | |
| 254 | 261 | |
| 255 | spriteram_old = auto_alloc_array_clear(machine, UINT16, machine->generic.spriteram_size/2); | |
| 256 | vidregs_old = auto_alloc_array(machine, UINT16, (0xf+1)/2); | |
| 262 | state->spriteram_old = auto_alloc_array_clear(machine, UINT16, state->spriteram_size / 2); | |
| 263 | state->vidregs_old = auto_alloc_array(machine, UINT16, (0x0f + 1) / 2); | |
| 257 | 264 | |
| 258 | palette_bank1 = 0; | |
| 259 | palette_bank2 = 0; | |
| 265 | state->palette_bank1 = 0; | |
| 266 | state->palette_bank2 = 0; | |
| 267 | ||
| 268 | state_save_register_global_pointer(machine, state->spriteram_old, state->spriteram_size / 2); | |
| 269 | state_save_register_global_pointer(machine, state->vidregs_old, (0x0f + 1) / 2); | |
| 260 | 270 | } |
| 261 | 271 | |
| 262 | 272 | VIDEO_EOF( mcatadv ) |
| 263 | 273 | { |
| 264 | memcpy(spriteram_old,machine->generic.spriteram.u16,machine->generic.spriteram_size); | |
| 265 | memcpy(vidregs_old,mcatadv_vidregs,0xf); | |
| 274 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 275 | memcpy(state->spriteram_old, state->spriteram, state->spriteram_size); | |
| 276 | memcpy(state->vidregs_old, state->vidregs, 0xf); | |
| 266 | 277 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/munchmo.h" | |
| 2 | 3 | |
| 3 | 4 | |
| 4 | UINT8 *mnchmobl_vreg; | |
| 5 | UINT8 *mnchmobl_status_vram; | |
| 6 | UINT8 *mnchmobl_sprite_xpos; | |
| 7 | UINT8 *mnchmobl_sprite_attr; | |
| 8 | UINT8 *mnchmobl_sprite_tile; | |
| 9 | ||
| 10 | static int mnchmobl_palette_bank; | |
| 11 | static int flipscreen; | |
| 12 | ||
| 13 | 5 | PALETTE_INIT( mnchmobl ) |
| 14 | 6 | { |
| 15 | 7 | int i; |
| 16 | 8 | |
| 17 | for (i = 0;i < machine->config->total_colors;i++) | |
| 9 | for (i = 0; i < machine->config->total_colors; i++) | |
| 18 | 10 | { |
| 19 | int bit0,bit1,bit2,r,g,b; | |
| 11 | int bit0, bit1, bit2, r, g, b; | |
| 20 | 12 | |
| 21 | 13 | /* red component */ |
| 22 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 23 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 24 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 14 | bit0 = BIT(color_prom[i], 0); | |
| 15 | bit1 = BIT(color_prom[i], 1); | |
| 16 | bit2 = BIT(color_prom[i], 2); | |
| 25 | 17 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 26 | 18 | /* green component */ |
| 27 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 28 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 29 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 19 | bit0 = BIT(color_prom[i], 3); | |
| 20 | bit1 = BIT(color_prom[i], 4); | |
| 21 | bit2 = BIT(color_prom[i], 5); | |
| 30 | 22 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 31 | 23 | /* blue component */ |
| 32 | bit0 = (color_prom[i] >> 6) & 0x01; | |
| 33 | bit1 = (color_prom[i] >> 7) & 0x01; | |
| 24 | bit0 = BIT(color_prom[i], 6); | |
| 25 | bit1 = BIT(color_prom[i], 7); | |
| 34 | 26 | b = 0x4f * bit0 + 0xa8 * bit1; |
| 35 | 27 | |
| 36 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); | |
| 28 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 37 | 29 | } |
| 38 | 30 | } |
| 39 | 31 | |
| 40 | 32 | WRITE8_HANDLER( mnchmobl_palette_bank_w ) |
| 41 | 33 | { |
| 42 | mnchmobl_palette_bank = data&0x3; | |
| 34 | munchmo_state *state = (munchmo_state *)space->machine->driver_data; | |
| 35 | state->palette_bank = data & 0x3; | |
| 43 | 36 | } |
| 44 | 37 | |
| 45 | 38 | WRITE8_HANDLER( mnchmobl_flipscreen_w ) |
| 46 | 39 | { |
| 47 | flipscreen = data; | |
| 40 | munchmo_state *state = (munchmo_state *)space->machine->driver_data; | |
| 41 | state->flipscreen = data; | |
| 48 | 42 | } |
| 49 | 43 | |
| 50 | 44 | |
| 51 | 45 | VIDEO_START( mnchmobl ) |
| 52 | 46 | { |
| 53 | machine->generic.tmpbitmap = auto_bitmap_alloc(machine,512,512,video_screen_get_format(machine->primary_screen)); | |
| 47 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 48 | state->tmpbitmap = auto_bitmap_alloc(machine, 512, 512, video_screen_get_format(machine->primary_screen)); | |
| 54 | 49 | } |
| 55 | 50 | |
| 56 | static void draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 51 | static void draw_status( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 57 | 52 | { |
| 53 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 58 | 54 | const gfx_element *gfx = machine->gfx[0]; |
| 59 | 55 | int row; |
| 60 | 56 | |
| 61 | for | |
| 57 | for | |
| 62 | 58 | { |
| 63 | int sy,sx = (row&1)*8; | |
| 64 | const UINT8 *source = mnchmobl_status_vram + (~row&1)*32; | |
| 65 | if( row<=1 ) | |
| 59 | int sy, sx = (row & 1) * 8; | |
| 60 | const UINT8 *source = state->status_vram + (~row & 1) * 32; | |
| 61 | if (row <= 1) | |
| 66 | 62 | { |
| 67 | source+=2*32; | |
| 68 | sx+=256+32+16; | |
| 63 | source += 2 * 32; | |
| 64 | sx += 256 + 32 + 16; | |
| 69 | 65 | } |
| 70 | for( sy=0; sy<256; sy+=8 ) | |
| 66 | ||
| 67 | for (sy = 0; sy < 256; sy += 8) | |
| 71 | 68 | { |
| 72 | 69 | drawgfx_opaque( bitmap, cliprect, |
| 73 | 70 | gfx, |
| r7500 | r7501 | |
| 79 | 76 | } |
| 80 | 77 | } |
| 81 | 78 | |
| 82 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 79 | static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 83 | 80 | { |
| 84 | 81 | /* |
| 85 | 82 | ROM B1.2C contains 256 tilemaps defining 4x4 configurations of |
| 86 | 83 | the tiles in ROM B2.2B |
| 87 | 84 | */ |
| 85 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 88 | 86 | UINT8 *rom = memory_region(machine, "gfx2"); |
| 89 | 87 | const gfx_element *gfx = machine->gfx[1]; |
| 90 | 88 | int offs; |
| 91 | 89 | |
| 92 | for | |
| 90 | for | |
| 93 | 91 | { |
| 94 | int sy = (offs%16)*32; | |
| 95 | int sx = (offs/16)*32; | |
| 96 | int tile_number = machine->generic.videoram.u8[offs]; | |
| 97 | int row,col; | |
| 92 | int sy = (offs % 16) * 32; | |
| 93 | int sx = (offs / 16) * 32; | |
| 94 | int tile_number = state->videoram[offs]; | |
| 95 | int row, col; | |
| 98 | 96 | |
| 99 | for | |
| 97 | for | |
| 100 | 98 | { |
| 101 | for | |
| 99 | for | |
| 102 | 100 | { |
| 103 | drawgfx_opaque( machine->generic.tmpbitmap,0, gfx, | |
| 104 | rom[col+tile_number*4+row*0x400], | |
| 105 | mnchmobl_palette_bank, | |
| 101 | drawgfx_opaque(state->tmpbitmap, 0, gfx, | |
| 102 | rom[col + tile_number * 4 + row * 0x400], | |
| 103 | state->palette_bank, | |
| 106 | 104 | 0,0, /* flip */ |
| 107 | sx+col*8, sy+row*8 ); | |
| 105 | sx + col * 8, sy + row * 8 ); | |
| 108 | 106 | } |
| 109 | 107 | } |
| 110 | 108 | } |
| 111 | 109 | |
| 112 | 110 | { |
| 113 | int scrollx = -( | |
| 111 | int scrollx = -(state-> | |
| 114 | 112 | int scrolly = 0; |
| 115 | 113 | |
| 116 | copyscrollbitmap(bitmap, | |
| 114 | copyscrollbitmap(bitmap, stat | |
| 117 | 115 | } |
| 118 | 116 | } |
| 119 | 117 | |
| 120 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 118 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 121 | 119 | { |
| 122 | int scroll = mnchmobl_vreg[6]; | |
| 123 | int flags = mnchmobl_vreg[7]; /* XB?????? */ | |
| 120 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 121 | int scroll = state->vreg[6]; | |
| 122 | int flags = state->vreg[7]; /* XB?????? */ | |
| 124 | 123 | int xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0); |
| 125 | 124 | int bank = (flags & 0x40) ? 1 : 0; |
| 126 | 125 | const gfx_element *gfx = machine->gfx[2 + bank]; |
| 127 | int color_base = | |
| 126 | int color_base = state-> | |
| 128 | 127 | int i, j; |
| 129 | int firstsprite = mnchmobl_vreg[4] & 0x3f; | |
| 130 | for( i = firstsprite; i < firstsprite + 0x40; i++ ) | |
| 128 | int firstsprite = state->vreg[4] & 0x3f; | |
| 129 | for (i = firstsprite; i < firstsprite + 0x40; i++) | |
| 131 | 130 | { |
| 132 | for | |
| 131 | for | |
| 133 | 132 | { |
| 134 | int offs = (j << 6) | ( i & 0x3f ); | |
| 135 | int tile_number = mnchmobl_sprite_tile[offs]; /* ETTTTTTT */ | |
| 136 | int attributes = mnchmobl_sprite_attr[offs]; /* XYYYYYCC */ | |
| 137 | int sx = mnchmobl_sprite_xpos[offs]; /* XXXXXXX? */ | |
| 133 | int offs = (j << 6) | (i & 0x3f); | |
| 134 | int tile_number = state->sprite_tile[offs]; /* ETTTTTTT */ | |
| 135 | int attributes = state->sprite_attr[offs]; /* XYYYYYCC */ | |
| 136 | int sx = state->sprite_xpos[offs]; /* XXXXXXX? */ | |
| 138 | 137 | int sy = (offs >> 6) << 5; /* Y YY------ */ |
| 139 | 138 | sy += (attributes >> 2) & 0x1f; |
| 140 | 139 | if( attributes & 0x80 ) |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "video/resnet.h" |
| 11 | #include "includes/mikie.h" | |
| 11 | 12 | |
| 12 | static int palettebank; | |
| 13 | ||
| 14 | UINT8 *mikie_videoram; | |
| 15 | UINT8 *mikie_colorram; | |
| 16 | static tilemap_t *bg_tilemap; | |
| 17 | ||
| 18 | 13 | /*************************************************************************** |
| 19 | 14 | |
| 20 | 15 | Convert the color PROMs into a more useable format. |
| r7500 | r7501 | |
| 30 | 25 | bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE |
| 31 | 26 | |
| 32 | 27 | ***************************************************************************/ |
| 28 | ||
| 33 | 29 | PALETTE_INIT( mikie ) |
| 34 | 30 | { |
| 35 | 31 | static const int resistances[4] = { 2200, 1000, 470, 220 }; |
| r7500 | r7501 | |
| 78 | 74 | /* color_prom now points to the beginning of the lookup table,*/ |
| 79 | 75 | color_prom += 0x300; |
| 80 | 76 | |
| 81 | /* characters use colors 0x10-0x1f of each 0x20 color bank, | |
| 82 | while sprites use colors 0-0x0f */ | |
| 77 | /* characters use colors 0x10-0x1f of each 0x20 color bank, while sprites use colors 0-0x0f */ | |
| 83 | 78 | for (i = 0; i < 0x200; i++) |
| 84 | 79 | { |
| 85 | 80 | int j; |
| r7500 | r7501 | |
| 94 | 89 | |
| 95 | 90 | WRITE8_HANDLER( mikie_videoram_w ) |
| 96 | 91 | { |
| 97 | mikie_videoram[offset] = data; | |
| 98 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 92 | mikie_state *state = (mikie_state *)space->machine->driver_data; | |
| 93 | ||
| 94 | state->videoram[offset] = data; | |
| 95 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 99 | 96 | } |
| 100 | 97 | |
| 101 | 98 | WRITE8_HANDLER( mikie_colorram_w ) |
| 102 | 99 | { |
| 103 | mikie_colorram[offset] = data; | |
| 104 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 100 | mikie_state *state = (mikie_state *)space->machine->driver_data; | |
| 101 | ||
| 102 | state->colorram[offset] = data; | |
| 103 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | 106 | WRITE8_HANDLER( mikie_palettebank_w ) |
| 108 | 107 | { |
| 109 | if (palettebank != (data & 0x07)) | |
| 108 | mikie_state *state = (mikie_state *)space->machine->driver_data; | |
| 109 | ||
| 110 | if (state->palettebank != (data & 0x07)) | |
| 110 | 111 | { |
| 111 | palettebank = data & 0x07; | |
| 112 | state->palettebank = data & 0x07; | |
| 112 | 113 | tilemap_mark_all_tiles_dirty_all(space->machine); |
| 113 | 114 | } |
| 114 | 115 | } |
| r7500 | r7501 | |
| 124 | 125 | |
| 125 | 126 | static TILE_GET_INFO( get_bg_tile_info ) |
| 126 | 127 | { |
| 127 | int code = mikie_videoram[tile_index] + ((mikie_colorram[tile_index] & 0x20) << 3); | |
| 128 | int color = (mikie_colorram[tile_index] & 0x0f) + 16 * palettebank; | |
| 129 | int flags = ((mikie_colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((mikie_colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); | |
| 130 | if (mikie_colorram[tile_index] & 0x10) | |
| 128 | mikie_state *state = (mikie_state *)machine->driver_data; | |
| 129 | int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x20) << 3); | |
| 130 | int color = (state->colorram[tile_index] & 0x0f) + 16 * state->palettebank; | |
| 131 | int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); | |
| 132 | if (state->colorram[tile_index] & 0x10) | |
| 131 | 133 | tileinfo->category = 1; |
| 132 | 134 | else |
| 133 | 135 | tileinfo->category = 0; |
| 136 | ||
| 134 | 137 | SET_TILE_INFO(0, code, color, flags); |
| 135 | 138 | |
| 136 | 139 | |
| r7500 | r7501 | |
| 138 | 141 | |
| 139 | 142 | VIDEO_START( mikie ) |
| 140 | 143 | { |
| 141 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 142 | 8, 8, 32, 32); | |
| 144 | mikie_state *state = (mikie_state *)machine->driver_data; | |
| 145 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 143 | 146 | } |
| 144 | 147 | |
| 145 | 148 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 146 | 149 | { |
| 147 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 150 | mikie_state *state = (mikie_state *)machine->driver_data; | |
| 151 | UINT8 *spriteram = state->spriteram; | |
| 148 | 152 | int offs; |
| 149 | 153 | |
| 150 | for (offs = 0;offs < | |
| 154 | for (offs = 0; offs < stat | |
| 151 | 155 | { |
| 152 | int gfxbank = (spriteram[offs+2] & 0x40) ? 2 : 1; | |
| 156 | int gfxbank = (spriteram[offs + 2] & 0x40) ? 2 : 1; | |
| 153 | 157 | int code = (spriteram[offs + 2] & 0x3f) + ((spriteram[offs + 2] & 0x80) >> 1) + ((spriteram[offs] & 0x40) << 1); |
| 154 | int color = (spriteram[offs] & 0x0f) + 16 * palettebank; | |
| 158 | int color = (spriteram[offs] & 0x0f) + 16 * state->palettebank; | |
| 155 | 159 | int sx = spriteram[offs + 3]; |
| 156 | 160 | int sy = 244 - spriteram[offs + 1]; |
| 157 | 161 | int flipx = ~spriteram[offs] & 0x10; |
| r7500 | r7501 | |
| 173 | 177 | |
| 174 | 178 | VIDEO_UPDATE( mikie ) |
| 175 | 179 | { |
| 176 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_CATEGORY(0), 0); | |
| 180 | mikie_state *state = (mikie_state *)screen->machine->driver_data; | |
| 181 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_CATEGORY(0), 0); | |
| 177 | 182 | draw_sprites(screen->machine, bitmap, cliprect); |
| 178 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_CATEGORY(1), 0); | |
| 183 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_CATEGORY(1), 0); | |
| 179 | 184 | return 0; |
| 180 | 185 | } |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "includes/deco16ic.h" | |
| 8 | #include "includes/cbuster.h" | |
| 9 | #include "video/deco16ic.h" | |
| 9 | 10 | |
| 10 | static int twocrude_pri; | |
| 11 | ||
| 12 | 11 | /******************************************************************************/ |
| 13 | 12 | |
| 14 | static i | |
| 13 | static void | |
| 15 | 14 | { |
| 16 | return ((bank>>4)&0x7) * 0x1000; | |
| 17 | } | |
| 15 | UINT8 r, g, b; /* The highest palette value seems to be 0x8e */ | |
| 18 | 16 | |
| 19 | VIDEO_START( twocrude ) | |
| 20 | { | |
| 21 | deco16_2_video_init(machine, 0); | |
| 17 | r = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 0) & 0xff) * 1.75); | |
| 18 | g = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 8) & 0xff) * 1.75); | |
| 19 | b = (UINT8)((float)((machine->generic.paletteram2.u16[offset] >> 0) & 0xff) * 1.75); | |
| 22 | 20 | |
| 23 | deco16_set_tilemap_bank_callback(0, bank_callback); | |
| 24 | deco16_set_tilemap_bank_callback(1, bank_callback); | |
| 25 | deco16_set_tilemap_bank_callback(2, bank_callback); | |
| 26 | deco16_set_tilemap_bank_callback(3, bank_callback); | |
| 27 | ||
| 28 | deco16_pf1_colour_bank=0x00; | |
| 29 | deco16_pf2_colour_bank=0x20; | |
| 30 | deco16_pf4_colour_bank=0x40; | |
| 31 | deco16_pf3_colour_bank=0x30; | |
| 21 | palette_set_color(machine, offset, MAKE_RGB(r, g, b)); | |
| 32 | 22 | } |
| 33 | 23 | |
| 34 | /******************************************************************************/ | |
| 35 | ||
| 36 | static void update_24bitcol(running_machine *machine, int offset) | |
| 37 | { | |
| 38 | UINT8 r,g,b; /* The highest palette value seems to be 0x8e */ | |
| 39 | ||
| 40 | r = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 0) & 0xff)*1.75); | |
| 41 | g = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 8) & 0xff)*1.75); | |
| 42 | b = (UINT8)((float)((machine->generic.paletteram2.u16[offset] >> 0) & 0xff)*1.75); | |
| 43 | ||
| 44 | palette_set_color(machine,offset,MAKE_RGB(r,g,b)); | |
| 45 | } | |
| 46 | ||
| 47 | 24 | WRITE16_HANDLER( twocrude_palette_24bit_rg_w ) |
| 48 | 25 | { |
| 49 | 26 | COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]); |
| r7500 | r7501 | |
| 56 | 33 | update_24bitcol(space->machine, offset); |
| 57 | 34 | } |
| 58 | 35 | |
| 59 | /******************************************************************************/ | |
| 60 | 36 | |
| 61 | void twocrude_pri_w(int pri) | |
| 62 | { | |
| 63 | twocrude_pri=pri; | |
| 64 | } | |
| 65 | ||
| 66 | 37 | /******************************************************************************/ |
| 67 | 38 | |
| 68 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri) | |
| 39 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri ) | |
| 69 | 40 | { |
| 70 | UINT16 *buffered_spriteram | |
| 41 | UINT16 *buffered_spriteram | |
| 71 | 42 | int offs; |
| 72 | 43 | |
| 73 | for (offs = 0;offs < 0x400;offs += 4) | |
| 44 | for (offs = 0; offs < 0x400; offs += 4) | |
| 74 | 45 | { |
| 75 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 46 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 76 | 47 | |
| 77 | sprite = buffered_spriteram16[offs+1] & 0x7fff; | |
| 78 | if (!sprite) continue; | |
| 48 | sprite = buffered_spriteram[offs + 1] & 0x7fff; | |
| 49 | if (!sprite) | |
| 50 | continue; | |
| 79 | 51 | |
| 80 | y = buffered_spriteram16[offs]; | |
| 81 | x = buffered_spriteram16[offs+2]; | |
| 52 | y = buffered_spriteram[offs]; | |
| 53 | x = buffered_spriteram[offs + 2]; | |
| 82 | 54 | |
| 83 | if ((y&0x8000) && pri==1) continue; | |
| 84 | if (!(y&0x8000) && pri==0) continue; | |
| 55 | if ((y & 0x8000) && pri == 1) | |
| 56 | continue; | |
| 57 | if (!(y & 0x8000) && pri == 0) | |
| 58 | continue; | |
| 85 | 59 | |
| 86 | colour = (x >> 9) &0xf; | |
| 87 | if (x&0x2000) colour+=64; | |
| 60 | colour = (x >> 9) & 0xf; | |
| 61 | if (x & 0x2000) | |
| 62 | colour += 64; | |
| 88 | 63 | |
| 89 | flash=y&0x1000; | |
| 90 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 64 | flash = y & 0x1000; | |
| 65 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 66 | continue; | |
| 91 | 67 | |
| 92 | 68 | fx = y & 0x2000; |
| 93 | 69 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 100 | 76 | x = 240 - x; |
| 101 | 77 | y = 240 - y; |
| 102 | 78 | |
| 103 | if (x>256) continue; /* Speedup */ | |
| 79 | if (x > 256) | |
| 80 | continue; /* Speedup */ | |
| 104 | 81 | |
| 105 | 82 | sprite &= ~multi; |
| 106 | 83 | if (fy) |
| r7500 | r7501 | |
| 111 | 88 | inc = 1; |
| 112 | 89 | } |
| 113 | 90 | |
| 114 | if (flip_screen_get(machine)) { | |
| 115 | y=240-y; | |
| 116 | x=240-x; | |
| 117 | if (fx) fx=0; else fx=1; | |
| 118 | if (fy) fy=0; else fy=1; | |
| 119 | mult=16; | |
| 91 | if (flip_screen_get(machine)) | |
| 92 | { | |
| 93 | y = 240 - y; | |
| 94 | x = 240 - x; | |
| 95 | if (fx) fx = 0; else fx = 1; | |
| 96 | if (fy) fy = 0; else fy = 1; | |
| 97 | mult = 16; | |
| 120 | 98 | } |
| 121 | else mult=-16; | |
| 99 | else mult = -16; | |
| 122 | 100 | |
| 123 | 101 | while (multi >= 0) |
| 124 | 102 | { |
| r7500 | r7501 | |
| 137 | 115 | |
| 138 | 116 | VIDEO_UPDATE( twocrude ) |
| 139 | 117 | { |
| 140 | flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) ); | |
| 118 | cbuster_state *state = (cbuster_state *)screen->machine->driver_data; | |
| 119 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 141 | 120 | |
| 142 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 143 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 121 | flip_screen_set(screen->machine, !BIT(flip, 7)); | |
| 144 | 122 | |
| 123 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 124 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 125 | ||
| 145 | 126 | /* Draw playfields & sprites */ |
| 146 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 147 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 127 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 128 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 148 | 129 | |
| 149 | if (twocrude_pri) { | |
| 150 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 151 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,0); | |
| 130 | if (state->pri) | |
| 131 | { | |
| 132 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 133 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 152 | 134 | } |
| 153 | else { | |
| 154 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,0); | |
| 155 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 135 | else | |
| 136 | { | |
| 137 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 138 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 156 | 139 | } |
| 157 | 140 | |
| 158 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 159 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 141 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 142 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 160 | 143 | return 0; |
| 161 | 144 | } |
| r7500 | r7501 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | #include "includes/ojankohs.h" | |
| 12 | 13 | |
| 13 | ||
| 14 | static UINT8 *ojankohs_videoram; | |
| 15 | static UINT8 *ojankohs_colorram; | |
| 16 | static UINT8 *ojankohs_paletteram; | |
| 17 | static int ojankohs_gfxreg; | |
| 18 | static int ojankohs_flipscreen; | |
| 19 | static int ojankohs_scrollx, ojankohs_scrolly; | |
| 20 | static tilemap_t *ojankohs_tilemap; | |
| 21 | static int ojankoc_screen_refresh; | |
| 22 | static bitmap_t *ojankoc_tmpbitmap; | |
| 23 | ||
| 24 | WRITE8_HANDLER( ojankoc_videoram_w ); | |
| 25 | ||
| 26 | ||
| 27 | 14 | /****************************************************************************** |
| 28 | 15 | |
| 29 | 16 | Palette system |
| r7500 | r7501 | |
| 35 | 22 | int i; |
| 36 | 23 | int bit0, bit1, bit2, bit3, bit4, r, g, b; |
| 37 | 24 | |
| 38 | for (i = 0; i < machine->config->total_colors; i++) { | |
| 39 | bit0 = (color_prom[0] >> 2) & 0x01; | |
| 40 | bit1 = (color_prom[0] >> 3) & 0x01; | |
| 41 | bit2 = (color_prom[0] >> 4) & 0x01; | |
| 42 | bit3 = (color_prom[0] >> 5) & 0x01; | |
| 43 | bit4 = (color_prom[0] >> 6) & 0x01; | |
| 25 | for (i = 0; i < machine->config->total_colors; i++) | |
| 26 | { | |
| 27 | bit0 = BIT(color_prom[0], 2); | |
| 28 | bit1 = BIT(color_prom[0], 3); | |
| 29 | bit2 = BIT(color_prom[0], 4); | |
| 30 | bit3 = BIT(color_prom[0], 5); | |
| 31 | bit4 = BIT(color_prom[0], 6); | |
| 44 | 32 | r = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; |
| 45 | bit0 = (color_prom[machine->config->total_colors] >> 5) & 0x01; | |
| 46 | bit1 = (color_prom[machine->config->total_colors] >> 6) & 0x01; | |
| 47 | bit2 = (color_prom[machine->config->total_colors] >> 7) & 0x01; | |
| 48 | bit3 = (color_prom[0] >> 0) & 0x01; | |
| 49 | bit4 = (color_prom[0] >> 1) & 0x01; | |
| 33 | bit0 = BIT(color_prom[machine->config->total_colors], 5); | |
| 34 | bit1 = BIT(color_prom[machine->config->total_colors], 6); | |
| 35 | bit2 = BIT(color_prom[machine->config->total_colors], 7); | |
| 36 | bit3 = BIT(color_prom[0], 0); | |
| 37 | bit4 = BIT(color_prom[0], 1); | |
| 50 | 38 | g = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; |
| 51 | bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; | |
| 52 | bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; | |
| 53 | bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; | |
| 54 | bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; | |
| 55 | bit4 = (color_prom[machine->config->total_colors] >> 4) & 0x01; | |
| 39 | bit0 = BIT(color_prom[machine->config->total_colors], 0); | |
| 40 | bit1 = BIT(color_prom[machine->config->total_colors], 1); | |
| 41 | bit2 = BIT(color_prom[machine->config->total_colors], 2); | |
| 42 | bit3 = BIT(color_prom[machine->config->total_colors], 3); | |
| 43 | bit4 = BIT(color_prom[machine->config->total_colors], 4); | |
| 56 | 44 | b = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; |
| 57 | 45 | |
| 58 | 46 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 62 | 50 | |
| 63 | 51 | WRITE8_HANDLER( ojankohs_palette_w ) |
| 64 | 52 | { |
| 53 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 65 | 54 | int r, g, b; |
| 66 | 55 | |
| 67 | | |
| 56 | | |
| 68 | 57 | |
| 69 | 58 | offset &= 0x7fe; |
| 70 | 59 | |
| 71 | r = (ojankohs_paletteram[offset + 0] & 0x7c) >> 2; | |
| 72 | g = ((ojankohs_paletteram[offset + 0] & 0x03) << 3) | | |
| 73 | ((ojankohs_paletteram[offset + 1] & 0xe0) >> 5); | |
| 74 | b = (ojankohs_paletteram[offset + 1] & 0x1f) >> 0; | |
| 60 | r = (state->paletteram[offset + 0] & 0x7c) >> 2; | |
| 61 | g = ((state->paletteram[offset + 0] & 0x03) << 3) | ((state->paletteram[offset + 1] & 0xe0) >> 5); | |
| 62 | b = (state->paletteram[offset + 1] & 0x1f) >> 0; | |
| 75 | 63 | |
| 76 | palette_set_color_rgb(space->machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 64 | palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 77 | 65 | } |
| 78 | 66 | |
| 79 | 67 | WRITE8_HANDLER( ccasino_palette_w ) |
| 80 | 68 | { |
| 69 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 81 | 70 | int r, g, b; |
| 82 | 71 | |
| 83 | 72 | /* get top 8 bits of the I/O port address */ |
| 84 | 73 | offset = (offset << 8) | (cpu_get_reg(space->cpu, Z80_BC) >> 8); |
| 85 | 74 | |
| 86 | | |
| 75 | | |
| 87 | 76 | |
| 88 | 77 | offset &= 0x7fe; |
| 89 | 78 | |
| 90 | r = (ojankohs_paletteram[offset + 0] & 0x7c) >> 2; | |
| 91 | g = ((ojankohs_paletteram[offset + 0] & 0x03) << 3) | | |
| 92 | ((ojankohs_paletteram[offset + 1] & 0xe0) >> 5); | |
| 93 | b = (ojankohs_paletteram[offset + 1] & 0x1f) >> 0; | |
| 79 | r = (state->paletteram[offset + 0] & 0x7c) >> 2; | |
| 80 | g = ((state->paletteram[offset + 0] & 0x03) << 3) | ((state->paletteram[offset + 1] & 0xe0) >> 5); | |
| 81 | b = (state->paletteram[offset + 1] & 0x1f) >> 0; | |
| 94 | 82 | |
| 95 | palette_set_color_rgb(space->machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 83 | palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 96 | 84 | } |
| 97 | 85 | |
| 98 | 86 | WRITE8_HANDLER( ojankoc_palette_w ) |
| 99 | 87 | { |
| 88 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 100 | 89 | int r, g, b, color; |
| 101 | 90 | |
| 102 | if (ojankohs_paletteram[offset] == data) return; | |
| 91 | if (state->paletteram[offset] == data) | |
| 92 | return; | |
| 103 | 93 | |
| 104 | ojankohs_paletteram[offset] = data; | |
| 105 | ojankoc_screen_refresh = 1; | |
| 94 | state->paletteram[offset] = data; | |
| 95 | state->screen_refresh = 1; | |
| 106 | 96 | |
| 107 | color = ( | |
| 97 | color = ( | |
| 108 | 98 | |
| 109 | 99 | r = (color >> 10) & 0x1f; |
| 110 | 100 | g = (color >> 5) & 0x1f; |
| 111 | 101 | b = (color >> 0) & 0x1f; |
| 112 | 102 | |
| 113 | palette_set_color_rgb(space->machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 103 | palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 114 | 104 | } |
| 115 | 105 | |
| 116 | 106 | |
| r7500 | r7501 | |
| 122 | 112 | |
| 123 | 113 | WRITE8_HANDLER( ojankohs_videoram_w ) |
| 124 | 114 | { |
| 125 | ojankohs_videoram[offset] = data; | |
| 126 | tilemap_mark_tile_dirty(ojankohs_tilemap, offset); | |
| 115 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 116 | state->videoram[offset] = data; | |
| 117 | tilemap_mark_tile_dirty(state->tilemap, offset); | |
| 127 | 118 | } |
| 128 | 119 | |
| 129 | 120 | WRITE8_HANDLER( ojankohs_colorram_w ) |
| 130 | 121 | { |
| 131 | ojankohs_colorram[offset] = data; | |
| 132 | tilemap_mark_tile_dirty(ojankohs_tilemap, offset); | |
| 122 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 123 | state->colorram[offset] = data; | |
| 124 | tilemap_mark_tile_dirty(state->tilemap, offset); | |
| 133 | 125 | } |
| 134 | 126 | |
| 135 | 127 | WRITE8_HANDLER( ojankohs_gfxreg_w ) |
| 136 | 128 | { |
| 137 | if (ojankohs_gfxreg != data) { | |
| 138 | ojankohs_gfxreg = data; | |
| 139 | tilemap_mark_all_tiles_dirty(ojankohs_tilemap); | |
| 129 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 130 | ||
| 131 | if (state->gfxreg != data) | |
| 132 | { | |
| 133 | state->gfxreg = data; | |
| 134 | tilemap_mark_all_tiles_dirty(state->tilemap); | |
| 140 | 135 | } |
| 141 | 136 | } |
| 142 | 137 | |
| 143 | 138 | WRITE8_HANDLER( ojankohs_flipscreen_w ) |
| 144 | 139 | { |
| 145 | | |
| 140 | | |
| 146 | 141 | |
| 147 | ojankohs_flipscreen = data & 0x01; | |
| 142 | if (state->flipscreen != BIT(data, 0)) | |
| 143 | { | |
| 148 | 144 | |
| 149 | | |
| 145 | | |
| 150 | 146 | |
| 151 | if (ojankohs_flipscreen) { | |
| 152 | ojankohs_scrollx = -0xe0; | |
| 153 | ojankohs_scrolly = -0x20; | |
| 147 | tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 148 | ||
| 149 | if (state->flipscreen) | |
| 150 | { | |
| 151 | state->scrollx = -0xe0; | |
| 152 | state->scrolly = -0x20; | |
| 154 | 153 | } |
| 155 | else { | |
| 156 | ojankohs_scrollx = 0; | |
| 157 | ojankohs_scrolly = 0; | |
| 154 | else | |
| 155 | { | |
| 156 | state->scrollx = 0; | |
| 157 | state->scrolly = 0; | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | static TILE_GET_INFO( ojankohs_get_tile_info ) |
| 163 | 163 | { |
| 164 | int tile, color; | |
| 164 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 165 | int tile = state->videoram[tile_index] | ((state->colorram[tile_index] & 0x0f) << 8); | |
| 166 | int color = (state->colorram[tile_index] & 0xe0) >> 5; | |
| 165 | 167 | |
| 166 | tile = ojankohs_videoram[tile_index] | ((ojankohs_colorram[tile_index] & 0x0f) << 8); | |
| 167 | color = (ojankohs_colorram[tile_index] & 0xe0) >> 5; | |
| 168 | ||
| 169 | if (ojankohs_colorram[tile_index] & 0x10) { | |
| 170 | tile |= (ojankohs_gfxreg & 0x07) << 12; | |
| 171 | color |= (ojankohs_gfxreg & 0xe0) >> 2; | |
| 168 | if (state->colorram[tile_index] & 0x10) | |
| 169 | { | |
| 170 | tile |= (state->gfxreg & 0x07) << 12; | |
| 171 | color |= (state->gfxreg & 0xe0) >> 2; | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | SET_TILE_INFO(0, tile, color, 0); |
| r7500 | r7501 | |
| 176 | 176 | |
| 177 | 177 | static TILE_GET_INFO( ojankoy_get_tile_info ) |
| 178 | 178 | { |
| 179 | int tile, color, flipx, flipy; | |
| 179 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 180 | int tile = state->videoram[tile_index] | (state->videoram[tile_index + 0x1000] << 8); | |
| 181 | int color = state->colorram[tile_index] & 0x3f; | |
| 182 | int flipx = ((state->colorram[tile_index] & 0x40) >> 6) ? TILEMAP_FLIPX : 0; | |
| 183 | int flipy = ((state->colorram[tile_index] & 0x80) >> 7) ? TILEMAP_FLIPY : 0; | |
| 180 | 184 | |
| 181 | tile = ojankohs_videoram[tile_index] | (ojankohs_videoram[tile_index + 0x1000] << 8); | |
| 182 | color = ojankohs_colorram[tile_index] & 0x3f; | |
| 183 | flipx = ((ojankohs_colorram[tile_index] & 0x40) >> 6) ? TILEMAP_FLIPX : 0; | |
| 184 | flipy = ((ojankohs_colorram[tile_index] & 0x80) >> 7) ? TILEMAP_FLIPY : 0; | |
| 185 | ||
| 186 | 185 | SET_TILE_INFO(0, tile, color, (flipx | flipy)); |
| 187 | 186 | } |
| 188 | 187 | |
| r7500 | r7501 | |
| 193 | 192 | |
| 194 | 193 | ******************************************************************************/ |
| 195 | 194 | |
| 196 | void ojankoc_flipscreen(const address_space *space, int data) | |
| 195 | void ojankoc_flipscreen( const address_space *space, int data ) | |
| 197 | 196 | { |
| 198 | stat | |
| 197 | ojankohs_state | |
| 199 | 198 | int x, y; |
| 200 | 199 | UINT8 color1, color2; |
| 201 | 200 | |
| 202 | | |
| 201 | | |
| 203 | 202 | |
| 204 | if (ojankohs_flipscreen == ojankoc_flipscreen_old) return; | |
| 203 | if (state->flipscreen == state->flipscreen_old) | |
| 204 | return; | |
| 205 | 205 | |
| 206 | for (y = 0; y < 0x40; y++) { | |
| 207 | for (x = 0; x < 0x100; x++) { | |
| 208 | color1 = ojankohs_videoram[0x0000 + ((y * 256) + x)]; | |
| 209 | color2 = ojankohs_videoram[0x3fff - ((y * 256) + x)]; | |
| 206 | for (y = 0; y < 0x40; y++) | |
| 207 | { | |
| 208 | for (x = 0; x < 0x100; x++) | |
| 209 | { | |
| 210 | color1 = state->videoram[0x0000 + ((y * 256) + x)]; | |
| 211 | color2 = state->videoram[0x3fff - ((y * 256) + x)]; | |
| 210 | 212 | ojankoc_videoram_w(space, 0x0000 + ((y * 256) + x), color2); |
| 211 | 213 | ojankoc_videoram_w(space, 0x3fff - ((y * 256) + x), color1); |
| 212 | 214 | |
| 213 | color1 = ojankohs_videoram[0x4000 + ((y * 256) + x)]; | |
| 214 | color2 = ojankohs_videoram[0x7fff - ((y * 256) + x)]; | |
| 215 | color1 = state->videoram[0x4000 + ((y * 256) + x)]; | |
| 216 | color2 = state->videoram[0x7fff - ((y * 256) + x)]; | |
| 215 | 217 | ojankoc_videoram_w(space, 0x4000 + ((y * 256) + x), color2); |
| 216 | 218 | ojankoc_videoram_w(space, 0x7fff - ((y * 256) + x), color1); |
| 217 | 219 | } |
| 218 | 220 | } |
| 219 | 221 | |
| 220 | | |
| 222 | state-> | |
| 221 | 223 | } |
| 222 | 224 | |
| 223 | 225 | WRITE8_HANDLER( ojankoc_videoram_w ) |
| 224 | 226 | { |
| 227 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 225 | 228 | int i; |
| 226 | 229 | UINT8 x, y, xx, px, py ; |
| 227 | 230 | UINT8 color, color1, color2; |
| 228 | 231 | |
| 229 | | |
| 232 | | |
| 230 | 233 | |
| 231 | color1 = ojankohs_videoram[offset & 0x3fff]; | |
| 232 | color2 = ojankohs_videoram[offset | 0x4000]; | |
| 234 | color1 = state->videoram[offset & 0x3fff]; | |
| 235 | color2 = state->videoram[offset | 0x4000]; | |
| 233 | 236 | |
| 234 | 237 | y = offset >> 6; |
| 235 | 238 | x = (offset & 0x3f) << 2; |
| 236 | 239 | xx = 0; |
| 237 | 240 | |
| 238 | if (ojankohs_flipscreen) { | |
| 241 | if (state->flipscreen) | |
| 242 | { | |
| 239 | 243 | x = 0xfc - x; |
| 240 | 244 | y = 0xff - y; |
| 241 | 245 | xx = 3; |
| 242 | 246 | } |
| 243 | 247 | |
| 244 | for (i = 0; i < 4; i++) { | |
| 248 | for (i = 0; i < 4; i++) | |
| 249 | { | |
| 245 | 250 | color = ((color1 & 0x01) >> 0) | ((color1 & 0x10) >> 3) | ((color2 & 0x01) << 2) | ((color2 & 0x10) >> 1); |
| 246 | 251 | |
| 247 | 252 | px = x + (i ^ xx); |
| 248 | 253 | py = y; |
| 249 | 254 | |
| 250 | *BITMAP_ADDR16( | |
| 255 | *BITMAP_ADDR16(state-> | |
| 251 | 256 | |
| 252 | 257 | color1 >>= 1; |
| 253 | 258 | color2 >>= 1; |
| r7500 | r7501 | |
| 263 | 268 | |
| 264 | 269 | VIDEO_START( ojankohs ) |
| 265 | 270 | { |
| 266 | ojankohs_tilemap = tilemap_create(machine, ojankohs_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64); | |
| 267 | ojankohs_videoram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 268 | ojankohs_colorram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 269 | ojankohs_paletteram = auto_alloc_array(machine, UINT8, 0x800); | |
| 271 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 272 | ||
| 273 | state->tilemap = tilemap_create(machine, ojankohs_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64); | |
| 274 | state->videoram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 275 | state->colorram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 276 | state->paletteram = auto_alloc_array(machine, UINT8, 0x800); | |
| 277 | ||
| 278 | state_save_register_global_pointer(machine, state->videoram, 0x2000); | |
| 279 | state_save_register_global_pointer(machine, state->colorram, 0x1000); | |
| 280 | state_save_register_global_pointer(machine, state->paletteram, 0x800); | |
| 270 | 281 | } |
| 271 | 282 | |
| 272 | 283 | VIDEO_START( ojankoy ) |
| 273 | 284 | { |
| 274 | ojankohs_tilemap = tilemap_create(machine, ojankoy_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64); | |
| 275 | ojankohs_videoram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 276 | ojankohs_colorram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 277 | ojankohs_paletteram = auto_alloc_array(machine, UINT8, 0x800); | |
| 285 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 286 | ||
| 287 | state->tilemap = tilemap_create(machine, ojankoy_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64); | |
| 288 | state->videoram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 289 | state->colorram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 290 | state->paletteram = auto_alloc_array(machine, UINT8, 0x800); | |
| 291 | ||
| 292 | state_save_register_global_pointer(machine, state->videoram, 0x2000); | |
| 293 | state_save_register_global_pointer(machine, state->colorram, 0x1000); | |
| 294 | state_save_register_global_pointer(machine, state->paletteram, 0x800); | |
| 278 | 295 | } |
| 279 | 296 | |
| 280 | 297 | VIDEO_START( ojankoc ) |
| 281 | 298 | { |
| 282 | ojankoc_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 283 | ojankohs_videoram = auto_alloc_array(machine, UINT8, 0x8000); | |
| 284 | ojankohs_paletteram = auto_alloc_array(machine, UINT8, 0x20); | |
| 299 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 300 | ||
| 301 | state->tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 302 | state->videoram = auto_alloc_array(machine, UINT8, 0x8000); | |
| 303 | state->paletteram = auto_alloc_array(machine, UINT8, 0x20); | |
| 304 | ||
| 305 | state_save_register_global_pointer(machine, state->videoram, 0x8000); | |
| 306 | state_save_register_global_pointer(machine, state->paletteram, 0x20); | |
| 307 | state_save_register_global_bitmap(machine, state->tmpbitmap); | |
| 285 | 308 | } |
| 286 | 309 | |
| 287 | 310 | |
| r7500 | r7501 | |
| 293 | 316 | |
| 294 | 317 | VIDEO_UPDATE( ojankohs ) |
| 295 | 318 | { |
| 296 | tilemap_set_scrollx(ojankohs_tilemap, 0, ojankohs_scrollx); | |
| 297 | tilemap_set_scrolly(ojankohs_tilemap, 0, ojankohs_scrolly); | |
| 319 | ojankohs_state *state = (ojankohs_state *)screen->machine->driver_data; | |
| 298 | 320 | |
| 299 | tilemap_draw(bitmap, cliprect, ojankohs_tilemap, 0, 0); | |
| 321 | tilemap_set_scrollx(state->tilemap, 0, state->scrollx); | |
| 322 | tilemap_set_scrolly(state->tilemap, 0, state->scrolly); | |
| 323 | ||
| 324 | tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0); | |
| 300 | 325 | return 0; |
| 301 | 326 | } |
| 302 | 327 | |
| 303 | 328 | VIDEO_UPDATE( ojankoc ) |
| 304 | 329 | { |
| 330 | ojankohs_state *state = (ojankohs_state *)screen->machine->driver_data; | |
| 305 | 331 | int offs; |
| 306 | 332 | |
| 307 | if ( | |
| 333 | if (state-> | |
| 308 | 334 | { |
| 309 | 335 | const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 310 | 336 | |
| 311 | 337 | /* redraw bitmap */ |
| 312 | for (offs = 0; offs < 0x8000; offs++) { | |
| 313 | ojankoc_videoram_w(space, offs, ojankohs_videoram[offs]); | |
| 338 | for (offs = 0; offs < 0x8000; offs++) | |
| 339 | { | |
| 340 | ojankoc_videoram_w(space, offs, state->videoram[offs]); | |
| 314 | 341 | } |
| 315 | | |
| 342 | state-> | |
| 316 | 343 | } |
| 317 | 344 | |
| 318 | copybitmap(bitmap, | |
| 345 | copybitmap(bitmap, state-> | |
| 319 | 346 | return 0; |
| 320 | 347 | } |
| r7500 | r7501 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | tile = RAM[tile_index]; |
| 63 | if (tile > 0x7f) bank = 3; else bank = 2; | |
| 63 | if (tile > 0x7f) | |
| 64 | bank = 3; | |
| 65 | else | |
| 66 | bank = 2; | |
| 64 | 67 | SET_TILE_INFO(bank, tile & 0x7f, state->background_color, 0); |
| 65 | 68 | } |
| 66 | 69 | |
| r7500 | r7501 | |
| 104 | 107 | liberate_state *state = (liberate_state *)space->machine->driver_data; |
| 105 | 108 | state->io_ram[offset] = data; |
| 106 | 109 | if (offset > 1 && offset < 6) |
| 107 | tilemap_mark_all_tiles_dirty(state->back | |
| 110 | tilemap_mark_all_tiles_dirty(state->back | |
| 108 | 111 | |
| 109 | 112 | switch (offset) |
| 110 | 113 | { |
| r7500 | r7501 | |
| 112 | 115 | if (((data >> 4) & 3) != state->background_color) |
| 113 | 116 | { |
| 114 | 117 | state->background_color = (data >> 4) & 3; |
| 115 | tilemap_mark_all_tiles_dirty(state->back | |
| 118 | tilemap_mark_all_tiles_dirty(state->back | |
| 116 | 119 | } |
| 117 | 120 | state->background_disable = data & 0x4; |
| 118 | flip_screen_set(space->machine, data & 0x1); | |
| 121 | flip_screen_set(space->machine, data & 0x01); | |
| 119 | 122 | break; |
| 120 | 123 | case 7: /* Background palette resistors? */ |
| 121 | 124 | /* Todo */ |
| 122 | 125 | break; |
| 123 | 126 | case 8: /* Irq ack */ |
| 124 | cpu | |
| 127 | cpu | |
| 125 | 128 | break; |
| 126 | 129 | case 9: /* Sound */ |
| 127 | 130 | soundlatch_w(space, 0, data); |
| 128 | cpu | |
| 131 | cpu | |
| 129 | 132 | break; |
| 130 | 133 | } |
| 131 | 134 | } |
| r7500 | r7501 | |
| 135 | 138 | liberate_state *state = (liberate_state *)space->machine->driver_data; |
| 136 | 139 | state->io_ram[offset] = data; |
| 137 | 140 | if (offset > 1 && offset < 6) |
| 138 | tilemap_mark_all_tiles_dirty(state->back | |
| 141 | tilemap_mark_all_tiles_dirty(state->back | |
| 139 | 142 | |
| 140 | // popmessage("%02x %02x",state->io_ram[6],state->io_ram[7]); | |
| 143 | // popmessage("%02x %02x",state->io_ram[6],state->io_ram[7]); | |
| 141 | 144 | |
| 142 | 145 | switch (offset) |
| 143 | 146 | { |
| r7500 | r7501 | |
| 150 | 153 | /* x--- ---- used on the attract mode */ |
| 151 | 154 | break; |
| 152 | 155 | case 8: /* Irq ack */ |
| 153 | cpu | |
| 156 | cpu | |
| 154 | 157 | break; |
| 155 | 158 | case 9: /* Sound */ |
| 156 | 159 | soundlatch_w(space, 0, data); |
| 157 | cpu | |
| 160 | cpu | |
| 158 | 161 | break; |
| 159 | 162 | } |
| 160 | 163 | } |
| r7500 | r7501 | |
| 170 | 173 | case 0: |
| 171 | 174 | //background_disable = ~data & 0x80; |
| 172 | 175 | flip_screen_set(space->machine, data & 0x80); |
| 173 | tilemap_mark_all_tiles_dirty(state->back | |
| 176 | tilemap_mark_all_tiles_dirty(state->back | |
| 174 | 177 | break; |
| 175 | 178 | case 2: /* Sound */ |
| 176 | 179 | soundlatch_w(space, 0, data); |
| 177 | cpu | |
| 180 | cpu | |
| 178 | 181 | break; |
| 179 | 182 | case 4: /* Irq ack */ |
| 180 | cpu | |
| 183 | cpu | |
| 181 | 184 | break; |
| 182 | 185 | } |
| 183 | 186 | } |
| r7500 | r7501 | |
| 200 | 203 | { |
| 201 | 204 | liberate_state *state = (liberate_state *)space->machine->driver_data; |
| 202 | 205 | state->bg_vram[offset] = data; |
| 203 | tilemap_mark_tile_dirty(state->back | |
| 206 | tilemap_mark_tile_dirty(state->back | |
| 204 | 207 | } |
| 205 | 208 | |
| 206 | 209 | /***************************************************************************/ |
| r7500 | r7501 | |
| 208 | 211 | VIDEO_START( prosoccr ) |
| 209 | 212 | { |
| 210 | 213 | liberate_state *state = (liberate_state *)machine->driver_data; |
| 211 | state->background_tilemap = tilemap_create(machine, get_back_tile_info,back_scan,16,16,32,32); | |
| 212 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32); | |
| 214 | state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32); | |
| 215 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32); | |
| 213 | 216 | |
| 214 | tilemap_set_transparent_pen(state->fix_tilemap,0); | |
| 217 | tilemap_set_transparent_pen(state->fix_tilemap, 0); | |
| 215 | 218 | |
| 216 | state->charram = auto_alloc_array(machine, UINT8, 0x1800*2); | |
| 219 | state->charram = auto_alloc_array(machine, UINT8, 0x1800 * 2); | |
| 217 | 220 | } |
| 218 | 221 | |
| 219 | 222 | VIDEO_START( boomrang ) |
| 220 | 223 | { |
| 221 | 224 | liberate_state *state = (liberate_state *)machine->driver_data; |
| 222 | state->background_tilemap = tilemap_create(machine, get_back_tile_info,back_scan,16,16,32,32); | |
| 223 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32); | |
| 225 | state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32); | |
| 226 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32); | |
| 224 | 227 | |
| 225 | tilemap_set_transmask(state->background_tilemap,0,0x0001,0x007e); /* Bottom 1 pen/Top 7 pens */ | |
| 226 | tilemap_set_transparent_pen(state->fix_tilemap,0); | |
| 228 | tilemap_set_transmask(state->back_tilemap, 0, 0x0001, 0x007e); /* Bottom 1 pen/Top 7 pens */ | |
| 229 | tilemap_set_transparent_pen(state->fix_tilemap, 0); | |
| 227 | 230 | } |
| 228 | 231 | |
| 229 | 232 | VIDEO_START( liberate ) |
| 230 | 233 | { |
| 231 | 234 | liberate_state *state = (liberate_state *)machine->driver_data; |
| 232 | state->background_tilemap = tilemap_create(machine, get_back_tile_info,back_scan,16,16,32,32); | |
| 233 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32); | |
| 235 | state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32); | |
| 236 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32); | |
| 234 | 237 | |
| 235 | tilemap_set_transparent_pen(state->fix_tilemap,0); | |
| 238 | tilemap_set_transparent_pen(state->fix_tilemap, 0); | |
| 236 | 239 | } |
| 237 | 240 | |
| 238 | 241 | VIDEO_START( prosport ) |
| 239 | 242 | { |
| 240 | 243 | liberate_state *state = (liberate_state *)machine->driver_data; |
| 241 | state->background_tilemap = tilemap_create(machine, prosport_get_back_tile_info,back_scan,16,16,32,32); | |
| 242 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32); | |
| 244 | state->back_tilemap = tilemap_create(machine, prosport_get_back_tile_info, back_scan, 16, 16, 32, 32); | |
| 245 | state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32); | |
| 243 | 246 | |
| 244 | tilemap_set_transparent_pen(state->fix_tilemap,0); | |
| 247 | tilemap_set_transparent_pen(state->fix_tilemap, 0); | |
| 245 | 248 | } |
| 246 | 249 | |
| 247 | 250 | /***************************************************************************/ |
| 248 | 251 | |
| 249 | 252 | WRITE8_HANDLER( prosport_paletteram_w ) |
| 250 | 253 | { |
| 251 | space->machine->generic.paletteram.u8[offset] = data; | |
| 254 | liberate_state *state = (liberate_state *)space->machine->driver_data; | |
| 255 | state->paletteram[offset] = data; | |
| 252 | 256 | |
| 253 | 257 | /* RGB output is inverted */ |
| 254 | 258 | palette_set_color_rgb(space->machine, offset, pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)); |
| r7500 | r7501 | |
| 256 | 260 | |
| 257 | 261 | PALETTE_INIT( liberate ) |
| 258 | 262 | { |
| 259 | int i,bit0,bit1,bit2,g,r,b; | |
| 263 | int i, bit0, bit1, bit2, g, r, b; | |
| 260 | 264 | |
| 261 | 265 | for (i = 0;i < 32;i++) |
| 262 | 266 | { |
| r7500 | r7501 | |
| 286 | 290 | |
| 287 | 291 | /***************************************************************************/ |
| 288 | 292 | |
| 289 | static void liberate_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 293 | static void liberate_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 290 | 294 | { |
| 291 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 295 | liberate_state *state = (liberate_state *)machine->driver_data; | |
| 296 | UINT8 *spriteram = state->spriteram; | |
| 292 | 297 | int offs; |
| 293 | 298 | |
| 294 | 299 | /* Sprites */ |
| 295 | for (offs = 0x000;offs < 0x800;offs += 4) | |
| 300 | for (offs = 0x000; offs < 0x800; offs += 4) | |
| 296 | 301 | { |
| 297 | int multi,fx,fy,sx,sy,sy2,code,color; | |
| 302 | int multi, fx, fy, sx, sy, sy2, code, color; | |
| 298 | 303 | |
| 299 | 304 | /* |
| 300 | 305 | Byte 0: 0x01 - ? |
| r7500 | r7501 | |
| 309 | 314 | Byte 3: 0xff - X position |
| 310 | 315 | */ |
| 311 | 316 | |
| 312 | code = spriteram[offs+1] + ((spriteram[offs+0] & 0x60) << 3); | |
| 313 | sx = 240 - spriteram[offs+3]; | |
| 314 | sy = 240 - spriteram[offs+2]; | |
| 315 | color = ((spriteram[offs+1] & 0x08) >> 3); // ? | |
| 317 | code = spriteram[offs + 1] + ((spriteram[offs + 0] & 0x60) << 3); | |
| 318 | sx = 240 - spriteram[offs + 3]; | |
| 319 | sy = 240 - spriteram[offs + 2]; | |
| 320 | color = ((spriteram[offs + 1] & 0x08) >> 3); // ? | |
| 316 | 321 | |
| 317 | fx = spriteram[offs+0] & 0x04; | |
| 318 | fy = spriteram[offs+0] & 0x02; | |
| 319 | multi = spriteram[offs+0] & 0x10; | |
| 322 | fx = spriteram[offs + 0] & 0x04; | |
| 323 | fy = spriteram[offs + 0] & 0x02; | |
| 324 | multi = spriteram[offs + 0] & 0x10; | |
| 320 | 325 | |
| 321 | if (multi && fy==0) sy-=16; | |
| 326 | if (multi && fy == 0) | |
| 327 | sy -= 16; | |
| 322 | 328 | |
| 323 | 329 | if (flip_screen_get(machine)) |
| 324 | 330 | { |
| 325 | sy=240-sy; | |
| 326 | sx=240-sx; | |
| 331 | sy = 240 - sy; | |
| 332 | sx = 240 - sx; | |
| 327 | 333 | if (fy) |
| 328 | sy2=sy+16; | |
| 334 | sy2 = sy + 16; | |
| 329 | 335 | else |
| 330 | sy2=sy-16; | |
| 331 | if (fx) fx=0; else fx=1; | |
| 332 | if (fy) fy=0; else fy=1; | |
| 336 | sy2 = sy - 16; | |
| 337 | if (fx) fx = 0; else fx = 1; | |
| 338 | if (fy) fy = 0; else fy = 1; | |
| 333 | 339 | } |
| 334 | 340 | else |
| 335 | 341 | { |
| 336 | 342 | if (fy) |
| 337 | sy2=sy-16; | |
| 343 | sy2 = sy - 16; | |
| 338 | 344 | else |
| 339 | sy2=sy+16; | |
| 345 | sy2 = sy + 16; | |
| 340 | 346 | } |
| 341 | 347 | |
| 342 | 348 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| r7500 | r7501 | |
| 353 | 359 | } |
| 354 | 360 | } |
| 355 | 361 | |
| 356 | static void prosport_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 362 | static void prosport_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 357 | 363 | { |
| 358 | 364 | liberate_state *state = (liberate_state *)machine->driver_data; |
| 359 | int offs,multi,fx,fy,sx,sy,sy2,code,code2,color,gfx_region; | |
| 360 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 365 | int offs, multi, fx, fy, sx, sy, sy2, code, code2, color, gfx_region; | |
| 366 | UINT8 *spriteram = state->spriteram; | |
| 361 | 367 | |
| 362 | for (offs = 0x000;offs < 0x800;offs += 4) | |
| 368 | for (offs = 0x000; offs < 0x800; offs += 4) | |
| 363 | 369 | { |
| 364 | if ((spriteram[offs+0]&1)!=1) continue; | |
| 370 | if ((spriteram[offs + 0] & 1) != 1) | |
| 371 | continue; | |
| 365 | 372 | |
| 366 | code = spriteram[offs+1] + ((spriteram[offs+0]&0x3)<<8); | |
| 367 | code2=code+1; | |
| 373 | code = spriteram[offs + 1] + ((spriteram[offs + 0] & 0x3) << 8); | |
| 374 | code2 = code + 1; | |
| 368 | 375 | |
| 369 | if(state->io_ram[0]&0x40) //dynamic ram-based gfxs for Pro Golf | |
| 370 | gfx_region = 3+4; | |
| 376 | if(state->io_ram[0] & 0x40) //dynamic ram-based gfxs for Pro Golf | |
| 377 | gfx_region = 3 + 4; | |
| 371 | 378 | else |
| 372 | gfx_region = ((state->io_ram[0]&0x30)>>4)+4; | |
| 379 | gfx_region = ((state->io_ram[0] & 0x30) >> 4) + 4; | |
| 373 | 380 | |
| 374 | 381 | |
| 375 | multi = spriteram[offs+0] & 0x10; | |
| 382 | multi = spriteram[offs + 0] & 0x10; | |
| 376 | 383 | |
| 377 | sy=spriteram[offs+2]; | |
| 378 | if (multi) sy+=16; | |
| 379 | sx = (240 - spriteram[offs+3]); | |
| 380 | // sy = (240-spriteram[offs+2]);//-16; | |
| 381 | sy = 240-sy; | |
| 384 | sy = spriteram[offs + 2]; | |
| 385 | if (multi) | |
| 386 | sy += 16; | |
| 387 | sx = (240 - spriteram[offs + 3]); | |
| 388 | // sy = (240 - spriteram[offs + 2]);//-16; | |
| 389 | sy = 240 - sy; | |
| 382 | 390 | |
| 383 | color = 1;//(state->io_ram[4] & 2)+1;//(spriteram[offs+0]&0x4)>>2; | |
| 391 | color = 1;//(state->io_ram[4] & 2) + 1;//(spriteram[offs + 0] & 0x4) >> 2; | |
| 384 | 392 | |
| 385 | fy = spriteram[offs+0] & 0x02; | |
| 386 | fx = spriteram[offs+0] & 0x04; | |
| 387 | multi = 0;// spriteram[offs+0] & 0x10; | |
| 393 | fy = spriteram[offs + 0] & 0x02; | |
| 394 | fx = spriteram[offs + 0] & 0x04; | |
| 395 | multi = 0;// spriteram[offs + 0] & 0x10; | |
| 388 | 396 | |
| 389 | // if (multi) sy-=16; | |
| 390 | if ((fy && multi) || (fx && multi)) { code2=code; code++; } | |
| 397 | // if (multi) sy -= 16; | |
| 398 | if ((fy && multi) || (fx && multi)) { code2 = code; code++; } | |
| 391 | 399 | |
| 392 | 400 | if (flip_screen_get(machine)) |
| 393 | 401 | { |
| 394 | sy=240-sy; | |
| 395 | sx=240-sx; | |
| 396 | if (fx) fx=0; else fx=1; | |
| 397 | if (fy) fy=0; else fy=1; | |
| 398 | sy2=sy-16; | |
| 402 | sy = 240 - sy; | |
| 403 | sx = 240 - sx; | |
| 404 | if (fx) fx = 0; else fx = 1; | |
| 405 | if (fy) fy = 0; else fy = 1; | |
| 406 | sy2 = sy - 16; | |
| 399 | 407 | } |
| 400 | 408 | else |
| 401 | 409 | { |
| 402 | sy2=sy+16; | |
| 410 | sy2 = sy + 16; | |
| 403 | 411 | } |
| 404 | 412 | |
| 405 | 413 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region], |
| r7500 | r7501 | |
| 416 | 424 | } |
| 417 | 425 | } |
| 418 | 426 | |
| 419 | static void boomrang_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri) | |
| 427 | static void boomrang_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri ) | |
| 420 | 428 | { |
| 421 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 422 | int offs,multi,fx,fy,sx,sy,sy2,code,code2,color; | |
| 429 | liberate_state *state = (liberate_state *)machine->driver_data; | |
| 430 | UINT8 *spriteram = state->spriteram; | |
| 431 | int offs, multi, fx, fy, sx, sy, sy2, code, code2, color; | |
| 423 | 432 | |
| 424 | for (offs = 0x000;offs < 0x800;offs += 4) | |
| 433 | for (offs = 0x000; offs < 0x800; offs += 4) | |
| 425 | 434 | { |
| 426 | if ((spriteram[offs+0]&1)!=1) continue; | |
| 427 | if ((spriteram[offs+0]&0x8)!=pri) continue; | |
| 435 | if ((spriteram[offs + 0] & 1) != 1) | |
| 436 | continue; | |
| 437 | if ((spriteram[offs + 0] & 0x8) != pri) | |
| 438 | continue; | |
| 428 | 439 | |
| 429 | code = spriteram[offs+1] + ((spriteram[offs+0]&0xe0)<<3); | |
| 430 | code2=code+1; | |
| 440 | code = spriteram[offs + 1] + ((spriteram[offs + 0] & 0xe0) << 3); | |
| 441 | code2 = code + 1; | |
| 431 | 442 | |
| 432 | multi = spriteram[offs+0] & 0x10; | |
| 443 | multi = spriteram[offs + 0] & 0x10; | |
| 433 | 444 | |
| 434 | sy=spriteram[offs+2]; | |
| 435 | if (multi) sy+=16; | |
| 436 | sx = (240 - spriteram[offs+3]); | |
| 437 | // sy = (240-spriteram[offs+2]);//-16; | |
| 438 | sy = 240-sy; | |
| 445 | sy=spriteram[offs + 2]; | |
| 446 | if (multi) | |
| 447 | sy += 16; | |
| 448 | sx = (240 - spriteram[offs + 3]); | |
| 449 | // sy = (240-spriteram[offs + 2]);//-16; | |
| 450 | sy = 240 - sy; | |
| 439 | 451 | |
| 440 | color = (spriteram[offs+0]&0x4)>>2; | |
| 452 | color = (spriteram[offs + 0] & 0x4) >> 2; | |
| 441 | 453 | |
| 442 | 454 | fx = 0; |
| 443 | fy = spriteram[offs+0] & 0x02; | |
| 444 | multi = spriteram[offs+0] & 0x10; | |
| 455 | fy = spriteram[offs + 0] & 0x02; | |
| 456 | multi = spriteram[offs + 0] & 0x10; | |
| 445 | 457 | |
| 446 | // if (multi) sy-=16; | |
| 447 | if (fy && multi) { code2=code; code++; } | |
| 458 | // if (multi) sy -= 16; | |
| 459 | if (fy && multi) { code2 = code; code++; } | |
| 448 | 460 | |
| 449 | 461 | if (flip_screen_get(machine)) |
| 450 | 462 | { |
| 451 | sy=240-sy; | |
| 452 | sx=240-sx; | |
| 453 | if (fx) fx=0; else fx=1; | |
| 454 | if (fy) fy=0; else fy=1; | |
| 455 | sy2=sy-16; | |
| 463 | sy = 240 - sy; | |
| 464 | sx = 240 - sx; | |
| 465 | if (fx) fx = 0; else fx = 1; | |
| 466 | if (fy) fy = 0; else fy = 1; | |
| 467 | sy2 = sy - 16; | |
| 456 | 468 | } |
| 457 | 469 | else |
| 458 | 470 | { |
| 459 | sy2=sy+16; | |
| 471 | sy2 = sy + 16; | |
| 460 | 472 | } |
| 461 | 473 | |
| 462 | 474 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| r7500 | r7501 | |
| 473 | 485 | } |
| 474 | 486 | } |
| 475 | 487 | |
| 476 | static void prosoccr_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 488 | static void prosoccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 477 | 489 | { |
| 478 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 479 | int offs,code,fx,fy,sx,sy; | |
| 490 | liberate_state *state = (liberate_state *)machine->driver_data; | |
| 491 | UINT8 *spriteram = state->spriteram; | |
| 492 | int offs, code, fx, fy, sx, sy; | |
| 480 | 493 | |
| 481 | for (offs = 0x000;offs < 0x400;offs += 4) | |
| 494 | for (offs = 0x000; offs < 0x400; offs += 4) | |
| 482 | 495 | { |
| 483 | if ((spriteram[offs+0]&1)!=1) continue; | |
| 496 | if ((spriteram[offs + 0] & 1) != 1) | |
| 497 | continue; | |
| 484 | 498 | |
| 485 | code = spriteram[offs+1]; | |
| 486 | sy = 240 - spriteram[offs+2]; | |
| 487 | sx = 240 - spriteram[offs+3]; | |
| 488 | fx = spriteram[offs+0] & 4; | |
| 489 | fy = spriteram[offs+0] & 2; | |
| 499 | code = spriteram[offs + 1]; | |
| 500 | sy = 240 - spriteram[offs + 2]; | |
| 501 | sx = 240 - spriteram[offs + 3]; | |
| 502 | fx = spriteram[offs + 0] & 4; | |
| 503 | fy = spriteram[offs + 0] & 2; | |
| 490 | 504 | |
| 491 | 505 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 492 | 506 | code, |
| r7500 | r7501 | |
| 501 | 515 | VIDEO_UPDATE( prosoccr ) |
| 502 | 516 | { |
| 503 | 517 | liberate_state *state = (liberate_state *)screen->machine->driver_data; |
| 504 | tilemap_set_scrolly(state->background_tilemap,0, state->io_ram[1]); | |
| 505 | tilemap_set_scrollx(state->background_tilemap,0,-state->io_ram[0]); | |
| 518 | tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]); | |
| 519 | tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]); | |
| 506 | 520 | |
| 507 | 521 | if (state->background_disable) |
| 508 | bitmap_fill(bitmap,cliprect,32); | |
| 522 | bitmap_fill(bitmap, cliprect, 32); | |
| 509 | 523 | else |
| 510 | tilemap_draw(bitmap,cliprect,state->back | |
| 524 | tilemap_draw(bitmap, cliprect, state->back | |
| 511 | 525 | |
| 512 | tilemap_draw(bitmap,cliprect,state->fix_tilemap,0,0); | |
| 513 | prosoccr_draw_sprites(screen->machine,bitmap,cliprect); | |
| 526 | tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0); | |
| 527 | prosoccr_draw_sprites(screen->machine, bitmap, cliprect); | |
| 514 | 528 | |
| 515 | 529 | return 0; |
| 516 | 530 | } |
| r7500 | r7501 | |
| 520 | 534 | liberate_state *state = (liberate_state *)screen->machine->driver_data; |
| 521 | 535 | UINT8 *videoram = state->videoram; |
| 522 | 536 | UINT8 *colorram = state->colorram; |
| 523 | int mx,my,tile,offs,gfx_region; | |
| 524 | int scrollx,scrolly; | |
| 537 | int mx, my, tile, offs, gfx_region; | |
| 538 | int scrollx, scrolly; | |
| 525 | 539 | |
| 526 | bitmap_fill(bitmap,cliprect,0); | |
| 540 | bitmap_fill(bitmap, cliprect, 0); | |
| 527 | 541 | |
| 528 | 542 | offs = 0; |
| 529 | 543 | /* TODO: what's bits 0 and 2 for? Internal scrolling state? */ |
| 530 | scrolly = ((state->io_ram[0] & 0x8)<<5); | |
| 531 | scrollx = ((state->io_ram[0] & 0x2)<<7) | (state->io_ram[1]); | |
| 544 | scrolly = ((state->io_ram[0] & 0x8) << 5); | |
| 545 | scrollx = ((state->io_ram[0] & 0x2) << 7) | (state->io_ram[1]); | |
| 532 | 546 | |
| 533 | tilemap_set_scrolly(state->background_tilemap,0,scrolly); | |
| 534 | tilemap_set_scrollx(state->background_tilemap,0,-scrollx); | |
| 547 | tilemap_set_scrolly(state->back_tilemap, 0, scrolly); | |
| 548 | tilemap_set_scrollx(state->back_tilemap, 0, -scrollx); | |
| 535 | 549 | |
| 536 | tilemap_draw(bitmap,cliprect,state->back | |
| 550 | tilemap_draw(bitmap, cliprect, state->back | |
| 537 | 551 | |
| 538 | 552 | // popmessage("%d %02x %02x %02x %02x %02x %02x %02x %02x",scrollx,deco16_io_ram[0],deco16_io_ram[1],deco16_io_ram[2],deco16_io_ram[3] |
| 539 | 553 | // ,deco16_io_ram[4],deco16_io_ram[5],deco16_io_ram[6],deco16_io_ram[7]); |
| 540 | 554 | |
| 541 | for (offs = 0;offs < 0x400;offs++) | |
| 555 | for (offs = 0; offs < 0x400; offs++) | |
| 542 | 556 | { |
| 543 | tile=videoram[offs]+((colorram[offs]&0x3)<<8); | |
| 557 | tile = videoram[offs] + ((colorram[offs] & 0x3) << 8); | |
| 544 | 558 | |
| 545 | if(state->io_ram[0]&0x40) //dynamic ram-based gfxs for Pro Golf | |
| 559 | if(state->io_ram[0] & 0x40) //dynamic ram-based gfxs for Pro Golf | |
| 546 | 560 | gfx_region = 3; |
| 547 | 561 | else |
| 548 | gfx_region = ((state->io_ram[0]&0x30)>>4); | |
| 562 | gfx_region = ((state->io_ram[0] & 0x30) >> 4); | |
| 549 | 563 | |
| 550 | 564 | my = (offs) % 32; |
| 551 | 565 | mx = (offs) / 32; |
| 552 | 566 | |
| 553 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx_region], | |
| 554 | tile,1,0,0,248-8*mx,8*my,0); | |
| 567 | drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[gfx_region], | |
| 568 | tile, 1, 0, 0, 248 - 8 * mx, 8 * my, 0); | |
| 555 | 569 | } |
| 556 | 570 | |
| 557 | prosport_draw_sprites(screen->machine,bitmap,cliprect); | |
| 571 | prosport_draw_sprites(screen->machine, bitmap, cliprect); | |
| 558 | 572 | |
| 559 | 573 | return 0; |
| 560 | 574 | } |
| r7500 | r7501 | |
| 562 | 576 | VIDEO_UPDATE( boomrang ) |
| 563 | 577 | { |
| 564 | 578 | liberate_state *state = (liberate_state *)screen->machine->driver_data; |
| 565 | tilemap_set_scrolly(state->background_tilemap,0, state->io_ram[1]); | |
| 566 | tilemap_set_scrollx(state->background_tilemap,0,-state->io_ram[0]); | |
| 579 | tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]); | |
| 580 | tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]); | |
| 567 | 581 | |
| 568 | 582 | if (state->background_disable) |
| 569 | bitmap_fill(bitmap,cliprect,32); | |
| 583 | bitmap_fill(bitmap, cliprect, 32); | |
| 570 | 584 | else |
| 571 | tilemap_draw(bitmap,cliprect,state->back | |
| 585 | tilemap_draw(bitmap, cliprect, state->back | |
| 572 | 586 | |
| 573 | 587 | boomrang_draw_sprites(screen->machine,bitmap,cliprect,8); |
| 574 | 588 | if (!state->background_disable) |
| 575 | tilemap_draw(bitmap,cliprect,state->background_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 576 | boomrang_draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 577 | tilemap_draw(bitmap,cliprect,state->fix_tilemap,0,0); | |
| 589 | tilemap_draw(bitmap, cliprect, state->back_tilemap, TILEMAP_DRAW_LAYER0, 0); | |
| 590 | ||
| 591 | boomrang_draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 592 | tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0); | |
| 578 | 593 | return 0; |
| 579 | 594 | } |
| 580 | 595 | |
| 581 | 596 | VIDEO_UPDATE( liberate ) |
| 582 | 597 | { |
| 583 | 598 | liberate_state *state = (liberate_state *)screen->machine->driver_data; |
| 584 | tilemap_set_scrolly(state->background_tilemap,0, state->io_ram[1]); | |
| 585 | tilemap_set_scrollx(state->background_tilemap,0,-state->io_ram[0]); | |
| 599 | tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]); | |
| 600 | tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]); | |
| 586 | 601 | |
| 587 | 602 | if (state->background_disable) |
| 588 | bitmap_fill(bitmap,cliprect,32); | |
| 603 | bitmap_fill(bitmap, cliprect, 32); | |
| 589 | 604 | else |
| 590 | tilemap_draw(bitmap,cliprect,state->back | |
| 605 | tilemap_draw(bitmap, cliprect, state->back | |
| 591 | 606 | |
| 592 | liberate_draw_sprites(screen->machine,bitmap,cliprect); | |
| 593 | tilemap_draw(bitmap,cliprect,state->fix_tilemap,0,0); | |
| 607 | liberate_draw_sprites(screen->machine, bitmap, cliprect); | |
| 608 | tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0); | |
| 594 | 609 | return 0; |
| 595 | 610 | } |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "includes/deco16ic.h" | |
| 8 | #include "includes/rohga.h" | |
| 9 | #include "video/deco16ic.h" | |
| 9 | 10 | |
| 10 | static UINT16 * rohga_spriteram; | |
| 11 | 11 | |
| 12 | /******************************************************************************/ | |
| 13 | ||
| 14 | 12 | WRITE16_HANDLER( rohga_buffer_spriteram16_w ) |
| 15 | 13 | { |
| 16 | 14 | // Spriteram seems to be triple buffered (no sprite lag on real pcb, but there |
| 17 | 15 | // is on driver with only double buffering) |
| 18 | memcpy(rohga_spriteram, space->machine->generic.buffered_spriteram.u16, 0x800); | |
| 16 | rohga_state *state = (rohga_state *)space->machine->driver_data; | |
| 17 | memcpy(state->spriteram, space->machine->generic.buffered_spriteram.u16, 0x800); | |
| 19 | 18 | memcpy(space->machine->generic.buffered_spriteram.u16, space->machine->generic.spriteram.u16, 0x800); |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | static int wizdfire_bank_callback(const int bank) | |
| 23 | { | |
| 24 | return ((bank>>4)&0x3)<<12; | |
| 25 | } | |
| 26 | ||
| 27 | 21 | VIDEO_START( rohga ) |
| 28 | 22 | { |
| 29 | rohga_spriteram = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 30 | ||
| 31 | deco16_2_video_init(machine, 0); | |
| 32 | ||
| 33 | deco16_set_tilemap_bank_callback(0,wizdfire_bank_callback); | |
| 34 | deco16_set_tilemap_bank_callback(1,wizdfire_bank_callback); | |
| 35 | deco16_set_tilemap_bank_callback(2,wizdfire_bank_callback); | |
| 36 | deco16_set_tilemap_bank_callback(3,wizdfire_bank_callback); | |
| 23 | rohga_state *state = (rohga_state *)machine->driver_data; | |
| 24 | state->spriteram = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 25 | state_save_register_global_pointer(machine, state->spriteram, 0x800/2); | |
| 37 | 26 | } |
| 38 | 27 | |
| 39 | VIDEO_START( wizdfire ) | |
| 40 | { | |
| 41 | deco16_2_video_init(machine, 0); | |
| 42 | ||
| 43 | deco16_set_tilemap_bank_callback(0,wizdfire_bank_callback); | |
| 44 | deco16_set_tilemap_bank_callback(1,wizdfire_bank_callback); | |
| 45 | deco16_set_tilemap_bank_callback(2,wizdfire_bank_callback); | |
| 46 | deco16_set_tilemap_bank_callback(3,wizdfire_bank_callback); | |
| 47 | ||
| 48 | deco16_pf1_rowscroll=deco16_pf2_rowscroll=0; | |
| 49 | } | |
| 50 | ||
| 51 | VIDEO_START( nitrobal ) | |
| 52 | { | |
| 53 | deco16_2_video_init_half_width(machine); | |
| 54 | ||
| 55 | deco16_set_tilemap_bank_callback(0,wizdfire_bank_callback); | |
| 56 | deco16_set_tilemap_bank_callback(1,wizdfire_bank_callback); | |
| 57 | deco16_set_tilemap_bank_callback(2,wizdfire_bank_callback); | |
| 58 | deco16_set_tilemap_bank_callback(3,wizdfire_bank_callback); | |
| 59 | ||
| 60 | deco16_set_tilemap_colour_base(2,0); | |
| 61 | deco16_set_tilemap_colour_mask(2,0); | |
| 62 | deco16_set_tilemap_colour_base(3,0); | |
| 63 | deco16_set_tilemap_colour_mask(3,0); | |
| 64 | } | |
| 65 | ||
| 66 | 28 | /******************************************************************************/ |
| 67 | 29 | |
| 68 | static void rohga_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int is_schmeisr) | |
| 30 | static void rohga_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int is_schmeisr ) | |
| 69 | 31 | { |
| 70 | 32 | int offs; |
| 71 | 33 | |
| 72 | for (offs = 0x400-4;offs >= 0;offs -= 4) | |
| 34 | for (offs = 0x400 - 4; offs >= 0; offs -= 4) | |
| 73 | 35 | { |
| 74 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0; | |
| 75 | sprite = spriteptr[offs+1]; | |
| 76 | if (!sprite) continue; | |
| 36 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0; | |
| 37 | sprite = spriteptr[offs + 1]; | |
| 38 | if (!sprite) | |
| 39 | continue; | |
| 77 | 40 | |
| 78 | x = spriteptr[offs+2]; | |
| 41 | x = spriteptr[offs + 2]; | |
| 79 | 42 | |
| 80 | 43 | /* Sprite/playfield priority */ |
| 81 | switch (x&0x6000) { | |
| 82 | case 0x0000: pri=0; break; | |
| 83 | case 0x4000: pri=0xf0; break; | |
| 84 | case 0x6000: pri=0xf0|0xcc; break; | |
| 85 | case 0x2000: pri=0;//0xf0|0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 44 | switch (x & 0x6000) | |
| 45 | { | |
| 46 | case 0x0000: pri = 0; break; | |
| 47 | case 0x4000: pri = 0xf0; break; | |
| 48 | case 0x6000: pri = 0xf0 | 0xcc; break; | |
| 49 | case 0x2000: pri = 0;//0xf0|0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 86 | 50 | } |
| 87 | 51 | |
| 88 | 52 | y = spriteptr[offs]; |
| 89 | flash=y&0x1000; | |
| 90 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 53 | flash = y & 0x1000; | |
| 54 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 55 | continue; | |
| 91 | 56 | |
| 92 | 57 | // Sprite colour is different between Rohga (6bpp) and Schmeisr (4bpp plus wire mods on pcb) |
| 93 | 58 | if (is_schmeisr) |
| 94 | 59 | { |
| 95 | colour = ((x >> 9) &0xf)<<2; | |
| 96 | if (x&0x8000) | |
| 60 | colour = ((x >> 9) & 0xf) << 2; | |
| 61 | if (x & 0x8000) | |
| 97 | 62 | colour++; |
| 98 | 63 | } |
| 99 | 64 | else |
| 100 | 65 | { |
| 101 | colour = (x >> 9) &0xf; | |
| 66 | colour = (x >> 9) & 0xf; | |
| 102 | 67 | } |
| 103 | 68 | |
| 104 | 69 | fx = y & 0x2000; |
| r7500 | r7501 | |
| 119 | 84 | inc = 1; |
| 120 | 85 | } |
| 121 | 86 | |
| 122 | if (flip_screen_get(machine)) { | |
| 123 | x=304-x; | |
| 124 | y=240-y; | |
| 125 | if (fx) fx=0; else fx=1; | |
| 126 | if (fy) fy=0; else fy=1; | |
| 127 | mult=-16; | |
| 87 | if (flip_screen_get(machine)) | |
| 88 | { | |
| 89 | x = 304 - x; | |
| 90 | y = 240 - y; | |
| 91 | if (fx) fx = 0; else fx = 1; | |
| 92 | if (fy) fy = 0; else fy = 1; | |
| 93 | mult = -16; | |
| 128 | 94 | } |
| 129 | else mult=+16; | |
| 95 | else | |
| 96 | mult = +16; | |
| 130 | 97 | |
| 131 | 98 | while (multi >= 0) |
| 132 | 99 | { |
| r7500 | r7501 | |
| 142 | 109 | } |
| 143 | 110 | } |
| 144 | 111 | |
| 145 | static void wizdfire_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spriteptr, int mode, int bank) | |
| 112 | static void wizdfire_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spriteptr, int mode, int bank ) | |
| 146 | 113 | { |
| 147 | 114 | int offs; |
| 148 | 115 | |
| 149 | for (offs = 0;offs < 0x400;offs += 4) | |
| 116 | for (offs = 0; offs < 0x400; offs += 4) | |
| 150 | 117 | { |
| 151 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 152 | int alpha=0xff; | |
| 118 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 119 | int alpha = 0xff; | |
| 153 | 120 | |
| 154 | sprite = spriteptr[offs+1]; | |
| 155 | if (!sprite) continue; | |
| 121 | sprite = spriteptr[offs + 1]; | |
| 122 | if (!sprite) | |
| 123 | continue; | |
| 156 | 124 | |
| 157 | x = spriteptr[offs+2]; | |
| 125 | x = spriteptr[offs + 2]; | |
| 158 | 126 | |
| 159 | 127 | /* |
| 160 | 128 | Sprite/playfield priority - we can't use pdrawgfx because we need alpha'd sprites overlaid |
| r7500 | r7501 | |
| 163 | 131 | Hence, we rely on the hardware sorting everything correctly and not relying on any orthoganality |
| 164 | 132 | effects (it doesn't seem to), and instead draw seperate passes for each sprite priority. :( |
| 165 | 133 | */ |
| 166 | switch (mode) { | |
| 134 | switch (mode) | |
| 135 | { | |
| 167 | 136 | case 4: |
| 168 | if ((x&0xc000)!=0xc000) | |
| 137 | if ((x & 0xc000) != 0xc000) | |
| 169 | 138 | continue; |
| 170 | 139 | break; |
| 171 | 140 | case 3: |
| 172 | if ((x&0xc000)!=0x8000) | |
| 141 | if ((x & 0xc000) != 0x8000) | |
| 173 | 142 | continue; |
| 174 | 143 | break; |
| 175 | 144 | case 2: |
| 176 | if ((x&0x8000)!=0x8000) | |
| 145 | if ((x & 0x8000) != 0x8000) | |
| 177 | 146 | continue; |
| 178 | 147 | break; |
| 179 | 148 | case 1: |
| 180 | 149 | case 0: |
| 181 | 150 | default: |
| 182 | if ((x&0x8000)!=0) | |
| 151 | if ((x & 0x8000) != 0) | |
| 183 | 152 | continue; |
| 184 | 153 | break; |
| 185 | 154 | } |
| 186 | 155 | |
| 187 | 156 | y = spriteptr[offs]; |
| 188 | flash=y&0x1000; | |
| 189 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 190 | colour = (x >> 9) &0x1f; | |
| 157 | flash = y & 0x1000; | |
| 158 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 159 | continue; | |
| 160 | colour = (x >> 9) & 0x1f; | |
| 191 | 161 | |
| 192 | if (bank==4 && colour&0x10) { | |
| 193 | alpha=0x80; | |
| 194 | colour&=0xf; | |
| 162 | if (bank == 4 && colour & 0x10) | |
| 163 | { | |
| 164 | alpha = 0x80; | |
| 165 | colour &= 0xf; | |
| 195 | 166 | } |
| 196 | 167 | |
| 197 | 168 | fx = y & 0x2000; |
| r7500 | r7501 | |
| 212 | 183 | inc = 1; |
| 213 | 184 | } |
| 214 | 185 | |
| 215 | if (flip_screen_get(machine)) { | |
| 216 | x=304-x; | |
| 217 | y=240-y; | |
| 218 | if (fx) fx=0; else fx=1; | |
| 219 | if (fy) fy=0; else fy=1; | |
| 220 | mult=-16; | |
| 186 | if (flip_screen_get(machine)) | |
| 187 | { | |
| 188 | x = 304 - x; | |
| 189 | y = 240 - y; | |
| 190 | if (fx) fx = 0; else fx = 1; | |
| 191 | if (fy) fy = 0; else fy = 1; | |
| 192 | mult = -16; | |
| 221 | 193 | } |
| 222 | 194 | else |
| 223 | mult=+16; | |
| 195 | mult = +16; | |
| 224 | 196 | |
| 225 | if (fx) fx=0; else fx=1; | |
| 226 | if (fy) fy=0; else fy=1; | |
| 197 | if (fx) fx = 0; else fx = 1; | |
| 198 | if (fy) fy = 0; else fy = 1; | |
| 227 | 199 | |
| 228 | 200 | while (multi >= 0) |
| 229 | 201 | { |
| r7500 | r7501 | |
| 239 | 211 | } |
| 240 | 212 | } |
| 241 | 213 | |
| 242 | static void nitrobal_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank) | |
| 214 | static void nitrobal_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank ) | |
| 243 | 215 | { |
| 244 | int offs,end,inc; | |
| 216 | rohga_state *state = (rohga_state *)machine->driver_data; | |
| 217 | int offs, end, inc; | |
| 218 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 245 | 219 | |
| 246 | 220 | /* |
| 247 | 221 | Alternate format from most 16 bit games - same as Captain America and Mutant Fighter |
| r7500 | r7501 | |
| 272 | 246 | 0xffff: Sprite value |
| 273 | 247 | */ |
| 274 | 248 | |
| 275 | offs=0x3fc; | |
| 276 | end=-4; | |
| 277 | inc=-4; | |
| 249 | offs = 0x3fc; | |
| 250 | end = -4; | |
| 251 | inc = -4; | |
| 278 | 252 | |
| 279 | while (offs!=end) | |
| 253 | while (offs != end) | |
| 280 | 254 | { |
| 281 | int x,y,sprite,colour,fx,fy,w,h,sx,sy,x_mult,y_mult,tilemap_pri,sprite_pri; | |
| 282 | int alpha=0xff; | |
| 255 | int x, y, sprite, colour, fx, fy, w, h, sx, sy, x_mult, y_mult, tilemap_pri, sprite_pri; | |
| 256 | int alpha = 0xff; | |
| 283 | 257 | |
| 284 | sprite = spriteptr[offs+3]; | |
| 285 | if (!sprite) { | |
| 286 | offs+=inc; | |
| 258 | sprite = spriteptr[offs + 3]; | |
| 259 | if (!sprite) | |
| 260 | { | |
| 261 | offs += inc; | |
| 287 | 262 | continue; |
| 288 | 263 | } |
| 289 | 264 | |
| 290 | sx = spriteptr[offs+1]; | |
| 265 | sx = spriteptr[offs + 1]; | |
| 291 | 266 | |
| 292 | h = (spriteptr[offs+2]&0xf000)>>12; | |
| 293 | w = (spriteptr[offs+2]&0x0f00)>> 8; | |
| 267 | h = (spriteptr[offs + 2] & 0xf000) >> 12; | |
| 268 | w = (spriteptr[offs + 2] & 0x0f00) >> 8; | |
| 294 | 269 | |
| 295 | 270 | sy = spriteptr[offs]; |
| 296 | if ((sy&0x2000) && (video_screen_get_frame_number(machine->primary_screen) & 1)) { | |
| 297 | offs+=inc; | |
| 271 | if ((sy & 0x2000) && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 272 | { | |
| 273 | offs += inc; | |
| 298 | 274 | continue; |
| 299 | 275 | } |
| 300 | 276 | |
| 301 | colour = (spriteptr[offs+2] >>0) & 0x1f; | |
| 277 | colour = (spriteptr[offs + 2] >> 0) & 0x1f; | |
| 302 | 278 | |
| 303 | 279 | // PRIORITIES - TODO |
| 304 | if (gfxbank==3) { | |
| 280 | if (gfxbank == 3) | |
| 281 | { | |
| 305 | 282 | /* Sprite chip 1 */ |
| 306 | switch (spriteptr[offs+2]&0xe0) { | |
| 307 | // case 0xc0: colour=rand()%0xff; tilemap_pri=256; break; //todo | |
| 308 | case 0xc0: tilemap_pri=8; break; //? under other sprites | |
| 309 | case 0x80: tilemap_pri=32; break; //? under other sprites | |
| 310 | case 0x20: tilemap_pri=32; break; /* Over pf2 and under other sprite chip */ | |
| 311 | case 0x40: tilemap_pri=8; break; /* Under pf2 and under other sprite chip */ | |
| 312 | case 0xa0: tilemap_pri=32; break; | |
| 283 | switch (spriteptr[offs + 2] & 0xe0) | |
| 284 | { | |
| 285 | // case 0xc0: colour = rand()%0xff; tilemap_pri = 256; break; //todo | |
| 286 | case 0xc0: tilemap_pri = 8; break; //? under other sprites | |
| 287 | case 0x80: tilemap_pri = 32; break; //? under other sprites | |
| 288 | case 0x20: tilemap_pri = 32; break; /* Over pf2 and under other sprite chip */ | |
| 289 | case 0x40: tilemap_pri = 8; break; /* Under pf2 and under other sprite chip */ | |
| 290 | case 0xa0: tilemap_pri = 32; break; | |
| 313 | 291 | case 0: |
| 314 | tilemap_pri=128; break; | |
| 292 | tilemap_pri = 128; break; | |
| 315 | 293 | default: |
| 316 | tilemap_pri=128; | |
| 294 | tilemap_pri = 128; | |
| 317 | 295 | break; |
| 318 | 296 | } |
| 319 | 297 | |
| r7500 | r7501 | |
| 364 | 342 | |
| 365 | 343 | */ |
| 366 | 344 | |
| 367 | sprite_pri=1; | |
| 368 | } else { | |
| 345 | sprite_pri = 1; | |
| 346 | } | |
| 347 | else | |
| 348 | { | |
| 369 | 349 | /* Sprite chip 2 (with alpha blending) */ |
| 370 | 350 | |
| 371 | 351 | /* Sprite above playfield 2, but still below other sprite chip */ |
| 372 | // if (spriteptr[offs+2]&0x80) | |
| 373 | tilemap_pri=64; | |
| 352 | // if (spriteptr[offs + 2] & 0x80) | |
| 353 | tilemap_pri = 64; | |
| 374 | 354 | // else |
| 375 | // tilemap_pri=8; | |
| 355 | // tilemap_pri = 8; | |
| 376 | 356 | |
| 377 | if (deco16_priority) | |
| 378 | tilemap_pri=8; | |
| 357 | if (priority) | |
| 358 | tilemap_pri = 8; | |
| 379 | 359 | else |
| 380 | tilemap_pri=64; | |
| 360 | tilemap_pri = 64; | |
| 381 | 361 | |
| 382 | sprite_pri=2; | |
| 362 | sprite_pri = 2; | |
| 383 | 363 | } |
| 384 | 364 | |
| 385 | if (gfxbank==4 && colour&0x10) { | |
| 386 | alpha=0x80; | |
| 387 | colour&=0xf; | |
| 365 | if (gfxbank == 4 && colour & 0x10) | |
| 366 | { | |
| 367 | alpha = 0x80; | |
| 368 | colour &= 0xf; | |
| 388 | 369 | } |
| 389 | 370 | |
| 390 | fx = (spriteptr[offs+0]&0x4000); | |
| 391 | fy = (spriteptr[offs+0]&0x8000); | |
| 371 | fx = (spriteptr[offs + 0] & 0x4000); | |
| 372 | fy = (spriteptr[offs + 0] & 0x8000); | |
| 392 | 373 | |
| 393 | if (!flip_screen_get(machine)) { /* Inverted from Mutant Fighter! */ | |
| 394 | if (fx) fx=0; else fx=1; | |
| 395 | if (fy) fy=0; else fy=1; | |
| 374 | if (!flip_screen_get(machine)) | |
| 375 | { /* Inverted from Mutant Fighter! */ | |
| 376 | if (fx) fx = 0; else fx = 1; | |
| 377 | if (fy) fy = 0; else fy = 1; | |
| 396 | 378 | |
| 397 | 379 | sx = sx & 0x01ff; |
| 398 | 380 | sy = sy & 0x01ff; |
| 399 | if (sx>0x180) sx=-(0x200 - sx); | |
| 400 | if (sy>0x180) sy=-(0x200 - sy); | |
| 381 | if (sx > 0x180) sx = -(0x200 - sx); | |
| 382 | if (sy > 0x180) sy = -(0x200 - sy); | |
| 401 | 383 | |
| 402 | if (fx) { x_mult=-16; sx+=16*w; } else { x_mult=16; sx-=16; } | |
| 403 | if (fy) { y_mult=-16; sy+=16*h; } else { y_mult=16; sy-=16; } | |
| 404 | } else { | |
| 384 | if (fx) { x_mult = -16; sx += 16 * w; } else { x_mult = 16; sx -= 16; } | |
| 385 | if (fy) { y_mult = -16; sy += 16 * h; } else { y_mult = 16; sy -= 16; } | |
| 386 | } | |
| 387 | else | |
| 388 | { | |
| 405 | 389 | sx = sx & 0x01ff; |
| 406 | 390 | sy = sy & 0x01ff; |
| 407 | if (sx&0x100) sx=-(0x100 - (sx&0xff)); | |
| 408 | if (sy&0x100) sy=-(0x100 - (sy&0xff)); | |
| 391 | if (sx & 0x100) sx = -(0x100 - (sx & 0xff)); | |
| 392 | if (sy & 0x100) sy = -(0x100 - (sy & 0xff)); | |
| 409 | 393 | sx = 304 - sx; |
| 410 | 394 | sy = 240 - sy; |
| 411 | 395 | if (sx >= 432) sx -= 512; |
| 412 | 396 | if (sy >= 384) sy -= 512; |
| 413 | if (fx) { x_mult=-16; sx+=16; } else { x_mult=16; sx-=16*w; } | |
| 414 | if (fy) { y_mult=-16; sy+=16; } else { y_mult=16; sy-=16*h; } | |
| 397 | if (fx) { x_mult = -16; sx += 16; } else { x_mult = 16; sx -= 16 * w; } | |
| 398 | if (fy) { y_mult = -16; sy += 16; } else { y_mult = 16; sy -= 16 * h; } | |
| 415 | 399 | } |
| 416 | 400 | |
| 417 | for (x=0; x<w; x++) { | |
| 418 | for (y=0; y<h; y++) { | |
| 419 | deco16_pdrawgfx( | |
| 401 | for (x = 0; x < w; x++) | |
| 402 | { | |
| 403 | for (y = 0; y < h; y++) | |
| 404 | { | |
| 405 | deco16ic_pdrawgfx( | |
| 406 | state->deco16ic, | |
| 420 | 407 | bitmap,cliprect,machine->gfx[gfxbank], |
| 421 | 408 | sprite + y + h * x, |
| 422 | 409 | colour, |
| r7500 | r7501 | |
| 426 | 413 | } |
| 427 | 414 | } |
| 428 | 415 | |
| 429 | offs+=inc; | |
| 416 | offs += inc; | |
| 430 | 417 | } |
| 431 | 418 | } |
| 432 | 419 | |
| 433 | 420 | /******************************************************************************/ |
| 434 | 421 | |
| 435 | static void update_rohga(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr) | |
| 422 | static void update_rohga( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr ) | |
| 436 | 423 | { |
| 424 | rohga_state *state = (rohga_state *)screen->machine->driver_data; | |
| 425 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 426 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 427 | ||
| 437 | 428 | /* Update playfields */ |
| 438 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 439 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 440 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 429 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 430 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 431 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 441 | 432 | |
| 442 | 433 | /* Draw playfields */ |
| 443 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 444 | bitmap_fill(bitmap,cliprect,screen->machine->pens[768]); | |
| 434 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 435 | bitmap_fill(bitmap, cliprect, screen->machine->pens[768]); | |
| 445 | 436 | |
| 446 | switch ( | |
| 437 | switch ( | |
| 447 | 438 | { |
| 448 | 439 | case 0: |
| 449 | if ( | |
| 440 | if ( | |
| 450 | 441 | { |
| 451 | 442 | // Draw as 1 8BPP layer |
| 452 | deco16_tilemap_34_combine_draw(s | |
| 443 | deco16ic_tilemap_34_combine_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3); | |
| 453 | 444 | } |
| 454 | 445 | else |
| 455 | 446 | { |
| 456 | 447 | // Draw as 2 4BPP layers |
| 457 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 458 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 448 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 449 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 459 | 450 | } |
| 460 | deco16_tilemap_2_draw(s | |
| 451 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 461 | 452 | break; |
| 462 | 453 | case 1: |
| 463 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 464 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 465 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,4); | |
| 454 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 455 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 456 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 466 | 457 | break; |
| 467 | 458 | case 2: |
| 468 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 469 | deco16_tilemap_4_draw(screen,bitmap,cliprect,0,2); | |
| 470 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,4); | |
| 459 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 460 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 461 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 471 | 462 | break; |
| 472 | 463 | } |
| 473 | 464 | |
| 474 | rohga_draw_sprites(screen->machine,bitmap,cliprect,rohga_spriteram,is_schmeisr); | |
| 475 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 465 | rohga_draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, is_schmeisr); | |
| 466 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 476 | 467 | } |
| 477 | 468 | |
| 478 | 469 | VIDEO_UPDATE( rohga ) |
| r7500 | r7501 | |
| 491 | 482 | |
| 492 | 483 | VIDEO_UPDATE( wizdfire ) |
| 493 | 484 | { |
| 485 | rohga_state *state = (rohga_state *)screen->machine->driver_data; | |
| 486 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 487 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 488 | ||
| 494 | 489 | /* Update playfields */ |
| 495 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 496 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 497 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 490 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 491 | deco16ic_pf12_update(state->deco16ic, 0, 0); | |
| 492 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 498 | 493 | |
| 499 | 494 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 500 | bitmap_fill(bitmap,cliprect,screen->machine->pens[512]); | |
| 495 | bitmap_fill(bitmap, cliprect, screen->machine->pens[512]); | |
| 501 | 496 | |
| 502 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 503 | wizdfire_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,4,3); | |
| 504 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 505 | wizdfire_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,3,3); | |
| 497 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 498 | wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 4, 3); | |
| 499 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 500 | wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3, 3); | |
| 506 | 501 | |
| 507 | if ((deco16_priority&0x1f)==0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */ | |
| 508 | deco16_tilemap_3_draw(screen,bitmap,cliprect,TILEMAP_DRAW_ALPHA(0x80),0); | |
| 502 | if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */ | |
| 503 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); | |
| 509 | 504 | else |
| 510 | deco16_tilemap_3_draw(s | |
| 505 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 511 | 506 | |
| 512 | 507 | /* See notes in wizdfire_draw_sprites about this */ |
| 513 | wizdfire_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,0,3); | |
| 514 | wizdfire_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram2.u16,2,4); | |
| 515 | wizdfire_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram2.u16,1,4); | |
| 508 | wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, 3); | |
| 509 | wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 2, 4); | |
| 510 | wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 1, 4); | |
| 516 | 511 | |
| 517 | deco16_tilemap_1_draw(s | |
| 512 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 518 | 513 | return 0; |
| 519 | 514 | } |
| 520 | 515 | |
| 521 | 516 | VIDEO_UPDATE( nitrobal ) |
| 522 | 517 | { |
| 518 | rohga_state *state = (rohga_state *)screen->machine->driver_data; | |
| 519 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 520 | ||
| 523 | 521 | /* Update playfields */ |
| 524 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 525 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 526 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 522 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 523 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 524 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 527 | 525 | |
| 528 | 526 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 529 | bitmap_fill(bitmap,cliprect,screen->machine->pens[512]); | |
| 530 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 531 | deco16_clear_sprite_priority_bitmap(); | |
| 527 | bitmap_fill(bitmap, cliprect, screen->machine->pens[512]); | |
| 528 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 529 | deco16ic_clear_sprite_priority_bitmap(state->deco16ic); | |
| 532 | 530 | |
| 533 | 531 | /* pf3 and pf4 are combined into a single 8bpp bitmap */ |
| 534 | deco16_tilemap_34_combine_draw(s | |
| 532 | deco16ic_tilemap_34_combine_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 535 | 533 | |
| 536 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,16); | |
| 537 | nitrobal_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,3); | |
| 538 | nitrobal_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram2.u16,4); | |
| 534 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 16); | |
| 535 | nitrobal_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3); | |
| 536 | nitrobal_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4); | |
| 539 | 537 | |
| 540 | deco16_tilemap_1_draw(s | |
| 538 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 541 | 539 | return 0; |
| 542 | 540 | } |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #include "includes/nemesis.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | UINT16 *nemesis_videoram1; | |
| 12 | UINT16 *nemesis_videoram2; | |
| 13 | UINT16 *nemesis_colorram1; | |
| 14 | UINT16 *nemesis_colorram2; | |
| 15 | UINT16 *nemesis_characterram; | |
| 16 | size_t nemesis_characterram_size; | |
| 17 | UINT16 *nemesis_xscroll1, *nemesis_xscroll2; | |
| 18 | UINT16 *nemesis_yscroll1, *nemesis_yscroll2; | |
| 19 | ||
| 20 | static int spriteram_words; | |
| 21 | static int tilemap_flip; | |
| 22 | static int flipscreen; | |
| 23 | static UINT8 irq_port_last; | |
| 24 | ||
| 25 | static tilemap_t *background, *foreground; | |
| 26 | ||
| 27 | 11 | static const struct |
| 28 | 12 | { |
| 29 | 13 | UINT8 width; |
| r7500 | r7501 | |
| 36 | 20 | { 8, 8, 0 }, { 16, 8, 6 }, { 8, 16, 3 }, { 16, 16, 1 } |
| 37 | 21 | }; |
| 38 | 22 | |
| 39 | static UINT8 blank_tile[8*8]; | |
| 40 | 23 | |
| 41 | ||
| 42 | 24 | static TILE_GET_INFO( get_bg_tile_info ) |
| 43 | 25 | { |
| 44 | int code,color,flags,mask,layer; | |
| 26 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 27 | int code, color, flags, mask, layer; | |
| 45 | 28 | |
| 46 | code = nemesis_videoram2[tile_index]; | |
| 47 | color = nemesis_colorram2[tile_index]; | |
| 29 | code = state->videoram2[tile_index]; | |
| 30 | color = state->colorram2[tile_index]; | |
| 48 | 31 | flags = 0; |
| 49 | 32 | |
| 50 | if (color & 0x80) flags |= TILE_FLIPX; | |
| 51 | if (code & 0x0800) flags |= TILE_FLIPY; | |
| 33 | if (color & 0x80) | |
| 34 | flags |= TILE_FLIPX; | |
| 35 | ||
| 36 | if (code & 0x0800) | |
| 37 | flags |= TILE_FLIPY; | |
| 38 | ||
| 52 | 39 | if ((~code & 0x2000) || ((code & 0xc000) == 0x4000)) |
| 53 | 40 | flags |= TILE_FORCE_LAYER0; /* no transparency */ |
| 54 | if (code & 0xf800) { | |
| 41 | ||
| 42 | if (code & 0xf800) | |
| 43 | { | |
| 55 | 44 | SET_TILE_INFO( 0, code & 0x7ff, color & 0x7f, flags ); |
| 56 | } else { | |
| 45 | } | |
| 46 | else | |
| 47 | { | |
| 57 | 48 | SET_TILE_INFO( 0, 0, 0x00, 0 ); |
| 58 | tileinfo->pen_data = blank_tile; | |
| 49 | tileinfo->pen_data = state->blank_tile; | |
| 59 | 50 | } |
| 60 | 51 | |
| 61 | 52 | mask = (code & 0x1000) >> 12; |
| r7500 | r7501 | |
| 68 | 59 | |
| 69 | 60 | static TILE_GET_INFO( get_fg_tile_info ) |
| 70 | 61 | { |
| 71 | int code,color,flags,mask,layer; | |
| 62 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 63 | int code, color, flags, mask, layer; | |
| 72 | 64 | |
| 73 | code = nemesis_videoram1[tile_index]; | |
| 74 | color = nemesis_colorram1[tile_index]; | |
| 65 | code = state->videoram1[tile_index]; | |
| 66 | color = state->colorram1[tile_index]; | |
| 75 | 67 | flags = 0; |
| 76 | 68 | |
| 77 | if (color & 0x80) flags |= TILE_FLIPX; | |
| 78 | if (code & 0x0800) flags |= TILE_FLIPY; | |
| 69 | if (color & 0x80) | |
| 70 | flags |= TILE_FLIPX; | |
| 71 | ||
| 72 | if (code & 0x0800) | |
| 73 | flags |= TILE_FLIPY; | |
| 74 | ||
| 79 | 75 | if ((~code & 0x2000) || ((code & 0xc000) == 0x4000)) |
| 80 | 76 | flags |= TILE_FORCE_LAYER0; /* no transparency */ |
| 81 | if (code & 0xf800) { | |
| 77 | ||
| 78 | if (code & 0xf800) | |
| 79 | { | |
| 82 | 80 | SET_TILE_INFO( 0, code & 0x7ff, color & 0x7f, flags ); |
| 83 | } else { | |
| 81 | } | |
| 82 | else | |
| 83 | { | |
| 84 | 84 | SET_TILE_INFO( 0, 0, 0x00, 0 ); |
| 85 | tileinfo->pen_data = blank_tile; | |
| 85 | tileinfo->pen_data = state->blank_tile; | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | mask = (code & 0x1000) >> 12; |
| r7500 | r7501 | |
| 96 | 96 | |
| 97 | 97 | WRITE16_HANDLER( nemesis_gfx_flipx_word_w ) |
| 98 | 98 | { |
| 99 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 100 | ||
| 99 | 101 | if (ACCESSING_BITS_0_7) |
| 100 | 102 | { |
| 101 | flipscreen = data & 0x01; | |
| 103 | state->flipscreen = data & 0x01; | |
| 102 | 104 | |
| 103 | 105 | if (data & 0x01) |
| 104 | tilemap_flip |= TILEMAP_FLIPX; | |
| 106 | state->tilemap_flip |= TILEMAP_FLIPX; | |
| 105 | 107 | else |
| 106 | tilemap_flip &= ~TILEMAP_FLIPX; | |
| 108 | state->tilemap_flip &= ~TILEMAP_FLIPX; | |
| 107 | 109 | |
| 108 | tilemap_set_flip_all(space->machine, tilemap_flip); | |
| 110 | tilemap_set_flip_all(space->machine, state->tilemap_flip); | |
| 109 | 111 | } |
| 110 | 112 | |
| 111 | 113 | if (ACCESSING_BITS_8_15) |
| 112 | 114 | { |
| 113 | 115 | if (data & 0x0100) |
| 114 | cpu | |
| 116 | cpu | |
| 115 | 117 | } |
| 116 | 118 | } |
| 117 | 119 | |
| 118 | 120 | WRITE16_HANDLER( nemesis_gfx_flipy_word_w ) |
| 119 | 121 | { |
| 122 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 123 | ||
| 120 | 124 | if (ACCESSING_BITS_0_7) |
| 121 | 125 | { |
| 122 | 126 | if (data & 0x01) |
| 123 | tilemap_flip |= TILEMAP_FLIPY; | |
| 127 | state->tilemap_flip |= TILEMAP_FLIPY; | |
| 124 | 128 | else |
| 125 | tilemap_flip &= ~TILEMAP_FLIPY; | |
| 129 | state->tilemap_flip &= ~TILEMAP_FLIPY; | |
| 126 | 130 | |
| 127 | tilemap_set_flip_all(space->machine, tilemap_flip); | |
| 131 | tilemap_set_flip_all(space->machine, state->tilemap_flip); | |
| 128 | 132 | } |
| 129 | 133 | } |
| 130 | 134 | |
| 131 | 135 | |
| 132 | 136 | WRITE16_HANDLER( salamand_control_port_word_w ) |
| 133 | 137 | { |
| 138 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 139 | ||
| 134 | 140 | if (ACCESSING_BITS_0_7) |
| 135 | 141 | { |
| 136 | UINT8 accessing_bits = data ^ irq_port_last; | |
| 142 | UINT8 accessing_bits = data ^ state->irq_port_last; | |
| 137 | 143 | |
| 138 | nemesis_irq_on = data & 0x01; | |
| 139 | nemesis_irq2_on = data & 0x02; | |
| 140 | flipscreen = data & 0x04; | |
| 144 | state->irq_on = data & 0x01; | |
| 145 | state->irq2_on = data & 0x02; | |
| 146 | state->flipscreen = data & 0x04; | |
| 141 | 147 | |
| 142 | 148 | if (data & 0x04) |
| 143 | tilemap_flip |= TILEMAP_FLIPX; | |
| 149 | state->tilemap_flip |= TILEMAP_FLIPX; | |
| 144 | 150 | else |
| 145 | tilemap_flip &= ~TILEMAP_FLIPX; | |
| 151 | state->tilemap_flip &= ~TILEMAP_FLIPX; | |
| 146 | 152 | |
| 147 | 153 | if (data & 0x08) |
| 148 | tilemap_flip |= TILEMAP_FLIPY; | |
| 154 | state->tilemap_flip |= TILEMAP_FLIPY; | |
| 149 | 155 | else |
| 150 | tilemap_flip &= ~TILEMAP_FLIPY; | |
| 156 | state->tilemap_flip &= ~TILEMAP_FLIPY; | |
| 151 | 157 | |
| 152 | 158 | if (accessing_bits & 0x0c) |
| 153 | tilemap_set_flip_all(space->machine, tilemap_flip); | |
| 159 | tilemap_set_flip_all(space->machine, state->tilemap_flip); | |
| 154 | 160 | |
| 155 | irq_port_last = data; | |
| 161 | state->irq_port_last = data; | |
| 156 | 162 | } |
| 157 | 163 | |
| 158 | 164 | if (ACCESSING_BITS_8_15) |
| r7500 | r7501 | |
| 161 | 167 | coin_lockout_w(space->machine, 1, data & 0x0400); |
| 162 | 168 | |
| 163 | 169 | if (data & 0x0800) |
| 164 | cpu | |
| 170 | cpu | |
| 165 | 171 | |
| 166 | | |
| 172 | | |
| 167 | 173 | } |
| 168 | 174 | } |
| 169 | 175 | |
| 170 | 176 | |
| 171 | 177 | WRITE16_HANDLER( nemesis_palette_word_w ) |
| 172 | 178 | { |
| 173 | int r,g,b,bit1,bit2,bit3,bit4,bit5; | |
| 179 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 180 | int r, g, b, bit1, bit2, bit3, bit4, bit5; | |
| 174 | 181 | |
| 175 | COMBINE_DATA(space->machine->generic.paletteram.u16 + offset); | |
| 176 | data = space->machine->generic.paletteram.u16[offset]; | |
| 182 | COMBINE_DATA(state->paletteram + offset); | |
| 183 | data = state->paletteram[offset]; | |
| 177 | 184 | |
| 178 | 185 | /* Mish, 30/11/99 - Schematics show the resistor values are: |
| 179 | 186 | 300 Ohms |
| r7500 | r7501 | |
| 187 | 194 | |
| 188 | 195 | #define MULTIPLIER 8 * bit1 + 17 * bit2 + 33 * bit3 + 67 * bit4 + 130 * bit5 |
| 189 | 196 | |
| 190 | bit1=(data >> 0)&1; | |
| 191 | bit2=(data >> 1)&1; | |
| 192 | bit3=(data >> 2)&1; | |
| 193 | bit4=(data >> 3)&1; | |
| 194 | bit5=(data >> 4)&1; | |
| 197 | bit1 = BIT(data, 0); | |
| 198 | bit2 = BIT(data, 1); | |
| 199 | bit3 = BIT(data, 2); | |
| 200 | bit4 = BIT(data, 3); | |
| 201 | bit5 = BIT(data, 4); | |
| 195 | 202 | r = MULTIPLIER; |
| 196 | r = pow (r/255.0, 2)*255; | |
| 197 | bit1=(data >> 5)&1; | |
| 198 | bit2=(data >> 6)&1; | |
| 199 | bit3=(data >> 7)&1; | |
| 200 | bit4=(data >> 8)&1; | |
| 201 | bit5=(data >> 9)&1; | |
| 203 | r = pow(r/255.0, 2)*255; | |
| 204 | bit1 = BIT(data, 5); | |
| 205 | bit2 = BIT(data, 6); | |
| 206 | bit3 = BIT(data, 7); | |
| 207 | bit4 = BIT(data, 8); | |
| 208 | bit5 = BIT(data, 9); | |
| 202 | 209 | g = MULTIPLIER; |
| 203 | g = pow (g/255.0, 2)*255; | |
| 204 | bit1=(data >> 10)&1; | |
| 205 | bit2=(data >> 11)&1; | |
| 206 | bit3=(data >> 12)&1; | |
| 207 | bit4=(data >> 13)&1; | |
| 208 | bit5=(data >> 14)&1; | |
| 210 | g = pow(g/255.0, 2)*255; | |
| 211 | bit1 = BIT(data, 10); | |
| 212 | bit2 = BIT(data, 11); | |
| 213 | bit3 = BIT(data, 12); | |
| 214 | bit4 = BIT(data, 13); | |
| 215 | bit5 = BIT(data, 14); | |
| 209 | 216 | b = MULTIPLIER; |
| 210 | b = pow | |
| 217 | b = pow | |
| 211 | 218 | |
| 212 | palette_set_color(space->machine,offset,MAKE_RGB(r,g,b)); | |
| 219 | palette_set_color(space->machine, offset, MAKE_RGB(r, g, b)); | |
| 213 | 220 | } |
| 214 | 221 | |
| 215 | 222 | WRITE16_HANDLER( salamander_palette_word_w ) |
| 216 | 223 | { |
| 217 | COMBINE_DATA(space->machine->generic.paletteram.u16 + offset); | |
| 224 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 225 | ||
| 226 | COMBINE_DATA(state->paletteram + offset); | |
| 218 | 227 | offset &= ~1; |
| 219 | 228 | |
| 220 | data = ((space->machine->generic.paletteram.u16[offset] << 8) & 0xff00) | (space->machine->generic.paletteram.u16[offset+1] & 0xff); | |
| 221 | palette_set_color_rgb(space->machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10)); | |
| 229 | data = ((state->paletteram[offset] << 8) & 0xff00) | (state->paletteram[offset + 1] & 0xff); | |
| 230 | palette_set_color_rgb(space->machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10)); | |
| 222 | 231 | } |
| 223 | 232 | |
| 224 | 233 | |
| 225 | 234 | WRITE16_HANDLER( nemesis_videoram1_word_w ) |
| 226 | 235 | { |
| 227 | COMBINE_DATA(nemesis_videoram1 + offset); | |
| 228 | tilemap_mark_tile_dirty( foreground, offset ); | |
| 236 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 237 | ||
| 238 | COMBINE_DATA(state->videoram1 + offset); | |
| 239 | tilemap_mark_tile_dirty(state->foreground, offset); | |
| 229 | 240 | } |
| 230 | 241 | |
| 231 | 242 | WRITE16_HANDLER( nemesis_videoram2_word_w ) |
| 232 | 243 | { |
| 233 | COMBINE_DATA(nemesis_videoram2 + offset); | |
| 234 | tilemap_mark_tile_dirty( background, offset ); | |
| 244 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 245 | ||
| 246 | COMBINE_DATA(state->videoram2 + offset); | |
| 247 | tilemap_mark_tile_dirty(state->background, offset); | |
| 235 | 248 | } |
| 236 | 249 | |
| 237 | 250 | WRITE16_HANDLER( nemesis_colorram1_word_w ) |
| 238 | 251 | { |
| 239 | COMBINE_DATA(nemesis_colorram1 + offset); | |
| 240 | tilemap_mark_tile_dirty( foreground, offset ); | |
| 252 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 253 | ||
| 254 | COMBINE_DATA(state->colorram1 + offset); | |
| 255 | tilemap_mark_tile_dirty(state->foreground, offset); | |
| 241 | 256 | } |
| 242 | 257 | |
| 243 | 258 | WRITE16_HANDLER( nemesis_colorram2_word_w ) |
| 244 | 259 | { |
| 245 | COMBINE_DATA(nemesis_colorram2 + offset); | |
| 246 | tilemap_mark_tile_dirty( background, offset ); | |
| 260 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 261 | ||
| 262 | COMBINE_DATA(state->colorram2 + offset); | |
| 263 | tilemap_mark_tile_dirty(state->background, offset); | |
| 247 | 264 | } |
| 248 | 265 | |
| 249 | 266 | |
| 250 | 267 | /* we have to straighten out the 16-bit word into bytes for gfxdecode() to work */ |
| 251 | WRITE16_HANDLER( nemesis_char | |
| 268 | WRITE16_HANDLER( nemesis_char | |
| 252 | 269 | { |
| 253 | UINT16 oldword = nemesis_characterram[offset]; | |
| 254 | COMBINE_DATA(nemesis_characterram + offset); | |
| 255 | data = nemesis_characterram[offset]; | |
| 270 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 271 | UINT16 oldword = state->charram[offset]; | |
| 256 | 272 | |
| 273 | COMBINE_DATA(state->charram + offset); | |
| 274 | data = state->charram[offset]; | |
| 275 | ||
| 257 | 276 | if (oldword != data) |
| 258 | 277 | { |
| 259 | 278 | int i; |
| 260 | for (i=0; i<8; i++) | |
| 279 | for (i = 0; i < 8; i++) | |
| 261 | 280 | { |
| 262 | 281 | int w = sprite_data[i].width; |
| 263 | 282 | int h = sprite_data[i].height; |
| r7500 | r7501 | |
| 269 | 288 | |
| 270 | 289 | static STATE_POSTLOAD( nemesis_postload ) |
| 271 | 290 | { |
| 272 | int i,offs; | |
| 291 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 292 | int i, offs; | |
| 273 | 293 | |
| 274 | for (offs=0; offs< | |
| 294 | for (offs = 0; offs < | |
| 275 | 295 | { |
| 276 | for (i=0; i<8; i++) | |
| 296 | for (i = 0; i < 8; i++) | |
| 277 | 297 | { |
| 278 | 298 | int w = sprite_data[i].width; |
| 279 | 299 | int h = sprite_data[i].height; |
| 280 | 300 | gfx_element_mark_dirty(machine->gfx[sprite_data[i].char_type], offs * 4 / (w * h)); |
| 281 | 301 | } |
| 282 | 302 | } |
| 283 | tilemap_mark_all_tiles_dirty(background); | |
| 284 | tilemap_mark_all_tiles_dirty(foreground); | |
| 303 | tilemap_mark_all_tiles_dirty(state->background); | |
| 304 | tilemap_mark_all_tiles_dirty(state->foreground); | |
| 285 | 305 | } |
| 286 | 306 | |
| 287 | 307 | |
| 288 | 308 | /* claim a palette dirty array */ |
| 289 | 309 | VIDEO_START( nemesis ) |
| 290 | 310 | { |
| 291 | s | |
| 311 | nemes | |
| 292 | 312 | |
| 293 | background = tilemap_create(machine, | |
| 294 | get_bg_tile_info, tilemap_scan_rows, 8,8, 64,32 ); | |
| 313 | state->spriteram_words = state->spriteram_size / 2; | |
| 295 | 314 | |
| 296 | foreground = tilemap_create(machine, | |
| 297 | get_fg_tile_info, tilemap_scan_rows, 8,8, 64,32 ); | |
| 315 | state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 316 | state->foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 298 | 317 | |
| 299 | tilemap_set_transparent_pen( background, 0 ); | |
| 300 | tilemap_set_transparent_pen( foreground, 0 ); | |
| 301 | tilemap_set_scroll_rows( background, 256 ); | |
| 302 | tilemap_set_scroll_rows( foreground, 256 ); | |
| 318 | tilemap_set_transparent_pen(state->background, 0); | |
| 319 | tilemap_set_transparent_pen(state->foreground, 0); | |
| 320 | tilemap_set_scroll_rows(state->background, 256); | |
| 321 | tilemap_set_scroll_rows(state->foreground, 256); | |
| 303 | 322 | |
| 304 | memset(nemesis_characterram, 0, nemesis_characterram_size); | |
| 323 | memset(state->charram, 0, state->charram_size); | |
| 324 | memset(state->blank_tile, 0, ARRAY_LENGTH(state->blank_tile)); | |
| 305 | 325 | |
| 306 | gfx_element_set_source(machine->gfx[0], (UINT8 *)nemesis_characterram); | |
| 307 | gfx_element_set_source(machine->gfx[1], (UINT8 *)nemesis_characterram); | |
| 308 | gfx_element_set_source(machine->gfx[2], (UINT8 *)nemesis_characterram); | |
| 309 | gfx_element_set_source(machine->gfx[3], (UINT8 *)nemesis_characterram); | |
| 310 | gfx_element_set_source(machine->gfx[4], (UINT8 *)nemesis_characterram); | |
| 311 | gfx_element_set_source(machine->gfx[5], (UINT8 *)nemesis_characterram); | |
| 312 | gfx_element_set_source(machine->gfx[6], (UINT8 *)nemesis_characterram); | |
| 313 | gfx_element_set_source(machine->gfx[7], (UINT8 *)nemesis_characterram); | |
| 326 | gfx_element_set_source(machine->gfx[0], (UINT8 *)state->charram); | |
| 327 | gfx_element_set_source(machine->gfx[1], (UINT8 *)state->charram); | |
| 328 | gfx_element_set_source(machine->gfx[2], (UINT8 *)state->charram); | |
| 329 | gfx_element_set_source(machine->gfx[3], (UINT8 *)state->charram); | |
| 330 | gfx_element_set_source(machine->gfx[4], (UINT8 *)state->charram); | |
| 331 | gfx_element_set_source(machine->gfx[5], (UINT8 *)state->charram); | |
| 332 | gfx_element_set_source(machine->gfx[6], (UINT8 *)state->charram); | |
| 333 | gfx_element_set_source(machine->gfx[7], (UINT8 *)state->charram); | |
| 314 | 334 | |
| 315 | flipscreen = 0; | |
| 316 | tilemap_flip = 0; | |
| 317 | irq_port_last = 0; | |
| 318 | ||
| 319 | 335 | /* Set up save state */ |
| 320 | state_save_register_global(machine, spriteram_words); | |
| 321 | state_save_register_global(machine, tilemap_flip); | |
| 322 | state_save_register_global(machine, flipscreen); | |
| 323 | state_save_register_global(machine, irq_port_last); | |
| 324 | 336 | state_save_register_postload(machine, nemesis_postload, NULL); |
| 325 | 337 | } |
| 326 | 338 | |
| 327 | 339 | |
| 328 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 340 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 329 | 341 | { |
| 330 | 342 | /* |
| 331 | 343 | * 16 bytes per sprite, in memory from 56000-56fff |
| r7500 | r7501 | |
| 342 | 354 | * byte E : not used. |
| 343 | 355 | */ |
| 344 | 356 | |
| 345 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 357 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 358 | UINT16 *spriteram = state->spriteram; | |
| 346 | 359 | int adress; /* start of sprite in spriteram */ |
| 347 | 360 | int sx; /* sprite X-pos */ |
| 348 | 361 | int sy; /* sprite Y-pos */ |
| r7500 | r7501 | |
| 356 | 369 | int w,h; |
| 357 | 370 | int idx; |
| 358 | 371 | |
| 359 | for (priority=256-1; priority>=0; priority--) | |
| 372 | for (priority = 256 - 1; priority >= 0; priority--) | |
| 360 | 373 | { |
| 361 | for (adress = spriteram_words-8; adress >= 0; adress -= 8) | |
| 374 | for (adress = state->spriteram_words - 8; adress >= 0; adress -= 8) | |
| 362 | 375 | { |
| 363 | if((spriteram16[adress] & 0xff)!=priority) continue; | |
| 376 | if((spriteram[adress] & 0xff) != priority) | |
| 377 | continue; | |
| 364 | 378 | |
| 365 | zoom = spriteram16[adress+2] & 0xff; | |
| 366 | if (!(spriteram16[adress+2] & 0xff00) && ((spriteram16[adress+3] & 0xff00) != 0xff00)) | |
| 367 | code = spriteram16[adress+3] + ((spriteram16[adress+4] & 0xc0) << 2); | |
| 379 | zoom = spriteram[adress + 2] & 0xff; | |
| 380 | if (!(spriteram[adress + 2] & 0xff00) && ((spriteram[adress + 3] & 0xff00) != 0xff00)) | |
| 381 | code = spriteram[adress + 3] + ((spriteram[adress + 4] & 0xc0) << 2); | |
| 368 | 382 | else |
| 369 | code = (spriteram | |
| 383 | code = (spriteram | |
| 370 | 384 | |
| 371 | if (zoom != 0x | |
| 385 | if (zoom != 0xff || code != 0) | |
| 372 | 386 | { |
| 373 | size = spriteram | |
| 387 | size = spriteram | |
| 374 | 388 | zoom += (size & 0xc0) << 2; |
| 375 | 389 | |
| 376 | sx = spriteram16[adress+5] & 0xff; | |
| 377 | sy = spriteram16[adress+6] & 0xff; | |
| 378 | if (spriteram16[adress+4] & 0x01) | |
| 390 | sx = spriteram[adress + 5] & 0xff; | |
| 391 | sy = spriteram[adress + 6] & 0xff; | |
| 392 | if (spriteram[adress + 4] & 0x01) | |
| 379 | 393 | sx-=0x100; /* fixes left side clip */ |
| 380 | color = (spriteram16[adress+4] & 0x1e) >> 1; | |
| 381 | flipx = spriteram16[adress+1] & 0x01; | |
| 382 | flipy = spriteram16[adress+4] & 0x20; | |
| 383 | 394 | |
| 395 | color = (spriteram[adress + 4] & 0x1e) >> 1; | |
| 396 | flipx = spriteram[adress + 1] & 0x01; | |
| 397 | flipy = spriteram[adress + 4] & 0x20; | |
| 398 | ||
| 384 | 399 | idx = (size >> 3) & 7; |
| 385 | 400 | w = sprite_data[idx].width; |
| 386 | 401 | h = sprite_data[idx].height; |
| 387 | 402 | code = code * 8 * 16 / (w * h); |
| 388 | 403 | char_type = sprite_data[idx].char_type; |
| 389 | 404 | |
| 390 | if | |
| 405 | if | |
| 391 | 406 | { |
| 392 | zoom = ((1<<16) * 0x80 / zoom) + 0x02ab; | |
| 393 | if (flipscreen) | |
| 407 | zoom = ((1 << 16) * 0x80 / zoom) + 0x02ab; | |
| 408 | if (state->flipscreen) | |
| 394 | 409 | { |
| 395 | 410 | sx = 256 - ((zoom * w) >> 16) - sx; |
| 396 | 411 | sy = 256 - ((zoom * h) >> 16) - sy; |
| 397 | 412 | flipx = !flipx; |
| 398 | 413 | flipy = !flipy; |
| 399 | 414 | } |
| 415 | ||
| 400 | 416 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[char_type], |
| 401 | 417 | code, |
| 402 | 418 | color, |
| r7500 | r7501 | |
| 405 | 421 | zoom,zoom, |
| 406 | 422 | machine->priority_bitmap,0xffcc,0 ); |
| 407 | 423 | } |
| 408 | } /* if sprite */ | |
| 409 | } /* for loop */ | |
| 410 | } /* priority */ | |
| 424 | } | |
| 425 | } | |
| 426 | } | |
| 411 | 427 | } |
| 412 | 428 | |
| 413 | 429 | /******************************************************************************/ |
| 414 | 430 | |
| 415 | 431 | VIDEO_UPDATE( nemesis ) |
| 416 | 432 | { |
| 433 | nemesis_state *state = (nemesis_state *)screen->machine->driver_data; | |
| 417 | 434 | int offs; |
| 418 | 435 | rectangle clip; |
| 419 | 436 | |
| 420 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 421 | bitmap_fill(bitmap,cliprect,0); | |
| 437 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 438 | bitmap_fill(bitmap, cliprect, 0); | |
| 422 | 439 | |
| 423 | 440 | clip.min_x = 0; |
| 424 | 441 | clip.max_x = 255; |
| 425 | 442 | |
| 426 | tilemap_set_scroll_cols( background, 64 ); | |
| 427 | tilemap_set_scroll_cols( foreground, 64 ); | |
| 428 | tilemap_set_scroll_rows( background, 1 ); | |
| 429 | tilemap_set_scroll_rows( foreground, 1 ); | |
| 443 | tilemap_set_scroll_cols(state->background, 64); | |
| 444 | tilemap_set_scroll_cols(state->foreground, 64); | |
| 445 | tilemap_set_scroll_rows(state->background, 1); | |
| 446 | tilemap_set_scroll_rows(state->foreground, 1); | |
| 430 | 447 | |
| 431 | 448 | for (offs = 0; offs < 64; offs++) |
| 432 | 449 | { |
| 433 | 450 | int offset_x = offs; |
| 434 | 451 | |
| 435 | if (flipscreen) | |
| 452 | if (state->flipscreen) | |
| 436 | 453 | offset_x = (offs + 0x20) & 0x3f; |
| 437 | 454 | |
| 438 | tilemap_set_scrolly( background, offs, nemesis_yscroll2[offset_x] ); | |
| 439 | tilemap_set_scrolly( foreground, offs, nemesis_yscroll1[offset_x] ); | |
| 455 | tilemap_set_scrolly(state->background, offs, state->yscroll2[offset_x]); | |
| 456 | tilemap_set_scrolly(state->foreground, offs, state->yscroll1[offset_x]); | |
| 440 | 457 | } |
| 441 | 458 | |
| 442 | 459 | for (offs = cliprect->min_y; offs <= cliprect->max_y; offs++) |
| r7500 | r7501 | |
| 447 | 464 | clip.min_y = offs; |
| 448 | 465 | clip.max_y = offs; |
| 449 | 466 | |
| 450 | if (flipscreen) | |
| 467 | if (state->flipscreen) | |
| 451 | 468 | offset_y = 255 - offs; |
| 452 | 469 | |
| 453 | tilemap_set_scrollx( background, 0, (nemesis_xscroll2[offset_y] & 0xff) + ((nemesis_xscroll2[0x100 + offset_y] & 0x01) << 8) - (flipscreen ? 0x107 : 0) ); | |
| 454 | tilemap_set_scrollx( foreground, 0, (nemesis_xscroll1[offset_y] & 0xff) + ((nemesis_xscroll1[0x100 + offset_y] & 0x01) << 8) - (flipscreen ? 0x107 : 0) ); | |
| 470 | tilemap_set_scrollx(state->background, 0, (state->xscroll2[offset_y] & 0xff) + ((state->xscroll2[0x100 + offset_y] & 0x01) << 8) - (state->flipscreen ? 0x107 : 0)); | |
| 471 | tilemap_set_scrollx(state->foreground, 0, (state->xscroll1[offset_y] & 0xff) + ((state->xscroll1[0x100 + offset_y] & 0x01) << 8) - (state->flipscreen ? 0x107 : 0)); | |
| 455 | 472 | |
| 456 | for (i=0; i<4; i+=2) | |
| 473 | for (i = 0; i < 4; i += 2) | |
| 457 | 474 | { |
| 458 | tilemap_draw(bitmap, &clip, background, TILEMAP_DRAW_CATEGORY(i+0), 1); | |
| 459 | tilemap_draw(bitmap, &clip, background, TILEMAP_DRAW_CATEGORY(i+1), 2); | |
| 460 | tilemap_draw(bitmap, &clip, foreground, TILEMAP_DRAW_CATEGORY(i+0), 1); | |
| 461 | tilemap_draw(bitmap, &clip, foreground, TILEMAP_DRAW_CATEGORY(i+1), 2); | |
| 475 | tilemap_draw(bitmap, &clip, state->background, TILEMAP_DRAW_CATEGORY(i + 0), 1); | |
| 476 | tilemap_draw(bitmap, &clip, state->background, TILEMAP_DRAW_CATEGORY(i + 1), 2); | |
| 477 | tilemap_draw(bitmap, &clip, state->foreground, TILEMAP_DRAW_CATEGORY(i + 0), 1); | |
| 478 | tilemap_draw(bitmap, &clip, state->foreground, TILEMAP_DRAW_CATEGORY(i + 1), 2); | |
| 462 | 479 | } |
| 463 | 480 | } |
| 464 | 481 |
| r7500 | r7501 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | Column and rowscroll can both be applied at once. |
| 139 | 139 | |
| 140 | ||
| 141 | 2010-02: Converted to be a device. | |
| 142 | TODO: | |
| 143 | - properly support PCBs with two ICs (i.e. no pf3/pf4 because they actually belong to a 2nd chip) | |
| 144 | - move here emulation of the sprite chips (currently replicated in each driver)? | |
| 145 | ||
| 140 | 146 | ***************************************************************************/ |
| 141 | 147 | |
| 142 | 148 | #include "emu.h" |
| 143 | #include "i | |
| 149 | #include "vi | |
| 144 | 150 | #include "ui.h" |
| 145 | 151 | |
| 146 | UINT16 *deco16_pf1_data,*deco16_pf2_data; | |
| 147 | UINT16 *deco16_pf3_data,*deco16_pf4_data; | |
| 148 | UINT16 *deco16_pf1_rowscroll,*deco16_pf2_rowscroll; | |
| 149 | UINT16 *deco16_pf3_rowscroll,*deco16_pf4_rowscroll; | |
| 152 | #if 0 | |
| 153 | void deco16ic_set_vram( const device_config *device, UINT8 *ram_bank ) | |
| 154 | { | |
| 155 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 150 | 156 | |
| 151 | static const UINT16 *pf1_rowscroll_ptr, *pf2_rowscroll_ptr; | |
| 152 | static const UINT16 *pf3_rowscroll_ptr, *pf4_rowscroll_ptr; | |
| 157 | deco16ic->vram = ram_bank; | |
| 158 | } | |
| 153 | 159 | |
| 154 | UINT16 *deco16_pf12_control,*deco16_pf34_control; | |
| 155 | UINT16 deco16_priority; | |
| 160 | UINT8 *deco16icvdp_get_vram( const device_config *device ) | |
| 161 | { | |
| 162 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 156 | 163 | |
| 157 | UINT16 *deco16_raster_display_list; | |
| 158 | int deco16_raster_display_position; | |
| 164 | return deco16ic->vram; | |
| 165 | } | |
| 166 | #endif | |
| 159 | 167 | |
| 160 | static int use_custom_pf1, use_custom_pf2, use_custom_pf3, use_custom_pf4; | |
| 161 | 168 | |
| 162 | static tilemap_t *pf1_tilemap_16x16,*pf2_tilemap_16x16,*pf3_tilemap_16x16,*pf4_tilemap_16x16; | |
| 163 | static tilemap_t *pf1_tilemap_8x8,*pf2_tilemap_8x8; | |
| 169 | typedef struct _deco16ic_state deco16ic_state; | |
| 170 | struct _deco16ic_state | |
| 171 | { | |
| 172 | running_device *screen; | |
| 164 | 173 | |
| 165 | static bitmap_t *sprite_priority_bitmap; | |
| 174 | UINT16 *pf1_data, *pf2_data; | |
| 175 | UINT16 *pf3_data, *pf4_data; | |
| 176 | UINT16 *pf12_control, *pf34_control; | |
| 177 | UINT16 *raster_display_list; | |
| 178 | UINT8 *dirty_palette; | |
| 166 | 179 | |
| 167 | static UINT8 *dirty_palette; | |
| 168 | static int deco16_pf1_bank,deco16_pf2_bank,deco16_pf3_bank,deco16_pf4_bank; | |
| 169 | static int deco16_pf12_16x16_gfx_bank,deco16_pf34_16x16_gfx_bank,deco16_pf12_8x8_gfx_bank; | |
| 170 | static int deco16_pf1_colourmask,deco16_pf2_colourmask,deco16_pf3_colourmask,deco16_pf4_colourmask; | |
| 171 | int deco16_pf1_colour_bank,deco16_pf2_colour_bank,deco16_pf3_colour_bank,deco16_pf4_colour_bank; | |
| 172 | static int deco16_pf1_trans_mask,deco16_pf2_trans_mask,deco16_pf3_trans_mask,deco16_pf4_trans_mask; | |
| 173 | static int (*deco16_bank_callback_1)(const int bank); | |
| 174 | static int (*deco16_bank_callback_2)(const int bank); | |
| 175 | static int (*deco16_bank_callback_3)(const int bank); | |
| 176 | static int (*deco16_bank_callback_4)(const int bank); | |
| 177 | static void custom_tilemap_draw(running_machine *machine, | |
| 178 | bitmap_t *bitmap,tilemap_t *tilemap0_8x8,tilemap_t *tilemap0_16x16, | |
| 179 | tilemap_t *tilemap1_8x8,tilemap_t *tilemap1_16x16, const UINT16 *rowscroll_ptr,const UINT16 scrollx, | |
| 180 | const UINT16 scrolly,const UINT16 control0, const UINT16 control1,int combine_mask,int combine_shift,int trans_mask,int flags,UINT32 priority); | |
| 181 | static int pf12_last_small, pf12_last_big, pf34_last_big; | |
| 180 | const UINT16 *pf1_rowscroll_ptr, *pf2_rowscroll_ptr; | |
| 181 | const UINT16 *pf3_rowscroll_ptr, *pf4_rowscroll_ptr; | |
| 182 | 182 | |
| 183 | tilemap_t *pf1_tilemap_16x16, *pf2_tilemap_16x16, *pf3_tilemap_16x16, *pf4_tilemap_16x16 ; | |
| 184 | tilemap_t *pf1_tilemap_8x8, *pf2_tilemap_8x8; | |
| 185 | bitmap_t *sprite_priority_bitmap; | |
| 183 | 186 | |
| 184 | ||
| 187 | deco16_bank_cb bank_cb[4]; | |
| 185 | 188 | |
| 189 | UINT16 priority; | |
| 190 | ||
| 191 | int raster_display_position; | |
| 192 | ||
| 193 | int use_custom_pf1, use_custom_pf2, use_custom_pf3, use_custom_pf4; | |
| 194 | ||
| 195 | int pf1_bank, pf2_bank, pf3_bank, pf4_bank; | |
| 196 | int pf12_16x16_gfx_bank, pf34_16x16_gfx_bank, pf12_8x8_gfx_bank; | |
| 197 | int pf1_colourmask, pf2_colourmask, pf3_colourmask, pf4_colourmask; | |
| 198 | int pf1_colour_bank, pf2_colour_bank, pf3_colour_bank, pf4_colour_bank; | |
| 199 | int pf1_trans_mask, pf2_trans_mask, pf3_trans_mask, pf4_trans_mask; | |
| 200 | ||
| 201 | int pf12_last_small, pf12_last_big, pf34_last_big; | |
| 202 | }; | |
| 203 | ||
| 204 | /***************************************************************************** | |
| 205 | INLINE FUNCTIONS | |
| 206 | *****************************************************************************/ | |
| 207 | ||
| 208 | INLINE deco16ic_state *get_safe_token( running_device *device ) | |
| 209 | { | |
| 210 | assert(device != NULL); | |
| 211 | assert(device->token != NULL); | |
| 212 | assert(device->type == DECO16IC); | |
| 213 | ||
| 214 | return (deco16ic_state *)device->token; | |
| 215 | } | |
| 216 | ||
| 217 | INLINE const deco16ic_interface *get_interface( running_device *device ) | |
| 218 | { | |
| 219 | assert(device != NULL); | |
| 220 | assert((device->type == DECO16IC)); | |
| 221 | return (const deco16ic_interface *) device->baseconfig().static_config; | |
| 222 | } | |
| 223 | ||
| 224 | /***************************************************************************** | |
| 225 | DEVICE HANDLERS | |
| 226 | *****************************************************************************/ | |
| 227 | ||
| 186 | 228 | /* Later games have double buffered paletteram - the real palette ram is |
| 187 | 229 | only updated on a DMA call */ |
| 188 | 230 | |
| 189 | WRITE16_HANDLER( deco16_nonbuffered_palette_w ) | |
| 231 | WRITE16_DEVICE_HANDLER( deco16ic_nonbuffered_palette_w ) | |
| 190 | 232 | { |
| 191 | 233 | int r,g,b; |
| 192 | 234 | |
| 193 | COMBINE_DATA(& | |
| 235 | COMBINE_DATA(&device->machine->generic.paletteram.u16[offset]); | |
| 194 | 236 | if (offset&1) offset--; |
| 195 | 237 | |
| 196 | b = (space->machine->generic.paletteram.u16[offset] >> 0) & 0xff; | |
| 197 | g = (space->machine->generic.paletteram.u16[offset+1] >> 8) & 0xff; | |
| 198 | r = (space->machine->generic.paletteram.u16[offset+1] >> 0) & 0xff; | |
| 238 | b = (device->machine->generic.paletteram.u16[offset] >> 0) & 0xff; | |
| 239 | g = (device->machine->generic.paletteram.u16[offset + 1] >> 8) & 0xff; | |
| 240 | r = (device->machine->generic.paletteram.u16[offset + 1] >> 0) & 0xff; | |
| 199 | 241 | |
| 200 | palette_set_color( | |
| 242 | palette_set_color(device->machine, offset / 2, MAKE_RGB(r,g,b)); | |
| 201 | 243 | } |
| 202 | 244 | |
| 203 | WRITE16_HANDLER( deco16_buffered_palette_w ) | |
| 245 | WRITE16_DEVICE_HANDLER( deco16ic_buffered_palette_w ) | |
| 204 | 246 | { |
| 205 | COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]); | |
| 206 | dirty_palette[offset/2]=1; | |
| 247 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 248 | ||
| 249 | COMBINE_DATA(&device->machine->generic.paletteram.u16[offset]); | |
| 250 | ||
| 251 | deco16ic->dirty_palette[offset / 2] = 1; | |
| 207 | 252 | } |
| 208 | 253 | |
| 209 | WRITE16_HANDLER( deco16_palette_dma_w ) | |
| 254 | WRITE16_DEVICE_HANDLER( deco16ic_palette_dma_w ) | |
| 210 | 255 | { |
| 211 | const int m=space->machine->config->total_colors; | |
| 212 | int r,g,b,i; | |
| 256 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 257 | const int m = device->machine->config->total_colors; | |
| 258 | int r, g, b, i; | |
| 213 | 259 | |
| 214 | for (i=0; i<m; i++) { | |
| 215 | if (dirty_palette[i]) { | |
| 216 | dirty_palette[i]=0; | |
| 260 | for (i = 0; i < m; i++) | |
| 261 | { | |
| 262 | if (deco16ic->dirty_palette[i]) | |
| 263 | { | |
| 264 | deco16ic->dirty_palette[i] = 0; | |
| 217 | 265 | |
| 218 | b = (space->machine->generic.paletteram.u16[i*2] >> 0) & 0xff; | |
| 219 | g = (space->machine->generic.paletteram.u16[i*2+1] >> 8) & 0xff; | |
| 220 | r = (space->machine->generic.paletteram.u16[i*2+1] >> 0) & 0xff; | |
| 266 | b = (device->machine->generic.paletteram.u16[i * 2] >> 0) & 0xff; | |
| 267 | g = (device->machine->generic.paletteram.u16[i * 2 + 1] >> 8) & 0xff; | |
| 268 | r = (device->machine->generic.paletteram.u16[i * 2 + 1] >> 0) & 0xff; | |
| 221 | 269 | |
| 222 | palette_set_color( | |
| 270 | palette_set_color(device->machine, i, MAKE_RGB(r,g,b)); | |
| 223 | 271 | } |
| 224 | 272 | } |
| 225 | 273 | } |
| r7500 | r7501 | |
| 227 | 275 | /*****************************************************************************************/ |
| 228 | 276 | |
| 229 | 277 | /* */ |
| 230 | READ16_HANDLER( deco16_71_r ) | |
| 278 | READ16_DEVICE_HANDLER( deco16ic_71_r ) | |
| 231 | 279 | { |
| 232 | 280 | return 0xffff; |
| 233 | 281 | } |
| 234 | 282 | |
| 235 | WRITE16_HANDLER( deco16_priority_w ) | |
| 283 | WRITE16_DEVICE_HANDLER( deco16ic_priority_w ) | |
| 236 | 284 | { |
| 237 | deco16_priority=data; | |
| 285 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 286 | deco16ic->priority = data; | |
| 238 | 287 | } |
| 239 | 288 | |
| 289 | READ16_DEVICE_HANDLER( deco16ic_priority_r ) | |
| 290 | { | |
| 291 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 292 | return deco16ic->priority; | |
| 293 | } | |
| 294 | ||
| 295 | ||
| 240 | 296 | /*****************************************************************************************/ |
| 241 | 297 | |
| 242 | 298 | static TILEMAP_MAPPER( deco16_scan_rows ) |
| r7500 | r7501 | |
| 245 | 301 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6); |
| 246 | 302 | } |
| 247 | 303 | |
| 248 | static TILE_GET_INFO( get_pf4_tile_info ) | |
| 304 | static TILE_GET_INFO_DEVICE( get_pf4_tile_info ) | |
| 249 | 305 | { |
| 250 | UINT16 tile=deco16_pf4_data[tile_index]; | |
| 251 | UINT8 colour=(tile>>12)&0xf; | |
| 252 | UINT8 flags=0; | |
| 306 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 307 | UINT16 tile = deco16ic->pf4_data[tile_index]; | |
| 308 | UINT8 colour = (tile >> 12) & 0xf; | |
| 309 | UINT8 flags = 0; | |
| 253 | 310 | |
| 254 | if (tile&0x8000) { | |
| 255 | if ((deco16_pf34_control[6]>>8)&0x01) { | |
| 256 | flags|=TILE_FLIPX; | |
| 257 | colour&=0x7; | |
| 311 | if (tile & 0x8000) | |
| 312 | { | |
| 313 | if ((deco16ic->pf34_control[6] >> 8) & 0x01) | |
| 314 | { | |
| 315 | flags |= TILE_FLIPX; | |
| 316 | colour &= 0x7; | |
| 258 | 317 | } |
| 259 | if ((deco16_pf34_control[6]>>8)&0x02) { | |
| 318 | if ((deco16ic->pf34_control[6] >> 8) & 0x02) | |
| 319 | { | |
| 260 | 320 | flags|=TILE_FLIPY; |
| 261 | colour&=0x7; | |
| 321 | colour &= 0x7; | |
| 262 | 322 | } |
| 263 | 323 | } |
| 264 | 324 | |
| 265 | SET_TILE_INFO( | |
| 266 | deco16_pf34_16x16_gfx_bank, | |
| 267 | (tile&0xfff)|deco16_pf4_bank, | |
| 268 | (colour&deco16_pf4_colourmask)+deco16_pf4_colour_bank, | |
| 325 | SET_TILE_INFO_DEVICE( | |
| 326 | deco16ic->pf34_16x16_gfx_bank, | |
| 327 | (tile & 0xfff) | deco16ic->pf4_bank, | |
| 328 | (colour & deco16ic->pf4_colourmask) + deco16ic->pf4_colour_bank, | |
| 269 | 329 | flags); |
| 270 | 330 | } |
| 271 | 331 | |
| 272 | static TILE_GET_INFO( get_pf3_tile_info ) | |
| 332 | static TILE_GET_INFO_DEVICE( get_pf3_tile_info ) | |
| 273 | 333 | { |
| 274 | UINT16 tile=deco16_pf3_data[tile_index]; | |
| 275 | UINT8 colour=(tile>>12)&0xf; | |
| 276 | UINT8 flags=0; | |
| 334 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 335 | UINT16 tile = deco16ic->pf3_data[tile_index]; | |
| 336 | UINT8 colour = (tile >> 12) & 0xf; | |
| 337 | UINT8 flags = 0; | |
| 277 | 338 | |
| 278 | if (tile&0x8000) { | |
| 279 | if ((deco16_pf34_control[6]>>0)&0x01) { | |
| 280 | flags|=TILE_FLIPX; | |
| 281 | colour&=0x7; | |
| 339 | if (tile & 0x8000) | |
| 340 | { | |
| 341 | if ((deco16ic->pf34_control[6] >> 0) & 0x01) | |
| 342 | { | |
| 343 | flags |= TILE_FLIPX; | |
| 344 | colour &= 0x7; | |
| 282 | 345 | } |
| 283 | if ((deco16_pf34_control[6]>>0)&0x02) { | |
| 284 | flags|=TILE_FLIPY; | |
| 285 | colour&=0x7; | |
| 346 | if ((deco16ic->pf34_control[6] >> 0) & 0x02) | |
| 347 | { | |
| 348 | flags |= TILE_FLIPY; | |
| 349 | colour &= 0x7; | |
| 286 | 350 | } |
| 287 | 351 | } |
| 288 | 352 | |
| 289 | SET_TILE_INFO( | |
| 290 | deco16_pf34_16x16_gfx_bank, | |
| 291 | (tile&0xfff)|deco16_pf3_bank, | |
| 292 | (colour&deco16_pf3_colourmask)+deco16_pf3_colour_bank, | |
| 353 | SET_TILE_INFO_DEVICE( | |
| 354 | deco16ic->pf34_16x16_gfx_bank, | |
| 355 | (tile & 0xfff) | deco16ic->pf3_bank, | |
| 356 | (colour & deco16ic->pf3_colourmask) + deco16ic->pf3_colour_bank, | |
| 293 | 357 | flags); |
| 294 | 358 | } |
| 295 | 359 | |
| 296 | static TILE_GET_INFO( get_pf2_tile_info ) | |
| 360 | static TILE_GET_INFO_DEVICE( get_pf2_tile_info ) | |
| 297 | 361 | { |
| 298 | UINT16 tile=deco16_pf2_data[tile_index]; | |
| 299 | UINT8 colour=(tile>>12)&0xf; | |
| 300 | UINT8 flags=0; | |
| 362 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 363 | UINT16 tile = deco16ic->pf2_data[tile_index]; | |
| 364 | UINT8 colour = (tile >> 12) & 0xf; | |
| 365 | UINT8 flags = 0; | |
| 301 | 366 | |
| 302 | if (tile&0x8000) { | |
| 303 | if ((deco16_pf12_control[6]>>8)&0x01) { | |
| 304 | flags|=TILE_FLIPX; | |
| 305 | colour&=0x7; | |
| 367 | if (tile & 0x8000) | |
| 368 | { | |
| 369 | if ((deco16ic->pf12_control[6] >> 8) & 0x01) | |
| 370 | { | |
| 371 | flags |= TILE_FLIPX; | |
| 372 | colour &= 0x7; | |
| 306 | 373 | } |
| 307 | if ((deco16_pf12_control[6]>>8)&0x02) { | |
| 308 | flags|=TILE_FLIPY; | |
| 309 | colour&=0x7; | |
| 374 | if ((deco16ic->pf12_control[6] >> 8) & 0x02) | |
| 375 | { | |
| 376 | flags |= TILE_FLIPY; | |
| 377 | colour &= 0x7; | |
| 310 | 378 | } |
| 311 | 379 | } |
| 312 | 380 | |
| 313 | SET_TILE_INFO( | |
| 314 | deco16_pf12_16x16_gfx_bank, | |
| 315 | (tile&0xfff)|deco16_pf2_bank, | |
| 316 | (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank, | |
| 381 | SET_TILE_INFO_DEVICE( | |
| 382 | deco16ic->pf12_16x16_gfx_bank, | |
| 383 | (tile & 0xfff) | deco16ic->pf2_bank, | |
| 384 | (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank, | |
| 317 | 385 | flags); |
| 318 | 386 | } |
| 319 | 387 | |
| 320 | static TILE_GET_INFO( get_pf1_tile_info ) | |
| 388 | static TILE_GET_INFO_DEVICE( get_pf1_tile_info ) | |
| 321 | 389 | { |
| 322 | UINT16 tile=deco16_pf1_data[tile_index]; | |
| 323 | UINT8 colour=(tile>>12)&0xf; | |
| 324 | UINT8 flags=0; | |
| 390 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 391 | UINT16 tile = deco16ic->pf1_data[tile_index]; | |
| 392 | UINT8 colour = (tile >> 12) & 0xf; | |
| 393 | UINT8 flags = 0; | |
| 325 | 394 | |
| 326 | if (tile&0x8000) { | |
| 327 | if ((deco16_pf12_control[6]>>0)&0x01) { | |
| 328 | flags|=TILE_FLIPX; | |
| 329 | colour&=0x7; | |
| 395 | if (tile & 0x8000) | |
| 396 | { | |
| 397 | if ((deco16ic->pf12_control[6] >> 0) & 0x01) | |
| 398 | { | |
| 399 | flags |= TILE_FLIPX; | |
| 400 | colour &= 0x7; | |
| 330 | 401 | } |
| 331 | if ((deco16_pf12_control[6]>>0)&0x02) { | |
| 332 | flags|=TILE_FLIPY; | |
| 333 | colour&=0x7; | |
| 402 | if ((deco16ic->pf12_control[6] >> 0) & 0x02) | |
| 403 | { | |
| 404 | flags |= TILE_FLIPY; | |
| 405 | colour &= 0x7; | |
| 334 | 406 | } |
| 335 | 407 | } |
| 336 | 408 | |
| 337 | SET_TILE_INFO( | |
| 338 | deco16_pf12_16x16_gfx_bank, | |
| 339 | (tile&0xfff)|deco16_pf1_bank, | |
| 340 | (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank, | |
| 409 | SET_TILE_INFO_DEVICE( | |
| 410 | deco16ic->pf12_16x16_gfx_bank, | |
| 411 | (tile & 0xfff) | deco16ic->pf1_bank, | |
| 412 | (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank, | |
| 341 | 413 | flags); |
| 342 | 414 | } |
| 343 | 415 | |
| 344 | static TILE_GET_INFO( get_pf2_tile_info_b ) | |
| 416 | static TILE_GET_INFO_DEVICE( get_pf2_tile_info_b ) | |
| 345 | 417 | { |
| 346 | UINT16 tile=deco16_pf2_data[tile_index]; | |
| 347 | UINT8 colour=(tile>>12)&0xf; | |
| 348 | UINT8 flags=0; | |
| 418 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 419 | UINT16 tile = deco16ic->pf2_data[tile_index]; | |
| 420 | UINT8 colour = (tile >> 12) & 0xf; | |
| 421 | UINT8 flags = 0; | |
| 349 | 422 | |
| 350 | if (tile&0x8000) { | |
| 351 | if ((deco16_pf12_control[6]>>8)&0x01) { | |
| 352 | flags|=TILE_FLIPX; | |
| 353 | colour&=0x7; | |
| 423 | if (tile & 0x8000) | |
| 424 | { | |
| 425 | if ((deco16ic->pf12_control[6] >> 8) & 0x01) | |
| 426 | { | |
| 427 | flags |= TILE_FLIPX; | |
| 428 | colour &= 0x7; | |
| 354 | 429 | } |
| 355 | if ((deco16_pf12_control[6]>>8)&0x02) { | |
| 356 | flags|=TILE_FLIPY; | |
| 357 | colour&=0x7; | |
| 430 | if ((deco16ic->pf12_control[6] >> 8) & 0x02) | |
| 431 | { | |
| 432 | flags |= TILE_FLIPY; | |
| 433 | colour &= 0x7; | |
| 358 | 434 | } |
| 359 | 435 | } |
| 360 | 436 | |
| 361 | SET_TILE_INFO( | |
| 362 | deco16_pf12_8x8_gfx_bank, | |
| 363 | (tile&0xfff)|deco16_pf2_bank, | |
| 364 | (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank, | |
| 437 | SET_TILE_INFO_DEVICE( | |
| 438 | deco16ic->pf12_8x8_gfx_bank, | |
| 439 | (tile & 0xfff) | deco16ic->pf2_bank, | |
| 440 | (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank, | |
| 365 | 441 | flags); |
| 366 | 442 | } |
| 367 | 443 | |
| 368 | static TILE_GET_INFO( get_pf1_tile_info_b ) | |
| 444 | static TILE_GET_INFO_DEVICE( get_pf1_tile_info_b ) | |
| 369 | 445 | { |
| 370 | UINT16 tile=deco16_pf1_data[tile_index]; | |
| 371 | UINT8 colour=(tile>>12)&0xf; | |
| 372 | UINT8 flags=0; | |
| 446 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 447 | UINT16 tile = deco16ic->pf1_data[tile_index]; | |
| 448 | UINT8 colour = (tile >> 12) & 0xf; | |
| 449 | UINT8 flags = 0; | |
| 373 | 450 | |
| 374 | if (tile&0x8000) { | |
| 375 | if ((deco16_pf12_control[6]>>0)&0x01) { | |
| 376 | flags|=TILE_FLIPX; | |
| 377 | colour&=0x7; | |
| 451 | if (tile & 0x8000) | |
| 452 | { | |
| 453 | if ((deco16ic->pf12_control[6] >> 0) & 0x01) | |
| 454 | { | |
| 455 | flags |= TILE_FLIPX; | |
| 456 | colour &= 0x7; | |
| 378 | 457 | } |
| 379 | if ((deco16_pf12_control[6]>>0)&0x02) { | |
| 380 | flags|=TILE_FLIPY; | |
| 381 | colour&=0x7; | |
| 458 | if ((deco16ic->pf12_control[6] >> 0) & 0x02) | |
| 459 | { | |
| 460 | flags |= TILE_FLIPY; | |
| 461 | colour &= 0x7; | |
| 382 | 462 | } |
| 383 | 463 | } |
| 384 | 464 | |
| 385 | SET_TILE_INFO( | |
| 386 | deco16_pf12_8x8_gfx_bank, | |
| 387 | (tile&0xfff)|deco16_pf1_bank, | |
| 388 | (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank, | |
| 465 | SET_TILE_INFO_DEVICE( | |
| 466 | deco16ic->pf12_8x8_gfx_bank, | |
| 467 | (tile & 0xfff) | deco16ic->pf1_bank, | |
| 468 | (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank, | |
| 389 | 469 | flags); |
| 390 | 470 | } |
| 391 | 471 | |
| 392 | /******************************************************************************/ | |
| 472 | /*****************************************************************************************/ | |
| 393 | 473 | |
| 394 | /* Each game can have banking set up differently depending on how the roms are | |
| 395 | connected, and what rom slots are used */ | |
| 474 | /* | |
| 475 | Consider this the 'reference rasterizer' for the 56/74/141 tilemap chips - it implements | |
| 476 | simultaneous row & column scroll which the Mame tilemap core cannot do. It also | |
| 477 | implements combining the 4BPP output of two tilemaps into 8BPP output. This function | |
| 478 | is automatically called when the tilemap is in a state the cannot be properly rendered | |
| 479 | by the Mame core. | |
| 480 | */ | |
| 396 | 481 | |
| 397 | void deco16_set_tilemap_bank_callback(int tmap, int (*callback)(const int bank)) | |
| 482 | static void custom_tilemap_draw( | |
| 483 | running_device *device, | |
| 484 | bitmap_t *bitmap, | |
| 485 | tilemap_t *tilemap0_8x8, | |
| 486 | tilemap_t *tilemap0_16x16, | |
| 487 | tilemap_t *tilemap1_8x8, | |
| 488 | tilemap_t *tilemap1_16x16, | |
| 489 | const UINT16 *rowscroll_ptr, | |
| 490 | const UINT16 scrollx, | |
| 491 | const UINT16 scrolly, | |
| 492 | const UINT16 control0, | |
| 493 | const UINT16 control1, | |
| 494 | int combine_mask, | |
| 495 | int combine_shift, | |
| 496 | int trans_mask, | |
| 497 | int flags, | |
| 498 | UINT32 priority) | |
| 398 | 499 | { |
| 399 | switch (tmap) { | |
| 400 | case 0: deco16_bank_callback_1=callback; break; | |
| 401 | case 1: deco16_bank_callback_2=callback; break; | |
| 402 | case 2: deco16_bank_callback_3=callback; break; | |
| 403 | case 3: deco16_bank_callback_4=callback; break; | |
| 500 | running_machine *machine = device->machine; | |
| 501 | tilemap_t *tilemap0 = BIT(control1, 7) ? tilemap0_8x8 : tilemap0_16x16; | |
| 502 | tilemap_t *tilemap1 = BIT(control1, 7) ? tilemap1_8x8 : tilemap1_16x16; | |
| 503 | const bitmap_t *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL; | |
| 504 | const bitmap_t *src_bitmap1 = tilemap1 ? tilemap_get_pixmap(tilemap1) : NULL; | |
| 505 | int width_mask, height_mask, x, y, p; | |
| 506 | int column_offset, src_x = 0, src_y = 0; | |
| 507 | int row_type = 1 << ((control0 >> 3) & 0xf); | |
| 508 | int col_type = 8 << (control0 & 7); | |
| 509 | ||
| 510 | if (!src_bitmap0) | |
| 511 | return; | |
| 512 | ||
| 513 | // Playfield disable | |
| 514 | if (!BIT(control0, 7)) | |
| 515 | return; | |
| 516 | ||
| 517 | width_mask = src_bitmap0->width - 1; | |
| 518 | height_mask = src_bitmap0->height - 1; | |
| 519 | src_y = scrolly + 8; | |
| 520 | ||
| 521 | for (y = 8; y < 248; y++) | |
| 522 | { | |
| 523 | if (rowscroll_ptr && BIT(control1, 6)) | |
| 524 | src_x = scrollx + rowscroll_ptr[src_y / row_type]; | |
| 525 | else | |
| 526 | src_x = scrollx; | |
| 527 | ||
| 528 | src_x &= width_mask; | |
| 529 | ||
| 530 | if (bitmap->bpp == 16) | |
| 531 | { | |
| 532 | for (x = 0; x < 320; x++) | |
| 533 | { | |
| 534 | if (rowscroll_ptr && BIT(control1, 5)) | |
| 535 | column_offset = rowscroll_ptr[0x200 + ((src_x & 0x1ff) / col_type)]; | |
| 536 | else | |
| 537 | column_offset = 0; | |
| 538 | ||
| 539 | p = *BITMAP_ADDR16(src_bitmap0, (src_y + column_offset) & height_mask, src_x); | |
| 540 | ||
| 541 | if (src_bitmap1) | |
| 542 | p |= (*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset) & height_mask, src_x) & combine_mask) << combine_shift; | |
| 543 | ||
| 544 | src_x = (src_x + 1) & width_mask; | |
| 545 | ||
| 546 | if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask)) | |
| 547 | { | |
| 548 | *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p]; | |
| 549 | if (machine->priority_bitmap) | |
| 550 | { | |
| 551 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); | |
| 552 | pri[x] |= priority; | |
| 553 | } | |
| 554 | } | |
| 555 | } | |
| 556 | } | |
| 557 | else | |
| 558 | { | |
| 559 | /* boogwing */ | |
| 560 | for (x = 0; x < 320; x++) | |
| 561 | { | |
| 562 | if (rowscroll_ptr && BIT(control1, 5)) | |
| 563 | column_offset = rowscroll_ptr[0x200 + ((src_x & 0x1ff) / col_type)]; | |
| 564 | else | |
| 565 | column_offset = 0; | |
| 566 | ||
| 567 | p = *BITMAP_ADDR16(src_bitmap0, (src_y + column_offset) & height_mask, src_x); | |
| 568 | ||
| 569 | if (src_bitmap1) | |
| 570 | p |= (*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset) & height_mask, src_x) & combine_mask) << combine_shift; | |
| 571 | ||
| 572 | src_x = (src_x + 1) & width_mask; | |
| 573 | ||
| 574 | if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask)) | |
| 575 | { | |
| 576 | *BITMAP_ADDR32(bitmap, y, x) = machine->pens[p]; | |
| 577 | if (machine->priority_bitmap) | |
| 578 | { | |
| 579 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); | |
| 580 | pri[x] |= priority; | |
| 581 | } | |
| 582 | } | |
| 583 | } | |
| 584 | } | |
| 585 | src_y = (src_y + 1) & height_mask; | |
| 404 | 586 | } |
| 405 | 587 | } |
| 406 | 588 | |
| 407 | /* Each game can have colours set up differently depending on how the playfield | |
| 408 | generator is connected to paletteram */ | |
| 589 | /******************************************************************************/ | |
| 409 | 590 | |
| 410 | void deco16_set_tilemap_colour_base(int tmap, int base) | |
| 591 | /* robocop 2 can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */ | |
| 592 | void deco16ic_set_tilemap_colour_mask( running_device *device, int tmap, int mask ) | |
| 411 | 593 | { |
| 412 | switch (tmap) { | |
| 413 | case 0: deco16_pf1_colour_bank=base; break; | |
| 414 | case 1: deco16_pf2_colour_bank=base; break; | |
| 415 | case 2: deco16_pf3_colour_bank=base; break; | |
| 416 | case 3: deco16_pf4_colour_bank=base; break; | |
| 594 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 595 | ||
| 596 | switch (tmap) | |
| 597 | { | |
| 598 | case 0: deco16ic->pf1_colourmask = mask; break; | |
| 599 | case 1: deco16ic->pf2_colourmask = mask; break; | |
| 600 | case 2: deco16ic->pf3_colourmask = mask; break; | |
| 601 | case 3: deco16ic->pf4_colourmask = mask; break; | |
| 417 | 602 | } |
| 418 | 603 | } |
| 419 | 604 | |
| 420 | void deco16_set_ | |
| 605 | void deco16ic_pf34_set_gfxb | |
| 421 | 606 | { |
| 422 | switch (tmap) { | |
| 423 | case 0: deco16_pf1_colourmask=mask; break; | |
| 424 | case 1: deco16_pf2_colourmask=mask; break; | |
| 425 | case 2: deco16_pf3_colourmask=mask; break; | |
| 426 | case 3: deco16_pf4_colourmask=mask; break; | |
| 607 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 608 | ||
| 609 | if (deco16ic->pf34_last_big != big) | |
| 610 | { | |
| 611 | if (deco16ic->pf3_tilemap_16x16) | |
| 612 | tilemap_mark_all_tiles_dirty(deco16ic->pf3_tilemap_16x16); | |
| 613 | if (deco16ic->pf4_tilemap_16x16) | |
| 614 | tilemap_mark_all_tiles_dirty(deco16ic->pf4_tilemap_16x16); | |
| 615 | ||
| 616 | deco16ic->pf34_last_big = big; | |
| 427 | 617 | } |
| 618 | deco16ic->pf34_16x16_gfx_bank = big; | |
| 428 | 619 | } |
| 429 | 620 | |
| 430 | void deco16_set_tilemap_transparency_mask(int tmap, int mask) | |
| 621 | /* stoneage has broken scroll registers */ | |
| 622 | void deco16ic_set_scrolldx( running_device *device, int tmap, int size, int dx, int dx_if_flipped ) | |
| 431 | 623 | { |
| 432 | switch (tmap) { | |
| 433 | case 0: deco16_pf1_trans_mask=mask; break; | |
| 434 | case 1: deco16_pf2_trans_mask=mask; break; | |
| 435 | case 2: deco16_pf3_trans_mask=mask; break; | |
| 436 | case 3: deco16_pf4_trans_mask=mask; break; | |
| 624 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 625 | ||
| 626 | switch (tmap) | |
| 627 | { | |
| 628 | case 0: | |
| 629 | if (!size) | |
| 630 | tilemap_set_scrolldx(deco16ic->pf1_tilemap_16x16, dx, dx_if_flipped); | |
| 631 | else | |
| 632 | tilemap_set_scrolldx(deco16ic->pf1_tilemap_8x8, dx, dx_if_flipped); | |
| 633 | break; | |
| 634 | case 1: | |
| 635 | if (!size) | |
| 636 | tilemap_set_scrolldx(deco16ic->pf2_tilemap_16x16, dx, dx_if_flipped); | |
| 637 | else | |
| 638 | tilemap_set_scrolldx(deco16ic->pf2_tilemap_8x8, dx, dx_if_flipped); | |
| 639 | break; | |
| 640 | case 2: | |
| 641 | if (!size) | |
| 642 | tilemap_set_scrolldx(deco16ic->pf3_tilemap_16x16, dx, dx_if_flipped); | |
| 643 | break; | |
| 644 | case 3: | |
| 645 | if (!size) | |
| 646 | tilemap_set_scrolldx(deco16ic->pf4_tilemap_16x16, dx, dx_if_flipped); | |
| 647 | break; | |
| 437 | 648 | } |
| 438 | 649 | } |
| 439 | 650 | |
| 440 | void deco16_pf12_set_gfxbank(int small, int big) | |
| 651 | /******************************************************************************/ | |
| 652 | ||
| 653 | WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w ) | |
| 441 | 654 | { |
| 442 | if (pf12_last_small!=small) { | |
| 443 | if (pf1_tilemap_8x8) | |
| 444 | tilemap_mark_all_tiles_dirty(pf1_tilemap_8x8); | |
| 445 | if (pf2_tilemap_8x8) | |
| 446 | tilemap_mark_all_tiles_dirty(pf2_tilemap_8x8); | |
| 447 | pf12_last_small=small; | |
| 448 | } | |
| 449 | deco16_pf12_8x8_gfx_bank=small; | |
| 655 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 450 | 656 | |
| 451 | if (pf12_last_big!=big) { | |
| 452 | if (pf1_tilemap_16x16) | |
| 453 | tilemap_mark_all_tiles_dirty(pf1_tilemap_16x16); | |
| 454 | if (pf2_tilemap_16x16) | |
| 455 | tilemap_mark_all_tiles_dirty(pf2_tilemap_16x16); | |
| 456 | pf12_last_big=big; | |
| 457 | } | |
| 458 | deco16_pf12_16x16_gfx_bank=big; | |
| 657 | COMBINE_DATA(&deco16ic->pf1_data[offset]); | |
| 459 | 658 | |
| 659 | tilemap_mark_tile_dirty(deco16ic->pf1_tilemap_8x8, offset); | |
| 660 | if (offset < 0x800) | |
| 661 | tilemap_mark_tile_dirty(deco16ic->pf1_tilemap_16x16, offset); | |
| 460 | 662 | } |
| 461 | 663 | |
| 462 | ||
| 664 | WRITE16_DEVICE_HANDLER( deco16ic_pf2 | |
| 463 | 665 | { |
| 464 | if (pf34_last_big!=big) { | |
| 465 | if (pf3_tilemap_16x16) | |
| 466 | tilemap_mark_all_tiles_dirty(pf3_tilemap_16x16); | |
| 467 | if (pf4_tilemap_16x16) | |
| 468 | tilemap_mark_all_tiles_dirty(pf4_tilemap_16x16); | |
| 469 | pf34_last_big=big; | |
| 470 | } | |
| 471 | deco16_pf34_16x16_gfx_bank=big; | |
| 666 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 667 | ||
| 668 | COMBINE_DATA(&deco16ic->pf2_data[offset]); | |
| 669 | ||
| 670 | tilemap_mark_tile_dirty(deco16ic->pf2_tilemap_8x8, offset); | |
| 671 | if (offset < 0x800) | |
| 672 | tilemap_mark_tile_dirty(deco16ic->pf2_tilemap_16x16, offset); | |
| 472 | 673 | } |
| 473 | 674 | |
| 474 | ||
| 675 | WRITE16_DEVICE_HANDLER( | |
| 475 | 676 | { |
| 476 | switch (pf) { | |
| 477 | case 0: if (size) return pf1_tilemap_8x8; return pf1_tilemap_16x16; | |
| 478 | case 1: if (size) return pf2_tilemap_8x8; return pf2_tilemap_16x16; | |
| 479 | case 2: if (size) return 0; return pf3_tilemap_16x16; | |
| 480 | case 3: if (size) return 0; return pf4_tilemap_16x16; | |
| 481 | } | |
| 482 | return 0; | |
| 677 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 678 | ||
| 679 | COMBINE_DATA(&deco16ic->pf3_data[offset]); | |
| 680 | tilemap_mark_tile_dirty(deco16ic->pf3_tilemap_16x16, offset); | |
| 483 | 681 | } |
| 484 | 682 | |
| 485 | /******************************************************************************/ | |
| 683 | WRITE16_DEVICE_HANDLER( deco16ic_pf4_data_w ) | |
| 684 | { | |
| 685 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 486 | 686 | |
| 487 | WRITE16_HANDLER( deco16_pf1_data_w ) | |
| 687 | COMBINE_DATA(&deco16ic->pf4_data[offset]); | |
| 688 | tilemap_mark_tile_dirty(deco16ic->pf4_tilemap_16x16, offset); | |
| 689 | } | |
| 690 | ||
| 691 | READ16_DEVICE_HANDLER( deco16ic_pf1_data_r ) | |
| 488 | 692 | { |
| 489 | COMBINE_DATA(&deco16_pf1_data[offset]); | |
| 490 | tilemap_mark_tile_dirty(pf1_tilemap_8x8,offset); | |
| 491 | if (offset<0x800) | |
| 492 | tilemap_mark_tile_dirty(pf1_tilemap_16x16,offset); | |
| 693 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 694 | return deco16ic->pf1_data[offset]; | |
| 493 | 695 | } |
| 494 | 696 | |
| 495 | ||
| 697 | ||
| 496 | 698 | { |
| 497 | COMBINE_DATA(&deco16_pf2_data[offset]); | |
| 498 | tilemap_mark_tile_dirty(pf2_tilemap_8x8,offset); | |
| 499 | if (offset<0x800) | |
| 500 | tilemap_mark_tile_dirty(pf2_tilemap_16x16,offset); | |
| 699 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 700 | return deco16ic->pf2_data[offset]; | |
| 501 | 701 | } |
| 502 | 702 | |
| 503 | ||
| 703 | ||
| 504 | 704 | { |
| 505 | COMBINE_DATA(&deco16_pf3_data[offset]); | |
| 506 | tilemap_mark_tile_dirty(pf3_tilemap_16x16,offset); | |
| 705 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 706 | return deco16ic->pf3_data[offset]; | |
| 507 | 707 | } |
| 508 | 708 | |
| 509 | ||
| 709 | ||
| 510 | 710 | { |
| 511 | COMBINE_DATA(&deco16_pf4_data[offset]); | |
| 512 | tilemap_mark_tile_dirty(pf4_tilemap_16x16,offset); | |
| 711 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 712 | return deco16ic->pf4_data[offset]; | |
| 513 | 713 | } |
| 514 | 714 | |
| 515 | /*****************************************************************************************/ | |
| 516 | 715 | |
| 517 | ||
| 716 | WRITE16_DEVICE_HANDLER( | |
| 518 | 717 | { |
| 519 | int width = video_screen_get_width(machine->primary_screen); | |
| 520 | int height = video_screen_get_height(machine->primary_screen); | |
| 521 | sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED8 ); | |
| 718 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 719 | COMBINE_DATA(&deco16ic->pf12_control[offset]); | |
| 720 | } | |
| 522 | 721 | |
| 523 | pf1_tilemap_16x16 = tilemap_create(machine, get_pf1_tile_info, deco16_scan_rows, 16,16,64,32); | |
| 524 | pf1_tilemap_8x8 = tilemap_create(machine, get_pf1_tile_info_b, tilemap_scan_rows,8,8,64,32); | |
| 722 | WRITE16_DEVICE_HANDLER( deco16ic_pf34_control_w ) | |
| 723 | { | |
| 724 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 725 | COMBINE_DATA(&deco16ic->pf34_control[offset]); | |
| 726 | } | |
| 525 | 727 | |
| 526 | if (split) | |
| 527 | pf2_tilemap_16x16 = tilemap_create(machine, get_pf2_tile_info, deco16_scan_rows, 16,16,full_width ? 64 : 32,32); | |
| 528 | else | |
| 529 | pf2_tilemap_16x16 = tilemap_create(machine, get_pf2_tile_info, deco16_scan_rows, 16,16,full_width ? 64 : 32,32); | |
| 530 | pf2_tilemap_8x8 = tilemap_create(machine, get_pf2_tile_info_b, tilemap_scan_rows,8,8,full_width ? 64 : 32,32); | |
| 728 | READ16_DEVICE_HANDLER( deco16ic_pf12_control_r ) | |
| 729 | { | |
| 730 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 731 | return deco16ic->pf12_control[offset]; | |
| 732 | } | |
| 531 | 733 | |
| 532 | dirty_palette = auto_alloc_array(machine, UINT8, 4096); | |
| 533 | deco16_raster_display_list=auto_alloc_array(machine, UINT16, 20 * 256 / 2); | |
| 734 | READ16_DEVICE_HANDLER( deco16ic_pf34_control_r ) | |
| 735 | { | |
| 736 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 737 | return deco16ic->pf34_control[offset]; | |
| 738 | } | |
| 534 | 739 | |
| 535 | if (!pf12_only) | |
| 536 | { | |
| 537 | pf4_tilemap_16x16 = tilemap_create(machine, get_pf4_tile_info, deco16_scan_rows, 16,16,full_width ? 64 : 32,32); | |
| 538 | pf3_tilemap_16x16 = tilemap_create(machine, get_pf3_tile_info, deco16_scan_rows, 16,16,full_width ? 64 : 32,32); | |
| 539 | } | |
| 540 | else | |
| 541 | { | |
| 542 | pf3_tilemap_16x16=0; | |
| 543 | pf4_tilemap_16x16=0; | |
| 544 | } | |
| 545 | 740 | |
| 546 | tilemap_set_transparent_pen(pf1_tilemap_8x8,0); | |
| 547 | tilemap_set_transparent_pen(pf2_tilemap_8x8,0); | |
| 548 | tilemap_set_transparent_pen(pf1_tilemap_16x16,0); | |
| 549 | tilemap_set_transparent_pen(pf2_tilemap_16x16,0); | |
| 550 | if (split) /* Caveman Ninja only */ | |
| 551 | tilemap_set_transmask(pf2_tilemap_16x16,0,0x00ff,0xff01); | |
| 741 | READ32_DEVICE_HANDLER ( deco16ic_pf12_control_dword_r ) | |
| 742 | { | |
| 743 | return deco16ic_pf12_control_r(device, offset, 0xffff)^0xffff0000; | |
| 744 | } | |
| 552 | 745 | |
| 553 | if (!pf12_only) | |
| 554 | { | |
| 555 | tilemap_set_transparent_pen(pf3_tilemap_16x16,0); | |
| 556 | tilemap_set_transparent_pen(pf4_tilemap_16x16,0); | |
| 557 | } | |
| 746 | WRITE32_DEVICE_HANDLER( deco16ic_pf12_control_dword_w ) | |
| 747 | { | |
| 748 | deco16ic_pf12_control_w(device, offset, data & 0xffff, mem_mask & 0xffff); | |
| 749 | } | |
| 558 | 750 | |
| 751 | READ32_DEVICE_HANDLER ( deco16ic_pf34_control_dword_r ) | |
| 752 | { | |
| 753 | return deco16ic_pf34_control_r(device, offset, 0xffff)^0xffff0000; | |
| 754 | } | |
| 559 | 755 | |
| 560 | deco16_bank_callback_1=0; | |
| 561 | deco16_bank_callback_2=0; | |
| 562 | deco16_bank_callback_3=0; | |
| 563 | deco16_bank_callback_4=0; | |
| 756 | WRITE32_DEVICE_HANDLER( deco16ic_pf34_control_dword_w ) | |
| 757 | { | |
| 758 | deco16ic_pf34_control_w(device, offset, data & 0xffff, mem_mask & 0xffff); | |
| 759 | } | |
| 564 | 760 | |
| 565 | deco16_pf1_trans_mask=0xf; | |
| 566 | deco16_pf2_trans_mask=0xf; | |
| 567 | deco16_pf3_trans_mask=0xf; | |
| 568 | deco16_pf4_trans_mask=0xf; | |
| 569 | 761 | |
| 570 | deco16_pf1_colourmask=deco16_pf2_colourmask=0xf; | |
| 571 | deco16_pf3_colourmask=deco16_pf4_colourmask=0xf; | |
| 572 | deco16_pf1_bank=deco16_pf2_bank=deco16_pf3_bank=deco16_pf4_bank=0; | |
| 573 | deco16_pf4_colour_bank=deco16_pf2_colour_bank=16; | |
| 574 | deco16_pf3_colour_bank=deco16_pf1_colour_bank=0; | |
| 762 | READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r ) | |
| 763 | { | |
| 764 | return deco16ic_pf1_data_r(device, offset, 0xffff)^0xffff0000; | |
| 765 | } | |
| 575 | 766 | |
| 576 | deco16_pf12_8x8_gfx_bank=0; | |
| 577 | deco16_pf12_16x16_gfx_bank=1; | |
| 578 | deco16_pf34_16x16_gfx_bank=2; | |
| 767 | WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w ) | |
| 768 | { | |
| 769 | deco16ic_pf1_data_w(device, offset, data & 0xffff, mem_mask & 0xffff); | |
| 770 | } | |
| 579 | 771 | |
| 580 | deco16_raster_display_position=0; | |
| 772 | READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r ) | |
| 773 | { | |
| 774 | return deco16ic_pf2_data_r(device, offset, 0xffff)^0xffff0000; | |
| 775 | } | |
| 581 | 776 | |
| 582 | pf12_last_small = pf12_last_big = pf34_last_big = -1; | |
| 777 | WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w ) | |
| 778 | { | |
| 779 | deco16ic_pf2_data_w(device, offset, data & 0xffff, mem_mask & 0xffff); | |
| 583 | 780 | } |
| 584 | 781 | |
| 585 | ||
| 782 | READ32_DEVICE_HANDLER( deco16 | |
| 586 | 783 | { |
| 587 | deco16 | |
| 784 | return deco16 | |
| 588 | 785 | } |
| 589 | 786 | |
| 590 | ||
| 787 | WRITE32_DEVICE_HANDLER( deco16 | |
| 591 | 788 | { |
| 592 | deco16 | |
| 789 | deco16 | |
| 593 | 790 | } |
| 594 | 791 | |
| 595 | ||
| 792 | READ32_DEVICE_HANDLER( deco16 | |
| 596 | 793 | { |
| 597 | deco16 | |
| 794 | return deco16 | |
| 598 | 795 | } |
| 599 | 796 | |
| 797 | WRITE32_DEVICE_HANDLER( deco16ic_pf4_data_dword_w ) | |
| 798 | { | |
| 799 | deco16ic_pf4_data_w(device, offset, data & 0xffff, mem_mask & 0xffff); | |
| 800 | } | |
| 801 | ||
| 802 | ||
| 803 | ||
| 804 | #if 0 | |
| 600 | 805 | void deco_allocate_sprite_bitmap(running_machine *machine) |
| 601 | 806 | { |
| 602 | 807 | /* Allow sprite bitmap to be used by Deco32 games as well */ |
| r7500 | r7501 | |
| 605 | 810 | sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 ); |
| 606 | 811 | } |
| 607 | 812 | |
| 813 | #endif | |
| 814 | ||
| 608 | 815 | /*****************************************************************************************/ |
| 609 | 816 | |
| 610 | 817 | static int deco16_pf_update( |
| r7500 | r7501 | |
| 616 | 823 | const UINT16 control0, |
| 617 | 824 | const UINT16 control1) |
| 618 | 825 | { |
| 619 | int rows, cols, offs, use_custom=0; | |
| 826 | int rows, cols, offs, use_custom = 0; | |
| 620 | 827 | |
| 621 | 828 | /* Toggle between 8x8 and 16x16 modes (and master enable bit) */ |
| 622 | if (control1&0x80) { | |
| 623 | if (!tilemap_8x8) popmessage("Deco16: Playfield switched into 8x8 mode but no tilemap defined"); | |
| 829 | if (BIT(control1, 7)) | |
| 830 | { | |
| 831 | if (!tilemap_8x8) | |
| 832 | popmessage("Deco16: Playfield switched into 8x8 mode but no tilemap defined"); | |
| 624 | 833 | |
| 625 | if (tilemap_8x8) tilemap_set_enable(tilemap_8x8,control0&0x80); | |
| 626 | if (tilemap_16x16) tilemap_set_enable(tilemap_16x16,0); | |
| 627 | } else { | |
| 628 | if (!tilemap_16x16) popmessage("Deco16: Playfield switched into 16x16 mode but no tilemap defined"); | |
| 834 | if (tilemap_8x8) | |
| 835 | tilemap_set_enable(tilemap_8x8, BIT(control0, 7)); | |
| 629 | 836 | |
| 630 | if (tilemap_8x8) tilemap_set_enable(tilemap_8x8,0); | |
| 631 | if (tilemap_16x16) tilemap_set_enable(tilemap_16x16,control0&0x80); | |
| 837 | if (tilemap_16x16) | |
| 838 | tilemap_set_enable(tilemap_16x16, 0); | |
| 839 | ||
| 632 | 840 | } |
| 841 | else | |
| 842 | { | |
| 843 | if (!tilemap_16x16) | |
| 844 | popmessage("Deco16: Playfield switched into 16x16 mode but no tilemap defined"); | |
| 633 | 845 | |
| 846 | if (tilemap_8x8) | |
| 847 | tilemap_set_enable(tilemap_8x8, 0); | |
| 848 | ||
| 849 | if (tilemap_16x16) | |
| 850 | tilemap_set_enable(tilemap_16x16, BIT(control0, 7)); | |
| 851 | } | |
| 852 | ||
| 634 | 853 | /* Rowscroll enable */ |
| 635 | if (rowscroll_ptr && (control1&0x60)==0x40) { | |
| 854 | if (rowscroll_ptr && (control1 & 0x60) == 0x40) | |
| 855 | { | |
| 636 | 856 | |
| 637 | 857 | /* Several different rowscroll styles */ |
| 638 | switch ((control0>>3)&0xf) { | |
| 639 | case 0: rows=512; break;/* Every line of 512 height bitmap */ | |
| 640 | case 1: rows=256; break; | |
| 641 | case 2: rows=128; break; | |
| 642 | case 3: rows=64; break; | |
| 643 | case 4: rows=32; break; | |
| 644 | case 5: rows=16; break; | |
| 645 | case 6: rows=8; break; | |
| 646 | case 7: rows=4; break; | |
| 647 | case 8: rows=2; break; | |
| 648 | default: rows=1; break; | |
| 858 | switch ((control0 >> 3) & 0xf) | |
| 859 | { | |
| 860 | case 0: rows = 512; break;/* Every line of 512 height bitmap */ | |
| 861 | case 1: rows = 256; break; | |
| 862 | case 2: rows = 128; break; | |
| 863 | case 3: rows = 64; break; | |
| 864 | case 4: rows = 32; break; | |
| 865 | case 5: rows = 16; break; | |
| 866 | case 6: rows = 8; break; | |
| 867 | case 7: rows = 4; break; | |
| 868 | case 8: rows = 2; break; | |
| 869 | default: rows = 1; break; | |
| 649 | 870 | } |
| 650 | 871 | |
| 651 | if (tilemap_16x16) { | |
| 652 | tilemap_set_scroll_cols(tilemap_16x16,1); | |
| 653 | tilemap_set_scroll_rows(tilemap_16x16,rows); | |
| 654 | tilemap_set_scrolly(tilemap_16x16,0,scrolly); | |
| 872 | if (tilemap_16x16) | |
| 873 | { | |
| 874 | tilemap_set_scroll_cols(tilemap_16x16, 1); | |
| 875 | tilemap_set_scroll_rows(tilemap_16x16, rows); | |
| 876 | tilemap_set_scrolly(tilemap_16x16, 0, scrolly); | |
| 655 | 877 | |
| 656 | for (offs = 0;offs < rows;offs++) | |
| 657 | tilemap_set_scrollx( tilemap_16x16, offs, scrollx + rowscroll_ptr[offs] ); | |
| 878 | for (offs = 0; offs < rows; offs++) | |
| 879 | tilemap_set_scrollx(tilemap_16x16, offs, scrollx + rowscroll_ptr[offs]); | |
| 658 | 880 | } |
| 659 | 881 | |
| 660 | if (tilemap_8x8) { | |
| 661 | tilemap_set_scroll_cols(tilemap_8x8,1); | |
| 662 | tilemap_set_scroll_rows(tilemap_8x8,rows/2); | |
| 663 | tilemap_set_scrolly(tilemap_8x8,0,scrolly); | |
| 882 | if (tilemap_8x8) | |
| 883 | { | |
| 884 | tilemap_set_scroll_cols(tilemap_8x8, 1); | |
| 885 | tilemap_set_scroll_rows(tilemap_8x8, rows / 2); | |
| 886 | tilemap_set_scrolly(tilemap_8x8, 0, scrolly); | |
| 664 | 887 | |
| 665 | for (offs = 0;offs < rows/2;offs++) | |
| 666 | tilemap_set_scrollx( tilemap_8x8, offs, scrollx + rowscroll_ptr[offs] ); | |
| 888 | for (offs = 0; offs < rows / 2; offs++) | |
| 889 | tilemap_set_scrollx(tilemap_8x8, offs, scrollx + rowscroll_ptr[offs]); | |
| 667 | 890 | } |
| 668 | 891 | } |
| 669 | else if (rowscroll_ptr && (control1&0x60)==0x20) { /* Column scroll */ | |
| 892 | else if (rowscroll_ptr && (control1 & 0x60) == 0x20) /* Column scroll */ | |
| 893 | { | |
| 670 | 894 | |
| 671 | 895 | /* Column scroll ranges from 8 pixel columns to 512 pixel columns */ |
| 672 | int mask=(0x40 >> (control0&7))-1; | |
| 673 | if (mask==-1) mask=0; | |
| 674 | cols=(8<<(control0&7))&0x3ff; | |
| 675 | if (!cols) cols=1024; | |
| 676 | cols=1024 / cols; | |
| 896 | int mask = (0x40 >> (control0 & 7)) - 1; | |
| 897 | if (mask == -1) | |
| 898 | mask = 0; | |
| 677 | 899 | |
| 678 | if (tilemap_16x16) { | |
| 679 | tilemap_set_scroll_cols(tilemap_16x16,cols); | |
| 680 | tilemap_set_scroll_rows(tilemap_16x16,1); | |
| 681 | tilemap_set_scrollx(tilemap_16x16,0,scrollx ); | |
| 900 | cols = (8 << (control0 & 7)) & 0x3ff; | |
| 901 | if (!cols) | |
| 902 | cols = 1024; | |
| 682 | 903 | |
| 683 | for (offs=0 ; offs < cols;offs++) | |
| 684 | tilemap_set_scrolly( tilemap_16x16, offs, scrolly + rowscroll_ptr[(offs&mask)+0x200] ); | |
| 904 | cols = 1024 / cols; | |
| 905 | ||
| 906 | if (tilemap_16x16) | |
| 907 | { | |
| 908 | tilemap_set_scroll_cols(tilemap_16x16, cols); | |
| 909 | tilemap_set_scroll_rows(tilemap_16x16, 1); | |
| 910 | tilemap_set_scrollx(tilemap_16x16, 0, scrollx); | |
| 911 | ||
| 912 | for (offs = 0; offs < cols; offs++) | |
| 913 | tilemap_set_scrolly(tilemap_16x16, offs, scrolly + rowscroll_ptr[(offs & mask) + 0x200]); | |
| 685 | 914 | } |
| 686 | 915 | |
| 687 | if (tilemap_8x8) { | |
| 916 | if (tilemap_8x8) | |
| 917 | { | |
| 688 | 918 | cols = cols / 2; /* Adjust because 8x8 tilemap is half the width of 16x16 */ |
| 689 | 919 | |
| 690 | tilemap_set_scroll_cols(tilemap_8x8,cols); | |
| 691 | tilemap_set_scroll_rows(tilemap_8x8,1); | |
| 692 | tilemap_set_scrollx(tilemap_8x8,0,scrollx ); | |
| 920 | tilemap_set_scroll_cols(tilemap_8x8, cols); | |
| 921 | tilemap_set_scroll_rows(tilemap_8x8, 1); | |
| 922 | tilemap_set_scrollx(tilemap_8x8, 0, scrollx); | |
| 693 | 923 | |
| 694 | for (offs=0 ; offs < cols;offs++) | |
| 695 | tilemap_set_scrolly( tilemap_8x8,offs, scrolly + rowscroll_ptr[(offs&mask)+0x200] ); | |
| 924 | for (offs = 0; offs < cols; offs++) | |
| 925 | tilemap_set_scrolly(tilemap_8x8, offs, scrolly + rowscroll_ptr[(offs & mask) + 0x200]); | |
| 696 | 926 | } |
| 697 | 927 | } |
| 698 | else if (control1&0x60) { | |
| 928 | else if (control1 & 0x60) | |
| 929 | { | |
| 699 | 930 | /* Simultaneous row & column scroll requested - use custom renderer */ |
| 700 | use_custom=1; | |
| 931 | use_custom = 1; | |
| 701 | 932 | |
| 702 | if (tilemap_16x16) { | |
| 703 | tilemap_set_scroll_rows(tilemap_16x16,1); | |
| 704 | tilemap_set_scroll_cols(tilemap_16x16,1); | |
| 705 | tilemap_set_scrollx( tilemap_16x16,0, scrollx ); | |
| 706 | tilemap_set_scrolly( tilemap_16x16,0, scrolly ); | |
| 933 | if (tilemap_16x16) | |
| 934 | { | |
| 935 | tilemap_set_scroll_rows(tilemap_16x16, 1); | |
| 936 | tilemap_set_scroll_cols(tilemap_16x16, 1); | |
| 937 | tilemap_set_scrollx(tilemap_16x16, 0, scrollx); | |
| 938 | tilemap_set_scrolly(tilemap_16x16, 0, scrolly); | |
| 707 | 939 | } |
| 708 | 940 | |
| 709 | if (tilemap_8x8) { | |
| 710 | tilemap_set_scroll_rows(tilemap_8x8,1); | |
| 711 | tilemap_set_scroll_cols(tilemap_8x8,1); | |
| 712 | tilemap_set_scrollx( tilemap_8x8,0, scrollx ); | |
| 713 | tilemap_set_scrolly( tilemap_8x8,0, scrolly ); | |
| 941 | if (tilemap_8x8) | |
| 942 | { | |
| 943 | tilemap_set_scroll_rows(tilemap_8x8, 1); | |
| 944 | tilemap_set_scroll_cols(tilemap_8x8, 1); | |
| 945 | tilemap_set_scrollx(tilemap_8x8, 0, scrollx); | |
| 946 | tilemap_set_scrolly(tilemap_8x8, 0, scrolly); | |
| 714 | 947 | |
| 715 | 948 | } |
| 716 | 949 | |
| 717 | } else { | |
| 718 | if (tilemap_16x16) { | |
| 719 | tilemap_set_scroll_rows(tilemap_16x16,1); | |
| 720 | tilemap_set_scroll_cols(tilemap_16x16,1); | |
| 721 | tilemap_set_scrollx( tilemap_16x16,0, scrollx ); | |
| 722 | tilemap_set_scrolly( tilemap_16x16,0, scrolly ); | |
| 950 | } | |
| 951 | else | |
| 952 | { | |
| 953 | if (tilemap_16x16) | |
| 954 | { | |
| 955 | tilemap_set_scroll_rows(tilemap_16x16, 1); | |
| 956 | tilemap_set_scroll_cols(tilemap_16x16, 1); | |
| 957 | tilemap_set_scrollx(tilemap_16x16, 0, scrollx); | |
| 958 | tilemap_set_scrolly(tilemap_16x16, 0, scrolly); | |
| 723 | 959 | } |
| 724 | 960 | |
| 725 | if (tilemap_8x8) { | |
| 726 | tilemap_set_scroll_rows(tilemap_8x8,1); | |
| 727 | tilemap_set_scroll_cols(tilemap_8x8,1); | |
| 728 | tilemap_set_scrollx( tilemap_8x8,0, scrollx ); | |
| 729 | tilemap_set_scrolly( tilemap_8x8,0, scrolly ); | |
| 961 | if (tilemap_8x8) | |
| 962 | { | |
| 963 | tilemap_set_scroll_rows(tilemap_8x8, 1); | |
| 964 | tilemap_set_scroll_cols(tilemap_8x8, 1); | |
| 965 | tilemap_set_scrollx(tilemap_8x8, 0, scrollx); | |
| 966 | tilemap_set_scrolly(tilemap_8x8, 0, scrolly); | |
| 730 | 967 | } |
| 731 | 968 | } |
| 732 | 969 | |
| 733 | 970 | return use_custom; |
| 734 | 971 | } |
| 735 | 972 | |
| 736 | void deco16_pf12_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr) | |
| 973 | void deco16ic_pf12_update( running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr ) | |
| 737 | 974 | { |
| 975 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 738 | 976 | int bank1, bank2; |
| 739 | 977 | |
| 740 | 978 | /* Update scrolling and tilemap enable */ |
| 741 | pf1_rowscroll_ptr=rowscroll_1_ptr; | |
| 742 | pf2_rowscroll_ptr=rowscroll_2_ptr; | |
| 743 | use_custom_pf2=deco16_pf_update(pf2_tilemap_8x8,pf2_tilemap_16x16,rowscroll_2_ptr,deco16_pf12_control[3], deco16_pf12_control[4], deco16_pf12_control[5]>>8, deco16_pf12_control[6]>>8); | |
| 744 | use_custom_pf1=deco16_pf_update(pf1_tilemap_8x8,pf1_tilemap_16x16,rowscroll_1_ptr,deco16_pf12_control[1], deco16_pf12_control[2], deco16_pf12_control[5]&0xff, deco16_pf12_control[6]&0xff); | |
| 979 | deco16ic->pf1_rowscroll_ptr = rowscroll_1_ptr; | |
| 980 | deco16ic->pf2_rowscroll_ptr = rowscroll_2_ptr; | |
| 981 | deco16ic->use_custom_pf2 = deco16_pf_update(deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, rowscroll_2_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8); | |
| 982 | deco16ic->use_custom_pf1 = deco16_pf_update(deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, rowscroll_1_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff); | |
| 745 | 983 | |
| 746 | 984 | /* Update banking and global flip state */ |
| 747 | if (deco16_bank_callback_1) { | |
| 748 | bank1=deco16_bank_callback_1(deco16_pf12_control[7]&0xff); | |
| 749 | if (bank1!=deco16_pf1_bank) { | |
| 750 | if (pf1_tilemap_8x8) tilemap_mark_all_tiles_dirty(pf1_tilemap_8x8); | |
| 751 | if (pf1_tilemap_16x16) tilemap_mark_all_tiles_dirty(pf1_tilemap_16x16); | |
| 985 | if (deco16ic->bank_cb[0]) | |
| 986 | { | |
| 987 | bank1 = deco16ic->bank_cb[0](deco16ic->pf12_control[7] & 0xff); | |
| 988 | ||
| 989 | if (bank1 != deco16ic->pf1_bank) | |
| 990 | { | |
| 991 | if (deco16ic->pf1_tilemap_8x8) | |
| 992 | tilemap_mark_all_tiles_dirty(deco16ic->pf1_tilemap_8x8); | |
| 993 | if (deco16ic->pf1_tilemap_16x16) | |
| 994 | tilemap_mark_all_tiles_dirty(deco16ic->pf1_tilemap_16x16); | |
| 995 | ||
| 996 | deco16ic->pf1_bank = bank1; | |
| 752 | 997 | } |
| 753 | ||
| 754 | deco16_pf1_bank=bank1; | |
| 755 | 998 | } |
| 756 | 999 | |
| 757 | if (deco16_bank_callback_2) { | |
| 758 | bank2=deco16_bank_callback_2(deco16_pf12_control[7]>>8); | |
| 759 | if (bank2!=deco16_pf2_bank) { | |
| 760 | if (pf2_tilemap_8x8) tilemap_mark_all_tiles_dirty(pf2_tilemap_8x8); | |
| 761 | if (pf2_tilemap_16x16) tilemap_mark_all_tiles_dirty(pf2_tilemap_16x16); | |
| 1000 | if (deco16ic->bank_cb[1]) | |
| 1001 | { | |
| 1002 | bank2 = deco16ic->bank_cb[1](deco16ic->pf12_control[7] >> 8); | |
| 1003 | ||
| 1004 | if (bank2 != deco16ic->pf2_bank) | |
| 1005 | { | |
| 1006 | if (deco16ic->pf2_tilemap_8x8) | |
| 1007 | tilemap_mark_all_tiles_dirty(deco16ic->pf2_tilemap_8x8); | |
| 1008 | if (deco16ic->pf2_tilemap_16x16) | |
| 1009 | tilemap_mark_all_tiles_dirty(deco16ic->pf2_tilemap_16x16); | |
| 1010 | ||
| 1011 | deco16ic->pf2_bank = bank2; | |
| 762 | 1012 | } |
| 763 | ||
| 764 | deco16_pf2_bank=bank2; | |
| 765 | 1013 | } |
| 766 | 1014 | } |
| 767 | 1015 | |
| 768 | void deco16_pf34_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr) | |
| 1016 | void deco16ic_pf34_update( running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr ) | |
| 769 | 1017 | { |
| 1018 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 770 | 1019 | int bank1, bank2; |
| 771 | 1020 | |
| 772 | 1021 | /* Update scrolling and tilemap enable */ |
| 773 | pf3_rowscroll_ptr=rowscroll_1_ptr; | |
| 774 | pf4_rowscroll_ptr=rowscroll_2_ptr; | |
| 775 | use_custom_pf4=deco16_pf_update(0,pf4_tilemap_16x16,rowscroll_2_ptr,deco16_pf34_control[3], deco16_pf34_control[4], deco16_pf34_control[5]>>8, deco16_pf34_control[6]>>8); | |
| 776 | use_custom_pf3=deco16_pf_update(0,pf3_tilemap_16x16,rowscroll_1_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff); | |
| 1022 | deco16ic->pf3_rowscroll_ptr = rowscroll_1_ptr; | |
| 1023 | deco16ic->pf4_rowscroll_ptr = rowscroll_2_ptr; | |
| 1024 | deco16ic->use_custom_pf4 = deco16_pf_update(0, deco16ic->pf4_tilemap_16x16, rowscroll_2_ptr, deco16ic->pf34_control[3], deco16ic->pf34_control[4], deco16ic->pf34_control[5] >> 8, deco16ic->pf34_control[6] >> 8); | |
| 1025 | deco16ic->use_custom_pf3 = deco16_pf_update(0, deco16ic->pf3_tilemap_16x16, rowscroll_1_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff); | |
| 777 | 1026 | |
| 1027 | /* Update banking and global flip state */ | |
| 1028 | if (deco16ic->bank_cb[2]) | |
| 1029 | { | |
| 1030 | bank1 = deco16ic->bank_cb[2](deco16ic->pf34_control[7] & 0xff); | |
| 1031 | if (bank1 != deco16ic->pf3_bank) | |
| 1032 | { | |
| 1033 | if (deco16ic->pf3_tilemap_16x16) | |
| 1034 | tilemap_mark_all_tiles_dirty(deco16ic->pf3_tilemap_16x16); | |
| 778 | 1035 | |
| 779 | /* Update banking and global flip state */ | |
| 780 | if (deco16_bank_callback_3) { | |
| 781 | bank1=deco16_bank_callback_3(deco16_pf34_control[7]&0xff); | |
| 782 | if (bank1!=deco16_pf3_bank) { | |
| 783 | //if (pf3_tilemap_8x8) tilemap_mark_all_tiles_dirty(pf3_tilemap_8x8); | |
| 784 | if (pf3_tilemap_16x16) tilemap_mark_all_tiles_dirty(pf3_tilemap_16x16); | |
| 1036 | deco16ic->pf3_bank = bank1; | |
| 785 | 1037 | } |
| 786 | ||
| 787 | deco16_pf3_bank=bank1; | |
| 788 | 1038 | } |
| 789 | 1039 | |
| 790 | if (deco16_bank_callback_4) { | |
| 791 | bank2=deco16_bank_callback_4(deco16_pf34_control[7]>>8); | |
| 792 | if (bank2!=deco16_pf4_bank) { | |
| 793 | //if (pf4_tilemap_8x8) tilemap_mark_all_tiles_dirty(pf4_tilemap_8x8); | |
| 794 | if (pf4_tilemap_16x16) tilemap_mark_all_tiles_dirty(pf4_tilemap_16x16); | |
| 1040 | if (deco16ic->bank_cb[3]) | |
| 1041 | { | |
| 1042 | bank2 = deco16ic->bank_cb[3](deco16ic->pf34_control[7] >> 8); | |
| 1043 | if (bank2 != deco16ic->pf4_bank) | |
| 1044 | { | |
| 1045 | if (deco16ic->pf4_tilemap_16x16) | |
| 1046 | tilemap_mark_all_tiles_dirty(deco16ic->pf4_tilemap_16x16); | |
| 1047 | ||
| 1048 | deco16ic->pf4_bank = bank2; | |
| 795 | 1049 | } |
| 796 | ||
| 797 | deco16_pf4_bank=bank2; | |
| 798 | 1050 | } |
| 799 | 1051 | } |
| 800 | 1052 | |
| 801 | 1053 | /*****************************************************************************************/ |
| 802 | 1054 | |
| 803 | void deco16_print_debug_info(running_ | |
| 1055 | void deco16ic_print_debug_info(running_dev | |
| 804 | 1056 | { |
| 1057 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 805 | 1058 | char buf[64*5]; |
| 806 | 1059 | |
| 807 | if (input_code_pressed(machine, KEYCODE_O)) | |
| 1060 | if (input_code_pressed(device->machine, KEYCODE_O)) | |
| 808 | 1061 | return; |
| 809 | 1062 | |
| 810 | if (deco16_pf12_control) { | |
| 811 | sprintf(buf,"%04X %04X %04X %04X\n",deco16_pf12_control[0],deco16_pf12_control[1],deco16_pf12_control[2],deco16_pf12_control[3]); | |
| 812 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n",deco16_pf12_control[4],deco16_pf12_control[5],deco16_pf12_control[6],deco16_pf12_control[7]); | |
| 1063 | if (deco16ic->pf12_control) | |
| 1064 | { | |
| 1065 | sprintf(buf,"%04X %04X %04X %04X\n", deco16ic->pf12_control[0], deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[3]); | |
| 1066 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", deco16ic->pf12_control[4], deco16ic->pf12_control[5], deco16ic->pf12_control[6], deco16ic->pf12_control[7]); | |
| 813 | 1067 | } |
| 814 | 1068 | else |
| 815 | 1069 | sprintf(buf, "\n\n"); |
| 816 | 1070 | |
| 817 | if (deco16_pf34_control) { | |
| 818 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n",deco16_pf34_control[0],deco16_pf34_control[1],deco16_pf34_control[2],deco16_pf34_control[3]); | |
| 819 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n",deco16_pf34_control[4],deco16_pf34_control[5],deco16_pf34_control[6],deco16_pf34_control[7]); | |
| 1071 | if (deco16ic->pf34_control) | |
| 1072 | { | |
| 1073 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", deco16ic->pf34_control[0], deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[3]); | |
| 1074 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", deco16ic->pf34_control[4], deco16ic->pf34_control[5], deco16ic->pf34_control[6], deco16ic->pf34_control[7]); | |
| 820 | 1075 | } |
| 821 | 1076 | else |
| 822 | 1077 | sprintf(&buf[strlen(buf)], "\n\n"); |
| 823 | 1078 | |
| 824 | sprintf(&buf[strlen(buf)],"%04X",deco16 | |
| 1079 | sprintf(&buf[strlen(buf)],"%04X", deco16ic->priority); | |
| 825 | 1080 | |
| 826 | ui_draw_text(render_container_get_ui(), buf,60,40); | |
| 1081 | ui_draw_text(render_container_get_ui(), buf, 60, 40); | |
| 827 | 1082 | } |
| 828 | 1083 | |
| 829 | 1084 | /*****************************************************************************************/ |
| 830 | 1085 | |
| 831 | void deco16_clear_sprite_priority_bitmap(v | |
| 1086 | void deco16ic_clear_sprite_priority_bitmap( running_dev | |
| 832 | 1087 | { |
| 833 | if (sprite_priority_bitmap) | |
| 834 | bitmap_fill(sprite_priority_bitmap,NULL,0); | |
| 1088 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1089 | ||
| 1090 | if (deco16ic->sprite_priority_bitmap) | |
| 1091 | bitmap_fill(deco16ic->sprite_priority_bitmap, NULL, 0); | |
| 835 | 1092 | } |
| 836 | 1093 | |
| 837 | 1094 | /* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */ |
| 838 | void deco16_pdrawgfx( | |
| 839 | bitmap_t *dest,const rectangle *clip,const gfx_element *gfx, | |
| 840 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, | |
| 841 | int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha) | |
| 1095 | void deco16ic_pdrawgfx( | |
| 1096 | running_device *device, | |
| 1097 | bitmap_t *dest, const rectangle *clip, const gfx_element *gfx, | |
| 1098 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, | |
| 1099 | int transparent_color, UINT32 pri_mask, UINT32 sprite_mask, UINT8 write_pri, UINT8 alpha) | |
| 842 | 1100 | { |
| 843 | int ox,oy,cx,cy; | |
| 844 | int x_index,y_index,x,y; | |
| 1101 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1102 | int ox, oy, cx, cy; | |
| 1103 | int x_index, y_index, x, y; | |
| 845 | 1104 | bitmap_t *priority_bitmap = gfx->machine->priority_bitmap; |
| 846 | 1105 | const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; |
| 847 | 1106 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| r7500 | r7501 | |
| 850 | 1109 | ox = sx; |
| 851 | 1110 | oy = sy; |
| 852 | 1111 | |
| 853 | if (sx>319 || sy>247 || sx<-15 || sy<-7) | |
| 1112 | if (sx > 319 || sy > 247 || sx < -15 || sy < -7) | |
| 854 | 1113 | return; |
| 855 | 1114 | |
| 856 | if (sy<0) sy=0; | |
| 857 | if (sx<0) sx=0; | |
| 858 | if (sx>319) cx=319; | |
| 859 | else cx=ox+16; | |
| 1115 | if (sy < 0) sy = 0; | |
| 1116 | if (sx < 0) sx = 0; | |
| 860 | 1117 | |
| 861 | cy=(sy-oy); | |
| 1118 | if (sx > 319) cx = 319; | |
| 1119 | else cx = ox + 16; | |
| 862 | 1120 | |
| 863 | | |
| 1121 | c | |
| 864 | 1122 | |
| 865 | for( y=0; y<16-cy; y++ ) | |
| 1123 | if (flipy) y_index = 15 - cy; else y_index = cy; | |
| 1124 | ||
| 1125 | for (y = 0; y < 16 - cy; y++) | |
| 866 | 1126 | { |
| 867 | 1127 | const UINT8 *source = code_base + (y_index * gfx->line_modulo); |
| 868 | 1128 | UINT32 *destb = BITMAP_ADDR32(dest, sy, 0); |
| 869 | 1129 | UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0); |
| 870 | UINT8 *spri = BITMAP_ADDR8(sprite_priority_bitmap, sy, 0); | |
| 1130 | UINT8 *spri = BITMAP_ADDR8(deco16ic->sprite_priority_bitmap, sy, 0); | |
| 871 | 1131 | |
| 872 | 1132 | if (sy >= 0 && sy < 248) |
| 873 | 1133 | { |
| 874 | if (flipx) { source+=15-(sx-ox); x_index=-1; } else { x_index=1; source+=(sx-ox); } | |
| 1134 | if (flipx) { source += 15 - (sx - ox); x_index = -1; } | |
| 1135 | else { source += (sx - ox); x_index = 1; } | |
| 875 | 1136 | |
| 876 | for (x=sx; x<cx; x++) | |
| 1137 | for (x = sx; x < cx; x++) | |
| 877 | 1138 | { |
| 878 | 1139 | int c = *source; |
| 879 | if | |
| 1140 | if | |
| 880 | 1141 | { |
| 881 | if (pri_mask>pri[x] && sprite_mask>spri[x]) { | |
| 1142 | if (pri_mask>pri[x] && sprite_mask>spri[x]) | |
| 1143 | { | |
| 882 | 1144 | if (alpha != 0xff) |
| 883 | 1145 | destb[x] = alpha_blend_r32(destb[x], pal[c], alpha); |
| 884 | 1146 | else |
| r7500 | r7501 | |
| 886 | 1148 | if (write_pri) |
| 887 | 1149 | pri[x] |= pri_mask; |
| 888 | 1150 | } |
| 889 | spri[x]|=sprite_mask; | |
| 1151 | spri[x] |= sprite_mask; | |
| 890 | 1152 | } |
| 891 | source+=x_index; | |
| 1153 | source += x_index; | |
| 892 | 1154 | } |
| 893 | 1155 | } |
| 894 | 1156 | |
| 895 | 1157 | sy++; |
| 896 | if (sy>247) | |
| 1158 | if (sy > 247) | |
| 897 | 1159 | return; |
| 898 | 1160 | if (flipy) y_index--; else y_index++; |
| 899 | 1161 | } |
| r7500 | r7501 | |
| 901 | 1163 | |
| 902 | 1164 | /*****************************************************************************************/ |
| 903 | 1165 | |
| 904 | void deco16_tilemap_1_draw(running_device * | |
| 1166 | void deco16ic_tilemap_1_draw( running_device *devic | |
| 905 | 1167 | { |
| 906 | if (use_custom_pf1) | |
| 1168 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1169 | ||
| 1170 | if (deco16ic->use_custom_pf1) | |
| 907 | 1171 | { |
| 908 | custom_tilemap_draw( | |
| 1172 | custom_tilemap_draw(d | |
| 909 | 1173 | } |
| 910 | 1174 | else |
| 911 | 1175 | { |
| 912 | if (pf1_tilemap_8x8) tilemap_draw(bitmap,cliprect,pf1_tilemap_8x8,flags,priority); | |
| 913 | if (pf1_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf1_tilemap_16x16,flags,priority); | |
| 1176 | if (deco16ic->pf1_tilemap_8x8) | |
| 1177 | tilemap_draw(bitmap, cliprect, deco16ic->pf1_tilemap_8x8, flags, priority); | |
| 1178 | if (deco16ic->pf1_tilemap_16x16) | |
| 1179 | tilemap_draw(bitmap, cliprect, deco16ic->pf1_tilemap_16x16, flags, priority); | |
| 914 | 1180 | } |
| 915 | 1181 | } |
| 916 | 1182 | |
| 917 | void deco16_tilemap_2_draw(running_device * | |
| 1183 | void deco16ic_tilemap_2_draw(running_device *devic | |
| 918 | 1184 | { |
| 919 | if (use_custom_pf2) | |
| 1185 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1186 | ||
| 1187 | if (deco16ic->use_custom_pf2) | |
| 920 | 1188 | { |
| 921 | custom_tilemap_draw( | |
| 1189 | custom_tilemap_draw(d | |
| 922 | 1190 | } |
| 923 | 1191 | else |
| 924 | 1192 | { |
| 925 | if (pf2_tilemap_8x8) tilemap_draw(bitmap,cliprect,pf2_tilemap_8x8,flags,priority); | |
| 926 | if (pf2_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf2_tilemap_16x16,flags,priority); | |
| 1193 | if (deco16ic->pf2_tilemap_8x8) | |
| 1194 | tilemap_draw(bitmap, cliprect, deco16ic->pf2_tilemap_8x8, flags, priority); | |
| 1195 | if (deco16ic->pf2_tilemap_16x16) | |
| 1196 | tilemap_draw(bitmap, cliprect, deco16ic->pf2_tilemap_16x16, flags, priority); | |
| 927 | 1197 | } |
| 928 | 1198 | } |
| 929 | 1199 | |
| 930 | void deco16_tilemap_3_draw(running_device * | |
| 1200 | void deco16ic_tilemap_3_draw(running_device *devic | |
| 931 | 1201 | { |
| 932 | if (use_custom_pf3) custom_tilemap_draw(screen->machine, bitmap,0,pf3_tilemap_16x16,0,0,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0, 0, deco16_pf3_trans_mask, flags, priority); | |
| 933 | else if (pf3_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf3_tilemap_16x16,flags,priority); | |
| 1202 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1203 | ||
| 1204 | if (deco16ic->use_custom_pf3) | |
| 1205 | custom_tilemap_draw(device, bitmap, 0, deco16ic->pf3_tilemap_16x16, 0, 0, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0, 0, deco16ic->pf3_trans_mask, flags, priority); | |
| 1206 | else if (deco16ic->pf3_tilemap_16x16) | |
| 1207 | tilemap_draw(bitmap, cliprect, deco16ic->pf3_tilemap_16x16, flags, priority); | |
| 934 | 1208 | } |
| 935 | 1209 | |
| 936 | void deco16_tilemap_4_draw(running_device * | |
| 1210 | void deco16ic_tilemap_4_draw(running_device *devic | |
| 937 | 1211 | { |
| 938 | if (use_custom_pf4) custom_tilemap_draw(screen->machine, bitmap,0,pf4_tilemap_16x16,0,0,pf4_rowscroll_ptr,deco16_pf34_control[3], deco16_pf34_control[4], deco16_pf34_control[5]>>8, deco16_pf34_control[6]>>8, 0, 0, deco16_pf4_trans_mask, flags, priority); | |
| 939 | else if (pf4_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf4_tilemap_16x16,flags,priority); | |
| 1212 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1213 | ||
| 1214 | if (deco16ic->use_custom_pf4) | |
| 1215 | custom_tilemap_draw(device, bitmap, 0, deco16ic->pf4_tilemap_16x16, 0, 0, deco16ic->pf4_rowscroll_ptr, deco16ic->pf34_control[3], deco16ic->pf34_control[4], deco16ic->pf34_control[5] >> 8, deco16ic->pf34_control[6] >> 8, 0, 0, deco16ic->pf4_trans_mask, flags, priority); | |
| 1216 | else if (deco16ic->pf4_tilemap_16x16) | |
| 1217 | tilemap_draw(bitmap, cliprect, deco16ic->pf4_tilemap_16x16, flags, priority); | |
| 940 | 1218 | } |
| 941 | 1219 | |
| 942 | 1220 | /*****************************************************************************************/ |
| 943 | 1221 | |
| 944 | 1222 | // Combines the output of two 4BPP tilemaps into an 8BPP tilemap |
| 945 | void deco16_tilemap_34_combine_draw(running_device * | |
| 1223 | void deco16ic_tilemap_34_combine_draw(running_device *devic | |
| 946 | 1224 | { |
| 947 | custom_tilemap_draw(screen->machine, bitmap,0,pf3_tilemap_16x16,0,pf4_tilemap_16x16,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0xf, 4, 0xff, flags, priority); | |
| 1225 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1226 | custom_tilemap_draw(device, bitmap, 0, deco16ic->pf3_tilemap_16x16, 0, deco16ic->pf4_tilemap_16x16, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0xf, 4, 0xff, flags, priority); | |
| 948 | 1227 | } |
| 949 | 1228 | |
| 950 | /*****************************************************************************************/ | |
| 951 | 1229 | |
| 952 | /* | |
| 953 | Consider this the 'reference rasterizer' for the 56/74/141 tilemap chips - it implements | |
| 954 | simultaneous row & column scroll which the Mame tilemap core cannot do. It also | |
| 955 | implements combining the 4BPP output of two tilemaps into 8BPP output. This function | |
| 956 | is automatically called when the tilemap is in a state the cannot be properly rendered | |
| 957 | by the Mame core. | |
| 958 | */ | |
| 1230 | /***************************************************************************** | |
| 1231 | DEVICE INTERFACE | |
| 1232 | *****************************************************************************/ | |
| 959 | 1233 | |
| 960 | static void custom_tilemap_draw( | |
| 961 | running_machine *machine, | |
| 962 | bitmap_t *bitmap, | |
| 963 | tilemap_t *tilemap0_8x8, | |
| 964 | tilemap_t *tilemap0_16x16, | |
| 965 | tilemap_t *tilemap1_8x8, | |
| 966 | tilemap_t *tilemap1_16x16, | |
| 967 | const UINT16 *rowscroll_ptr, | |
| 968 | const UINT16 scrollx, | |
| 969 | const UINT16 scrolly, | |
| 970 | const UINT16 control0, | |
| 971 | const UINT16 control1, | |
| 972 | int combine_mask, | |
| 973 | int combine_shift, | |
| 974 | int trans_mask, | |
| 975 | int flags, | |
| 976 | UINT32 priority) | |
| 1234 | static DEVICE_START( deco16ic ) | |
| 977 | 1235 | { |
| 978 | tilemap_t *tilemap0 = (control1&0x80) ? tilemap0_8x8 : tilemap0_16x16; | |
| 979 | tilemap_t *tilemap1 = (control1&0x80) ? tilemap1_8x8 : tilemap1_16x16; | |
| 980 | const bitmap_t *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL; | |
| 981 | const bitmap_t *src_bitmap1 = tilemap1 ? tilemap_get_pixmap(tilemap1) : NULL; | |
| 982 | int width_mask, height_mask, x, y, p; | |
| 983 | int column_offset, src_x=0, src_y=0; | |
| 984 | int row_type=1 << ((control0>>3)&0xf); | |
| 985 | int col_type=8 << (control0&7); | |
| 1236 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1237 | const deco16ic_interface *intf = get_interface(device); | |
| 1238 | int width, height; | |
| 986 | 1239 | |
| 987 | if (!src_bitmap0) | |
| 988 | return; | |
| 1240 | deco16ic->screen = devtag_get_device(device->machine, intf->screen); | |
| 1241 | width = video_screen_get_width(deco16ic->screen); | |
| 1242 | height = video_screen_get_height(deco16ic->screen); | |
| 989 | 1243 | |
| 990 | // Playfield disable | |
| 991 | if (!(control0&0x80)) | |
| 992 | return; | |
| 1244 | deco16ic->sprite_priority_bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED8); | |
| 993 | 1245 | |
| 994 | width_mask=src_bitmap0->width - 1; | |
| 995 | height_mask=src_bitmap0->height - 1; | |
| 996 | src_y=scrolly + 8; | |
| 1246 | deco16ic->bank_cb[0] = intf->bank_cb0; | |
| 1247 | deco16ic->bank_cb[1] = intf->bank_cb1; | |
| 1248 | deco16ic->bank_cb[2] = intf->bank_cb2; | |
| 1249 | deco16ic->bank_cb[3] = intf->bank_cb3; | |
| 997 | 1250 | |
| 998 | for (y=8; y<248; y++) { | |
| 999 | if (rowscroll_ptr && (control1&0x40)) | |
| 1000 | src_x=scrollx + rowscroll_ptr[src_y / row_type]; | |
| 1001 | else | |
| 1002 | src_x=scrollx; | |
| 1251 | deco16ic->pf1_trans_mask = intf->trans_mask1; | |
| 1252 | deco16ic->pf2_trans_mask = intf->trans_mask2; | |
| 1253 | deco16ic->pf3_trans_mask = intf->trans_mask3; | |
| 1254 | deco16ic->pf4_trans_mask = intf->trans_mask4; | |
| 1003 | 1255 | |
| 1004 | src_x &= width_mask; | |
| 1256 | deco16ic->pf1_colour_bank = intf->col_base1; | |
| 1257 | deco16ic->pf2_colour_bank = intf->col_base2; | |
| 1258 | deco16ic->pf3_colour_bank = intf->col_base3; | |
| 1259 | deco16ic->pf4_colour_bank = intf->col_base4; | |
| 1005 | 1260 | |
| 1006 | if (bitmap->bpp == 16) | |
| 1007 | { | |
| 1008 | for (x=0; x<320; x++) { | |
| 1009 | if (rowscroll_ptr && (control1&0x20)) | |
| 1010 | column_offset=rowscroll_ptr[0x200 + ((src_x&0x1ff) / col_type)]; | |
| 1011 | else | |
| 1012 | column_offset=0; | |
| 1261 | deco16ic->pf1_colourmask = intf->col_mask1; | |
| 1262 | deco16ic->pf2_colourmask = intf->col_mask2; | |
| 1263 | deco16ic->pf3_colourmask = intf->col_mask3; | |
| 1264 | deco16ic->pf4_colourmask = intf->col_mask4; | |
| 1013 | 1265 | |
| 1014 | p=*BITMAP_ADDR16(src_bitmap0, (src_y + column_offset)&height_mask, src_x); | |
| 1015 | if (src_bitmap1) | |
| 1016 | p|=(*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset)&height_mask, src_x)&combine_mask)<<combine_shift; | |
| 1266 | deco16ic->pf1_tilemap_16x16 = tilemap_create_device(device, get_pf1_tile_info, deco16_scan_rows, 16, 16, 64, 32); | |
| 1267 | deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, tilemap_scan_rows, 8, 8, 64, 32); | |
| 1017 | 1268 | |
| 1018 | src_x=(src_x+1)&width_mask; | |
| 1019 | if ((flags&TILEMAP_DRAW_OPAQUE) || (p&trans_mask)) | |
| 1020 | { | |
| 1021 | *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p]; | |
| 1022 | if (machine->priority_bitmap) | |
| 1023 | { | |
| 1024 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); | |
| 1025 | pri[x]|=priority; | |
| 1026 | } | |
| 1027 | } | |
| 1028 | } | |
| 1029 | } | |
| 1030 | else | |
| 1031 | { | |
| 1032 | /* boogwing */ | |
| 1033 | for (x=0; x<320; x++) { | |
| 1034 | if (rowscroll_ptr && (control1&0x20)) | |
| 1035 | column_offset=rowscroll_ptr[0x200 + ((src_x&0x1ff) / col_type)]; | |
| 1036 | else | |
| 1037 | column_offset=0; | |
| 1269 | if (intf->split) | |
| 1270 | deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); | |
| 1271 | else | |
| 1272 | deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); | |
| 1038 | 1273 | |
| 1039 | p=*BITMAP_ADDR16(src_bitmap0, (src_y + column_offset)&height_mask, src_x); | |
| 1040 | if (src_bitmap1) | |
| 1041 | p|=(*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset)&height_mask, src_x)&combine_mask)<<combine_shift; | |
| 1274 | deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, tilemap_scan_rows, 8, 8, intf->full_width ? 64 : 32, 32); | |
| 1042 | 1275 | |
| 1043 | src_x=(src_x+1)&width_mask; | |
| 1044 | if ((flags&TILEMAP_DRAW_OPAQUE) || (p&trans_mask)) | |
| 1045 | { | |
| 1046 | *BITMAP_ADDR32(bitmap, y, x) = machine->pens[p]; | |
| 1047 | if (machine->priority_bitmap) | |
| 1048 | { | |
| 1049 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); | |
| 1050 | pri[x]|=priority; | |
| 1051 | } | |
| 1052 | } | |
| 1053 | } | |
| 1054 | } | |
| 1055 | src_y=(src_y+1)&height_mask; | |
| 1276 | if (!intf->pf12_only) | |
| 1277 | { | |
| 1278 | deco16ic->pf4_tilemap_16x16 = tilemap_create_device(device, get_pf4_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); | |
| 1279 | deco16ic->pf3_tilemap_16x16 = tilemap_create_device(device, get_pf3_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); | |
| 1056 | 1280 | } |
| 1281 | else | |
| 1282 | { | |
| 1283 | deco16ic->pf3_tilemap_16x16 = 0; | |
| 1284 | deco16ic->pf4_tilemap_16x16 = 0; | |
| 1285 | } | |
| 1286 | ||
| 1287 | tilemap_set_transparent_pen(deco16ic->pf1_tilemap_8x8, 0); | |
| 1288 | tilemap_set_transparent_pen(deco16ic->pf2_tilemap_8x8, 0); | |
| 1289 | tilemap_set_transparent_pen(deco16ic->pf1_tilemap_16x16, 0); | |
| 1290 | tilemap_set_transparent_pen(deco16ic->pf2_tilemap_16x16, 0); | |
| 1291 | ||
| 1292 | if (intf->split) /* Caveman Ninja only */ | |
| 1293 | tilemap_set_transmask(deco16ic->pf2_tilemap_16x16, 0, 0x00ff, 0xff01); | |
| 1294 | ||
| 1295 | if (!intf->pf12_only) | |
| 1296 | { | |
| 1297 | tilemap_set_transparent_pen(deco16ic->pf3_tilemap_16x16, 0); | |
| 1298 | tilemap_set_transparent_pen(deco16ic->pf4_tilemap_16x16, 0); | |
| 1299 | } | |
| 1300 | ||
| 1301 | ||
| 1302 | deco16ic->dirty_palette = auto_alloc_array_clear(device->machine, UINT8, 4096); | |
| 1303 | deco16ic->raster_display_list = auto_alloc_array_clear(device->machine, UINT16, 20 * 256 / 2); | |
| 1304 | ||
| 1305 | deco16ic->pf1_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2); | |
| 1306 | deco16ic->pf2_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2); | |
| 1307 | deco16ic->pf3_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2); | |
| 1308 | deco16ic->pf4_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2); | |
| 1309 | deco16ic->pf12_control = auto_alloc_array_clear(device->machine, UINT16, 0x10 / 2); | |
| 1310 | deco16ic->pf34_control = auto_alloc_array_clear(device->machine, UINT16, 0x10 / 2); | |
| 1311 | ||
| 1312 | state_save_register_device_item(device, 0, deco16ic->priority); | |
| 1313 | state_save_register_device_item(device, 0, deco16ic->raster_display_position); | |
| 1314 | state_save_register_device_item(device, 0, deco16ic->use_custom_pf1); | |
| 1315 | state_save_register_device_item(device, 0, deco16ic->use_custom_pf2); | |
| 1316 | state_save_register_device_item(device, 0, deco16ic->use_custom_pf3); | |
| 1317 | state_save_register_device_item(device, 0, deco16ic->use_custom_pf4); | |
| 1318 | state_save_register_device_item(device, 0, deco16ic->pf1_bank); | |
| 1319 | state_save_register_device_item(device, 0, deco16ic->pf2_bank); | |
| 1320 | state_save_register_device_item(device, 0, deco16ic->pf3_bank); | |
| 1321 | state_save_register_device_item(device, 0, deco16ic->pf4_bank); | |
| 1322 | state_save_register_device_item(device, 0, deco16ic->pf12_8x8_gfx_bank); | |
| 1323 | state_save_register_device_item(device, 0, deco16ic->pf12_16x16_gfx_bank); | |
| 1324 | state_save_register_device_item(device, 0, deco16ic->pf34_16x16_gfx_bank); | |
| 1325 | state_save_register_device_item(device, 0, deco16ic->pf12_last_small); | |
| 1326 | state_save_register_device_item(device, 0, deco16ic->pf12_last_big); | |
| 1327 | state_save_register_device_item(device, 0, deco16ic->pf34_last_big); | |
| 1328 | ||
| 1329 | state_save_register_device_item_pointer(device, 0, deco16ic->dirty_palette, 4096); | |
| 1330 | state_save_register_device_item_pointer(device, 0, deco16ic->raster_display_list, 20 * 256 / 2); | |
| 1331 | state_save_register_device_item_pointer(device, 0, deco16ic->pf1_data, 0x2000 / 2); | |
| 1332 | state_save_register_device_item_pointer(device, 0, deco16ic->pf2_data, 0x2000 / 2); | |
| 1333 | state_save_register_device_item_pointer(device, 0, deco16ic->pf3_data, 0x2000 / 2); | |
| 1334 | state_save_register_device_item_pointer(device, 0, deco16ic->pf4_data, 0x2000 / 2); | |
| 1335 | state_save_register_device_item_pointer(device, 0, deco16ic->pf12_control, 0x10 / 2); | |
| 1336 | state_save_register_device_item_pointer(device, 0, deco16ic->pf34_control, 0x10 / 2); | |
| 1057 | 1337 | } |
| 1338 | ||
| 1339 | static DEVICE_RESET( deco16ic ) | |
| 1340 | { | |
| 1341 | deco16ic_state *deco16ic = get_safe_token(device); | |
| 1342 | ||
| 1343 | deco16ic->pf1_bank = deco16ic->pf2_bank = deco16ic->pf3_bank = deco16ic->pf4_bank = 0; | |
| 1344 | ||
| 1345 | deco16ic->pf12_8x8_gfx_bank = 0; | |
| 1346 | deco16ic->pf12_16x16_gfx_bank = 1; | |
| 1347 | deco16ic->pf34_16x16_gfx_bank = 2; | |
| 1348 | ||
| 1349 | deco16ic->raster_display_position = 0; | |
| 1350 | ||
| 1351 | deco16ic->pf12_last_small = deco16ic->pf12_last_big = deco16ic->pf34_last_big = -1; | |
| 1352 | ||
| 1353 | deco16ic->priority = 0; | |
| 1354 | deco16ic->use_custom_pf1 = deco16ic->use_custom_pf2 = deco16ic->use_custom_pf3 = deco16ic->use_custom_pf4 = 0; | |
| 1355 | ||
| 1356 | deco16ic->pf1_rowscroll_ptr = 0; | |
| 1357 | deco16ic->pf2_rowscroll_ptr = 0; | |
| 1358 | deco16ic->pf3_rowscroll_ptr = 0; | |
| 1359 | deco16ic->pf4_rowscroll_ptr = 0; | |
| 1360 | } | |
| 1361 | ||
| 1362 | ||
| 1363 | DEVICE_GET_INFO( deco16ic ) | |
| 1364 | { | |
| 1365 | switch (state) | |
| 1366 | { | |
| 1367 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 1368 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(deco16ic_state); break; | |
| 1369 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_VIDEO; break; | |
| 1370 | ||
| 1371 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1372 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(deco16ic); break; | |
| 1373 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 1374 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(deco16ic); break; | |
| 1375 | ||
| 1376 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 1377 | case DEVINFO_STR_NAME: strcpy(info->s, "Data East IC 55 / 56 / 74 / 141"); break; | |
| 1378 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Data East Video IC"); break; | |
| 1379 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1380 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1381 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MAME Team"); break; | |
| 1382 | } | |
| 1383 | } |
| r0 | r7501 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | deco16ic.h | |
| 4 | ||
| 5 | Implementation of various Data East custom 16bit video ICs | |
| 6 | ||
| 7 | **************************************************************************/ | |
| 8 | ||
| 9 | #include "devcb.h" | |
| 10 | ||
| 11 | ||
| 12 | /*************************************************************************** | |
| 13 | TYPE DEFINITIONS | |
| 14 | ***************************************************************************/ | |
| 15 | ||
| 16 | typedef int (*deco16_bank_cb)( const int bank ); | |
| 17 | ||
| 18 | ||
| 19 | typedef struct _deco16ic_interface deco16ic_interface; | |
| 20 | struct _deco16ic_interface | |
| 21 | { | |
| 22 | const char *screen; | |
| 23 | int pf12_only; | |
| 24 | int split; | |
| 25 | int full_width; | |
| 26 | ||
| 27 | int trans_mask1, trans_mask2, trans_mask3, trans_mask4; | |
| 28 | int col_base1, col_base2, col_base3, col_base4; | |
| 29 | int col_mask1, col_mask2, col_mask3, col_mask4; | |
| 30 | deco16_bank_cb bank_cb0, bank_cb1, bank_cb2, bank_cb3; | |
| 31 | }; | |
| 32 | ||
| 33 | /*************************************************************************** | |
| 34 | FUNCTION PROTOTYPES | |
| 35 | ***************************************************************************/ | |
| 36 | ||
| 37 | DEVICE_GET_INFO( deco16ic ); | |
| 38 | ||
| 39 | ||
| 40 | /*************************************************************************** | |
| 41 | DEVICE CONFIGURATION MACROS | |
| 42 | ***************************************************************************/ | |
| 43 | ||
| 44 | #define DECO16IC DEVICE_GET_INFO_NAME( deco16ic ) | |
| 45 | ||
| 46 | #define MDRV_DECO16IC_ADD(_tag, _interface) \ | |
| 47 | MDRV_DEVICE_ADD(_tag, DECO16IC, 0) \ | |
| 48 | MDRV_DEVICE_CONFIG(_interface) | |
| 49 | ||
| 50 | /*************************************************************************** | |
| 51 | DEVICE I/O FUNCTIONS | |
| 52 | ***************************************************************************/ | |
| 53 | ||
| 54 | WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w ); | |
| 55 | WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w ); | |
| 56 | WRITE16_DEVICE_HANDLER( deco16ic_pf3_data_w ); | |
| 57 | WRITE16_DEVICE_HANDLER( deco16ic_pf4_data_w ); | |
| 58 | ||
| 59 | READ16_DEVICE_HANDLER( deco16ic_pf1_data_r ); | |
| 60 | READ16_DEVICE_HANDLER( deco16ic_pf2_data_r ); | |
| 61 | READ16_DEVICE_HANDLER( deco16ic_pf3_data_r ); | |
| 62 | READ16_DEVICE_HANDLER( deco16ic_pf4_data_r ); | |
| 63 | ||
| 64 | WRITE16_DEVICE_HANDLER( deco16ic_pf12_control_w ); | |
| 65 | WRITE16_DEVICE_HANDLER( deco16ic_pf34_control_w ); | |
| 66 | ||
| 67 | READ16_DEVICE_HANDLER( deco16ic_pf12_control_r ); | |
| 68 | READ16_DEVICE_HANDLER( deco16ic_pf34_control_r ); | |
| 69 | ||
| 70 | ||
| 71 | WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w ); | |
| 72 | WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w ); | |
| 73 | WRITE32_DEVICE_HANDLER( deco16ic_pf3_data_dword_w ); | |
| 74 | WRITE32_DEVICE_HANDLER( deco16ic_pf4_data_dword_w ); | |
| 75 | ||
| 76 | READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r ); | |
| 77 | READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r ); | |
| 78 | READ32_DEVICE_HANDLER( deco16ic_pf3_data_dword_r ); | |
| 79 | READ32_DEVICE_HANDLER( deco16ic_pf4_data_dword_r ); | |
| 80 | ||
| 81 | WRITE32_DEVICE_HANDLER( deco16ic_pf12_control_dword_w ); | |
| 82 | WRITE32_DEVICE_HANDLER( deco16ic_pf34_control_dword_w ); | |
| 83 | ||
| 84 | READ32_DEVICE_HANDLER( deco16ic_pf12_control_dword_r ); | |
| 85 | READ32_DEVICE_HANDLER( deco16ic_pf34_control_dword_r ); | |
| 86 | ||
| 87 | ||
| 88 | WRITE16_DEVICE_HANDLER( deco16ic_nonbuffered_palette_w ); | |
| 89 | WRITE16_DEVICE_HANDLER( deco16ic_buffered_palette_w ); | |
| 90 | WRITE16_DEVICE_HANDLER( deco16ic_palette_dma_w ); | |
| 91 | ||
| 92 | WRITE16_DEVICE_HANDLER( deco16ic_priority_w ); | |
| 93 | READ16_DEVICE_HANDLER( deco16ic_priority_r ); | |
| 94 | ||
| 95 | READ16_DEVICE_HANDLER( deco16ic_71_r ); | |
| 96 | ||
| 97 | void deco16ic_print_debug_info(running_device *device, bitmap_t *bitmap); | |
| 98 | ||
| 99 | void deco16ic_pf12_update(running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr); | |
| 100 | void deco16ic_pf34_update(running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr); | |
| 101 | ||
| 102 | void deco16ic_tilemap_1_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 103 | void deco16ic_tilemap_2_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 104 | void deco16ic_tilemap_3_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 105 | void deco16ic_tilemap_4_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 106 | ||
| 107 | /* used by boogwing, nitrobal */ | |
| 108 | void deco16ic_tilemap_34_combine_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 109 | ||
| 110 | ||
| 111 | /* used by boogwing, dassault, nitrobal */ | |
| 112 | void deco16ic_clear_sprite_priority_bitmap(running_device *device); | |
| 113 | void deco16ic_pdrawgfx( | |
| 114 | running_device *device, | |
| 115 | bitmap_t *dest,const rectangle *clip,const gfx_element *gfx, | |
| 116 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, | |
| 117 | int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha); | |
| 118 | ||
| 119 | /* used by robocop2 */ | |
| 120 | void deco16ic_set_tilemap_colour_mask(running_device *device, int tmap, int mask); | |
| 121 | void deco16ic_pf34_set_gfxbank(running_device *device, int small, int big); | |
| 122 | ||
| 123 | /* used by stoneage */ | |
| 124 | void deco16ic_set_scrolldx(running_device *device, int tmap, int size, int dx, int dx_if_flipped); |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "includes/mrdo.h" | |
| 10 | 11 | |
| 11 | 12 | |
| 12 | UINT8 *mrdo_bgvideoram,*mrdo_fgvideoram; | |
| 13 | static tilemap_t *bg_tilemap,*fg_tilemap; | |
| 14 | static int flipscreen; | |
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | 13 | /*************************************************************************** |
| 19 | 14 | |
| 20 | 15 | Convert the color PROMs into a more useable format. |
| r7500 | r7501 | |
| 46 | 41 | 200 ohm pulldown on all three components |
| 47 | 42 | |
| 48 | 43 | ***************************************************************************/ |
| 44 | ||
| 49 | 45 | PALETTE_INIT( mrdo ) |
| 50 | 46 | { |
| 51 | 47 | int i; |
| r7500 | r7501 | |
| 138 | 134 | |
| 139 | 135 | static TILE_GET_INFO( get_bg_tile_info ) |
| 140 | 136 | { |
| 141 | UINT8 attr = mrdo_bgvideoram[tile_index]; | |
| 137 | mrdo_state *state = (mrdo_state *)machine->driver_data; | |
| 138 | UINT8 attr = state->bgvideoram[tile_index]; | |
| 142 | 139 | SET_TILE_INFO( |
| 143 | 140 | 1, |
| 144 | | |
| 141 | state->bgvideoram[tile_index + 0x400] + ((attr & 0x80) << 1), | |
| 145 | 142 | attr & 0x3f, |
| 146 | 143 | (attr & 0x40) ? TILE_FORCE_LAYER0 : 0); |
| 147 | 144 | } |
| 148 | 145 | |
| 149 | 146 | static TILE_GET_INFO( get_fg_tile_info ) |
| 150 | 147 | { |
| 151 | UINT8 attr = mrdo_fgvideoram[tile_index]; | |
| 148 | mrdo_state *state = (mrdo_state *)machine->driver_data; | |
| 149 | UINT8 attr = state->fgvideoram[tile_index]; | |
| 152 | 150 | SET_TILE_INFO( |
| 153 | 151 | 0, |
| 154 | | |
| 152 | state->fgvideoram[tile_index+0x400] + ((attr & 0x80) << 1), | |
| 155 | 153 | attr & 0x3f, |
| 156 | 154 | (attr & 0x40) ? TILE_FORCE_LAYER0 : 0); |
| 157 | 155 | } |
| r7500 | r7501 | |
| 166 | 164 | |
| 167 | 165 | VIDEO_START( mrdo ) |
| 168 | 166 | { |
| 169 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 170 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 167 | mrdo_state *state = (mrdo_state *)machine->driver_data; | |
| 171 | 168 | |
| 172 | tilemap_set_transparent_pen(bg_tilemap,0); | |
| 173 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 169 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 170 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 174 | 171 | |
| 175 | tilemap_set_scrolldx(bg_tilemap, 0, 56); | |
| 176 | tilemap_set_scrolldx(fg_tilemap, 0, 56); | |
| 177 | tilemap_set_scrolldy(bg_tilemap, 0, 6); | |
| 178 | tilemap_set_scrolldy(fg_tilemap, 0, 6); | |
| 172 | tilemap_set_transparent_pen(state->bg_tilemap,0); | |
| 173 | tilemap_set_transparent_pen(state->fg_tilemap,0); | |
| 179 | 174 | |
| 180 | state_save_register_global(machine, flipscreen); | |
| 175 | tilemap_set_scrolldx(state->bg_tilemap, 0, 56); | |
| 176 | tilemap_set_scrolldx(state->fg_tilemap, 0, 56); | |
| 177 | tilemap_set_scrolldy(state->bg_tilemap, 0, 6); | |
| 178 | tilemap_set_scrolldy(state->fg_tilemap, 0, 6); | |
| 179 | ||
| 180 | state->flipscreen = 0; | |
| 181 | ||
| 182 | state_save_register_global(machine, state->flipscreen); | |
| 181 | 183 | } |
| 182 | 184 | |
| 183 | 185 | |
| r7500 | r7501 | |
| 190 | 192 | |
| 191 | 193 | WRITE8_HANDLER( mrdo_bgvideoram_w ) |
| 192 | 194 | { |
| 193 | mrdo_bgvideoram[offset] = data; | |
| 194 | tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff); | |
| 195 | mrdo_state *state = (mrdo_state *)space->machine->driver_data; | |
| 196 | state->bgvideoram[offset] = data; | |
| 197 | tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff); | |
| 195 | 198 | } |
| 196 | 199 | |
| 197 | 200 | WRITE8_HANDLER( mrdo_fgvideoram_w ) |
| 198 | 201 | { |
| 199 | mrdo_fgvideoram[offset] = data; | |
| 200 | tilemap_mark_tile_dirty(fg_tilemap,offset & 0x3ff); | |
| 202 | mrdo_state *state = (mrdo_state *)space->machine->driver_data; | |
| 203 | state->fgvideoram[offset] = data; | |
| 204 | tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff); | |
| 201 | 205 | } |
| 202 | 206 | |
| 203 | 207 | |
| 204 | 208 | WRITE8_HANDLER( mrdo_scrollx_w ) |
| 205 | 209 | { |
| 206 | tilemap_set_scrollx(bg_tilemap,0,data); | |
| 210 | mrdo_state *state = (mrdo_state *)space->machine->driver_data; | |
| 211 | tilemap_set_scrollx(state->bg_tilemap, 0, data); | |
| 207 | 212 | } |
| 208 | 213 | |
| 209 | 214 | WRITE8_HANDLER( mrdo_scrolly_w ) |
| 210 | 215 | { |
| 216 | mrdo_state *state = (mrdo_state *)space->machine->driver_data; | |
| 217 | ||
| 211 | 218 | /* This is NOT affected by flipscreen (so stop it happening) */ |
| 212 | ||
| 213 | if (flipscreen) tilemap_set_scrolly(bg_tilemap,0,((256-data) & 0xff)); | |
| 214 | else tilemap_set_scrolly(bg_tilemap,0,data); | |
| 219 | if (state->flipscreen) | |
| 220 | tilemap_set_scrolly(state->bg_tilemap, 0,((256 - data) & 0xff)); | |
| 221 | else | |
| 222 | tilemap_set_scrolly(state->bg_tilemap, 0, data); | |
| 215 | 223 | } |
| 216 | 224 | |
| 217 | 225 | |
| 218 | 226 | WRITE8_HANDLER( mrdo_flipscreen_w ) |
| 219 | 227 | { |
| 228 | mrdo_state *state = (mrdo_state *)space->machine->driver_data; | |
| 229 | ||
| 220 | 230 | /* bits 1-3 control the playfield priority, but they are not used by */ |
| 221 | 231 | /* Mr. Do! so we don't emulate them */ |
| 222 | 232 | |
| 223 | flipscreen = data & 0x01; | |
| 224 | tilemap_set_flip_all(space->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 233 | state->flipscreen = data & 0x01; | |
| 234 | tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 225 | 235 | } |
| 226 | 236 | |
| 227 | 237 | |
| r7500 | r7501 | |
| 232 | 242 | |
| 233 | 243 | ***************************************************************************/ |
| 234 | 244 | |
| 235 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 245 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect ) | |
| 236 | 246 | { |
| 237 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 247 | mrdo_state *state = (mrdo_state *)machine->driver_data; | |
| 248 | UINT8 *spriteram = state->spriteram; | |
| 238 | 249 | int offs; |
| 239 | 250 | |
| 240 | ||
| 241 | for (offs = machine->generic.spriteram_size - 4;offs >= 0;offs -= 4) | |
| 251 | for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4) | |
| 242 | 252 | { |
| 243 | 253 | if (spriteram[offs + 1] != 0) |
| 244 | 254 | { |
| 245 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 246 | spriteram[offs],spriteram[offs + 2] & 0x0f, | |
| 247 | spriteram[offs + 2] & 0x10,spriteram[offs + 2] & 0x20, | |
| 248 | spriteram[offs + 3],256 - spriteram[offs + 1],0); | |
| 255 | drawgfx_transpen(bitmap, cliprect, machine->gfx[2], | |
| 256 | spriteram[offs], spriteram[offs + 2] & 0x0f, | |
| 257 | spriteram[offs + 2] & 0x10, spriteram[offs + 2] & 0x20, | |
| 258 | spriteram[offs + 3], 256 - spriteram[offs + 1], 0); | |
| 249 | 259 | } |
| 250 | 260 | } |
| 251 | 261 | } |
| 252 | 262 | |
| 253 | 263 | VIDEO_UPDATE( mrdo ) |
| 254 | 264 | { |
| 255 | bitmap_fill(bitmap,cliprect,0); | |
| 256 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 257 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 258 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 265 | mrdo_state *state = (mrdo_state *)screen->machine->driver_data; | |
| 266 | ||
| 267 | bitmap_fill(bitmap, cliprect,0); | |
| 268 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 269 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 270 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 259 | 271 | return 0; |
| 260 | 272 | } |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "video/resnet.h" |
| 11 | #include "includes/megazone.h" | |
| 11 | 12 | |
| 12 | UINT8 *megazone_scrollx; | |
| 13 | UINT8 *megazone_scrolly; | |
| 14 | static int flipscreen; | |
| 15 | ||
| 16 | UINT8 *megazone_videoram; | |
| 17 | UINT8 *megazone_colorram; | |
| 18 | UINT8 *megazone_videoram2; | |
| 19 | UINT8 *megazone_colorram2; | |
| 20 | size_t megazone_videoram_size; | |
| 21 | size_t megazone_videoram2_size; | |
| 22 | ||
| 23 | 13 | /*************************************************************************** |
| 24 | 14 | Based on driver from MAME 0.55 |
| 25 | 15 | Changes by Martin M. (pfloyd@gmx.net) 14.10.2001: |
| r7500 | r7501 | |
| 45 | 35 | bit 0 -- 1 kohm resistor -- RED |
| 46 | 36 | |
| 47 | 37 | ***************************************************************************/ |
| 38 | ||
| 48 | 39 | PALETTE_INIT( megazone ) |
| 49 | 40 | { |
| 50 | 41 | static const int resistances_rg[3] = { 1000, 470, 220 }; |
| r7500 | r7501 | |
| 68 | 59 | int r, g, b; |
| 69 | 60 | |
| 70 | 61 | /* red component */ |
| 71 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 72 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 73 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 62 | bit0 = BIT(color_prom[i], 0); | |
| 63 | bit1 = BIT(color_prom[i], 1); | |
| 64 | bit2 = BIT(color_prom[i], 2); | |
| 74 | 65 | r = combine_3_weights(rweights, bit0, bit1, bit2); |
| 75 | 66 | |
| 76 | 67 | /* green component */ |
| 77 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 78 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 79 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 68 | bit0 = BIT(color_prom[i], 3); | |
| 69 | bit1 = BIT(color_prom[i], 4); | |
| 70 | bit2 = BIT(color_prom[i], 5); | |
| 80 | 71 | g = combine_3_weights(gweights, bit0, bit1, bit2); |
| 81 | 72 | |
| 82 | 73 | /* blue component */ |
| 83 | bit0 = (color_prom[i] >> 6) & 0x01; | |
| 84 | bit1 = (color_prom[i] >> 7) & 0x01; | |
| 74 | bit0 = BIT(color_prom[i], 6); | |
| 75 | bit1 = BIT(color_prom[i], 7); | |
| 85 | 76 | b = combine_2_weights(bweights, bit0, bit1); |
| 86 | 77 | |
| 87 | 78 | colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 107 | 98 | |
| 108 | 99 | WRITE8_HANDLER( megazone_flipscreen_w ) |
| 109 | 100 | { |
| 110 | flipscreen = data & 1; | |
| 101 | megazone_state *state = (megazone_state *)space->machine->driver_data; | |
| 102 | state->flipscreen = data & 1; | |
| 111 | 103 | } |
| 112 | 104 | |
| 113 | 105 | VIDEO_START( megazone ) |
| 114 | 106 | { |
| 115 | machine->generic.tmpbitmap = auto_bitmap_alloc(machine,256,256,video_screen_get_format(machine->primary_screen)); | |
| 107 | megazone_state *state = (megazone_state *)machine->driver_data; | |
| 108 | state->tmpbitmap = auto_bitmap_alloc(machine, 256, 256, video_screen_get_format(machine->primary_screen)); | |
| 109 | ||
| 110 | state_save_register_global_bitmap(machine, state->tmpbitmap); | |
| 116 | 111 | } |
| 117 | 112 | |
| 118 | 113 | |
| 119 | 114 | VIDEO_UPDATE( megazone ) |
| 120 | 115 | { |
| 116 | megazone_state *state = (megazone_state *)screen->machine->driver_data; | |
| 121 | 117 | int offs; |
| 122 | int x,y; | |
| 118 | int x, y; | |
| 123 | 119 | |
| 124 | 120 | /* for every character in the Video RAM */ |
| 125 | for (offs = | |
| 121 | for (offs = st | |
| 126 | 122 | { |
| 127 | int sx,sy,flipx,flipy; | |
| 123 | int sx, sy, flipx, flipy; | |
| 128 | 124 | |
| 129 | 125 | sx = offs % 32; |
| 130 | 126 | sy = offs / 32; |
| 131 | flipx = megazone_colorram[offs] & (1<<6); | |
| 132 | flipy = megazone_colorram[offs] & (1<<5); | |
| 133 | if (flipscreen) | |
| 127 | flipx = state->colorram[offs] & (1 << 6); | |
| 128 | flipy = state->colorram[offs] & (1 << 5); | |
| 129 | ||
| 130 | if (state->flipscreen) | |
| 134 | 131 | { |
| 135 | 132 | sx = 31 - sx; |
| 136 | 133 | sy = 31 - sy; |
| r7500 | r7501 | |
| 138 | 135 | flipy = !flipy; |
| 139 | 136 | } |
| 140 | 137 | |
| 141 | drawgfx_opaque(screen->machine->generic.tmpbitmap,0,screen->machine->gfx[1], | |
| 142 | ((int)megazone_videoram[offs]) + ((megazone_colorram[offs] & (1<<7) ? 256 : 0) ), | |
| 143 | (megazone_colorram[offs] & 0x0f) + 0x10, | |
| 138 | drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1], | |
| 139 | ((int)state->videoram[offs]) + ((state->colorram[offs] & (1 << 7) ? 256 : 0) ), | |
| 140 | (state->colorram[offs] & 0x0f) + 0x10, | |
| 144 | 141 | flipx,flipy, |
| 145 | 142 | 8*sx,8*sy); |
| 146 | 143 | } |
| r7500 | r7501 | |
| 150 | 147 | int scrollx; |
| 151 | 148 | int scrolly; |
| 152 | 149 | |
| 153 | if (flipscreen) | |
| 150 | if (state->flipscreen) | |
| 154 | 151 | { |
| 155 | scrollx = *megazone_scrolly; | |
| 156 | scrolly = *megazone_scrollx; | |
| 152 | scrollx = *state->scrolly; | |
| 153 | scrolly = *state->scrollx; | |
| 157 | 154 | } |
| 158 | 155 | else |
| 159 | 156 | { |
| 160 | scrollx = -*megazone_scrolly+4*8; // leave space for credit&score overlay | |
| 161 | scrolly = -*megazone_scrollx; | |
| 157 | scrollx = - *state->scrolly + 4 * 8; // leave space for credit&score overlay | |
| 158 | scrolly = - *state->scrollx; | |
| 162 | 159 | } |
| 163 | 160 | |
| 164 | 161 | |
| 165 | copyscrollbitmap(bitmap,s | |
| 162 | copyscrollbitmap(bitmap, st | |
| 166 | 163 | } |
| 167 | 164 | |
| 168 | 165 | |
| 169 | 166 | /* Draw the sprites. */ |
| 170 | 167 | { |
| 171 | UINT8 *spriteram = screen->machine->generic.spriteram.u8; | |
| 172 | for (offs = screen->machine->generic.spriteram_size-4; offs >= 0;offs -= 4) | |
| 168 | UINT8 *spriteram = state->spriteram; | |
| 169 | for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4) | |
| 173 | 170 | { |
| 174 | 171 | int sx = spriteram[offs + 3]; |
| 175 | int sy = 255-((spriteram[offs + 1]+16)&0xff); | |
| 172 | int sy = 255 - ((spriteram[offs + 1] + 16) & 0xff); | |
| 176 | 173 | int color = spriteram[offs + 0] & 0x0f; |
| 177 | 174 | int flipx = ~spriteram[offs + 0] & 0x40; |
| 178 | 175 | int flipy = spriteram[offs + 0] & 0x80; |
| 179 | 176 | |
| 180 | if (flipscreen) | |
| 177 | if (state->flipscreen) | |
| 181 | 178 | { |
| 182 | 179 | sx = sx - 11; |
| 183 | 180 | sy = sy + 2; |
| r7500 | r7501 | |
| 196 | 193 | |
| 197 | 194 | for (y = 0; y < 32;y++) |
| 198 | 195 | { |
| 199 | offs = y*32; | |
| 196 | offs = y * 32; | |
| 200 | 197 | for (x = 0; x < 6; x++) |
| 201 | 198 | { |
| 202 | int sx,sy,flipx,flipy; | |
| 199 | int sx, sy, flipx, flipy; | |
| 203 | 200 | |
| 204 | 201 | sx = x; |
| 205 | 202 | sy = y; |
| 206 | 203 | |
| 207 | flipx = megazone_colorram2[offs] & (1<<6); | |
| 208 | flipy = megazone_colorram2[offs] & (1<<5); | |
| 204 | flipx = state->colorram2[offs] & (1 << 6); | |
| 205 | flipy = state->colorram2[offs] & (1 << 5); | |
| 209 | 206 | |
| 210 | if (flipscreen) | |
| 207 | if (state->flipscreen) | |
| 211 | 208 | { |
| 212 | 209 | sx = 35 - sx; |
| 213 | 210 | sy = 31 - sy; |
| r7500 | r7501 | |
| 218 | 215 | |
| 219 | 216 | |
| 220 | 217 | |
| 221 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], | |
| 222 | ((int)megazone_videoram2[offs]) + ((megazone_colorram2[offs] & (1<<7) ? 256 : 0) ), | |
| 223 | (megazone_colorram2[offs] & 0x0f) + 0x10, | |
| 218 | drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], | |
| 219 | ((int)state->videoram2[offs]) + ((state->colorram2[offs] & (1 << 7) ? 256 : 0) ), | |
| 220 | (state->colorram2[offs] & 0x0f) + 0x10, | |
| 224 | 221 | flipx,flipy, |
| 225 | 222 | 8*sx,8*sy); |
| 226 | 223 | offs++; |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "includes/mrjong.h" | |
| 10 | 11 | |
| 11 | UINT8 *mrjong_videoram; | |
| 12 | UINT8 *mrjong_colorram; | |
| 13 | static tilemap_t *bg_tilemap; | |
| 14 | 12 | |
| 15 | 13 | /*************************************************************************** |
| 16 | 14 | |
| 17 | 15 | Convert the color PROMs. (from video/pengo.c) |
| 18 | 16 | |
| 19 | 17 | ***************************************************************************/ |
| 18 | ||
| 20 | 19 | PALETTE_INIT( mrjong ) |
| 21 | 20 | { |
| 22 | 21 | int i; |
| r7500 | r7501 | |
| 31 | 30 | int r, g, b; |
| 32 | 31 | |
| 33 | 32 | /* red component */ |
| 34 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 35 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 36 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 33 | bit0 = BIT(color_prom[i], 0); | |
| 34 | bit1 = BIT(color_prom[i], 1); | |
| 35 | bit2 = BIT(color_prom[i], 2); | |
| 37 | 36 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 38 | 37 | |
| 39 | 38 | /* green component */ |
| 40 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 41 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 42 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 39 | bit0 = BIT(color_prom[i], 3); | |
| 40 | bit1 = BIT(color_prom[i], 4); | |
| 41 | bit2 = BIT(color_prom[i], 5); | |
| 43 | 42 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 44 | 43 | |
| 45 | 44 | /* blue component */ |
| 46 | 45 | bit0 = 0; |
| 47 | bit1 = (color_prom[i] >> 6) & 0x01; | |
| 48 | bit2 = (color_prom[i] >> 7) & 0x01; | |
| 46 | bit1 = BIT(color_prom[i], 6); | |
| 47 | bit2 = BIT(color_prom[i], 7); | |
| 49 | 48 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 50 | 49 | |
| 51 | 50 | colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 68 | 67 | Display control parameter. |
| 69 | 68 | |
| 70 | 69 | ***************************************************************************/ |
| 70 | ||
| 71 | 71 | WRITE8_HANDLER( mrjong_videoram_w ) |
| 72 | 72 | { |
| 73 | mrjong_videoram[offset] = data; | |
| 74 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 73 | mrjong_state *state = (mrjong_state *)space->machine->driver_data; | |
| 74 | state->videoram[offset] = data; | |
| 75 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 75 | 76 | } |
| 76 | 77 | |
| 77 | 78 | WRITE8_HANDLER( mrjong_colorram_w ) |
| 78 | 79 | { |
| 79 | mrjong_colorram[offset] = data; | |
| 80 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 80 | mrjong_state *state = (mrjong_state *)space->machine->driver_data; | |
| 81 | state->colorram[offset] = data; | |
| 82 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 81 | 83 | } |
| 82 | 84 | |
| 83 | 85 | WRITE8_HANDLER( mrjong_flipscreen_w ) |
| 84 | 86 | { |
| 85 | if (flip_screen_get(space->machine) != (data | |
| 87 | if (flip_screen_get(space->machine) != BIT(data, 2 | |
| 86 | 88 | { |
| 87 | flip_screen_set(space->machine, data | |
| 89 | flip_screen_set(space->machine, BIT(data, 2) | |
| 88 | 90 | tilemap_mark_all_tiles_dirty_all(space->machine); |
| 89 | 91 | } |
| 90 | 92 | } |
| 91 | 93 | |
| 92 | 94 | static TILE_GET_INFO( get_bg_tile_info ) |
| 93 | 95 | { |
| 94 | int code = mrjong_videoram[tile_index] | ((mrjong_colorram[tile_index] & 0x20) << 3); | |
| 95 | int color = mrjong_colorram[tile_index] & 0x1f; | |
| 96 | int flags = ((mrjong_colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((mrjong_colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); | |
| 96 | mrjong_state *state = (mrjong_state *)machine->driver_data; | |
| 97 | int code = state->videoram[tile_index] | ((state->colorram[tile_index] & 0x20) << 3); | |
| 98 | int color = state->colorram[tile_index] & 0x1f; | |
| 99 | int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); | |
| 97 | 100 | |
| 98 | 101 | SET_TILE_INFO(0, code, color, flags); |
| 99 | 102 | } |
| 100 | 103 | |
| 101 | 104 | VIDEO_START( mrjong ) |
| 102 | 105 | { |
| 103 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32); | |
| 106 | mrjong_state *state = (mrjong_state *)machine->driver_data; | |
| 107 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32); | |
| 104 | 108 | } |
| 105 | 109 | |
| 106 | 110 | /* |
| 107 | 111 | Note: First 0x40 entries in the videoram are actually spriteram |
| 108 | 112 | */ |
| 109 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 113 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 110 | 114 | { |
| 115 | mrjong_state *state = (mrjong_state *)machine->driver_data; | |
| 111 | 116 | int offs; |
| 112 | 117 | |
| 113 | 118 | for (offs = (0x40 - 4); offs >= 0; offs -= 4) |
| r7500 | r7501 | |
| 117 | 122 | int sx, sy; |
| 118 | 123 | int flipx, flipy; |
| 119 | 124 | |
| 120 | sprt = (((mrjong_videoram[offs + 1] >> 2) & 0x3f) | ((mrjong_videoram[offs + 3] & 0x20) << 1)); | |
| 121 | flipx = (mrjong_videoram[offs + 1] & 0x01) >> 0; | |
| 122 | flipy = (mrjong_videoram[offs + 1] & 0x02) >> 1; | |
| 123 | color = (mrjong_videoram[offs + 3] & 0x1f); | |
| 125 | sprt = (((state->videoram[offs + 1] >> 2) & 0x3f) | ((state->videoram[offs + 3] & 0x20) << 1)); | |
| 126 | flipx = (state->videoram[offs + 1] & 0x01) >> 0; | |
| 127 | flipy = (state->videoram[offs + 1] & 0x02) >> 1; | |
| 128 | color = (state->videoram[offs + 3] & 0x1f); | |
| 124 | 129 | |
| 125 | sx = 224 - mrjong_videoram[offs + 2]; | |
| 126 | sy = mrjong_videoram[offs + 0]; | |
| 130 | sx = 224 - state->videoram[offs + 2]; | |
| 131 | sy = state->videoram[offs + 0]; | |
| 127 | 132 | if (flip_screen_get(machine)) |
| 128 | 133 | { |
| 129 | 134 | sx = 208 - sx; |
| r7500 | r7501 | |
| 142 | 147 | |
| 143 | 148 | VIDEO_UPDATE( mrjong ) |
| 144 | 149 | { |
| 145 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 150 | mrjong_state *state = (mrjong_state *)screen->machine->driver_data; | |
| 151 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 146 | 152 | draw_sprites(screen->machine, bitmap, cliprect); |
| 147 | 153 | return 0; |
| 148 | 154 | } |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "i | |
| 8 | #include "vi | |
| 9 | 9 | #include "includes/cninja.h" |
| 10 | 10 | |
| 11 | 11 | /******************************************************************************/ |
| 12 | 12 | |
| 13 | static int cninja_bank_callback(const int bank) | |
| 14 | { | |
| 15 | if ((bank>>4)&0xf) return 0x0000; /* Only 2 banks */ | |
| 16 | return 0x1000; | |
| 17 | } | |
| 18 | ||
| 19 | static int edrandy_bank_callback(const int bank) | |
| 20 | { | |
| 21 | if ((bank>>4)&0xf) return 0x0000; /* Only 2 banks */ | |
| 22 | return 0x1000; | |
| 23 | } | |
| 24 | ||
| 25 | static int robocop2_bank_callback(const int bank) | |
| 26 | { | |
| 27 | return (bank&0x30)<<8; | |
| 28 | } | |
| 29 | ||
| 30 | static int mutantf_1_bank_callback(const int bank) | |
| 31 | { | |
| 32 | return ((bank>>4)&0x3)<<12; | |
| 33 | } | |
| 34 | ||
| 35 | static int mutantf_2_bank_callback(const int bank) | |
| 36 | { | |
| 37 | return ((bank>>5)&0x1)<<14; | |
| 38 | } | |
| 39 | ||
| 40 | /******************************************************************************/ | |
| 41 | ||
| 42 | VIDEO_START( cninja ) | |
| 43 | { | |
| 44 | deco16_2_video_init(machine, 1); | |
| 45 | ||
| 46 | deco16_set_tilemap_bank_callback(2,cninja_bank_callback); | |
| 47 | deco16_set_tilemap_bank_callback(3,cninja_bank_callback); | |
| 48 | deco16_set_tilemap_colour_base(3,48); | |
| 49 | } | |
| 50 | ||
| 51 | 13 | VIDEO_START( stoneage ) |
| 52 | 14 | { |
| 53 | | |
| 15 | | |
| 54 | 16 | |
| 55 | deco16_set_tilemap_bank_callback(2,edrandy_bank_callback); | |
| 56 | deco16_set_tilemap_bank_callback(3,edrandy_bank_callback); | |
| 57 | deco16_set_tilemap_colour_base(3,48); | |
| 58 | ||
| 59 | 17 | /* The bootleg has broken scroll registers */ |
| 60 | tilemap_set_scrolldx(deco16_get_tilemap(3,0),-10,-10); | |
| 61 | tilemap_set_scrolldx(deco16_get_tilemap(1,0),-10,-10); | |
| 62 | tilemap_set_scrolldx(deco16_get_tilemap(0,1),2,2); | |
| 18 | deco16ic_set_scrolldx(state->deco16ic, 3, 0, -10, -10); /* pf4 16x16 tilemap */ | |
| 19 | deco16ic_set_scrolldx(state->deco16ic, 1, 0, -10, -10); /* pf2 16x16 tilemap */ | |
| 20 | deco16ic_set_scrolldx(state->deco16ic, 0, 1, 2, 2); /* pf1 8x8 tilemap */ | |
| 63 | 21 | } |
| 64 | 22 | |
| 65 | VIDEO_START( edrandy ) | |
| 66 | { | |
| 67 | deco16_2_video_init(machine, 0); | |
| 68 | ||
| 69 | deco16_set_tilemap_bank_callback(2,edrandy_bank_callback); | |
| 70 | deco16_set_tilemap_bank_callback(3,edrandy_bank_callback); | |
| 71 | deco16_set_tilemap_colour_base(3,48); | |
| 72 | } | |
| 73 | ||
| 74 | VIDEO_START( robocop2 ) | |
| 75 | { | |
| 76 | deco16_2_video_init(machine, 0); | |
| 77 | ||
| 78 | deco16_set_tilemap_bank_callback(1,robocop2_bank_callback); | |
| 79 | deco16_set_tilemap_bank_callback(2,robocop2_bank_callback); | |
| 80 | deco16_set_tilemap_bank_callback(3,robocop2_bank_callback); | |
| 81 | deco16_set_tilemap_colour_base(3,48); | |
| 82 | } | |
| 83 | ||
| 84 | VIDEO_START( mutantf ) | |
| 85 | { | |
| 86 | deco16_2_video_init(machine, 0); | |
| 87 | ||
| 88 | deco16_set_tilemap_bank_callback(0,mutantf_1_bank_callback); | |
| 89 | deco16_set_tilemap_bank_callback(1,mutantf_2_bank_callback); | |
| 90 | deco16_set_tilemap_bank_callback(2,mutantf_1_bank_callback); | |
| 91 | deco16_set_tilemap_bank_callback(3,mutantf_1_bank_callback); | |
| 92 | ||
| 93 | deco16_set_tilemap_colour_base(1,0x30); | |
| 94 | deco16_set_tilemap_colour_base(2,0x20); | |
| 95 | deco16_set_tilemap_colour_base(3,0x40); | |
| 96 | } | |
| 97 | ||
| 98 | 23 | /******************************************************************************/ |
| 99 | 24 | |
| 100 | /******************************************************************************/ | |
| 101 | ||
| 102 | static void cninja_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 25 | static void cninja_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 103 | 26 | { |
| 104 | UINT16 *buffered_spriteram | |
| 27 | UINT16 *buffered_spriteram | |
| 105 | 28 | int offs; |
| 106 | 29 | |
| 107 | for (offs = 0x400-4;offs >=0 ;offs -= 4) | |
| 30 | for (offs = 0x400 - 4; offs >=0 ; offs -= 4) | |
| 108 | 31 | { |
| 109 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0; | |
| 32 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0; | |
| 110 | 33 | |
| 111 | sprite = buffered_spriteram16[offs+1]; | |
| 112 | if (!sprite) continue; | |
| 34 | sprite = buffered_spriteram[offs + 1]; | |
| 35 | if (!sprite) | |
| 36 | continue; | |
| 113 | 37 | |
| 114 | x = buffered_spriteram | |
| 38 | x = buffered_spriteram | |
| 115 | 39 | |
| 116 | 40 | /* Sprite/playfield priority */ |
| 117 | switch (x&0xc000) { | |
| 118 | case 0x0000: pri=0; break; | |
| 119 | case 0x4000: pri=0xf0; break; | |
| 120 | case 0x8000: pri=0xf0|0xcc; break; | |
| 121 | case 0xc000: pri=0xf0|0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 41 | switch (x & 0xc000) | |
| 42 | { | |
| 43 | case 0x0000: pri = 0; break; | |
| 44 | case 0x4000: pri = 0xf0; break; | |
| 45 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 46 | case 0xc000: pri = 0xf0 | 0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 122 | 47 | } |
| 123 | 48 | |
| 124 | y = buffered_spriteram16[offs]; | |
| 125 | flash=y&0x1000; | |
| 126 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 127 | colour = (x >> 9) &0x1f; | |
| 49 | y = buffered_spriteram[offs]; | |
| 50 | flash = y & 0x1000; | |
| 51 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 52 | continue; | |
| 128 | 53 | |
| 54 | colour = (x >> 9) & 0x1f; | |
| 55 | ||
| 129 | 56 | fx = y & 0x2000; |
| 130 | 57 | fy = y & 0x4000; |
| 131 | 58 | multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ |
| r7500 | r7501 | |
| 146 | 73 | inc = 1; |
| 147 | 74 | } |
| 148 | 75 | |
| 149 | if (flip_screen_get(machine)) { | |
| 150 | y=240-y; | |
| 151 | x=240-x; | |
| 152 | if (fx) fx=0; else fx=1; | |
| 153 | if (fy) fy=0; else fy=1; | |
| 154 | mult=16; | |
| 76 | if (flip_screen_get(machine)) | |
| 77 | { | |
| 78 | y = 240 - y; | |
| 79 | x = 240 - x; | |
| 80 | if (fx) fx = 0; else fx = 1; | |
| 81 | if (fy) fy = 0; else fy = 1; | |
| 82 | mult = 16; | |
| 155 | 83 | } |
| 156 | else mult=-16; | |
| 84 | else | |
| 85 | mult = -16; | |
| 157 | 86 | |
| 158 | 87 | while (multi >= 0) |
| 159 | 88 | { |
| r7500 | r7501 | |
| 170 | 99 | } |
| 171 | 100 | |
| 172 | 101 | /* The bootleg sprites are in a different format! */ |
| 173 | static void cninjabl_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 102 | static void cninjabl_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 174 | 103 | { |
| 175 | UINT16 *buffered_spriteram | |
| 104 | UINT16 *buffered_spriteram | |
| 176 | 105 | int offs; |
| 177 | 106 | int endoffs; |
| 178 | 107 | |
| 179 | 108 | // bootleg seems to use 0x180 as an end of list marker |
| 180 | 109 | // find it first, so we can use normal list processing |
| 181 | endoffs = 0x400-4; | |
| 182 | for (offs = 0;offs <0x400-4 ;offs += 4) | |
| 110 | endoffs = 0x400 - 4; | |
| 111 | for (offs = 0; offs < 0x400 - 4 ; offs += 4) | |
| 183 | 112 | { |
| 184 | int y; | |
| 113 | int y = buffered_spriteram[offs + 1]; | |
| 185 | 114 | |
| 186 | y = buffered_spriteram16[offs+1]; | |
| 187 | ||
| 188 | if (y==0x180) | |
| 115 | if (y == 0x180) | |
| 189 | 116 | { |
| 190 | 117 | endoffs = offs; |
| 191 | offs = 0x400-4; | |
| 118 | offs = 0x400 - 4; | |
| 192 | 119 | } |
| 193 | 120 | } |
| 194 | 121 | |
| 195 | for (offs = endoffs;offs >=0 ;offs -= 4) | |
| 122 | for (offs = endoffs; offs >=0 ; offs -= 4) | |
| 196 | 123 | { |
| 197 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0; | |
| 124 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0; | |
| 198 | 125 | |
| 199 | sprite = buffered_spriteram16[offs+0]; // changed on bootleg! | |
| 200 | y = buffered_spriteram16[offs+1]; // changed on bootleg! | |
| 126 | sprite = buffered_spriteram[offs + 0]; // changed on bootleg! | |
| 127 | y = buffered_spriteram[offs + 1]; // changed on bootleg! | |
| 201 | 128 | |
| 202 | if (!sprite) continue; | |
| 129 | if (!sprite) | |
| 130 | continue; | |
| 203 | 131 | |
| 204 | x = buffered_spriteram | |
| 132 | x = buffered_spriteram | |
| 205 | 133 | |
| 206 | 134 | /* Sprite/playfield priority */ |
| 207 | switch (x&0xc000) { | |
| 208 | case 0x0000: pri=0; break; | |
| 209 | case 0x4000: pri=0xf0; break; | |
| 210 | case 0x8000: pri=0xf0|0xcc; break; | |
| 211 | case 0xc000: pri=0xf0|0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 135 | switch (x & 0xc000) | |
| 136 | { | |
| 137 | case 0x0000: pri = 0; break; | |
| 138 | case 0x4000: pri = 0xf0; break; | |
| 139 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 140 | case 0xc000: pri = 0xf0 | 0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 212 | 141 | } |
| 213 | 142 | |
| 143 | flash = y & 0x1000; | |
| 144 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 145 | continue; | |
| 214 | 146 | |
| 147 | colour = (x >> 9) & 0x1f; | |
| 215 | 148 | |
| 216 | flash=y&0x1000; | |
| 217 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 218 | ||
| 219 | colour = (x >> 9) &0x1f; | |
| 220 | ||
| 221 | ||
| 222 | 149 | fx = y & 0x2000; |
| 223 | 150 | fy = y & 0x4000; |
| 224 | 151 | |
| 225 | 152 | multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ |
| 226 | 153 | |
| 227 | y -= multi*16; // changed on bootleg! | |
| 154 | y -= multi * 16; // changed on bootleg! | |
| 228 | 155 | y += 4; |
| 229 | 156 | |
| 230 | 157 | x = x & 0x01ff; |
| r7500 | r7501 | |
| 243 | 170 | inc = 1; |
| 244 | 171 | } |
| 245 | 172 | |
| 246 | if (flip_screen_get(machine)) { | |
| 247 | y=240-y; | |
| 248 | x=240-x; | |
| 249 | if (fx) fx=0; else fx=1; | |
| 250 | if (fy) fy=0; else fy=1; | |
| 251 | mult=16; | |
| 173 | if (flip_screen_get(machine)) | |
| 174 | { | |
| 175 | y = 240 - y; | |
| 176 | x = 240 - x; | |
| 177 | if (fx) fx = 0; else fx = 1; | |
| 178 | if (fy) fy = 0; else fy = 1; | |
| 179 | mult = 16; | |
| 252 | 180 | } |
| 253 | else mult=-16; | |
| 181 | else | |
| 182 | mult = -16; | |
| 254 | 183 | |
| 255 | 184 | while (multi >= 0) |
| 256 | 185 | { |
| r7500 | r7501 | |
| 267 | 196 | } |
| 268 | 197 | |
| 269 | 198 | |
| 270 | static void robocop2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 199 | static void robocop2_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 271 | 200 | { |
| 272 | UINT16 *buffered_spriteram | |
| 201 | UINT16 *buffered_spriteram | |
| 273 | 202 | int offs; |
| 274 | 203 | |
| 275 | for (offs = 0x400-4;offs >=0 ;offs -= 4) | |
| 204 | for (offs = 0x400 - 4; offs >=0 ; offs -= 4) | |
| 276 | 205 | { |
| 277 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0; | |
| 278 | sprite = buffered_spriteram16[offs+1]; | |
| 279 | if (!sprite) continue; | |
| 206 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0; | |
| 207 | sprite = buffered_spriteram[offs + 1]; | |
| 208 | if (!sprite) | |
| 209 | continue; | |
| 280 | 210 | |
| 281 | x = buffered_spriteram | |
| 211 | x = buffered_spriteram | |
| 282 | 212 | |
| 283 | 213 | /* Sprite/playfield priority */ |
| 284 | switch (x&0xc000) { | |
| 285 | case 0x0000: pri=0; break; | |
| 286 | case 0x4000: pri=0xf0; break; | |
| 287 | case 0x8000: pri=0xf0|0xcc; break; | |
| 288 | case 0xc000: pri=0xf0|0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 214 | switch (x & 0xc000) | |
| 215 | { | |
| 216 | case 0x0000: pri = 0; break; | |
| 217 | case 0x4000: pri = 0xf0; break; | |
| 218 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 219 | case 0xc000: pri = 0xf0 | 0xcc; break; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ | |
| 289 | 220 | } |
| 290 | 221 | |
| 291 | y = buffered_spriteram16[offs]; | |
| 292 | flash=y&0x1000; | |
| 293 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 294 | colour = (x >> 9) &0x1f; | |
| 222 | y = buffered_spriteram[offs]; | |
| 223 | flash = y & 0x1000; | |
| 224 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 225 | continue; | |
| 226 | colour = (x >> 9) & 0x1f; | |
| 295 | 227 | |
| 296 | 228 | fx = y & 0x2000; |
| 297 | 229 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 313 | 245 | inc = 1; |
| 314 | 246 | } |
| 315 | 247 | |
| 316 | if (flip_screen_get(machine)) { | |
| 317 | y=240-y; | |
| 318 | x=304-x; | |
| 319 | if (fx) fx=0; else fx=1; | |
| 320 | if (fy) fy=0; else fy=1; | |
| 321 | mult=16; | |
| 248 | if (flip_screen_get(machine)) | |
| 249 | { | |
| 250 | y = 240 - y; | |
| 251 | x = 304 - x; | |
| 252 | if (fx) fx = 0; else fx = 1; | |
| 253 | if (fy) fy = 0; else fy = 1; | |
| 254 | mult = 16; | |
| 322 | 255 | } |
| 323 | else mult=-16; | |
| 256 | else | |
| 257 | mult = -16; | |
| 324 | 258 | |
| 325 | 259 | while (multi >= 0) |
| 326 | 260 | { |
| r7500 | r7501 | |
| 336 | 270 | } |
| 337 | 271 | } |
| 338 | 272 | |
| 339 | static void mutantf_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank) | |
| 273 | static void mutantf_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank ) | |
| 340 | 274 | { |
| 341 | int offs,end,inc; | |
| 275 | int offs, end, inc; | |
| 342 | 276 | |
| 343 | 277 | /* |
| 344 | 278 | Alternate format from most 16 bit games - same as Captain America |
| r7500 | r7501 | |
| 361 | 295 | |
| 362 | 296 | /* This may look strange, but the alpha-blended sprite chip definitely draws end to |
| 363 | 297 | front, ie, reversed from normal pdrawgfx style. */ |
| 364 | if (gfxbank==4) { | |
| 365 | offs=0; | |
| 366 | end=0x400; | |
| 367 | inc=4; | |
| 368 | } else { | |
| 369 | offs=0x3fc; | |
| 370 | end=-4; | |
| 371 | inc=-4; | |
| 298 | if (gfxbank == 4) | |
| 299 | { | |
| 300 | offs = 0; | |
| 301 | end = 0x400; | |
| 302 | inc = 4; | |
| 372 | 303 | } |
| 304 | else | |
| 305 | { | |
| 306 | offs = 0x3fc; | |
| 307 | end = -4; | |
| 308 | inc = -4; | |
| 309 | } | |
| 373 | 310 | |
| 374 | while (offs!=end) | |
| 311 | while (offs != end) | |
| 375 | 312 | { |
| 376 | int x,y,sprite,colour,fx,fy,w,h,sx,sy,x_mult,y_mult; | |
| 377 | int alpha=0xff; | |
| 313 | int x, y, sprite, colour, fx, fy, w, h, sx, sy, x_mult, y_mult; | |
| 314 | int alpha = 0xff; | |
| 378 | 315 | |
| 379 | sprite = spriteptr[offs+3]; | |
| 380 | if (!sprite) { | |
| 381 | offs+=inc; | |
| 316 | sprite = spriteptr[offs + 3]; | |
| 317 | if (!sprite) | |
| 318 | { | |
| 319 | offs += inc; | |
| 382 | 320 | continue; |
| 383 | 321 | } |
| 384 | 322 | |
| 385 | sx = spriteptr[offs+1]; | |
| 323 | sx = spriteptr[offs + 1]; | |
| 386 | 324 | |
| 387 | h = (spriteptr[offs+2]&0xf000)>>12; | |
| 388 | w = (spriteptr[offs+2]&0x0f00)>> 8; | |
| 325 | h = (spriteptr[offs + 2] & 0xf000) >> 12; | |
| 326 | w = (spriteptr[offs + 2] & 0x0f00) >> 8; | |
| 389 | 327 | |
| 390 | 328 | sy = spriteptr[offs]; |
| 391 | if ((sy&0x2000) && (video_screen_get_frame_number(machine->primary_screen) & 1)) { | |
| 392 | offs+=inc; | |
| 329 | if ((sy & 0x2000) && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 330 | { | |
| 331 | offs += inc; | |
| 393 | 332 | continue; |
| 394 | 333 | } |
| 395 | 334 | |
| 396 | colour = (spriteptr[offs+2] >>0) & 0x1f; | |
| 335 | colour = (spriteptr[offs + 2] >> 0) & 0x1f; | |
| 397 | 336 | |
| 398 | if (gfxbank==4) { /* Seems to be always alpha'd */ | |
| 399 | alpha=0x80; | |
| 400 | colour&=0xf; | |
| 337 | if (gfxbank == 4) | |
| 338 | { /* Seems to be always alpha'd */ | |
| 339 | alpha = 0x80; | |
| 340 | colour &= 0xf; | |
| 401 | 341 | } |
| 402 | 342 | |
| 403 | fx = (spriteptr[offs+0]&0x4000); | |
| 404 | fy = (spriteptr[offs+0]&0x8000); | |
| 343 | fx = (spriteptr[offs + 0] & 0x4000); | |
| 344 | fy = (spriteptr[offs + 0] & 0x8000); | |
| 405 | 345 | |
| 406 | if (flip_screen_get(machine)) { | |
| 407 | if (fx) fx=0; else fx=1; | |
| 408 | if (fy) fy=0; else fy=1; | |
| 346 | if (flip_screen_get(machine)) | |
| 347 | { | |
| 348 | if (fx) fx = 0; else fx = 1; | |
| 349 | if (fy) fy = 0; else fy = 1; | |
| 409 | 350 | |
| 410 | 351 | sx = sx & 0x01ff; |
| 411 | 352 | sy = sy & 0x01ff; |
| 412 | if (sx>0x180) sx=-(0x200 - sx); | |
| 413 | if (sy>0x180) sy=-(0x200 - sy); | |
| 353 | if (sx > 0x180) sx = -(0x200 - sx); | |
| 354 | if (sy > 0x180) sy = -(0x200 - sy); | |
| 414 | 355 | |
| 415 | if (fx) { x_mult=-16; sx+=16*w; } else { x_mult=16; sx-=16; } | |
| 416 | if (fy) { y_mult=-16; sy+=16*h; } else { y_mult=16; sy-=16; } | |
| 417 | } else { | |
| 356 | if (fx) { x_mult = -16; sx += 16 * w; } else { x_mult = 16; sx -= 16; } | |
| 357 | if (fy) { y_mult = -16; sy += 16 * h; } else { y_mult = 16; sy -= 16; } | |
| 358 | } | |
| 359 | else | |
| 360 | { | |
| 418 | 361 | sx = sx & 0x01ff; |
| 419 | 362 | sy = sy & 0x01ff; |
| 420 | if (sx&0x100) sx=-(0x100 - (sx&0xff)); | |
| 421 | if (sy&0x100) sy=-(0x100 - (sy&0xff)); | |
| 363 | if (sx & 0x100) sx = -(0x100 - (sx & 0xff)); | |
| 364 | if (sy & 0x100) sy = -(0x100 - (sy & 0xff)); | |
| 422 | 365 | sx = 304 - sx; |
| 423 | 366 | sy = 240 - sy; |
| 424 | 367 | if (sx >= 432) sx -= 512; |
| 425 | 368 | if (sy >= 384) sy -= 512; |
| 426 | if (fx) { x_mult=-16; sx+=16; } else { x_mult=16; sx-=16*w; } | |
| 427 | if (fy) { y_mult=-16; sy+=16; } else { y_mult=16; sy-=16*h; } | |
| 369 | if (fx) { x_mult = -16; sx += 16; } else { x_mult = 16; sx -= 16*w; } | |
| 370 | if (fy) { y_mult = -16; sy += 16; } else { y_mult = 16; sy -= 16*h; } | |
| 428 | 371 | } |
| 429 | 372 | |
| 430 | for (x=0; x<w; x++) { | |
| 431 | for (y=0; y<h; y++) { | |
| 373 | for (x = 0; x < w; x++) | |
| 374 | { | |
| 375 | for (y = 0; y < h; y++) | |
| 376 | { | |
| 432 | 377 | pdrawgfx_alpha(bitmap,cliprect,machine->gfx[gfxbank], |
| 433 | 378 | sprite + y + h * x, |
| 434 | 379 | colour, |
| r7500 | r7501 | |
| 438 | 383 | 0,alpha); |
| 439 | 384 | } |
| 440 | 385 | } |
| 441 | ||
| 442 | offs+=inc; | |
| 386 | offs += inc; | |
| 443 | 387 | } |
| 444 | 388 | } |
| 445 | 389 | |
| r7500 | r7501 | |
| 447 | 391 | |
| 448 | 392 | VIDEO_UPDATE( cninja ) |
| 449 | 393 | { |
| 450 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 451 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 452 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 394 | cninja_state *state = (cninja_state *)screen->machine->driver_data; | |
| 395 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 453 | 396 | |
| 397 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 398 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 399 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 400 | ||
| 454 | 401 | /* Draw playfields */ |
| 455 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 456 | bitmap_fill(bitmap,cliprect,512); | |
| 457 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 458 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 459 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER1,2); | |
| 460 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0,4); | |
| 461 | cninja_draw_sprites(screen->machine,bitmap,cliprect); | |
| 462 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 402 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 403 | bitmap_fill(bitmap, cliprect, 512); | |
| 404 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 405 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 406 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); | |
| 407 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); | |
| 408 | cninja_draw_sprites(screen->machine, bitmap, cliprect); | |
| 409 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 463 | 410 | return 0; |
| 464 | 411 | } |
| 465 | 412 | |
| 466 | 413 | VIDEO_UPDATE( cninjabl ) |
| 467 | 414 | { |
| 468 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 469 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 470 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 415 | cninja_state *state = (cninja_state *)screen->machine->driver_data; | |
| 416 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 471 | 417 | |
| 418 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 419 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 420 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 421 | ||
| 472 | 422 | /* Draw playfields */ |
| 473 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 474 | bitmap_fill(bitmap,cliprect,512); | |
| 475 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 476 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 477 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER1,2); | |
| 478 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0,4); | |
| 479 | cninjabl_draw_sprites(screen->machine,bitmap,cliprect); | |
| 480 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 423 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 424 | bitmap_fill(bitmap, cliprect, 512); | |
| 425 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 426 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 427 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); | |
| 428 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); | |
| 429 | cninjabl_draw_sprites(screen->machine, bitmap, cliprect); | |
| 430 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 481 | 431 | return 0; |
| 482 | 432 | } |
| 483 | 433 | |
| 484 | 434 | VIDEO_UPDATE( edrandy ) |
| 485 | 435 | { |
| 486 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 487 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 488 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 436 | cninja_state *state = (cninja_state *)screen->machine->driver_data; | |
| 437 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 489 | 438 | |
| 490 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 491 | bitmap_fill(bitmap,cliprect,0); | |
| 492 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 493 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 494 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,4); | |
| 495 | cninja_draw_sprites(screen->machine,bitmap,cliprect); | |
| 496 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 439 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 440 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 441 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 442 | ||
| 443 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 444 | bitmap_fill(bitmap, cliprect, 0); | |
| 445 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 446 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 447 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 448 | cninja_draw_sprites(screen->machine, bitmap, cliprect); | |
| 449 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 497 | 450 | return 0; |
| 498 | 451 | } |
| 499 | 452 | |
| 500 | 453 | VIDEO_UPDATE( robocop2 ) |
| 501 | 454 | { |
| 455 | cninja_state *state = (cninja_state *)screen->machine->driver_data; | |
| 456 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 457 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 458 | ||
| 502 | 459 | /* One of the tilemap chips can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */ |
| 503 | if (deco16_priority&4) { | |
| 504 | deco16_set_tilemap_colour_mask(2,0); | |
| 505 | deco16_set_tilemap_colour_mask(3,0); | |
| 506 | deco16_pf34_set_gfxbank(0,4); | |
| 507 | } else { | |
| 508 | deco16_set_tilemap_colour_mask(2,0xf); | |
| 509 | deco16_set_tilemap_colour_mask(3,0xf); | |
| 510 | deco16_pf34_set_gfxbank(0,2); | |
| 460 | if (priority & 4) | |
| 461 | { | |
| 462 | deco16ic_set_tilemap_colour_mask(state->deco16ic, 2, 0); | |
| 463 | deco16ic_set_tilemap_colour_mask(state->deco16ic, 3, 0); | |
| 464 | deco16ic_pf34_set_gfxbank(state->deco16ic, 0, 4); | |
| 511 | 465 | } |
| 466 | else | |
| 467 | { | |
| 468 | deco16ic_set_tilemap_colour_mask(state->deco16ic, 2, 0xf); | |
| 469 | deco16ic_set_tilemap_colour_mask(state->deco16ic, 3, 0xf); | |
| 470 | deco16ic_pf34_set_gfxbank(state->deco16ic, 0, 2); | |
| 471 | } | |
| 512 | 472 | |
| 513 | 473 | /* Update playfields */ |
| 514 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 515 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 516 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 474 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 475 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 476 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 517 | 477 | |
| 518 | 478 | /* Draw playfields */ |
| 519 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 520 | bitmap_fill(bitmap,cliprect,0x200); | |
| 521 | if ((deco16_priority&4)==0) | |
| 522 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1); | |
| 479 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 480 | bitmap_fill(bitmap, cliprect, 0x200); | |
| 523 | 481 | |
| 482 | if ((priority & 4) == 0) | |
| 483 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); | |
| 484 | ||
| 524 | 485 | /* Switchable priority */ |
| 525 | switch (deco16_priority&0x8) { | |
| 486 | switch (priority & 0x8) | |
| 487 | { | |
| 526 | 488 | case 8: |
| 527 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 528 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,4); | |
| 489 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 490 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 529 | 491 | break; |
| 530 | 492 | default: |
| 531 | 493 | case 0: |
| 532 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 533 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,4); | |
| 494 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 495 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 534 | 496 | break; |
| 535 | 497 | } |
| 536 | 498 | |
| 537 | robocop2_draw_sprites(screen->machine,bitmap,cliprect); | |
| 538 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 499 | robocop2_draw_sprites(screen->machine, bitmap, cliprect); | |
| 500 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 539 | 501 | return 0; |
| 540 | 502 | } |
| 541 | 503 | |
| 542 | 504 | VIDEO_UPDATE( mutantf ) |
| 543 | 505 | { |
| 544 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 545 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 546 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 506 | cninja_state *state = (cninja_state *)screen->machine->driver_data; | |
| 507 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 508 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 547 | 509 | |
| 510 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 511 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 512 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 513 | ||
| 548 | 514 | /* Draw playfields */ |
| 549 | bitmap_fill(bitmap,cliprect,0x400); /* Confirmed */ | |
| 515 | bitmap_fill(bitmap, cliprect, 0x400); /* Confirmed */ | |
| 550 | 516 | |
| 551 | 517 | /* There is no priority prom on this board, but there is a |
| 552 | 518 | priority control word, the only values used in game appear |
| r7500 | r7501 | |
| 559 | 525 | The other bits may control alpha blend on the 2nd sprite chip, or |
| 560 | 526 | layer order. |
| 561 | 527 | */ |
| 562 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 563 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 564 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,0); | |
| 528 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 529 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 530 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 565 | 531 | |
| 566 | 532 | /* We need to abuse the priority bitmap a little by clearing it before |
| 567 | 533 | drawing each sprite layer. This is because there is no priority |
| r7500 | r7501 | |
| 569 | 535 | priority between sprites in each layer. Ie, if we didn't do this, |
| 570 | 536 | then when two alpha blended shadows overlapped then they would be 25% |
| 571 | 537 | transparent against the background, rather than 50% */ |
| 572 | if (deco16_priority&1) { | |
| 573 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 574 | mutantf_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,3); | |
| 575 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 576 | mutantf_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram2.u16,4); | |
| 577 | } else { | |
| 578 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 579 | mutantf_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram2.u16,4); | |
| 580 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 581 | mutantf_draw_sprites(screen->machine,bitmap,cliprect,screen->machine->generic.buffered_spriteram.u16,3); | |
| 538 | if (priority & 1) | |
| 539 | { | |
| 540 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 541 | mutantf_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3); | |
| 542 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 543 | mutantf_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4); | |
| 582 | 544 | } |
| 583 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 545 | else | |
| 546 | { | |
| 547 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 548 | mutantf_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4); | |
| 549 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 550 | mutantf_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3); | |
| 551 | } | |
| 552 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 584 | 553 | return 0; |
| 585 | 554 | } |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "emu.h" |
| 17 | #include "includes/deco16ic.h" | |
| 17 | #include "video/deco16ic.h" | |
| 18 | #include "includes/tumblep.h" | |
| 18 | 19 | |
| 19 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 20 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 20 | 21 | { |
| 21 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 22 | tumblep_state *state = (tumblep_state *)machine->driver_data; | |
| 23 | UINT16 *spriteram = state->spriteram; | |
| 22 | 24 | int offs; |
| 23 | 25 | |
| 24 | for (offs = 0;offs < 0x400;offs += 4) | |
| 26 | for (offs = 0; offs < 0x400; offs += 4) | |
| 25 | 27 | { |
| 26 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 28 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 27 | 29 | |
| 28 | sprite = spriteram16[offs+1]; | |
| 29 | if (!sprite) continue; | |
| 30 | sprite = spriteram[offs + 1]; | |
| 31 | if (!sprite) | |
| 32 | continue; | |
| 30 | 33 | |
| 31 | y = spriteram16[offs]; | |
| 32 | flash=y&0x1000; | |
| 33 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 34 | y = spriteram[offs]; | |
| 35 | flash = y & 0x1000; | |
| 36 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 37 | continue; | |
| 34 | 38 | |
| 35 | x = spriteram16[offs+2]; | |
| 36 | colour = (x >>9) & 0x1f; | |
| 39 | x = spriteram[offs + 2]; | |
| 40 | colour = (x >> 9) & 0x1f; | |
| 37 | 41 | |
| 38 | 42 | fx = y & 0x2000; |
| 39 | 43 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 44 | 48 | if (x >= 320) x -= 512; |
| 45 | 49 | if (y >= 256) y -= 512; |
| 46 | 50 | y = 240 - y; |
| 47 | ||
| 51 | | |
| 48 | 52 | |
| 49 | if (x>320) continue; | |
| 53 | if (x > 320) continue; | |
| 50 | 54 | |
| 51 | 55 | sprite &= ~multi; |
| 52 | 56 | if (fy) |
| r7500 | r7501 | |
| 59 | 63 | |
| 60 | 64 | if (flip_screen_get(machine)) |
| 61 | 65 | { |
| 62 | y=240-y; | |
| 63 | x=304-x; | |
| 64 | if (fx) fx=0; else fx=1; | |
| 65 | if (fy) fy=0; else fy=1; | |
| 66 | mult=16; | |
| 66 | y = 240 - y; | |
| 67 | x = 304 - x; | |
| 68 | if (fx) fx = 0; else fx = 1; | |
| 69 | if (fy) fy = 0; else fy = 1; | |
| 70 | mult = 16; | |
| 67 | 71 | } |
| 68 | else mult=-16; | |
| 72 | else mult = -16; | |
| 69 | 73 | |
| 70 | 74 | while (multi >= 0) |
| 71 | 75 | { |
| r7500 | r7501 | |
| 80 | 84 | } |
| 81 | 85 | } |
| 82 | 86 | |
| 83 | VIDEO_ | |
| 87 | VIDEO_UPDA | |
| 84 | 88 | { |
| 85 | deco16_1_video_init(machine); | |
| 86 | } | |
| 89 | tumblep_state *state = (tumblep_state *)screen->machine->driver_data; | |
| 90 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 87 | 91 | |
| 88 | VIDEO_UPDATE(tumblep) | |
| 89 | { | |
| 90 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 91 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 92 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 93 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 92 | 94 | |
| 93 | bitmap_fill(bitmap,cliprect,256); /* not verified */ | |
| 95 | bitmap_fill(bitmap, cliprect, 256); /* not verified */ | |
| 94 | 96 | |
| 95 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 96 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 97 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 98 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 97 | 99 | |
| 98 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 100 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 99 | 101 | return 0; |
| 100 | 102 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/deco16ic.h" | |
| 2 | #include "video/deco16ic.h" | |
| 3 | #include "includes/dietgo.h" | |
| 3 | 4 | |
| 4 | static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 5 | ||
| 6 | static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 5 | 7 | { |
| 6 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 8 | dietgo_state *state = (dietgo_state *)machine->driver_data; | |
| 9 | UINT16 *spriteram = state->spriteram; | |
| 7 | 10 | int offs; |
| 8 | 11 | |
| 9 | for (offs = 0;offs < 0x400;offs += 4) | |
| 12 | for (offs = 0; offs < 0x400; offs += 4) | |
| 10 | 13 | { |
| 11 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 14 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 12 | 15 | |
| 13 | sprite = spriteram16[offs+1]; | |
| 14 | if (!sprite) continue; | |
| 16 | sprite = spriteram[offs + 1]; | |
| 17 | if (!sprite) | |
| 18 | continue; | |
| 15 | 19 | |
| 16 | y = spriteram16[offs]; | |
| 17 | flash=y&0x1000; | |
| 18 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 20 | y = spriteram[offs]; | |
| 21 | flash = y & 0x1000; | |
| 22 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 23 | continue; | |
| 19 | 24 | |
| 20 | x = spriteram16[offs+2]; | |
| 21 | colour = (x >>9) & 0x1f; | |
| 25 | x = spriteram[offs + 2]; | |
| 26 | colour = (x >> 9) & 0x1f; | |
| 22 | 27 | |
| 23 | 28 | fx = y & 0x2000; |
| 24 | 29 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 29 | 34 | if (x >= 320) x -= 512; |
| 30 | 35 | if (y >= 256) y -= 512; |
| 31 | 36 | y = 240 - y; |
| 32 | ||
| 37 | | |
| 33 | 38 | |
| 34 | if (x>320) continue; | |
| 39 | if (x > 320) | |
| 40 | continue; | |
| 35 | 41 | |
| 36 | 42 | sprite &= ~multi; |
| 37 | 43 | if (fy) |
| r7500 | r7501 | |
| 44 | 50 | |
| 45 | 51 | if (flip_screen_get(machine)) |
| 46 | 52 | { |
| 47 | y=240-y; | |
| 48 | x=304-x; | |
| 49 | if (fx) fx=0; else fx=1; | |
| 50 | if (fy) fy=0; else fy=1; | |
| 51 | mult=16; | |
| 53 | y = 240 - y; | |
| 54 | x = 304 - x; | |
| 55 | if (fx) fx = 0; else fx = 1; | |
| 56 | if (fy) fy = 0; else fy = 1; | |
| 57 | mult = 16; | |
| 52 | 58 | } |
| 53 | else mult=-16; | |
| 59 | else mult = -16; | |
| 54 | 60 | |
| 55 | 61 | while (multi >= 0) |
| 56 | 62 | { |
| r7500 | r7501 | |
| 65 | 71 | } |
| 66 | 72 | } |
| 67 | 73 | |
| 68 | static int dietgo_bank_callback(const int bank) | |
| 69 | { | |
| 70 | return ((bank>>4)&0x7) * 0x1000; | |
| 71 | } | |
| 72 | 74 | |
| 73 | VIDEO_ | |
| 75 | VIDEO_UPDA | |
| 74 | 76 | { |
| 75 | deco16_1_video_init(machine); | |
| 77 | dietgo_state *state = (dietgo_state *)screen->machine->driver_data; | |
| 78 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 76 | 79 | |
| 77 | deco16_set_tilemap_bank_callback(0, dietgo_bank_callback); | |
| 78 | deco16_set_tilemap_bank_callback(1, dietgo_bank_callback); | |
| 79 | } | |
| 80 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 81 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 80 | 82 | |
| 81 | VIDEO_UPDATE(dietgo) | |
| 82 | { | |
| 83 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 84 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 83 | bitmap_fill(bitmap, cliprect, 256); /* not verified */ | |
| 85 | 84 | |
| 86 | bitmap_fill(bitmap,cliprect,256); /* not verified */ | |
| 85 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 86 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 87 | 87 | |
| 88 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 89 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 90 | ||
| 91 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 88 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 92 | 89 | return 0; |
| 93 | 90 | } |
| r7500 | r7501 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | static void vg_flush (running_machine *machine) |
| 175 | 175 | { |
| 176 | int i; | |
| 176 | int i = 0; | |
| 177 | 177 | |
| 178 | while (vectbuf[i].status == VGCLIP) | |
| 179 | i++; | |
| 180 | vector_add_point(machine, vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, 0); | |
| 181 | ||
| 178 | 182 | for (i = 0; i < nvect; i++) |
| 179 | 183 | { |
| 180 | 184 | if (vectbuf[i].status == VGVECTOR) |
| r7500 | r7501 | |
| 1131 | 1135 | vg->sp = 0; |
| 1132 | 1136 | } |
| 1133 | 1137 | |
| 1138 | static void tempest_vggo(vgdata *vg) | |
| 1139 | { | |
| 1140 | vg->pc = 0; | |
| 1141 | vg->sp = 0; | |
| 1142 | /* | |
| 1143 | * Tempest and Quantum trigger VGGO from time to time even though | |
| 1144 | * the VG runs in an endless loop for these games (see | |
| 1145 | * avg_common_strobe2). If we don't discard all vectors in the | |
| 1146 | * current buffer at this point, the screen starts flickering. | |
| 1147 | */ | |
| 1148 | nvect = 0; | |
| 1149 | } | |
| 1150 | ||
| 1134 | 1151 | static void dvg_vggo(vgdata *vg) |
| 1135 | 1152 | { |
| 1136 | 1153 | vg->dvy = 0; |
| r7500 | r7501 | |
| 1221 | 1238 | * |
| 1222 | 1239 | ************************************/ |
| 1223 | 1240 | |
| 1224 | #ifdef UNUSED_FUNCTION | |
| 1225 | int avgdvg_done(void) | |
| 1226 | { | |
| 1227 | return vg->sync_halt; | |
| 1228 | } | |
| 1229 | #endif | |
| 1230 | ||
| 1231 | 1241 | CUSTOM_INPUT( avgdvg_done_r ) |
| 1232 | 1242 | { |
| 1233 | 1243 | return vg->sync_halt ? 0x01 : 0x00; |
| r7500 | r7501 | |
| 1235 | 1245 | |
| 1236 | 1246 | WRITE8_HANDLER( avgdvg_go_w ) |
| 1237 | 1247 | { |
| 1248 | vgc->vggo(vg); | |
| 1249 | ||
| 1238 | 1250 | if (vg->sync_halt && (nvect > 10)) |
| 1239 | 1251 | { |
| 1240 | 1252 | /* |
| r7500 | r7501 | |
| 1246 | 1258 | } |
| 1247 | 1259 | vg_flush(space->machine); |
| 1248 | 1260 | |
| 1249 | vgc->vggo(vg); | |
| 1250 | 1261 | vg_set_halt(0); |
| 1251 | 1262 | timer_adjust_oneshot(vg_run_timer, attotime_zero, 0); |
| 1252 | 1263 | } |
| r7500 | r7501 | |
| 1372 | 1383 | }, |
| 1373 | 1384 | avg_state_addr, |
| 1374 | 1385 | avg_data, |
| 1375 | | |
| 1386 | tempest_vggo, | |
| 1376 | 1387 | avg_vgrst |
| 1377 | 1388 | }; |
| 1378 | 1389 | |
| r7500 | r7501 | |
| 1408 | 1419 | }, |
| 1409 | 1420 | avg_state_addr, |
| 1410 | 1421 | quantum_data, |
| 1411 | | |
| 1422 | tempest_vggo, | |
| 1412 | 1423 | avg_vgrst |
| 1413 | 1424 | }; |
| 1414 | 1425 |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "includes/deco16ic.h" | |
| 8 | #include "video/deco16ic.h" | |
| 9 | #include "includes/dassault.h" | |
| 9 | 10 | |
| 10 | 11 | /******************************************************************************/ |
| 11 | 12 | |
| 12 | static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int pf_priority) | |
| 13 | static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int pf_priority ) | |
| 13 | 14 | { |
| 14 | UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16; | |
| 15 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 15 | dassault_state *state = (dassault_state *)machine->driver_data; | |
| 16 | UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16; | |
| 17 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 16 | 18 | int offs, bank, gfxbank; |
| 17 | 19 | const UINT16 *spritebase; |
| 18 | 20 | |
| 19 | 21 | /* Have to loop over the two sprite sources */ |
| 20 | for (bank=0; bank<2; bank++) | |
| 22 | for (bank = 0; bank < 2; bank++) | |
| 21 | 23 | { |
| 22 | for (offs = 0x800-4;offs >= 0; offs -= 4) | |
| 24 | for (offs = 0x800 - 4; offs >= 0; offs -= 4) | |
| 23 | 25 | { |
| 24 | int alpha=0xff, pmask=0; | |
| 26 | int alpha = 0xff, pmask = 0; | |
| 25 | 27 | |
| 26 | 28 | /* Draw the main spritebank after the other one */ |
| 27 | if (bank==0) | |
| 29 | if (bank == 0) | |
| 28 | 30 | { |
| 29 | spritebase=buffered_spriteram16; | |
| 30 | gfxbank=3; | |
| 31 | spritebase = buffered_spriteram; | |
| 32 | gfxbank = 3; | |
| 31 | 33 | } |
| 32 | 34 | else |
| 33 | 35 | { |
| 34 | spritebase=machine->generic.buffered_spriteram2.u16; | |
| 35 | gfxbank=4; | |
| 36 | spritebase = machine->generic.buffered_spriteram2.u16; | |
| 37 | gfxbank = 4; | |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | sprite = spritebase[offs+1] & 0x7fff; | |
| 39 | if (!sprite) continue; | |
| 40 | sprite = spritebase[offs + 1] & 0x7fff; | |
| 41 | if (!sprite) | |
| 42 | continue; | |
| 40 | 43 | |
| 41 | x = spritebase[offs+2]; | |
| 44 | x = spritebase[offs + 2]; | |
| 42 | 45 | |
| 43 | 46 | /* Alpha on chip 2 only */ |
| 44 | if (bank==1 && x&0xc000) | |
| 45 | alpha=0x80; | |
| 47 | if (bank == 1 && x & 0xc000) | |
| 48 | alpha = 0x80; | |
| 46 | 49 | |
| 47 | 50 | y = spritebase[offs]; |
| 48 | flash=y&0x1000; | |
| 49 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 50 | colour = (x >> 9) &0x1f; | |
| 51 | if (y&0x8000) colour+=32; | |
| 51 | flash = y & 0x1000; | |
| 52 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 53 | continue; | |
| 54 | colour = (x >> 9) & 0x1f; | |
| 55 | if (y & 0x8000) | |
| 56 | colour += 32; | |
| 52 | 57 | |
| 53 | 58 | fx = y & 0x2000; |
| 54 | 59 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 61 | 66 | x = 304 - x; |
| 62 | 67 | y = 240 - y; |
| 63 | 68 | |
| 64 | if (x>320) continue; /* Speedup */ | |
| 69 | if (x > 320) | |
| 70 | continue; /* Speedup */ | |
| 65 | 71 | |
| 66 | 72 | sprite &= ~multi; |
| 67 | 73 | if (fy) |
| r7500 | r7501 | |
| 72 | 78 | inc = 1; |
| 73 | 79 | } |
| 74 | 80 | |
| 75 | if (flip_screen_get(machine)) { | |
| 76 | y=240-y; | |
| 77 | x=304-x; | |
| 78 | if (fx) fx=0; else fx=1; | |
| 79 | if (fy) fy=0; else fy=1; | |
| 80 | mult=16; | |
| 81 | if (flip_screen_get(machine)) | |
| 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; | |
| 81 | 88 | } |
| 82 | else mult=-16; | |
| 89 | else mult = -16; | |
| 83 | 90 | |
| 84 | 91 | /* Priority */ |
| 85 | switch (pf_priority&3) { | |
| 92 | switch (pf_priority & 3) | |
| 93 | { | |
| 86 | 94 | case 0: |
| 87 | if (bank==0) { | |
| 88 | switch (spritebase[offs+2]&0xc000) { | |
| 89 | case 0xc000: pmask=1; break; | |
| 90 | case 0x8000: pmask=8; break; | |
| 91 | case 0x4000: pmask=32; break; | |
| 92 | case 0x0000: pmask=128; break; | |
| 95 | if (bank == 0) | |
| 96 | { | |
| 97 | switch (spritebase[offs+2]&0xc000) | |
| 98 | { | |
| 99 | case 0xc000: pmask = 1; break; | |
| 100 | case 0x8000: pmask = 8; break; | |
| 101 | case 0x4000: pmask = 32; break; | |
| 102 | case 0x0000: pmask = 128; break; | |
| 93 | 103 | } |
| 94 | } else { | |
| 95 | if (spritebase[offs+2]&0x8000) pmask=64; /* Check */ | |
| 96 | else pmask=64; | |
| 97 | 104 | } |
| 105 | else | |
| 106 | { | |
| 107 | if (spritebase[offs + 2] & 0x8000) | |
| 108 | pmask = 64; /* Check */ | |
| 109 | else | |
| 110 | pmask = 64; | |
| 111 | } | |
| 98 | 112 | break; |
| 99 | 113 | |
| 100 | 114 | case 1: |
| 101 | if (bank==0) { | |
| 102 | switch (spritebase[offs+2]&0xc000) { | |
| 103 | case 0xc000: pmask=1; break; | |
| 104 | case 0x8000: pmask=8; break; | |
| 105 | case 0x4000: pmask=32; break; | |
| 106 | case 0x0000: pmask=128; break; | |
| 115 | if (bank == 0) | |
| 116 | { | |
| 117 | switch (spritebase[offs + 2] & 0xc000) | |
| 118 | { | |
| 119 | case 0xc000: pmask = 1; break; | |
| 120 | case 0x8000: pmask = 8; break; | |
| 121 | case 0x4000: pmask = 32; break; | |
| 122 | case 0x0000: pmask = 128; break; | |
| 107 | 123 | } |
| 108 | } else { | |
| 109 | if (spritebase[offs+2]&0x8000) pmask=16; /* Check */ | |
| 110 | else pmask=16; | |
| 111 | 124 | } |
| 125 | else | |
| 126 | { | |
| 127 | if (spritebase[offs + 2] & 0x8000) | |
| 128 | pmask = 16; /* Check */ | |
| 129 | else | |
| 130 | pmask = 16; | |
| 131 | } | |
| 112 | 132 | break; |
| 113 | 133 | |
| 114 | 134 | case 2: /* Unused */ |
| 115 | 135 | case 3: |
| 116 | if (bank==0) { | |
| 117 | switch (spritebase[offs+2]&0xc000) { | |
| 118 | case 0xc000: pmask=1; break; | |
| 119 | case 0x8000: pmask=8; break; | |
| 120 | case 0x4000: pmask=32; break; | |
| 121 | case 0x0000: pmask=128; break; | |
| 136 | if (bank == 0) | |
| 137 | { | |
| 138 | switch (spritebase[offs + 2] & 0xc000) | |
| 139 | { | |
| 140 | case 0xc000: pmask = 1; break; | |
| 141 | case 0x8000: pmask = 8; break; | |
| 142 | case 0x4000: pmask = 32; break; | |
| 143 | case 0x0000: pmask = 128; break; | |
| 122 | 144 | } |
| 123 | } else { | |
| 124 | if (spritebase[offs+2]&0x8000) pmask=64; /* Check */ | |
| 125 | else pmask=64; | |
| 126 | 145 | } |
| 146 | else | |
| 147 | { | |
| 148 | if (spritebase[offs + 2] & 0x8000) | |
| 149 | pmask = 64; /* Check */ | |
| 150 | else | |
| 151 | pmask = 64; | |
| 152 | } | |
| 127 | 153 | break; |
| 128 | 154 | } |
| 129 | 155 | |
| 130 | 156 | while (multi >= 0) |
| 131 | 157 | { |
| 132 | deco16_pdrawgfx( | |
| 158 | deco16ic_pdrawgfx( | |
| 159 | state->deco16ic, | |
| 133 | 160 | bitmap,cliprect,machine->gfx[gfxbank], |
| 134 | 161 | sprite - multi * inc, |
| 135 | 162 | colour, |
| 136 | fx,fy, | |
| 137 | x,y + mult * multi, | |
| 138 | 0,pmask,1<<bank, 1, alpha); | |
| 163 | fx, fy, | |
| 164 | x, y + mult * multi, | |
| 165 | 0, pmask, 1 << bank, 1, alpha); | |
| 139 | 166 | |
| 140 | 167 | multi--; |
| 141 | 168 | } |
| r7500 | r7501 | |
| 145 | 172 | |
| 146 | 173 | /******************************************************************************/ |
| 147 | 174 | |
| 148 | ||
| 175 | VIDEO_UPDATE( | |
| 149 | 176 | { |
| 150 | return ((bank>>4)&0xf)<<12; | |
| 151 | } | |
| 177 | dassault_state *state = (dassault_state *)screen->machine->driver_data; | |
| 178 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 179 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 152 | 180 | |
| 153 | VIDEO_START( dassault ) | |
| 154 | { | |
| 155 | deco16_2_video_init(machine, 0); | |
| 156 | ||
| 157 | deco16_set_tilemap_bank_callback(0,dassault_bank_callback); | |
| 158 | deco16_set_tilemap_bank_callback(1,dassault_bank_callback); | |
| 159 | deco16_set_tilemap_bank_callback(2,dassault_bank_callback); | |
| 160 | deco16_set_tilemap_bank_callback(3,dassault_bank_callback); | |
| 161 | } | |
| 162 | ||
| 163 | /******************************************************************************/ | |
| 164 | ||
| 165 | VIDEO_UPDATE( dassault ) | |
| 166 | { | |
| 167 | 181 | /* Update tilemaps */ |
| 168 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 169 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 170 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 182 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 183 | deco16ic_pf12_update(state->deco16ic, 0, state->pf2_rowscroll); | |
| 184 | deco16ic_pf34_update(state->deco16ic, 0, state->pf4_rowscroll); | |
| 171 | 185 | |
| 172 | 186 | /* Draw playfields/update priority bitmap */ |
| 173 | deco16_clear_sprite_priority_bitmap(); | |
| 174 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 175 | bitmap_fill(bitmap,cliprect,screen->machine->pens[3072]); | |
| 176 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 187 | deco16ic_clear_sprite_priority_bitmap(state->deco16ic); | |
| 188 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 189 | bitmap_fill(bitmap, cliprect, screen->machine->pens[3072]); | |
| 190 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 177 | 191 | |
| 178 | 192 | /* The middle playfields can be swapped priority-wise */ |
| 179 | if ((deco16_priority&3)==0) { | |
| 180 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 181 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,16); | |
| 182 | } else if ((deco16_priority&3)==1) { | |
| 183 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 184 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,64); | |
| 185 | } else if ((deco16_priority&3)==3) { | |
| 186 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,2); | |
| 187 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,16); | |
| 188 | } else { | |
| 193 | if ((priority & 3) == 0) | |
| 194 | { | |
| 195 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 196 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 16); | |
| 197 | } | |
| 198 | else if ((priority & 3) == 1) | |
| 199 | { | |
| 200 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 201 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 64); | |
| 202 | } | |
| 203 | else if ((priority & 3) == 3) | |
| 204 | { | |
| 205 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 206 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 16); | |
| 207 | } | |
| 208 | else | |
| 209 | { | |
| 189 | 210 | /* Unused */ |
| 190 | 211 | } |
| 191 | 212 | |
| 192 | 213 | /* Draw sprites - two sprite generators, with selectable priority */ |
| 193 | draw_sprites(screen->machine,bitmap,cliprect,deco16_priority); | |
| 194 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 214 | draw_sprites(screen->machine, bitmap, cliprect, priority); | |
| 215 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 195 | 216 | return 0; |
| 196 | 217 | } |
| r7500 | r7501 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "emu.h" |
| 16 | #include "includes/deco16ic.h" | |
| 16 | #include "video/deco16ic.h" | |
| 17 | #include "includes/supbtime.h" | |
| 17 | 18 | |
| 18 | 19 | /******************************************************************************/ |
| 19 | 20 | |
| 20 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 21 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 21 | 22 | { |
| 22 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 23 | supbtime_state *state = (supbtime_state *)machine->driver_data; | |
| 24 | UINT16 *spriteram = state->spriteram; | |
| 23 | 25 | int offs; |
| 24 | 26 | |
| 25 | for (offs = 0;offs < 0x400;offs += 4) | |
| 27 | for (offs = 0; offs < 0x400; offs += 4) | |
| 26 | 28 | { |
| 27 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 29 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 28 | 30 | |
| 29 | sprite = spriteram16[offs+1] & 0x3fff; | |
| 30 | if (!sprite) continue; | |
| 31 | sprite = spriteram[offs + 1] & 0x3fff; | |
| 32 | if (!sprite) | |
| 33 | continue; | |
| 31 | 34 | |
| 32 | y = spriteram16[offs]; | |
| 33 | flash=y&0x1000; | |
| 34 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 35 | y = spriteram[offs]; | |
| 36 | flash = y & 0x1000; | |
| 37 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 38 | continue; | |
| 35 | 39 | |
| 36 | x = spriteram16[offs+2]; | |
| 37 | colour = (x >>9) & 0x1f; | |
| 40 | x = spriteram[offs + 2]; | |
| 41 | colour = (x >> 9) & 0x1f; | |
| 38 | 42 | |
| 39 | 43 | fx = y & 0x2000; |
| 40 | 44 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 45 | 49 | if (x >= 320) x -= 512; |
| 46 | 50 | if (y >= 256) y -= 512; |
| 47 | 51 | y = 240 - y; |
| 48 | ||
| 52 | | |
| 49 | 53 | |
| 50 | if (x>320) continue; | |
| 54 | if (x > 320) | |
| 55 | continue; | |
| 51 | 56 | |
| 52 | 57 | sprite &= ~multi; |
| 53 | 58 | if (fy) |
| r7500 | r7501 | |
| 60 | 65 | |
| 61 | 66 | if (flip_screen_get(machine)) |
| 62 | 67 | { |
| 63 | y=240-y; | |
| 64 | x=304-x; | |
| 65 | if (fx) fx=0; else fx=1; | |
| 66 | if (fy) fy=0; else fy=1; | |
| 67 | mult=16; | |
| 68 | y = 240 - y; | |
| 69 | x = 304 - x; | |
| 70 | if (fx) fx = 0; else fx = 1; | |
| 71 | if (fy) fy = 0; else fy = 1; | |
| 72 | mult = 16; | |
| 68 | 73 | } |
| 69 | else mult=-16; | |
| 74 | else mult = -16; | |
| 70 | 75 | |
| 71 | 76 | while (multi >= 0) |
| 72 | 77 | { |
| r7500 | r7501 | |
| 83 | 88 | |
| 84 | 89 | /******************************************************************************/ |
| 85 | 90 | |
| 86 | VIDEO_START(supbtime) | |
| 87 | { | |
| 88 | deco16_1_video_init(machine); | |
| 89 | } | |
| 90 | ||
| 91 | 91 | VIDEO_UPDATE(supbtime) |
| 92 | 92 | { |
| 93 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 94 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 93 | supbtime_state *state = (supbtime_state *)screen->machine->driver_data; | |
| 94 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 95 | 95 | |
| 96 | bitmap_fill(bitmap,cliprect,768); | |
| 96 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 97 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 97 | 98 | |
| 98 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 99 | draw_sprites(screen->machine, bitmap,cliprect); | |
| 100 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 99 | bitmap_fill(bitmap, cliprect, 768); | |
| 100 | ||
| 101 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 102 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 103 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 101 | 104 | return 0; |
| 102 | 105 | } |
| 103 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/ohmygod.h" | |
| 2 | 3 | |
| 3 | ||
| 4 | UINT16 *ohmygod_videoram; | |
| 5 | ||
| 6 | static int spritebank; | |
| 7 | static tilemap_t *bg_tilemap; | |
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | 4 | /*************************************************************************** |
| 12 | 5 | |
| 13 | 6 | Callbacks for the TileMap code |
| r7500 | r7501 | |
| 16 | 9 | |
| 17 | 10 | static TILE_GET_INFO( get_tile_info ) |
| 18 | 11 | { |
| 19 | UINT16 code = ohmygod_videoram[2*tile_index+1]; | |
| 20 | UINT16 attr = ohmygod_videoram[2*tile_index]; | |
| 12 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 13 | UINT16 code = state->videoram[2 * tile_index + 1]; | |
| 14 | UINT16 attr = state->videoram[2 * tile_index]; | |
| 21 | 15 | SET_TILE_INFO( |
| 22 | 16 | 0, |
| 23 | 17 | code, |
| r7500 | r7501 | |
| 35 | 29 | |
| 36 | 30 | VIDEO_START( ohmygod ) |
| 37 | 31 | { |
| 38 | bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,64,64); | |
| 32 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 33 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 64); | |
| 39 | 34 | } |
| 40 | 35 | |
| 41 | 36 | |
| r7500 | r7501 | |
| 48 | 43 | |
| 49 | 44 | WRITE16_HANDLER( ohmygod_videoram_w ) |
| 50 | 45 | { |
| 51 | COMBINE_DATA(&ohmygod_videoram[offset]); | |
| 52 | tilemap_mark_tile_dirty(bg_tilemap,offset/2); | |
| 46 | ohmygod_state *state = (ohmygod_state *)space->machine->driver_data; | |
| 47 | COMBINE_DATA(&state->videoram[offset]); | |
| 48 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 53 | 49 | } |
| 54 | 50 | |
| 55 | 51 | WRITE16_HANDLER( ohmygod_spritebank_w ) |
| 56 | 52 | { |
| 53 | ohmygod_state *state = (ohmygod_state *)space->machine->driver_data; | |
| 57 | 54 | if (ACCESSING_BITS_8_15) |
| 58 | spritebank = data & 0x8000; | |
| 55 | state->spritebank = data & 0x8000; | |
| 59 | 56 | } |
| 60 | 57 | |
| 61 | 58 | WRITE16_HANDLER( ohmygod_scrollx_w ) |
| 62 | 59 | { |
| 63 | static UINT16 scroll; | |
| 64 | COMBINE_DATA(&scroll); | |
| 65 | tilemap_set_scrollx(bg_tilemap,0,scroll - 0x81ec); | |
| 60 | ohmygod_state *state = (ohmygod_state *)space->machine->driver_data; | |
| 61 | COMBINE_DATA(&state->scrollx); | |
| 62 | tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx - 0x81ec); | |
| 66 | 63 | } |
| 67 | 64 | |
| 68 | 65 | WRITE16_HANDLER( ohmygod_scrolly_w ) |
| 69 | 66 | { |
| 70 | static UINT16 scroll; | |
| 71 | COMBINE_DATA(&scroll); | |
| 72 | tilemap_set_scrolly(bg_tilemap,0,scroll - 0x81ef); | |
| 67 | ohmygod_state *state = (ohmygod_state *)space->machine->driver_data; | |
| 68 | COMBINE_DATA(&state->scrolly); | |
| 69 | tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly - 0x81ef); | |
| 73 | 70 | } |
| 74 | 71 | |
| 75 | 72 | |
| r7500 | r7501 | |
| 79 | 76 | |
| 80 | 77 | ***************************************************************************/ |
| 81 | 78 | |
| 82 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 79 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 83 | 80 | { |
| 84 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 81 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 82 | UINT16 *spriteram = state->spriteram; | |
| 85 | 83 | int offs; |
| 86 | 84 | |
| 87 | for (offs = 0;offs < | |
| 85 | for (offs = 0; offs < stat | |
| 88 | 86 | { |
| 89 | int sx,sy,code,color,flipx; | |
| 87 | int sx, sy, code, color, flipx; | |
| 90 | 88 | UINT16 *sr; |
| 91 | 89 | |
| 92 | sr = spritebank ? (spriteram | |
| 90 | sr = state->spritebank ? (spriteram | |
| 93 | 91 | |
| 94 | code = sr[offs+3] & 0x0fff; | |
| 95 | color = sr[offs+2] & 0x000f; | |
| 96 | sx = sr[offs+0] - 29; | |
| 97 | sy = sr[offs+1]; | |
| 98 | if (sy >= 32768) sy -= 65536; | |
| 99 | flipx = sr[offs+3] & 0x8000; | |
| 92 | code = sr[offs + 3] & 0x0fff; | |
| 93 | color = sr[offs + 2] & 0x000f; | |
| 94 | sx = sr[offs + 0] - 29; | |
| 95 | sy = sr[offs + 1]; | |
| 96 | if (sy >= 32768) | |
| 97 | sy -= 65536; | |
| 98 | flipx = sr[offs + 3] & 0x8000; | |
| 100 | 99 | |
| 101 | 100 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 102 | 101 | code, |
| r7500 | r7501 | |
| 108 | 107 | |
| 109 | 108 | VIDEO_UPDATE( ohmygod ) |
| 110 | 109 | { |
| 111 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 112 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 110 | ohmygod_state *state = (ohmygod_state *)screen->machine->driver_data; | |
| 111 | ||
| 112 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 113 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 113 | 114 | return 0; |
| 114 | 115 | } |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | #include "emu.h" |
| 4 | 4 | #include "includes/oneshot.h" |
| 5 | 5 | |
| 6 | static tilemap_t *oneshot_bg_tilemap; | |
| 7 | static tilemap_t *oneshot_mid_tilemap; | |
| 8 | static tilemap_t *oneshot_fg_tilemap; | |
| 9 | 6 | |
| 10 | 7 | /* bg tilemap */ |
| 11 | 8 | static TILE_GET_INFO( get_oneshot_bg_tile_info ) |
| 12 | 9 | { |
| 13 | int tileno; | |
| 10 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 11 | int tileno = state->bg_videoram[tile_index * 2 + 1]; | |
| 14 | 12 | |
| 15 | tileno = oneshot_bg_videoram[tile_index*2+1]; | |
| 16 | ||
| 17 | SET_TILE_INFO(0,tileno,0,0); | |
| 13 | SET_TILE_INFO(0, tileno, 0, 0); | |
| 18 | 14 | } |
| 19 | 15 | |
| 20 | 16 | WRITE16_HANDLER( oneshot_bg_videoram_w ) |
| 21 | 17 | { |
| 22 | COMBINE_DATA(&oneshot_bg_videoram[offset]); | |
| 23 | tilemap_mark_tile_dirty(oneshot_bg_tilemap,offset/2); | |
| 18 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 19 | COMBINE_DATA(&state->bg_videoram[offset]); | |
| 20 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 24 | 21 | } |
| 25 | 22 | |
| 26 | 23 | /* mid tilemap */ |
| 27 | 24 | static TILE_GET_INFO( get_oneshot_mid_tile_info ) |
| 28 | 25 | { |
| 29 | int tileno; | |
| 26 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 27 | int tileno = state->mid_videoram[tile_index * 2 + 1]; | |
| 30 | 28 | |
| 31 | tileno = oneshot_mid_videoram[tile_index*2+1]; | |
| 32 | ||
| 33 | SET_TILE_INFO(0,tileno,2,0); | |
| 29 | SET_TILE_INFO(0, tileno, 2, 0); | |
| 34 | 30 | } |
| 35 | 31 | |
| 36 | 32 | WRITE16_HANDLER( oneshot_mid_videoram_w ) |
| 37 | 33 | { |
| 38 | COMBINE_DATA(&oneshot_mid_videoram[offset]); | |
| 39 | tilemap_mark_tile_dirty(oneshot_mid_tilemap,offset/2); | |
| 34 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 35 | COMBINE_DATA(&state->mid_videoram[offset]); | |
| 36 | tilemap_mark_tile_dirty(state->mid_tilemap, offset / 2); | |
| 40 | 37 | } |
| 41 | 38 | |
| 42 | 39 | |
| 43 | 40 | /* fg tilemap */ |
| 44 | 41 | static TILE_GET_INFO( get_oneshot_fg_tile_info ) |
| 45 | 42 | { |
| 46 | int tileno; | |
| 43 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 44 | int tileno = state->fg_videoram[tile_index * 2 + 1]; | |
| 47 | 45 | |
| 48 | tileno = oneshot_fg_videoram[tile_index*2+1]; | |
| 49 | ||
| 50 | SET_TILE_INFO(0,tileno,3,0); | |
| 46 | SET_TILE_INFO(0, tileno, 3, 0); | |
| 51 | 47 | } |
| 52 | 48 | |
| 53 | 49 | WRITE16_HANDLER( oneshot_fg_videoram_w ) |
| 54 | 50 | { |
| 55 | COMBINE_DATA(&oneshot_fg_videoram[offset]); | |
| 56 | tilemap_mark_tile_dirty(oneshot_fg_tilemap,offset/2); | |
| 51 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 52 | COMBINE_DATA(&state->fg_videoram[offset]); | |
| 53 | tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2); | |
| 57 | 54 | } |
| 58 | 55 | |
| 59 | 56 | VIDEO_START( oneshot ) |
| 60 | 57 | { |
| 61 | oneshot_bg_tilemap = tilemap_create(machine, get_oneshot_bg_tile_info,tilemap_scan_rows, 16, 16,32,32); | |
| 62 | oneshot_mid_tilemap = tilemap_create(machine, get_oneshot_mid_tile_info,tilemap_scan_rows, 16, 16,32,32); | |
| 63 | oneshot_fg_tilemap = tilemap_create(machine, get_oneshot_fg_tile_info,tilemap_scan_rows, 16, 16,32,32); | |
| 58 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 64 | 59 | |
| 65 | tilemap_set_transparent_pen(oneshot_bg_tilemap,0); | |
| 66 | tilemap_set_transparent_pen(oneshot_mid_tilemap,0); | |
| 67 | tilemap_set_transparent_pen(oneshot_fg_tilemap,0); | |
| 60 | state->bg_tilemap = tilemap_create(machine, get_oneshot_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 61 | state->mid_tilemap = tilemap_create(machine, get_oneshot_mid_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 62 | state->fg_tilemap = tilemap_create(machine, get_oneshot_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 63 | ||
| 64 | tilemap_set_transparent_pen(state->bg_tilemap, 0); | |
| 65 | tilemap_set_transparent_pen(state->mid_tilemap, 0); | |
| 66 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | 69 | static void draw_crosshairs( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 71 | 70 | { |
| 72 | int xpos,ypos; | |
| 73 | /* get gun raw coordonates (player 1) */ | |
| 74 | gun_x_p1 = (input_port_read(machine, "LIGHT0_X") & 0xff) * 320 / 256; | |
| 75 | gun_y_p1 = (input_port_read(machine, "LIGHT0_Y") & 0xff) * 240 / 256; | |
| 71 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 72 | int xpos,ypos; | |
| 76 | 73 | |
| 77 | /* compute the coordonates for drawing (from routine at 0x009ab0) */ | |
| 78 | xpos = gun_x_p1; | |
| 79 | ypos = gun_y_p1; | |
| 74 | /* get gun raw coordinates (player 1) */ | |
| 75 | state->gun_x_p1 = (input_port_read(machine, "LIGHT0_X") & 0xff) * 320 / 256; | |
| 76 | state->gun_y_p1 = (input_port_read(machine, "LIGHT0_Y") & 0xff) * 240 / 256; | |
| 80 | 77 | |
| 81 | gun_x_p1+=gun_x_shift; | |
| 78 | /* compute the coordinates for drawing (from routine at 0x009ab0) */ | |
| 79 | xpos = state->gun_x_p1; | |
| 80 | ypos = state->gun_y_p1; | |
| 82 | 81 | |
| 83 | gun_y_p1 -= 0x0a; | |
| 84 | if (gun_y_p1 < 0) | |
| 85 | gun_y_p1=0; | |
| 82 | state->gun_x_p1 += state->gun_x_shift; | |
| 86 | 83 | |
| 84 | state->gun_y_p1 -= 0x0a; | |
| 85 | if (state->gun_y_p1 < 0) | |
| 86 | state->gun_y_p1 = 0; | |
| 87 | 87 | |
| 88 | /* get gun raw coordonates (player 2) */ | |
| 89 | gun_x_p2 = (input_port_read(machine, "LIGHT1_X") & 0xff) * 320 / 256; | |
| 90 | gun_y_p2 = (input_port_read(machine, "LIGHT1_Y") & 0xff) * 240 / 256; | |
| 91 | /* compute the coordonates for drawing (from routine at 0x009b6e) */ | |
| 92 | xpos = gun_x_p2; | |
| 93 | ypos = gun_y_p2; | |
| 94 | 88 | |
| 95 | gun_x_p2 += gun_x_shift-0x0a; | |
| 96 | if (gun_x_p2 < 0) | |
| 97 | gun_x_p2=0; | |
| 89 | /* get gun raw coordinates (player 2) */ | |
| 90 | state->gun_x_p2 = (input_port_read(machine, "LIGHT1_X") & 0xff) * 320 / 256; | |
| 91 | state->gun_y_p2 = (input_port_read(machine, "LIGHT1_Y") & 0xff) * 240 / 256; | |
| 92 | ||
| 93 | /* compute the coordinates for drawing (from routine at 0x009b6e) */ | |
| 94 | xpos = state->gun_x_p2; | |
| 95 | ypos = state->gun_y_p2; | |
| 96 | ||
| 97 | state->gun_x_p2 += state->gun_x_shift - 0x0a; | |
| 98 | if (state->gun_x_p2 < 0) | |
| 99 | state->gun_x_p2 = 0; | |
| 98 | 100 | } |
| 99 | 101 | |
| 100 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 102 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 101 | 103 | { |
| 102 | const UINT16 *source = oneshot_sprites; | |
| 103 | const UINT16 *finish = source+(0x1000/2); | |
| 104 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 105 | const UINT16 *source = state->sprites; | |
| 106 | const UINT16 *finish = source + (0x1000 / 2); | |
| 104 | 107 | const gfx_element *gfx = machine->gfx[1]; |
| 105 | 108 | |
| 106 | int xpos,ypos; | |
| 109 | int xpos, ypos; | |
| 107 | 110 | |
| 108 | while | |
| 111 | while | |
| 109 | 112 | { |
| 110 | int blockx,blocky; | |
| 113 | int blockx, blocky; | |
| 111 | 114 | int num = source[1] & 0xffff; |
| 112 | int xsize = (source[2] & 0x000f)+1; | |
| 113 | int ysize = (source[3] & 0x000f)+1; | |
| 115 | int xsize = (source[2] & 0x000f) + 1; | |
| 116 | int ysize = (source[3] & 0x000f) + 1; | |
| 114 | 117 | |
| 115 | 118 | ypos = source[3] & 0xff80; |
| 116 | 119 | xpos = source[2] & 0xff80; |
| r7500 | r7501 | |
| 119 | 122 | xpos = xpos >> 7; |
| 120 | 123 | |
| 121 | 124 | |
| 122 | if (source[0] == 0x0001) break; | |
| 125 | if (source[0] == 0x0001) | |
| 126 | break; | |
| 123 | 127 | |
| 124 | 128 | xpos -= 8; |
| 125 | 129 | ypos -= 6; |
| 126 | 130 | |
| 127 | ||
| 128 | for (blockx = 0; blockx<xsize;blockx++) { | |
| 129 | for (blocky = 0; blocky<ysize;blocky++) { | |
| 130 | ||
| 131 | ||
| 131 | for (blockx = 0; blockx < xsize; blockx++) | |
| 132 | { | |
| 133 | for (blocky = 0; blocky < ysize; blocky++) | |
| 134 | { | |
| 132 | 135 | drawgfx_transpen( |
| 133 | 136 | bitmap, |
| 134 | 137 | cliprect, |
| 135 | 138 | gfx, |
| 136 | num+(blocky*xsize)+blockx, | |
| 139 | num + (blocky * xsize) + blockx, | |
| 137 | 140 | 1, |
| 138 | 141 | 0,0, |
| 139 | xpos+blockx*8,ypos+blocky*8,0 | |
| 140 | ); | |
| 142 | xpos + blockx * 8, ypos + blocky * 8, 0); | |
| 141 | 143 | |
| 142 | 144 | drawgfx_transpen( |
| 143 | 145 | bitmap, |
| 144 | 146 | cliprect, |
| 145 | 147 | gfx, |
| 146 | num+(blocky*xsize)+blockx, | |
| 148 | num + (blocky * xsize) + blockx, | |
| 147 | 149 | 1, |
| 148 | 150 | 0,0, |
| 149 | xpos+blockx*8-0x200,ypos+blocky*8,0 | |
| 150 | ); | |
| 151 | xpos + blockx * 8 - 0x200, ypos + blocky * 8, 0); | |
| 151 | 152 | } |
| 152 | 153 | } |
| 153 | 154 | source += 0x4; |
| r7500 | r7501 | |
| 157 | 158 | |
| 158 | 159 | VIDEO_UPDATE( oneshot ) |
| 159 | 160 | { |
| 161 | oneshot_state *state = (oneshot_state *)screen->machine->driver_data; | |
| 162 | ||
| 160 | 163 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 161 | 164 | |
| 162 | tilemap_set_scrollx(oneshot_mid_tilemap,0, oneshot_scroll[0]-0x1f5); | |
| 163 | tilemap_set_scrolly(oneshot_mid_tilemap,0, oneshot_scroll[1]); | |
| 165 | tilemap_set_scrollx(state->mid_tilemap, 0, state->scroll[0] - 0x1f5); | |
| 166 | tilemap_set_scrolly(state->mid_tilemap, 0, state->scroll[1]); | |
| 164 | 167 | |
| 165 | tilemap_draw(bitmap,cliprect,oneshot_bg_tilemap,0,0); | |
| 166 | tilemap_draw(bitmap,cliprect,oneshot_mid_tilemap,0,0); | |
| 167 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 168 | tilemap_draw(bitmap,cliprect,oneshot_fg_tilemap,0,0); | |
| 169 | draw_crosshairs(screen->machine,bitmap,cliprect); | |
| 168 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 169 | tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0); | |
| 170 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 171 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 172 | draw_crosshairs(screen->machine, bitmap, cliprect); | |
| 170 | 173 | return 0; |
| 171 | 174 | } |
| 172 | 175 | |
| 173 | 176 | VIDEO_UPDATE( maddonna ) |
| 174 | 177 | { |
| 178 | oneshot_state *state = (oneshot_state *)screen->machine->driver_data; | |
| 179 | ||
| 175 | 180 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 176 | 181 | |
| 177 | tilemap_set_scrolly( | |
| 182 | tilemap_set_scrolly( | |
| 178 | 183 | |
| 179 | tilemap_draw(bitmap,cliprect,oneshot_mid_tilemap,0,0); | |
| 180 | tilemap_draw(bitmap,cliprect,oneshot_fg_tilemap,0,0); | |
| 181 | tilemap_draw(bitmap,cliprect,oneshot_bg_tilemap,0,0); | |
| 182 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 183 | // draw_crosshairs(screen->machine,bitmap,cliprect); // not a gun game | |
| 184 | tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0); | |
| 185 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 186 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 187 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 184 | 188 | |
| 185 | // popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", | |
| 189 | // popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", | |
| 186 | 190 | return 0; |
| 187 | 191 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /********************************************************************************** |
| 2 | 2 | |
| 3 | 3 | |
| 4 | FUNWORLD / TAB. | |
| 4 | FUNWORLD / TAB. | |
| 5 | Video Hardware. | |
| 5 | 6 | |
| 6 | | |
| 7 | Written by Roberto F | |
| 7 | 8 | |
| 8 | Written by Roberto Fresca. | |
| 9 | 9 | |
| 10 | Games running on this hardware: | |
| 10 | 11 | |
| 11 | Games running on this hardware: | |
| 12 | * Jolly Card (austrian), TAB-Austria, 1985. | |
| 13 | * Jolly Card (3x3 deal), TAB-Austria, 1985. | |
| 14 | * Jolly Card Professional 2.0, Spale-Soft, 2000. | |
| 15 | * Jolly Card (Evona Electronic), Evona Electronic 1998. | |
| 16 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. | |
| 17 | * Jolly Card (croatian, set 2), Soft Design, 1993. | |
| 18 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. | |
| 19 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 20 | * Super Joly 2000 - 3x, M.P. 1985. | |
| 21 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. | |
| 22 | * Big Deal (hungarian, set 1), Funworld, 1986. | |
| 23 | * Big Deal (hungarian, set 2), Funworld, 1986. | |
| 24 | * Jolly Card (austrian, Funworld), Funworld, 1986. | |
| 25 | * Cuore 1 (italian), C.M.C., 1996. | |
| 26 | * Elephant Family (italian, new), C.M.C., 1997. | |
| 27 | * Elephant Family (italian, old), C.M.C., 1996. | |
| 28 | * Pool 10 (italian, set 1), C.M.C., 1996. | |
| 29 | * Pool 10 (italian, set 2), C.M.C., 1996. | |
| 30 | * Pool 10 (italian, set 3), C.M.C., 1996. | |
| 31 | * Pool 10 (italian, set 4), C.M.C., 1997. | |
| 32 | * Tortuga Family (italian), C.M.C., 1997. | |
| 33 | * Pot Game (italian), C.M.C., 1996. | |
| 34 | * Bottle 10 (italian, set 1), C.M.C., 1996. | |
| 35 | * Bottle 10 (italian, set 2), C.M.C., 1996. | |
| 36 | * Royal Card (austrian, set 1), TAB-Austria, 1991. | |
| 37 | * Royal Card (austrian, set 2), TAB-Austria, 1991. | |
| 38 | * Royal Card (slovak, encrypted), Evona Electronic, 1991. | |
| 39 | * Royal Card Professional 2.0, Digital Dreams, 1993. | |
| 40 | * Lucky Lady (3x3 deal), TAB-Austria, 1991. | |
| 41 | * Lucky Lady (4x1 aces), TAB-Austria, 1991. | |
| 42 | * Magic Card II (bulgarian), Impera, 1996. | |
| 43 | * Magic Card II (green TAB or Impera board), Impera, 1996. | |
| 44 | * Magic Card II (blue TAB board, encrypted), Impera, 1996. | |
| 45 | * Royal Vegas Joker Card (slow deal), Funworld, 1993. | |
| 46 | * Royal Vegas Joker Card (fast deal), Soft Design, 1993. | |
| 47 | * Royal Vegas Joker Card (fast deal, english gfx), Soft Design, 1993. | |
| 48 | * Jolly Joker (98bet, set 1). Impera, 198?. | |
| 49 | * Jolly Joker (98bet, set 2). Impera, 198?. | |
| 50 | * Jolly Joker (40bet, croatian hack), Impera, 198?. | |
| 51 | * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993. | |
| 52 | * Mongolfier New (italian), bootleg, 199?. | |
| 53 | * Soccer New (italian), bootleg, 199?. | |
| 54 | * Saloon (french, encrypted), unknown, 199?. | |
| 12 | 55 | |
| 13 | * Jolly Card (austrian), TAB-Austria, 1985. | |
| 14 | * Jolly Card (3x3 deal), TAB-Austria, 1985. | |
| 15 | * Jolly Card Professional 2.0, Spale-Soft, 2000. | |
| 16 | * Jolly Card (Evona Electronic), Evona Electronic 1998. | |
| 17 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. | |
| 18 | * Jolly Card (croatian, set 2), Soft Design, 1993. | |
| 19 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. | |
| 20 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 21 | * Super Joly 2000 - 3x, M.P. 1985. | |
| 22 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. | |
| 23 | * Big Deal (hungarian, set 1), Funworld, 1986. | |
| 24 | * Big Deal (hungarian, set 2), Funworld, 1986. | |
| 25 | * Jolly Card (austrian, Funworld), Funworld, 1986. | |
| 26 | * Cuore 1 (italian), C.M.C., 1996. | |
| 27 | * Elephant Family (italian, new), C.M.C., 1997. | |
| 28 | * Elephant Family (italian, old), C.M.C., 1996. | |
| 29 | * Pool 10 (italian, set 1), C.M.C., 1996. | |
| 30 | * Pool 10 (italian, set 2), C.M.C., 1996. | |
| 31 | * Pool 10 (italian, set 3), C.M.C., 1996. | |
| 32 | * Pool 10 (italian, set 4), C.M.C., 1997. | |
| 33 | * Tortuga Family (italian), C.M.C., 1997. | |
| 34 | * Pot Game (italian), C.M.C., 1996. | |
| 35 | * Bottle 10 (italian, set 1), C.M.C., 1996. | |
| 36 | * Bottle 10 (italian, set 2), C.M.C., 1996. | |
| 37 | * Royal Card (austrian, set 1), TAB-Austria, 1991. | |
| 38 | * Royal Card (austrian, set 2), TAB-Austria, 1991. | |
| 39 | * Royal Card (slovak, encrypted), Evona Electronic, 1991. | |
| 40 | * Royal Card Professional 2.0, Digital Dreams, 1993. | |
| 41 | * Lucky Lady (3x3 deal), TAB-Austria, 1991. | |
| 42 | * Lucky Lady (4x1 aces), TAB-Austria, 1991. | |
| 43 | * Magic Card II (bulgarian), Impera, 1996. | |
| 44 | * Magic Card II (green TAB or Impera board), Impera, 1996. | |
| 45 | * Magic Card II (blue TAB board, encrypted), Impera, 1996. | |
| 46 | * Royal Vegas Joker Card (slow deal), Funworld, 1993. | |
| 47 | * Royal Vegas Joker Card (fast deal), Soft Design, 1993. | |
| 48 | * Royal Vegas Joker Card (fast deal, english gfx), Soft Design, 1993. | |
| 49 | * Jolly Joker, Impera, 198?. | |
| 50 | * Jolly Joker (50bet), Impera, 198?. | |
| 51 | * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993. | |
| 52 | * Mongolfier New (italian), bootleg, 199?. | |
| 53 | * Soccer New (italian), bootleg, 199?. | |
| 54 | * Saloon (french, encrypted), unknown, 199?. | |
| 55 | 56 | |
| 56 | ||
| 57 | 57 | ***********************************************************************************/ |
| 58 | 58 | |
| 59 | 59 |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #include "emu.h" |
| 18 | 18 | #include "includes/tumbleb.h" |
| 19 | 19 | |
| 20 | ||
| 21 | static UINT16 tumblepb_control_0[8]; | |
| 22 | UINT16 *tumblepb_pf1_data,*tumblepb_pf2_data; | |
| 23 | static tilemap_t *pf1_tilemap,*pf1_alt_tilemap,*pf2_tilemap,*pf2_alt_tilemap; | |
| 24 | static int flipscreen; | |
| 25 | static UINT16 bcstory_tilebank; | |
| 26 | static int sprite_xoffset; | |
| 27 | static int sprite_yoffset; | |
| 28 | ||
| 29 | ||
| 30 | 20 | /******************************************************************************/ |
| 31 | 21 | |
| 32 | static void tumblepb_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 22 | static void tumblepb_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 33 | 23 | { |
| 34 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 24 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 25 | UINT16 *spriteram = state->spriteram; | |
| 35 | 26 | int offs; |
| 36 | 27 | |
| 37 | for (offs = 0;offs < 0x400;offs += 4) | |
| 28 | for (offs = 0; offs < 0x400; offs += 4) | |
| 38 | 29 | { |
| 39 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 30 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 40 | 31 | |
| 41 | sprite = spriteram16[offs+1] & 0x3fff; | |
| 42 | if (!sprite) continue; | |
| 32 | sprite = spriteram[offs + 1] & 0x3fff; | |
| 33 | if (!sprite) | |
| 34 | continue; | |
| 43 | 35 | |
| 44 | y = spriteram16[offs]; | |
| 45 | flash=y&0x1000; | |
| 46 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 36 | y = spriteram[offs]; | |
| 37 | flash = y & 0x1000; | |
| 38 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 39 | continue; | |
| 47 | 40 | |
| 48 | x = spriteram16[offs+2]; | |
| 49 | colour = (x >>9) & 0xf; | |
| 41 | x = spriteram[offs + 2]; | |
| 42 | colour = (x >> 9) & 0xf; | |
| 50 | 43 | |
| 51 | 44 | fx = y & 0x2000; |
| 52 | 45 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 57 | 50 | if (x >= 320) x -= 512; |
| 58 | 51 | if (y >= 256) y -= 512; |
| 59 | 52 | y = 240 - y; |
| 60 | ||
| 53 | | |
| 61 | 54 | |
| 62 | 55 | sprite &= ~multi; |
| 63 | 56 | if (fy) |
| r7500 | r7501 | |
| 68 | 61 | inc = 1; |
| 69 | 62 | } |
| 70 | 63 | |
| 71 | if (flipscreen) | |
| 64 | if (state->flipscreen) | |
| 72 | 65 | { |
| 73 | y=240-y; | |
| 74 | x=304-x; | |
| 75 | if (fx) fx=0; else fx=1; | |
| 76 | if (fy) fy=0; else fy=1; | |
| 77 | mult=16; | |
| 66 | y = 240 - y; | |
| 67 | x = 304 - x; | |
| 68 | if (fx) fx = 0; else fx = 1; | |
| 69 | if (fy) fy = 0; else fy = 1; | |
| 70 | mult = 16; | |
| 78 | 71 | } |
| 79 | else mult=-16; | |
| 72 | else | |
| 73 | mult = -16; | |
| 80 | 74 | |
| 81 | 75 | while (multi >= 0) |
| 82 | 76 | { |
| r7500 | r7501 | |
| 84 | 78 | sprite - multi * inc, |
| 85 | 79 | colour, |
| 86 | 80 | fx,fy, |
| 87 | sprite_xoffset + x,sprite_yoffset + y + mult * multi,0); | |
| 81 | state->sprite_xoffset + x, state->sprite_yoffset + y + mult * multi, 0); | |
| 88 | 82 | |
| 89 | 83 | multi--; |
| 90 | 84 | } |
| 91 | 85 | } |
| 92 | 86 | } |
| 93 | 87 | |
| 94 | static void jumpkids_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 88 | static void jumpkids_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 95 | 89 | { |
| 96 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 90 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 91 | UINT16 *spriteram = state->spriteram; | |
| 97 | 92 | int offs; |
| 98 | 93 | |
| 99 | for (offs = 0;offs < | |
| 94 | for (offs = 0; offs < stat | |
| 100 | 95 | { |
| 101 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 96 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 102 | 97 | |
| 103 | sprite = spriteram16[offs+1] & 0x7fff; | |
| 104 | if (!sprite) continue; | |
| 98 | sprite = spriteram[offs + 1] & 0x7fff; | |
| 99 | if (!sprite) | |
| 100 | continue; | |
| 105 | 101 | |
| 106 | y = spriteram16[offs]; | |
| 107 | flash=y&0x1000; | |
| 108 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 102 | y = spriteram[offs]; | |
| 103 | flash = y & 0x1000; | |
| 104 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 105 | continue; | |
| 109 | 106 | |
| 110 | x = spriteram16[offs+2]; | |
| 111 | colour = (x >>9) & 0xf; | |
| 107 | x = spriteram[offs+2]; | |
| 108 | colour = (x >> 9) & 0xf; | |
| 112 | 109 | |
| 113 | 110 | fx = y & 0x2000; |
| 114 | 111 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 119 | 116 | if (x >= 320) x -= 512; |
| 120 | 117 | if (y >= 256) y -= 512; |
| 121 | 118 | y = 240 - y; |
| 122 | ||
| 119 | | |
| 123 | 120 | |
| 124 | // sprite &= ~multi; /* Todo: I bet TumblePop bootleg doesn't do this either */ | |
| 121 | // sprite &= ~multi; /* Todo: I bet TumblePop bootleg doesn't do this either */ | |
| 125 | 122 | if (fy) |
| 126 | 123 | inc = -1; |
| 127 | 124 | else |
| r7500 | r7501 | |
| 130 | 127 | inc = 1; |
| 131 | 128 | } |
| 132 | 129 | |
| 133 | if (flipscreen) | |
| 130 | if (state->flipscreen) | |
| 134 | 131 | { |
| 135 | y=240-y; | |
| 136 | x=304-x; | |
| 137 | if (fx) fx=0; else fx=1; | |
| 138 | if (fy) fy=0; else fy=1; | |
| 139 | mult=16; | |
| 132 | y = 240 - y; | |
| 133 | x = 304 - x; | |
| 134 | if (fx) fx = 0; else fx = 1; | |
| 135 | if (fy) fy = 0; else fy = 1; | |
| 136 | mult = 16; | |
| 140 | 137 | } |
| 141 | else mult=-16; | |
| 138 | else | |
| 139 | mult = -16; | |
| 142 | 140 | |
| 143 | 141 | while (multi >= 0) |
| 144 | 142 | { |
| r7500 | r7501 | |
| 147 | 145 | sprite - multi * inc, |
| 148 | 146 | colour, |
| 149 | 147 | fx,fy, |
| 150 | sprite_xoffset+x,sprite_yoffset + y + mult * multi,0); | |
| 148 | state->sprite_xoffset + x, state->sprite_yoffset + y + mult * multi, 0); | |
| 151 | 149 | |
| 152 | 150 | multi--; |
| 153 | 151 | } |
| 154 | 152 | } |
| 155 | 153 | } |
| 156 | 154 | |
| 157 | static void fncywld_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 155 | static void fncywld_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 158 | 156 | { |
| 159 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 157 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 158 | UINT16 *spriteram = state->spriteram; | |
| 160 | 159 | int offs; |
| 161 | 160 | |
| 162 | for (offs = 0;offs < 0x400;offs += 4) | |
| 161 | for (offs = 0; offs < 0x400; offs += 4) | |
| 163 | 162 | { |
| 164 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 163 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 165 | 164 | |
| 166 | sprite = spriteram16[offs+1] & 0x3fff; | |
| 167 | if (!sprite) continue; | |
| 165 | sprite = spriteram[offs + 1] & 0x3fff; | |
| 166 | if (!sprite) | |
| 167 | continue; | |
| 168 | 168 | |
| 169 | y = spriteram16[offs]; | |
| 170 | flash=y&0x1000; | |
| 171 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 169 | y = spriteram[offs]; | |
| 170 | flash = y & 0x1000; | |
| 171 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 172 | continue; | |
| 172 | 173 | |
| 173 | x = spriteram16[offs+2]; | |
| 174 | colour = (x >>9) & 0x3f; | |
| 174 | x = spriteram[offs + 2]; | |
| 175 | colour = (x >> 9) & 0x3f; | |
| 175 | 176 | |
| 176 | 177 | fx = y & 0x2000; |
| 177 | 178 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 182 | 183 | if (x >= 320) x -= 512; |
| 183 | 184 | if (y >= 256) y -= 512; |
| 184 | 185 | y = 240 - y; |
| 185 | ||
| 186 | | |
| 186 | 187 | |
| 187 | // sprite &= ~multi; /* Todo: I bet TumblePop bootleg doesn't do this either */ | |
| 188 | // sprite &= ~multi; /* Todo: I bet TumblePop bootleg doesn't do this either */ | |
| 188 | 189 | if (fy) |
| 189 | 190 | inc = -1; |
| 190 | 191 | else |
| r7500 | r7501 | |
| 193 | 194 | inc = 1; |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | if (flipscreen) | |
| 197 | if (state->flipscreen) | |
| 197 | 198 | { |
| 198 | y=240-y; | |
| 199 | x=304-x; | |
| 200 | if (fx) fx=0; else fx=1; | |
| 201 | if (fy) fy=0; else fy=1; | |
| 202 | mult=16; | |
| 199 | y = 240 - y; | |
| 200 | x = 304 - x; | |
| 201 | if (fx) fx = 0; else fx = 1; | |
| 202 | if (fy) fy = 0; else fy = 1; | |
| 203 | mult = 16; | |
| 203 | 204 | } |
| 204 | else mult=-16; | |
| 205 | else mult = -16; | |
| 205 | 206 | |
| 206 | 207 | while (multi >= 0) |
| 207 | 208 | { |
| r7500 | r7501 | |
| 209 | 210 | sprite - multi * inc, |
| 210 | 211 | colour, |
| 211 | 212 | fx,fy, |
| 212 | sprite_xoffset+x,sprite_yoffset+ y + mult * multi,15); | |
| 213 | state->sprite_xoffset + x, state->sprite_yoffset + y + mult * multi, 15); | |
| 213 | 214 | |
| 214 | 215 | multi--; |
| 215 | 216 | } |
| r7500 | r7501 | |
| 220 | 221 | |
| 221 | 222 | WRITE16_HANDLER( bcstory_tilebank_w ) |
| 222 | 223 | { |
| 223 | bcstory_tilebank = data; | |
| 224 | tilemap_mark_all_tiles_dirty(pf1_tilemap); | |
| 225 | tilemap_mark_all_tiles_dirty(pf1_alt_tilemap); | |
| 226 | tilemap_mark_all_tiles_dirty(pf2_tilemap); | |
| 224 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 225 | ||
| 226 | state->tilebank = data; | |
| 227 | tilemap_mark_all_tiles_dirty(state->pf1_tilemap); | |
| 228 | tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap); | |
| 229 | tilemap_mark_all_tiles_dirty(state->pf2_tilemap); | |
| 227 | 230 | } |
| 228 | 231 | |
| 229 | 232 | WRITE16_HANDLER( chokchok_tilebank_w ) |
| 230 | 233 | { |
| 231 | bcstory_tilebank = data<<1; | |
| 232 | tilemap_mark_all_tiles_dirty(pf1_tilemap); | |
| 233 | tilemap_mark_all_tiles_dirty(pf1_alt_tilemap); | |
| 234 | tilemap_mark_all_tiles_dirty(pf2_tilemap); | |
| 234 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 235 | ||
| 236 | state->tilebank = data << 1; | |
| 237 | tilemap_mark_all_tiles_dirty(state->pf1_tilemap); | |
| 238 | tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap); | |
| 239 | tilemap_mark_all_tiles_dirty(state->pf2_tilemap); | |
| 235 | 240 | } |
| 236 | 241 | |
| 237 | 242 | WRITE16_HANDLER( wlstar_tilebank_w ) |
| 238 | 243 | { |
| 244 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 245 | ||
| 239 | 246 | /* it just writes 0000 or ffff */ |
| 240 | bcstory_tilebank = data&0x4000; | |
| 241 | tilemap_mark_all_tiles_dirty(pf1_tilemap); | |
| 242 | tilemap_mark_all_tiles_dirty(pf1_alt_tilemap); | |
| 243 | tilemap_mark_all_tiles_dirty(pf2_tilemap); | |
| 247 | state->tilebank = data & 0x4000; | |
| 248 | tilemap_mark_all_tiles_dirty(state->pf1_tilemap); | |
| 249 | tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap); | |
| 250 | tilemap_mark_all_tiles_dirty(state->pf2_tilemap); | |
| 244 | 251 | } |
| 245 | 252 | |
| 246 | 253 | |
| 247 | 254 | WRITE16_HANDLER( suprtrio_tilebank_w ) |
| 248 | 255 | { |
| 249 | bcstory_tilebank = data<<14; // shift it here, makes using bcstory_tilebank easier | |
| 250 | tilemap_mark_all_tiles_dirty(pf1_tilemap); | |
| 251 | tilemap_mark_all_tiles_dirty(pf1_alt_tilemap); | |
| 252 | tilemap_mark_all_tiles_dirty(pf2_tilemap); | |
| 256 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 257 | ||
| 258 | state->tilebank = data << 14; // shift it here, makes using bcstory_tilebank easier | |
| 259 | tilemap_mark_all_tiles_dirty(state->pf1_tilemap); | |
| 260 | tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap); | |
| 261 | tilemap_mark_all_tiles_dirty(state->pf2_tilemap); | |
| 253 | 262 | } |
| 254 | 263 | |
| 255 | 264 | |
| 256 | ||
| 257 | ||
| 258 | ||
| 259 | 265 | WRITE16_HANDLER( tumblepb_pf1_data_w ) |
| 260 | 266 | { |
| 261 | COMBINE_DATA(&tumblepb_pf1_data[offset]); | |
| 262 | tilemap_mark_tile_dirty(pf1_tilemap,offset); | |
| 263 | tilemap_mark_tile_dirty(pf1_alt_tilemap,offset); | |
| 267 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 268 | ||
| 269 | COMBINE_DATA(&state->pf1_data[offset]); | |
| 270 | tilemap_mark_tile_dirty(state->pf1_tilemap, offset); | |
| 271 | tilemap_mark_tile_dirty(state->pf1_alt_tilemap, offset); | |
| 264 | 272 | } |
| 265 | 273 | |
| 266 | 274 | WRITE16_HANDLER( tumblepb_pf2_data_w ) |
| 267 | 275 | { |
| 268 | COMBINE_DATA(&tumblepb_pf2_data[offset]); | |
| 269 | tilemap_mark_tile_dirty(pf2_tilemap,offset); | |
| 276 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 270 | 277 | |
| 271 | if (pf2_alt_tilemap) | |
| 272 | tilemap_mark_tile_dirty(pf2_alt_tilemap,offset); | |
| 278 | COMBINE_DATA(&state->pf2_data[offset]); | |
| 279 | tilemap_mark_tile_dirty(state->pf2_tilemap, offset); | |
| 280 | ||
| 281 | if (state->pf2_alt_tilemap) | |
| 282 | tilemap_mark_tile_dirty(state->pf2_alt_tilemap, offset); | |
| 273 | 283 | } |
| 274 | 284 | |
| 275 | 285 | WRITE16_HANDLER( fncywld_pf1_data_w ) |
| 276 | 286 | { |
| 277 | COMBINE_DATA(&tumblepb_pf1_data[offset]); | |
| 278 | tilemap_mark_tile_dirty(pf1_tilemap,offset/2); | |
| 279 | tilemap_mark_tile_dirty(pf1_alt_tilemap,offset/2); | |
| 287 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 288 | ||
| 289 | COMBINE_DATA(&state->pf1_data[offset]); | |
| 290 | tilemap_mark_tile_dirty(state->pf1_tilemap, offset / 2); | |
| 291 | tilemap_mark_tile_dirty(state->pf1_alt_tilemap, offset / 2); | |
| 280 | 292 | } |
| 281 | 293 | |
| 282 | 294 | WRITE16_HANDLER( fncywld_pf2_data_w ) |
| 283 | 295 | { |
| 284 | COMBINE_DATA(&tumblepb_pf2_data[offset]); | |
| 285 | tilemap_mark_tile_dirty(pf2_tilemap,offset/2); | |
| 296 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 297 | ||
| 298 | COMBINE_DATA(&state->pf2_data[offset]); | |
| 299 | tilemap_mark_tile_dirty(state->pf2_tilemap, offset / 2); | |
| 286 | 300 | } |
| 287 | 301 | |
| 288 | 302 | WRITE16_HANDLER( tumblepb_control_0_w ) |
| 289 | 303 | { |
| 290 | COMBINE_DATA(&tumblepb_control_0[offset]); | |
| 304 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 305 | COMBINE_DATA(&state->control_0[offset]); | |
| 291 | 306 | } |
| 292 | 307 | |
| 308 | ||
| 309 | WRITE16_HANDLER( pangpang_pf1_data_w ) | |
| 310 | { | |
| 311 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 312 | ||
| 313 | COMBINE_DATA(&state->pf1_data[offset]); | |
| 314 | tilemap_mark_tile_dirty(state->pf1_tilemap, offset / 2); | |
| 315 | tilemap_mark_tile_dirty(state->pf1_alt_tilemap, offset / 2); | |
| 316 | } | |
| 317 | ||
| 318 | WRITE16_HANDLER( pangpang_pf2_data_w ) | |
| 319 | { | |
| 320 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 321 | ||
| 322 | COMBINE_DATA(&state->pf2_data[offset]); | |
| 323 | tilemap_mark_tile_dirty(state->pf2_tilemap, offset / 2); | |
| 324 | ||
| 325 | if (state->pf2_alt_tilemap) | |
| 326 | tilemap_mark_tile_dirty(state->pf2_alt_tilemap, offset / 2); | |
| 327 | } | |
| 328 | ||
| 293 | 329 | /******************************************************************************/ |
| 294 | 330 | |
| 295 | 331 | static TILEMAP_MAPPER( tumblep_scan ) |
| r7500 | r7501 | |
| 298 | 334 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5); |
| 299 | 335 | } |
| 300 | 336 | |
| 301 | INLINE void get_bg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int gfx_bank,UINT16 *gfx_base) | |
| 337 | INLINE void get_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base) | |
| 302 | 338 | { |
| 339 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 303 | 340 | int data = gfx_base[tile_index]; |
| 304 | 341 | |
| 305 | 342 | SET_TILE_INFO( |
| 306 | 343 | gfx_bank, |
| 307 | (data & 0x0fff)|( | |
| 344 | (data & 0x0fff) | ( | |
| 308 | 345 | data >> 12, |
| 309 | 346 | 0); |
| 310 | 347 | } |
| 311 | 348 | |
| 312 | static TILE_GET_INFO( get_bg1_tile_info ) { get_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); } | |
| 313 | static TILE_GET_INFO( get_bg2_tile_info ) { get_bg_tile_info(machine,tileinfo,tile_index,1,tumblepb_pf2_data); } | |
| 349 | static TILE_GET_INFO( get_bg1_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); } | |
| 350 | static TILE_GET_INFO( get_bg2_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; get_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); } | |
| 314 | 351 | |
| 315 | 352 | static TILE_GET_INFO( get_fg_tile_info ) |
| 316 | 353 | { |
| 317 | int data = tumblepb_pf1_data[tile_index]; | |
| 354 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 355 | int data = state->pf1_data[tile_index]; | |
| 318 | 356 | |
| 319 | 357 | SET_TILE_INFO( |
| 320 | 358 | 0, |
| 321 | (data & 0x0fff)| | |
| 359 | (data & 0x0fff) | | |
| 322 | 360 | data >> 12, |
| 323 | 361 | 0); |
| 324 | 362 | } |
| 325 | 363 | |
| 326 | INLINE void get_fncywld_bg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int gfx_bank,UINT16 *gfx_base) | |
| 364 | INLINE void get_fncywld_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base) | |
| 327 | 365 | { |
| 328 | int data = gfx_base[tile_index*2]; | |
| 329 | int attr = gfx_base[tile_index*2+1]; | |
| 366 | int data = gfx_base[tile_index * 2]; | |
| 367 | int attr = gfx_base[tile_index * 2 + 1]; | |
| 330 | 368 | |
| 331 | 369 | SET_TILE_INFO( |
| 332 | 370 | gfx_bank, |
| r7500 | r7501 | |
| 335 | 373 | 0); |
| 336 | 374 | } |
| 337 | 375 | |
| 338 | static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { get_fncywld_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); } | |
| 339 | static TILE_GET_INFO( get_fncywld_bg2_tile_info ) { get_fncywld_bg_tile_info(machine,tileinfo,tile_index,1,tumblepb_pf2_data); } | |
| 376 | static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); } | |
| 377 | static TILE_GET_INFO( get_fncywld_bg2_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); } | |
| 340 | 378 | |
| 341 | 379 | static TILE_GET_INFO( get_fncywld_fg_tile_info ) |
| 342 | 380 | { |
| 343 | int data = tumblepb_pf1_data[tile_index*2]; | |
| 344 | int attr = tumblepb_pf1_data[tile_index*2+1]; | |
| 381 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 382 | int data = state->pf1_data[tile_index * 2]; | |
| 383 | int attr = state->pf1_data[tile_index * 2 + 1]; | |
| 345 | 384 | |
| 346 | 385 | SET_TILE_INFO( |
| 347 | 386 | 0, |
| r7500 | r7501 | |
| 354 | 393 | /* jump pop */ |
| 355 | 394 | static TILE_GET_INFO( get_jumppop_bg1_tile_info ) |
| 356 | 395 | { |
| 357 | int data = tumblepb_pf1_data[tile_index]; | |
| 396 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 397 | int data = state->pf1_data[tile_index]; | |
| 358 | 398 | |
| 359 | 399 | SET_TILE_INFO( |
| 360 | 400 | 2, |
| r7500 | r7501 | |
| 365 | 405 | |
| 366 | 406 | static TILE_GET_INFO( get_jumppop_bg2_tile_info ) |
| 367 | 407 | { |
| 368 | int data = tumblepb_pf2_data[tile_index]; | |
| 408 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 409 | int data = state->pf2_data[tile_index]; | |
| 369 | 410 | |
| 370 | 411 | SET_TILE_INFO( |
| 371 | 412 | 1, |
| r7500 | r7501 | |
| 376 | 417 | |
| 377 | 418 | static TILE_GET_INFO( get_jumppop_bg2_alt_tile_info ) |
| 378 | 419 | { |
| 379 | int data = tumblepb_pf2_data[tile_index]; | |
| 420 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 421 | int data = state->pf2_data[tile_index]; | |
| 380 | 422 | |
| 381 | 423 | SET_TILE_INFO( |
| 382 | 424 | 0, |
| r7500 | r7501 | |
| 388 | 430 | |
| 389 | 431 | static TILE_GET_INFO( get_jumppop_fg_tile_info ) |
| 390 | 432 | { |
| 391 | int data = tumblepb_pf1_data[tile_index]; | |
| 433 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 434 | int data = state->pf1_data[tile_index]; | |
| 392 | 435 | |
| 393 | 436 | SET_TILE_INFO( |
| 394 | 437 | 0, |
| r7500 | r7501 | |
| 397 | 440 | 0); |
| 398 | 441 | } |
| 399 | 442 | |
| 400 | ||
| 401 | WRITE16_HANDLER( pangpang_pf1_data_w ) | |
| 443 | INLINE void pangpang_get_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base ) | |
| 402 | 444 | { |
| 403 | COMBINE_DATA(&tumblepb_pf1_data[offset]); | |
| 404 | tilemap_mark_tile_dirty(pf1_tilemap,offset/2); | |
| 405 | tilemap_mark_tile_dirty(pf1_alt_tilemap,offset/2); | |
| 406 | } | |
| 445 | int data = gfx_base[tile_index * 2 + 1]; | |
| 446 | int attr = gfx_base[tile_index * 2]; | |
| 407 | 447 | |
| 408 | WRITE16_HANDLER( pangpang_pf2_data_w ) | |
| 409 | { | |
| 410 | COMBINE_DATA(&tumblepb_pf2_data[offset]); | |
| 411 | tilemap_mark_tile_dirty(pf2_tilemap,offset/2); | |
| 412 | ||
| 413 | if (pf2_alt_tilemap) | |
| 414 | tilemap_mark_tile_dirty(pf2_alt_tilemap,offset/2); | |
| 415 | } | |
| 416 | ||
| 417 | ||
| 418 | ||
| 419 | INLINE void pangpang_get_bg_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,int gfx_bank,UINT16 *gfx_base) | |
| 420 | { | |
| 421 | int data = gfx_base[tile_index*2+1]; | |
| 422 | int attr = gfx_base[tile_index*2]; | |
| 423 | ||
| 424 | 448 | SET_TILE_INFO( |
| 425 | 449 | gfx_bank, |
| 426 | 450 | data & 0x1fff, |
| r7500 | r7501 | |
| 428 | 452 | 0); |
| 429 | 453 | } |
| 430 | 454 | |
| 431 | INLINE void pangpang_get_bg2x_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,int gfx_bank,UINT16 *gfx_base) | |
| 455 | INLINE void pangpang_get_bg2x_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base ) | |
| 432 | 456 | { |
| 433 | int data = gfx_base[tile_index*2+1]; | |
| 434 | int attr = gfx_base[tile_index*2]; | |
| 457 | int data = gfx_base[tile_index * 2 + 1]; | |
| 458 | int attr = gfx_base[tile_index * 2]; | |
| 435 | 459 | |
| 436 | 460 | SET_TILE_INFO( |
| 437 | 461 | gfx_bank, |
| 438 | (data & 0xfff)+0x1000, | |
| 462 | (data & 0xfff) + 0x1000, | |
| 439 | 463 | (attr >>12) & 0xf, |
| 440 | 464 | 0); |
| 441 | 465 | } |
| 442 | 466 | |
| 443 | 467 | |
| 444 | static TILE_GET_INFO( pangpang_get_bg1_tile_info ) { pangpang_get_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); } | |
| 445 | static TILE_GET_INFO( pangpang_get_bg2_tile_info ) { pangpang_get_bg2x_tile_info(machine,tileinfo,tile_index,1,tumblepb_pf2_data); } | |
| 468 | static TILE_GET_INFO( pangpang_get_bg1_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; pangpang_get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); } | |
| 469 | static TILE_GET_INFO( pangpang_get_bg2_tile_info ) { tumbleb_state *state = (tumbleb_state *)machine->driver_data; pangpang_get_bg2x_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); } | |
| 446 | 470 | |
| 447 | 471 | static TILE_GET_INFO( pangpang_get_fg_tile_info ) |
| 448 | 472 | { |
| 449 | int data = tumblepb_pf1_data[tile_index*2+1]; | |
| 450 | int attr = tumblepb_pf1_data[tile_index*2]; | |
| 473 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 474 | int data = state->pf1_data[tile_index * 2 + 1]; | |
| 475 | int attr = state->pf1_data[tile_index * 2]; | |
| 451 | 476 | |
| 452 | 477 | SET_TILE_INFO( |
| 453 | 478 | 0, |
| r7500 | r7501 | |
| 457 | 482 | } |
| 458 | 483 | |
| 459 | 484 | |
| 485 | static STATE_POSTLOAD( tumbleb_tilemap_redraw ) | |
| 486 | { | |
| 487 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 488 | ||
| 489 | tilemap_mark_all_tiles_dirty(state->pf1_tilemap); | |
| 490 | tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap); | |
| 491 | tilemap_mark_all_tiles_dirty(state->pf2_tilemap); | |
| 492 | if (state->pf2_alt_tilemap) | |
| 493 | tilemap_mark_all_tiles_dirty(state->pf2_alt_tilemap); | |
| 494 | } | |
| 495 | ||
| 460 | 496 | VIDEO_START( pangpang ) |
| 461 | 497 | { |
| 462 | pf1_tilemap = tilemap_create(machine, pangpang_get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32); | |
| 463 | pf1_alt_tilemap = tilemap_create(machine, pangpang_get_bg1_tile_info,tumblep_scan,16,16,64,32); | |
| 464 | pf2_tilemap = tilemap_create(machine, pangpang_get_bg2_tile_info,tumblep_scan, 16,16,64,32); | |
| 498 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 465 | 499 | |
| 466 | tilemap_set_transparent_pen(pf1_tilemap,0); | |
| 467 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); | |
| 468 | bcstory_tilebank = 0; | |
| 500 | state->pf1_tilemap = tilemap_create(machine, pangpang_get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 501 | state->pf1_alt_tilemap = tilemap_create(machine, pangpang_get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 502 | state->pf2_tilemap = tilemap_create(machine, pangpang_get_bg2_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 469 | 503 | |
| 470 | sprite_xoffset = -1; | |
| 471 | sprite_yoffset = 0; | |
| 504 | tilemap_set_transparent_pen(state->pf1_tilemap, 0); | |
| 505 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0); | |
| 506 | ||
| 507 | state->sprite_xoffset = -1; | |
| 508 | state->sprite_yoffset = 0; | |
| 509 | ||
| 510 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 472 | 511 | } |
| 473 | 512 | |
| 474 | 513 | |
| 475 | 514 | VIDEO_START( tumblepb ) |
| 476 | 515 | { |
| 477 | pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32); | |
| 478 | pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info,tumblep_scan,16,16,64,32); | |
| 479 | pf2_tilemap = tilemap_create(machine, get_bg2_tile_info,tumblep_scan, 16,16,64,32); | |
| 516 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 480 | 517 | |
| 481 | tilemap_set_transparent_pen(pf1_tilemap,0); | |
| 482 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); | |
| 483 | bcstory_tilebank = 0; | |
| 518 | state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 519 | state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 520 | state->pf2_tilemap = tilemap_create(machine, get_bg2_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 484 | 521 | |
| 485 | sprite_xoffset = -1; | |
| 486 | sprite_yoffset = 0; | |
| 522 | tilemap_set_transparent_pen(state->pf1_tilemap, 0); | |
| 523 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0); | |
| 524 | ||
| 525 | state->sprite_xoffset = -1; | |
| 526 | state->sprite_yoffset = 0; | |
| 527 | ||
| 528 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 487 | 529 | } |
| 488 | 530 | |
| 489 | 531 | VIDEO_START( sdfight ) |
| 490 | 532 | { |
| 491 | pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,64); // 64*64 to prevent bad tilemap wrapping? - check real behavior | |
| 492 | pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info,tumblep_scan,16,16,64,32); | |
| 493 | pf2_tilemap = tilemap_create(machine, get_bg2_tile_info,tumblep_scan, 16,16,64,32); | |
| 533 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 494 | 534 | |
| 495 | tilemap_set_transparent_pen(pf1_tilemap,0); | |
| 496 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); | |
| 497 | bcstory_tilebank = 0; | |
| 535 | state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 64); // 64*64 to prevent bad tilemap wrapping? - check real behavior | |
| 536 | state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 537 | state->pf2_tilemap = tilemap_create(machine, get_bg2_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 498 | 538 | |
| 539 | tilemap_set_transparent_pen(state->pf1_tilemap, 0); | |
| 540 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0); | |
| 541 | ||
| 499 | 542 | /* aligned to monitor test */ |
| 500 | sprite_xoffset = 0; | |
| 501 | sprite_yoffset = 1; | |
| 543 | state->sprite_xoffset = 0; | |
| 544 | state->sprite_yoffset = 1; | |
| 545 | ||
| 546 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 502 | 547 | } |
| 503 | 548 | |
| 504 | 549 | VIDEO_START( fncywld ) |
| 505 | 550 | { |
| 506 | pf1_tilemap = tilemap_create(machine, get_fncywld_fg_tile_info, tilemap_scan_rows, 8, 8,64,32); | |
| 507 | pf1_alt_tilemap = tilemap_create(machine, get_fncywld_bg1_tile_info,tumblep_scan,16,16,64,32); | |
| 508 | pf2_tilemap = tilemap_create(machine, get_fncywld_bg2_tile_info,tumblep_scan, 16,16,64,32); | |
| 551 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 509 | 552 | |
| 510 | tilemap_set_transparent_pen(pf1_tilemap,15); | |
| 511 | tilemap_set_transparent_pen(pf1_alt_tilemap,15); | |
| 512 | bcstory_tilebank = 0; | |
| 553 | state->pf1_tilemap = tilemap_create(machine, get_fncywld_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 554 | state->pf1_alt_tilemap = tilemap_create(machine, get_fncywld_bg1_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 555 | state->pf2_tilemap = tilemap_create(machine, get_fncywld_bg2_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 513 | 556 | |
| 514 | sprite_xoffset = -1; | |
| 515 | sprite_yoffset = 0; | |
| 557 | tilemap_set_transparent_pen(state->pf1_tilemap, 15); | |
| 558 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 15); | |
| 559 | ||
| 560 | state->sprite_xoffset = -1; | |
| 561 | state->sprite_yoffset = 0; | |
| 562 | ||
| 563 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 516 | 564 | } |
| 517 | 565 | |
| 518 | 566 | VIDEO_START( jumppop ) |
| 519 | 567 | { |
| 520 | pf1_tilemap = tilemap_create(machine, get_jumppop_fg_tile_info, tilemap_scan_rows, 8, 8,128,64); | |
| 521 | pf1_alt_tilemap = tilemap_create(machine, get_jumppop_bg1_tile_info,tilemap_scan_rows,16,16,64,64); | |
| 522 | pf2_tilemap = tilemap_create(machine, get_jumppop_bg2_tile_info,tilemap_scan_rows, 16,16,64,64); | |
| 523 | pf2_alt_tilemap = tilemap_create(machine, get_jumppop_bg2_alt_tile_info,tilemap_scan_rows, 8,8,128,64); | |
| 568 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 524 | 569 | |
| 525 | tilemap_set_transparent_pen(pf1_tilemap,0); | |
| 526 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); | |
| 570 | state->pf1_tilemap = tilemap_create(machine, get_jumppop_fg_tile_info, tilemap_scan_rows, 8, 8, 128, 64); | |
| 571 | state->pf1_alt_tilemap = tilemap_create(machine, get_jumppop_bg1_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 572 | state->pf2_tilemap = tilemap_create(machine, get_jumppop_bg2_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 573 | state->pf2_alt_tilemap = tilemap_create(machine, get_jumppop_bg2_alt_tile_info, tilemap_scan_rows, 8, 8, 128, 64); | |
| 527 | 574 | |
| 528 | tilemap_set_flip(pf1_tilemap, TILEMAP_FLIPX); | |
| 529 | tilemap_set_flip(pf1_alt_tilemap, TILEMAP_FLIPX); | |
| 530 | tilemap_set_flip(pf2_tilemap, TILEMAP_FLIPX); | |
| 531 | tilemap_set_flip(pf2_alt_tilemap, TILEMAP_FLIPX); | |
| 532 | bcstory_tilebank = 0; | |
| 575 | tilemap_set_transparent_pen(state->pf1_tilemap, 0); | |
| 576 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0); | |
| 533 | 577 | |
| 534 | sprite_xoffset = -1; | |
| 535 | sprite_yoffset = 0; | |
| 578 | tilemap_set_flip(state->pf1_tilemap, TILEMAP_FLIPX); | |
| 579 | tilemap_set_flip(state->pf1_alt_tilemap, TILEMAP_FLIPX); | |
| 580 | tilemap_set_flip(state->pf2_tilemap, TILEMAP_FLIPX); | |
| 581 | tilemap_set_flip(state->pf2_alt_tilemap, TILEMAP_FLIPX); | |
| 582 | ||
| 583 | state->sprite_xoffset = -1; | |
| 584 | state->sprite_yoffset = 0; | |
| 585 | ||
| 586 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 536 | 587 | } |
| 537 | 588 | |
| 538 | 589 | |
| 590 | VIDEO_START( suprtrio ) | |
| 591 | { | |
| 592 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 593 | ||
| 594 | state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 595 | state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 596 | state->pf2_tilemap = tilemap_create(machine, get_bg2_tile_info, tumblep_scan, 16, 16, 64, 32); | |
| 597 | ||
| 598 | tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0); | |
| 599 | ||
| 600 | state_save_register_postload(machine, tumbleb_tilemap_redraw, NULL); | |
| 601 | } | |
| 602 | ||
| 539 | 603 | /******************************************************************************/ |
| 540 | 604 | |
| 541 | 605 | |
| 542 | 606 | VIDEO_UPDATE( tumblepb ) |
| 543 | 607 | { |
| 544 | int offs,offs2; | |
| 608 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 609 | int offs, offs2; | |
| 545 | 610 | |
| 546 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 547 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 548 | if (flipscreen) offs=1; else offs=-1; | |
| 549 | if (flipscreen) offs2=-3; else offs2=-5; | |
| 611 | state->flipscreen = state->control_0[0] & 0x80; | |
| 612 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 550 | 613 | |
| 551 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 552 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 553 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 554 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 555 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 556 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 614 | if (state->flipscreen) | |
| 615 | offs = 1; | |
| 616 | else | |
| 617 | offs = -1; | |
| 557 | 618 | |
| 558 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 559 | if (tumblepb_control_0[6]&0x80) | |
| 560 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 619 | if (state->flipscreen) | |
| 620 | offs2 = -3; | |
| 561 | 621 | else |
| 562 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 563 | tumblepb_draw_sprites(screen->machine,bitmap,cliprect); | |
| 622 | offs2 = -5; | |
| 623 | ||
| 624 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 625 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 626 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 627 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 628 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 629 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 630 | ||
| 631 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 632 | ||
| 633 | if (state->control_0[6] & 0x80) | |
| 634 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 635 | else | |
| 636 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 637 | ||
| 638 | tumblepb_draw_sprites(screen->machine, bitmap, cliprect); | |
| 564 | 639 | return 0; |
| 565 | 640 | } |
| 566 | 641 | |
| 567 | 642 | VIDEO_UPDATE( jumpkids ) |
| 568 | 643 | { |
| 569 | int offs,offs2; | |
| 644 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 645 | int offs, offs2; | |
| 570 | 646 | |
| 571 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 572 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 573 | if (flipscreen) offs=1; else offs=-1; | |
| 574 | if (flipscreen) offs2=-3; else offs2=-5; | |
| 647 | state->flipscreen = state->control_0[0] & 0x80; | |
| 648 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 575 | 649 | |
| 576 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 577 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 578 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 579 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 580 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 581 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 650 | if (state->flipscreen) | |
| 651 | offs = 1; | |
| 652 | else | |
| 653 | offs = -1; | |
| 582 | 654 | |
| 583 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 584 | if (tumblepb_control_0[6]&0x80) | |
| 585 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 655 | if (state->flipscreen) | |
| 656 | offs2 = -3; | |
| 586 | 657 | else |
| 587 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 588 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 658 | offs2 = -5; | |
| 659 | ||
| 660 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 661 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 662 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 663 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 664 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 665 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 666 | ||
| 667 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 668 | ||
| 669 | if (state->control_0[6] & 0x80) | |
| 670 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 671 | else | |
| 672 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 673 | ||
| 674 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 589 | 675 | return 0; |
| 590 | 676 | } |
| 591 | 677 | |
| 592 | 678 | VIDEO_UPDATE( semicom ) |
| 593 | 679 | { |
| 594 | int offs,offs2; | |
| 680 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 681 | int offs, offs2; | |
| 595 | 682 | |
| 596 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 597 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 598 | if (flipscreen) offs=1; else offs=-1; /* fixed */ | |
| 599 | if (flipscreen) offs2=-3; else offs2=-5; /* fixed */ | |
| 683 | state->flipscreen = state->control_0[0] & 0x80; | |
| 684 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 600 | 685 | |
| 601 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 602 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 603 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 604 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 605 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 606 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 686 | if (state->flipscreen) | |
| 687 | offs = 1; | |
| 688 | else | |
| 689 | offs = -1; | |
| 607 | 690 | |
| 608 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 609 | if (tumblepb_control_0[6]&0x80) | |
| 610 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 691 | if (state->flipscreen) | |
| 692 | offs2 = -3; | |
| 611 | 693 | else |
| 612 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 613 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 694 | offs2 = -5; | |
| 695 | ||
| 696 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 697 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 698 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 699 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 700 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 701 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 702 | ||
| 703 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 704 | ||
| 705 | if (state->control_0[6] & 0x80) | |
| 706 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 707 | else | |
| 708 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 709 | ||
| 710 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 614 | 711 | return 0; |
| 615 | 712 | } |
| 616 | 713 | |
| 617 | 714 | VIDEO_UPDATE( semicom_altoffsets ) |
| 618 | 715 | { |
| 619 | int offsx,offsy,offsx2; | |
| 716 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 717 | int offsx, offsy, offsx2; | |
| 620 | 718 | |
| 621 | flipscreen=t | |
| 719 | state->flipscreen = stat | |
| 622 | 720 | |
| 623 | 721 | offsx = -1; |
| 624 | 722 | offsy = 2; |
| 625 | 723 | offsx2 = -5; |
| 626 | 724 | |
| 627 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offsx2 ); | |
| 628 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 629 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offsx2 ); | |
| 630 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 631 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offsx ); | |
| 632 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4]+offsy ); | |
| 725 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offsx2); | |
| 726 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 727 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offsx2); | |
| 728 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 729 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offsx); | |
| 730 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4] + offsy); | |
| 633 | 731 | |
| 634 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 635 | if (tumblepb_control_0[6]&0x80) | |
| 636 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 732 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 733 | ||
| 734 | if (state->control_0[6] & 0x80) | |
| 735 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 637 | 736 | else |
| 638 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 639 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 737 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 738 | ||
| 739 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 640 | 740 | return 0; |
| 641 | 741 | } |
| 642 | 742 | |
| 643 | 743 | VIDEO_UPDATE( bcstory ) |
| 644 | 744 | { |
| 645 | int offs,offs2; | |
| 745 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 746 | int offs, offs2; | |
| 646 | 747 | |
| 647 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 648 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 649 | if (flipscreen) offs=1; else offs=8; /* not sure of this */ | |
| 650 | if (flipscreen) offs2=-3; else offs2=8; /* not sure of this */ | |
| 748 | state->flipscreen = state->control_0[0] & 0x80; | |
| 749 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 651 | 750 | |
| 652 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 653 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 654 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 655 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 656 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 657 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 751 | /* not sure of this */ | |
| 752 | if (state->flipscreen) | |
| 753 | offs = 1; | |
| 754 | else | |
| 755 | offs = 8; | |
| 658 | 756 | |
| 659 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 660 | if (tumblepb_control_0[6]&0x80) | |
| 661 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 757 | /* not sure of this */ | |
| 758 | if (state->flipscreen) | |
| 759 | offs2 = -3; | |
| 662 | 760 | else |
| 663 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 664 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 761 | offs2 = 8; | |
| 762 | ||
| 763 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 764 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 765 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 766 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 767 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 768 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 769 | ||
| 770 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 771 | ||
| 772 | if (state->control_0[6] & 0x80) | |
| 773 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 774 | else | |
| 775 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 776 | ||
| 777 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 665 | 778 | return 0; |
| 666 | 779 | } |
| 667 | 780 | |
| 668 | 781 | VIDEO_UPDATE( semibase ) |
| 669 | 782 | { |
| 670 | int offs,offs2; | |
| 783 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 784 | int offs, offs2; | |
| 671 | 785 | |
| 672 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 673 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 674 | offs=-1; | |
| 675 | offs2=-2; | |
| 786 | state->flipscreen = state->control_0[0] & 0x80; | |
| 787 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 788 | offs = -1; | |
| 789 | offs2 = -2; | |
| 676 | 790 | |
| 677 | 791 | /* sprites need an offset too */ |
| 792 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 793 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 794 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 795 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 796 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 797 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 678 | 798 | |
| 679 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 680 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 681 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 682 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 683 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 684 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 799 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 685 | 800 | |
| 686 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 687 | if (tumblepb_control_0[6]&0x80) | |
| 688 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 801 | if (state->control_0[6] & 0x80) | |
| 802 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 689 | 803 | else |
| 690 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 691 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 804 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 805 | ||
| 806 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 692 | 807 | return 0; |
| 693 | 808 | } |
| 694 | 809 | |
| 695 | 810 | VIDEO_UPDATE( sdfight ) |
| 696 | 811 | { |
| 697 | int offs,offs2; | |
| 812 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 813 | int offs, offs2; | |
| 698 | 814 | |
| 699 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 700 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 701 | offs=-1; | |
| 702 | offs2=-5; // foreground scroll.. | |
| 815 | state->flipscreen = state->control_0[0] & 0x80; | |
| 816 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 817 | offs = -1; | |
| 818 | offs2 = -5; // foreground scroll.. | |
| 703 | 819 | |
| 704 | 820 | /* sprites need an offset too */ |
| 821 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 822 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2] - 16); // needed for the ground ... | |
| 823 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 824 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2] - 16); | |
| 825 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 826 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 705 | 827 | |
| 706 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 707 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2]-16 ); // needed for the ground ... | |
| 708 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 709 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2]-16 ); | |
| 710 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 711 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 828 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 829 | if (state->control_0[6] & 0x80) | |
| 830 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 831 | else | |
| 832 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 712 | 833 | |
| 713 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 714 | if (tumblepb_control_0[6]&0x80) | |
| 715 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 716 | else | |
| 717 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 718 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 834 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 719 | 835 | return 0; |
| 720 | 836 | } |
| 721 | 837 | |
| r7500 | r7501 | |
| 723 | 839 | |
| 724 | 840 | VIDEO_UPDATE( fncywld ) |
| 725 | 841 | { |
| 726 | int offs,offs2; | |
| 842 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 843 | int offs, offs2; | |
| 727 | 844 | |
| 728 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 729 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 730 | if (flipscreen) offs=1; else offs=-1; | |
| 731 | if (flipscreen) offs2=-3; else offs2=-5; | |
| 845 | state->flipscreen = state->control_0[0] & 0x80; | |
| 846 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 732 | 847 | |
| 733 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 734 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 735 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 736 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 737 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 738 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 848 | if (state->flipscreen) | |
| 849 | offs = 1; | |
| 850 | else | |
| 851 | offs = -1; | |
| 739 | 852 | |
| 740 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 741 | if (tumblepb_control_0[6]&0x80) | |
| 742 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 853 | if (state->flipscreen) | |
| 854 | offs2 = -3; | |
| 743 | 855 | else |
| 744 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 745 | fncywld_draw_sprites(screen->machine,bitmap,cliprect); | |
| 856 | offs2 = -5; | |
| 857 | ||
| 858 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 859 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 860 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 861 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 862 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 863 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 864 | ||
| 865 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 866 | ||
| 867 | if (state->control_0[6] & 0x80) | |
| 868 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 869 | else | |
| 870 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 871 | ||
| 872 | fncywld_draw_sprites(screen->machine, bitmap, cliprect); | |
| 746 | 873 | return 0; |
| 747 | 874 | } |
| 748 | 875 | |
| 749 | 876 | |
| 750 | 877 | VIDEO_UPDATE( jumppop ) |
| 751 | 878 | { |
| 752 | ||
| 879 | | |
| 753 | 880 | |
| 754 | tilemap_set_scrollx( pf1_tilemap,0, jumppop_control[2]-0x3a0 ); | |
| 755 | tilemap_set_scrolly( pf1_tilemap,0, jumppop_control[3] ); | |
| 756 | tilemap_set_scrollx( pf1_alt_tilemap,0, jumppop_control[2]-0x3a0 ); | |
| 757 | tilemap_set_scrolly( pf1_alt_tilemap,0, jumppop_control[3] ); | |
| 758 | tilemap_set_scrollx( pf2_tilemap,0, jumppop_control[0]-0x3a2 ); | |
| 759 | tilemap_set_scrolly( pf2_tilemap,0, jumppop_control[1] ); | |
| 760 | tilemap_set_scrollx( pf2_alt_tilemap,0, jumppop_control[0]-0x3a2 ); | |
| 761 | tilemap_set_scrolly( pf2_alt_tilemap,0, jumppop_control[1] ); | |
| 881 | // bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 762 | 882 | |
| 763 | if (jumppop_control[7]&1) | |
| 764 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 883 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control[2] - 0x3a0); | |
| 884 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control[3]); | |
| 885 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control[2] - 0x3a0); | |
| 886 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control[3]); | |
| 887 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control[0] - 0x3a2); | |
| 888 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control[1]); | |
| 889 | tilemap_set_scrollx(state->pf2_alt_tilemap, 0, state->control[0] - 0x3a2); | |
| 890 | tilemap_set_scrolly(state->pf2_alt_tilemap, 0, state->control[1]); | |
| 891 | ||
| 892 | if (state->control[7] & 1) | |
| 893 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 765 | 894 | else |
| 766 | tilemap_draw(bitmap,cliprect,pf2_alt_tilemap,0,0); | |
| 895 | tilemap_draw(bitmap, cliprect, state->pf2_alt_tilemap, 0, 0); | |
| 767 | 896 | |
| 768 | if (jumppop_control[7]&2) | |
| 769 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 897 | if (state->control[7] & 2) | |
| 898 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 770 | 899 | else |
| 771 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 900 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 772 | 901 | |
| 773 | //popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", | |
| 902 | //popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", state-> | |
| 774 | 903 | |
| 775 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 904 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 776 | 905 | return 0; |
| 777 | 906 | } |
| 778 | 907 | |
| 779 | 908 | |
| 780 | 909 | VIDEO_UPDATE( suprtrio ) |
| 781 | 910 | { |
| 782 | tilemap_set_scrollx( pf1_alt_tilemap,0, -suprtrio_control[1]-6 ); | |
| 783 | tilemap_set_scrolly( pf1_alt_tilemap,0, -suprtrio_control[2] ); | |
| 784 | tilemap_set_scrollx( pf2_tilemap,0, -suprtrio_control[3]-2 ); | |
| 785 | tilemap_set_scrolly( pf2_tilemap,0, -suprtrio_control[4] ); | |
| 911 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 786 | 912 | |
| 787 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 788 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 913 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, -state->control[1] - 6); | |
| 914 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, -state->control[2]); | |
| 915 | tilemap_set_scrollx(state->pf2_tilemap, 0, -state->control[3] - 2); | |
| 916 | tilemap_set_scrolly(state->pf2_tilemap, 0, -state->control[4]); | |
| 789 | 917 | |
| 790 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 918 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 919 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 920 | ||
| 921 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 791 | 922 | #if 0 |
| 792 | 923 | popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", |
| 793 | suprtrio_control[0], | |
| 794 | suprtrio_control[1], | |
| 795 | suprtrio_control[2], | |
| 796 | suprtrio_control[3], | |
| 797 | suprtrio_control[4], | |
| 798 | suprtrio_control[5], | |
| 799 | suprtrio_control[6], | |
| 800 | suprtrio_control[7]); | |
| 924 | state->control[0], | |
| 925 | state->control[1], | |
| 926 | state->control[2], | |
| 927 | state->control[3], | |
| 928 | state->control[4], | |
| 929 | state->control[5], | |
| 930 | state->control[6], | |
| 931 | state->control[7]); | |
| 801 | 932 | #endif |
| 802 | 933 | |
| 803 | 934 | return 0; |
| r7500 | r7501 | |
| 805 | 936 | |
| 806 | 937 | VIDEO_UPDATE( pangpang ) |
| 807 | 938 | { |
| 808 | int offs,offs2; | |
| 939 | tumbleb_state *state = (tumbleb_state *)screen->machine->driver_data; | |
| 940 | int offs, offs2; | |
| 809 | 941 | |
| 810 | flipscreen=tumblepb_control_0[0]&0x80; | |
| 811 | tilemap_set_flip_all(screen->machine,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 812 | if (flipscreen) offs=1; else offs=-1; | |
| 813 | if (flipscreen) offs2=-3; else offs2=-5; | |
| 942 | state->flipscreen = state->control_0[0] & 0x80; | |
| 943 | tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 814 | 944 | |
| 815 | tilemap_set_scrollx( pf1_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 816 | tilemap_set_scrolly( pf1_tilemap,0, tumblepb_control_0[2] ); | |
| 817 | tilemap_set_scrollx( pf1_alt_tilemap,0, tumblepb_control_0[1]+offs2 ); | |
| 818 | tilemap_set_scrolly( pf1_alt_tilemap,0, tumblepb_control_0[2] ); | |
| 819 | tilemap_set_scrollx( pf2_tilemap,0, tumblepb_control_0[3]+offs ); | |
| 820 | tilemap_set_scrolly( pf2_tilemap,0, tumblepb_control_0[4] ); | |
| 945 | if (state->flipscreen) | |
| 946 | offs = 1; | |
| 947 | else | |
| 948 | offs = -1; | |
| 821 | 949 | |
| 822 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); | |
| 823 | if (tumblepb_control_0[6]&0x80) | |
| 824 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); | |
| 950 | if (state->flipscreen) | |
| 951 | offs2 = -3; | |
| 825 | 952 | else |
| 826 | tilemap_draw(bitmap,cliprect,pf1_alt_tilemap,0,0); | |
| 827 | jumpkids_draw_sprites(screen->machine,bitmap,cliprect); | |
| 828 | return 0; | |
| 829 | } | |
| 953 | offs2 = -5; | |
| 830 | 954 | |
| 831 | VIDEO_START( suprtrio ) | |
| 832 | { | |
| 833 | pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32); | |
| 834 | pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info,tumblep_scan,16,16,64,32); | |
| 835 | pf2_tilemap = tilemap_create(machine, get_bg2_tile_info,tumblep_scan, 16,16,64,32); | |
| 955 | tilemap_set_scrollx(state->pf1_tilemap, 0, state->control_0[1] + offs2); | |
| 956 | tilemap_set_scrolly(state->pf1_tilemap, 0, state->control_0[2]); | |
| 957 | tilemap_set_scrollx(state->pf1_alt_tilemap, 0, state->control_0[1] + offs2); | |
| 958 | tilemap_set_scrolly(state->pf1_alt_tilemap, 0, state->control_0[2]); | |
| 959 | tilemap_set_scrollx(state->pf2_tilemap, 0, state->control_0[3] + offs); | |
| 960 | tilemap_set_scrolly(state->pf2_tilemap, 0, state->control_0[4]); | |
| 836 | 961 | |
| 837 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); | |
| 838 | bcstory_tilebank = 0; | |
| 839 | } | |
| 962 | tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0); | |
| 840 | 963 | |
| 964 | if (state->control_0[6] & 0x80) | |
| 965 | tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0); | |
| 966 | else | |
| 967 | tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0); | |
| 841 | 968 | |
| 969 | jumpkids_draw_sprites(screen->machine, bitmap, cliprect); | |
| 970 | return 0; | |
| 971 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /******************************************************************************* |
| 2 | 2 | |
| 3 | Momoko 120% (c) 1986 Jaleco | |
| 3 | Momoko 120% (c) 1986 Jaleco | |
| 4 | 4 | |
| 5 | Video hardware driver by Uki | |
| 5 | Video hardware driver by Uki | |
| 6 | 6 | |
| 7 | 7 | 02/Mar/2001 - |
| 8 | 8 | |
| 9 | 9 | *******************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "includes/momoko.h" | |
| 12 | 13 | |
| 13 | UINT8 *momoko_bg_scrollx; | |
| 14 | UINT8 *momoko_bg_scrolly; | |
| 15 | static UINT8 momoko_fg_scrollx; | |
| 16 | static UINT8 momoko_fg_scrolly; | |
| 17 | static UINT8 momoko_fg_select; | |
| 18 | static UINT8 momoko_text_scrolly; | |
| 19 | static UINT8 momoko_text_mode; | |
| 20 | static UINT8 momoko_bg_select; | |
| 21 | static UINT8 momoko_bg_priority; | |
| 22 | static UINT8 momoko_bg_mask; | |
| 23 | static UINT8 momoko_fg_mask; | |
| 24 | static UINT8 momoko_flipscreen; | |
| 25 | 14 | |
| 26 | /****************************************************************************/ | |
| 27 | ||
| 28 | 15 | WRITE8_HANDLER ( momoko_fg_scrollx_w ) |
| 29 | 16 | { |
| 30 | momoko_fg_scrollx = data; | |
| 17 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 18 | state->fg_scrollx = data; | |
| 31 | 19 | } |
| 20 | ||
| 32 | 21 | WRITE8_HANDLER ( momoko_fg_scrolly_w ) |
| 33 | 22 | { |
| 34 | momoko_fg_scrolly = data; | |
| 23 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 24 | state->fg_scrolly = data; | |
| 35 | 25 | } |
| 26 | ||
| 36 | 27 | WRITE8_HANDLER ( momoko_fg_select_w ) |
| 37 | 28 | { |
| 38 | momoko_fg_select = data & 0x0f; | |
| 39 | momoko_fg_mask = data & 0x10; | |
| 29 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 30 | state->fg_select = data & 0x0f; | |
| 31 | state->fg_mask = data & 0x10; | |
| 40 | 32 | } |
| 33 | ||
| 41 | 34 | WRITE8_HANDLER ( momoko_text_scrolly_w ) |
| 42 | 35 | { |
| 43 | momoko_text_scrolly = data; | |
| 36 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 37 | state->text_scrolly = data; | |
| 44 | 38 | } |
| 39 | ||
| 45 | 40 | WRITE8_HANDLER ( momoko_text_mode_w ) |
| 46 | 41 | { |
| 47 | momoko_text_mode = data; | |
| 42 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 43 | state->text_mode = data; | |
| 48 | 44 | } |
| 45 | ||
| 49 | 46 | WRITE8_HANDLER ( momoko_bg_scrollx_w ) |
| 50 | 47 | { |
| 51 | momoko_bg_scrollx[ offset ] = data; | |
| 48 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 49 | state->bg_scrollx[offset] = data; | |
| 52 | 50 | } |
| 51 | ||
| 53 | 52 | WRITE8_HANDLER ( momoko_bg_scrolly_w ) |
| 54 | 53 | { |
| 55 | momoko_bg_scrolly[ offset ] = data; | |
| 54 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 55 | state->bg_scrolly[offset] = data; | |
| 56 | 56 | } |
| 57 | ||
| 57 | 58 | WRITE8_HANDLER( momoko_bg_select_w ) |
| 58 | 59 | { |
| 59 | momoko_bg_select = data & 0x0f; | |
| 60 | momoko_bg_mask = data & 0x10; | |
| 60 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 61 | state->bg_select = data & 0x0f; | |
| 62 | state->bg_mask = data & 0x10; | |
| 61 | 63 | } |
| 64 | ||
| 62 | 65 | WRITE8_HANDLER( momoko_bg_priority_w ) |
| 63 | 66 | { |
| 64 | momoko_bg_priority = data & 0x01; | |
| 67 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 68 | state->bg_priority = data & 0x01; | |
| 65 | 69 | } |
| 70 | ||
| 66 | 71 | WRITE8_HANDLER( momoko_flipscreen_w ) |
| 67 | 72 | { |
| 68 | momoko_flipscreen = data & 0x01; | |
| 73 | momoko_state *state = (momoko_state *)space->machine->driver_data; | |
| 74 | state->flipscreen = data & 0x01; | |
| 69 | 75 | } |
| 76 | ||
| 70 | 77 | /****************************************************************************/ |
| 71 | 78 | |
| 72 | static void momoko_draw_bg_pri(running_machine *machine, bitmap_t *bitmap, int chr, int col, int flipx, int flipy, int x,int y, int pri) | |
| 79 | static void momoko_draw_bg_pri( running_machine *machine, bitmap_t *bitmap, int chr, int col, int flipx, int flipy, int x, int y, int pri ) | |
| 73 | 80 | { |
| 74 | int xx,sx,sy,px,py,dot; | |
| 81 | int xx, sx, sy, px, py, dot; | |
| 75 | 82 | UINT32 gfxadr; |
| 76 | 83 | UINT8 d0, d1; |
| 77 | UINT8 *BG_GFX = memory_region( machine, "gfx2" ); | |
| 78 | for (sy=0; sy<8; sy++) | |
| 84 | UINT8 *BG_GFX = memory_region(machine, "gfx2"); | |
| 85 | ||
| 86 | for (sy = 0; sy < 8; sy++) | |
| 79 | 87 | { |
| 80 | gfxadr = chr*16 + sy*2; | |
| 81 | for (xx=0; xx<2; xx++) | |
| 88 | gfxadr = chr * 16 + sy * 2; | |
| 89 | for (xx = 0; xx < 2; xx++) | |
| 82 | 90 | { |
| 83 | d0 = BG_GFX[gfxadr + xx*4096]; | |
| 84 | d1 = BG_GFX[gfxadr + xx*4096+1]; | |
| 85 | for (sx=0; sx<4; sx++) | |
| 91 | d0 = BG_GFX[gfxadr + xx * 4096]; | |
| 92 | d1 = BG_GFX[gfxadr + xx * 4096 + 1]; | |
| 93 | ||
| 94 | for (sx = 0; sx < 4; sx++) | |
| 86 | 95 | { |
| 87 | 96 | dot = (d0 & 0x08) | ((d0 & 0x80) >>5) | ((d1 & 0x08) >>2) | ((d1 & 0x80) >>7); |
| 88 | if (flipx==0) px=sx+xx*4 + x; | |
| 89 | else px=7-sx-xx*4 + x; | |
| 90 | if (flipy==0) py=sy + y; | |
| 91 | else py=7-sy + y; | |
| 97 | if (flipx == 0) px = sx + xx * 4 + x; | |
| 98 | else px = 7 - sx - xx * 4 + x; | |
| 99 | if (flipy == 0) py = sy + y; | |
| 100 | else py = 7 - sy + y; | |
| 92 | 101 | |
| 93 | if (dot>=pri) | |
| 94 | *BITMAP_ADDR16(bitmap, py, px) = col*16+dot+256; | |
| 102 | if (dot >= pri) | |
| 103 | *BITMAP_ADDR16(bitmap, py, px) = col * 16 + dot + 256; | |
| 104 | ||
| 95 | 105 | d0 = d0 << 1; |
| 96 | 106 | d1 = d1 << 1; |
| 97 | 107 | } |
| r7500 | r7501 | |
| 103 | 113 | |
| 104 | 114 | VIDEO_UPDATE( momoko ) |
| 105 | 115 | { |
| 116 | momoko_state *state = (momoko_state *)screen->machine->driver_data; | |
| 106 | 117 | int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ; |
| 107 | UINT8 *spriteram = s | |
| 118 | UINT8 *spriteram = st | |
| 108 | 119 | |
| 109 | UINT8 *BG_MAP = memory_region( screen->machine, "user1" ); | |
| 110 | UINT8 *BG_COL_MAP = memory_region( screen->machine, "user2" ); | |
| 111 | UINT8 *FG_MAP = memory_region( screen->machine, "user3" ); | |
| 112 | UINT8 *TEXT_COLOR = memory_region( screen->machine, "proms" ); | |
| 120 | UINT8 *BG_MAP = memory_region(screen->machine, "user1"); | |
| 121 | UINT8 *BG_COL_MAP = memory_region(screen->machine, "user2"); | |
| 122 | UINT8 *FG_MAP = memory_region(screen->machine, "user3"); | |
| 123 | UINT8 *TEXT_COLOR = memory_region(screen->machine, "proms"); | |
| 113 | 124 | |
| 114 | 125 | |
| 115 | flip = | |
| 126 | flip = state->flipscreen ^ (input_port_read(screen->machine, "FAKE") & 0x01); | |
| 116 | 127 | |
| 117 | /* draw BG layer */ | |
| 128 | /* draw BG layer */ | |
| 129 | dx = (7 - state->bg_scrollx[0]) & 7; | |
| 130 | dy = (7 - state->bg_scrolly[0]) & 7; | |
| 131 | rx = (state->bg_scrollx[0] + state->bg_scrollx[1] * 256) >> 3; | |
| 132 | ry = (state->bg_scrolly[0] + state->bg_scrolly[1] * 256) >> 3; | |
| 118 | 133 | |
| 119 | dx = ( 7 - momoko_bg_scrollx[0] ) & 7 ; | |
| 120 | dy = ( 7 - momoko_bg_scrolly[0] ) & 7 ; | |
| 121 | rx = (momoko_bg_scrollx[0] + momoko_bg_scrollx[1]*256) >> 3 ; | |
| 122 | ry = (momoko_bg_scrolly[0] + momoko_bg_scrolly[1]*256) >> 3 ; | |
| 123 | ||
| 124 | if (momoko_bg_mask == 0) | |
| 134 | if (state->bg_mask == 0) | |
| 125 | 135 | { |
| 126 | for (y=0; y<29; y++) | |
| 136 | for (y = 0; y < 29; y++) | |
| 127 | 137 | { |
| 128 | for (x=0; x<32; x++) | |
| 138 | for (x = 0; x < 32; x++) | |
| 129 | 139 | { |
| 130 | radr = ( (ry + y +2 ) & 0x3ff ) * 128 + ( (rx + x) & 0x7f ) ; | |
| 131 | chr = BG_MAP[ radr ] ; | |
| 132 | col = BG_COL_MAP[ chr+momoko_bg_select*512+momoko_bg_priority*256] & 0x0f; | |
| 133 | chr = chr + momoko_bg_select * 512; | |
| 140 | radr = ((ry + y + 2) & 0x3ff) * 128 + ((rx + x) & 0x7f); | |
| 141 | chr = BG_MAP[radr]; | |
| 142 | col = BG_COL_MAP[chr + state->bg_select * 512 + state->bg_priority * 256] & 0x0f; | |
| 143 | chr = chr + state->bg_select * 512; | |
| 134 | 144 | |
| 135 | if (flip==0) | |
| 145 | if (flip == 0) | |
| 136 | 146 | { |
| 137 | px = 8*x+dx-6; | |
| 138 | py = 8*y+dy+9; | |
| 147 | px = 8 * x + dx - 6; | |
| 148 | py = 8 * y + dy + 9; | |
| 139 | 149 | } |
| 140 | 150 | else |
| 141 | 151 | { |
| 142 | px = 248-(8*x+dx-8); | |
| 143 | py = 248-(8*y+dy+9); | |
| 152 | px = 248 - (8 * x + dx - 8); | |
| 153 | py = 248 - (8 * y + dy + 9); | |
| 144 | 154 | } |
| 145 | 155 | |
| 146 | 156 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], |
| r7500 | r7501 | |
| 155 | 165 | bitmap_fill(bitmap, cliprect, 256); |
| 156 | 166 | |
| 157 | 167 | |
| 158 | /* draw sprites (momoko) */ | |
| 159 | ||
| 160 | for (offs=0; offs<9*4; offs +=4) | |
| 168 | /* draw sprites (momoko) */ | |
| 169 | for (offs = 0; offs < 9 * 4; offs +=4) | |
| 161 | 170 | { |
| 162 | chr = spriteram[offs+1] | ((spriteram[offs+2]&0x60)<<3); | |
| 171 | chr = spriteram[offs + 1] | ((spriteram[offs + 2] & 0x60) << 3); | |
| 163 | 172 | chr = ((chr & 0x380) << 1) | (chr & 0x7f); |
| 164 | col = spriteram[offs+2] & 0x07; | |
| 165 | fx = ((spriteram[offs+2] & 0x10) >> 4) ^ flip; | |
| 166 | fy = ((spriteram[offs+2] & 0x08) >> 3) ^ flip; /* ??? */ | |
| 167 | x = spriteram[offs+3]; | |
| 168 | y = spriteram[offs+0]; | |
| 169 | if (flip==0) | |
| 173 | col = spriteram[offs + 2] & 0x07; | |
| 174 | fx = ((spriteram[offs + 2] & 0x10) >> 4) ^ flip; | |
| 175 | fy = ((spriteram[offs + 2] & 0x08) >> 3) ^ flip; /* ??? */ | |
| 176 | x = spriteram[offs + 3]; | |
| 177 | y = spriteram[offs + 0]; | |
| 178 | ||
| 179 | if (flip == 0) | |
| 170 | 180 | { |
| 171 | 181 | px = x; |
| 172 | py = 239-y; | |
| 182 | py = 239 - y; | |
| 173 | 183 | } |
| 174 | 184 | else |
| 175 | 185 | { |
| 176 | px = 248-x; | |
| 177 | py = y+1; | |
| 186 | px = 248 - x; | |
| 187 | py = y + 1; | |
| 178 | 188 | } |
| 179 | 189 | |
| 180 | 190 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3], |
| r7500 | r7501 | |
| 185 | 195 | } |
| 186 | 196 | |
| 187 | 197 | |
| 188 | /* draw BG layer */ | |
| 189 | ||
| 190 | if (momoko_bg_mask ==0) | |
| 198 | /* draw BG layer */ | |
| 199 | if (state->bg_mask ==0) | |
| 191 | 200 | { |
| 192 | for (y=0; y<29; y++) | |
| 201 | for (y = 0; y < 29; y++) | |
| 193 | 202 | { |
| 194 | for (x=0; x<32; x++) | |
| 203 | for (x = 0; x < 32; x++) | |
| 195 | 204 | { |
| 196 | radr = ( (ry + y +2 ) & 0x3ff ) * 128 + ( (rx + x) & 0x7f ) ; | |
| 197 | chr = BG_MAP[ radr ] ; | |
| 198 | col = BG_COL_MAP[ chr+momoko_bg_select*512+momoko_bg_priority*256 ]; | |
| 205 | radr = ((ry + y + 2) & 0x3ff) * 128 + ((rx + x) & 0x7f) ; | |
| 206 | chr = BG_MAP[radr] ; | |
| 207 | col = BG_COL_MAP[chr + state->bg_select * 512 + state->bg_priority * 256]; | |
| 199 | 208 | pri = (col & 0x10) >> 1; |
| 200 | 209 | |
| 201 | if (flip==0) | |
| 210 | if (flip == 0) | |
| 202 | 211 | { |
| 203 | px = 8*x+dx-6; | |
| 204 | py = 8*y+dy+9; | |
| 205 | } | |
| 212 | px = 8 * x + dx - 6; | |
| 213 | py = 8 * y + dy + 9; | |
| 214 | } | |
| 206 | 215 | else |
| 207 | 216 | { |
| 208 | px = 248-(8*x+dx-8); | |
| 209 | py = 248-(8*y+dy+9); | |
| 217 | px = 248 - (8 * x + dx - 8); | |
| 218 | py = 248 - (8 * y + dy + 9); | |
| 210 | 219 | } |
| 211 | 220 | if (pri != 0) |
| 212 | 221 | { |
| 213 | 222 | col = col & 0x0f; |
| 214 | chr = chr + momoko_bg_select * 512; | |
| 215 | momoko_draw_bg_pri(screen->machine,bitmap,chr,col,flip,flip,px,py,pri); | |
| 223 | chr = chr + state->bg_select * 512; | |
| 224 | momoko_draw_bg_pri(screen->machine, bitmap, chr, col, flip, flip, px, py, pri); | |
| 216 | 225 | } |
| 217 | 226 | } |
| 218 | 227 | } |
| 219 | 228 | } |
| 220 | 229 | |
| 221 | 230 | |
| 222 | /* draw sprites (others) */ | |
| 223 | ||
| 224 | for (offs=9*4; offs<screen->machine->generic.spriteram_size; offs +=4) | |
| 231 | /* draw sprites (others) */ | |
| 232 | for (offs = 9 * 4; offs < state->spriteram_size; offs += 4) | |
| 225 | 233 | { |
| 226 | chr = spriteram[offs+1] | ((spriteram[offs+2]&0x60)<<3); | |
| 234 | chr = spriteram[offs + 1] | ((spriteram[offs + 2] & 0x60) << 3); | |
| 227 | 235 | chr = ((chr & 0x380) << 1) | (chr & 0x7f); |
| 228 | col = spriteram[offs+2] & 0x07; | |
| 229 | fx = ((spriteram[offs+2] & 0x10) >> 4) ^ flip; | |
| 230 | fy = ((spriteram[offs+2] & 0x08) >> 3) ^ flip; /* ??? */ | |
| 231 | x = spriteram[offs+3]; | |
| 232 | y = spriteram[offs+0]; | |
| 233 | if (flip==0) | |
| 236 | col = spriteram[offs + 2] & 0x07; | |
| 237 | fx = ((spriteram[offs + 2] & 0x10) >> 4) ^ flip; | |
| 238 | fy = ((spriteram[offs + 2] & 0x08) >> 3) ^ flip; /* ??? */ | |
| 239 | x = spriteram[offs + 3]; | |
| 240 | y = spriteram[offs + 0]; | |
| 241 | ||
| 242 | if (flip == 0) | |
| 234 | 243 | { |
| 235 | 244 | px = x; |
| 236 | py = 239-y; | |
| 245 | py = 239 - y; | |
| 237 | 246 | } |
| 238 | 247 | else |
| 239 | 248 | { |
| 240 | px = 248-x; | |
| 241 | py = y+1; | |
| 249 | px = 248 - x; | |
| 250 | py = y + 1; | |
| 242 | 251 | } |
| 243 | 252 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3], |
| 244 | 253 | chr, |
| r7500 | r7501 | |
| 248 | 257 | } |
| 249 | 258 | |
| 250 | 259 | |
| 251 | /* draw text layer */ | |
| 252 | ||
| 253 | for (y=16; y<240; y++) | |
| 260 | /* draw text layer */ | |
| 261 | for (y = 16; y < 240; y++) | |
| 254 | 262 | { |
| 255 | for (x=0; x<32; x++) | |
| 263 | for (x = 0; x < 32; x++) | |
| 256 | 264 | { |
| 257 | 265 | sy = y; |
| 258 | if (momoko_text_mode == 0) | |
| 259 | col = TEXT_COLOR[ (sy >> 3) + 0x100 ] & 0x0f; | |
| 266 | if (state->text_mode == 0) | |
| 267 | col = TEXT_COLOR[(sy >> 3) + 0x100] & 0x0f; | |
| 260 | 268 | else |
| 261 | 269 | { |
| 262 | if (TEXT_COLOR[ y ] < 0x08) | |
| 263 | sy += momoko_text_scrolly; | |
| 264 | col = (TEXT_COLOR[ y ] & 0x07) + 0x10; | |
| 270 | if (TEXT_COLOR[y] < 0x08) | |
| 271 | sy += state->text_scrolly; | |
| 272 | col = (TEXT_COLOR[y] & 0x07) + 0x10; | |
| 265 | 273 | } |
| 266 | dy=sy & 7; | |
| 267 | if (flip==0) | |
| 274 | dy = sy & 7; | |
| 275 | if (flip == 0) | |
| 268 | 276 | { |
| 269 | px = x*8; | |
| 277 | px = x * 8; | |
| 270 | 278 | py = y; |
| 271 | 279 | } |
| 272 | 280 | else |
| 273 | 281 | { |
| 274 | px = 248-x*8; | |
| 275 | py = 255-y; | |
| 282 | px = 248 - x * 8; | |
| 283 | py = 255 - y; | |
| 276 | 284 | } |
| 277 | 285 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], |
| 278 | s | |
| 286 | st | |
| 279 | 287 | col, |
| 280 | 288 | flip,0, |
| 281 | 289 | px,py,0); |
| r7500 | r7501 | |
| 283 | 291 | } |
| 284 | 292 | |
| 285 | 293 | |
| 286 | /* draw FG layer */ | |
| 287 | ||
| 288 | if (momoko_fg_mask==0) | |
| 294 | /* draw FG layer */ | |
| 295 | if (state->fg_mask == 0) | |
| 289 | 296 | { |
| 290 | dx = ( 7 - momoko_fg_scrollx ) & 7 ; | |
| 291 | dy = ( 7 - momoko_fg_scrolly ) & 7 ; | |
| 292 | rx = momoko_fg_scrollx >> 3 ; | |
| 293 | ry = momoko_fg_scrolly >> 3 ; | |
| 297 | dx = (7 - state->fg_scrollx) & 7; | |
| 298 | dy = (7 - state->fg_scrolly) & 7; | |
| 299 | rx = state->fg_scrollx >> 3; | |
| 300 | ry = state->fg_scrolly >> 3; | |
| 294 | 301 | |
| 295 | for (y=0; y<29; y++) | |
| 302 | for (y = 0; y < 29; y++) | |
| 296 | 303 | { |
| 297 | for (x=0; x<32; x++) | |
| 304 | for (x = 0; x < 32; x++) | |
| 298 | 305 | { |
| 299 | radr = ((ry + y +34) & 0x3f) *0x20 + ((rx + x) & 0x1f) + (momoko_fg_select & 3) *0x800; | |
| 300 | chr = FG_MAP[ radr ] ; | |
| 301 | if (flip==0) | |
| 306 | radr = ((ry + y + 34) & 0x3f) * 0x20 + ((rx + x) & 0x1f) + (state->fg_select & 3) * 0x800; | |
| 307 | chr = FG_MAP[radr] ; | |
| 308 | if (flip == 0) | |
| 302 | 309 | { |
| 303 | px = 8*x+dx-6; | |
| 304 | py = 8*y+dy+9; | |
| 310 | px = 8 * x + dx - 6; | |
| 311 | py = 8 * y + dy + 9; | |
| 305 | 312 | } |
| 306 | 313 | else |
| 307 | 314 | { |
| 308 | px = 248-(8*x+dx-8); | |
| 309 | py = 248-(8*y+dy+9); | |
| 315 | px = 248 - (8 * x + dx - 8); | |
| 316 | py = 248 - (8 * y + dy + 9); | |
| 310 | 317 | } |
| 311 | 318 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], |
| 312 | 319 | chr, |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | |
| 3 | Markham (c) 1983 Sun Electronics | |
| 3 | Markham (c) 1983 Sun Electronics | |
| 4 | 4 | |
| 5 | Video hardware driver by Uki | |
| 5 | Video hardware driver by Uki | |
| 6 | 6 | |
| 7 | 7 | 17/Jun/2001 - |
| 8 | 8 | |
| 9 | 9 | ******************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "includes/markham.h" | |
| 12 | 13 | |
| 13 | ||
| 14 | UINT8 *markham_xscroll; | |
| 15 | ||
| 16 | static tilemap_t *bg_tilemap; | |
| 17 | ||
| 18 | 14 | PALETTE_INIT( markham ) |
| 19 | 15 | { |
| 20 | 16 | int i; |
| r7500 | r7501 | |
| 45 | 41 | |
| 46 | 42 | WRITE8_HANDLER( markham_videoram_w ) |
| 47 | 43 | { |
| 48 | space->machine->generic.videoram.u8[offset] = data; | |
| 49 | tilemap_mark_tile_dirty(bg_tilemap, offset / 2); | |
| 44 | markham_state *state = (markham_state *)space->machine->driver_data; | |
| 45 | state->videoram[offset] = data; | |
| 46 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 50 | 47 | } |
| 51 | 48 | |
| 52 | 49 | WRITE8_HANDLER( markham_flipscreen_w ) |
| r7500 | r7501 | |
| 60 | 57 | |
| 61 | 58 | static TILE_GET_INFO( get_bg_tile_info ) |
| 62 | 59 | { |
| 63 | int attr = machine->generic.videoram.u8[tile_index * 2]; | |
| 64 | int code = machine->generic.videoram.u8[(tile_index * 2) + 1] + ((attr & 0x60) << 3); | |
| 60 | markham_state *state = (markham_state *)machine->driver_data; | |
| 61 | int attr = state->videoram[tile_index * 2]; | |
| 62 | int code = state->videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3); | |
| 65 | 63 | int color = (attr & 0x1f) | ((attr & 0x80) >> 2); |
| 66 | 64 | |
| 67 | 65 | SET_TILE_INFO(0, code, color, 0); |
| r7500 | r7501 | |
| 69 | 67 | |
| 70 | 68 | VIDEO_START( markham ) |
| 71 | 69 | { |
| 72 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, | |
| 73 | 8, 8, 32, 32); | |
| 70 | markham_state *state = (markham_state *)machine->driver_data; | |
| 71 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32); | |
| 74 | 72 | |
| 75 | tilemap_set_scroll_rows(bg_tilemap, 32); | |
| 73 | tilemap_set_scroll_rows(state->bg_tilemap, 32); | |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 76 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 79 | 77 | { |
| 80 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 78 | markham_state *state = (markham_state *)machine->driver_data; | |
| 79 | UINT8 *spriteram = state->spriteram; | |
| 81 | 80 | int offs; |
| 82 | 81 | |
| 83 | for (offs=0x60; offs<0x100; offs +=4) | |
| 82 | for (offs = 0x60; offs < 0x100; offs += 4) | |
| 84 | 83 | { |
| 85 | int chr = spriteram[offs+1]; | |
| 86 | int col = spriteram[offs+2]; | |
| 84 | int chr = spriteram[offs + 1]; | |
| 85 | int col = spriteram[offs + 2]; | |
| 87 | 86 | |
| 88 | 87 | int fx = flip_screen_get(machine); |
| 89 | 88 | int fy = flip_screen_get(machine); |
| 90 | 89 | |
| 91 | int x = spriteram[offs+3]; | |
| 92 | int y = spriteram[offs+0]; | |
| 93 | int px,py; | |
| 90 | int x = spriteram[offs + 3]; | |
| 91 | int y = spriteram[offs + 0]; | |
| 92 | int px, py; | |
| 94 | 93 | col &= 0x3f ; |
| 95 | 94 | |
| 96 | if (flip_screen_get(machine)==0) | |
| 95 | if (flip_screen_get(machine) == 0) | |
| 97 | 96 | { |
| 98 | px = x-2; | |
| 99 | py = 240-y; | |
| 97 | px = x - 2; | |
| 98 | py = 240 - y; | |
| 100 | 99 | } |
| 101 | 100 | else |
| 102 | 101 | { |
| 103 | px = 240-x; | |
| 102 | px = 240 - x; | |
| 104 | 103 | py = y; |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | 106 | px = px & 0xff; |
| 108 | 107 | |
| 109 | if (px>248) | |
| 110 | px = px-256; | |
| 108 | if (px > 248) | |
| 109 | px = px - 256; | |
| 111 | 110 | |
| 112 | 111 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], |
| 113 | 112 | chr, |
| r7500 | r7501 | |
| 120 | 119 | |
| 121 | 120 | VIDEO_UPDATE( markham ) |
| 122 | 121 | { |
| 122 | markham_state *state = (markham_state *)screen->machine->driver_data; | |
| 123 | 123 | int i; |
| 124 | 124 | |
| 125 | 125 | for (i = 0; i < 32; i++) |
| 126 | 126 | { |
| 127 | if ((i > 3) && (i<16)) | |
| 128 | tilemap_set_scrollx(bg_tilemap, i, markham_xscroll[0]); | |
| 127 | if ((i > 3) && (i < 16)) | |
| 128 | tilemap_set_scrollx(state->bg_tilemap, i, state->xscroll[0]); | |
| 129 | 129 | if (i >= 16) |
| 130 | tilemap_set_scrollx(bg_tilemap, i, | |
| 130 | tilemap_set_scrollx(state->bg_tilemap, i, state-> | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 133 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 134 | 134 | draw_sprites(screen->machine, bitmap, cliprect); |
| 135 | 135 | return 0; |
| 136 | 136 | } |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | /************************************* |
| 19 | 19 | * |
| 20 | * Globals | |
| 21 | * | |
| 22 | *************************************/ | |
| 23 | ||
| 24 | UINT16 *lockon_char_ram; | |
| 25 | UINT16 *lockon_hud_ram; | |
| 26 | UINT16 *lockon_scene_ram; | |
| 27 | UINT16 *lockon_ground_ram; | |
| 28 | UINT16 *lockon_object_ram; | |
| 29 | ||
| 30 | size_t lockon_hudram_size; | |
| 31 | size_t lockon_objectram_size; | |
| 32 | size_t lockon_groundram_size; | |
| 33 | ||
| 34 | ||
| 35 | /************************************* | |
| 36 | * | |
| 37 | * Statics | |
| 38 | * | |
| 39 | *************************************/ | |
| 40 | ||
| 41 | static tilemap_t *lockon_tilemap; | |
| 42 | static UINT8 ground_ctrl; | |
| 43 | static UINT16 scroll_h; | |
| 44 | static UINT16 scroll_v; | |
| 45 | ||
| 46 | static bitmap_t *front_buffer; | |
| 47 | static bitmap_t *back_buffer; | |
| 48 | static emu_timer *bufend_timer; | |
| 49 | static emu_timer *cursor_timer; | |
| 50 | ||
| 51 | /* Rotation Control */ | |
| 52 | static UINT16 xsal; | |
| 53 | static UINT16 x0ll; | |
| 54 | static UINT16 dx0ll; | |
| 55 | static UINT16 dxll; | |
| 56 | static UINT16 ysal; | |
| 57 | static UINT16 y0ll; | |
| 58 | static UINT16 dy0ll; | |
| 59 | static UINT16 dyll; | |
| 60 | ||
| 61 | /* Object palette RAM control */ | |
| 62 | static UINT32 iden; | |
| 63 | static UINT8 *obj_pal_ram; | |
| 64 | static UINT32 obj_pal_latch; | |
| 65 | static UINT32 obj_pal_addr; | |
| 66 | ||
| 67 | ||
| 68 | /************************************* | |
| 69 | * | |
| 70 | 20 | * HD46505S-2 CRT Controller |
| 71 | 21 | * |
| 72 | 22 | *************************************/ |
| r7500 | r7501 | |
| 114 | 64 | |
| 115 | 65 | static TIMER_CALLBACK( cursor_callback ) |
| 116 | 66 | { |
| 117 | if (lockon_main_inten) | |
| 118 | cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, 0xff); | |
| 67 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 119 | 68 | |
| 120 | timer_adjust_oneshot(cursor_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0); | |
| 69 | if (state->main_inten) | |
| 70 | cpu_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0xff); | |
| 71 | ||
| 72 | timer_adjust_oneshot(state->cursor_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0); | |
| 121 | 73 | } |
| 122 | 74 | |
| 123 | 75 | /************************************* |
| r7500 | r7501 | |
| 158 | 110 | |
| 159 | 111 | if (p2 & 0x80) |
| 160 | 112 | { |
| 161 | r = compute_res_net( (p2 >> 2) & 0x1f, 0, &lockon_net_info ); | |
| 162 | g = compute_res_net( ((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_net_info ); | |
| 163 | b = compute_res_net( (p1 & 0x1f), 2, &lockon_net_info ); | |
| 113 | r = compute_res_net((p2 >> 2) & 0x1f, 0, &lockon_net_info); | |
| 114 | g = compute_res_net(((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_net_info); | |
| 115 | b = compute_res_net((p1 & 0x1f), 2, &lockon_net_info); | |
| 164 | 116 | } |
| 165 | 117 | else |
| 166 | 118 | { |
| 167 | r = compute_res_net( (p2 >> 2) & 0x1f, 0, &lockon_pd_net_info ); | |
| 168 | g = compute_res_net( ((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_pd_net_info ); | |
| 169 | b = compute_res_net( (p1 & 0x1f), 2, &lockon_pd_net_info ); | |
| 119 | r = compute_res_net((p2 >> 2) & 0x1f, 0, &lockon_pd_net_info); | |
| 120 | g = compute_res_net(((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_pd_net_info); | |
| 121 | b = compute_res_net((p1 & 0x1f), 2, &lockon_pd_net_info); | |
| 170 | 122 | } |
| 171 | 123 | |
| 172 | 124 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 182 | 134 | |
| 183 | 135 | WRITE16_HANDLER( lockon_char_w ) |
| 184 | 136 | { |
| 185 | lockon_char_ram[offset] = data; | |
| 186 | tilemap_mark_tile_dirty(lockon_tilemap, offset); | |
| 137 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 138 | state->char_ram[offset] = data; | |
| 139 | tilemap_mark_tile_dirty(state->tilemap, offset); | |
| 187 | 140 | } |
| 188 | 141 | |
| 189 | 142 | static TILE_GET_INFO( get_lockon_tile_info ) |
| 190 | 143 | { |
| 191 | UINT32 tileno = lockon_char_ram[tile_index] & 0x03ff; | |
| 192 | UINT32 col = (lockon_char_ram[tile_index] >> 10) & 0x3f; | |
| 144 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 145 | UINT32 tileno = state->char_ram[tile_index] & 0x03ff; | |
| 146 | UINT32 col = (state->char_ram[tile_index] >> 10) & 0x3f; | |
| 193 | 147 | |
| 194 | 148 | col = (col & 0x1f) + (col & 0x20 ? 64 : 0); |
| 195 | 149 | SET_TILE_INFO(0, tileno, col, 0); |
| r7500 | r7501 | |
| 204 | 158 | |
| 205 | 159 | WRITE16_HANDLER( lockon_scene_h_scr_w ) |
| 206 | 160 | { |
| 207 | scroll_h = data & 0x1ff; | |
| 161 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 162 | state->scroll_h = data & 0x1ff; | |
| 208 | 163 | } |
| 209 | 164 | |
| 210 | 165 | WRITE16_HANDLER( lockon_scene_v_scr_w ) |
| 211 | 166 | { |
| 212 | scroll_v = data & 0x81ff; | |
| 167 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 168 | state->scroll_v = data & 0x81ff; | |
| 213 | 169 | } |
| 214 | 170 | |
| 215 | static void scene_draw(running_machine *machine) | |
| 171 | static void scene_draw( running_machine *machine ) | |
| 216 | 172 | { |
| 173 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 217 | 174 | UINT32 y; |
| 218 | 175 | |
| 219 | 176 | /* 3bpp characters */ |
| r7500 | r7501 | |
| 224 | 181 | |
| 225 | 182 | for (y = 0; y < FRAMEBUFFER_MAX_Y; ++y) |
| 226 | 183 | { |
| 227 | UINT32 x; | |
| 228 | UINT32 d0 = 0, d1 = 0, d2 = 0; | |
| 229 | UINT32 colour = 0; | |
| 230 | UINT32 y_offs; | |
| 231 | UINT32 x_offs; | |
| 232 | UINT32 y_gran; | |
| 233 | UINT16 *bmpaddr; | |
| 234 | UINT32 ram_mask = 0x7ff; | |
| 184 | UINT32 x; | |
| 185 | UINT32 d0 = 0, d1 = 0, d2 = 0; | |
| 186 | UINT32 colour = 0; | |
| 187 | UINT32 y_offs; | |
| 188 | UINT32 x_offs; | |
| 189 | UINT32 y_gran; | |
| 190 | UINT16 *bmpaddr; | |
| 191 | UINT32 ram_mask = 0x7ff; | |
| 235 | 192 | |
| 236 | y_offs = (y + scroll_v) & 0x1ff; | |
| 193 | y_offs = (y + state->scroll_v) & 0x1ff; | |
| 237 | 194 | |
| 238 | 195 | /* Clamp - stops tilemap wrapping when screen is rotated */ |
| 239 | if (BIT(scroll_v, 15) && y_offs & 0x100) | |
| 196 | if (BIT(state->scroll_v, 15) && y_offs & 0x100) | |
| 240 | 197 | ram_mask = 0x7; |
| 241 | 198 | |
| 242 | x_offs = (scroll_h - 8) & 0x1ff; | |
| 199 | x_offs = (state->scroll_h - 8) & 0x1ff; | |
| 243 | 200 | y_gran = y_offs & 7; |
| 244 | 201 | |
| 245 | 202 | if (x_offs & 7) |
| 246 | 203 | { |
| 247 | 204 | UINT32 tileidx; |
| 248 | 205 | UINT16 addr = ((y_offs & ~7) << 3) + ((x_offs >> 3) & 0x3f); |
| 249 | UINT16 ram_val = | |
| 206 | UINT16 ram_val = state->scene_ram[addr & ram_mask]; | |
| 250 | 207 | |
| 251 | 208 | colour = (clut[ram_val & 0x7fff] & 0x3f) << 3; |
| 252 | 209 | tileidx = ((ram_val & 0x0fff) << 3) + y_gran; |
| r7500 | r7501 | |
| 256 | 213 | d2 = *(gfx3 + tileidx); |
| 257 | 214 | } |
| 258 | 215 | |
| 259 | bmpaddr = BITMAP_ADDR16(back_buffer, y, 0); | |
| 216 | bmpaddr = BITMAP_ADDR16(state->back_buffer, y, 0); | |
| 260 | 217 | |
| 261 | 218 | for (x = 0; x < FRAMEBUFFER_MAX_X; ++x) |
| 262 | 219 | { |
| r7500 | r7501 | |
| 267 | 224 | { |
| 268 | 225 | UINT32 tileidx; |
| 269 | 226 | UINT16 addr = ((y_offs & ~7) << 3) + ((x_offs >> 3) & 0x3f); |
| 270 | UINT16 ram_val = | |
| 227 | UINT16 ram_val = state->scene_ram[addr & ram_mask]; | |
| 271 | 228 | |
| 272 | 229 | colour = (clut[ram_val & 0x7fff] & 0x3f) << 3; |
| 273 | 230 | tileidx = ((ram_val & 0x0fff) << 3) + y_gran; |
| r7500 | r7501 | |
| 324 | 281 | |
| 325 | 282 | WRITE16_HANDLER( lockon_ground_ctrl_w ) |
| 326 | 283 | { |
| 327 | ground_ctrl = data & 0xff; | |
| 284 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 285 | state->ground_ctrl = data & 0xff; | |
| 328 | 286 | } |
| 329 | 287 | |
| 330 | 288 | static TIMER_CALLBACK( bufend_callback ) |
| 331 | 289 | { |
| 332 | cputag_set_input_line_and_vector(machine, "ground", 0, HOLD_LINE, 0xff); | |
| 333 | cputag_set_input_line(machine, "object", NEC_INPUT_LINE_POLL, ASSERT_LINE); | |
| 290 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 291 | cpu_set_input_line_and_vector(state->ground, 0, HOLD_LINE, 0xff); | |
| 292 | cpu_set_input_line(state->object, NEC_INPUT_LINE_POLL, ASSERT_LINE); | |
| 334 | 293 | } |
| 335 | 294 | |
| 336 | 295 | /* Get data for a each 8x8x3 ground tile */ |
| r7500 | r7501 | |
| 347 | 306 | rom_data3 = gfx_rom[gfx_addr + 0x20000]; \ |
| 348 | 307 | } |
| 349 | 308 | |
| 350 | static void ground_draw(running_machine *machine) | |
| 309 | static void ground_draw( running_machine *machine ) | |
| 351 | 310 | { |
| 311 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 312 | ||
| 352 | 313 | /* ROM pointers */ |
| 353 | 314 | const UINT8 *const gfx_rom = memory_region(machine, "gfx4"); |
| 354 | const UINT8 *const lut_rom = gfx_rom + 0x30000 + ((ground_ctrl >> 2) & 0x3 ? 0x10000 : 0); | |
| 315 | const UINT8 *const lut_rom = gfx_rom + 0x30000 + ((state->ground_ctrl >> 2) & 0x3 ? 0x10000 : 0); | |
| 355 | 316 | const UINT8 *const clut_rom = gfx_rom + 0x50000; |
| 356 | 317 | |
| 357 | UINT32 lut_a15_14 = (ground_ctrl & 0x3) << 14; | |
| 358 | UINT32 clut_a14_12 = (ground_ctrl & 0x70) << 8; | |
| 359 | UINT32 gfx_a15 = (ground_ctrl & 0x40) << 9; | |
| 318 | UINT32 lut_a15_14 = (state->ground_ctrl & 0x3) << 14; | |
| 319 | UINT32 clut_a14_12 = (state->ground_ctrl & 0x70) << 8; | |
| 320 | UINT32 gfx_a15 = (state->ground_ctrl & 0x40) << 9; | |
| 360 | 321 | UINT32 offs = 3; |
| 361 | 322 | UINT32 y; |
| 362 | 323 | |
| 363 | 324 | /* TODO: Clean up and emulate CS of GFX ROMs? */ |
| 364 | 325 | for (y = 0; y < FRAMEBUFFER_MAX_Y; ++y) |
| 365 | 326 | { |
| 366 | UINT16 *bmpaddr = BITMAP_ADDR16(back_buffer, y, 0); | |
| 367 | UINT8 ls163; | |
| 368 | UINT32 clut_addr; | |
| 369 | UINT32 gfx_addr; | |
| 370 | UINT8 rom_data1 = 0; | |
| 371 | UINT8 rom_data2 = 0; | |
| 372 | UINT8 rom_data3 = 0; | |
| 373 | UINT32 pal = 0; | |
| 374 | UINT32 x; | |
| 327 | UINT16 *bmpaddr = BITMAP_ADDR16(state->back_buffer, y, 0); | |
| 328 | UINT8 ls163; | |
| 329 | UINT32 clut_addr; | |
| 330 | UINT32 gfx_addr; | |
| 331 | UINT8 rom_data1 = 0; | |
| 332 | UINT8 rom_data2 = 0; | |
| 333 | UINT8 rom_data3 = 0; | |
| 334 | UINT32 pal = 0; | |
| 335 | UINT32 x; | |
| 375 | 336 | |
| 376 | 337 | /* Draw this line? */ |
| 377 | if (!( | |
| 338 | if (!(state->ground_ram[offs] & 0x8000)) | |
| 378 | 339 | { |
| 379 | UINT32 gfx_a2_0 = lockon_ground_ram[offs] & 0x0007; | |
| 380 | UINT32 gfx_a6_5 = (lockon_ground_ram[offs] & 0x0018) << 2; | |
| 381 | UINT32 clut_a4_3 = (lockon_ground_ram[offs] & 0x0018) >> 1; | |
| 382 | UINT8 tz2213_x = lockon_ground_ram[offs + 1] & 0xff; | |
| 383 | UINT8 tz2213_dx = lockon_ground_ram[offs + 2] & 0xff; | |
| 340 | UINT32 gfx_a2_0 = state->ground_ram[offs] & 0x0007; | |
| 341 | UINT32 gfx_a6_5 = (state->ground_ram[offs] & 0x0018) << 2; | |
| 342 | UINT32 clut_a4_3 = (state->ground_ram[offs] & 0x0018) >> 1; | |
| 343 | UINT8 tz2213_x = state->ground_ram[offs + 1] & 0xff; | |
| 344 | UINT8 tz2213_dx = state->ground_ram[offs + 2] & 0xff; | |
| 384 | 345 | |
| 385 | UINT32 lut_address = lut_a15_14 + ((lockon_ground_ram[offs] & 0x7fe0) >> 1); | |
| 386 | UINT32 cy = lockon_ground_ram[offs + 2] & 0x0100; | |
| 387 | UINT32 color; | |
| 388 | UINT32 gpbal2_0_prev; | |
| 346 | UINT32 lut_address = lut_a15_14 + ((state->ground_ram[offs] & 0x7fe0) >> 1); | |
| 347 | UINT32 cy = state->ground_ram[offs + 2] & 0x0100; | |
| 348 | UINT32 color; | |
| 349 | UINT32 gpbal2_0_prev; | |
| 389 | 350 | |
| 390 | ls163 = | |
| 351 | ls163 = state->ground_ram[offs + 1] >> 8; | |
| 391 | 352 | |
| 392 | 353 | gpbal2_0_prev = ((ls163 & 3) << 1) | BIT(tz2213_x, 7); |
| 393 | 354 | |
| r7500 | r7501 | |
| 425 | 386 | offs += 3; |
| 426 | 387 | |
| 427 | 388 | /* End of list marker */ |
| 428 | if ( | |
| 389 | if (state->ground_ram[offs + 2] & 0x8000) | |
| 429 | 390 | { |
| 430 | timer_adjust_oneshot(bufend_timer, attotime_mul(ATTOTIME_IN_HZ(FRAMEBUFFER_CLOCK), FRAMEBUFFER_MAX_X * y), 0); | |
| 391 | timer_adjust_oneshot(state->bufend_timer, attotime_mul(ATTOTIME_IN_HZ(FRAMEBUFFER_CLOCK), FRAMEBUFFER_MAX_X * y), 0); | |
| 431 | 392 | } |
| 432 | 393 | } |
| 433 | 394 | } |
| r7500 | r7501 | |
| 464 | 425 | if (px < FRAMEBUFFER_MAX_X) \ |
| 465 | 426 | if (COLOR != 0xf) \ |
| 466 | 427 | { \ |
| 467 | UINT8 clr = obj_pal_ram[(pal << 4) + COLOR]; \ | |
| 428 | UINT8 clr = state->obj_pal_ram[(pal << 4) + COLOR]; \ | |
| 468 | 429 | UINT16 *pix = (line + px); \ |
| 469 | 430 | if (!(clr == 0xff && ((*pix & 0xe00) == 0xa00))) \ |
| 470 | 431 | *pix = 0x400 + clr; \ |
| r7500 | r7501 | |
| 472 | 433 | px = (px + 1) & 0x7ff; \ |
| 473 | 434 | } while(0) |
| 474 | 435 | |
| 475 | static void objects_draw(running_machine *machine) | |
| 436 | static void objects_draw( running_machine *machine ) | |
| 476 | 437 | { |
| 477 | 438 | UINT32 offs; |
| 439 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 478 | 440 | |
| 479 | 441 | const UINT8 *const romlut = memory_region(machine, "user1"); |
| 480 | 442 | const UINT16 *const chklut = (UINT16*)memory_region(machine, "user2"); |
| 481 | 443 | const UINT8 *const gfxrom = memory_region(machine, "gfx5"); |
| 482 | 444 | const UINT8 *const sproms = memory_region(machine, "proms") + 0x800; |
| 483 | 445 | |
| 484 | for (offs = 0; offs < | |
| 446 | for (offs = 0; offs < state->objectram_size; offs += 4) | |
| 485 | 447 | { |
| 486 | 448 | UINT32 y; |
| 487 | 449 | UINT32 xpos; |
| r7500 | r7501 | |
| 497 | 459 | UINT32 opsta15_8; |
| 498 | 460 | |
| 499 | 461 | /* Retrieve the object attributes */ |
| 500 | ypos = lockon_object_ram[offs] & 0x03ff; | |
| 501 | xpos = lockon_object_ram[offs + 3] & 0x07ff; | |
| 502 | ysize = (lockon_object_ram[offs] >> 10) & 0x3; | |
| 503 | xsize = (lockon_object_ram[offs] >> 12) & 0x3; | |
| 504 | yflip = BIT(lockon_object_ram[offs], 14); | |
| 505 | xflip = BIT(lockon_object_ram[offs], 15); | |
| 506 | scale = lockon_object_ram[offs + 1] & 0xff; | |
| 507 | pal = (lockon_object_ram[offs + 1] >> 8) & 0x7f; | |
| 508 | opsta = lockon_object_ram[offs + 2]; | |
| 462 | ypos = state->object_ram[offs] & 0x03ff; | |
| 463 | xpos = state->object_ram[offs + 3] & 0x07ff; | |
| 464 | ysize = (state->object_ram[offs] >> 10) & 0x3; | |
| 465 | xsize = (state->object_ram[offs] >> 12) & 0x3; | |
| 466 | yflip = BIT(state->object_ram[offs], 14); | |
| 467 | xflip = BIT(state->object_ram[offs], 15); | |
| 468 | scale = state->object_ram[offs + 1] & 0xff; | |
| 469 | pal = (state->object_ram[offs + 1] >> 8) & 0x7f; | |
| 470 | opsta = state->object_ram[offs + 2]; | |
| 509 | 471 | |
| 510 | if (iden) | |
| 472 | if (state->iden) | |
| 511 | 473 | { |
| 512 | obj_pal_ram[(pal << 4) + obj_pal_addr] = obj_pal_latch; | |
| 474 | state->obj_pal_ram[(pal << 4) + state->obj_pal_addr] = state->obj_pal_latch; | |
| 513 | 475 | break; |
| 514 | 476 | } |
| 515 | 477 | |
| r7500 | r7501 | |
| 523 | 485 | |
| 524 | 486 | for (y = 0; y < FRAMEBUFFER_MAX_Y; y++) |
| 525 | 487 | { |
| 526 | UINT32 cy = (y + ypos) & 0x3ff; | |
| 527 | UINT32 optab; | |
| 528 | UINT32 lutaddr; | |
| 529 | UINT32 tile; | |
| 488 | UINT32 cy = (y + ypos) & 0x3ff; | |
| 489 | UINT32 optab; | |
| 490 | UINT32 lutaddr; | |
| 491 | UINT32 tile; | |
| 530 | 492 | UINT8 cnt; |
| 531 | UINT32 yidx; | |
| 532 | UINT16 *line = BITMAP_ADDR16(back_buffer, y, 0); | |
| 533 | UINT32 px = xpos; | |
| 493 | UINT32 yidx; | |
| 494 | UINT16 *line = BITMAP_ADDR16(state->back_buffer, y, 0); | |
| 495 | UINT32 px = xpos; | |
| 534 | 496 | |
| 535 | 497 | /* Outside the limits? */ |
| 536 | 498 | if (cy & 0x300) |
| r7500 | r7501 | |
| 560 | 522 | /* Draw! */ |
| 561 | 523 | for (tile = 0; tile < (1 << xsize); ++tile) |
| 562 | 524 | { |
| 563 | UINT16 sc; | |
| 564 | UINT16 scl; | |
| 565 | UINT32 x; | |
| 566 | UINT32 tileaddr; | |
| 567 | UINT16 td0, td1, td2, td3; | |
| 568 | UINT32 j; | |
| 569 | UINT32 bank; | |
| 525 | UINT16 sc; | |
| 526 | UINT16 scl; | |
| 527 | UINT32 x; | |
| 528 | UINT32 tileaddr; | |
| 529 | UINT16 td0, td1, td2, td3; | |
| 530 | UINT32 j; | |
| 531 | UINT32 bank; | |
| 570 | 532 | |
| 571 | 533 | scl = scale & 0x7f; |
| 572 | 534 | tileaddr = (chklut[opsta15_8 + cnt] & 0x7fff); |
| r7500 | r7501 | |
| 610 | 572 | |
| 611 | 573 | DRAW_OBJ_PIXEL(col); |
| 612 | 574 | |
| 613 | if ( | |
| 575 | if ( | |
| 614 | 576 | DRAW_OBJ_PIXEL(col); |
| 615 | 577 | } |
| 616 | 578 | } |
| r7500 | r7501 | |
| 621 | 583 | UINT8 col; |
| 622 | 584 | UINT8 pix = x; |
| 623 | 585 | |
| 624 | if ( | |
| 586 | if ( | |
| 625 | 587 | { |
| 626 | 588 | if (!xflip) |
| 627 | 589 | pix ^= 0x7; |
| r7500 | r7501 | |
| 640 | 602 | } |
| 641 | 603 | |
| 642 | 604 | /* Check for the end of list marker */ |
| 643 | if ( | |
| 605 | if (state->object_ram[offs + 1] & 0x8000) | |
| 644 | 606 | return; |
| 645 | 607 | } |
| 646 | 608 | } |
| r7500 | r7501 | |
| 648 | 610 | /* The mechanism used by the object CPU to update the object ASICs palette RAM */ |
| 649 | 611 | WRITE16_HANDLER( lockon_tza112_w ) |
| 650 | 612 | { |
| 651 | if (iden) | |
| 613 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 614 | ||
| 615 | if (state->iden) | |
| 652 | 616 | { |
| 653 | obj_pal_latch = data & 0xff; | |
| 654 | obj_pal_addr = offset & 0xf; | |
| 617 | state->obj_pal_latch = data & 0xff; | |
| 618 | state->obj_pal_addr = offset & 0xf; | |
| 655 | 619 | objects_draw(space->machine); |
| 656 | 620 | } |
| 657 | 621 | } |
| 658 | 622 | |
| 659 | 623 | READ16_HANDLER( lockon_obj_4000_r ) |
| 660 | 624 | { |
| 661 | cputag_set_input_line(space->machine, "object", NEC_INPUT_LINE_POLL, CLEAR_LINE); | |
| 625 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 626 | ||
| 627 | cpu_set_input_line(state->object, NEC_INPUT_LINE_POLL, CLEAR_LINE); | |
| 662 | 628 | return 0xffff; |
| 663 | 629 | } |
| 664 | 630 | |
| 665 | 631 | WRITE16_HANDLER( lockon_obj_4000_w ) |
| 666 | 632 | { |
| 667 | iden = data & 1; | |
| 633 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 634 | state->iden = data & 1; | |
| 668 | 635 | } |
| 669 | 636 | |
| 670 | 637 | |
| r7500 | r7501 | |
| 701 | 668 | /* Rotation control register */ |
| 702 | 669 | WRITE16_HANDLER( lockon_rotate_w ) |
| 703 | 670 | { |
| 671 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 672 | ||
| 704 | 673 | switch (offset & 7) |
| 705 | 674 | { |
| 706 | case 0: xsal = data & 0x1ff; break; | |
| 707 | case 1: x0ll = data & 0xff; break; | |
| 708 | case 2: dx0ll = data & 0x1ff; break; | |
| 709 | case 3: dxll = data & 0x1ff; break; | |
| 675 | case 0: state->xsal = data & 0x1ff; break; | |
| 676 | case 1: state->x0ll = data & 0xff; break; | |
| 677 | case 2: state->dx0ll = data & 0x1ff; break; | |
| 678 | case 3: state->dxll = data & 0x1ff; break; | |
| 710 | 679 | |
| 711 | case 4: ysal = data & 0x1ff; break; | |
| 712 | case 5: y0ll = data & 0xff; break; | |
| 713 | case 6: dy0ll = data & 0x1ff; break; | |
| 714 | case 7: dyll = data & 0x3ff; break; | |
| 680 | case 4: state->ysal = data & 0x1ff; break; | |
| 681 | case 5: state->y0ll = data & 0xff; break; | |
| 682 | case 6: state->dy0ll = data & 0x1ff; break; | |
| 683 | case 7: state->dyll = data & 0x3ff; break; | |
| 715 | 684 | } |
| 716 | 685 | } |
| 717 | 686 | |
| r7500 | r7501 | |
| 729 | 698 | if (carry) --CNT; \ |
| 730 | 699 | } while(0) |
| 731 | 700 | |
| 732 | static void rotate_draw(bitmap_t *bitmap, const rectangle *cliprect) | |
| 701 | static void rotate_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 733 | 702 | { |
| 703 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 734 | 704 | UINT32 y; |
| 735 | 705 | |
| 736 | 706 | /* Counters */ |
| 737 | UINT32 cxy = xsal & 0xff; | |
| 738 | UINT32 cyy = ysal & 0x1ff; | |
| 707 | UINT32 cxy = state->xsal & 0xff; | |
| 708 | UINT32 cyy = state->ysal & 0x1ff; | |
| 739 | 709 | |
| 740 | 710 | /* Accumulator values and deltas */ |
| 741 | UINT8 axy = x0ll & 0xff; | |
| 742 | UINT8 daxy = dx0ll & 0xff; | |
| 743 | UINT8 ayy = y0ll & 0xff; | |
| 744 | UINT8 dayy = dy0ll & 0xff; | |
| 745 | UINT8 dayx = dyll & 0xff; | |
| 746 | UINT8 daxx = dxll & 0xff; | |
| 711 | UINT8 axy = state->x0ll & 0xff; | |
| 712 | UINT8 daxy = state->dx0ll & 0xff; | |
| 713 | UINT8 ayy = state->y0ll & 0xff; | |
| 714 | UINT8 dayy = state->dy0ll & 0xff; | |
| 715 | UINT8 dayx = state->dyll & 0xff; | |
| 716 | UINT8 daxx = state->dxll & 0xff; | |
| 747 | 717 | |
| 748 | UINT32 xy_up = BIT(xsal, 8); | |
| 749 | UINT32 yx_up = BIT(dyll, 9); | |
| 750 | UINT32 axx_en = !BIT(dxll, 8); | |
| 751 | UINT32 ayx_en = !BIT(dyll, 8); | |
| 752 | UINT32 axy_en = !BIT(dx0ll, 8); | |
| 753 | UINT32 ayy_en = !BIT(dy0ll, 8); | |
| 718 | UINT32 xy_up = BIT(state->xsal, 8); | |
| 719 | UINT32 yx_up = BIT(state->dyll, 9); | |
| 720 | UINT32 axx_en = !BIT(state->dxll, 8); | |
| 721 | UINT32 ayx_en = !BIT(state->dyll, 8); | |
| 722 | UINT32 axy_en = !BIT(state->dx0ll, 8); | |
| 723 | UINT32 ayy_en = !BIT(state->dy0ll, 8); | |
| 754 | 724 | |
| 755 | 725 | for (y = 0; y <= cliprect->max_y; ++y) |
| 756 | 726 | { |
| r7500 | r7501 | |
| 769 | 739 | cx &= 0x1ff; |
| 770 | 740 | cy &= 0x1ff; |
| 771 | 741 | |
| 772 | *dst++ = *BITMAP_ADDR16(front_buffer, cy, cx); | |
| 742 | *dst++ = *BITMAP_ADDR16(state->front_buffer, cy, cx); | |
| 773 | 743 | |
| 774 | 744 | if (axx_en) |
| 775 | 745 | INCREMENT(axx, cx); |
| r7500 | r7501 | |
| 833 | 803 | |
| 834 | 804 | *******************************************************************************************/ |
| 835 | 805 | |
| 836 | static void hud_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 806 | static void hud_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 837 | 807 | { |
| 808 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 838 | 809 | UINT8 *tile_rom = memory_region(machine, "gfx3"); |
| 839 | UINT32 | |
| 810 | UINT32 offs; | |
| 840 | 811 | |
| 841 | for (offs = 0x0; offs <= | |
| 812 | for (offs = 0x0; offs <= state->hudram_size; offs += 2) | |
| 842 | 813 | { |
| 843 | UINT32 y; | |
| 844 | UINT32 y_pos; | |
| 845 | UINT32 x_pos; | |
| 846 | UINT32 y_size; | |
| 847 | UINT32 x_size; | |
| 848 | UINT32 layout; | |
| 849 | UINT16 colour; | |
| 850 | UINT32 code; | |
| 851 | UINT32 rom_a12_7; | |
| 814 | UINT32 y; | |
| 815 | UINT32 y_pos; | |
| 816 | UINT32 x_pos; | |
| 817 | UINT32 y_size; | |
| 818 | UINT32 x_size; | |
| 819 | UINT32 layout; | |
| 820 | UINT16 colour; | |
| 821 | UINT32 code; | |
| 822 | UINT32 rom_a12_7; | |
| 852 | 823 | |
| 853 | 824 | /* End of sprite list marker */ |
| 854 | if ( | |
| 825 | if (state->hud_ram[offs + 1] & 0x8000) | |
| 855 | 826 | break; |
| 856 | 827 | |
| 857 | y_pos = lockon_hud_ram[offs] & 0x1ff; | |
| 858 | x_pos = lockon_hud_ram[offs + 1] & 0x1ff; | |
| 859 | x_size = (lockon_hud_ram[offs + 1] >> 12) & 7; | |
| 860 | code = (lockon_hud_ram[offs] >> 9) & 0x7f; | |
| 861 | colour = 0x200 + ((lockon_hud_ram[offs + 1] >> 9) & 7); | |
| 862 | layout = (code >> 5) & 3; | |
| 828 | y_pos = state->hud_ram[offs] & 0x1ff; | |
| 829 | x_pos = state->hud_ram[offs + 1] & 0x1ff; | |
| 830 | x_size = (state->hud_ram[offs + 1] >> 12) & 7; | |
| 831 | code = (state->hud_ram[offs] >> 9) & 0x7f; | |
| 832 | colour = 0x200 + ((state->hud_ram[offs + 1] >> 9) & 7); | |
| 833 | layout = (code >> 5) & 3; | |
| 863 | 834 | |
| 864 | 835 | rom_a12_7 = (code & 0xfe) << 6; |
| 865 | 836 | |
| r7500 | r7501 | |
| 888 | 859 | |
| 889 | 860 | for (xt = 0; xt <= x_size; ++xt) |
| 890 | 861 | { |
| 891 | UINT32 rom_a6_3; | |
| 892 | UINT32 px; | |
| 862 | UINT32 rom_a6_3; | |
| 863 | UINT32 px; | |
| 893 | 864 | UINT8 gfx_strip; |
| 894 | 865 | |
| 895 | 866 | if (layout == 3) |
| r7500 | r7501 | |
| 934 | 905 | |
| 935 | 906 | VIDEO_START( lockon ) |
| 936 | 907 | { |
| 937 | lockon_tilemap = tilemap_create(machine, get_lockon_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 938 | tilemap_set_transparent_pen(lockon_tilemap, 0); | |
| 908 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 939 | 909 | |
| 910 | state->tilemap = tilemap_create(machine, get_lockon_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 911 | tilemap_set_transparent_pen(state->tilemap, 0); | |
| 912 | ||
| 940 | 913 | /* Allocate the two frame buffers for rotation */ |
| 941 | back_buffer = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16); | |
| 942 | front_buffer = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16); | |
| 914 | state->back_buffer = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16); | |
| 915 | state->front_buffer = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16); | |
| 943 | 916 | |
| 944 | 917 | /* 2kB of object ASIC palette RAM */ |
| 945 | obj_pal_ram = auto_alloc_array(machine, UINT8, 2048); | |
| 918 | state->obj_pal_ram = auto_alloc_array(machine, UINT8, 2048); | |
| 946 | 919 | |
| 947 | 920 | /* Timer for ground display list callback */ |
| 948 | bufend_timer = timer_alloc(machine, bufend_callback, NULL); | |
| 921 | state->bufend_timer = timer_alloc(machine, bufend_callback, NULL); | |
| 949 | 922 | |
| 950 | 923 | /* Timer for the CRTC cursor pulse */ |
| 951 | cursor_timer = timer_alloc(machine, cursor_callback, NULL); | |
| 952 | timer_adjust_oneshot(cursor_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0); | |
| 924 | state->cursor_timer = timer_alloc(machine, cursor_callback, NULL); | |
| 925 | timer_adjust_oneshot(state->cursor_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0); | |
| 926 | ||
| 927 | state_save_register_global_bitmap(machine, state->back_buffer); | |
| 928 | state_save_register_global_bitmap(machine, state->front_buffer); | |
| 929 | state_save_register_global_pointer(machine, state->obj_pal_ram, 2048); | |
| 953 | 930 | } |
| 954 | 931 | |
| 955 | 932 | VIDEO_UPDATE( lockon ) |
| 956 | 933 | { |
| 934 | lockon_state *state = (lockon_state *)screen->machine->driver_data; | |
| 935 | ||
| 957 | 936 | /* If screen output is disabled, fill with black */ |
| 958 | if ( | |
| 937 | if ( | |
| 959 | 938 | { |
| 960 | 939 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 961 | 940 | return 0; |
| 962 | 941 | } |
| 963 | 942 | |
| 964 | 943 | /* Scan out the frame buffer in rotated order */ |
| 965 | rotate_draw(bitmap, cliprect); | |
| 944 | rotate_draw(screen->machine, bitmap, cliprect); | |
| 966 | 945 | |
| 967 | 946 | /* Draw the character tilemap */ |
| 968 | tilemap_draw(bitmap, cliprect, | |
| 947 | tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0); | |
| 969 | 948 | |
| 970 | 949 | /* Draw the HUD */ |
| 971 | 950 | hud_draw(screen->machine, bitmap, cliprect); |
| r7500 | r7501 | |
| 975 | 954 | |
| 976 | 955 | VIDEO_EOF( lockon ) |
| 977 | 956 | { |
| 957 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 958 | ||
| 978 | 959 | /* Swap the frame buffers */ |
| 979 | bitmap_t *tmp = front_buffer; | |
| 980 | front_buffer = back_buffer; | |
| 981 | back_buffer = tmp; | |
| 960 | bitmap_t *tmp = state->front_buffer; | |
| 961 | state->front_buffer = state->back_buffer; | |
| 962 | state->back_buffer = tmp; | |
| 982 | 963 | |
| 983 | 964 | /* Draw the frame buffer layers */ |
| 984 | 965 | scene_draw(machine); |
| 985 | 966 | ground_draw(machine); |
| 986 | 967 | objects_draw(machine); |
| 987 | ||
| 988 | 968 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/deco16ic.h" | |
| 2 | #include "includes/boogwing.h" | |
| 3 | #include "video/deco16ic.h" | |
| 3 | 4 | |
| 4 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region) | |
| 5 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram_base, int gfx_region ) | |
| 5 | 6 | { |
| 7 | boogwing_state *state = (boogwing_state *)machine->driver_data; | |
| 6 | 8 | int offs; |
| 7 | int flipscreen=!flip_screen_get(machine); | |
| 9 | int flipscreen = !flip_screen_get(machine); | |
| 10 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 8 | 11 | |
| 9 | for (offs = 0x400-4;offs >= 0;offs -= 4) | |
| 12 | for (offs = 0x400 - 4; offs >= 0; offs -= 4) | |
| 10 | 13 | { |
| 11 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0,spri=0; | |
| 14 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0, spri = 0; | |
| 12 | 15 | int alpha = 0xff; |
| 13 | 16 | |
| 14 | sprite = spriteram_base[offs+1]; | |
| 15 | if (!sprite) continue; | |
| 17 | sprite = spriteram_base[offs + 1]; | |
| 18 | if (!sprite) | |
| 19 | continue; | |
| 16 | 20 | |
| 17 | 21 | y = spriteram_base[offs]; |
| 18 | flash=y&0x1000; | |
| 19 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 22 | flash = y & 0x1000; | |
| 23 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 24 | continue; | |
| 20 | 25 | |
| 21 | x = spriteram_base[offs+2]; | |
| 22 | colour = (x >>9) & 0x1f; | |
| 26 | x = spriteram_base[offs + 2]; | |
| 27 | colour = (x >> 9) & 0x1f; | |
| 23 | 28 | |
| 24 | 29 | fx = y & 0x2000; |
| 25 | 30 | fy = y & 0x4000; |
| 26 | 31 | multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ |
| 27 | 32 | |
| 28 | 33 | // Todo: This should be verified from the prom |
| 29 | if (gfx_region==4) | |
| 34 | if (gfx_region == 4) | |
| 30 | 35 | { |
| 31 | 36 | // Sprite 2 priority vs sprite 1 |
| 32 | if ((spriteram_base[offs+2]&0xc000)==0xc000) | |
| 33 | spri=4; | |
| 34 | else if ((spriteram_base[offs+2]&0xc000)) | |
| 35 | spri=16; | |
| 37 | if ((spriteram_base[offs + 2] & 0xc000) == 0xc000) | |
| 38 | spri = 4; | |
| 39 | else if ((spriteram_base[offs + 2] & 0xc000)) | |
| 40 | spri = 16; | |
| 36 | 41 | else |
| 37 | spri=64; | |
| 42 | spri = 64; | |
| 38 | 43 | |
| 39 | 44 | // Transparency |
| 40 | if (spriteram_base[offs+2]&0x2000) | |
| 45 | if (spriteram_base[offs + 2] & 0x2000) | |
| 41 | 46 | alpha = 0x80; |
| 42 | 47 | |
| 43 | if ( | |
| 48 | if ( | |
| 44 | 49 | { |
| 45 | 50 | // Additional sprite alpha in this mode |
| 46 | if (spriteram_base[offs+2]&0x8000) | |
| 51 | if (spriteram_base[offs + 2] & 0x8000) | |
| 47 | 52 | alpha = 0x80; |
| 48 | 53 | |
| 49 | 54 | // Sprite vs playfield |
| 50 | if ((spriteram_base[offs+2]&0xc000)==0xc000) | |
| 51 | pri=4; | |
| 52 | else if ((spriteram_base[offs+2]&0xc000)==0x8000) | |
| 53 | pri=16; | |
| 55 | if ((spriteram_base[offs + 2] & 0xc000) == 0xc000) | |
| 56 | pri = 4; | |
| 57 | else if ((spriteram_base[offs + 2] & 0xc000) == 0x8000) | |
| 58 | pri = 16; | |
| 54 | 59 | else |
| 55 | pri=64; | |
| 60 | pri = 64; | |
| 56 | 61 | } |
| 57 | 62 | else |
| 58 | 63 | { |
| 59 | if ((spriteram_base[offs+2]&0x8000)==0x8000) | |
| 60 | pri=16; | |
| 64 | if ((spriteram_base[offs + 2] & 0x8000) == 0x8000) | |
| 65 | pri = 16; | |
| 61 | 66 | else |
| 62 | pri=64; | |
| 67 | pri = 64; | |
| 63 | 68 | } |
| 64 | 69 | } |
| 65 | 70 | else |
| 66 | 71 | { |
| 67 | 72 | // Sprite 1 priority vs sprite 2 |
| 68 | if (spriteram_base[offs+2]&0x8000) // todo - check only in pri mode 2?? | |
| 69 | spri=8; | |
| 73 | if (spriteram_base[offs + 2] & 0x8000) // todo - check only in pri mode 2?? | |
| 74 | spri = 8; | |
| 70 | 75 | else |
| 71 | spri=32; | |
| 76 | spri = 32; | |
| 72 | 77 | |
| 73 | 78 | // Sprite vs playfield |
| 74 | if ( | |
| 79 | if ( | |
| 75 | 80 | { |
| 76 | if ((spriteram_base[offs+2]&0xc000)) | |
| 77 | pri=16; | |
| 81 | if ((spriteram_base[offs + 2] & 0xc000)) | |
| 82 | pri = 16; | |
| 78 | 83 | else |
| 79 | pri=64; | |
| 84 | pri = 64; | |
| 80 | 85 | } |
| 81 | 86 | else |
| 82 | 87 | { |
| 83 | if ((spriteram_base[offs+2]&0xc000)==0xc000) | |
| 84 | pri=4; | |
| 85 | else if ((spriteram_base[offs+2]&0xc000)==0x8000) | |
| 86 | pri=16; | |
| 88 | if ((spriteram_base[offs + 2] & 0xc000) == 0xc000) | |
| 89 | pri = 4; | |
| 90 | else if ((spriteram_base[offs + 2] & 0xc000) == 0x8000) | |
| 91 | pri = 16; | |
| 87 | 92 | else |
| 88 | pri=64; | |
| 93 | pri = 64; | |
| 89 | 94 | } |
| 90 | 95 | } |
| 91 | 96 | |
| r7500 | r7501 | |
| 94 | 99 | if (x >= 320) x -= 512; |
| 95 | 100 | if (y >= 256) y -= 512; |
| 96 | 101 | y = 240 - y; |
| 97 | ||
| 102 | | |
| 98 | 103 | |
| 99 | 104 | sprite &= ~multi; |
| 100 | 105 | if (fy) |
| r7500 | r7501 | |
| 107 | 112 | |
| 108 | 113 | if (flipscreen) |
| 109 | 114 | { |
| 110 | y=240-y; | |
| 111 | x=304-x; | |
| 112 | if (fx) fx=0; else fx=1; | |
| 113 | if (fy) fy=0; else fy=1; | |
| 114 | mult=16; | |
| 115 | y = 240 - y; | |
| 116 | x = 304 - x; | |
| 117 | if (fx) fx = 0; else fx = 1; | |
| 118 | if (fy) fy = 0; else fy = 1; | |
| 119 | mult = 16; | |
| 115 | 120 | } |
| 116 | else mult=-16; | |
| 121 | else | |
| 122 | mult = -16; | |
| 117 | 123 | |
| 118 | 124 | while (multi >= 0) |
| 119 | 125 | { |
| 120 | deco16_pdrawgfx( | |
| 126 | deco16ic_pdrawgfx( | |
| 127 | state->deco16ic, | |
| 121 | 128 | bitmap, cliprect, machine->gfx[gfx_region], |
| 122 | 129 | sprite - multi * inc, |
| 123 | 130 | colour, |
| r7500 | r7501 | |
| 130 | 137 | } |
| 131 | 138 | } |
| 132 | 139 | |
| 133 | ||
| 140 | VIDEO_UPDATE( | |
| 134 | 141 | { |
| 135 | return ((bank>>4) & 0x7) * 0x1000; | |
| 136 | } | |
| 142 | boogwing_state *state = (boogwing_state *)screen->machine->driver_data; | |
| 143 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 144 | UINT16 priority = deco16ic_priority_r(state->deco16ic, 0, 0xffff); | |
| 137 | 145 | |
| 138 | static int boogwing_bank_callback2(const int bank) | |
| 139 | { | |
| 140 | int offset=((bank>>4) & 0x7) * 0x1000; | |
| 141 | if ((bank&0xf)==0xa) | |
| 142 | offset+=0x800; // strange - transporter level | |
| 143 | return offset; | |
| 144 | } | |
| 146 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 147 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 148 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 145 | 149 | |
| 146 | VIDEO_START(boogwing) | |
| 147 | { | |
| 148 | deco16_2_video_init(machine, 0); | |
| 149 | ||
| 150 | deco16_set_tilemap_bank_callback(1,boogwing_bank_callback); | |
| 151 | deco16_set_tilemap_bank_callback(2,boogwing_bank_callback2); | |
| 152 | deco16_set_tilemap_bank_callback(3,boogwing_bank_callback2); | |
| 153 | deco16_set_tilemap_colour_base(1,0); | |
| 154 | deco16_set_tilemap_transparency_mask(1, 0x1f); // 5bpp graphics | |
| 155 | } | |
| 156 | ||
| 157 | VIDEO_UPDATE(boogwing) | |
| 158 | { | |
| 159 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 160 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 161 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 162 | ||
| 163 | 150 | /* Draw playfields */ |
| 164 | deco16_clear_sprite_priority_bitmap(); | |
| 165 | bitmap_fill(bitmap,cliprect,screen->machine->pens[0x400]); /* pen not confirmed */ | |
| 166 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 151 | deco16ic_clear_sprite_priority_bitmap(state->deco16ic); | |
| 152 | bitmap_fill(bitmap, cliprect, screen->machine->pens[0x400]); /* pen not confirmed */ | |
| 153 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 167 | 154 | |
| 168 | 155 | // bit&0x8 is definitely some kind of palette effect |
| 169 | 156 | // bit&0x4 combines playfields |
| 170 | if (( | |
| 157 | if (( | |
| 171 | 158 | { |
| 172 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 173 | deco16_tilemap_34_combine_draw(screen,bitmap,cliprect,0,32); | |
| 159 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 160 | deco16ic_tilemap_34_combine_draw(state->deco16ic, bitmap, cliprect, 0, 32); | |
| 174 | 161 | } |
| 175 | else if (( | |
| 162 | else if (( | |
| 176 | 163 | { |
| 177 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 178 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,8); | |
| 179 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,32); | |
| 164 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 165 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 8); | |
| 166 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 32); | |
| 180 | 167 | } |
| 181 | else if (( | |
| 168 | else if (( | |
| 182 | 169 | { |
| 183 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 184 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,8); | |
| 170 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 171 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 8); | |
| 185 | 172 | |
| 186 | 173 | // This mode uses playfield 3 to shadow sprites & playfield 2 (instead of |
| 187 | 174 | // regular alpha-blending, the destination is inverted). Not yet implemented. |
| 188 | // | |
| 175 | // | |
| 189 | 176 | } |
| 190 | 177 | else |
| 191 | 178 | { |
| 192 | deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 193 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,8); | |
| 194 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,32); | |
| 179 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 180 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 8); | |
| 181 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 32); | |
| 195 | 182 | } |
| 196 | 183 | |
| 197 | 184 | draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3); |
| 198 | 185 | draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4); |
| 199 | 186 | |
| 200 | deco16_tilemap_1_draw(s | |
| 187 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 201 | 188 | return 0; |
| 202 | 189 | } |
| r7500 | r7501 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | mugsmash_state *state = (mugsmash_state *)machine->driver_data; |
| 29 | 29 | const UINT16 *source = state->spriteram; |
| 30 | const UINT16 *finish = source+0x2000; | |
| 30 | const UINT16 *finish = source + 0x2000; | |
| 31 | 31 | const gfx_element *gfx = machine->gfx[0]; |
| 32 | 32 | |
| 33 | while | |
| 33 | while | |
| 34 | 34 | { |
| 35 | 35 | int xpos = source[0] & 0x00ff; |
| 36 | 36 | int ypos = source[4] & 0x00ff; |
| 37 | 37 | int num = (source[3] & 0x00ff) | ((source[2] & 0x00ff) << 8); |
| 38 | 38 | int attr = source[1]; |
| 39 | int flipx = (attr & 0x0080)>>7; | |
| 39 | int flipx = (attr & 0x0080) >> 7; | |
| 40 | 40 | int colour = (attr & 0x000f); |
| 41 | 41 | |
| 42 | 42 | xpos += ((attr & 0x0020) >> 5) * 0x100; |
| r7500 | r7501 | |
| 71 | 71 | */ |
| 72 | 72 | |
| 73 | 73 | mugsmash_state *state = (mugsmash_state *)machine->driver_data; |
| 74 | int tileno,colour,fx; | |
| 74 | int tileno, colour, fx; | |
| 75 | 75 | |
| 76 | tileno = state->videoram1[tile_index *2 +1]; | |
| 77 | colour = state->videoram1[tile_index *2] & 0x000f; | |
| 78 | fx = (state->videoram1[tile_index *2] & 0xc0) >>6; | |
| 76 | tileno = state->videoram1[tile_index * 2 + 1]; | |
| 77 | colour = state->videoram1[tile_index * 2] & 0x000f; | |
| 78 | fx = (state->videoram1[tile_index * 2] & 0xc0) >> 6; | |
| 79 | 79 | |
| 80 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(fx)); | |
| 80 | SET_TILE_INFO(1, tileno, colour, TILE_FLIPYX(fx)); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | WRITE16_HANDLER( mugsmash_videoram1_w ) |
| r7500 | r7501 | |
| 85 | 85 | mugsmash_state *state = (mugsmash_state *)space->machine->driver_data; |
| 86 | 86 | |
| 87 | 87 | state->videoram1[offset] = data; |
| 88 | tilemap_mark_tile_dirty(state->tilemap1,offset/2); | |
| 88 | tilemap_mark_tile_dirty(state->tilemap1, offset / 2); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static TILE_GET_INFO( get_mugsmash_tile_info2 ) |
| r7500 | r7501 | |
| 100 | 100 | */ |
| 101 | 101 | |
| 102 | 102 | mugsmash_state *state = (mugsmash_state *)machine->driver_data; |
| 103 | int tileno,colour,fx; | |
| 103 | int tileno, colour, fx; | |
| 104 | 104 | |
| 105 | tileno = state->videoram2[tile_index *2 +1]; | |
| 106 | colour = state->videoram2[tile_index *2] & 0x000f; | |
| 107 | fx = (state->videoram2[tile_index *2] & 0xc0) >>6; | |
| 105 | tileno = state->videoram2[tile_index * 2 + 1]; | |
| 106 | colour = state->videoram2[tile_index * 2] & 0x000f; | |
| 107 | fx = (state->videoram2[tile_index * 2] & 0xc0) >> 6; | |
| 108 | 108 | |
| 109 | SET_TILE_INFO(1,tileno,16+colour,TILE_FLIPYX(fx)); | |
| 109 | SET_TILE_INFO(1, tileno, 16 + colour, TILE_FLIPYX(fx)); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE16_HANDLER( mugsmash_videoram2_w ) |
| r7500 | r7501 | |
| 114 | 114 | mugsmash_state *state = (mugsmash_state *)space->machine->driver_data; |
| 115 | 115 | |
| 116 | 116 | state->videoram2[offset] = data; |
| 117 | tilemap_mark_tile_dirty(state->tilemap2,offset/2); | |
| 117 | tilemap_mark_tile_dirty(state->tilemap2, offset / 2); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | WRITE16_HANDLER (mugsmash_reg_w) |
| r7500 | r7501 | |
| 127 | 127 | switch (offset) |
| 128 | 128 | { |
| 129 | 129 | case 0: |
| 130 | tilemap_set_scrollx(state->tilemap2,0, state->regs1[2]+7); | |
| 130 | tilemap_set_scrollx(state->tilemap2, 0, state->regs1[2] + 7); | |
| 131 | 131 | break; |
| 132 | 132 | case 1: |
| 133 | tilemap_set_scrolly(state->tilemap2,0, state->regs1[3]+4); | |
| 133 | tilemap_set_scrolly(state->tilemap2, 0, state->regs1[3] + 4); | |
| 134 | 134 | break; |
| 135 | 135 | case 2: |
| 136 | tilemap_set_scrollx(state->tilemap1,0, state->regs1[0]+3); | |
| 136 | tilemap_set_scrollx(state->tilemap1, 0, state->regs1[0] + 3); | |
| 137 | 137 | break; |
| 138 | 138 | case 3: |
| 139 | tilemap_set_scrolly(state->tilemap1,0, state->regs1[1]+4); | |
| 139 | tilemap_set_scrolly(state->tilemap1, 0, state->regs1[1] + 4); | |
| 140 | 140 | break; |
| 141 | 141 | } |
| 142 | 142 | } |
| r7500 | r7501 | |
| 145 | 145 | { |
| 146 | 146 | mugsmash_state *state = (mugsmash_state *)machine->driver_data; |
| 147 | 147 | |
| 148 | state->tilemap1 = tilemap_create(machine, get_mugsmash_tile_info1,tilemap_scan_rows, 16, 16,32,32); | |
| 149 | tilemap_set_transparent_pen(state->tilemap1,0); | |
| 148 | state->tilemap1 = tilemap_create(machine, get_mugsmash_tile_info1, tilemap_scan_rows, 16, 16, 32, 32); | |
| 149 | tilemap_set_transparent_pen(state->tilemap1, 0); | |
| 150 | 150 | |
| 151 | state->tilemap2 = tilemap_create(machine, get_mugsmash_tile_info2,tilemap_scan_rows, 16, 16,32,32); | |
| 151 | state->tilemap2 = tilemap_create(machine, get_mugsmash_tile_info2, tilemap_scan_rows, 16, 16, 32, 32); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | VIDEO_UPDATE( mugsmash ) |
| 155 | 155 | { |
| 156 | 156 | mugsmash_state *state = (mugsmash_state *)screen->machine->driver_data; |
| 157 | 157 | |
| 158 | tilemap_draw(bitmap,cliprect,state->tilemap2,0,0); | |
| 159 | tilemap_draw(bitmap,cliprect,state->tilemap1,0,0); | |
| 160 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 158 | tilemap_draw(bitmap, cliprect, state->tilemap2, 0, 0); | |
| 159 | tilemap_draw(bitmap, cliprect, state->tilemap1, 0, 0); | |
| 160 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 161 | 161 | return 0; |
| 162 | 162 | } |
| r7500 | r7501 | |
|---|---|---|
| 1657 | 1657 | static float modelViewMatrix[16]; |
| 1658 | 1658 | static float cameraMatrix[16]; |
| 1659 | 1659 | |
| 1660 | static float lightStrength; | |
| 1661 | static float lightVector[3]; | |
| 1662 | ||
| 1660 | 1663 | struct polyVert |
| 1661 | 1664 | { |
| 1662 | 1665 | float worldCoords[4]; // World space coordinates (X Y Z 1.0) |
| r7500 | r7501 | |
| 1677 | 1680 | float faceNormal[4]; // Normal of the face overall - for calculating visibility and flat-shading... |
| 1678 | 1681 | int visible; // Polygon visibility in scene |
| 1679 | 1682 | |
| 1680 | INT8 texIndex; // Which texture to draw from (0x00-0x0f) | |
| 1681 | INT8 texType; // How to index into the texture | |
| 1683 | UINT8 texIndex; // Which texture to draw from (0x00-0x0f) | |
| 1684 | UINT8 texType; // How to index into the texture | |
| 1685 | UINT8 texPageSmall; // Does this polygon use 'small' texture pages? | |
| 1686 | UINT8 texPageHorizOffset; // If it does use small texture pages, how far is this page horizontally offset? | |
| 1687 | UINT8 texPageVertOffset; // If it does use small texture pages, how far is this page vertically offset? | |
| 1688 | ||
| 1682 | 1689 | UINT32 palOffset; // The base offset where this object's palette starts. |
| 1683 | 1690 | UINT32 palPageSize; // The size of the palette page that is being pointed to. |
| 1684 | 1691 | |
| r7500 | r7501 | |
| 1688 | 1695 | static void setIdentity(float *matrix); |
| 1689 | 1696 | static void matmul4(float *product, const float *a, const float *b); |
| 1690 | 1697 | static void vecmatmul4(float *product, const float *a, const float *b); |
| 1691 | //static float vecDotProduct( const float *a, const float *b); | |
| 1692 | //static void normalize(float* x); | |
| 1698 | static float vecDotProduct(const float *a, const float *b); | |
| 1699 | static void normalize(float* x); | |
| 1693 | 1700 | |
| 1694 | 1701 | static void performFrustumClip(struct polygon *p); |
| 1695 | 1702 | static void drawShaded(running_machine *machine, struct polygon *p); |
| r7500 | r7501 | |
| 1777 | 1784 | cameraMatrix[15] = 1.0f; |
| 1778 | 1785 | } |
| 1779 | 1786 | |
| 1787 | // Operation 0010 | |
| 1788 | // Lighting information | |
| 1789 | static void setLighting(const UINT16* packet) | |
| 1790 | { | |
| 1791 | /*////////////// | |
| 1792 | // PACKET FORMAT | |
| 1793 | // [0] - 0010 ... ID | |
| 1794 | // [1] - ???? ... ? Always zero | |
| 1795 | // [2] - ???? ... ? Always zero | |
| 1796 | // [3] - xxxx ... X light vector direction | |
| 1797 | // [4] - xxxx ... Y light vector direction | |
| 1798 | // [5] - xxxx ... Z light vector direction | |
| 1799 | // [6] - ???? ... ? Seems to be another light vector ? | |
| 1800 | // [7] - ???? ... ? Seems to be another light vector ? | |
| 1801 | // [8] - ???? ... ? Seems to be another light vector ? | |
| 1802 | // [9] - xxxx ... Strength according to sams64_2 [0000,01ff] | |
| 1803 | // [10] - ???? ... ? Used in fatfurwa | |
| 1804 | // [11] - ???? ... ? Used in fatfurwa | |
| 1805 | // [12] - ???? ... ? Used in fatfurwa | |
| 1806 | // [13] - ???? ... ? Used in fatfurwa | |
| 1807 | // [14] - ???? ... ? Used in fatfurwa | |
| 1808 | // [15] - ???? ... ? Used in fatfurwa | |
| 1809 | ////////////*/ | |
| 1810 | if (packet[1] != 0x0000) printf("ZOMG! packet[1] in setLighting function is non-zero!\n"); | |
| 1811 | if (packet[2] != 0x0000) printf("ZOMG! packet[2] in setLighting function is non-zero!\n"); | |
| 1812 | ||
| 1813 | lightVector[0] = uToF(packet[3]); | |
| 1814 | lightVector[1] = uToF(packet[4]); | |
| 1815 | lightVector[2] = uToF(packet[5]); | |
| 1816 | lightStrength = uToF(packet[9]); | |
| 1817 | } | |
| 1818 | ||
| 1780 | 1819 | // Operation 0011 |
| 1781 | 1820 | // Palette / Model flags? |
| 1782 | 1821 | static void set3dFlags(const UINT16* packet) |
| r7500 | r7501 | |
| 1813 | 1852 | // [1] - ???? ... ? Contains a value in buriki's 'how to play' - probably a projection window/offset. |
| 1814 | 1853 | // [2] - ???? ... ? Contains a value in buriki's 'how to play' - probably a projection window/offset. |
| 1815 | 1854 | // [3] - ???? ... ? Contains a value |
| 1816 | // [4] - ???? ... ? Contains a value in buriki | |
| 1817 | // [5] - ???? ... ? Contains a value | |
| 1818 | // [6] - xxxx ... camera projection near | |
| 1819 | // [7] - xxxx ... camera projection far | |
| 1820 | // [8] - ???? ... ? Contains a value | |
| 1821 | // [9] - ???? ... ? Contains a value | |
| 1822 | // [10] - xxxx ... camera projection right | |
| 1823 | // [11] - xxxx ... camera projection left | |
| 1824 | // [12] - xxxx ... camera projection top | |
| 1825 | // [13] - xxxx ... camera projection bottom | |
| 1855 | // [4] - xxxx ... Camera projection near scale | |
| 1856 | // [5] - xxxx ... Camera projection near height(?) | |
| 1857 | // [6] - xxxx ... Camera projection near width(?) | |
| 1858 | // [7] - xxxx ... Camera projection far scale | |
| 1859 | // [8] - xxxx ... Camera projection far height(?) | |
| 1860 | // [9] - xxxx ... Camera projection far width(?) | |
| 1861 | // [10] - xxxx ... Camera projection right | |
| 1862 | // [11] - xxxx ... Camera projection left | |
| 1863 | // [12] - xxxx ... Camera projection top | |
| 1864 | // [13] - xxxx ... Camera projection bottom | |
| 1826 | 1865 | // [14] - ???? ... ? Gets data during buriki door-run |
| 1827 | 1866 | // [15] - ???? ... ? Gets data during buriki door-run |
| 1828 | 1867 | ////////////*/ |
| r7500 | r7501 | |
| 1834 | 1873 | right = uToF(packet[10]); |
| 1835 | 1874 | top = uToF(packet[12]); |
| 1836 | 1875 | bottom = uToF(packet[13]); |
| 1837 | near_ = uToF(packet[6]); | |
| 1838 | far_ = uToF(packet[7]); | |
| 1876 | near_ = uToF(packet[6]) + (uToF(packet[6]) * uToF(packet[4])); | |
| 1877 | far_ = uToF(packet[9]) + (uToF(packet[9]) * uToF(packet[7])); | |
| 1878 | // (note are likely not 100% correct - I'm not using one of the parameters) | |
| 1839 | 1879 | |
| 1840 | 1880 | projectionMatrix[0] = (2.0f*near_)/(right-left); |
| 1841 | 1881 | projectionMatrix[1] = 0.0f; |
| r7500 | r7501 | |
| 1865 | 1905 | /*////////////// |
| 1866 | 1906 | // PACKET FORMAT |
| 1867 | 1907 | // [0] - 0100 ... ID |
| 1868 | // [1] - xxxx ... Flags | |
| 1908 | // [1] - ?--- ... Flags [?000 = ??? | |
| 1909 | // 0?00 = ??? | |
| 1910 | // 00?0 = ??? | |
| 1911 | // 000? = ???] | |
| 1912 | // [1] - -?-- ... Flags [?000 = ??? | |
| 1913 | // 0?00 = ??? | |
| 1914 | // 00?0 = ??? | |
| 1915 | // 000x = Dynamic palette bit] | |
| 1916 | // [1] - --?- ... Flags [?000 = ??? | |
| 1917 | // 0?00 = ??? | |
| 1918 | // 00?0 = ??? | |
| 1919 | // 000? = ???] | |
| 1920 | // [1] - ---? ... Flags [x000 = Apply lighting bit | |
| 1921 | // 0?00 = ??? | |
| 1922 | // 00?0 = ??? | |
| 1923 | // 000? = ???] | |
| 1869 | 1924 | // [2] - xxxx ... offset into ROM |
| 1870 | 1925 | // [3] - xxxx ... offset into ROM |
| 1871 | 1926 | // [4] - xxxx ... Transformation matrix |
| r7500 | r7501 | |
| 1954 | 2009 | UINT32 threeDOffset = (((UINT32)packet[2]) << 16) | ((UINT32)packet[3]); |
| 1955 | 2010 | UINT16* threeDPointer = &threeDRoms[threeDOffset * 3]; |
| 1956 | 2011 | |
| 1957 | if (threeDOffset >= | |
| 2012 | if (threeDOffset >= memory_re | |
| 1958 | 2013 | { |
| 1959 | 2014 | printf("Strange geometry packet: (ignoring)\n"); |
| 1960 | 2015 | printPacket(packet, 1); |
| r7500 | r7501 | |
| 2022 | 2077 | //////////////////////////////////////////// |
| 2023 | 2078 | // GATHER A SINGLE TRIANGLE'S INFORMATION // |
| 2024 | 2079 | //////////////////////////////////////////// |
| 2025 | /*///////////////////////// | |
| 2026 | // SINGLE POLY CHUNK FORMAT | |
| 2027 | // [0] ??-- - ???? unused ???? | |
| 2028 | // [0] --xx - Chunk type | |
| 2029 | // [1] ?--- - Flags [x000 = ??? | |
| 2030 | 0x00 = ??? | |
| 2031 | 00x0 = ??? | |
| 2032 | 000x = low-res texture flag] | |
| 2033 | // [1] -x-- - Explicit palette index. | |
| 2034 | // [1] --?- - Unknown | |
| 2035 | // [1] ---x - Texture index | |
| 2036 | // [2] ???? - Used in fatfurwa 'hng64' & everywhere in roadedge | |
| 2037 | /////////////////////////*/ | |
| 2080 | // SINGLE POLY CHUNK FORMAT | |
| 2081 | // [0] ??-- - ??? | |
| 2082 | // [0] --xx - Chunk type | |
| 2083 | // | |
| 2084 | // [1] ?--- - Flags [?000 = ??? | |
| 2085 | // 0?00 = ??? | |
| 2086 | // 00?0 = ??? | |
| 2087 | // 000x = low-res texture flag] | |
| 2088 | // [1] -x-- - Explicit 0x80 palette index. | |
| 2089 | // [1] --x- - Explicit 0x08 palette index. | |
| 2090 | // [1] ---x - Texture page (1024x1024 bytes) | |
| 2091 | // | |
| 2092 | // [2] x--- - Texture Flags [x000 = Uses 4x4 sub-texture pages? | |
| 2093 | // 0?00 = ??? - differen sub-page size? SNK logo in RoadEdge. Always on in bbust2. | |
| 2094 | // 00xx = Horizontal sub-texture page index] | |
| 2095 | // [2] -?-- - ??? - barely visible (thus far) in roadedge | |
| 2096 | // [2] --x- - Texture Flags [?000 = ??? | |
| 2097 | // 0xx0 = Vertical sub-texture page index. | |
| 2098 | // 000? = ???] | |
| 2099 | // [2] ---? - ??? | |
| 2100 | ////////////////////////// | |
| 2038 | 2101 | UINT8 chunkType = chunkOffset[0] & 0x00ff; |
| 2039 | 2102 | |
| 2040 | 2103 | // Debug - ajg |
| r7500 | r7501 | |
| 2057 | 2120 | if (chunkOffset[1] & 0x1000) polys[*numPolys].texType = 0x1; |
| 2058 | 2121 | else polys[*numPolys].texType = 0x0; |
| 2059 | 2122 | |
| 2123 | polys[*numPolys].texPageSmall = (chunkOffset[2] & 0x8000) >> 15; // Just a guess. | |
| 2124 | polys[*numPolys].texPageHorizOffset = (chunkOffset[2] & 0x3000) >> 12; | |
| 2125 | polys[*numPolys].texPageVertOffset = (chunkOffset[2] & 0x0060) >> 5; | |
| 2126 | ||
| 2060 | 2127 | polys[*numPolys].texIndex = chunkOffset[1] & 0x000f; |
| 2061 | 2128 | |
| 2062 | 2129 | |
| r7500 | r7501 | |
| 2069 | 2136 | So instead we're looking for a bit that is on for XRally & Buriki, but noone else. */ |
| 2070 | 2137 | if (hng64_3dregs[0x00/4] & 0x2000) |
| 2071 | 2138 | { |
| 2072 | polys[*numPolys].palOffset += 0x800; | |
| 2139 | if (strcmp(machine->basename, "roadedge")) | |
| 2140 | polys[*numPolys].palOffset += 0x800; | |
| 2073 | 2141 | } |
| 2074 | 2142 | |
| 2075 | 2143 | //UINT16 explicitPaletteValue0 = ((chunkOffset[?] & 0x????) >> ?) * 0x800; |
| r7500 | r7501 | |
| 2286 | 2354 | } |
| 2287 | 2355 | matmul4(modelViewMatrix, modelViewMatrix, objectMatrix); |
| 2288 | 2356 | |
| 2357 | // LIGHTING | |
| 2358 | if (packet[1] & 0x0008 && lightStrength > 0.0f) | |
| 2359 | { | |
| 2360 | for (int v = 0; v < 3; v++) | |
| 2361 | { | |
| 2362 | float transformedNormal[4]; | |
| 2363 | vecmatmul4(transformedNormal, objectMatrix, polys[*numPolys].vert[v].normal); | |
| 2364 | normalize(transformedNormal); | |
| 2365 | normalize(lightVector); | |
| 2366 | ||
| 2367 | float intensity = vecDotProduct(transformedNormal, lightVector) * -1.0f; | |
| 2368 | intensity = (intensity <= 0.0f) ? (0.0f) : (intensity); | |
| 2369 | intensity *= lightStrength * 128.0f * 0.5f; // HACK. This 0.5 is completely arbitrary. | |
| 2370 | intensity *= 255.0f; | |
| 2371 | if (intensity >= 255.0f) intensity = 255.0f; | |
| 2372 | ||
| 2373 | polys[*numPolys].vert[v].light[0] = intensity; | |
| 2374 | polys[*numPolys].vert[v].light[1] = intensity; | |
| 2375 | polys[*numPolys].vert[v].light[2] = intensity; | |
| 2376 | } | |
| 2377 | } | |
| 2378 | else | |
| 2379 | { | |
| 2380 | // Just clear out the light values | |
| 2381 | for (int v = 0; v < 3; v++) | |
| 2382 | { | |
| 2383 | polys[*numPolys].vert[v].light[0] = 0; | |
| 2384 | polys[*numPolys].vert[v].light[1] = 0; | |
| 2385 | polys[*numPolys].vert[v].light[2] = 0; | |
| 2386 | } | |
| 2387 | } | |
| 2388 | ||
| 2389 | ||
| 2289 | 2390 | // BACKFACE CULL // |
| 2290 | 2391 | // EMPIRICAL EVIDENCE SEEMS TO SHOW THE HNG64 HARDWARE DOES NOT BACKFACE CULL // |
| 2291 | 2392 | /* |
| r7500 | r7501 | |
| 2306 | 2407 | polys[*numPolys].visible = 0; |
| 2307 | 2408 | */ |
| 2308 | 2409 | |
| 2410 | ||
| 2309 | 2411 | // BEHIND-THE-CAMERA CULL // |
| 2310 | 2412 | vecmatmul4(cullRay, modelViewMatrix, polys[*numPolys].vert[0].worldCoords); |
| 2311 | 2413 | if (cullRay[2] > 0.0f) // Camera is pointing down -Z |
| r7500 | r7501 | |
| 2377 | 2479 | setCameraTransformation(packet); |
| 2378 | 2480 | break; |
| 2379 | 2481 | |
| 2380 | case 0x0010: // Unknown | |
| 2381 | // Called very interestingly per-frame in every game. Floats for sure. Light-related? | |
| 2482 | case 0x0010: // Lighting information. | |
| 2483 | //if (packet[9]) printPacket(packet, 1); | |
| 2484 | setLighting(packet); | |
| 2382 | 2485 | break; |
| 2383 | 2486 | |
| 2384 | 2487 | case 0x0011: // Palette / Model flags? |
| r7500 | r7501 | |
| 2498 | 2601 | ///////////////////// |
| 2499 | 2602 | |
| 2500 | 2603 | /* 4x4 matrix multiplication */ |
| 2501 | static void matmul4( | |
| 2604 | static void matmul4( | |
| 2502 | 2605 | { |
| 2503 | 2606 | int i; |
| 2504 | 2607 | for (i = 0; i < 4; i++) |
| r7500 | r7501 | |
| 2516 | 2619 | } |
| 2517 | 2620 | |
| 2518 | 2621 | /* vector by 4x4 matrix multiply */ |
| 2519 | static void vecmatmul4( | |
| 2622 | static void vecmatmul4( | |
| 2520 | 2623 | { |
| 2521 | 2624 | const float bi0 = b[0]; |
| 2522 | 2625 | const float bi1 = b[1]; |
| r7500 | r7501 | |
| 2529 | 2632 | product[3] = bi0 * a[3] + bi1 * a[7] + bi2 * a[11] + bi3 * a[15]; |
| 2530 | 2633 | } |
| 2531 | 2634 | |
| 2532 | #ifdef UNUSED_FUNCTION | |
| 2533 | static float vecDotProduct( const float *a, const float *b) | |
| 2635 | static float vecDotProduct(const float *a, const float *b) | |
| 2534 | 2636 | { |
| 2535 | 2637 | return ((a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2])); |
| 2536 | 2638 | } |
| 2537 | #endif | |
| 2538 | 2639 | |
| 2539 | 2640 | static void setIdentity(float *matrix) |
| 2540 | 2641 | { |
| r7500 | r7501 | |
| 2562 | 2663 | */ |
| 2563 | 2664 | } |
| 2564 | 2665 | |
| 2565 | #ifdef UNUSED_FUNCTION | |
| 2566 | 2666 | static void normalize(float* x) |
| 2567 | 2667 | { |
| 2568 | 2668 | double l2 = (x[0]*x[0]) + (x[1]*x[1]) + (x[2]*x[2]); |
| 2569 | double l=sqrt(l2); | |
| 2669 | double l = sqrt(l2); | |
| 2570 | 2670 | |
| 2571 | 2671 | x[0] = (float)(x[0] / l); |
| 2572 | 2672 | x[1] = (float)(x[1] / l); |
| 2573 | 2673 | x[2] = (float)(x[2] / l); |
| 2574 | 2674 | } |
| 2575 | #endif | |
| 2576 | 2675 | |
| 2577 | 2676 | |
| 2578 | 2677 | |
| r7500 | r7501 | |
| 2826 | 2925 | // polygon rendering // |
| 2827 | 2926 | /////////////////////// |
| 2828 | 2927 | |
| 2928 | struct polygonRasterOptions | |
| 2929 | { | |
| 2930 | UINT8 texType; | |
| 2931 | UINT8 texIndex; | |
| 2932 | UINT8 texPageSmall; | |
| 2933 | UINT8 texPageHorizOffset; | |
| 2934 | UINT8 texPageVertOffset; | |
| 2935 | int palOffset; | |
| 2936 | int palPageSize; | |
| 2937 | int debugColor; | |
| 2938 | }; | |
| 2939 | ||
| 2829 | 2940 | /*********************************************************************/ |
| 2830 | 2941 | /** FillSmoothTexPCHorizontalLine **/ |
| 2831 | 2942 | /** Input: Color Buffer (framebuffer), depth buffer, width and **/ |
| r7500 | r7501 | |
| 2836 | 2947 | /** Output: none **/ |
| 2837 | 2948 | /*********************************************************************/ |
| 2838 | 2949 | INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine, |
| 2839 | int textureType, int palOffset, int palPageSize, | |
| 2840 | int texIndex, int debugColor, | |
| 2950 | const polygonRasterOptions& prOptions, | |
| 2841 | 2951 | int x_start, int x_end, int y, float z_start, float z_delta, |
| 2842 | 2952 | float w_start, float w_delta, float r_start, float r_delta, |
| 2843 | 2953 | float g_start, float g_delta, float b_start, float b_delta, |
| r7500 | r7501 | |
| 2849 | 2959 | UINT8 paletteEntry = 0; |
| 2850 | 2960 | float t_coord, s_coord; |
| 2851 | 2961 | const UINT8 *gfx = memory_region(machine, "textures"); |
| 2852 | const UINT8 *textureOffset = &gfx[texIndex * 1024 * 1024]; | |
| 2962 | const UINT8 *textureOffset = &gfx[prOptions.texIndex * 1024 * 1024]; | |
| 2853 | 2963 | |
| 2854 | 2964 | for (; x_start <= x_end; x_start++) |
| 2855 | 2965 | { |
| r7500 | r7501 | |
| 2859 | 2969 | t_coord = t_start / w_start; |
| 2860 | 2970 | s_coord = s_start / w_start; |
| 2861 | 2971 | |
| 2862 | if ((debugColor & 0xff000000) == 0x01000000) | |
| 2972 | if ((prOptions.debugColor & 0xff000000) == 0x01000000) | |
| 2863 | 2973 | { |
| 2864 | 2974 | // UV COLOR MODE |
| 2865 | 2975 | *cb = MAKE_ARGB(255, (UINT8)(s_coord*255.0f), (UINT8)(t_coord*255.0f), (UINT8)(0)); |
| 2866 | 2976 | *db = z_start; |
| 2867 | 2977 | } |
| 2868 | else if ((debugColor & 0xff000000) == 0x02000000) | |
| 2978 | else if ((prOptions.debugColor & 0xff000000) == 0x02000000) | |
| 2869 | 2979 | { |
| 2870 | 2980 | // Lit |
| 2871 | 2981 | *cb = MAKE_ARGB(255, (UINT8)(r_start/w_start), (UINT8)(g_start/w_start), (UINT8)(b_start/w_start)); |
| 2872 | 2982 | *db = z_start; |
| 2873 | 2983 | } |
| 2874 | else if ((debugColor & 0xff000000) == 0xff000000) | |
| 2984 | else if ((prOptions.debugColor & 0xff000000) == 0xff000000) | |
| 2875 | 2985 | { |
| 2876 | 2986 | // DEBUG COLOR MODE |
| 2877 | *cb = debugColor; | |
| 2987 | *cb = prOptions.debugColor; | |
| 2878 | 2988 | *db = z_start; |
| 2879 | 2989 | } |
| 2880 | 2990 | else |
| 2881 | 2991 | { |
| 2882 | // TEXTURED | |
| 2883 | if (textureType == 0x0) | |
| 2884 | paletteEntry = textureOffset[(((int)(s_coord*1024.0f))*1024 + (int)(t_coord*1024.0f))]; | |
| 2885 | else if (textureType == 0x1) | |
| 2886 | paletteEntry = textureOffset[(((int)(s_coord*512.0f))*1024 + (int)(t_coord*512.0f))]; | |
| 2992 | float textureS = 0.0f; | |
| 2993 | float textureT = 0.0f; | |
| 2887 | 2994 | |
| 2995 | // Standard & Half-Res textures | |
| 2996 | if (prOptions.texType == 0x0) | |
| 2997 | { | |
| 2998 | textureS = s_coord * 1024.0f; | |
| 2999 | textureT = t_coord * 1024.0f; | |
| 3000 | } | |
| 3001 | else if (prOptions.texType == 0x1) | |
| 3002 | { | |
| 3003 | textureS = s_coord * 512.0f; | |
| 3004 | textureT = t_coord * 512.0f; | |
| 3005 | } | |
| 3006 | ||
| 3007 | // Small-Page textures | |
| 3008 | if (prOptions.texPageSmall) | |
| 3009 | { | |
| 3010 | textureT = fmod(textureT, 256.0f); | |
| 3011 | textureS = fmod(textureS, 256.0f); | |
| 3012 | ||
| 3013 | textureT += (256.0f * prOptions.texPageHorizOffset); | |
| 3014 | textureS += (256.0f * prOptions.texPageVertOffset); | |
| 3015 | } | |
| 3016 | paletteEntry = textureOffset[((int)textureS)*1024 + (int)textureT]; | |
| 3017 | ||
| 2888 | 3018 | // Naieve Alpha Implementation (?) - don't draw if you're at texture index 0... |
| 2889 | 3019 | if (paletteEntry != 0) |
| 2890 | 3020 | { |
| 2891 | paletteEntry %= palPageSize; | |
| 3021 | // The color out of the texture | |
| 3022 | paletteEntry %= prOptions.palPageSize; | |
| 3023 | UINT32 color = machine->pens[prOptions.palOffset + paletteEntry]; | |
| 2892 | 3024 | |
| 2893 | // Greyscale texture test. | |
| 2894 | // *cb = MAKE_ARGB(255, (UINT8)paletteEntry, (UINT8)paletteEntry, (UINT8)paletteEntry); | |
| 2895 | *cb = machine->pens[palOffset + paletteEntry]; | |
| 3025 | // Application of the lighting | |
| 3026 | UINT32 red = RGB_RED(color) + (UINT8)(r_start/w_start); | |
| 3027 | UINT32 green = RGB_GREEN(color) + (UINT8)(g_start/w_start); | |
| 3028 | UINT32 blue = RGB_BLUE(color) + (UINT8)(b_start/w_start); | |
| 3029 | ||
| 3030 | // Clamp and finalize | |
| 3031 | if (red >= 255) red = 255; | |
| 3032 | if (green >= 255) green = 255; | |
| 3033 | if (blue >= 255) blue = 255; | |
| 3034 | color = MAKE_ARGB(255, (UINT8)red, (UINT8)green, (UINT8)blue); | |
| 3035 | ||
| 3036 | *cb = color; | |
| 2896 | 3037 | *db = z_start; |
| 2897 | 3038 | } |
| 2898 | 3039 | } |
| r7500 | r7501 | |
| 2943 | 3084 | float A[4], float B[4], float C[4], |
| 2944 | 3085 | float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS |
| 2945 | 3086 | float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS |
| 2946 | int textureType, int palOffset, int palPageSize, | |
| 2947 | int texIndex, int debugColor) | |
| 3087 | const polygonRasterOptions& prOptions) | |
| 2948 | 3088 | { |
| 2949 | 3089 | // Get our order of points by increasing y-coord |
| 2950 | 3090 | float *p_min = ((A[1] <= B[1]) && (A[1] <= C[1])) ? A : ((B[1] <= A[1]) && (B[1] <= C[1])) ? B : C; |
| r7500 | r7501 | |
| 3041 | 3181 | t_max = (p_max == A) ? ta : (p_max == B) ? tb : tc; |
| 3042 | 3182 | |
| 3043 | 3183 | // Find out control points for y, this divides the triangle into upper and lower |
| 3044 | y_min = (((int)p_min[1]) + 0.5 >= p_min[1]) ? p_min[1] : ((int)p_min[1]) + 1; | |
| 3045 | y_max = (((int)p_max[1]) + 0.5 < p_max[1]) ? p_max[1] : ((int)p_max[1]) - 1; | |
| 3046 | y_mid = (((int)p_mid[1]) + 0.5 >= p_mid[1]) ? p_mid[1] : ((int)p_mid[1]) + 1; | |
| 3184 | y_min = (((int)p_min[1]) + 0.5 >= p_min[1]) ? (int)p_min[1] : ((int)p_min[1]) + 1; | |
| 3185 | y_max = (((int)p_max[1]) + 0.5 < p_max[1]) ? (int)p_max[1] : ((int)p_max[1]) - 1; | |
| 3186 | y_mid = (((int)p_mid[1]) + 0.5 >= p_mid[1]) ? (int)p_mid[1] : ((int)p_mid[1]) + 1; | |
| 3047 | 3187 | |
| 3048 | 3188 | // Compute the slopes of each line, and color this is used to determine the interpolation |
| 3049 | 3189 | x1_slope = (p_max[0] - p_min[0]) / (p_max[1] - p_min[1]); |
| r7500 | r7501 | |
| 3095 | 3235 | // Compute the integer starting and ending points and the appropriate z by |
| 3096 | 3236 | // interpolating. Remember the pixels are in the middle of the grid, i.e. (0.5,0.5,0.5) |
| 3097 | 3237 | if (x1_interp < x2_interp) { |
| 3098 | x_start = ((((int)x1_interp) + 0.5) >= x1_interp) ? x1_interp : ((int)x1_interp) + 1; | |
| 3099 | x_end = ((((int)x2_interp) + 0.5) < x2_interp) ? x2_interp : ((int)x2_interp) - 1; | |
| 3238 | x_start = ((((int)x1_interp) + 0.5) >= x1_interp) ? (int)x1_interp : ((int)x1_interp) + 1; | |
| 3239 | x_end = ((((int)x2_interp) + 0.5) < x2_interp) ? (int)x2_interp : ((int)x2_interp) - 1; | |
| 3100 | 3240 | z_delta_x = (z2_interp - z1_interp) / (x2_interp - x1_interp); |
| 3101 | 3241 | w_delta_x = (w2_interp - w1_interp) / (x2_interp - x1_interp); |
| 3102 | 3242 | r_delta_x = (r2_interp - r1_interp) / (x2_interp - x1_interp); |
| r7500 | r7501 | |
| 3114 | 3254 | t_interp_x = t1_interp + (t2_interp - t1_interp) * t; |
| 3115 | 3255 | |
| 3116 | 3256 | } else { |
| 3117 | x_start = ((((int)x2_interp) + 0.5) >= x2_interp) ? x2_interp : ((int)x2_interp) + 1; | |
| 3118 | x_end = ((((int)x1_interp) + 0.5) < x1_interp) ? x1_interp : ((int)x1_interp) - 1; | |
| 3257 | x_start = ((((int)x2_interp) + 0.5) >= x2_interp) ? (int)x2_interp : ((int)x2_interp) + 1; | |
| 3258 | x_end = ((((int)x1_interp) + 0.5) < x1_interp) ? (int)x1_interp : ((int)x1_interp) - 1; | |
| 3119 | 3259 | z_delta_x = (z1_interp - z2_interp) / (x1_interp - x2_interp); |
| 3120 | 3260 | w_delta_x = (w1_interp - w2_interp) / (x1_interp - x2_interp); |
| 3121 | 3261 | r_delta_x = (r1_interp - r2_interp) / (x1_interp - x2_interp); |
| r7500 | r7501 | |
| 3135 | 3275 | |
| 3136 | 3276 | // Pass the horizontal line to the filler, this could be put in the routine |
| 3137 | 3277 | // then interpolate for the next values of x and z |
| 3138 | FillSmoothTexPCHorizontalLine(machine, | |
| 3278 | FillSmoothTexPCHorizontalLine(machine, | |
| 3139 | 3279 | x_start, x_end, y_min, z_interp_x, z_delta_x, w_interp_x, w_delta_x, |
| 3140 | 3280 | r_interp_x, r_delta_x, g_interp_x, g_delta_x, b_interp_x, b_delta_x, |
| 3141 | 3281 | s_interp_x, s_delta_x, t_interp_x, t_delta_x); |
| r7500 | r7501 | |
| 3175 | 3315 | for (; y_mid <= y_max; y_mid++) { |
| 3176 | 3316 | |
| 3177 | 3317 | if (x1_interp < x2_interp) { |
| 3178 | x_start = ((((int)x1_interp) + 0.5) >= x1_interp) ? x1_interp : ((int)x1_interp) + 1; | |
| 3179 | x_end = ((((int)x2_interp) + 0.5) < x2_interp) ? x2_interp : ((int)x2_interp) - 1; | |
| 3318 | x_start = ((((int)x1_interp) + 0.5) >= x1_interp) ? (int)x1_interp : ((int)x1_interp) + 1; | |
| 3319 | x_end = ((((int)x2_interp) + 0.5) < x2_interp) ? (int)x2_interp : ((int)x2_interp) - 1; | |
| 3180 | 3320 | z_delta_x = (z2_interp - z1_interp) / (x2_interp - x1_interp); |
| 3181 | 3321 | w_delta_x = (w2_interp - w1_interp) / (x2_interp - x1_interp); |
| 3182 | 3322 | r_delta_x = (r2_interp - r1_interp) / (x2_interp - x1_interp); |
| r7500 | r7501 | |
| 3194 | 3334 | t_interp_x = t1_interp + (t2_interp - t1_interp) * t; |
| 3195 | 3335 | |
| 3196 | 3336 | } else { |
| 3197 | x_start = ((((int)x2_interp) + 0.5) >= x2_interp) ? x2_interp : ((int)x2_interp) + 1; | |
| 3198 | x_end = ((((int)x1_interp) + 0.5) < x1_interp) ? x1_interp : ((int)x1_interp) - 1; | |
| 3337 | x_start = ((((int)x2_interp) + 0.5) >= x2_interp) ? (int)x2_interp : ((int)x2_interp) + 1; | |
| 3338 | x_end = ((((int)x1_interp) + 0.5) < x1_interp) ? (int)x1_interp : ((int)x1_interp) - 1; | |
| 3199 | 3339 | z_delta_x = (z1_interp - z2_interp) / (x1_interp - x2_interp); |
| 3200 | 3340 | w_delta_x = (w1_interp - w2_interp) / (x1_interp - x2_interp); |
| 3201 | 3341 | r_delta_x = (r1_interp - r2_interp) / (x1_interp - x2_interp); |
| r7500 | r7501 | |
| 3215 | 3355 | |
| 3216 | 3356 | // Pass the horizontal line to the filler, this could be put in the routine |
| 3217 | 3357 | // then interpolate for the next values of x and z |
| 3218 | FillSmoothTexPCHorizontalLine(machine, | |
| 3358 | FillSmoothTexPCHorizontalLine(machine, | |
| 3219 | 3359 | x_start, x_end, y_mid, z_interp_x, z_delta_x, w_interp_x, w_delta_x, |
| 3220 | 3360 | r_interp_x, r_delta_x, g_interp_x, g_delta_x, b_interp_x, b_delta_x, |
| 3221 | 3361 | s_interp_x, s_delta_x, t_interp_x, t_delta_x); |
| r7500 | r7501 | |
| 3245 | 3385 | p->vert[j].texCoords[1] = p->vert[j].texCoords[1] * p->vert[j].clipCoords[3]; |
| 3246 | 3386 | } |
| 3247 | 3387 | |
| 3388 | // Set up the struct that will pass the polygon's options around. | |
| 3389 | polygonRasterOptions prOptions; | |
| 3390 | prOptions.texType = p->texType; | |
| 3391 | prOptions.texIndex = p->texIndex; | |
| 3392 | prOptions.palOffset = p->palOffset; | |
| 3393 | prOptions.palPageSize = p->palPageSize; | |
| 3394 | prOptions.debugColor = p->debugColor; | |
| 3395 | prOptions.texPageSmall = p->texPageSmall; | |
| 3396 | prOptions.texPageHorizOffset = p->texPageHorizOffset; | |
| 3397 | prOptions.texPageVertOffset = p->texPageVertOffset; | |
| 3398 | ||
| 3248 | 3399 | for (j = 1; j < p->n-1; j++) |
| 3249 | 3400 | { |
| 3250 | 3401 | RasterizeTriangle_SMOOTH_TEX_PC(machine, |
| 3251 | 3402 | p->vert[0].clipCoords, p->vert[j].clipCoords, p->vert[j+1].clipCoords, |
| 3252 | 3403 | p->vert[0].light, p->vert[j].light, p->vert[j+1].light, |
| 3253 | 3404 | p->vert[0].texCoords, p->vert[j].texCoords, p->vert[j+1].texCoords, |
| 3254 | p->texType, p->palOffset, p->palPageSize, | |
| 3255 | p->texIndex, p->debugColor); | |
| 3405 | prOptions); | |
| 3256 | 3406 | } |
| 3257 | 3407 | } |
| 3258 | 3408 |
| r7500 | r7501 | |
|---|---|---|
| 1 | /* Macross Plus - video | |
| 2 | see DRIVER file for notes */ | |
| 1 | /* video/macrossp.c */ | |
| 3 | 2 | |
| 4 | 3 | #include "emu.h" |
| 4 | #include "includes/macrossp.h" | |
| 5 | 5 | |
| 6 | 6 | |
| 7 | UINT32 *macrossp_scra_videoram, *macrossp_scra_videoregs; | |
| 8 | UINT32 *macrossp_scrb_videoram, *macrossp_scrb_videoregs; | |
| 9 | UINT32 *macrossp_scrc_videoram, *macrossp_scrc_videoregs; | |
| 10 | UINT32 *macrossp_text_videoram, *macrossp_text_videoregs; | |
| 11 | UINT32 *macrossp_spriteram; | |
| 12 | ||
| 13 | static UINT32 *spriteram_old,*spriteram_old2; | |
| 14 | ||
| 15 | static tilemap_t *macrossp_scra_tilemap, *macrossp_scrb_tilemap,*macrossp_scrc_tilemap, *macrossp_text_tilemap; | |
| 16 | ||
| 17 | ||
| 18 | 7 | /*** SCR A LAYER ***/ |
| 19 | 8 | |
| 20 | 9 | WRITE32_HANDLER( macrossp_scra_videoram_w ) |
| 21 | 10 | { |
| 22 | | |
| 11 | macrossp_state *state = ( | |
| 23 | 12 | |
| 24 | tilemap_mark_tile_dirty(macrossp_scra_tilemap,offset); | |
| 13 | COMBINE_DATA(&state->scra_videoram[offset]); | |
| 14 | ||
| 15 | tilemap_mark_tile_dirty(state->scra_tilemap, offset); | |
| 25 | 16 | } |
| 26 | 17 | |
| 27 | 18 | |
| 28 | 19 | static TILE_GET_INFO( get_macrossp_scra_tile_info ) |
| 29 | 20 | { |
| 30 | UINT32 attr,tileno,color; | |
| 21 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 22 | UINT32 attr, tileno, color; | |
| 31 | 23 | |
| 32 | attr = | |
| 24 | attr = | |
| 33 | 25 | tileno = attr & 0x0000ffff; |
| 34 | 26 | |
| 35 | switch ( | |
| 27 | switch ( | |
| 36 | 28 | { |
| 37 | 29 | case 0x00000800: |
| 38 | 30 | color = (attr & 0x000e0000) >> 15; |
| r7500 | r7501 | |
| 47 | 39 | break; |
| 48 | 40 | } |
| 49 | 41 | |
| 50 | SET_TILE_INFO(1,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 42 | SET_TILE_INFO(1, tileno, color, TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 51 | 43 | } |
| 52 | 44 | |
| 53 | 45 | /*** SCR B LAYER ***/ |
| 54 | 46 | |
| 55 | 47 | WRITE32_HANDLER( macrossp_scrb_videoram_w ) |
| 56 | 48 | { |
| 57 | | |
| 49 | | |
| 58 | 50 | |
| 59 | tilemap_mark_tile_dirty(macrossp_scrb_tilemap,offset); | |
| 51 | COMBINE_DATA(&state->scrb_videoram[offset]); | |
| 52 | ||
| 53 | tilemap_mark_tile_dirty(state->scrb_tilemap, offset); | |
| 60 | 54 | } |
| 61 | 55 | |
| 62 | 56 | |
| 63 | 57 | static TILE_GET_INFO( get_macrossp_scrb_tile_info ) |
| 64 | 58 | { |
| 65 | UINT32 attr,tileno,color; | |
| 59 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 60 | UINT32 attr, tileno, color; | |
| 66 | 61 | |
| 67 | attr = | |
| 62 | attr = | |
| 68 | 63 | tileno = attr & 0x0000ffff; |
| 69 | 64 | |
| 70 | switch ( | |
| 65 | switch ( | |
| 71 | 66 | { |
| 72 | 67 | case 0x00000800: |
| 73 | 68 | color = (attr & 0x000e0000) >> 15; |
| r7500 | r7501 | |
| 82 | 77 | break; |
| 83 | 78 | } |
| 84 | 79 | |
| 85 | SET_TILE_INFO(2,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 80 | SET_TILE_INFO(2, tileno, color, TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 86 | 81 | } |
| 87 | 82 | |
| 88 | 83 | /*** SCR C LAYER ***/ |
| 89 | 84 | |
| 90 | 85 | WRITE32_HANDLER( macrossp_scrc_videoram_w ) |
| 91 | 86 | { |
| 92 | | |
| 87 | macrossp_state *state = ( | |
| 93 | 88 | |
| 94 | tilemap_mark_tile_dirty(macrossp_scrc_tilemap,offset); | |
| 89 | COMBINE_DATA(&state->scrc_videoram[offset]); | |
| 90 | ||
| 91 | tilemap_mark_tile_dirty(state->scrc_tilemap, offset); | |
| 95 | 92 | } |
| 96 | 93 | |
| 97 | 94 | |
| 98 | 95 | static TILE_GET_INFO( get_macrossp_scrc_tile_info ) |
| 99 | 96 | { |
| 100 | UINT32 attr,tileno,color; | |
| 97 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 98 | UINT32 attr, tileno, color; | |
| 101 | 99 | |
| 102 | attr = | |
| 100 | attr = | |
| 103 | 101 | tileno = attr & 0x0000ffff; |
| 104 | 102 | |
| 105 | switch ( | |
| 103 | switch ( | |
| 106 | 104 | { |
| 107 | 105 | case 0x00000800: |
| 108 | 106 | color = (attr & 0x000e0000) >> 15; |
| r7500 | r7501 | |
| 117 | 115 | break; |
| 118 | 116 | } |
| 119 | 117 | |
| 120 | SET_TILE_INFO(3,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 118 | SET_TILE_INFO(3, tileno, color, TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 121 | 119 | } |
| 122 | 120 | |
| 123 | 121 | /*** TEXT LAYER ***/ |
| 124 | 122 | |
| 125 | 123 | WRITE32_HANDLER( macrossp_text_videoram_w ) |
| 126 | 124 | { |
| 127 | | |
| 125 | | |
| 128 | 126 | |
| 129 | tilemap_mark_tile_dirty(macrossp_text_tilemap,offset); | |
| 127 | COMBINE_DATA(&state->text_videoram[offset]); | |
| 128 | ||
| 129 | tilemap_mark_tile_dirty(state->text_tilemap, offset); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static TILE_GET_INFO( get_macrossp_text_tile_info ) |
| 134 | 134 | { |
| 135 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 135 | 136 | UINT32 tileno, colour; |
| 136 | 137 | |
| 137 | tileno = macrossp_text_videoram[tile_index] & 0x0000ffff; | |
| 138 | colour = (macrossp_text_videoram[tile_index] & 0x00fe0000) >> 17; | |
| 138 | tileno = state->text_videoram[tile_index] & 0x0000ffff; | |
| 139 | colour = (state->text_videoram[tile_index] & 0x00fe0000) >> 17; | |
| 139 | 140 | |
| 140 | SET_TILE_INFO(4,tileno,colour,0); | |
| 141 | SET_TILE_INFO(4, tileno, colour, 0); | |
| 141 | 142 | } |
| 142 | 143 | |
| 143 | 144 | |
| 144 | 145 | |
| 145 | 146 | /*** VIDEO START / UPDATE ***/ |
| 146 | 147 | |
| 147 | VIDEO_START(macrossp) | |
| 148 | VIDEO_START( macrossp ) | |
| 148 | 149 | { |
| 149 | spriteram_old = auto_alloc_array_clear(machine, UINT32, machine->generic.spriteram_size/4); | |
| 150 | spriteram_old2 = auto_alloc_array_clear(machine, UINT32, machine->generic.spriteram_size/4); | |
| 150 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 151 | 151 | |
| 152 | macrossp_text_tilemap = tilemap_create(machine, get_macrossp_text_tile_info,tilemap_scan_rows,16,16,64,64); | |
| 153 | macrossp_scra_tilemap = tilemap_create(machine, get_macrossp_scra_tile_info,tilemap_scan_rows,16,16,64,64); | |
| 154 | macrossp_scrb_tilemap = tilemap_create(machine, get_macrossp_scrb_tile_info,tilemap_scan_rows,16,16,64,64); | |
| 155 | macrossp_scrc_tilemap = tilemap_create(machine, get_macrossp_scrc_tile_info,tilemap_scan_rows,16,16,64,64); | |
| 152 | state->spriteram_old = auto_alloc_array_clear(machine, UINT32, state->spriteram_size / 4); | |
| 153 | state->spriteram_old2 = auto_alloc_array_clear(machine, UINT32, state->spriteram_size / 4); | |
| 156 | 154 | |
| 157 | tilemap_set_transparent_pen(macrossp_text_tilemap,0); | |
| 158 | tilemap_set_transparent_pen(macrossp_scra_tilemap,0); | |
| 159 | tilemap_set_transparent_pen(macrossp_scrb_tilemap,0); | |
| 160 | tilemap_set_transparent_pen(macrossp_scrc_tilemap,0); | |
| 155 | state->text_tilemap = tilemap_create(machine, get_macrossp_text_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 156 | state->scra_tilemap = tilemap_create(machine, get_macrossp_scra_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 157 | state->scrb_tilemap = tilemap_create(machine, get_macrossp_scrb_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 158 | state->scrc_tilemap = tilemap_create(machine, get_macrossp_scrc_tile_info, tilemap_scan_rows, 16, 16, 64, 64); | |
| 161 | 159 | |
| 162 | machine->gfx[0]->color_granularity=64; | |
| 163 | machine->gfx[1]->color_granularity=64; | |
| 164 | machine->gfx[2]->color_granularity=64; | |
| 165 | machine->gfx[3]->color_granularity=64; | |
| 160 | tilemap_set_transparent_pen(state->text_tilemap, 0); | |
| 161 | tilemap_set_transparent_pen(state->scra_tilemap, 0); | |
| 162 | tilemap_set_transparent_pen(state->scrb_tilemap, 0); | |
| 163 | tilemap_set_transparent_pen(state->scrc_tilemap, 0); | |
| 164 | ||
| 165 | machine->gfx[0]->color_granularity = 64; | |
| 166 | machine->gfx[1]->color_granularity = 64; | |
| 167 | machine->gfx[2]->color_granularity = 64; | |
| 168 | machine->gfx[3]->color_granularity = 64; | |
| 169 | ||
| 170 | state_save_register_global_pointer(machine, state->spriteram_old, state->spriteram_size / 4); | |
| 171 | state_save_register_global_pointer(machine, state->spriteram_old2, state->spriteram_size / 4); | |
| 166 | 172 | } |
| 167 | 173 | |
| 168 | 174 | |
| 169 | 175 | |
| 170 | 176 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority ) |
| 171 | 177 | { |
| 178 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 172 | 179 | const gfx_element *gfx = machine->gfx[0]; |
| 173 | // UINT32 *source = macrossp_spriteram; | |
| 174 | UINT32 *source = spriteram_old2; /* buffers by two frames */ | |
| 175 | UINT32 *finish = source + machine->generic.spriteram_size/4; | |
| 180 | // UINT32 *source = state->spriteram; | |
| 181 | UINT32 *source = state->spriteram_old2; /* buffers by two frames */ | |
| 182 | UINT32 *finish = source + state->spriteram_size / 4; | |
| 176 | 183 | |
| 177 | ||
| 178 | while( source<finish ) | |
| 184 | while (source < finish) | |
| 179 | 185 | { |
| 180 | 186 | |
| 181 | 187 | /* |
| r7500 | r7501 | |
| 208 | 214 | |
| 209 | 215 | int loopno = 0; |
| 210 | 216 | |
| 211 | int xcnt,ycnt; | |
| 212 | int xoffset,yoffset; | |
| 217 | int xcnt, ycnt; | |
| 218 | int xoffset, yoffset; | |
| 213 | 219 | |
| 214 | 220 | int pri = (source[2] & 0x0c000000) >> 26; |
| 215 | 221 | |
| r7500 | r7501 | |
| 234 | 240 | if (xpos > 0x1ff) xpos -=0x400; |
| 235 | 241 | if (ypos > 0x1ff) ypos -=0x400; |
| 236 | 242 | |
| 237 | if (!flipx) { | |
| 238 | if (!flipy) { /* noxflip, noyflip */ | |
| 243 | if (!flipx) | |
| 244 | { | |
| 245 | if (!flipy) | |
| 246 | { | |
| 247 | /* noxflip, noyflip */ | |
| 239 | 248 | yoffset = 0; /* I'm doing this so rounding errors are cumulative, still looks a touch crappy when multiple sprites used together */ |
| 240 | for (ycnt = 0; ycnt <= high; ycnt++) { | |
| 249 | for (ycnt = 0; ycnt <= high; ycnt++) | |
| 250 | { | |
| 241 | 251 | xoffset = 0; |
| 242 | for (xcnt = 0; xcnt <= wide; xcnt++) { | |
| 252 | for (xcnt = 0; xcnt <= wide; xcnt++) | |
| 253 | { | |
| 243 | 254 | drawgfxzoom_alpha(bitmap,cliprect,gfx,tileno+loopno,col,flipx,flipy,xpos+xoffset,ypos+yoffset,xzoom*0x100,yzoom*0x100,0,alpha); |
| 244 | 255 | |
| 245 | 256 | xoffset += ((xzoom*16 + (1<<7)) >> 8); |
| r7500 | r7501 | |
| 247 | 258 | } |
| 248 | 259 | yoffset += ((yzoom*16 + (1<<7)) >> 8); |
| 249 | 260 | } |
| 250 | }else{ /* noxflip, flipy */ | |
| 251 | yoffset = ((high*yzoom*16) >> 8); | |
| 252 | for (ycnt = high; ycnt >= 0; ycnt--) { | |
| 261 | } | |
| 262 | else | |
| 263 | { | |
| 264 | /* noxflip, flipy */ | |
| 265 | yoffset = ((high * yzoom * 16) >> 8); | |
| 266 | for (ycnt = high; ycnt >= 0; ycnt--) | |
| 267 | { | |
| 253 | 268 | xoffset = 0; |
| 254 | for (xcnt = 0; xcnt <= wide; xcnt++) { | |
| 269 | for (xcnt = 0; xcnt <= wide; xcnt++) | |
| 270 | { | |
| 255 | 271 | drawgfxzoom_alpha(bitmap,cliprect,gfx,tileno+loopno,col,flipx,flipy,xpos+xoffset,ypos+yoffset,xzoom*0x100,yzoom*0x100,0,alpha); |
| 256 | 272 | |
| 257 | xoffset += ((xzoom*16 + (1<<7)) >> 8); | |
| 273 | xoffset += ((xzoom * 16 + (1 << 7)) >> 8); | |
| 258 | 274 | loopno++; |
| 259 | 275 | } |
| 260 | yoffset -= ((yzoom*16 + (1<<7)) >> 8); | |
| 276 | yoffset -= ((yzoom * 16 + (1 << 7)) >> 8); | |
| 261 | 277 | } |
| 262 | 278 | } |
| 263 | }else{ | |
| 264 | if (!flipy) { /* xflip, noyflip */ | |
| 279 | } | |
| 280 | else | |
| 281 | { | |
| 282 | if (!flipy) | |
| 283 | { | |
| 284 | /* xflip, noyflip */ | |
| 265 | 285 | yoffset = 0; |
| 266 | for (ycnt = 0; ycnt <= high; ycnt++) { | |
| 286 | for (ycnt = 0; ycnt <= high; ycnt++) | |
| 287 | { | |
| 267 | 288 | xoffset = ((wide*xzoom*16) >> 8); |
| 268 | for (xcnt = wide; xcnt >= 0; xcnt--) { | |
| 289 | for (xcnt = wide; xcnt >= 0; xcnt--) | |
| 290 | { | |
| 269 | 291 | drawgfxzoom_alpha(bitmap,cliprect,gfx,tileno+loopno,col,flipx,flipy,xpos+xoffset,ypos+yoffset,xzoom*0x100,yzoom*0x100,0,alpha); |
| 270 | 292 | |
| 271 | xoffset -= ((xzoom*16 + (1<<7)) >> 8); | |
| 293 | xoffset -= ((xzoom * 16 + (1 << 7)) >> 8); | |
| 272 | 294 | loopno++; |
| 273 | 295 | } |
| 274 | yoffset += ((yzoom*16 + (1<<7)) >> 8); | |
| 296 | yoffset += ((yzoom * 16 + (1 << 7)) >> 8); | |
| 275 | 297 | } |
| 276 | }else{ /* xflip, yflip */ | |
| 277 | yoffset = ((high*yzoom*16) >> 8); | |
| 278 | for (ycnt = high; ycnt >= 0; ycnt--) { | |
| 279 | xoffset = ((wide*xzoom*16) >> 8); | |
| 280 | for (xcnt = wide; xcnt >=0 ; xcnt--) { | |
| 298 | } | |
| 299 | else | |
| 300 | { | |
| 301 | /* xflip, yflip */ | |
| 302 | yoffset = ((high * yzoom * 16) >> 8); | |
| 303 | for (ycnt = high; ycnt >= 0; ycnt--) | |
| 304 | { | |
| 305 | xoffset = ((wide * xzoom * 16) >> 8); | |
| 306 | for (xcnt = wide; xcnt >=0 ; xcnt--) | |
| 307 | { | |
| 281 | 308 | drawgfxzoom_alpha(bitmap,cliprect,gfx,tileno+loopno,col,flipx,flipy,xpos+xoffset,ypos+yoffset,xzoom*0x100,yzoom*0x100,0,alpha); |
| 282 | 309 | |
| 283 | xoffset -= ((xzoom*16 + (1<<7)) >> 8); | |
| 310 | xoffset -= ((xzoom * 16 + (1 << 7)) >> 8); | |
| 284 | 311 | loopno++; |
| 285 | 312 | } |
| 286 | yoffset -= ((yzoom*16 + (1<<7)) >> 8); | |
| 313 | yoffset -= ((yzoom * 16 + (1 << 7)) >> 8); | |
| 287 | 314 | } |
| 288 | 315 | } |
| 289 | 316 | } |
| r7500 | r7501 | |
| 293 | 320 | } |
| 294 | 321 | |
| 295 | 322 | |
| 296 | static void draw_layer(bitmap_t *bitmap, const rectangle *cliprect, int layer) | |
| 323 | static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer ) | |
| 297 | 324 | { |
| 325 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 298 | 326 | tilemap_t *tm; |
| 299 | 327 | UINT32 *vr; |
| 300 | 328 | |
| r7500 | r7501 | |
| 302 | 330 | { |
| 303 | 331 | case 0: |
| 304 | 332 | default: |
| 305 | tm = macrossp_scra_tilemap; | |
| 306 | vr = macrossp_scra_videoregs; | |
| 333 | tm = state->scra_tilemap; | |
| 334 | vr = state->scra_videoregs; | |
| 307 | 335 | break; |
| 308 | 336 | |
| 309 | 337 | case 1: |
| 310 | tm = macrossp_scrb_tilemap; | |
| 311 | vr = macrossp_scrb_videoregs; | |
| 338 | tm = state->scrb_tilemap; | |
| 339 | vr = state->scrb_videoregs; | |
| 312 | 340 | break; |
| 313 | 341 | |
| 314 | 342 | case 2: |
| 315 | tm = macrossp_scrc_tilemap; | |
| 316 | vr = macrossp_scrc_videoregs; | |
| 343 | tm = state->scrc_tilemap; | |
| 344 | vr = state->scrc_videoregs; | |
| 317 | 345 | break; |
| 318 | 346 | } |
| 319 | 347 | |
| 320 | 348 | if ((vr[2] & 0xf0000000) == 0xe0000000) /* zoom enable (guess, surely wrong) */ |
| 321 | 349 | { |
| 322 | int startx,starty,inc; | |
| 350 | int startx, starty, inc; | |
| 323 | 351 | |
| 324 | 352 | startx = (vr[1] & 0x0000ffff) << 16; |
| 325 | 353 | starty = (vr[1] & 0xffff0000) >> 0; |
| r7500 | r7501 | |
| 339 | 367 | { |
| 340 | 368 | tilemap_set_scrollx( tm, 0, ((vr[0] & 0x000003ff) >> 0 ) ); |
| 341 | 369 | tilemap_set_scrolly( tm, 0, ((vr[0] & 0x03ff0000) >> 16) ); |
| 342 | tilemap_draw(bitmap,cliprect,tm,0,0); | |
| 370 | tilemap_draw(bitmap, cliprect, tm, 0, 0); | |
| 343 | 371 | } |
| 344 | 372 | } |
| 345 | 373 | |
| r7500 | r7501 | |
| 359 | 387 | SWAP(1,2) |
| 360 | 388 | } |
| 361 | 389 | |
| 362 | VIDEO_UPDATE(macrossp) | |
| 390 | VIDEO_UPDATE( macrossp ) | |
| 363 | 391 | { |
| 392 | macrossp_state *state = (macrossp_state *)screen->machine->driver_data; | |
| 364 | 393 | int layers[3],layerpri[3]; |
| 365 | 394 | |
| 395 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 366 | 396 | |
| 367 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); | |
| 368 | ||
| 369 | 397 | layers[0] = 0; |
| 370 | layerpri[0] = ( | |
| 398 | layerpri[0] = ( | |
| 371 | 399 | layers[1] = 1; |
| 372 | layerpri[1] = ( | |
| 400 | layerpri[1] = ( | |
| 373 | 401 | layers[2] = 2; |
| 374 | layerpri[2] = ( | |
| 402 | layerpri[2] = ( | |
| 375 | 403 | |
| 376 | 404 | sortlayers(layers, layerpri); |
| 377 | 405 | |
| 378 | draw_layer(bitmap,cliprect,layers[0]); | |
| 379 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 380 | draw_layer(bitmap,cliprect,layers[1]); | |
| 381 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 382 | draw_layer(bitmap,cliprect,layers[2]); | |
| 383 | draw_sprites(screen->machine,bitmap,cliprect,2); | |
| 384 | draw_sprites(screen->machine,bitmap,cliprect,3); | |
| 385 | tilemap_draw(bitmap,cliprect,macrossp_text_tilemap,0,0); | |
| 406 | draw_layer(screen->machine, bitmap, cliprect, layers[0]); | |
| 407 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 408 | draw_layer(screen->machine, bitmap, cliprect, layers[1]); | |
| 409 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 410 | draw_layer(screen->machine, bitmap, cliprect, layers[2]); | |
| 411 | draw_sprites(screen->machine, bitmap, cliprect, 2); | |
| 412 | draw_sprites(screen->machine, bitmap, cliprect, 3); | |
| 413 | tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0); | |
| 386 | 414 | |
| 387 | 415 | #if 0 |
| 388 | 416 | popmessage ("scra - %08x %08x %08x\nscrb - %08x %08x %08x\nscrc - %08x %08x %08x", |
| 389 | macrossp_scra_videoregs[0]&0xffff33ff, // yyyyxxxx | |
| 390 | macrossp_scra_videoregs[1], // ??? more scrolling? | |
| 391 | macrossp_scra_videoregs[2], // 08 - 0b | |
| 417 | state->scra_videoregs[0]&0xffff33ff, // yyyyxxxx | |
| 418 | state->scra_videoregs[1], // ??? more scrolling? | |
| 419 | state->scra_videoregs[2], // 08 - 0b | |
| 392 | 420 | |
| 393 | macrossp_scrb_videoregs[0]&0xffff33ff, // 00 - 03 | |
| 394 | macrossp_scrb_videoregs[1], // 04 - 07 | |
| 395 | macrossp_scrb_videoregs[2], // 08 - 0b | |
| 421 | state->scrb_videoregs[0]&0xffff33ff, // 00 - 03 | |
| 422 | state->scrb_videoregs[1], // 04 - 07 | |
| 423 | state->scrb_videoregs[2], // 08 - 0b | |
| 396 | 424 | |
| 397 | macrossp_scrc_videoregs[0]&0xffff33ff, // 00 - 03 | |
| 398 | macrossp_scrc_videoregs[1], // 04 - 07 | |
| 399 | macrossp_scrc_videoregs[2]);// 08 - 0b | |
| 425 | state->scrc_videoregs[0]&0xffff33ff, // 00 - 03 | |
| 426 | state->scrc_videoregs[1], // 04 - 07 | |
| 427 | state->scrc_videoregs[2]);// 08 - 0b | |
| 400 | 428 | #endif |
| 401 | 429 | return 0; |
| 402 | 430 | } |
| 403 | 431 | |
| 404 | 432 | VIDEO_EOF( macrossp ) |
| 405 | 433 | { |
| 434 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 435 | ||
| 406 | 436 | /* looks like sprites are *two* frames ahead, like nmk16 */ |
| 407 | memcpy(spriteram_old2,spriteram_old,machine->generic.spriteram_size); | |
| 408 | memcpy(spriteram_old,macrossp_spriteram,machine->generic.spriteram_size); | |
| 437 | memcpy(state->spriteram_old2, state->spriteram_old, state->spriteram_size); | |
| 438 | memcpy(state->spriteram_old, state->spriteram, state->spriteram_size); | |
| 409 | 439 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | #include "includes/deco16ic.h" | |
| 2 | #include "video/deco16ic.h" | |
| 3 | #include "includes/pktgaldx.h" | |
| 3 | 4 | |
| 4 | UINT16* pcktgaldb_fgram; | |
| 5 | UINT16* pcktgaldb_sprites; | |
| 6 | ||
| 7 | ||
| 8 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 5 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect ) | |
| 9 | 6 | { |
| 10 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 7 | pktgaldx_state *state = (pktgaldx_state *)machine->driver_data; | |
| 8 | UINT16 *spriteram = state->spriteram; | |
| 11 | 9 | int offs; |
| 12 | int flipscreen=!flip_screen_get(machine); | |
| 10 | int flipscreen = !flip_screen_get(machine); | |
| 13 | 11 | |
| 14 | for (offs = 0;offs < 0x400;offs += 4) | |
| 12 | for (offs = 0; offs < 0x400; offs += 4) | |
| 15 | 13 | { |
| 16 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 14 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 17 | 15 | |
| 18 | sprite = spriteram16[offs+1]; | |
| 19 | if (!sprite) continue; | |
| 16 | sprite = spriteram[offs+1]; | |
| 17 | if (!sprite) | |
| 18 | continue; | |
| 20 | 19 | |
| 21 | y = spriteram16[offs]; | |
| 22 | flash=y&0x1000; | |
| 23 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 20 | y = spriteram[offs]; | |
| 21 | flash = y & 0x1000; | |
| 22 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 23 | continue; | |
| 24 | 24 | |
| 25 | x = spriteram16[offs+2]; | |
| 26 | colour = (x >>9) & 0x1f; | |
| 25 | x = spriteram[offs + 2]; | |
| 26 | colour = (x >> 9) & 0x1f; | |
| 27 | 27 | |
| 28 | 28 | fx = y & 0x2000; |
| 29 | 29 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 34 | 34 | if (x >= 320) x -= 512; |
| 35 | 35 | if (y >= 256) y -= 512; |
| 36 | 36 | y = 240 - y; |
| 37 | ||
| 37 | | |
| 38 | 38 | |
| 39 | if (x>320) continue; | |
| 39 | if (x > 320) | |
| 40 | continue; | |
| 40 | 41 | |
| 41 | 42 | sprite &= ~multi; |
| 42 | 43 | if (fy) |
| r7500 | r7501 | |
| 49 | 50 | |
| 50 | 51 | if (flipscreen) |
| 51 | 52 | { |
| 52 | y=240-y; | |
| 53 | x=304-x; | |
| 54 | if (fx) fx=0; else fx=1; | |
| 55 | if (fy) fy=0; else fy=1; | |
| 56 | mult=16; | |
| 53 | y = 240 - y; | |
| 54 | x = 304 - x; | |
| 55 | if (fx) fx = 0; else fx = 1; | |
| 56 | if (fy) fy = 0; else fy = 1; | |
| 57 | mult = 16; | |
| 57 | 58 | } |
| 58 | else mult=-16; | |
| 59 | else mult = -16; | |
| 59 | 60 | |
| 60 | 61 | while (multi >= 0) |
| 61 | 62 | { |
| r7500 | r7501 | |
| 70 | 71 | } |
| 71 | 72 | } |
| 72 | 73 | |
| 73 | static int pktgaldx_bank_callback(const int bank) | |
| 74 | { | |
| 75 | return ((bank>>4) & 0x7) * 0x1000; | |
| 76 | } | |
| 77 | ||
| 78 | 74 | /* Video on the orginal */ |
| 79 | VIDEO_START(pktgaldx) | |
| 80 | { | |
| 81 | deco16_1_video_init(machine); | |
| 82 | 75 | |
| 83 | deco16_set_tilemap_bank_callback(1,pktgaldx_bank_callback); | |
| 84 | } | |
| 85 | ||
| 86 | VIDEO_UPDATE(pktgaldx) | |
| 76 | VIDEO_UPDATE( pktgaldx ) | |
| 87 | 77 | { |
| 88 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 89 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 78 | pktgaldx_state *state = (pktgaldx_state *)screen->machine->driver_data; | |
| 79 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 90 | 80 | |
| 91 | bitmap_fill(bitmap,cliprect,0); /* not Confirmed */ | |
| 92 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 81 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 82 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 93 | 83 | |
| 94 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0); | |
| 95 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 96 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 84 | bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */ | |
| 85 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 86 | ||
| 87 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 88 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 89 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 97 | 90 | return 0; |
| 98 | 91 | } |
| 99 | 92 | |
| 100 | 93 | /* Video for the bootleg */ |
| 101 | VIDEO_START(pktgaldb) | |
| 102 | { | |
| 103 | } | |
| 104 | 94 | |
| 105 | VIDEO_UPDATE(pktgaldb) | |
| 95 | VIDEO_UPDATE( pktgaldb ) | |
| 106 | 96 | { |
| 107 | int x,y; | |
| 108 | int offset=0; | |
| 97 | pktgaldx_state *state = (pktgaldx_state *)screen->machine->driver_data; | |
| 98 | int x, y; | |
| 99 | int offset = 0; | |
| 109 | 100 | int tileno; |
| 110 | 101 | int colour; |
| 111 | 102 | |
| 112 | 103 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 113 | 104 | |
| 114 | 105 | /* the bootleg seems to treat the tilemaps as sprites */ |
| 115 | for (offset = 0;offset<0x1600/2;offset+=8) | |
| 106 | for (offset = 0; offset < 0x1600 / 2; offset += 8) | |
| 116 | 107 | { |
| 117 | tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16); | |
| 118 | colour = pcktgaldb_sprites[offset+1]>>1; | |
| 119 | x = pcktgaldb_sprites[offset+0]; | |
| 120 | y = pcktgaldb_sprites[offset+4]; | |
| 108 | tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16); | |
| 109 | colour = state->pktgaldb_sprites[offset + 1] >> 1; | |
| 110 | x = state->pktgaldb_sprites[offset + 0]; | |
| 111 | y = state->pktgaldb_sprites[offset + 4]; | |
| 121 | 112 | |
| 122 | x-=0xc2; | |
| 123 | y&=0x1ff; | |
| 124 | y-=8; | |
| 113 | x -= 0xc2; | |
| 114 | y &= 0x1ff; | |
| 115 | y -= 8; | |
| 125 | 116 | |
| 126 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y,0); | |
| 117 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0); | |
| 127 | 118 | } |
| 128 | 119 | |
| 129 | for (offset = 0x1600/2;offset<0x2000/2;offset+=8) | |
| 120 | for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8) | |
| 130 | 121 | { |
| 131 | tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16); | |
| 132 | colour = pcktgaldb_sprites[offset+1]>>1; | |
| 133 | x = pcktgaldb_sprites[offset+0]&0x1ff; | |
| 134 | y = pcktgaldb_sprites[offset+4]&0x0ff; | |
| 122 | tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16); | |
| 123 | colour = state->pktgaldb_sprites[offset + 1] >> 1; | |
| 124 | x = state->pktgaldb_sprites[offset + 0] & 0x1ff; | |
| 125 | y = state->pktgaldb_sprites[offset + 4] & 0x0ff; | |
| 135 | 126 | |
| 136 | x-=0xc2; | |
| 137 | y&=0x1ff; | |
| 138 | y-=8; | |
| 127 | x -= 0xc2; | |
| 128 | y &= 0x1ff; | |
| 129 | y -= 8; | |
| 139 | 130 | |
| 140 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y,0); | |
| 131 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0); | |
| 141 | 132 | } |
| 142 | 133 | |
| 143 | for (offset = 0x2000/2;offset<0x4000/2;offset+=8) | |
| 134 | for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8) | |
| 144 | 135 | { |
| 145 | tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16); | |
| 146 | colour = pcktgaldb_sprites[offset+1]>>1; | |
| 147 | x = pcktgaldb_sprites[offset+0]&0x1ff; | |
| 148 | y = pcktgaldb_sprites[offset+4]&0x0ff; | |
| 136 | tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16); | |
| 137 | colour = state->pktgaldb_sprites[offset + 1] >> 1; | |
| 138 | x = state->pktgaldb_sprites[offset + 0] & 0x1ff; | |
| 139 | y = state->pktgaldb_sprites[offset + 4] & 0x0ff; | |
| 149 | 140 | |
| 150 | x-=0xc2; | |
| 151 | y&=0x1ff; | |
| 152 | y-=8; | |
| 141 | x -= 0xc2; | |
| 142 | y &= 0x1ff; | |
| 143 | y -= 8; | |
| 153 | 144 | |
| 154 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y,0); | |
| 145 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0); | |
| 155 | 146 | } |
| 156 | 147 | |
| 157 | 148 | return 0; |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | #include "includes/matmania.h" |
| 17 | 17 | |
| 18 | 18 | |
| 19 | ||
| 20 | UINT8 *matmania_videoram,*matmania_colorram; | |
| 21 | size_t matmania_videoram_size; | |
| 22 | UINT8 *matmania_videoram2,*matmania_colorram2; | |
| 23 | size_t matmania_videoram2_size; | |
| 24 | UINT8 *matmania_videoram3,*matmania_colorram3; | |
| 25 | size_t matmania_videoram3_size; | |
| 26 | UINT8 *matmania_scroll; | |
| 27 | static bitmap_t *tmpbitmap; | |
| 28 | static bitmap_t *tmpbitmap2; | |
| 29 | ||
| 30 | UINT8 *matmania_pageselect; | |
| 31 | ||
| 32 | 19 | /*************************************************************************** |
| 33 | 20 | |
| 34 | 21 | Convert the color PROMs into a more useable format. |
| r7500 | r7501 | |
| 58 | 45 | { |
| 59 | 46 | int i; |
| 60 | 47 | |
| 61 | for (i = 0;i < 64;i++) | |
| 48 | for (i = 0; i < 64; i++) | |
| 62 | 49 | { |
| 63 | int bit0,bit1,bit2,bit3,r,g,b; | |
| 50 | int bit0, bit1, bit2, bit3, r, g, b; | |
| 64 | 51 | |
| 65 | ||
| 66 | bit0 = (color_prom[0] >> 0) & 0x01; | |
| 67 | bit1 = (color_prom[0] >> 1) & 0x01; | |
| 68 | bit2 = (color_prom[0] >> 2) & 0x01; | |
| 69 | bit3 = (color_prom[0] >> 3) & 0x01; | |
| 52 | bit0 = BIT(color_prom[0], 0); | |
| 53 | bit1 = BIT(color_prom[0], 1); | |
| 54 | bit2 = BIT(color_prom[0], 2); | |
| 55 | bit3 = BIT(color_prom[0], 3); | |
| 70 | 56 | r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 71 | bit0 = (color_prom[0] >> 4) & 0x01; | |
| 72 | bit1 = (color_prom[0] >> 5) & 0x01; | |
| 73 | bit2 = (color_prom[0] >> 6) & 0x01; | |
| 74 | bit3 = (color_prom[0] >> 7) & 0x01; | |
| 57 | bit0 = BIT(color_prom[0], 4); | |
| 58 | bit1 = BIT(color_prom[0], 5); | |
| 59 | bit2 = BIT(color_prom[0], 6); | |
| 60 | bit3 = BIT(color_prom[0], 7); | |
| 75 | 61 | g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 76 | bit0 = (color_prom[64] >> 0) & 0x01; | |
| 77 | bit1 = (color_prom[64] >> 1) & 0x01; | |
| 78 | bit2 = (color_prom[64] >> 2) & 0x01; | |
| 79 | bit3 = (color_prom[64] >> 3) & 0x01; | |
| 62 | bit0 = BIT(color_prom[64], 0); | |
| 63 | bit1 = BIT(color_prom[64], 1); | |
| 64 | bit2 = BIT(color_prom[64], 2); | |
| 65 | bit3 = BIT(color_prom[64], 3); | |
| 80 | 66 | b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 81 | 67 | |
| 82 | 68 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); |
| r7500 | r7501 | |
| 88 | 74 | |
| 89 | 75 | WRITE8_HANDLER( matmania_paletteram_w ) |
| 90 | 76 | { |
| 91 | int bit0,bit1,bit2,bit3,val; | |
| 92 | int r,g,b; | |
| 77 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 78 | int bit0, bit1, bit2, bit3, val; | |
| 79 | int r, g, b; | |
| 93 | 80 | int offs2; |
| 94 | 81 | |
| 95 | ||
| 96 | space->machine->generic.paletteram.u8[offset] = data; | |
| 82 | state->paletteram[offset] = data; | |
| 97 | 83 | offs2 = offset & 0x0f; |
| 98 | 84 | |
| 99 | val = space->machine->generic.paletteram.u8[offs2]; | |
| 100 | bit0 = (val >> 0) & 0x01; | |
| 101 | bit1 = (val >> 1) & 0x01; | |
| 102 | bit2 = (val >> 2) & 0x01; | |
| 103 | bit3 = (val >> 3) & 0x01; | |
| 85 | val = state->paletteram[offs2]; | |
| 86 | bit0 = BIT(val, 0); | |
| 87 | bit1 = BIT(val, 1); | |
| 88 | bit2 = BIT(val, 2); | |
| 89 | bit3 = BIT(val, 3); | |
| 104 | 90 | r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 105 | 91 | |
| 106 | val = space->machine->generic.paletteram.u8[offs2 | 0x10]; | |
| 107 | bit0 = (val >> 0) & 0x01; | |
| 108 | bit1 = (val >> 1) & 0x01; | |
| 109 | bit2 = (val >> 2) & 0x01; | |
| 110 | bit3 = (val >> 3) & 0x01; | |
| 92 | val = state->paletteram[offs2 | 0x10]; | |
| 93 | bit0 = BIT(val, 0); | |
| 94 | bit1 = BIT(val, 1); | |
| 95 | bit2 = BIT(val, 2); | |
| 96 | bit3 = BIT(val, 3); | |
| 111 | 97 | g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 112 | 98 | |
| 113 | val = space->machine->generic.paletteram.u8[offs2 | 0x20]; | |
| 114 | bit0 = (val >> 0) & 0x01; | |
| 115 | bit1 = (val >> 1) & 0x01; | |
| 116 | bit2 = (val >> 2) & 0x01; | |
| 117 | bit3 = (val >> 3) & 0x01; | |
| 99 | val = state->paletteram[offs2 | 0x20]; | |
| 100 | bit0 = BIT(val, 0); | |
| 101 | bit1 = BIT(val, 1); | |
| 102 | bit2 = BIT(val, 2); | |
| 103 | bit3 = BIT(val, 3); | |
| 118 | 104 | b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; |
| 119 | 105 | |
| 120 | 106 | palette_set_color(space->machine,offs2 + 64,MAKE_RGB(r,g,b)); |
| r7500 | r7501 | |
| 126 | 112 | Start the video hardware emulation. |
| 127 | 113 | |
| 128 | 114 | ***************************************************************************/ |
| 115 | ||
| 129 | 116 | VIDEO_START( matmania ) |
| 130 | 117 | { |
| 118 | matmania_state *state = (matmania_state *)machine->driver_data; | |
| 131 | 119 | int width = video_screen_get_width(machine->primary_screen); |
| 132 | 120 | int height = video_screen_get_height(machine->primary_screen); |
| 133 | 121 | bitmap_format format = video_screen_get_format(machine->primary_screen); |
| 134 | 122 | |
| 135 | 123 | /* Mat Mania has a virtual screen twice as large as the visible screen */ |
| 136 | tmpbitmap = auto_bitmap_alloc(machine, width, 2*height, format); | |
| 137 | tmpbitmap2 = auto_bitmap_alloc(machine, width, 2*height, format); | |
| 124 | state->tmpbitmap = auto_bitmap_alloc(machine, width, 2 * height, format); | |
| 125 | state->tmpbitmap2 = auto_bitmap_alloc(machine, width, 2 * height, format); | |
| 138 | 126 | } |
| 139 | 127 | |
| 140 | 128 | |
| 141 | 129 | |
| 142 | 130 | VIDEO_UPDATE( matmania ) |
| 143 | 131 | { |
| 144 | UINT8 *spriteram = screen->machine->generic.spriteram.u8; | |
| 132 | matmania_state *state = (matmania_state *)screen->machine->driver_data; | |
| 133 | UINT8 *spriteram = state->spriteram; | |
| 145 | 134 | int offs; |
| 146 | 135 | |
| 147 | 136 | |
| 148 | 137 | /* Update the tiles in the left tile ram bank */ |
| 149 | for (offs = | |
| 138 | for (offs = s | |
| 150 | 139 | { |
| 151 | int sx,sy; | |
| 140 | int sx = 15 - offs / 32; | |
| 141 | int sy = offs % 32; | |
| 152 | 142 | |
| 153 | ||
| 154 | sx = 15 - offs / 32; | |
| 155 | sy = offs % 32; | |
| 156 | ||
| 157 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1], | |
| 158 | matmania_videoram[offs] + ((matmania_colorram[offs] & 0x08) << 5), | |
| 159 | (matmania_colorram[offs] & 0x30) >> 4, | |
| 143 | drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1], | |
| 144 | state->videoram[offs] + ((state->colorram[offs] & 0x08) << 5), | |
| 145 | (state->colorram[offs] & 0x30) >> 4, | |
| 160 | 146 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| 161 | 16*sx,16*sy); | |
| 147 | 16 * sx, 16 * sy); | |
| 162 | 148 | } |
| 163 | 149 | |
| 164 | 150 | /* Update the tiles in the right tile ram bank */ |
| 165 | for (offs = | |
| 151 | for (offs = s | |
| 166 | 152 | { |
| 167 | int sx,sy; | |
| 153 | int sx = 15 - offs / 32; | |
| 154 | int sy = offs % 32; | |
| 168 | 155 | |
| 169 | ||
| 170 | sx = 15 - offs / 32; | |
| 171 | sy = offs % 32; | |
| 172 | ||
| 173 | drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1], | |
| 174 | matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x08) << 5), | |
| 175 | (matmania_colorram3[offs] & 0x30) >> 4, | |
| 156 | drawgfx_opaque(state->tmpbitmap2, 0, screen->machine->gfx[1], | |
| 157 | state->videoram3[offs] + ((state->colorram3[offs] & 0x08) << 5), | |
| 158 | (state->colorram3[offs] & 0x30) >> 4, | |
| 176 | 159 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| 177 | 160 | 16*sx,16*sy); |
| 178 | 161 | } |
| 179 | 162 | |
| 180 | ||
| 181 | 163 | /* copy the temporary bitmap to the screen */ |
| 182 | 164 | { |
| 183 | int scrolly; | |
| 184 | ||
| 185 | ||
| 186 | scrolly = -*matmania_scroll; | |
| 187 | if (matmania_pageselect[0]&0x01) // maniach sets 0x20 sometimes, which must have a different meaning | |
| 188 | copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,cliprect); | |
| 165 | int scrolly = -*state->scroll; | |
| 166 | if (state->pageselect[0] & 0x01) // maniach sets 0x20 sometimes, which must have a different meaning | |
| 167 | copyscrollbitmap(bitmap, state->tmpbitmap2, 0, 0, 1, &scrolly, cliprect); | |
| 189 | 168 | else |
| 190 | copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,cliprect); | |
| 169 | copyscrollbitmap(bitmap, state->tmpbitmap, 0, 0, 1, &scrolly, cliprect); | |
| 191 | 170 | } |
| 192 | 171 | |
| 193 | 172 | |
| 194 | 173 | /* Draw the sprites */ |
| 195 | for (offs = 0;offs < s | |
| 174 | for (offs = 0; offs < st | |
| 196 | 175 | { |
| 197 | 176 | if (spriteram[offs] & 0x01) |
| 198 | 177 | { |
| 199 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 200 | spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4), | |
| 178 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], | |
| 179 | spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4), | |
| 201 | 180 | (spriteram[offs] & 0x08) >> 3, |
| 202 | spriteram[offs] & 0x04,spriteram[offs] & 0x02, | |
| 203 | 239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,0); | |
| 181 | spriteram[offs] & 0x04, spriteram[offs] & 0x02, | |
| 182 | 239 - spriteram[offs + 3],(240 - spriteram[offs + 2]) & 0xff,0); | |
| 204 | 183 | } |
| 205 | 184 | } |
| 206 | 185 | |
| 207 | 186 | |
| 208 | 187 | /* draw the frontmost playfield. They are characters, but draw them as sprites */ |
| 209 | for (offs = | |
| 188 | for (offs = s | |
| 210 | 189 | { |
| 211 | int sx,sy; | |
| 190 | int sx = 31 - offs / 32; | |
| 191 | int sy = offs % 32; | |
| 212 | 192 | |
| 213 | ||
| 214 | sx = 31 - offs / 32; | |
| 215 | sy = offs % 32; | |
| 216 | ||
| 217 | 193 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], |
| 218 | matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07), | |
| 219 | (matmania_colorram2[offs] & 0x30) >> 4, | |
| 194 | state->videoram2[offs] + 256 * (state->colorram2[offs] & 0x07), | |
| 195 | (state->colorram2[offs] & 0x30) >> 4, | |
| 220 | 196 | 0,0, |
| 221 | 197 | 8*sx,8*sy,0); |
| 222 | 198 | } |
| r7500 | r7501 | |
| 225 | 201 | |
| 226 | 202 | VIDEO_UPDATE( maniach ) |
| 227 | 203 | { |
| 228 | UINT8 *spriteram = screen->machine->generic.spriteram.u8; | |
| 204 | matmania_state *state = (matmania_state *)screen->machine->driver_data; | |
| 205 | UINT8 *spriteram = state->spriteram; | |
| 229 | 206 | int offs; |
| 230 | 207 | |
| 231 | 208 | |
| 232 | 209 | /* Update the tiles in the left tile ram bank */ |
| 233 | for (offs = | |
| 210 | for (offs = s | |
| 234 | 211 | { |
| 235 | int sx,sy; | |
| 212 | int sx = 15 - offs / 32; | |
| 213 | int sy = offs % 32; | |
| 236 | 214 | |
| 237 | ||
| 238 | sx = 15 - offs / 32; | |
| 239 | sy = offs % 32; | |
| 240 | ||
| 241 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1], | |
| 242 | matmania_videoram[offs] + ((matmania_colorram[offs] & 0x03) << 8), | |
| 243 | (matmania_colorram[offs] & 0x30) >> 4, | |
| 215 | drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1], | |
| 216 | state->videoram[offs] + ((state->colorram[offs] & 0x03) << 8), | |
| 217 | (state->colorram[offs] & 0x30) >> 4, | |
| 244 | 218 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| 245 | 219 | 16*sx,16*sy); |
| 246 | 220 | } |
| 247 | 221 | |
| 248 | 222 | /* Update the tiles in the right tile ram bank */ |
| 249 | for (offs = | |
| 223 | for (offs = s | |
| 250 | 224 | { |
| 251 | int sx,sy; | |
| 225 | int sx = 15 - offs / 32; | |
| 226 | int sy = offs % 32; | |
| 252 | 227 | |
| 253 | ||
| 254 | sx = 15 - offs / 32; | |
| 255 | sy = offs % 32; | |
| 256 | ||
| 257 | drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1], | |
| 258 | matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x03) << 8), | |
| 259 | (matmania_colorram3[offs] & 0x30) >> 4, | |
| 228 | drawgfx_opaque(state->tmpbitmap2, 0, screen->machine->gfx[1], | |
| 229 | state->videoram3[offs] + ((state->colorram3[offs] & 0x03) << 8), | |
| 230 | (state->colorram3[offs] & 0x30) >> 4, | |
| 260 | 231 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| 261 | 232 | 16*sx,16*sy); |
| 262 | 233 | } |
| r7500 | r7501 | |
| 264 | 235 | |
| 265 | 236 | /* copy the temporary bitmap to the screen */ |
| 266 | 237 | { |
| 267 | int scrolly; | |
| 238 | int scrolly = -*state->scroll; | |
| 268 | 239 | |
| 269 | ||
| 270 | scrolly = -*matmania_scroll; | |
| 271 | ||
| 272 | if (matmania_pageselect[0]&0x01) // this sets 0x20 sometimes, which must have a different meaning | |
| 273 | copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,cliprect); | |
| 240 | if (state->pageselect[0] & 0x01) // this sets 0x20 sometimes, which must have a different meaning | |
| 241 | copyscrollbitmap(bitmap, state->tmpbitmap2, 0, 0, 1, &scrolly, cliprect); | |
| 274 | 242 | else |
| 275 | copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,cliprect); | |
| 243 | copyscrollbitmap(bitmap, state->tmpbitmap, 0, 0, 1, &scrolly, cliprect); | |
| 276 | 244 | } |
| 277 | 245 | |
| 278 | 246 | |
| 279 | 247 | /* Draw the sprites */ |
| 280 | for (offs = 0;offs < s | |
| 248 | for (offs = 0; offs < st | |
| 281 | 249 | { |
| 282 | 250 | if (spriteram[offs] & 0x01) |
| 283 | 251 | { |
| r7500 | r7501 | |
| 291 | 259 | |
| 292 | 260 | |
| 293 | 261 | /* draw the frontmost playfield. They are characters, but draw them as sprites */ |
| 294 | for (offs = | |
| 262 | for (offs = s | |
| 295 | 263 | { |
| 296 | int sx,sy; | |
| 264 | int sx = 31 - offs / 32; | |
| 265 | int sy = offs % 32; | |
| 297 | 266 | |
| 298 | ||
| 299 | sx = 31 - offs / 32; | |
| 300 | sy = offs % 32; | |
| 301 | ||
| 302 | 267 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], |
| 303 | matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07), | |
| 304 | (matmania_colorram2[offs] & 0x30) >> 4, | |
| 268 | state->videoram2[offs] + 256 * (state->colorram2[offs] & 0x07), | |
| 269 | (state->colorram2[offs] & 0x30) >> 4, | |
| 305 | 270 | 0,0, |
| 306 | 271 | 8*sx,8*sy,0); |
| 307 | 272 | } |
| r7500 | r7501 | |
|---|---|---|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| 123 | WRITE8_HANDLER( hexa_d008_w ) | |
| 124 | { | |
| 125 | arkanoid_state *state = (arkanoid_state *)space->machine->driver_data; | |
| 126 | ||
| 127 | /* bit 0 = flipx (or y?) */ | |
| 128 | if (flip_screen_x_get(space->machine) != (data & 0x01)) | |
| 129 | { | |
| 130 | flip_screen_x_set(space->machine, data & 0x01); | |
| 131 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 132 | } | |
| 133 | ||
| 134 | /* bit 1 = flipy (or x?) */ | |
| 135 | if (flip_screen_y_get(space->machine) != (data & 0x02)) | |
| 136 | { | |
| 137 | flip_screen_y_set(space->machine, data & 0x02); | |
| 138 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 139 | } | |
| 140 | ||
| 141 | /* bit 2 - 3 unknown */ | |
| 142 | ||
| 143 | /* bit 4 could be the ROM bank selector for 8000-bfff (not sure) */ | |
| 144 | memory_set_bank(space->machine, "bank1", ((data & 0x10) >> 4)); | |
| 145 | ||
| 146 | /* bit 5 = gfx bank */ | |
| 147 | if (state->gfxbank != ((data & 0x20) >> 5)) | |
| 148 | { | |
| 149 | state->gfxbank = (data & 0x20) >> 5; | |
| 150 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 151 | } | |
| 152 | ||
| 153 | /* bit 6 - 7 unknown */ | |
| 154 | } | |
| 155 | ||
| 123 | 156 | static TILE_GET_INFO( get_bg_tile_info ) |
| 124 | 157 | { |
| 125 | 158 | arkanoid_state *state = (arkanoid_state *)machine->driver_data; |
| r7500 | r7501 | |
| 177 | 210 | draw_sprites(screen->machine, bitmap, cliprect); |
| 178 | 211 | return 0; |
| 179 | 212 | } |
| 213 | ||
| 214 | VIDEO_UPDATE( hexa ) | |
| 215 | { | |
| 216 | arkanoid_state *state = (arkanoid_state *)screen->machine->driver_data; | |
| 217 | ||
| 218 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 219 | return 0; | |
| 220 | } |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/lsasquad.h" |
| 3 | 3 | |
| 4 | UINT8 *lsasquad_scrollram; | |
| 5 | ||
| 6 | ||
| 7 | ||
| 8 | static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *scrollram) | |
| 4 | static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *scrollram ) | |
| 9 | 5 | { |
| 10 | int offs,scrollx,scrolly; | |
| 6 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 7 | int offs, scrollx, scrolly; | |
| 11 | 8 | |
| 12 | ||
| 13 | 9 | scrollx = scrollram[3]; |
| 14 | 10 | scrolly = -scrollram[0]; |
| 15 | 11 | |
| 16 | for (offs = 0;offs < 0x080;offs += 4) | |
| 12 | for (offs = 0; offs < 0x080; offs += 4) | |
| 17 | 13 | { |
| 18 | int base,y,sx,sy,code,color; | |
| 14 | int base, y, sx, sy, code, color; | |
| 19 | 15 | |
| 20 | base = 64 * scrollram[offs+1]; | |
| 21 | sx = 8*(offs/4) + scrollx; | |
| 22 | if (flip_screen_get(machine)) sx = 248 - sx; | |
| 16 | base = 64 * scrollram[offs + 1]; | |
| 17 | sx = 8 * (offs / 4) + scrollx; | |
| 18 | if (flip_screen_get(machine)) | |
| 19 | sx = 248 - sx; | |
| 20 | ||
| 23 | 21 | sx &= 0xff; |
| 24 | 22 | |
| 25 | for (y = 0;y < 32;y++) | |
| 23 | for (y = 0; y < 32; y++) | |
| 26 | 24 | { |
| 27 | 25 | int attr; |
| 28 | 26 | |
| 29 | sy = 8*y + scrolly; | |
| 30 | if (flip_screen_get(machine)) sy = 248 - sy; | |
| 27 | sy = 8 * y + scrolly; | |
| 28 | if (flip_screen_get(machine)) | |
| 29 | sy = 248 - sy; | |
| 31 | 30 | sy &= 0xff; |
| 32 | 31 | |
| 33 | attr = machine->generic.videoram.u8[base + 2*y + 1]; | |
| 34 | code = machine->generic.videoram.u8[base + 2*y] + ((attr & 0x0f) << 8); | |
| 32 | attr = state->videoram[base + 2 * y + 1]; | |
| 33 | code = state->videoram[base + 2 * y] + ((attr & 0x0f) << 8); | |
| 35 | 34 | color = attr >> 4; |
| 36 | 35 | |
| 37 | 36 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], |
| r7500 | r7501 | |
| 49 | 48 | } |
| 50 | 49 | } |
| 51 | 50 | |
| 52 | static int draw_layer_daikaiju(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int * previd, int type) | |
| 51 | static int draw_layer_daikaiju( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int * previd, int type ) | |
| 53 | 52 | { |
| 54 | int id,scrollx,scrolly,initoffs, globalscrollx; | |
| 55 | int stepx=0; | |
| 56 | initoffs=offs; | |
| 53 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 54 | int id, scrollx, scrolly, initoffs, globalscrollx; | |
| 55 | int stepx = 0; | |
| 57 | 56 | |
| 58 | globalscrollx=0; | |
| 57 | initoffs = offs; | |
| 58 | globalscrollx = 0; | |
| 59 | 59 | |
| 60 | id= | |
| 60 | id = state->s | |
| 61 | 61 | |
| 62 | for(;offs < 0x400; offs+=4) | |
| 62 | for( ; offs < 0x400; offs += 4) | |
| 63 | 63 | { |
| 64 | int base,y,sx,sy,code,color; | |
| 64 | int base, y, sx, sy, code, color; | |
| 65 | 65 | |
| 66 | 66 | //id change |
| 67 | if(id!= | |
| 67 | if (id != state->s | |
| 68 | 68 | { |
| 69 | 69 | *previd = id; |
| 70 | 70 | return offs; |
| 71 | 71 | } |
| 72 | 72 | else |
| 73 | 73 | { |
| 74 | id= | |
| 74 | id = state->s | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | //skip empty (??) column, potential probs with 1st column in scrollram (scroll 0, tile 0, id 0) |
| 78 | if | |
| 78 | if | |
| 79 | 79 | continue; |
| 80 | 80 | |
| 81 | 81 | //local scroll x/y |
| 82 | scrolly = -lsasquad_scrollram[offs+0]; | |
| 83 | scrollx = lsasquad_scrollram[offs+3]; | |
| 82 | scrolly = -state->scrollram[offs + 0]; | |
| 83 | scrollx = state->scrollram[offs + 3]; | |
| 84 | 84 | |
| 85 | 85 | //check for global x scroll used in bg layer in game (starts at offset 0 in scrollram |
| 86 | 86 | // and game name/logo on title screen (starts in the middle of scrollram, but with different |
| 87 | 87 | // (NOT unique )id than prev coulmn(s) |
| 88 | 88 | |
| 89 | if | |
| 89 | if | |
| 90 | 90 | { |
| 91 | if(offs!=initoffs) | |
| 91 | if (offs != initoffs) | |
| 92 | 92 | { |
| 93 | scrollx+=globalscrollx; | |
| 93 | scrollx += globalscrollx; | |
| 94 | 94 | } |
| 95 | 95 | else |
| 96 | 96 | { |
| 97 | 97 | //global scroll init |
| 98 | globalscrollx=scrollx; | |
| 98 | globalscrollx = scrollx; | |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | base = 64 * lsasquad_scrollram[offs+1]; | |
| 103 | sx = scrollx+stepx; | |
| 102 | base = 64 * state->scrollram[offs + 1]; | |
| 103 | sx = scrollx + stepx; | |
| 104 | 104 | |
| 105 | if (flip_screen_get(machine)) sx = 248 - sx; | |
| 105 | if (flip_screen_get(machine)) | |
| 106 | sx = 248 - sx; | |
| 106 | 107 | sx &= 0xff; |
| 107 | 108 | |
| 108 | for (y = 0;y < 32;y++) | |
| 109 | for (y = 0; y < 32; y++) | |
| 109 | 110 | { |
| 110 | 111 | int attr; |
| 111 | 112 | |
| 112 | sy = 8*y + scrolly; | |
| 113 | if (flip_screen_get(machine)) sy = 248 - sy; | |
| 113 | sy = 8 * y + scrolly; | |
| 114 | if (flip_screen_get(machine)) | |
| 115 | sy = 248 - sy; | |
| 114 | 116 | sy &= 0xff; |
| 115 | 117 | |
| 116 | attr = machine->generic.videoram.u8[base + 2*y + 1]; | |
| 117 | code = machine->generic.videoram.u8[base + 2*y] + ((attr & 0x0f) << 8); | |
| 118 | attr = state->videoram[base + 2 * y + 1]; | |
| 119 | code = state->videoram[base + 2 * y] + ((attr & 0x0f) << 8); | |
| 118 | 120 | color = attr >> 4; |
| 119 | 121 | |
| 120 | ||
| 121 | if((type==0 && color!=0x0d) || (type !=0 && color==0x0d)) | |
| 122 | if ((type == 0 && color != 0x0d) || (type != 0 && color == 0x0d)) | |
| 122 | 123 | { |
| 123 | 124 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], |
| 124 | 125 | code, |
| r7500 | r7501 | |
| 137 | 138 | return offs; |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | static void drawbg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int type) | |
| 141 | static void drawbg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int type ) | |
| 141 | 142 | { |
| 142 | int i=0; | |
| 143 | int id=-1; | |
| 143 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 144 | int i = 0; | |
| 145 | int id = -1; | |
| 144 | 146 | |
| 145 | while(i<0x400) | |
| 147 | while (i < 0x400) | |
| 146 | 148 | { |
| 147 | if(!( | |
| 149 | if (!( | |
| 148 | 150 | { |
| 149 | i=draw_layer_daikaiju(machine, bitmap, cliprect, i, &id,type); | |
| 151 | i = draw_layer_daikaiju(machine, bitmap, cliprect, i, &id, type); | |
| 150 | 152 | } |
| 151 | 153 | else |
| 152 | 154 | { |
| 153 | id=lsasquad_scrollram[i+2]; | |
| 154 | i+=4; | |
| 155 | id = state->scrollram[i + 2]; | |
| 156 | i += 4; | |
| 155 | 157 | } |
| 156 | 158 | } |
| 157 | 159 | } |
| 158 | 160 | |
| 159 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 161 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 160 | 162 | { |
| 161 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 163 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 164 | UINT8 *spriteram = state->spriteram; | |
| 162 | 165 | int offs; |
| 163 | 166 | |
| 164 | for (offs = | |
| 167 | for (offs = stat | |
| 165 | 168 | { |
| 166 | int sx,sy,attr,code,color,flipx,flipy; | |
| 169 | int sx, sy, attr, code, color, flipx, flipy; | |
| 167 | 170 | |
| 168 | sx = spriteram[offs+3]; | |
| 171 | sx = spriteram[offs + 3]; | |
| 169 | 172 | sy = 240 - spriteram[offs]; |
| 170 | attr = spriteram[offs+1]; | |
| 171 | code = spriteram[offs+2] + ((attr & 0x30) << 4); | |
| 173 | attr = spriteram[offs + 1]; | |
| 174 | code = spriteram[offs + 2] + ((attr & 0x30) << 4); | |
| 172 | 175 | color = attr & 0x0f; |
| 173 | 176 | flipx = attr & 0x40; |
| 174 | 177 | flipy = attr & 0x80; |
| r7500 | r7501 | |
| 197 | 200 | |
| 198 | 201 | VIDEO_UPDATE( lsasquad ) |
| 199 | 202 | { |
| 200 | bitmap_fill(bitmap,cliprect,511); | |
| 203 | lsasquad_state *state = (lsasquad_state *)screen->machine->driver_data; | |
| 204 | bitmap_fill(bitmap, cliprect, 511); | |
| 201 | 205 | |
| 202 | draw_layer(screen->machine,bitmap,cliprect,lsasquad_scrollram + 0x000); | |
| 203 | draw_layer(screen->machine,bitmap,cliprect,lsasquad_scrollram + 0x080); | |
| 204 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 205 | draw_layer(screen->machine,bitmap,cliprect,lsasquad_scrollram + 0x100); | |
| 206 | draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x000); | |
| 207 | draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x080); | |
| 208 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 209 | draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x100); | |
| 206 | 210 | return 0; |
| 207 | 211 | } |
| 208 | 212 | |
| 209 | 213 | |
| 210 | 214 | VIDEO_UPDATE( daikaiju ) |
| 211 | 215 | { |
| 212 | bitmap_fill(bitmap,cliprect,511); | |
| 213 | drawbg(screen->machine,bitmap,cliprect,0); // bottom | |
| 214 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 215 | drawbg(screen->machine,bitmap,cliprect,1); // top = pallete $d ? | |
| 216 | bitmap_fill(bitmap, cliprect, 511); | |
| 217 | drawbg(screen->machine, bitmap, cliprect, 0); // bottom | |
| 218 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 219 | drawbg(screen->machine, bitmap, cliprect, 1); // top = pallete $d ? | |
| 216 | 220 | return 0; |
| 217 | 221 | } |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "includes/mosaic.h" | |
| 10 | 11 | |
| 11 | ||
| 12 | UINT8 *mosaic_fgvideoram; | |
| 13 | UINT8 *mosaic_bgvideoram; | |
| 14 | ||
| 15 | static tilemap_t *bg_tilemap,*fg_tilemap; | |
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | 12 | /*************************************************************************** |
| 20 | 13 | |
| 21 | 14 | Callbacks for the TileMap code |
| r7500 | r7501 | |
| 24 | 17 | |
| 25 | 18 | static TILE_GET_INFO( get_fg_tile_info ) |
| 26 | 19 | { |
| 20 | mosaic_state *state = (mosaic_state *)machine->driver_data; | |
| 27 | 21 | tile_index *= 2; |
| 28 | 22 | SET_TILE_INFO( |
| 29 | 23 | 0, |
| 30 | | |
| 24 | | |
| 31 | 25 | 0, |
| 32 | 26 | 0); |
| 33 | 27 | } |
| 34 | 28 | |
| 35 | 29 | static TILE_GET_INFO( get_bg_tile_info ) |
| 36 | 30 | { |
| 31 | mosaic_state *state = (mosaic_state *)machine->driver_data; | |
| 37 | 32 | tile_index *= 2; |
| 38 | 33 | SET_TILE_INFO( |
| 39 | 34 | 1, |
| 40 | | |
| 35 | | |
| 41 | 36 | 0, |
| 42 | 37 | 0); |
| 43 | 38 | } |
| r7500 | r7501 | |
| 52 | 47 | |
| 53 | 48 | VIDEO_START( mosaic ) |
| 54 | 49 | { |
| 55 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32); | |
| 56 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8,8,64,32); | |
| 50 | mosaic_state *state = (mosaic_state *)machine->driver_data; | |
| 57 | 51 | |
| 58 | tilemap_set_transparent_pen(fg_tilemap,0xff); | |
| 52 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 53 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 54 | ||
| 55 | tilemap_set_transparent_pen(state->fg_tilemap, 0xff); | |
| 59 | 56 | } |
| 60 | 57 | |
| 61 | 58 | |
| r7500 | r7501 | |
| 67 | 64 | |
| 68 | 65 | WRITE8_HANDLER( mosaic_fgvideoram_w ) |
| 69 | 66 | { |
| 70 | mosaic_fgvideoram[offset] = data; | |
| 71 | tilemap_mark_tile_dirty(fg_tilemap,offset/2); | |
| 67 | mosaic_state *state = (mosaic_state *)space->machine->driver_data; | |
| 68 | ||
| 69 | state->fgvideoram[offset] = data; | |
| 70 | tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2); | |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | 73 | WRITE8_HANDLER( mosaic_bgvideoram_w ) |
| 75 | 74 | { |
| 76 | mosaic_bgvideoram[offset] = data; | |
| 77 | tilemap_mark_tile_dirty(bg_tilemap,offset/2); | |
| 75 | mosaic_state *state = (mosaic_state *)space->machine->driver_data; | |
| 76 | ||
| 77 | state->bgvideoram[offset] = data; | |
| 78 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 78 | 79 | } |
| 79 | 80 | |
| 80 | 81 | |
| 81 | 82 | |
| 82 | 83 | VIDEO_UPDATE( mosaic ) |
| 83 | 84 | { |
| 84 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 85 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 85 | mosaic_state *state = (mosaic_state *)screen->machine->driver_data; | |
| 86 | ||
| 87 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 88 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 86 | 89 | return 0; |
| 87 | 90 | } |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/nitedrvr.h" |
| 9 | 9 | |
| 10 | UINT8 *nitedrvr_hvc; | |
| 11 | ||
| 12 | static tilemap_t *bg_tilemap; | |
| 13 | ||
| 14 | 10 | WRITE8_HANDLER( nitedrvr_videoram_w ) |
| 15 | 11 | { |
| 16 | space->machine->generic.videoram.u8[offset] = data; | |
| 17 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 12 | nitedrvr_state *state = (nitedrvr_state *)space->machine->driver_data; | |
| 13 | ||
| 14 | state->videoram[offset] = data; | |
| 15 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 18 | 16 | } |
| 19 | 17 | |
| 20 | 18 | WRITE8_HANDLER( nitedrvr_hvc_w ) |
| 21 | 19 | { |
| 22 | nitedrvr_ | |
| 20 | nitedrvr_ | |
| 23 | 21 | |
| 22 | state->hvc[offset & 0x3f] = data; | |
| 23 | ||
| 24 | 24 | if ((offset & 0x30) == 0x30) |
| 25 | 25 | watchdog_reset_w(space, 0, 0); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static TILE_GET_INFO( get_bg_tile_info ) |
| 29 | 29 | { |
| 30 | int code = machine->generic.videoram.u8[tile_index] & 0x3f; | |
| 30 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 31 | int code = state->videoram[tile_index] & 0x3f; | |
| 31 | 32 | |
| 32 | 33 | SET_TILE_INFO(0, code, 0, 0); |
| 33 | 34 | } |
| r7500 | r7501 | |
| 36 | 37 | |
| 37 | 38 | VIDEO_START( nitedrvr ) |
| 38 | 39 | { |
| 39 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 40 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 41 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | static void draw_box(bitmap_t *bitmap, int bx, int by, int ex, int ey ) | |
| 44 | static void draw_box( bitmap_t *bitmap, int bx, int by, int ex, int ey ) | |
| 43 | 45 | { |
| 44 | 46 | int x, y; |
| 45 | 47 | |
| r7500 | r7501 | |
| 53 | 55 | return; |
| 54 | 56 | } |
| 55 | 57 | |
| 56 | static void draw_roadway(bitmap_t *bitmap) | |
| 58 | static void draw_roadway( running_machine *machine, bitmap_t *bitmap ) | |
| 57 | 59 | { |
| 60 | nitedrvr_state *state = (nitedrvr_state *)machine->driver_data; | |
| 58 | 61 | int roadway; |
| 59 | 62 | |
| 60 | 63 | for (roadway = 0; roadway < 16; roadway++) |
| 61 | 64 | { |
| 62 | 65 | int bx, by, ex, ey; |
| 63 | 66 | |
| 64 | bx = nitedrvr_hvc[roadway]; | |
| 65 | by = nitedrvr_hvc[roadway + 16]; | |
| 66 | ex = bx + ((nitedrvr_hvc[roadway + 32] & 0xf0) >> 4); | |
| 67 | ey = by + (16 - (nitedrvr_hvc[roadway + 32] & 0x0f)); | |
| 67 | bx = state->hvc[roadway]; | |
| 68 | by = state->hvc[roadway + 16]; | |
| 69 | ex = bx + ((state->hvc[roadway + 32] & 0xf0) >> 4); | |
| 70 | ey = by + (16 - (state->hvc[roadway + 32] & 0x0f)); | |
| 68 | 71 | |
| 69 | 72 | draw_box(bitmap, bx, by, ex, ey); |
| 70 | 73 | } |
| r7500 | r7501 | |
| 72 | 75 | |
| 73 | 76 | VIDEO_UPDATE( nitedrvr ) |
| 74 | 77 | { |
| 75 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 76 | draw_roadway(bitmap); | |
| 78 | nitedrvr_state *state = (nitedrvr_state *)screen->machine->driver_data; | |
| 79 | ||
| 80 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 81 | draw_roadway(screen->machine, bitmap); | |
| 77 | 82 | return 0; |
| 78 | 83 | } |
| r7500 | r7501 | |
|---|---|---|
| 153 | 153 | #include "sound/msm5232.h" |
| 154 | 154 | #include "includes/nycaptor.h" |
| 155 | 155 | |
| 156 | UINT8 *nycaptor_sharedram; | |
| 157 | static int generic_control_reg = 0; | |
| 158 | static int sound_nmi_enable=0,pending_nmi=0; | |
| 159 | int nyc_gametype=0; | |
| 160 | 156 | |
| 161 | 157 | static WRITE8_HANDLER( sub_cpu_halt_w ) |
| 162 | 158 | { |
| 163 | cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, (data) ? ASSERT_LINE : CLEAR_LINE); | |
| 159 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 160 | cpu_set_input_line(state->subcpu, INPUT_LINE_HALT, (data) ? ASSERT_LINE : CLEAR_LINE); | |
| 164 | 161 | } |
| 165 | 162 | |
| 166 | static UINT8 snd_data; | |
| 167 | ||
| 168 | 163 | static READ8_HANDLER( from_snd_r ) |
| 169 | 164 | { |
| 170 | return snd_data; | |
| 165 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 166 | return state->snd_data; | |
| 171 | 167 | } |
| 172 | 168 | |
| 173 | 169 | static WRITE8_HANDLER( to_main_w ) |
| 174 | 170 | { |
| 175 | snd_data = data; | |
| 171 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 172 | state->snd_data = data; | |
| 176 | 173 | } |
| 177 | 174 | |
| 178 | 175 | |
| 179 | 176 | static READ8_HANDLER(nycaptor_sharedram_r) |
| 180 | 177 | { |
| 181 | return nycaptor_sharedram[offset]; | |
| 178 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 179 | return state->sharedram[offset]; | |
| 182 | 180 | } |
| 183 | 181 | |
| 184 | 182 | static WRITE8_HANDLER(nycaptor_sharedram_w) |
| 185 | 183 | { |
| 186 | nycaptor_sharedram[offset]=data; | |
| 184 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 185 | state->sharedram[offset] = data; | |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | ||
| 190 | 188 | static READ8_HANDLER( nycaptor_b_r ) |
| 191 | 189 | { |
| 192 | 190 | return 1; |
| r7500 | r7501 | |
| 194 | 192 | |
| 195 | 193 | static READ8_HANDLER( nycaptor_by_r ) |
| 196 | 194 | { |
| 197 | int port=input_port_read(space->machine, "LIGHTY"); | |
| 198 | if(nyc_gametype == 1) | |
| 195 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 196 | int port = input_port_read(space->machine, "LIGHTY"); | |
| 197 | ||
| 198 | if (state->gametype == 1) | |
| 199 | 199 | port = 255 - port; |
| 200 | ||
| 200 | 201 | return port - 8; |
| 201 | 202 | } |
| 202 | 203 | |
| r7500 | r7501 | |
| 208 | 209 | |
| 209 | 210 | static WRITE8_HANDLER( sound_cpu_reset_w ) |
| 210 | 211 | { |
| 211 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 212 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 213 | cpu_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 212 | 214 | } |
| 213 | 215 | |
| 214 | static int vol_ctrl[16]; | |
| 215 | 216 | |
| 216 | 217 | static MACHINE_RESET( ta7630 ) |
| 217 | 218 | { |
| 219 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 218 | 220 | int i; |
| 219 | ||
| 220 | 221 | double db = 0.0; |
| 221 | 222 | double db_step = 0.50; /* 0.50 dB step (at least, maybe more) */ |
| 222 | 223 | double db_step_inc = 0.275; |
| 223 | for (i=0; i<16; i++) | |
| 224 | ||
| 225 | for (i = 0; i < 16; i++) | |
| 224 | 226 | { |
| 225 | 227 | double max = 100.0 / pow(10.0, db/20.0 ); |
| 226 | vol_ctrl[ 15-i ] = max; | |
| 227 | /*logerror("vol_ctrl[%x] = %i (%f dB)\n",15-i,vol_ctrl[ 15-i ],db);*/ | |
| 228 | state->vol_ctrl[15 - i] = max; | |
| 229 | /*logerror("vol_ctrl[%x] = %i (%f dB)\n", 15 - i, state->vol_ctrl[15 - i], db);*/ | |
| 228 | 230 | db += db_step; |
| 229 | 231 | db_step += db_step_inc; |
| 230 | 232 | } |
| r7500 | r7501 | |
| 232 | 234 | |
| 233 | 235 | static TIMER_CALLBACK( nmi_callback ) |
| 234 | 236 | { |
| 235 | if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 236 | else pending_nmi = 1; | |
| 237 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 238 | if (state->sound_nmi_enable) | |
| 239 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 240 | else | |
| 241 | state->pending_nmi = 1; | |
| 237 | 242 | } |
| 238 | 243 | |
| 239 | 244 | static WRITE8_HANDLER( sound_command_w ) |
| 240 | 245 | { |
| 241 | soundlatch_w(space,0,data); | |
| 242 | timer_call_after_resynch(space->machine, NULL, data,nmi_callback); | |
| 246 | soundlatch_w(space, 0, data); | |
| 247 | timer_call_after_resynch(space->machine, NULL, data, nmi_callback); | |
| 243 | 248 | } |
| 244 | 249 | |
| 245 | 250 | static WRITE8_HANDLER( nmi_disable_w ) |
| 246 | 251 | { |
| 247 | sound_nmi_enable = 0; | |
| 252 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 253 | state->sound_nmi_enable = 0; | |
| 248 | 254 | } |
| 249 | 255 | |
| 250 | 256 | static WRITE8_HANDLER( nmi_enable_w ) |
| 251 | 257 | { |
| 252 | sound_nmi_enable = 1; | |
| 253 | if (pending_nmi) | |
| 258 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 259 | state->sound_nmi_enable = 1; | |
| 260 | ||
| 261 | if (state->pending_nmi) | |
| 254 | 262 | { |
| 255 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 256 | pending_nmi = 0; | |
| 263 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 264 | state->pending_nmi = 0; | |
| 257 | 265 | } |
| 258 | 266 | } |
| 259 | 267 | |
| r7500 | r7501 | |
| 280 | 288 | |
| 281 | 289 | static READ8_HANDLER ( nycaptor_generic_control_r ) |
| 282 | 290 | { |
| 283 | return generic_control_reg; | |
| 291 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 292 | return state->generic_control_reg; | |
| 284 | 293 | } |
| 285 | 294 | |
| 286 | 295 | static WRITE8_HANDLER( nycaptor_generic_control_w ) |
| 287 | 296 | { |
| 288 | generic_control_reg = data; | |
| 297 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 298 | state->generic_control_reg = data; | |
| 289 | 299 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "maincpu") + 0x10000 + ((data&0x08)>>3)*0x4000 ); |
| 290 | 300 | } |
| 291 | 301 | |
| 292 | 302 | static ADDRESS_MAP_START( nycaptor_master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 293 | 303 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 294 | 304 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 295 | AM_RANGE(0xc000, 0xc7ff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE_GENERIC(videoram) AM_SIZE_GENERIC(videoram) | |
| 296 | AM_RANGE(0xd000, 0xd000) AM_READ(nycaptor_mcu_r) AM_WRITE(nycaptor_mcu_w) | |
| 305 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, videoram, videoram_size) | |
| 306 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(nycaptor_mcu_r, nycaptor_mcu_w) | |
| 297 | 307 | AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w) |
| 298 | AM_RANGE(0xd002, 0xd002) AM_READ(nycaptor_generic_control_r) AM_WRITE(nycaptor_generic_control_w) /* bit 3 - memory bank at 0x8000-0xbfff */ | |
| 299 | AM_RANGE(0xd400, 0xd400) AM_READ(from_snd_r) AM_WRITE(sound_command_w) | |
| 308 | AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, nycaptor_generic_control_w) /* bit 3 - memory bank at 0x8000-0xbfff */ | |
| 309 | AM_RANGE(0xd400, 0xd400) AM_READWRITE(from_snd_r, sound_command_w) | |
| 300 | 310 | AM_RANGE(0xd401, 0xd401) AM_READNOP |
| 301 | 311 | AM_RANGE(0xd403, 0xd403) AM_WRITE(sound_cpu_reset_w) |
| 302 | 312 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| r7500 | r7501 | |
| 307 | 317 | AM_RANGE(0xd805, 0xd805) AM_READ(nycaptor_mcu_status_r1) |
| 308 | 318 | AM_RANGE(0xd806, 0xd806) AM_READNOP /* unknown ?sound? */ |
| 309 | 319 | AM_RANGE(0xd807, 0xd807) AM_READ(nycaptor_mcu_status_r2) |
| 310 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 311 | AM_RANGE(0xdca0, 0xdcbf) AM_READ(nycaptor_scrlram_r) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 320 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 321 | AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 312 | 322 | AM_RANGE(0xdce1, 0xdce1) AM_WRITENOP |
| 313 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w) | |
| 314 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITE(nycaptor_gfxctrl_w) | |
| 315 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r) AM_WRITE(nycaptor_sharedram_w) AM_BASE(&nycaptor_sharedram) | |
| 323 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w) | |
| 324 | AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w) | |
| 325 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, sharedram) | |
| 316 | 326 | ADDRESS_MAP_END |
| 317 | 327 | |
| 318 | 328 | static ADDRESS_MAP_START( nycaptor_slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 319 | 329 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 320 | AM_RANGE(0xc000, 0xc7ff) AM_READ(nycaptor_videoram_r | |
| 330 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, | |
| 321 | 331 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| 322 | 332 | AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1") |
| 323 | 333 | AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2") |
| 324 | 334 | AM_RANGE(0xd803, 0xd803) AM_READ_PORT("IN0") |
| 325 | 335 | AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1") |
| 326 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 327 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 336 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 337 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 328 | 338 | |
| 329 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r | |
| 339 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, | |
| 330 | 340 | AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r) |
| 331 | 341 | AM_RANGE(0xdf01, 0xdf01) AM_READ(nycaptor_by_r) |
| 332 | 342 | AM_RANGE(0xdf02, 0xdf02) AM_READ(nycaptor_b_r) |
| 333 | 343 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITENOP/* ? gfx control ? */ |
| 334 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r | |
| 344 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, | |
| 335 | 345 | ADDRESS_MAP_END |
| 336 | 346 | |
| 337 | 347 | static ADDRESS_MAP_START( nycaptor_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r7500 | r7501 | |
| 343 | 353 | AM_RANGE(0xca00, 0xca00) AM_WRITENOP |
| 344 | 354 | AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP |
| 345 | 355 | AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP |
| 346 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r | |
| 356 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(soundlatch_r, | |
| 347 | 357 | AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w) |
| 348 | 358 | AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w) |
| 349 | 359 | AM_RANGE(0xd600, 0xd600) AM_WRITENOP |
| r7500 | r7501 | |
| 352 | 362 | |
| 353 | 363 | static ADDRESS_MAP_START( nycaptor_m68705_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 354 | 364 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 355 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(nycaptor_68705_portA_r,nycaptor_68705_portA_w) | |
| 356 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(nycaptor_68705_portB_r,nycaptor_68705_portB_w) | |
| 357 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(nycaptor_68705_portC_r,nycaptor_68705_portC_w) | |
| 358 | AM_RANGE(0x0004, 0x0004) AM_WRITE(nycaptor_68705_ddrA_w) | |
| 359 | AM_RANGE(0x0005, 0x0005) AM_WRITE(nycaptor_68705_ddrB_w) | |
| 360 | AM_RANGE(0x0006, 0x0006) AM_WRITE(nycaptor_68705_ddrC_w) | |
| 365 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(nycaptor_68705_port_a_r, nycaptor_68705_port_a_w) | |
| 366 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(nycaptor_68705_port_b_r, nycaptor_68705_port_b_w) | |
| 367 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(nycaptor_68705_port_c_r, nycaptor_68705_port_c_w) | |
| 368 | AM_RANGE(0x0004, 0x0004) AM_WRITE(nycaptor_68705_ddr_a_w) | |
| 369 | AM_RANGE(0x0005, 0x0005) AM_WRITE(nycaptor_68705_ddr_b_w) | |
| 370 | AM_RANGE(0x0006, 0x0006) AM_WRITE(nycaptor_68705_ddr_c_w) | |
| 361 | 371 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| 362 | 372 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 363 | 373 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 368 | 378 | |
| 369 | 379 | static READ8_HANDLER(cyclshtg_mcu_status_r) |
| 370 | 380 | { |
| 371 | ||
| 381 | | |
| 372 | 382 | } |
| 373 | 383 | |
| 374 | 384 | static READ8_HANDLER(cyclshtg_mcu_r) |
| 375 | 385 | { |
| 376 | ||
| 386 | | |
| 377 | 387 | } |
| 378 | 388 | |
| 379 | 389 | static WRITE8_HANDLER(cyclshtg_mcu_w) |
| r7500 | r7501 | |
| 383 | 393 | |
| 384 | 394 | static READ8_HANDLER(cyclshtg_mcu_status_r1) |
| 385 | 395 | { |
| 386 | ||
| 396 | | |
| 387 | 397 | } |
| 388 | 398 | |
| 389 | 399 | static WRITE8_HANDLER( cyclshtg_generic_control_w ) |
| 390 | 400 | { |
| 391 | int bank=(data>>2)&3; | |
| 392 | generic_control_reg = data; | |
| 401 | nycaptor_state *state = (nycaptor_state *)space->machine->driver_data; | |
| 402 | int bank = (data >> 2) & 3; | |
| 403 | ||
| 404 | state->generic_control_reg = data; | |
| 393 | 405 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "maincpu") + 0x10000 + bank*0x4000 ); |
| 394 | 406 | } |
| 395 | 407 | |
| r7500 | r7501 | |
| 397 | 409 | static ADDRESS_MAP_START( cyclshtg_master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 398 | 410 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 399 | 411 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 400 | AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE_GENERIC(videoram) AM_SIZE_GENERIC(videoram) | |
| 401 | AM_RANGE(0xd000, 0xd000) AM_READ(cyclshtg_mcu_r) AM_WRITE(cyclshtg_mcu_w) | |
| 412 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, videoram, videoram_size) | |
| 413 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(cyclshtg_mcu_r, cyclshtg_mcu_w) | |
| 402 | 414 | AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w) |
| 403 | AM_RANGE(0xd002, 0xd002) AM_READ(nycaptor_generic_control_r) AM_WRITE(cyclshtg_generic_control_w) | |
| 404 | AM_RANGE(0xd400, 0xd400) AM_READ(from_snd_r) AM_WRITE(sound_command_w) | |
| 415 | AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, cyclshtg_generic_control_w) | |
| 416 | AM_RANGE(0xd400, 0xd400) AM_READWRITE(from_snd_r, sound_command_w) | |
| 405 | 417 | AM_RANGE(0xd403, 0xd403) AM_WRITE(sound_cpu_reset_w) |
| 406 | 418 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| 407 | 419 | AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 411 | 423 | AM_RANGE(0xd805, 0xd805) AM_READ(cyclshtg_mcu_status_r) |
| 412 | 424 | AM_RANGE(0xd806, 0xd806) AM_READNOP |
| 413 | 425 | AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r) |
| 414 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 415 | AM_RANGE(0xdca0, 0xdcbf) AM_READ(nycaptor_scrlram_r) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 426 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 427 | AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 416 | 428 | AM_RANGE(0xdce1, 0xdce1) AM_WRITENOP |
| 417 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w) | |
| 418 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITE(nycaptor_gfxctrl_w) | |
| 419 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r) AM_WRITE(nycaptor_sharedram_w) AM_BASE(&nycaptor_sharedram) | |
| 429 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w) | |
| 430 | AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w) | |
| 431 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, sharedram) | |
| 420 | 432 | ADDRESS_MAP_END |
| 421 | 433 | |
| 422 | 434 | static ADDRESS_MAP_START( cyclshtg_slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 423 | 435 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 424 | AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r | |
| 436 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, | |
| 425 | 437 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| 426 | 438 | AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1") |
| 427 | 439 | AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2") |
| 428 | 440 | AM_RANGE(0xd803, 0xd803) AM_READ_PORT("IN0") |
| 429 | 441 | AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1") |
| 430 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 431 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 432 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w) | |
| 442 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 443 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 444 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w) | |
| 433 | 445 | AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r) |
| 434 | 446 | AM_RANGE(0xdf01, 0xdf01) AM_READ(nycaptor_by_r) |
| 435 | 447 | AM_RANGE(0xdf02, 0xdf02) AM_READ(nycaptor_b_r) |
| 436 | 448 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) |
| 437 | 449 | AM_RANGE(0xdf03, 0xdf03) AM_WRITENOP |
| 438 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r | |
| 450 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, | |
| 439 | 451 | ADDRESS_MAP_END |
| 440 | 452 | |
| 441 | static READ8_HANDLER(unk_r) | |
| 453 | static READ8_HANDLER( unk_r ) | |
| 442 | 454 | { |
| 443 | ||
| 455 | | |
| 444 | 456 | } |
| 445 | 457 | |
| 446 | 458 | static ADDRESS_MAP_START( bronx_master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 447 | 459 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 448 | 460 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 449 | AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r | |
| 461 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, | |
| 450 | 462 | AM_RANGE(0xd000, 0xd000) AM_READ(cyclshtg_mcu_r) AM_WRITENOP |
| 451 | 463 | AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w) |
| 452 | AM_RANGE(0xd002, 0xd002) AM_READ(nycaptor_generic_control_r) AM_WRITE(cyclshtg_generic_control_w) | |
| 453 | AM_RANGE(0xd400, 0xd400) AM_READ(from_snd_r) AM_WRITE(sound_command_w) | |
| 464 | AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, cyclshtg_generic_control_w) | |
| 465 | AM_RANGE(0xd400, 0xd400) AM_READWRITE(from_snd_r, sound_command_w) | |
| 454 | 466 | AM_RANGE(0xd401, 0xd401) AM_READ(unk_r) |
| 455 | 467 | AM_RANGE(0xd403, 0xd403) AM_WRITE(sound_cpu_reset_w) |
| 456 | 468 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| r7500 | r7501 | |
| 461 | 473 | AM_RANGE(0xd805, 0xd805) AM_READ(cyclshtg_mcu_status_r) |
| 462 | 474 | AM_RANGE(0xd806, 0xd806) AM_READNOP |
| 463 | 475 | AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r) |
| 464 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 465 | AM_RANGE(0xdca0, 0xdcbf) AM_READ(nycaptor_scrlram_r) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 466 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w) | |
| 467 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITE(nycaptor_gfxctrl_w) | |
| 468 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r) AM_WRITE(nycaptor_sharedram_w) AM_BASE(&nycaptor_sharedram) | |
| 476 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 477 | AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 478 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w) | |
| 479 | AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w) | |
| 480 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, sharedram) | |
| 469 | 481 | ADDRESS_MAP_END |
| 470 | 482 | |
| 471 | 483 | static ADDRESS_MAP_START( bronx_slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 472 | 484 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 473 | AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r | |
| 485 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, | |
| 474 | 486 | AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0") |
| 475 | 487 | AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1") |
| 476 | 488 | AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2") |
| r7500 | r7501 | |
| 478 | 490 | AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1") |
| 479 | 491 | AM_RANGE(0xd805, 0xd805) AM_READ(cyclshtg_mcu_status_r1) |
| 480 | 492 | AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r) |
| 481 | AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w) | |
| 482 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram) | |
| 483 | AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w) | |
| 493 | AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w) | |
| 494 | AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, scrlram) | |
| 495 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w) | |
| 484 | 496 | AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r) |
| 485 | 497 | AM_RANGE(0xdf01, 0xdf01) AM_READ(nycaptor_by_r) |
| 486 | 498 | AM_RANGE(0xdf02, 0xdf02) AM_READ(nycaptor_b_r) |
| 487 | AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITE(nycaptor_gfxctrl_w) | |
| 488 | AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r) AM_WRITE(nycaptor_sharedram_w) | |
| 499 | AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w) | |
| 500 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) | |
| 489 | 501 | ADDRESS_MAP_END |
| 490 | 502 | |
| 491 | 503 | static ADDRESS_MAP_START( bronx_slave_io_map, ADDRESS_SPACE_IO, 8 ) |
| r7500 | r7501 | |
| 683 | 695 | |
| 684 | 696 | |
| 685 | 697 | |
| 698 | static MACHINE_START( nycaptor ) | |
| 699 | { | |
| 700 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 701 | ||
| 702 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 703 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 704 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 705 | state->mcu = devtag_get_device(machine, "mcu"); | |
| 706 | ||
| 707 | state_save_register_global(machine, state->generic_control_reg); | |
| 708 | state_save_register_global(machine, state->sound_nmi_enable); | |
| 709 | state_save_register_global(machine, state->pending_nmi); | |
| 710 | state_save_register_global(machine, state->snd_data); | |
| 711 | state_save_register_global_array(machine, state->vol_ctrl); | |
| 712 | ||
| 713 | state_save_register_global(machine, state->char_bank); | |
| 714 | state_save_register_global(machine, state->palette_bank); | |
| 715 | state_save_register_global(machine, state->gfxctrl); | |
| 716 | ||
| 717 | state_save_register_global(machine, state->port_a_in); | |
| 718 | state_save_register_global(machine, state->port_a_out); | |
| 719 | state_save_register_global(machine, state->ddr_a); | |
| 720 | state_save_register_global(machine, state->port_b_in); | |
| 721 | state_save_register_global(machine, state->port_b_out); | |
| 722 | state_save_register_global(machine, state->ddr_b); | |
| 723 | state_save_register_global(machine, state->port_c_in); | |
| 724 | state_save_register_global(machine, state->port_c_out); | |
| 725 | state_save_register_global(machine, state->ddr_c); | |
| 726 | state_save_register_global(machine, state->mcu_sent); | |
| 727 | state_save_register_global(machine, state->main_sent); | |
| 728 | state_save_register_global(machine, state->from_main); | |
| 729 | state_save_register_global(machine, state->from_mcu); | |
| 730 | } | |
| 731 | ||
| 732 | static MACHINE_RESET( nycaptor ) | |
| 733 | { | |
| 734 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 735 | ||
| 736 | MACHINE_RESET_CALL(ta7630); | |
| 737 | ||
| 738 | state->generic_control_reg = 0; | |
| 739 | state->sound_nmi_enable = 0; | |
| 740 | state->pending_nmi = 0; | |
| 741 | state->snd_data = 0; | |
| 742 | ||
| 743 | state->char_bank = 0; | |
| 744 | state->palette_bank = 0; | |
| 745 | state->gfxctrl = 0; | |
| 746 | ||
| 747 | state->port_a_in = 0; | |
| 748 | state->port_a_out = 0; | |
| 749 | state->ddr_a = 0; | |
| 750 | state->port_b_in = 0; | |
| 751 | state->port_b_out = 0; | |
| 752 | state->ddr_b = 0; | |
| 753 | state->port_c_in = 0; | |
| 754 | state->port_c_out = 0; | |
| 755 | state->ddr_c = 0; | |
| 756 | state->mcu_sent = 0; | |
| 757 | state->main_sent = 0; | |
| 758 | state->from_main = 0; | |
| 759 | state->from_mcu = 0; | |
| 760 | ||
| 761 | memset(state->vol_ctrl, 0, ARRAY_LENGTH(state->vol_ctrl)); | |
| 762 | } | |
| 763 | ||
| 686 | 764 | static MACHINE_DRIVER_START( nycaptor ) |
| 765 | ||
| 766 | /* driver data */ | |
| 767 | MDRV_DRIVER_DATA(nycaptor_state) | |
| 768 | ||
| 687 | 769 | /* basic machine hardware */ |
| 688 | 770 | MDRV_CPU_ADD("maincpu", Z80,8000000/2) /* ??? */ |
| 689 | 771 | MDRV_CPU_PROGRAM_MAP(nycaptor_master_map) |
| r7500 | r7501 | |
| 702 | 784 | |
| 703 | 785 | MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame - an high value to ensure proper synchronization of the CPUs */ |
| 704 | 786 | |
| 705 | MDRV_MACHINE_RESET(ta7630) | |
| 787 | MDRV_MACHINE_START(nycaptor) | |
| 788 | MDRV_MACHINE_RESET(nycaptor) | |
| 706 | 789 | |
| 707 | 790 | /* video hardware */ |
| 708 | 791 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 745 | 828 | MACHINE_DRIVER_END |
| 746 | 829 | |
| 747 | 830 | static MACHINE_DRIVER_START( cyclshtg ) |
| 831 | ||
| 832 | /* driver data */ | |
| 833 | MDRV_DRIVER_DATA(nycaptor_state) | |
| 834 | ||
| 748 | 835 | MDRV_CPU_ADD("maincpu", Z80,8000000/2) |
| 749 | 836 | MDRV_CPU_PROGRAM_MAP(cyclshtg_master_map) |
| 750 | 837 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r7500 | r7501 | |
| 763 | 850 | #endif |
| 764 | 851 | |
| 765 | 852 | MDRV_QUANTUM_TIME(HZ(60)) |
| 766 | MDRV_MACHINE_RESET(ta7630) | |
| 853 | MDRV_MACHINE_START(nycaptor) | |
| 854 | MDRV_MACHINE_RESET(nycaptor) | |
| 767 | 855 | |
| 768 | 856 | MDRV_SCREEN_ADD("screen", RASTER) |
| 769 | 857 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 805 | 893 | |
| 806 | 894 | |
| 807 | 895 | static MACHINE_DRIVER_START( bronx ) |
| 896 | ||
| 897 | /* driver data */ | |
| 898 | MDRV_DRIVER_DATA(nycaptor_state) | |
| 899 | ||
| 808 | 900 | MDRV_CPU_ADD("maincpu", Z80,8000000/2) |
| 809 | 901 | MDRV_CPU_PROGRAM_MAP(bronx_master_map) |
| 810 | 902 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r7500 | r7501 | |
| 819 | 911 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,2*60) |
| 820 | 912 | |
| 821 | 913 | MDRV_QUANTUM_TIME(HZ(120)) |
| 822 | MDRV_MACHINE_RESET(ta7630) | |
| 914 | MDRV_MACHINE_START(nycaptor) | |
| 915 | MDRV_MACHINE_RESET(nycaptor) | |
| 823 | 916 | |
| 824 | 917 | MDRV_SCREEN_ADD("screen", RASTER) |
| 825 | 918 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 1189 | 1282 | ROM_LOAD( "a50_14", 0x1c000, 0x4000, CRC(24b2f1bf) SHA1(4757aec2e4b99ce33d993ce1e19ee46a4eb76e86) ) |
| 1190 | 1283 | ROM_END |
| 1191 | 1284 | |
| 1192 | static DRIVER_INIT(bronx) | |
| 1285 | static DRIVER_INIT( bronx ) | |
| 1193 | 1286 | { |
| 1287 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 1194 | 1288 | int i; |
| 1195 | 1289 | UINT8 *rom = memory_region(machine, "maincpu"); |
| 1196 | for(i=0;i<0x20000;i++) | |
| 1197 | rom[i]=BITSWAP8(rom[i],0,1,2,3,4,5,6,7); | |
| 1198 | nyc_gametype=1; | |
| 1290 | ||
| 1291 | for (i = 0; i < 0x20000; i++) | |
| 1292 | rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7); | |
| 1293 | ||
| 1294 | state->gametype = 1; | |
| 1199 | 1295 | } |
| 1200 | 1296 | |
| 1201 | static DRIVER_INIT(colt) | |
| 1297 | static DRIVER_INIT( colt ) | |
| 1202 | 1298 | { |
| 1299 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 1203 | 1300 | int i; |
| 1204 | 1301 | UINT8 *rom = memory_region(machine, "maincpu"); |
| 1205 | for(i=0;i<0x20000;i++) | |
| 1206 | rom[i]=BITSWAP8(rom[i],0,1,2,3,4,5,6,7); | |
| 1207 | nyc_gametype=2; | |
| 1302 | ||
| 1303 | for (i = 0; i < 0x20000; i++) | |
| 1304 | rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7); | |
| 1305 | ||
| 1306 | state->gametype = 2; | |
| 1208 | 1307 | } |
| 1209 | 1308 | |
| 1210 | static DRIVER_INIT(nycaptor) | |
| 1309 | static DRIVER_INIT( nycaptor ) | |
| 1211 | 1310 | { |
| 1212 | nyc_gametype=0; | |
| 1311 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 1312 | state->gametype = 0; | |
| 1213 | 1313 | } |
| 1214 | 1314 | |
| 1215 | static DRIVER_INIT(cyclshtg) | |
| 1315 | static DRIVER_INIT( cyclshtg ) | |
| 1216 | 1316 | { |
| 1217 | nyc_gametype=1; | |
| 1317 | nycaptor_state *state = (nycaptor_state *)machine->driver_data; | |
| 1318 | state->gametype = 1; | |
| 1218 | 1319 | } |
| 1219 | 1320 | |
| 1220 | GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor, ROT0, "Taito", "N.Y. Captor", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1221 | GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, cyclshtg, ROT90, "Taito", "Cycle Shooting", GAME_NOT_WORKING) | |
| 1321 | GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor, ROT0, "Taito", "N.Y. Captor", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1322 | GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, cyclshtg, ROT90, "Taito", "Cycle Shooting", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 1222 | 1323 | /* bootlegs */ |
| 1223 | GAME( 1986, bronx, cyclshtg, bronx, cyclshtg, bronx, ROT90, "bootleg", "Bronx",GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND) | |
| 1224 | GAME( 1986, colt , nycaptor, bronx, nycaptor, colt, ROT0, "bootleg", "Colt",GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND|GAME_WRONG_COLORS) | |
| 1324 | GAME( 1986, bronx, cyclshtg, bronx, cyclshtg, bronx, ROT90, "bootleg", "Bronx", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1325 | GAME( 1986, colt , nycaptor, bronx, nycaptor, colt, ROT0, "bootleg", "Colt", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "cpu/m6502/m6502.h" |
| 9 | 9 | |
| 10 | static UINT8* mgolf_video_ram; | |
| 10 | class mgolf_state | |
| 11 | { | |
| 12 | public: | |
| 13 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mgolf_state(machine)); } | |
| 11 | 14 | |
| 12 | static attotime time_pushed; | |
| 13 | static attotime time_released; | |
| 15 | mgolf_state(running_machine &machine) { } | |
| 14 | 16 | |
| 15 | static UINT8 prev = 0; | |
| 16 | static UINT8 mask = 0; | |
| 17 | /* memory pointers */ | |
| 18 | UINT8* video_ram; | |
| 17 | 19 | |
| 18 | static tilemap_t* bg_tilemap; | |
| 20 | /* video-related */ | |
| 21 | tilemap_t* bg_tilemap; | |
| 19 | 22 | |
| 23 | /* misc */ | |
| 24 | UINT8 prev; | |
| 25 | UINT8 mask; | |
| 26 | attotime time_pushed; | |
| 27 | attotime time_released; | |
| 20 | 28 | |
| 29 | /* devices */ | |
| 30 | running_device *maincpu; | |
| 31 | }; | |
| 32 | ||
| 33 | ||
| 21 | 34 | static TILE_GET_INFO( get_tile_info ) |
| 22 | 35 | { |
| 23 | UINT8 code = mgolf_video_ram[tile_index]; | |
| 36 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 37 | UINT8 code = state->video_ram[tile_index]; | |
| 24 | 38 | |
| 25 | 39 | SET_TILE_INFO(0, code, code >> 7, 0); |
| 26 | 40 | } |
| r7500 | r7501 | |
| 28 | 42 | |
| 29 | 43 | static WRITE8_HANDLER( mgolf_vram_w ) |
| 30 | 44 | { |
| 31 | mgolf_video_ram[offset] = data; | |
| 32 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 45 | mgolf_state *state = (mgolf_state *)space->machine->driver_data; | |
| 46 | state->video_ram[offset] = data; | |
| 47 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 33 | 48 | } |
| 34 | 49 | |
| 35 | 50 | |
| 36 | 51 | static VIDEO_START( mgolf ) |
| 37 | 52 | { |
| 38 | bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 53 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 54 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 39 | 55 | } |
| 40 | 56 | |
| 41 | 57 | |
| 42 | 58 | static VIDEO_UPDATE( mgolf ) |
| 43 | 59 | { |
| 60 | mgolf_state *state = (mgolf_state *)screen->machine->driver_data; | |
| 44 | 61 | int i; |
| 45 | 62 | |
| 46 | 63 | /* draw playfield */ |
| 64 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 47 | 65 | |
| 48 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 49 | ||
| 50 | 66 | /* draw sprites */ |
| 51 | ||
| 52 | 67 | for (i = 0; i < 2; i++) |
| 53 | 68 | { |
| 54 | 69 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], |
| 55 | | |
| 70 | state->video_ram[0x399 + 4 * i], | |
| 56 | 71 | i, |
| 57 | 72 | 0, 0, |
| 58 | mgolf_video_ram[0x390 + 2 * i] - 7, | |
| 59 | mgolf_video_ram[0x398 + 4 * i] - 16, 0); | |
| 73 | state->video_ram[0x390 + 2 * i] - 7, | |
| 74 | state->video_ram[0x398 + 4 * i] - 16, 0); | |
| 60 | 75 | |
| 61 | 76 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], |
| 62 | | |
| 77 | state->video_ram[0x39b + 4 * i], | |
| 63 | 78 | i, |
| 64 | 79 | 0, 0, |
| 65 | mgolf_video_ram[0x390 + 2 * i] - 15, | |
| 66 | mgolf_video_ram[0x39a + 4 * i] - 16, 0); | |
| 80 | state->video_ram[0x390 + 2 * i] - 15, | |
| 81 | state->video_ram[0x39a + 4 * i] - 16, 0); | |
| 67 | 82 | } |
| 68 | 83 | return 0; |
| 69 | 84 | } |
| 70 | 85 | |
| 71 | 86 | |
| 72 | static void update_plunger(running_machine *machine) | |
| 87 | static void update_plunger( running_machine *machine ) | |
| 73 | 88 | { |
| 89 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 74 | 90 | UINT8 val = input_port_read(machine, "BUTTON"); |
| 75 | 91 | |
| 76 | if (prev != val) | |
| 92 | if (state->prev != val) | |
| 77 | 93 | { |
| 78 | 94 | if (val == 0) |
| 79 | 95 | { |
| 80 | time_released = timer_get_time(machine); | |
| 96 | state->time_released = timer_get_time(machine); | |
| 81 | 97 | |
| 82 | if (!mask) | |
| 83 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 98 | if (!state->mask) | |
| 99 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | 100 | } |
| 85 | 101 | else |
| 86 | time_pushed = timer_get_time(machine); | |
| 102 | state->time_pushed = timer_get_time(machine); | |
| 87 | 103 | |
| 88 | prev = val; | |
| 104 | state->prev = val; | |
| 89 | 105 | } |
| 90 | 106 | } |
| 91 | 107 | |
| 92 | 108 | |
| 93 | 109 | static TIMER_CALLBACK( interrupt_callback ) |
| 94 | 110 | { |
| 111 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 95 | 112 | int scanline = param; |
| 96 | 113 | |
| 97 | 114 | update_plunger(machine); |
| 98 | 115 | |
| 99 | generic_pulse_irq_line( | |
| 116 | generic_pulse_irq_line(s | |
| 100 | 117 | |
| 101 | 118 | scanline = scanline + 32; |
| 102 | 119 | |
| r7500 | r7501 | |
| 109 | 126 | |
| 110 | 127 | static double calc_plunger_pos(running_machine *machine) |
| 111 | 128 | { |
| 112 | return (attotime_to_double(timer_get_time(machine)) - attotime_to_double(time_released)) * (attotime_to_double(time_released) - attotime_to_double(time_pushed) + 0.2); | |
| 129 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 130 | return (attotime_to_double(timer_get_time(machine)) - attotime_to_double(state->time_released)) * (attotime_to_double(state->time_released) - attotime_to_double(state->time_pushed) + 0.2); | |
| 113 | 131 | } |
| 114 | 132 | |
| 115 | 133 | |
| 116 | static MACHINE_RESET( mgolf ) | |
| 117 | { | |
| 118 | timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), NULL, 16, interrupt_callback); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | static PALETTE_INIT( mgolf ) | |
| 123 | { | |
| 124 | palette_set_color(machine, 0, MAKE_RGB(0x80, 0x80, 0x80)); | |
| 125 | palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00)); | |
| 126 | palette_set_color(machine, 2, MAKE_RGB(0x80, 0x80, 0x80)); | |
| 127 | palette_set_color(machine, 3, MAKE_RGB(0xff, 0xff, 0xff)); | |
| 128 | } | |
| 129 | ||
| 130 | ||
| 131 | 134 | static READ8_HANDLER( mgolf_wram_r ) |
| 132 | 135 | { |
| 133 | return mgolf_video_ram[0x380 + offset]; | |
| 136 | mgolf_state *state = (mgolf_state *)space->machine->driver_data; | |
| 137 | return state->video_ram[0x380 + offset]; | |
| 134 | 138 | } |
| 135 | 139 | |
| 136 | 140 | |
| r7500 | r7501 | |
| 172 | 176 | |
| 173 | 177 | static WRITE8_HANDLER( mgolf_wram_w ) |
| 174 | 178 | { |
| 175 | mgolf_video_ram[0x380 + offset] = data; | |
| 179 | mgolf_state *state = (mgolf_state *)space->machine->driver_data; | |
| 180 | state->video_ram[0x380 + offset] = data; | |
| 176 | 181 | } |
| 177 | 182 | |
| 178 | 183 | |
| r7500 | r7501 | |
| 201 | 206 | AM_RANGE(0x006d, 0x006d) AM_WRITENOP |
| 202 | 207 | AM_RANGE(0x0080, 0x00ff) AM_WRITE(mgolf_wram_w) |
| 203 | 208 | AM_RANGE(0x0180, 0x01ff) AM_WRITE(mgolf_wram_w) |
| 204 | AM_RANGE(0x0800, 0x0bff) AM_WRITE(mgolf_vram_w) AM_BASE( | |
| 209 | AM_RANGE(0x0800, 0x0bff) AM_WRITE(mgolf_vram_w) AM_BASE_MEMBER( | |
| 205 | 210 | |
| 206 | 211 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 207 | 212 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 209 | 214 | |
| 210 | 215 | static INPUT_PORTS_START( mgolf ) |
| 211 | 216 | |
| 212 | PORT_START("40") | |
| 217 | PORT_START("40") | |
| 213 | 218 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Language ) ) |
| 214 | 219 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 215 | 220 | PORT_DIPSETTING( 0x10, DEF_STR( French ) ) |
| r7500 | r7501 | |
| 221 | 226 | PORT_DIPSETTING( 0x80, "35" ) |
| 222 | 227 | PORT_DIPSETTING( 0xc0, "40" ) |
| 223 | 228 | |
| 224 | PORT_START("41") | |
| 229 | PORT_START("41") | |
| 225 | 230 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL A */ |
| 226 | 231 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL B */ |
| 227 | 232 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 228 | 233 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 229 | 234 | |
| 230 | PORT_START("60") | |
| 235 | PORT_START("60") | |
| 231 | 236 | PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) |
| 232 | 237 | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT ) |
| 233 | 238 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 234 | 239 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) |
| 235 | 240 | |
| 236 | PORT_START("61") | |
| 241 | PORT_START("61") | |
| 237 | 242 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Course Select") PORT_CODE(KEYCODE_SPACE) |
| 238 | 243 | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) /* PLUNGER 1 */ |
| 239 | 244 | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) /* PLUNGER 2 */ |
| r7500 | r7501 | |
| 248 | 253 | INPUT_PORTS_END |
| 249 | 254 | |
| 250 | 255 | |
| 256 | static PALETTE_INIT( mgolf ) | |
| 257 | { | |
| 258 | palette_set_color(machine, 0, MAKE_RGB(0x80, 0x80, 0x80)); | |
| 259 | palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00)); | |
| 260 | palette_set_color(machine, 2, MAKE_RGB(0x80, 0x80, 0x80)); | |
| 261 | palette_set_color(machine, 3, MAKE_RGB(0xff, 0xff, 0xff)); | |
| 262 | } | |
| 263 | ||
| 251 | 264 | static const gfx_layout tile_layout = |
| 252 | 265 | { |
| 253 | 266 | 8, 8, |
| r7500 | r7501 | |
| 287 | 300 | GFXDECODE_END |
| 288 | 301 | |
| 289 | 302 | |
| 303 | static MACHINE_START( mgolf ) | |
| 304 | { | |
| 305 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 306 | ||
| 307 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 308 | ||
| 309 | state_save_register_global(machine, state->prev); | |
| 310 | state_save_register_global(machine, state->mask); | |
| 311 | } | |
| 312 | ||
| 313 | static MACHINE_RESET( mgolf ) | |
| 314 | { | |
| 315 | mgolf_state *state = (mgolf_state *)machine->driver_data; | |
| 316 | timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), NULL, 16, interrupt_callback); | |
| 317 | ||
| 318 | state->mask = 0; | |
| 319 | state->prev = 0; | |
| 320 | } | |
| 321 | ||
| 322 | ||
| 290 | 323 | static MACHINE_DRIVER_START( mgolf ) |
| 291 | 324 | |
| 325 | /* driver data */ | |
| 326 | MDRV_DRIVER_DATA(mgolf_state) | |
| 327 | ||
| 292 | 328 | /* basic machine hardware */ |
| 293 | 329 | MDRV_CPU_ADD("maincpu", M6502, 12096000 / 16) /* ? */ |
| 294 | 330 | MDRV_CPU_PROGRAM_MAP(cpu_map) |
| 295 | 331 | |
| 332 | MDRV_MACHINE_START(mgolf) | |
| 296 | 333 | MDRV_MACHINE_RESET(mgolf) |
| 297 | 334 | |
| 298 | 335 | /* video hardware */ |
| r7500 | r7501 | |
|---|---|---|
| 19 | 19 | #include "emu.h" |
| 20 | 20 | #include "cpu/z80/z80.h" |
| 21 | 21 | #include "sound/2203intf.h" |
| 22 | #include "includes/skyfox.h" | |
| 22 | 23 | |
| 23 | /* Variables defined in video: */ | |
| 24 | 24 | |
| 25 | extern int skyfox_bg_pos, skyfox_bg_ctrl; | |
| 26 | ||
| 27 | ||
| 28 | /* Functions defined in video: */ | |
| 29 | ||
| 30 | WRITE8_HANDLER( skyfox_vregs_w ); | |
| 31 | ||
| 32 | PALETTE_INIT( skyfox ); | |
| 33 | ||
| 34 | VIDEO_UPDATE( skyfox ); | |
| 35 | ||
| 36 | ||
| 37 | 25 | /*************************************************************************** |
| 38 | 26 | |
| 39 | 27 | |
| r7500 | r7501 | |
| 50 | 38 | static ADDRESS_MAP_START( skyfox_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 51 | 39 | AM_RANGE(0x0000, 0xbfff) AM_ROM // ROM |
| 52 | 40 | AM_RANGE(0xc000, 0xcfff) AM_RAM // RAM |
| 53 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE_SIZE_ | |
| 41 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 54 | 42 | AM_RANGE(0xd400, 0xdfff) AM_RAM // RAM? |
| 55 | 43 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("INPUTS") // Input Ports |
| 56 | 44 | AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW0") // |
| r7500 | r7501 | |
| 96 | 84 | |
| 97 | 85 | static INPUT_CHANGED( coin_inserted ) |
| 98 | 86 | { |
| 99 | cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 87 | skyfox_state *state = (skyfox_state *)field->port->machine->driver_data; | |
| 88 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 100 | 89 | } |
| 101 | 90 | |
| 102 | 91 | static INPUT_PORTS_START( skyfox ) |
| r7500 | r7501 | |
| 225 | 214 | |
| 226 | 215 | static INTERRUPT_GEN( skyfox_interrupt ) |
| 227 | 216 | { |
| 217 | skyfox_state *state = (skyfox_state *)device->machine->driver_data; | |
| 218 | ||
| 228 | 219 | /* Scroll the bg */ |
| 229 | s | |
| 220 | state->bg_pos += (state->bg_ctrl >> 1) & 0x7; // maybe.. | |
| 230 | 221 | } |
| 231 | 222 | |
| 223 | static MACHINE_START( skyfox ) | |
| 224 | { | |
| 225 | skyfox_state *state = (skyfox_state *)machine->driver_data; | |
| 226 | ||
| 227 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 228 | ||
| 229 | state_save_register_global(machine, state->bg_pos); | |
| 230 | state_save_register_global(machine, state->bg_ctrl); | |
| 231 | } | |
| 232 | ||
| 233 | static MACHINE_RESET( skyfox ) | |
| 234 | { | |
| 235 | skyfox_state *state = (skyfox_state *)machine->driver_data; | |
| 236 | ||
| 237 | state->bg_pos = 0; | |
| 238 | state->bg_ctrl = 0; | |
| 239 | } | |
| 240 | ||
| 232 | 241 | static MACHINE_DRIVER_START( skyfox ) |
| 233 | 242 | |
| 243 | /* driver data */ | |
| 244 | MDRV_DRIVER_DATA(skyfox_state) | |
| 245 | ||
| 234 | 246 | /* basic machine hardware */ |
| 235 | 247 | MDRV_CPU_ADD("maincpu", Z80, 4000000) |
| 236 | 248 | MDRV_CPU_PROGRAM_MAP(skyfox_map) |
| r7500 | r7501 | |
| 239 | 251 | MDRV_CPU_ADD("audiocpu", Z80, 1748000) |
| 240 | 252 | MDRV_CPU_PROGRAM_MAP(skyfox_sound_map) |
| 241 | 253 | |
| 254 | MDRV_MACHINE_START(skyfox) | |
| 255 | MDRV_MACHINE_RESET(skyfox) | |
| 256 | ||
| 242 | 257 | /* video hardware */ |
| 243 | 258 | MDRV_SCREEN_ADD("screen", RASTER) |
| 244 | 259 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 394 | 409 | { |
| 395 | 410 | UINT8 *RAM = memory_region(machine, "gfx1"); |
| 396 | 411 | UINT8 *end = RAM + memory_region_length(machine, "gfx1"); |
| 397 | UINT8 buf[32*32]; | |
| 412 | UINT8 buf[32 * 32]; | |
| 398 | 413 | |
| 399 | 414 | while (RAM < end) |
| 400 | 415 | { |
| 401 | 416 | int i; |
| 402 | for (i=0;i<(32*32);i++) | |
| 403 | buf[i] = RAM[(i%8) + ((i/8)%8)*32 + ((i/64)%4)*8 + (i/256)*256]; | |
| 417 | for (i = 0; i < (32 * 32); i++) | |
| 418 | buf[i] = RAM[(i % 8) + ((i / 8) % 8) * 32 + ((i / 64) % 4) * 8 + (i / 256) * 256]; | |
| 404 | 419 | |
| 405 | memcpy(RAM,buf,32*32); | |
| 406 | RAM += 32*32; | |
| 420 | memcpy(RAM, buf, 32 * 32); | |
| 421 | RAM += 32 * 32; | |
| 407 | 422 | } |
| 408 | 423 | } |
| 409 | 424 | |
| 410 | 425 | |
| 411 | 426 | |
| 412 | GAME( 1987, skyfox, 0, skyfox, skyfox, skyfox, ROT90, "Jaleco (Nichibutsu USA license)", "Sky Fox" , 0 ) | |
| 413 | GAME( 1987, exerizrb, skyfox, skyfox, skyfox, skyfox, ROT90, "bootleg", "Exerizer (Japan) (bootleg)", 0 ) | |
| 427 | GAME( 1987, skyfox, 0, skyfox, skyfox, skyfox, ROT90, "Jaleco (Nichibutsu USA license)", "Sky Fox" , GAME_SUPPORTS_SAVE ) | |
| 428 | GAME( 1987, exerizrb, skyfox, skyfox, skyfox, skyfox, ROT90, "bootleg", "Exerizer (Japan) (bootleg)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 29 | 29 | #include "sound/dac.h" |
| 30 | 30 | |
| 31 | 31 | |
| 32 | typedef struct _cntsteer_state cntsteer_state; | |
| 33 | struct _cntsteer_state | |
| 32 | class cntsteer_state | |
| 34 | 33 | { |
| 34 | public: | |
| 35 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cntsteer_state(machine)); } | |
| 36 | ||
| 37 | cntsteer_state(running_machine &machine) { } | |
| 38 | ||
| 35 | 39 | /* memory pointers */ |
| 36 | 40 | UINT8 * videoram; |
| 37 | 41 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | * |
| 18 | 18 | *************************************/ |
| 19 | 19 | |
| 20 | typedef struct _skeetsht_state skeetsht_state; | |
| 21 | struct _skeetsht_state | |
| 20 | class skeetsht_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, skeetsht_state(machine)); } | |
| 24 | ||
| 25 | skeetsht_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | UINT16 *tms_vram; |
| 24 | 28 | UINT8 porta_latch; |
| 25 | 29 | UINT8 ay_sel; |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | #include "cpu/z80/z80.h" |
| 22 | 22 | #include "cpu/m68000/m68000.h" |
| 23 | 23 | #include "includes/decocrpt.h" |
| 24 | #include "includes/deco16ic.h" | |
| 25 | 24 | #include "sound/2151intf.h" |
| 26 | 25 | #include "sound/okim6295.h" |
| 26 | #include "video/deco16ic.h" | |
| 27 | 27 | |
| 28 | class dblewing_state | |
| 29 | { | |
| 30 | public: | |
| 31 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dblewing_state(machine)); } | |
| 32 | ||
| 33 | dblewing_state(running_machine &machine) { } | |
| 34 | ||
| 35 | /* memory pointers */ | |
| 36 | UINT16 * pf1_rowscroll; | |
| 37 | UINT16 * pf2_rowscroll; | |
| 38 | UINT16 * spriteram; | |
| 39 | size_t spriteram_size; | |
| 40 | ||
| 41 | /* protection */ | |
| 42 | UINT16 _008_data; | |
| 43 | UINT16 _104_data; | |
| 44 | UINT16 _406_data; | |
| 45 | UINT16 _608_data; | |
| 46 | UINT16 _70c_data; | |
| 47 | UINT16 _78a_data; | |
| 48 | UINT16 _088_data; | |
| 49 | UINT16 _58c_data; | |
| 50 | UINT16 _408_data; | |
| 51 | UINT16 _40e_data; | |
| 52 | UINT16 _080_data; | |
| 53 | UINT16 _788_data; | |
| 54 | UINT16 _38e_data; | |
| 55 | UINT16 _580_data; | |
| 56 | UINT16 _60a_data; | |
| 57 | UINT16 _200_data; | |
| 58 | UINT16 _28c_data; | |
| 59 | UINT16 _18a_data; | |
| 60 | UINT16 _280_data; | |
| 61 | UINT16 _384_data; | |
| 62 | ||
| 63 | UINT16 boss_move, boss_shoot_type, boss_3_data, boss_4_data, boss_5_data ,boss_5sx_data, boss_6_data; | |
| 64 | ||
| 65 | /* misc */ | |
| 66 | UINT8 sound_irq; | |
| 67 | ||
| 68 | /* devices */ | |
| 69 | running_device *maincpu; | |
| 70 | running_device *audiocpu; | |
| 71 | running_device *deco16ic; | |
| 72 | }; | |
| 73 | ||
| 28 | 74 | /* |
| 29 | 75 | |
| 30 | 76 | offs +0 |
| r7500 | r7501 | |
| 55 | 101 | */ |
| 56 | 102 | |
| 57 | 103 | |
| 58 | ||
| 59 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 104 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 60 | 105 | { |
| 61 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 106 | dblewing_state *state = (dblewing_state *)machine->driver_data; | |
| 107 | UINT16 *spriteram = state->spriteram; | |
| 62 | 108 | int offs; |
| 63 | 109 | |
| 64 | for (offs = 0x400-4;offs >= 0;offs -= 4) | |
| 110 | for (offs = 0x400 - 4; offs >= 0; offs -= 4) | |
| 65 | 111 | { |
| 66 | int x,y,sprite,colour,multi,mult2,fx,fy,inc,flash,mult,xsize,pri; | |
| 112 | int x, y, sprite, colour, multi, mult2, fx, fy, inc, flash, mult, xsize, pri; | |
| 67 | 113 | |
| 68 | sprite = spriteram | |
| 114 | sprite = spriteram | |
| 69 | 115 | |
| 70 | y = spriteram16[offs]; | |
| 71 | flash=y&0x1000; | |
| 72 | xsize = y&0x0800; | |
| 73 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 116 | y = spriteram[offs]; | |
| 117 | flash = y & 0x1000; | |
| 118 | xsize = y & 0x0800; | |
| 119 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 120 | continue; | |
| 74 | 121 | |
| 75 | x = spriteram16[offs+2]; | |
| 76 | colour = (x >>9) & 0x1f; | |
| 122 | x = spriteram[offs + 2]; | |
| 123 | colour = (x >> 9) & 0x1f; | |
| 77 | 124 | |
| 78 | pri = (x&0xc000); // 2 bits or 1? | |
| 125 | pri = (x & 0xc000); // 2 bits or 1? | |
| 79 | 126 | |
| 80 | switch (pri&0xc000) { | |
| 81 | case 0x0000: pri=0; break; | |
| 82 | case 0x4000: pri=0xf0; break; | |
| 83 | case 0x8000: pri=0xf0|0xcc; break; | |
| 84 | case 0xc000: pri=0xf0|0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 127 | switch (pri & 0xc000) | |
| 128 | { | |
| 129 | case 0x0000: pri = 0; break; | |
| 130 | case 0x4000: pri = 0xf0; break; | |
| 131 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 132 | case 0xc000: pri = 0xf0 | 0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 85 | 133 | } |
| 86 | 134 | |
| 87 | 135 | fx = y & 0x2000; |
| r7500 | r7501 | |
| 93 | 141 | if (x >= 320) x -= 512; |
| 94 | 142 | if (y >= 256) y -= 512; |
| 95 | 143 | y = 240 - y; |
| 96 | ||
| 144 | | |
| 97 | 145 | |
| 98 | if (x>320) continue; | |
| 146 | if (x > 320) | |
| 147 | continue; | |
| 99 | 148 | |
| 100 | 149 | sprite &= ~multi; |
| 101 | 150 | if (fy) |
| r7500 | r7501 | |
| 108 | 157 | |
| 109 | 158 | if (flip_screen_get(machine)) |
| 110 | 159 | { |
| 111 | y=240-y; | |
| 112 | x=304-x; | |
| 113 | if (fx) fx=0; else fx=1; | |
| 114 | if (fy) fy=0; else fy=1; | |
| 115 | mult=16; | |
| 160 | y = 240 - y; | |
| 161 | x = 304 - x; | |
| 162 | if (fx) fx = 0; else fx = 1; | |
| 163 | if (fy) fy = 0; else fy = 1; | |
| 164 | mult = 16; | |
| 116 | 165 | } |
| 117 | else mult=-16; | |
| 166 | else | |
| 167 | mult = -16; | |
| 118 | 168 | |
| 119 | mult2 = multi+1; | |
| 169 | mult2 = multi + 1; | |
| 120 | 170 | |
| 121 | 171 | while (multi >= 0) |
| 122 | 172 | { |
| r7500 | r7501 | |
| 141 | 191 | } |
| 142 | 192 | } |
| 143 | 193 | |
| 144 | static | |
| 194 | static VIDEO_UPDATE(dblewing | |
| 145 | 195 | { |
| 146 | return ((bank>>4) & 0x7) * 0x1000; | |
| 147 | } | |
| 196 | dblewing_state *state = (dblewing_state *)screen->machine->driver_data; | |
| 197 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 148 | 198 | |
| 149 | static VIDEO_START(dblewing) | |
| 150 | { | |
| 151 | deco16_1_video_init(machine); | |
| 199 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 200 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 152 | 201 | |
| 153 | deco16_set_tilemap_bank_callback(0,dblewing_bank_callback); | |
| 154 | deco16_set_tilemap_bank_callback(1,dblewing_bank_callback); | |
| 155 | } | |
| 202 | bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */ | |
| 203 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 156 | 204 | |
| 157 | static VIDEO_UPDATE(dblewing) | |
| 158 | { | |
| 159 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 160 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 161 | ||
| 162 | bitmap_fill(bitmap,cliprect,0); /* not Confirmed */ | |
| 163 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 164 | ||
| 165 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 166 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,4); | |
| 167 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 205 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 206 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 207 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 168 | 208 | return 0; |
| 169 | 209 | } |
| 170 | 210 | |
| r7500 | r7501 | |
| 178 | 218 | we need to log the PC of each read/write and check to |
| 179 | 219 | see if the code makes any of them move obvious |
| 180 | 220 | */ |
| 181 | static UINT16 dblwings_008_data; | |
| 182 | static UINT16 dblwings_104_data; | |
| 183 | static UINT16 dblwings_406_data; | |
| 184 | static UINT16 dblwings_608_data; | |
| 185 | static UINT16 dblwings_70c_data; | |
| 186 | static UINT16 dblwings_78a_data; | |
| 187 | static UINT16 dblwings_088_data; | |
| 188 | static UINT16 dblwings_58c_data; | |
| 189 | static UINT16 dblwings_408_data; | |
| 190 | static UINT16 dblwings_40e_data; | |
| 191 | static UINT16 dblwings_080_data; | |
| 192 | static UINT16 dblwings_788_data; | |
| 193 | static UINT16 dblwings_38e_data; | |
| 194 | static UINT16 dblwings_580_data; | |
| 195 | static UINT16 dblwings_60a_data; | |
| 196 | static UINT16 dblwings_200_data; | |
| 197 | static UINT16 dblwings_28c_data; | |
| 198 | static UINT16 dblwings_18a_data; | |
| 199 | static UINT16 dblwings_280_data; | |
| 200 | static UINT16 dblwings_384_data; | |
| 221 | static READ16_HANDLER ( dblewing_prot_r ) | |
| 222 | { | |
| 223 | dblewing_state *state = (dblewing_state *)space->machine->driver_data; | |
| 201 | 224 | |
| 202 | static UINT16 boss_move,boss_shoot_type,boss_3_data,boss_4_data,boss_5_data,boss_5sx_data,boss_6_data; | |
| 203 | ||
| 204 | static UINT8 dblewing_sound_irq; | |
| 205 | ||
| 206 | static READ16_HANDLER ( dlbewing_prot_r ) | |
| 207 | { | |
| 208 | switch(offset*2) | |
| 225 | switch (offset * 2) | |
| 209 | 226 | { |
| 210 | case 0x16a: return boss_move; // boss 1 movement | |
| 211 | case 0x6d6: return boss_move; // boss 1 2nd pilot | |
| 212 | case 0x748: return boss_move; // boss 1 3rd pilot | |
| 227 | case 0x16a: return state->boss_move; // boss 1 movement | |
| 228 | case 0x6d6: return state->boss_move; // boss 1 2nd pilot | |
| 229 | case 0x748: return state->boss_move; // boss 1 3rd pilot | |
| 213 | 230 | |
| 214 | 231 | case 0x566: return 0x0009; // boss BGM,might be a variable one (read->write to the sound latch) |
| 215 | case 0x1ea: return boss_shoot_type; // boss 1 shoot type | |
| 216 | case 0x596: return boss_3_data; // boss 3 appearing | |
| 217 | case 0x692: return boss_4_data; | |
| 218 | case 0x6b0: return boss_5_data; | |
| 219 | case 0x51e: return boss_5sx_data; | |
| 220 | case 0x784: return boss_6_data; | |
| 232 | case 0x1ea: return state->boss_shoot_type; // boss 1 shoot type | |
| 233 | case 0x596: return state->boss_3_data; // boss 3 appearing | |
| 234 | case 0x692: return state->boss_4_data; | |
| 235 | case 0x6b0: return state->boss_5_data; | |
| 236 | case 0x51e: return state->boss_5sx_data; | |
| 237 | case 0x784: return state->boss_6_data; | |
| 221 | 238 | |
| 222 | 239 | case 0x330: return 0; // controls bonuses such as shoot type,bombs etc. |
| 223 | case 0x1d4: return | |
| 240 | case 0x1d4: return | |
| 224 | 241 | |
| 225 | case 0x0ac: return (input_port_read(space->machine, "DSW") & 0x40)<<4;//flip screen | |
| 226 | case 0x4b0: return dblwings_608_data;//coinage | |
| 242 | case 0x0ac: return (input_port_read(space->machine, "DSW") & 0x40) << 4;//flip screen | |
| 243 | case 0x4b0: return state->_608_data;//coinage | |
| 227 | 244 | case 0x068: |
| 228 | 245 | { |
| 229 | switch(input_port_read(space->machine, "DSW") & 0x0300) //I don't know how to relationate this... | |
| 246 | switch (input_port_read(space->machine, "DSW") & 0x0300) //I don't know how to relationate this... | |
| 230 | 247 | { |
| 231 | 248 | case 0x0000: return 0x000;//0 |
| 232 | 249 | case 0x0100: return 0x060;//3 |
| r7500 | r7501 | |
| 234 | 251 | case 0x0300: return 0x160;//b |
| 235 | 252 | } |
| 236 | 253 | } |
| 237 | case 0x094: return dblwings_104_data;// p1 inputs select screen OK | |
| 238 | case 0x24c: return dblwings_008_data;//read DSW (mirror for coinage/territory) | |
| 254 | case 0x094: return state->_104_data;// p1 inputs select screen OK | |
| 255 | case 0x24c: return state->_008_data;//read DSW (mirror for coinage/territory) | |
| 239 | 256 | case 0x298: return input_port_read(space->machine, "SYSTEM");//vblank |
| 240 | 257 | case 0x476: return input_port_read(space->machine, "SYSTEM");//mirror for coins |
| 241 | 258 | case 0x506: return input_port_read(space->machine, "DSW"); |
| 242 | case 0x5d8: return | |
| 259 | case 0x5d8: return | |
| 243 | 260 | case 0x2b4: return input_port_read(space->machine, "P1_P2"); |
| 244 | 261 | case 0x1a8: return (input_port_read(space->machine, "DSW") & 0x4000) >> 12;//allow continue |
| 245 | case 0x3ec: return dblwings_70c_data; //score entry | |
| 246 | case 0x246: return dblwings_580_data; // these three controls "perfect bonus" I suppose... | |
| 247 | case 0x52e: return dblwings_580_data; | |
| 248 | case 0x532: return dblwings_580_data; | |
| 262 | case 0x3ec: return state->_70c_data; //score entry | |
| 263 | case 0x246: return state->_580_data; // these three controls "perfect bonus" I suppose... | |
| 264 | case 0x52e: return state->_580_data; | |
| 265 | case 0x532: return state->_580_data; | |
| 249 | 266 | } |
| 250 | 267 | |
| 251 | // printf("dblewing prot r %08x, %04x, %04x\n",cpu_get_pc(space->cpu), offset*2, mem_mask); | |
| 268 | // printf("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask); | |
| 252 | 269 | |
| 253 | if ((offset*2)==0x0f8) return 0; // dblwings_080_data; | |
| 254 | if ((offset*2)==0x104) return 0; | |
| 255 | if ((offset*2)==0x10e) return 0; | |
| 256 | if ((offset*2)==0x206) return 0; // dblwings_70c_data; | |
| 257 | if ((offset*2)==0x25c) return 0; | |
| 258 | if ((offset*2)==0x284) return 0; // 3rd player 2nd boss | |
| 259 | if ((offset*2)==0x432) return 0; // boss on water level? | |
| 260 | if ((offset*2)==0x54a) return 0; // 3rd player 2nd boss | |
| 261 | if ((offset*2)==0x786) return 0; | |
| 270 | if ((offset*2) == 0x0f8) return 0; // state->_080_data; | |
| 271 | if ((offset*2) == 0x104) return 0; | |
| 272 | if ((offset*2) == 0x10e) return 0; | |
| 273 | if ((offset*2) == 0x206) return 0; // state->_70c_data; | |
| 274 | if ((offset*2) == 0x25c) return 0; | |
| 275 | if ((offset*2) == 0x284) return 0; // 3rd player 2nd boss | |
| 276 | if ((offset*2) == 0x432) return 0; // boss on water level? | |
| 277 | if ((offset*2) == 0x54a) return 0; // 3rd player 2nd boss | |
| 278 | if ((offset*2) == 0x786) return 0; | |
| 262 | 279 | |
| 263 | mame_printf_debug("dblewing prot r %08x, %04x, %04x\n",cpu_get_pc(space->cpu), offset*2, mem_mask); | |
| 280 | mame_printf_debug("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask); | |
| 264 | 281 | |
| 265 | 282 | return 0;//mame_rand(space->machine); |
| 266 | 283 | } |
| 267 | 284 | |
| 268 | 285 | static WRITE16_HANDLER( dblewing_prot_w ) |
| 269 | 286 | { |
| 270 | // if(offset*2 != 0x380) | |
| 271 | // printf("dblewing prot w %08x, %04x, %04x %04x\n",cpu_get_pc(space->cpu), offset*2, mem_mask,data); | |
| 287 | dblewing_state *state = (dblewing_state *)space->machine->driver_data; | |
| 272 | 288 | |
| 273 | switch(offset*2) | |
| 289 | // if (offset * 2 != 0x380) | |
| 290 | // printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask, data); | |
| 291 | ||
| 292 | switch (offset * 2) | |
| 274 | 293 | { |
| 275 | 294 | case 0x088: |
| 276 | dblwings_088_data = data; | |
| 277 | if(dblwings_088_data == 0) { boss_4_data = 0; } | |
| 278 | else if(dblwings_088_data & 0x8000) { boss_4_data = 0x50; } | |
| 279 | else { boss_4_data = 0x40; } | |
| 295 | state->_088_data = data; | |
| 296 | if(state->_088_data == 0) { state->boss_4_data = 0; } | |
| 297 | else if(state->_088_data & 0x8000) { state->boss_4_data = 0x50; } | |
| 298 | else { state->boss_4_data = 0x40; } | |
| 280 | 299 | |
| 281 | 300 | return; |
| 282 | 301 | |
| 283 | 302 | case 0x104: |
| 284 | | |
| 303 | | |
| 285 | 304 | return; // p1 inputs select screen OK |
| 286 | 305 | |
| 287 | 306 | case 0x18a: |
| 288 | dblwings_18a_data = data; | |
| 289 | switch(dblwings_18a_data) | |
| 307 | state->_18a_data = data; | |
| 308 | switch (state->_18a_data) | |
| 290 | 309 | { |
| 291 | case 0x6b94: boss_5_data = 0x10; break; //initialize | |
| 292 | case 0x7c68: boss_5_data = 0x60; break; //go up | |
| 293 | case 0xfb1d: boss_5_data = 0x50; break; | |
| 294 | case 0x977c: boss_5_data = 0x50; break; | |
| 295 | case 0x8a49: boss_5_data = 0x60; break; | |
| 310 | case 0x6b94: state->boss_5_data = 0x10; break; //initialize | |
| 311 | case 0x7c68: state->boss_5_data = 0x60; break; //go up | |
| 312 | case 0xfb1d: state->boss_5_data = 0x50; break; | |
| 313 | case 0x977c: state->boss_5_data = 0x50; break; | |
| 314 | case 0x8a49: state->boss_5_data = 0x60; break; | |
| 296 | 315 | } |
| 297 | 316 | return; |
| 298 | 317 | case 0x200: |
| 299 | dblwings_200_data = data; | |
| 300 | switch(dblwings_200_data) | |
| 318 | state->_200_data = data; | |
| 319 | switch (state->_200_data) | |
| 301 | 320 | { |
| 302 | case 0x5a19: boss_move = 1; break; | |
| 303 | case 0x3b28: boss_move = 2; break; | |
| 304 | case 0x1d4d: boss_move = 1; break; | |
| 321 | case 0x5a19: state->boss_move = 1; break; | |
| 322 | case 0x3b28: state->boss_move = 2; break; | |
| 323 | case 0x1d4d: state->boss_move = 1; break; | |
| 305 | 324 | } |
| 306 | //popmessage("%04x", | |
| 325 | //popmessage("%04x", | |
| 307 | 326 | return; |
| 308 | 327 | case 0x280: |
| 309 | dblwings_280_data = data; | |
| 310 | switch(dblwings_280_data) | |
| 328 | state->_280_data = data; | |
| 329 | switch (state->_280_data) | |
| 311 | 330 | { |
| 312 | case 0x6b94: boss_5sx_data = 0x10; break; | |
| 313 | case 0x7519: boss_5sx_data = 0x60; break; | |
| 314 | case 0xfc68: boss_5sx_data = 0x50; break; | |
| 315 | case 0x02dd: boss_5sx_data = 0x50; break; | |
| 316 | case 0x613c: boss_5sx_data = 0x50; break; | |
| 331 | case 0x6b94: state->boss_5sx_data = 0x10; break; | |
| 332 | case 0x7519: state->boss_5sx_data = 0x60; break; | |
| 333 | case 0xfc68: state->boss_5sx_data = 0x50; break; | |
| 334 | case 0x02dd: state->boss_5sx_data = 0x50; break; | |
| 335 | case 0x613c: state->boss_5sx_data = 0x50; break; | |
| 317 | 336 | } |
| 318 | //printf("%04x\n", | |
| 337 | //printf("%04x\n", | |
| 319 | 338 | return; |
| 320 | 339 | case 0x380: // sound write |
| 321 | 340 | soundlatch_w(space, 0, data & 0xff); |
| 322 | dblewing_sound_irq |= 0x02; | |
| 323 | cputag_set_input_line(space->machine, "audiocpu", 0, (dblewing_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | state->sound_irq |= 0x02; | |
| 342 | cpu_set_input_line(state->audiocpu, 0, (state->sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 324 | 343 | return; |
| 325 | 344 | case 0x384: |
| 326 | dblwings_384_data = data; | |
| 327 | switch(dblwings_384_data) | |
| 345 | state->_384_data = data; | |
| 346 | switch(state->_384_data) | |
| 328 | 347 | { |
| 329 | case 0xaa41: boss_6_data = 1; break; | |
| 330 | case 0x5a97: boss_6_data = 2; break; | |
| 331 | case 0xbac5: boss_6_data = 3; break; | |
| 332 | case 0x0afb: boss_6_data = 4; break; | |
| 333 | case 0x6a99: boss_6_data = 5; break; | |
| 334 | case 0xda8f: boss_6_data = 6; break; | |
| 348 | case 0xaa41: state->boss_6_data = 1; break; | |
| 349 | case 0x5a97: state->boss_6_data = 2; break; | |
| 350 | case 0xbac5: state->boss_6_data = 3; break; | |
| 351 | case 0x0afb: state->boss_6_data = 4; break; | |
| 352 | case 0x6a99: state->boss_6_data = 5; break; | |
| 353 | case 0xda8f: state->boss_6_data = 6; break; | |
| 335 | 354 | } |
| 336 | 355 | return; |
| 337 | 356 | case 0x38e: |
| 338 | dblwings_38e_data = data; | |
| 339 | switch(dblwings_38e_data) | |
| 357 | state->_38e_data = data; | |
| 358 | switch(state->_38e_data) | |
| 340 | 359 | { |
| 341 | case 0x6c13: boss_shoot_type = 3; break; | |
| 342 | case 0xc311: boss_shoot_type = 0; break; | |
| 343 | case 0x1593: boss_shoot_type = 1; break; | |
| 344 | case 0xf9db: boss_shoot_type = 2; break; | |
| 345 | case 0xf742: boss_shoot_type = 3; break; | |
| 360 | case 0x6c13: state->boss_shoot_type = 3; break; | |
| 361 | case 0xc311: state->boss_shoot_type = 0; break; | |
| 362 | case 0x1593: state->boss_shoot_type = 1; break; | |
| 363 | case 0xf9db: state->boss_shoot_type = 2; break; | |
| 364 | case 0xf742: state->boss_shoot_type = 3; break; | |
| 346 | 365 | |
| 347 | case 0xeff5: boss_move = 1; break; | |
| 348 | case 0xd2f1: boss_move = 2; break; | |
| 349 | //default: printf("%04x\n",dblwings_38e_data); break; | |
| 350 | //case 0xe65a: boss_shoot_type = 0; break; | |
| 366 | case 0xeff5: state->boss_move = 1; break; | |
| 367 | case 0xd2f1: state->boss_move = 2; break; | |
| 368 | //default: printf("%04x\n",state->_38e_data); break; | |
| 369 | //case 0xe65a: state->boss_shoot_type = 0; break; | |
| 351 | 370 | } |
| 352 | 371 | return; |
| 353 | 372 | case 0x58c: // 3rd player 1st level |
| 354 | dblwings_58c_data = data; | |
| 355 | if(dblwings_58c_data == 0) { boss_move = 5; } | |
| 356 | else { boss_move = 2; } | |
| 373 | state->_58c_data = data; | |
| 374 | if(state->_58c_data == 0) { state->boss_move = 5; } | |
| 375 | else { state->boss_move = 2; } | |
| 357 | 376 | |
| 358 | 377 | return; |
| 359 | 378 | case 0x60a: |
| 360 | dblwings_60a_data = data; | |
| 361 | if(dblwings_60a_data & 0x8000) { boss_3_data = 2; } | |
| 362 | else { boss_3_data = 9; } | |
| 379 | state->_60a_data = data; | |
| 380 | if(state->_60a_data & 0x8000) { state->boss_3_data = 2; } | |
| 381 | else { state->boss_3_data = 9; } | |
| 363 | 382 | |
| 364 | 383 | return; |
| 365 | 384 | case 0x580: |
| 366 | | |
| 385 | | |
| 367 | 386 | return; |
| 368 | 387 | case 0x406: |
| 369 | | |
| 388 | | |
| 370 | 389 | return; // p2 inputs select screen OK |
| 371 | 390 | } |
| 372 | 391 | |
| 373 | // printf("dblewing prot w %08x, %04x, %04x %04x\n",cpu_get_pc(space->cpu), offset*2, mem_mask,data); | |
| 392 | // printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask, data); | |
| 374 | 393 | |
| 375 | if ((offset*2)==0x008) { dblwings_008_data = data; return; } | |
| 376 | if ((offset*2)==0x080) { dblwings_080_data = data; return; } // p3 3rd boss? | |
| 377 | if ((offset*2)==0x28c) { dblwings_28c_data = data; return; } | |
| 378 | if ((offset*2)==0x408) { dblwings_408_data = data; return; } // 3rd player 1st level? | |
| 379 | if ((offset*2)==0x40e) { dblwings_40e_data = data; return; } // 3rd player 2nd level? | |
| 380 | if ((offset*2)==0x608) { dblwings_608_data = data; return; } | |
| 381 | if ((offset*2)==0x70c) { dblwings_70c_data = data; return; } | |
| 382 | if ((offset*2)==0x78a) { dblwings_78a_data = data; return; } | |
| 383 | if ((offset*2)==0x788) { dblwings_788_data = data; return; } | |
| 394 | if ((offset * 2) == 0x008) { state->_008_data = data; return; } | |
| 395 | if ((offset * 2) == 0x080) { state->_080_data = data; return; } // p3 3rd boss? | |
| 396 | if ((offset * 2) == 0x28c) { state->_28c_data = data; return; } | |
| 397 | if ((offset * 2) == 0x408) { state->_408_data = data; return; } // 3rd player 1st level? | |
| 398 | if ((offset * 2) == 0x40e) { state->_40e_data = data; return; } // 3rd player 2nd level? | |
| 399 | if ((offset * 2) == 0x608) { state->_608_data = data; return; } | |
| 400 | if ((offset * 2) == 0x70c) { state->_70c_data = data; return; } | |
| 401 | if ((offset * 2) == 0x78a) { state->_78a_data = data; return; } | |
| 402 | if ((offset * 2) == 0x788) { state->_788_data = data; return; } | |
| 384 | 403 | } |
| 385 | 404 | |
| 386 | 405 | static ADDRESS_MAP_START( dblewing_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 387 | 406 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 388 | 407 | |
| 389 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 390 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 391 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 392 | AM_RANGE(0x106000, 0x106fff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 408 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 409 | AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 410 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_BASE_MEMBER(dblewing_state, pf1_rowscroll) | |
| 411 | AM_RANGE(0x106000, 0x106fff) AM_RAM AM_BASE_MEMBER(dblewing_state, pf2_rowscroll) | |
| 393 | 412 | |
| 394 | 413 | /* protection */ |
| 395 | 414 | // AM_RANGE(0x280104, 0x280105) AM_WRITENOP // ?? |
| 396 | 415 | // AM_RANGE(0x2800ac, 0x2800ad) AM_READ_PORT("DSW") // dips |
| 397 | 416 | // AM_RANGE(0x280298, 0x280299) AM_READ_PORT("SYSTEM") // vbl |
| 398 | 417 | // AM_RANGE(0x280506, 0x280507) AM_READ_PORT("UNK") |
| 399 | // AM_RANGE(0x2802 | |
| 418 | // AM_RANGE(0x2802b4, 0x2802b5) AM_READ_PORT("P1_P2") // inverted? | |
| 400 | 419 | // AM_RANGE(0x280330, 0x280331) AM_READNOP // sound? |
| 401 | 420 | // AM_RANGE(0x280380, 0x280381) AM_WRITENOP // sound |
| 402 | 421 | |
| 403 | AM_RANGE(0x280000, 0x2807ff) AM_READWRITE(d | |
| 422 | AM_RANGE(0x280000, 0x2807ff) AM_READWRITE(d | |
| 404 | 423 | |
| 405 | 424 | |
| 406 | 425 | AM_RANGE(0x284000, 0x284001) AM_RAM |
| 407 | 426 | AM_RANGE(0x288000, 0x288001) AM_RAM |
| 408 | AM_RANGE(0x28C000, 0x28C00f) AM_RAM AM_BASE(&deco16_pf12_control) | |
| 409 | AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 427 | AM_RANGE(0x28c000, 0x28c00f) AM_RAM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 428 | AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_BASE_SIZE_MEMBER(dblewing_state, spriteram, spriteram_size) | |
| 410 | 429 | AM_RANGE(0x320000, 0x3207ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 411 | 430 | AM_RANGE(0xff0000, 0xff3fff) AM_MIRROR(0xc000) AM_RAM |
| 412 | 431 | ADDRESS_MAP_END |
| 413 | 432 | |
| 414 | 433 | static READ8_HANDLER(irq_latch_r) |
| 415 | 434 | { |
| 435 | dblewing_state *state = (dblewing_state *)space->machine->driver_data; | |
| 436 | ||
| 416 | 437 | /* bit 1 of dblewing_sound_irq specifies IRQ command writes */ |
| 417 | dblewing_sound_irq &= ~0x02; | |
| 418 | cputag_set_input_line(space->machine, "audiocpu", 0, (dblewing_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 419 | return dblewing_sound_irq; | |
| 438 | state->sound_irq &= ~0x02; | |
| 439 | cpu_set_input_line(state->audiocpu, 0, (state->sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 440 | return state->sound_irq; | |
| 420 | 441 | } |
| 421 | 442 | |
| 422 | 443 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r7500 | r7501 | |
| 601 | 622 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 602 | 623 | INPUT_PORTS_END |
| 603 | 624 | |
| 604 | static void sound_irq(running_device *device, int state) | |
| 625 | static void sound_irq( running_device *device, int state ) | |
| 605 | 626 | { |
| 627 | dblewing_state *driver_state = (dblewing_state *)device->machine->driver_data; | |
| 628 | ||
| 606 | 629 | /* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */ |
| 607 | 630 | if (state) |
| 608 | d | |
| 631 | dr | |
| 609 | 632 | else |
| 610 | dblewing_sound_irq &= ~0x01; | |
| 611 | cputag_set_input_line(device->machine, "audiocpu", 0, (dblewing_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 633 | driver_state->sound_irq &= ~0x01; | |
| 634 | cpu_set_input_line(driver_state->audiocpu, 0, (driver_state->sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 612 | 635 | } |
| 613 | 636 | |
| 614 | 637 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 616 | 639 | sound_irq |
| 617 | 640 | }; |
| 618 | 641 | |
| 642 | static int dblewing_bank_callback( const int bank ) | |
| 643 | { | |
| 644 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 645 | } | |
| 646 | ||
| 647 | static const deco16ic_interface dblewing_deco16ic_intf = | |
| 648 | { | |
| 649 | "screen", | |
| 650 | 1, 0, 1, | |
| 651 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 652 | 0, 16, 0, 16, /* color base (default values) */ | |
| 653 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 654 | dblewing_bank_callback, | |
| 655 | dblewing_bank_callback, | |
| 656 | NULL, | |
| 657 | NULL | |
| 658 | }; | |
| 659 | ||
| 660 | static MACHINE_START( dblewing ) | |
| 661 | { | |
| 662 | dblewing_state *state = (dblewing_state *)machine->driver_data; | |
| 663 | ||
| 664 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 665 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 666 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 667 | ||
| 668 | state_save_register_global(machine, state->_008_data); | |
| 669 | state_save_register_global(machine, state->_104_data); | |
| 670 | state_save_register_global(machine, state->_406_data); | |
| 671 | state_save_register_global(machine, state->_608_data); | |
| 672 | state_save_register_global(machine, state->_70c_data); | |
| 673 | state_save_register_global(machine, state->_78a_data); | |
| 674 | state_save_register_global(machine, state->_088_data); | |
| 675 | state_save_register_global(machine, state->_58c_data); | |
| 676 | state_save_register_global(machine, state->_408_data); | |
| 677 | state_save_register_global(machine, state->_40e_data); | |
| 678 | state_save_register_global(machine, state->_080_data); | |
| 679 | state_save_register_global(machine, state->_788_data); | |
| 680 | state_save_register_global(machine, state->_38e_data); | |
| 681 | state_save_register_global(machine, state->_580_data); | |
| 682 | state_save_register_global(machine, state->_60a_data); | |
| 683 | state_save_register_global(machine, state->_200_data); | |
| 684 | state_save_register_global(machine, state->_28c_data); | |
| 685 | state_save_register_global(machine, state->_18a_data); | |
| 686 | state_save_register_global(machine, state->_280_data); | |
| 687 | state_save_register_global(machine, state->_384_data); | |
| 688 | ||
| 689 | state_save_register_global(machine, state->boss_move); | |
| 690 | state_save_register_global(machine, state->boss_shoot_type); | |
| 691 | state_save_register_global(machine, state->boss_3_data); | |
| 692 | state_save_register_global(machine, state->boss_4_data); | |
| 693 | state_save_register_global(machine, state->boss_5_data); | |
| 694 | state_save_register_global(machine, state->boss_5sx_data); | |
| 695 | state_save_register_global(machine, state->boss_6_data); | |
| 696 | state_save_register_global(machine, state->sound_irq); | |
| 697 | } | |
| 698 | ||
| 699 | static MACHINE_RESET( dblewing ) | |
| 700 | { | |
| 701 | dblewing_state *state = (dblewing_state *)machine->driver_data; | |
| 702 | ||
| 703 | state->_008_data = 0; | |
| 704 | state->_104_data = 0; | |
| 705 | state->_406_data = 0; | |
| 706 | state->_608_data = 0; | |
| 707 | state->_70c_data = 0; | |
| 708 | state->_78a_data = 0; | |
| 709 | state->_088_data = 0; | |
| 710 | state->_58c_data = 0; | |
| 711 | state->_408_data = 0; | |
| 712 | state->_40e_data = 0; | |
| 713 | state->_080_data = 0; | |
| 714 | state->_788_data = 0; | |
| 715 | state->_38e_data = 0; | |
| 716 | state->_580_data = 0; | |
| 717 | state->_60a_data = 0; | |
| 718 | state->_200_data = 0; | |
| 719 | state->_28c_data = 0; | |
| 720 | state->_18a_data = 0; | |
| 721 | state->_280_data = 0; | |
| 722 | state->_384_data = 0; | |
| 723 | ||
| 724 | state->boss_move = 0; | |
| 725 | state->boss_shoot_type = 0; | |
| 726 | state->boss_3_data = 0; | |
| 727 | state->boss_4_data = 0; | |
| 728 | state->boss_5_data = 0; | |
| 729 | state->boss_5sx_data = 0; | |
| 730 | state->boss_6_data = 0; | |
| 731 | state->sound_irq = 0; | |
| 732 | } | |
| 733 | ||
| 619 | 734 | static MACHINE_DRIVER_START( dblewing ) |
| 735 | ||
| 736 | /* driver data */ | |
| 737 | MDRV_DRIVER_DATA(dblewing_state) | |
| 738 | ||
| 620 | 739 | /* basic machine hardware */ |
| 621 | 740 | MDRV_CPU_ADD("maincpu", M68000, 14000000) /* DE102 */ |
| 622 | 741 | MDRV_CPU_PROGRAM_MAP(dblewing_map) |
| r7500 | r7501 | |
| 628 | 747 | |
| 629 | 748 | MDRV_QUANTUM_TIME(HZ(6000)) |
| 630 | 749 | |
| 750 | MDRV_MACHINE_START(dblewing) | |
| 751 | MDRV_MACHINE_RESET(dblewing) | |
| 752 | ||
| 631 | 753 | /* video hardware */ |
| 632 | 754 | MDRV_SCREEN_ADD("screen", RASTER) |
| 633 | 755 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 639 | 761 | MDRV_PALETTE_LENGTH(4096) |
| 640 | 762 | MDRV_GFXDECODE(dblewing) |
| 641 | 763 | |
| 642 | MDRV_VIDEO_START(dblewing) | |
| 643 | 764 | MDRV_VIDEO_UPDATE(dblewing) |
| 644 | 765 | |
| 766 | MDRV_DECO16IC_ADD("deco_custom", dblewing_deco16ic_intf) | |
| 767 | ||
| 645 | 768 | /* sound hardware */ |
| 646 | 769 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 647 | 770 | |
| r7500 | r7501 | |
| 732 | 855 | } |
| 733 | 856 | |
| 734 | 857 | |
| 735 | GAME( 1993, dblewing, 0, | |
| 858 | GAME( 1993, dblewing, 0, |
| r7500 | r7501 | |
|---|---|---|
| 87 | 87 | #include "sound/ay8910.h" |
| 88 | 88 | #include "video/resnet.h" |
| 89 | 89 | |
| 90 | typedef struct _shougi_state shougi_state; | |
| 91 | struct _shougi_state | |
| 90 | class shougi_state | |
| 92 | 91 | { |
| 92 | public: | |
| 93 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, shougi_state(machine)); } | |
| 94 | ||
| 95 | shougi_state(running_machine &machine) { } | |
| 96 | ||
| 93 | 97 | UINT8 *videoram; |
| 94 | 98 | int nmi_enabled; |
| 95 | 99 | //UINT8 *cpu_sharedram; |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | typedef struct _discoboy_state discoboy_state; | |
| 47 | struct _discoboy_state | |
| 46 | class discoboy_state | |
| 48 | 47 | { |
| 48 | public: | |
| 49 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, discoboy_state(machine)); } | |
| 50 | ||
| 51 | discoboy_state(running_machine &machine) { } | |
| 52 | ||
| 49 | 53 | /* memory pointers */ |
| 50 | 54 | UINT8 * ram_1; |
| 51 | 55 | UINT8 * ram_2; |
| r7500 | r7501 | |
|---|---|---|
| 1004 | 1004 | |
| 1005 | 1005 | static const struct pic8259_interface mediagx_pic8259_2_config = |
| 1006 | 1006 | { |
| 1007 | DEVCB_DEVICE_LINE("pic8259_ | |
| 1007 | DEVCB_DEVICE_LINE("pic8259_master", pic8259_ir2_w) | |
| 1008 | 1008 | }; |
| 1009 | 1009 | |
| 1010 | 1010 |
| r7500 | r7501 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | #define MASTER_CLOCK XTAL_12_096MHz |
| 27 | 27 | |
| 28 | ||
| 29 | static UINT8 orbit_misc_flags; | |
| 30 | ||
| 31 | ||
| 32 | ||
| 33 | 28 | /************************************* |
| 34 | 29 | * |
| 35 | 30 | * Interrupts and timing |
| r7500 | r7501 | |
| 38 | 33 | |
| 39 | 34 | static TIMER_DEVICE_CALLBACK( nmi_32v ) |
| 40 | 35 | { |
| 36 | orbit_state *state = (orbit_state *)timer->machine->driver_data; | |
| 41 | 37 | int scanline = param; |
| 42 | int nmistate = (scanline & 32) && (orbit_misc_flags & 4); | |
| 43 | cputag_set_input_line(timer->machine, "maincpu", INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | int nmistate = (scanline & 32) && (state->misc_flags & 4); | |
| 39 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE); | |
| 44 | 40 | } |
| 45 | 41 | |
| 46 | 42 | |
| 47 | 43 | static TIMER_CALLBACK( irq_off ) |
| 48 | 44 | { |
| 49 | cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); | |
| 45 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 46 | cpu_set_input_line(state->maincpu, 0, CLEAR_LINE); | |
| 50 | 47 | } |
| 51 | 48 | |
| 52 | 49 | |
| r7500 | r7501 | |
| 66 | 63 | |
| 67 | 64 | static void update_misc_flags(running_machine *machine, UINT8 val) |
| 68 | 65 | { |
| 69 | r | |
| 66 | orb | |
| 70 | 67 | |
| 71 | | |
| 68 | s | |
| 72 | 69 | |
| 73 | 70 | /* BIT0 => UNUSED */ |
| 74 | 71 | /* BIT1 => LOCKOUT */ |
| r7500 | r7501 | |
| 79 | 76 | /* BIT6 => HYPER LED */ |
| 80 | 77 | /* BIT7 => WARNING SND */ |
| 81 | 78 | |
| 82 | discrete_sound_w(discrete, ORBIT_WARNING_EN, | |
| 79 | discrete_sound_w(state->discrete, ORBIT_WARNING_EN, BIT(state->misc_flags, 7) | |
| 83 | 80 | |
| 84 | set_led_status(machine, 0, orbit_misc_flags & 0x08); | |
| 85 | set_led_status(machine, 1, orbit_misc_flags & 0x40); | |
| 81 | set_led_status(machine, 0, BIT(state->misc_flags, 3)); | |
| 82 | set_led_status(machine, 1, BIT(state->misc_flags, 6)); | |
| 86 | 83 | |
| 87 | coin_lockout_w(machine, 0, !(orbit_misc_flags & 0x02)); | |
| 88 | coin_lockout_w(machine, 1, !(orbit_misc_flags & 0x02)); | |
| 84 | coin_lockout_w(machine, 0, !BIT(state->misc_flags, 1)); | |
| 85 | coin_lockout_w(machine, 1, !BIT(state->misc_flags, 1)); | |
| 89 | 86 | } |
| 90 | 87 | |
| 91 | 88 | |
| 92 | 89 | static WRITE8_HANDLER( orbit_misc_w ) |
| 93 | 90 | { |
| 91 | orbit_state *state = (orbit_state *)space->machine->driver_data; | |
| 94 | 92 | UINT8 bit = offset >> 1; |
| 95 | 93 | |
| 96 | 94 | if (offset & 1) |
| 97 | update_misc_flags(space->machine, | |
| 95 | update_misc_flags(space->machine, s | |
| 98 | 96 | else |
| 99 | update_misc_flags(space->machine, | |
| 97 | update_misc_flags(space->machine, s | |
| 100 | 98 | } |
| 101 | 99 | |
| 102 | 100 | |
| 103 | 101 | |
| 104 | 102 | /************************************* |
| 105 | 103 | * |
| 106 | * Machine setup | |
| 107 | * | |
| 108 | *************************************/ | |
| 109 | ||
| 110 | static MACHINE_RESET( orbit ) | |
| 111 | { | |
| 112 | update_misc_flags(machine, 0); | |
| 113 | } | |
| 114 | ||
| 115 | ||
| 116 | ||
| 117 | /************************************* | |
| 118 | * | |
| 119 | 104 | * Address maps |
| 120 | 105 | * |
| 121 | 106 | *************************************/ |
| r7500 | r7501 | |
| 128 | 113 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x07ff) AM_READ_PORT("DSW1") |
| 129 | 114 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x07ff) AM_READ_PORT("DSW2") |
| 130 | 115 | AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x07ff) AM_READ_PORT("BUTTONS") |
| 131 | AM_RANGE(0x3000, 0x33bf) AM_MIRROR(0x0400) AM_RAM_WRITE(orbit_playfield_w) AM_BASE(&orbit_playfield_ram) | |
| 132 | AM_RANGE(0x33c0, 0x33ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&orbit_sprite_ram) | |
| 116 | AM_RANGE(0x3000, 0x33bf) AM_MIRROR(0x0400) AM_RAM_WRITE(orbit_playfield_w) AM_BASE_MEMBER(orbit_state, playfield_ram) | |
| 117 | AM_RANGE(0x33c0, 0x33ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(orbit_state, sprite_ram) | |
| 133 | 118 | AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x00ff) AM_DEVWRITE("discrete", orbit_note_w) |
| 134 | 119 | AM_RANGE(0x3900, 0x3900) AM_MIRROR(0x00ff) AM_DEVWRITE("discrete", orbit_noise_amp_w) |
| 135 | 120 | AM_RANGE(0x3a00, 0x3a00) AM_MIRROR(0x00ff) AM_DEVWRITE("discrete", orbit_note_amp_w) |
| r7500 | r7501 | |
| 283 | 268 | |
| 284 | 269 | /************************************* |
| 285 | 270 | * |
| 271 | * Machine setup | |
| 272 | * | |
| 273 | *************************************/ | |
| 274 | ||
| 275 | static MACHINE_START( orbit ) | |
| 276 | { | |
| 277 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 278 | ||
| 279 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 280 | state->discrete = devtag_get_device(machine, "discrete"); | |
| 281 | ||
| 282 | state_save_register_global(machine, state->misc_flags); | |
| 283 | state_save_register_global(machine, state->flip_screen); | |
| 284 | } | |
| 285 | ||
| 286 | static MACHINE_RESET( orbit ) | |
| 287 | { | |
| 288 | orbit_state *state = (orbit_state *)machine->driver_data; | |
| 289 | ||
| 290 | update_misc_flags(machine, 0); | |
| 291 | state->flip_screen = 0; | |
| 292 | } | |
| 293 | ||
| 294 | ||
| 295 | /************************************* | |
| 296 | * | |
| 286 | 297 | * Machine drivers |
| 287 | 298 | * |
| 288 | 299 | *************************************/ |
| 289 | 300 | |
| 290 | 301 | static MACHINE_DRIVER_START( orbit ) |
| 291 | 302 | |
| 303 | /* driver data */ | |
| 304 | MDRV_DRIVER_DATA(orbit_state) | |
| 305 | ||
| 292 | 306 | /* basic machine hardware */ |
| 293 | 307 | MDRV_CPU_ADD("maincpu", M6800, MASTER_CLOCK / 16) |
| 294 | 308 | MDRV_CPU_PROGRAM_MAP(orbit_map) |
| r7500 | r7501 | |
| 296 | 310 | |
| 297 | 311 | MDRV_TIMER_ADD_SCANLINE("32v", nmi_32v, "screen", 0, 32) |
| 298 | 312 | |
| 313 | MDRV_MACHINE_START(orbit) | |
| 299 | 314 | MDRV_MACHINE_RESET(orbit) |
| 300 | 315 | |
| 301 | 316 | /* video hardware */ |
| r7500 | r7501 | |
| 362 | 377 | * |
| 363 | 378 | *************************************/ |
| 364 | 379 | |
| 365 | GAME( 1978, orbit, 0, orbit, orbit, 0, 0, "Atari", "Orbit", | |
| 380 | GAME( 1978, orbit, 0, orbit, orbit, 0, 0, "Atari", "Orbit", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 42 | 42 | #include "cpu/m68000/m68000.h" |
| 43 | 43 | #include "sound/okim6295.h" |
| 44 | 44 | |
| 45 | #define MASTER_CLOCK XTAL_12MHz | |
| 46 | #define SOUND_CLOCK XTAL_45MHz | |
| 45 | #define MASTER_CLOCK XTAL_12MHz | |
| 46 | #define SOUND_CLOCK XTAL_45MHz | |
| 47 | 47 | |
| 48 | static tilemap_t *bg_tilemap, *mlow_tilemap, *mhigh_tilemap, *tx_tilemap; | |
| 49 | static UINT16 *bg_videoram, *mlow_videoram, *mhigh_videoram, *tx_videoram, *sprites_buffer; | |
| 50 | static UINT16 *bg_scrollram, *mlow_scrollram, *mhigh_scrollram, *vidattrram; | |
| 51 | static UINT16 *mwarr_ram; | |
| 52 | 48 | |
| 49 | class mwarr_state | |
| 50 | { | |
| 51 | public: | |
| 52 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mwarr_state(machine)); } | |
| 53 | ||
| 54 | mwarr_state(running_machine &machine) { } | |
| 55 | ||
| 56 | /* memory pointers */ | |
| 57 | UINT16 *bg_videoram, *mlow_videoram, *mhigh_videoram, *tx_videoram, *sprites_buffer; | |
| 58 | UINT16 *bg_scrollram, *mlow_scrollram, *mhigh_scrollram, *vidattrram; | |
| 59 | UINT16 *spriteram; | |
| 60 | // UINT16 *paletteram; // currently this uses generic palette handling | |
| 61 | UINT16 *mwarr_ram; | |
| 62 | ||
| 63 | /* video-related */ | |
| 64 | tilemap_t *bg_tilemap, *mlow_tilemap, *mhigh_tilemap, *tx_tilemap; | |
| 65 | ||
| 66 | /* misc */ | |
| 67 | int which; | |
| 68 | }; | |
| 69 | ||
| 70 | ||
| 71 | /************************************* | |
| 72 | * | |
| 73 | * Memory handlers | |
| 74 | * | |
| 75 | *************************************/ | |
| 76 | ||
| 53 | 77 | static WRITE16_HANDLER( bg_videoram_w ) |
| 54 | 78 | { |
| 55 | COMBINE_DATA(&bg_videoram[offset]); | |
| 56 | tilemap_mark_tile_dirty(bg_tilemap,offset); | |
| 79 | mwarr_state *state = (mwarr_state *)space->machine->driver_data; | |
| 80 | ||
| 81 | COMBINE_DATA(&state->bg_videoram[offset]); | |
| 82 | tilemap_mark_tile_dirty(state->bg_tilemap,offset); | |
| 57 | 83 | } |
| 58 | 84 | |
| 59 | 85 | static WRITE16_HANDLER( mlow_videoram_w ) |
| 60 | 86 | { |
| 61 | COMBINE_DATA(&mlow_videoram[offset]); | |
| 62 | tilemap_mark_tile_dirty(mlow_tilemap,offset); | |
| 87 | mwarr_state *state = (mwarr_state *)space->machine->driver_data; | |
| 88 | ||
| 89 | COMBINE_DATA(&state->mlow_videoram[offset]); | |
| 90 | tilemap_mark_tile_dirty(state->mlow_tilemap,offset); | |
| 63 | 91 | } |
| 64 | 92 | |
| 65 | 93 | static WRITE16_HANDLER( mhigh_videoram_w ) |
| 66 | 94 | { |
| 67 | COMBINE_DATA(&mhigh_videoram[offset]); | |
| 68 | tilemap_mark_tile_dirty(mhigh_tilemap,offset); | |
| 95 | mwarr_state *state = (mwarr_state *)space->machine->driver_data; | |
| 96 | ||
| 97 | COMBINE_DATA(&state->mhigh_videoram[offset]); | |
| 98 | tilemap_mark_tile_dirty(state->mhigh_tilemap,offset); | |
| 69 | 99 | } |
| 70 | 100 | |
| 71 | 101 | static WRITE16_HANDLER( tx_videoram_w ) |
| 72 | 102 | { |
| 73 | COMBINE_DATA(&tx_videoram[offset]); | |
| 74 | tilemap_mark_tile_dirty(tx_tilemap,offset); | |
| 103 | mwarr_state *state = (mwarr_state *)space->machine->driver_data; | |
| 104 | ||
| 105 | COMBINE_DATA(&state->tx_videoram[offset]); | |
| 106 | tilemap_mark_tile_dirty(state->tx_tilemap,offset); | |
| 75 | 107 | } |
| 76 | 108 | |
| 77 | 109 | static WRITE16_DEVICE_HANDLER( oki1_bank_w ) |
| r7500 | r7501 | |
| 81 | 113 | |
| 82 | 114 | static WRITE16_HANDLER( sprites_commands_w ) |
| 83 | 115 | { |
| 84 | stat | |
| 116 | mwarr_state | |
| 85 | 117 | |
| 86 | if | |
| 118 | if | |
| 87 | 119 | { |
| 88 | 120 | int i; |
| 89 | 121 | |
| 90 | switch(data) | |
| 122 | switch (data) | |
| 91 | 123 | { |
| 92 | 124 | case 0: |
| 93 | 125 | /* clear sprites on screen */ |
| 94 | for | |
| 126 | for | |
| 95 | 127 | { |
| 96 | sprites_buffer[i] = 0; | |
| 128 | state->sprites_buffer[i] = 0; | |
| 97 | 129 | } |
| 98 | which = 0; | |
| 130 | state->which = 0; | |
| 99 | 131 | break; |
| 100 | 132 | |
| 101 | 133 | default: |
| 102 | 134 | logerror("used unknown sprites command %02X\n",data); |
| 103 | 135 | case 0xf: |
| 104 | 136 | /* refresh sprites on screen */ |
| 105 | for | |
| 137 | for | |
| 106 | 138 | { |
| 107 | sprites_buffer[i] = s | |
| 139 | state->sprites_buffer[i] = state-> | |
| 108 | 140 | } |
| 109 | 141 | break; |
| 110 | 142 | |
| r7500 | r7501 | |
| 114 | 146 | } |
| 115 | 147 | } |
| 116 | 148 | |
| 117 | which ^= 1; | |
| 149 | state->which ^= 1; | |
| 118 | 150 | } |
| 119 | 151 | |
| 120 | 152 | static WRITE16_HANDLER( mwarr_brightness_w ) |
| 121 | 153 | { |
| 154 | mwarr_state *state = (mwarr_state *)space->machine->driver_data; | |
| 122 | 155 | int i; |
| 123 | 156 | double brightness; |
| 124 | 157 | |
| 125 | COMBINE_DATA(&mwarr_ram[0x14/2]); | |
| 158 | COMBINE_DATA(&state->mwarr_ram[0x14 / 2]); | |
| 126 | 159 | |
| 127 | 160 | brightness = (double)(data & 0xff); |
| 128 | for (i=0;i<0x800;i++) | |
| 161 | for (i = 0; i < 0x800; i++) | |
| 129 | 162 | { |
| 130 | 163 | palette_set_pen_contrast(space->machine, i, brightness/255); |
| 131 | 164 | } |
| 132 | 165 | } |
| 133 | 166 | |
| 134 | 167 | |
| 168 | /************************************* | |
| 169 | * | |
| 170 | * Address maps | |
| 171 | * | |
| 172 | *************************************/ | |
| 173 | ||
| 135 | 174 | static ADDRESS_MAP_START( mwarr_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 136 | 175 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 137 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 138 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(mlow_videoram_w) AM_BASE(&mlow_videoram) | |
| 139 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(mhigh_videoram_w) AM_BASE(&mhigh_videoram) | |
| 140 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(tx_videoram_w) AM_BASE(&tx_videoram) | |
| 141 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_BASE(&bg_scrollram) | |
| 142 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE(&mlow_scrollram) | |
| 143 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE(&mhigh_scrollram) | |
| 144 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE(&vidattrram) | |
| 176 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(bg_videoram_w) AM_BASE_MEMBER(mwarr_state, bg_videoram) | |
| 177 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(mlow_videoram_w) AM_BASE_MEMBER(mwarr_state, mlow_videoram) | |
| 178 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(mhigh_videoram_w) AM_BASE_MEMBER(mwarr_state, mhigh_videoram) | |
| 179 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(tx_videoram_w) AM_BASE_MEMBER(mwarr_state, tx_videoram) | |
| 180 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_BASE_MEMBER(mwarr_state, bg_scrollram) | |
| 181 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE_MEMBER(mwarr_state, mlow_scrollram) | |
| 182 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE_MEMBER(mwarr_state, mhigh_scrollram) | |
| 183 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE_MEMBER(mwarr_state, vidattrram) | |
| 145 | 184 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 146 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE_ | |
| 185 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE_MEMBER | |
| 147 | 186 | AM_RANGE(0x110000, 0x110001) AM_READ_PORT("P1_P2") |
| 148 | 187 | AM_RANGE(0x110002, 0x110003) AM_READ_PORT("SYSTEM") |
| 149 | 188 | AM_RANGE(0x110004, 0x110005) AM_READ_PORT("DSW") |
| 150 | 189 | AM_RANGE(0x110010, 0x110011) AM_DEVWRITE("oki2", oki1_bank_w) |
| 151 | 190 | AM_RANGE(0x110014, 0x110015) AM_WRITE(mwarr_brightness_w) |
| 152 | 191 | AM_RANGE(0x110016, 0x110017) AM_WRITE(sprites_commands_w) |
| 153 | AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_BASE( | |
| 192 | AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_BASE_MEMBER(mwarr_state, mwarr_ram) | |
| 154 | 193 | AM_RANGE(0x180000, 0x180001) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x00ff) |
| 155 | 194 | AM_RANGE(0x190000, 0x190001) AM_DEVREADWRITE8("oki2", okim6295_r, okim6295_w, 0x00ff) |
| 156 | 195 | ADDRESS_MAP_END |
| 157 | 196 | |
| 197 | ||
| 198 | /************************************* | |
| 199 | * | |
| 200 | * Input ports | |
| 201 | * | |
| 202 | *************************************/ | |
| 203 | ||
| 158 | 204 | static INPUT_PORTS_START( mwarr ) |
| 159 | 205 | PORT_START("P1_P2") |
| 160 | 206 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 229 | 275 | PORT_SERVICE_NO_TOGGLE( 0x8000, IP_ACTIVE_LOW ) |
| 230 | 276 | INPUT_PORTS_END |
| 231 | 277 | |
| 278 | /************************************* | |
| 279 | * | |
| 280 | * Graphics definitions | |
| 281 | * | |
| 282 | *************************************/ | |
| 283 | ||
| 232 | 284 | static const gfx_layout mwarr_tile8_layout = |
| 233 | 285 | { |
| 234 | 286 | 8,8, |
| r7500 | r7501 | |
| 271 | 323 | GFXDECODE_ENTRY( "gfx5", 0, mwarr_tile16_layout, 0, 8 ) |
| 272 | 324 | GFXDECODE_END |
| 273 | 325 | |
| 326 | /************************************* | |
| 327 | * | |
| 328 | * Video emulation | |
| 329 | * | |
| 330 | *************************************/ | |
| 331 | ||
| 274 | 332 | static TILE_GET_INFO( get_bg_tile_info ) |
| 275 | 333 | { |
| 276 | int tileno,colour; | |
| 334 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 335 | int tileno = state->bg_videoram[tile_index] & 0x1fff; | |
| 336 | int colour = (state->bg_videoram[tile_index] & 0xe000) >> 13; | |
| 277 | 337 | |
| 278 | tileno = bg_videoram[tile_index] & 0x1fff; | |
| 279 | colour = (bg_videoram[tile_index] & 0xe000) >> 13; | |
| 280 | ||
| 281 | SET_TILE_INFO(4,tileno,colour,0); | |
| 338 | SET_TILE_INFO(4, tileno, colour, 0); | |
| 282 | 339 | } |
| 283 | 340 | |
| 284 | 341 | static TILE_GET_INFO( get_mlow_tile_info ) |
| 285 | 342 | { |
| 286 | int tileno,colour; | |
| 343 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 344 | int tileno = state->mlow_videoram[tile_index] & 0x1fff; | |
| 345 | int colour = (state->mlow_videoram[tile_index] & 0xe000) >> 13; | |
| 287 | 346 | |
| 288 | tileno = mlow_videoram[tile_index] & 0x1fff; | |
| 289 | colour = (mlow_videoram[tile_index] & 0xe000) >> 13; | |
| 290 | ||
| 291 | SET_TILE_INFO(3,tileno,colour,0); | |
| 347 | SET_TILE_INFO(3, tileno, colour, 0); | |
| 292 | 348 | } |
| 293 | 349 | |
| 294 | 350 | static TILE_GET_INFO( get_mhigh_tile_info ) |
| 295 | 351 | { |
| 296 | int tileno,colour; | |
| 352 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 353 | int tileno = state->mhigh_videoram[tile_index] & 0x1fff; | |
| 354 | int colour = (state->mhigh_videoram[tile_index] & 0xe000) >> 13; | |
| 297 | 355 | |
| 298 | tileno = mhigh_videoram[tile_index] & 0x1fff; | |
| 299 | colour = (mhigh_videoram[tile_index] & 0xe000) >> 13; | |
| 300 | ||
| 301 | SET_TILE_INFO(2,tileno,colour,0); | |
| 356 | SET_TILE_INFO(2, tileno, colour, 0); | |
| 302 | 357 | } |
| 303 | 358 | |
| 304 | 359 | static TILE_GET_INFO( get_tx_tile_info ) |
| 305 | 360 | { |
| 306 | int tileno,colour; | |
| 361 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 362 | int tileno = state->tx_videoram[tile_index] & 0x1fff; | |
| 363 | int colour = (state->tx_videoram[tile_index] & 0xe000) >> 13; | |
| 307 | 364 | |
| 308 | tileno = tx_videoram[tile_index] & 0x1fff; | |
| 309 | colour = (tx_videoram[tile_index] & 0xe000) >> 13; | |
| 310 | ||
| 311 | SET_TILE_INFO(1,tileno,colour,0); | |
| 365 | SET_TILE_INFO(1, tileno, colour, 0); | |
| 312 | 366 | } |
| 313 | 367 | |
| 314 | 368 | static VIDEO_START( mwarr ) |
| 315 | 369 | { |
| 316 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16,64,16); | |
| 317 | mlow_tilemap = tilemap_create(machine, get_mlow_tile_info, tilemap_scan_cols, 16, 16,64,16); | |
| 318 | mhigh_tilemap = tilemap_create(machine, get_mhigh_tile_info,tilemap_scan_cols, 16, 16,64,16); | |
| 319 | tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8,64,32); | |
| 370 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 320 | 371 | |
| 321 | sprites_buffer = auto_alloc_array(machine, UINT16, 0x800); | |
| 372 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 16); | |
| 373 | state->mlow_tilemap = tilemap_create(machine, get_mlow_tile_info, tilemap_scan_cols, 16, 16, 64, 16); | |
| 374 | state->mhigh_tilemap = tilemap_create(machine, get_mhigh_tile_info, tilemap_scan_cols, 16, 16, 64, 16); | |
| 375 | state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 322 | 376 | |
| 323 | tilemap_set_transparent_pen(mlow_tilemap,0); | |
| 324 | tilemap_set_transparent_pen(mhigh_tilemap,0); | |
| 325 | tilemap_set_transparent_pen(tx_tilemap,0); | |
| 377 | state->sprites_buffer = auto_alloc_array(machine, UINT16, 0x800); | |
| 326 | 378 | |
| 327 | tilemap_set_scroll_rows(bg_tilemap, 256); | |
| 328 | tilemap_set_scroll_rows(mlow_tilemap, 256); | |
| 329 | tilemap_set_scroll_rows(mhigh_tilemap, 256); | |
| 379 | tilemap_set_transparent_pen(state->mlow_tilemap, 0); | |
| 380 | tilemap_set_transparent_pen(state->mhigh_tilemap, 0); | |
| 381 | tilemap_set_transparent_pen(state->tx_tilemap, 0); | |
| 382 | ||
| 383 | tilemap_set_scroll_rows(state->bg_tilemap, 256); | |
| 384 | tilemap_set_scroll_rows(state->mlow_tilemap, 256); | |
| 385 | tilemap_set_scroll_rows(state->mhigh_tilemap, 256); | |
| 386 | ||
| 387 | state_save_register_global_pointer(machine, state->sprites_buffer, 0x800); | |
| 330 | 388 | } |
| 331 | 389 | |
| 332 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 390 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 333 | 391 | { |
| 334 | const UINT16 *source = sprites_buffer+0x800-4; | |
| 335 | const UINT16 *finish = sprites_buffer; | |
| 392 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 393 | const UINT16 *source = state->sprites_buffer + 0x800 - 4; | |
| 394 | const UINT16 *finish = state->sprites_buffer; | |
| 336 | 395 | const gfx_element *gfx = machine->gfx[0]; |
| 337 | 396 | int x, y, color, flipx, dy, pri, pri_mask, i; |
| 338 | 397 | |
| 339 | while | |
| 398 | while | |
| 340 | 399 | { |
| 341 | 400 | /* draw sprite */ |
| 342 | if | |
| 401 | if | |
| 343 | 402 | { |
| 344 | 403 | y = 512 - (source[0] & 0x01ff); |
| 345 | 404 | x = (source[3] & 0x3ff) - 9; |
| r7500 | r7501 | |
| 347 | 406 | color = source[1] & 0x000f; |
| 348 | 407 | flipx = source[1] & 0x0200; |
| 349 | 408 | |
| 350 | dy = (source[0] & 0xf000)>>12; | |
| 409 | dy = (source[0] & 0xf000) >> 12; | |
| 351 | 410 | |
| 352 | pri = ((source[1] & 0x3c00)>>10); // Priority (1 = Low) | |
| 353 | pri_mask = ~((1 << (pri+1)) - 1); // Above the first "pri" levels | |
| 411 | pri = ((source[1] & 0x3c00) >> 10); // Priority (1 = Low) | |
| 412 | pri_mask = ~((1 << (pri + 1)) - 1); // Above the first "pri" levels | |
| 354 | 413 | |
| 355 | for(i=0;i<=dy;i++) | |
| 414 | for (i = 0; i <= dy; i++) | |
| 356 | 415 | { |
| 357 | 416 | pdrawgfx_transpen( bitmap, |
| 358 | 417 | cliprect, |
| r7500 | r7501 | |
| 401 | 460 | |
| 402 | 461 | static VIDEO_UPDATE( mwarr ) |
| 403 | 462 | { |
| 463 | mwarr_state *state = (mwarr_state *)screen->machine->driver_data; | |
| 404 | 464 | int i; |
| 405 | 465 | |
| 406 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); | |
| 466 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); | |
| 407 | 467 | |
| 408 | if(vidattrram[6] | |
| 468 | if (BIT(state->vidattrram[6], 0) | |
| 409 | 469 | { |
| 410 | for(i=0;i<256;i++) | |
| 411 | tilemap_set_scrollx(bg_tilemap, i, bg_scrollram[i]+20); | |
| 470 | for (i = 0; i < 256; i++) | |
| 471 | tilemap_set_scrollx(state->bg_tilemap, i, state->bg_scrollram[i] + 20); | |
| 412 | 472 | } |
| 413 | 473 | else |
| 414 | 474 | { |
| 415 | for(i=0;i<256;i++) | |
| 416 | tilemap_set_scrollx(bg_tilemap, i, bg_scrollram[0]+19); | |
| 475 | for (i = 0; i < 256; i++) | |
| 476 | tilemap_set_scrollx(state->bg_tilemap, i, state->bg_scrollram[0] + 19); | |
| 417 | 477 | } |
| 418 | 478 | |
| 419 | if(vidattrram[6] | |
| 479 | if (BIT(state->vidattrram[6], 2) | |
| 420 | 480 | { |
| 421 | for(i=0;i<256;i++) | |
| 422 | tilemap_set_scrollx(mlow_tilemap, i, mlow_scrollram[i]+19); | |
| 481 | for (i = 0; i < 256; i++) | |
| 482 | tilemap_set_scrollx(state->mlow_tilemap, i, state->mlow_scrollram[i] + 19); | |
| 423 | 483 | } |
| 424 | 484 | else |
| 425 | 485 | { |
| 426 | for(i=0;i<256;i++) | |
| 427 | tilemap_set_scrollx(mlow_tilemap, i, mlow_scrollram[0]+19); | |
| 486 | for (i = 0; i < 256; i++) | |
| 487 | tilemap_set_scrollx(state->mlow_tilemap, i, state->mlow_scrollram[0] + 19); | |
| 428 | 488 | } |
| 429 | 489 | |
| 430 | if(vidattrram[6] | |
| 490 | if (BIT(state->vidattrram[6], 4) | |
| 431 | 491 | { |
| 432 | for(i=0;i<256;i++) | |
| 433 | tilemap_set_scrollx(mhigh_tilemap, i, mhigh_scrollram[i]+19); | |
| 492 | for (i = 0; i < 256; i++) | |
| 493 | tilemap_set_scrollx(state->mhigh_tilemap, i, state->mhigh_scrollram[i] + 19); | |
| 434 | 494 | } |
| 435 | 495 | else |
| 436 | 496 | { |
| 437 | for(i=0;i<256;i++) | |
| 438 | tilemap_set_scrollx(mhigh_tilemap, i, mhigh_scrollram[0]+19); | |
| 497 | for (i = 0; i < 256; i++) | |
| 498 | tilemap_set_scrollx(state->mhigh_tilemap, i, state->mhigh_scrollram[0] + 19); | |
| 439 | 499 | } |
| 440 | 500 | |
| 441 | tilemap_set_scrolly(bg_tilemap, 0, vidattrram[1]+1); | |
| 442 | tilemap_set_scrolly(mlow_tilemap, 0, vidattrram[2]+1); | |
| 443 | tilemap_set_scrolly(mhigh_tilemap, 0, vidattrram[3]+1); | |
| 501 | tilemap_set_scrolly(state->bg_tilemap, 0, state->vidattrram[1] + 1); | |
| 502 | tilemap_set_scrolly(state->mlow_tilemap, 0, state->vidattrram[2] + 1); | |
| 503 | tilemap_set_scrolly(state->mhigh_tilemap, 0, state->vidattrram[3] + 1); | |
| 444 | 504 | |
| 445 | tilemap_set_scrollx(tx_tilemap, 0, vidattrram[0]+16); | |
| 446 | tilemap_set_scrolly(tx_tilemap, 0, vidattrram[4]+1); | |
| 505 | tilemap_set_scrollx(state->tx_tilemap, 0, state->vidattrram[0] + 16); | |
| 506 | tilemap_set_scrolly(state->tx_tilemap, 0, state->vidattrram[4] + 1); | |
| 447 | 507 | |
| 448 | tilemap_draw(bitmap,cliprect,bg_tilemap, 0,0x01); | |
| 449 | tilemap_draw(bitmap,cliprect,mlow_tilemap, 0,0x02); | |
| 450 | tilemap_draw(bitmap,cliprect,mhigh_tilemap,0,0x04); | |
| 451 | tilemap_draw(bitmap,cliprect,tx_tilemap, 0,0x10); | |
| 452 | draw_sprites(screen->machine, bitmap,cliprect); | |
| 508 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0x01); | |
| 509 | tilemap_draw(bitmap, cliprect, state->mlow_tilemap, 0, 0x02); | |
| 510 | tilemap_draw(bitmap, cliprect, state->mhigh_tilemap, 0, 0x04); | |
| 511 | tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0x10); | |
| 512 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 453 | 513 | return 0; |
| 454 | 514 | } |
| 455 | 515 | |
| 516 | /************************************* | |
| 517 | * | |
| 518 | * Machine driver | |
| 519 | * | |
| 520 | *************************************/ | |
| 521 | ||
| 522 | static MACHINE_START( mwarr ) | |
| 523 | { | |
| 524 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 525 | ||
| 526 | state_save_register_global(machine, state->which); | |
| 527 | } | |
| 528 | ||
| 529 | static MACHINE_RESET( mwarr ) | |
| 530 | { | |
| 531 | mwarr_state *state = (mwarr_state *)machine->driver_data; | |
| 532 | ||
| 533 | state->which = 0; | |
| 534 | } | |
| 535 | ||
| 456 | 536 | static MACHINE_DRIVER_START( mwarr ) |
| 537 | ||
| 538 | /* driver data */ | |
| 539 | MDRV_DRIVER_DATA(mwarr_state) | |
| 540 | ||
| 541 | /* basic machine hardware */ | |
| 457 | 542 | MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK) |
| 458 | 543 | MDRV_CPU_PROGRAM_MAP(mwarr_map) |
| 459 | 544 | MDRV_CPU_VBLANK_INT("screen", irq4_line_hold) |
| 460 | 545 | |
| 461 | MDRV_GFXDECODE(mwarr) | |
| 546 | MDRV_MACHINE_START(mwarr) | |
| 547 | MDRV_MACHINE_RESET(mwarr) | |
| 462 | 548 | |
| 463 | ||
| 549 | /* video hardware */ | |
| 464 | 550 | MDRV_SCREEN_ADD("screen", RASTER) |
| 465 | 551 | MDRV_SCREEN_REFRESH_RATE(54) |
| 466 | 552 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| r7500 | r7501 | |
| 468 | 554 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 469 | 555 | MDRV_SCREEN_VISIBLE_AREA(8+1, 48*8-1-8-1, 0, 30*8-1) |
| 470 | 556 | |
| 557 | MDRV_GFXDECODE(mwarr) | |
| 471 | 558 | MDRV_PALETTE_LENGTH(0x800) |
| 472 | 559 | |
| 473 | 560 | MDRV_VIDEO_START(mwarr) |
| 474 | 561 | MDRV_VIDEO_UPDATE(mwarr) |
| 475 | 562 | |
| 563 | /* sound hardware */ | |
| 476 | 564 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 477 | 565 | |
| 478 | 566 | MDRV_SOUND_ADD("oki1", OKIM6295, SOUND_CLOCK/48 ) |
| r7500 | r7501 | |
| 485 | 573 | MACHINE_DRIVER_END |
| 486 | 574 | |
| 487 | 575 | |
| 576 | /************************************* | |
| 577 | * | |
| 578 | * ROM definition(s) | |
| 579 | * | |
| 580 | *************************************/ | |
| 581 | ||
| 488 | 582 | ROM_START( mwarr ) |
| 489 | 583 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 490 | 584 | ROM_LOAD16_BYTE( "prg_ev", 0x00000, 0x80000, CRC(d1d5e0a6) SHA1(f47955459d41c904b96de000b32cae156ee3bcba) ) |
| r7500 | r7501 | |
| 545 | 639 | ROM_COPY( "user1", 0x060000, 0x0e0000, 0x020000) |
| 546 | 640 | ROM_END |
| 547 | 641 | |
| 548 | GAME( 199?, mwarr, 0, mwarr, mwarr, 0, ROT0, "Elettronica Video-Games S.R.L.", "Mighty Warriors", 0 ) | |
| 642 | /************************************* | |
| 643 | * | |
| 644 | * Game driver(s) | |
| 645 | * | |
| 646 | *************************************/ | |
| 647 | ||
| 648 | GAME( 199?, mwarr, 0, mwarr, mwarr, 0, ROT0, "Elettronica Video-Games S.R.L.", "Mighty Warriors", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | #define MCLK 16000000 |
| 16 | 16 | |
| 17 | typedef struct _cultures_state cultures_state; | |
| 18 | struct _cultures_state | |
| 17 | class cultures_state | |
| 19 | 18 | { |
| 19 | public: | |
| 20 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cultures_state(machine)); } | |
| 21 | ||
| 22 | cultures_state(running_machine &machine) { } | |
| 23 | ||
| 20 | 24 | /* memory pointers */ |
| 21 | 25 | UINT8 * bg0_videoram; |
| 22 | 26 | UINT8 * paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 27 | 27 | #include "machine/laserdsc.h" |
| 28 | 28 | #include "video/resnet.h" |
| 29 | 29 | |
| 30 | typedef struct _superdq_state superdq_state; | |
| 31 | struct _superdq_state | |
| 30 | class superdq_state | |
| 32 | 31 | { |
| 32 | public: | |
| 33 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, superdq_state(machine)); } | |
| 34 | ||
| 35 | superdq_state(running_machine &machine) { } | |
| 36 | ||
| 33 | 37 | running_device *laserdisc; |
| 34 | 38 | UINT8 ld_in_latch; |
| 35 | 39 | UINT8 ld_out_latch; |
| r7500 | r7501 | |
|---|---|---|
| 779 | 779 | PORT_INCLUDE(zaxxon) |
| 780 | 780 | |
| 781 | 781 | PORT_MODIFY("SW00") |
| 782 | PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM(razmataz_dial_r, (void *)0) | |
| 783 | ||
| 784 | PORT_START("DIAL0") | |
| 782 | 785 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_RESET |
| 783 | 786 | |
| 784 | 787 | PORT_MODIFY("SW01") |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static ADDRESS_MAP_START( news_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 23 | 23 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* 4000-7fff is written to during startup, probably leftover code */ |
| 24 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(news_fgram_w) AM_BASE(&news_fgram) | |
| 25 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(news_bgram_w) AM_BASE(&news_bgram) | |
| 24 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(news_fgram_w) AM_BASE_MEMBER(news_state, fgram) | |
| 25 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(news_bgram_w) AM_BASE_MEMBER(news_state, bgram) | |
| 26 | 26 | AM_RANGE(0x9000, 0x91ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_BASE_GENERIC(paletteram) |
| 27 | 27 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSW") |
| 28 | 28 | AM_RANGE(0xc001, 0xc001) AM_READ_PORT("INPUTS") |
| r7500 | r7501 | |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | |
| 116 | static MACHINE_START( news ) | |
| 117 | { | |
| 118 | news_state *state = (news_state *)machine->driver_data; | |
| 119 | ||
| 120 | state_save_register_global(machine, state->bgpic); | |
| 121 | } | |
| 122 | ||
| 123 | static MACHINE_RESET( news ) | |
| 124 | { | |
| 125 | news_state *state = (news_state *)machine->driver_data; | |
| 126 | ||
| 127 | state->bgpic = 0; | |
| 128 | } | |
| 129 | ||
| 116 | 130 | static MACHINE_DRIVER_START( news ) |
| 131 | ||
| 132 | /* driver data */ | |
| 133 | MDRV_DRIVER_DATA(news_state) | |
| 134 | ||
| 117 | 135 | /* basic machine hardware */ |
| 118 | 136 | MDRV_CPU_ADD("maincpu", Z80,8000000) /* ? MHz */ |
| 119 | 137 | MDRV_CPU_PROGRAM_MAP(news_map) |
| 120 | 138 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 121 | 139 | |
| 140 | MDRV_MACHINE_START(news) | |
| 141 | MDRV_MACHINE_RESET(news) | |
| 142 | ||
| 122 | 143 | /* video hardware */ |
| 123 | 144 | MDRV_SCREEN_ADD("screen", RASTER) |
| 124 | 145 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 167 | 188 | ROM_LOAD( "virus.1", 0x00000, 0x40000, CRC(41f5935a) SHA1(1566d243f165019660cd4dd69df9f049e0130f15) ) |
| 168 | 189 | ROM_END |
| 169 | 190 | |
| 170 | GAME( 1993, news, 0, news, news, 0, ROT0, "Poby / Virus", "News (set 1)", 0 ) | |
| 171 | GAME( 1993, newsa, news, news, newsa, 0, ROT0, "Poby", "News (set 2)", 0 ) | |
| 191 | GAME( 1993, news, 0, news, news, 0, ROT0, "Poby / Virus", "News (set 1)", GAME_SUPPORTS_SAVE ) | |
| 192 | GAME( 1993, newsa, news, news, newsa, 0, ROT0, "Poby", "News (set 2)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 309 | 309 | static MACHINE_DRIVER_START( wc90 ) |
| 310 | 310 | |
| 311 | 311 | /* basic machine hardware */ |
| 312 | MDRV_CPU_ADD("maincpu", Z80, | |
| 312 | MDRV_CPU_ADD("maincpu", Z80, XTAL_8MHz) /* verified on | |
| 313 | 313 | MDRV_CPU_PROGRAM_MAP(wc90_map_1) |
| 314 | 314 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 315 | 315 | |
| 316 | MDRV_CPU_ADD("sub", Z80, | |
| 316 | MDRV_CPU_ADD("sub", Z80, XTAL_8MHz) /* verified on | |
| 317 | 317 | MDRV_CPU_PROGRAM_MAP(wc90_map_2) |
| 318 | 318 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 319 | 319 | |
| 320 | MDRV_CPU_ADD("audiocpu", Z80, | |
| 320 | MDRV_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) /* verified on | |
| 321 | 321 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 322 | 322 | /* NMIs are triggered by the main CPU */ |
| 323 | 323 | |
| 324 | 324 | /* video hardware */ |
| 325 | 325 | MDRV_SCREEN_ADD("screen", RASTER) |
| 326 | MDRV_SCREEN_REFRESH_RATE( | |
| 326 | MDRV_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */ | |
| 327 | 327 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 328 | 328 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 329 | 329 | MDRV_SCREEN_SIZE(32*8, 32*8) |
| r7500 | r7501 | |
| 338 | 338 | /* sound hardware */ |
| 339 | 339 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 340 | 340 | |
| 341 | MDRV_SOUND_ADD("ymsnd", YM2608, 8 | |
| 341 | MDRV_SOUND_ADD("ymsnd", YM2608, XTAL_8MHz | |
| 342 | 342 | MDRV_SOUND_CONFIG(ym2608_config) |
| 343 | 343 | MDRV_SOUND_ROUTE(0, "mono", 0.50) |
| 344 | 344 | MDRV_SOUND_ROUTE(1, "mono", 1.0) |
| r7500 | r7501 | |
|---|---|---|
| 115 | 115 | |
| 116 | 116 | ROM_START( kinniku ) |
| 117 | 117 | ROM_REGION(0x200000, "bios", 0) |
| 118 | SYSTEM2 | |
| 118 | SYSTEM256_BIOS | |
| 119 | 119 | |
| 120 | 120 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 121 | 121 | ROM_LOAD( "kn1vera.ic002", 0x000000, 0x800000, CRC(17aac6c3) SHA1(dddf37e88385f01bba27496d03f053fdc33882e2) ) |
| r7500 | r7501 | |
| 133 | 133 | ROM_LOAD( "npy1verb_spr.ic002", 0x800000, 0x040000, CRC(6a3374f0) SHA1(0c0845edc0ac0e9871e65caade8b4157614b81eb) ) |
| 134 | 134 | |
| 135 | 135 | DISK_REGION("dvd") |
| 136 | DISK_IMAGE_READONLY( "npy1cd0b", 0, SHA1(514adcd2d4205873b3d144a05c033822344798e3) ) | |
| 136 | 137 | ROM_END |
| 137 | 138 | |
| 138 | 139 | ROM_START( soulclb2 ) |
| r7500 | r7501 | |
| 155 | 156 | ROM_LOAD( "sc21vera_spr.ic002", 0x800000, 0x040000, CRC(f5502fdf) SHA1(064196982d855bd41bafe97db5ff5694b933016a) ) |
| 156 | 157 | |
| 157 | 158 | DISK_REGION("dvd") |
| 159 | DISK_IMAGE_READONLY( "sc210d", 0, SHA1(9a7b1ea836adc9d78481928a3067530e0f8d74a6) ) | |
| 158 | 160 | ROM_END |
| 159 | 161 | |
| 160 | 162 | ROM_START( soulclb3 ) |
| r7500 | r7501 | |
| 166 | 168 | ROM_LOAD( "sc31001-na-a_spr.ic002", 0x800000, 0x040000, CRC(18c6f56d) SHA1(13bc6a3688985c0cd9900b063824a4af691a1b31) ) |
| 167 | 169 | |
| 168 | 170 | DISK_REGION("dvd") |
| 171 | DISK_IMAGE_READONLY( "sc31na0b", 0, SHA1(b46ee35083f8fcc091ce562951c55fbdbb929e4b) ) | |
| 169 | 172 | ROM_END |
| 170 | 173 | |
| 171 | 174 | ROM_START( sukuinuf ) |
| r7500 | r7501 | |
| 177 | 180 | ROM_LOAD( "in2vera_spr.ic002", 0x800000, 0x040000, CRC(c43fed95) SHA1(b6001dc8ff34198400a7bf3e41e5ab73823685b0) ) |
| 178 | 181 | |
| 179 | 182 | DISK_REGION("dvd") |
| 183 | DISK_IMAGE_READONLY( "in2vera", 0, SHA1(4e2d95798a2bcc6f93bc82c364379a3936d68986) ) | |
| 180 | 184 | ROM_END |
| 181 | 185 | |
| 182 | 186 | ROM_START( taiko9 ) |
| 183 | 187 | ROM_REGION(0x200000, "bios", 0) |
| 184 | SYSTEM2 | |
| 188 | SYSTEM256_BIOS | |
| 185 | 189 | |
| 186 | 190 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 187 | 191 | ROM_LOAD( "tk91001-na-a.ic002", 0x000000, 0x800000, CRC(db4efc9a) SHA1(a24f10c726f5bc7313559a515d5c4c34cd129c97) ) |
| r7500 | r7501 | |
| 221 | 225 | ROM_LOAD( "tef1vera.spr", 0x800000, 0x040000, CRC(64e12053) SHA1(04383cf928b4fd82290d7cccc7b23104fbf2c2f2) ) |
| 222 | 226 | |
| 223 | 227 | DISK_REGION("dvd") |
| 228 | DISK_IMAGE_READONLY( "tef1dvd0", 0, SHA1(f39aa37156245f622a6e19e8a0e081418e247b36) ) | |
| 224 | 229 | ROM_END |
| 225 | 230 | |
| 226 | 231 | ROM_START( tekken51 ) |
| r7500 | r7501 | |
| 232 | 237 | ROM_LOAD( "te51verb_spr.ic002", 0x800000, 0x040000, CRC(683bad0d) SHA1(ef10accbdc82143c31d29e2b8b812a209b341b1b) ) |
| 233 | 238 | |
| 234 | 239 | DISK_REGION("dvd") |
| 240 | DISK_IMAGE_READONLY( "te510b", 0, SHA1(2a0ac3723725572c1810b0ef4bcfa7aa114062f8) ) | |
| 235 | 241 | ROM_END |
| 236 | 242 | |
| 237 | 243 | ROM_START( zgundm ) |
| r7500 | r7501 | |
| 269 | 275 | GAME(2004, sukuinuf, sys246, system246, system246, 0, ROT0, "Namco", "Quiz and Variety Suku Suku Inufuku 2 (IN2 Ver. A)", GAME_NO_SOUND|GAME_NOT_WORKING) |
| 270 | 276 | GAME(2004, zgundmdx, sys246, system246, system246, 0, ROT0, "Capcom/Banpresto", "Mobile Suit Z-Gundam: A.E.U.G. vs Titans DX (ZDX1 Ver. A)", GAME_NO_SOUND|GAME_NOT_WORKING) |
| 271 | 277 | GAME(2005, soulclb3, sys246, system246, system246, 0, ROT0, "Namco", "Soul Calibur III (SC31001-NA-A)", GAME_NO_SOUND|GAME_NOT_WORKING) |
| 272 | GAME(2006, kinniku, sys246, system246, system246, 0, ROT0, "Namco", "Kinnikuman Muscle Grand Prix (KN1 Ver. A)", GAME_NO_SOUND|GAME_NOT_WORKING) | |
| 273 | GAME(2006, taiko9, sys246, system246, system246, 0, ROT0, "Namco", "Taiko No Tatsujin 9 (TK91001-NA-A)", GAME_NO_SOUND|GAME_NOT_WORKING) | |
| 274 | 278 | |
| 275 | 279 | GAME(2004, sys256, 0, system256, system246, 0, ROT0, "Namco", "System 256 BIOS", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT) |
| 276 | 280 | GAME(2005, tekken51, sys256, system256, system246, 0, ROT0, "Namco", "Tekken 5.1 (TE51 Ver. B)", GAME_NO_SOUND|GAME_NOT_WORKING) |
| 281 | GAME(2006, kinniku, sys256, system256, system246, 0, ROT0, "Namco", "Kinnikuman Muscle Grand Prix (KN1 Ver. A)", GAME_NO_SOUND|GAME_NOT_WORKING) | |
| 282 | GAME(2006, taiko9, sys256, system256, system246, 0, ROT0, "Namco", "Taiko No Tatsujin 9 (TK91001-NA-A)", GAME_NO_SOUND|GAME_NOT_WORKING) | |
| 277 | 283 |
| r7500 | r7501 | |
|---|---|---|
| 71 | 71 | okim6295_set_bank_base(device, (data & 0x01) ? 0x40000 : 0x00000); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | static WRITE16_HANDLER( deniam_irq_ack_w ) | |
| 75 | { | |
| 76 | cputag_set_input_line(space->machine, "maincpu", 4, CLEAR_LINE); | |
| 77 | } | |
| 74 | 78 | |
| 75 | 79 | static ADDRESS_MAP_START( deniam16b_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 76 | 80 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| r7500 | r7501 | |
| 80 | 84 | AM_RANGE(0x840000, 0x840fff) AM_WRITE(deniam_palette_w) AM_BASE_MEMBER(deniam_state, paletteram) |
| 81 | 85 | AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_w) |
| 82 | 86 | AM_RANGE(0xc40002, 0xc40003) AM_READWRITE(deniam_coinctrl_r, deniam_coinctrl_w) |
| 87 | AM_RANGE(0xc40004, 0xc40005) AM_WRITE(deniam_irq_ack_w) | |
| 83 | 88 | AM_RANGE(0xc44000, 0xc44001) AM_READ_PORT("SYSTEM") |
| 84 | 89 | AM_RANGE(0xc44002, 0xc44003) AM_READ_PORT("P1") |
| 85 | AM_RANGE(0xc44004, 0xc44005) AM_READ_PORT("P2") AM_WRITENOP | |
| 90 | AM_RANGE(0xc44004, 0xc44005) AM_READ_PORT("P2") AM_WRITENOP | |
| 86 | 91 | AM_RANGE(0xc44006, 0xc44007) AM_READNOP /* unused? */ |
| 87 | 92 | AM_RANGE(0xc4400a, 0xc4400b) AM_READ_PORT("DSW") |
| 88 | 93 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| r7500 | r7501 | |
| 110 | 115 | AM_RANGE(0x840000, 0x840fff) AM_WRITE(deniam_palette_w) AM_BASE_MEMBER(deniam_state, paletteram) |
| 111 | 116 | AM_RANGE(0xc40000, 0xc40001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff) |
| 112 | 117 | AM_RANGE(0xc40002, 0xc40003) AM_READWRITE(deniam_coinctrl_r, deniam_coinctrl_w) |
| 118 | AM_RANGE(0xc40004, 0xc40005) AM_WRITE(deniam_irq_ack_w) | |
| 113 | 119 | AM_RANGE(0xc44000, 0xc44001) AM_READ_PORT("SYSTEM") |
| 114 | 120 | AM_RANGE(0xc44002, 0xc44003) AM_READ_PORT("P1") |
| 115 | AM_RANGE(0xc44004, 0xc44005) AM_READ_PORT("P2") AM_WRITENOP | |
| 121 | AM_RANGE(0xc44004, 0xc44005) AM_READ_PORT("P2") AM_WRITENOP | |
| 116 | 122 | AM_RANGE(0xc44006, 0xc44007) AM_READNOP AM_DEVWRITE("oki", deniam16c_oki_rom_bank_w) /* read unused? */ |
| 117 | 123 | AM_RANGE(0xc40008, 0xc4000b) AM_DEVWRITE8("ymsnd", ym3812_w, 0xff00) |
| 118 | 124 | AM_RANGE(0xc4400a, 0xc4400b) AM_READ_PORT("DSW") /* probably YM3812 input port */ |
| r7500 | r7501 | |
| 267 | 273 | /* basic machine hardware */ |
| 268 | 274 | MDRV_CPU_ADD("maincpu", M68000,XTAL_25MHz/2) /* 12.5Mhz verified */ |
| 269 | 275 | MDRV_CPU_PROGRAM_MAP(deniam16b_map) |
| 270 | MDRV_CPU_VBLANK_INT("screen", irq4_line_ | |
| 276 | MDRV_CPU_VBLANK_INT("screen", irq4_line_assert) | |
| 271 | 277 | |
| 272 | 278 | MDRV_CPU_ADD("audiocpu", Z80,XTAL_25MHz/4) /* 6.25Mhz verified */ |
| 273 | 279 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| r7500 | r7501 | |
| 311 | 317 | /* basic machine hardware */ |
| 312 | 318 | MDRV_CPU_ADD("maincpu", M68000,XTAL_25MHz/2) /* 12.5Mhz verified */ |
| 313 | 319 | MDRV_CPU_PROGRAM_MAP(deniam16c_map) |
| 314 | MDRV_CPU_VBLANK_INT("screen", irq4_line_ | |
| 320 | MDRV_CPU_VBLANK_INT("screen", irq4_line_assert) | |
| 315 | 321 | |
| 316 | 322 | MDRV_MACHINE_START(deniam) |
| 317 | 323 | MDRV_MACHINE_RESET(deniam) |
| r7500 | r7501 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | static void big10_vdp_interrupt(running_machine *machine, int i) |
| 73 | 73 | { |
| 74 | cputag_set_input_line (machine, "maincpu", 0, (i ? | |
| 74 | cputag_set_input_line (machine, "maincpu", 0, (i ? ASSERT_LINE : CLEAR_LINE)); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static INTERRUPT_GEN( big10_interrupt ) |
| r7500 | r7501 | |
|---|---|---|
| 154 | 154 | ROM_CONTINUE( 0x300000, 0x040000) |
| 155 | 155 | ROM_END |
| 156 | 156 | |
| 157 | static INPUT_PORTS_START(mk3ghw) | |
| 158 | PORT_INCLUDE( md_common ) | |
| 159 | ||
| 160 | PORT_MODIFY("PAD1") /* Joypad 1 (3 button + start) NOT READ DIRECTLY */ | |
| 161 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // a | |
| 162 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // b | |
| 163 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // c | |
| 164 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) // start | |
| 165 | ||
| 166 | PORT_MODIFY("PAD2") /* Joypad 2 (3 button + start) NOT READ DIRECTLY - not used */ | |
| 167 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 168 | ||
| 169 | PORT_START("IN0") | |
| 170 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 171 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 172 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) | |
| 173 | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) | |
| 174 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) | |
| 175 | PORT_BIT( 0xf8, 0x00, IPT_UNUSED ) | |
| 176 | ||
| 177 | PORT_START("IN1") | |
| 178 | PORT_DIPUNKNOWN( 0x01, 0x00 ) | |
| 179 | PORT_DIPUNKNOWN( 0x02, 0x00 ) | |
| 180 | PORT_DIPUNKNOWN( 0x04, 0x00 ) | |
| 181 | PORT_DIPUNKNOWN( 0x08, 0x00 ) | |
| 182 | PORT_DIPUNKNOWN( 0x10, 0x00 ) | |
| 183 | PORT_DIPUNKNOWN( 0x20, 0x00 ) | |
| 184 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) | |
| 185 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 186 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 187 | PORT_DIPUNKNOWN( 0x80, 0x00 ) | |
| 188 | INPUT_PORTS_END | |
| 189 | ||
| 190 | 157 | // this should be correct, the areas of the rom that differ to the original |
| 191 | 158 | // after this decode look like intentional changes |
| 192 | 159 | static DRIVER_INIT( mk3ghw ) |
| r7500 | r7501 | |
| 233 | 200 | ROM[7] = 0x02; |
| 234 | 201 | ROM[6] = 0x10; |
| 235 | 202 | |
| 236 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770071, 0, 0, "IN0"); | |
| 237 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770072, 0x770073, 0, 0, "IN1"); | |
| 203 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770071, 0, 0, "DSWA"); | |
| 204 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770072, 0x770073, 0, 0, "DSWB"); | |
| 238 | 205 | } |
| 239 | 206 | |
| 240 | 207 |
| r7500 | r7501 | |
|---|---|---|
| 520 | 520 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE_GENERIC(paletteram) |
| 521 | 521 | TC0180VCU_MEMRW( 0x400000 ) |
| 522 | 522 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00) |
| 523 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) | |
| 523 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00) | |
| 524 | 524 | AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */ |
| 525 | 525 | AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_port_w, 0xff00) |
| 526 | 526 | AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r7500 | r7501 | |
| 641 | 641 | TC0180VCU_MEMRW( 0x400000 ) |
| 642 | 642 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE_GENERIC(paletteram) |
| 643 | 643 | AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00) |
| 644 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) | |
| 644 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00) | |
| 645 | 645 | AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_port_w, 0xff00) |
| 646 | 646 | AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 647 | 647 | ADDRESS_MAP_END |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #include "sound/2203intf.h" |
| 15 | 15 | #include "sound/2151intf.h" |
| 16 | 16 | #include "sound/okim6295.h" |
| 17 | #include "includes/deco16ic.h" | |
| 17 | #include "video/deco16ic.h" | |
| 18 | #include "includes/vaportra.h" | |
| 18 | 19 | |
| 19 | VIDEO_START( vaportra ); | |
| 20 | VIDEO_UPDATE( vaportra ); | |
| 21 | ||
| 22 | WRITE16_HANDLER( vaportra_priority_w ); | |
| 23 | WRITE16_HANDLER( vaportra_palette_24bit_rg_w ); | |
| 24 | WRITE16_HANDLER( vaportra_palette_24bit_b_w ); | |
| 25 | ||
| 26 | 20 | /******************************************************************************/ |
| 27 | 21 | |
| 28 | 22 | static WRITE16_HANDLER( vaportra_sound_w ) |
| 29 | 23 | { |
| 24 | vaportra_state *state = (vaportra_state *)space->machine->driver_data; | |
| 25 | ||
| 30 | 26 | /* Force synchronisation between CPUs with fake timer */ |
| 31 | 27 | timer_call_after_resynch(space->machine, NULL, 0, NULL); |
| 32 | soundlatch_w(space,0,data & 0xff); | |
| 33 | cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE); | |
| 28 | soundlatch_w(space, 0, data & 0xff); | |
| 29 | cpu_set_input_line(state->audiocpu, 0, ASSERT_LINE); | |
| 34 | 30 | } |
| 35 | 31 | |
| 36 | 32 | static READ16_HANDLER( vaportra_control_r ) |
| 37 | 33 | { |
| 38 | switch (offset<<1) | |
| 34 | switch (offset << 1) | |
| 39 | 35 | { |
| 40 | 36 | case 4: |
| 41 | 37 | return input_port_read(space->machine, "DSW"); |
| r7500 | r7501 | |
| 56 | 52 | AM_RANGE(0x100000, 0x100003) AM_WRITE(vaportra_priority_w) |
| 57 | 53 | AM_RANGE(0x100006, 0x100007) AM_WRITE(vaportra_sound_w) |
| 58 | 54 | AM_RANGE(0x100000, 0x10000f) AM_READ(vaportra_control_r) |
| 59 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 60 | AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 61 | AM_RANGE(0x240000, 0x24000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 62 | AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 63 | AM_RANGE(0x282000, 0x283fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 64 | AM_RANGE(0x2c0000, 0x2c000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 55 | AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 56 | AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 57 | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 58 | AM_RANGE(0x280000, 0x281fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 59 | AM_RANGE(0x282000, 0x283fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 60 | AM_RANGE(0x2c0000, 0x2c000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 65 | 61 | AM_RANGE(0x300000, 0x3009ff) AM_RAM_WRITE(vaportra_palette_24bit_rg_w) AM_BASE_GENERIC(paletteram) |
| 66 | 62 | AM_RANGE(0x304000, 0x3049ff) AM_RAM_WRITE(vaportra_palette_24bit_b_w) AM_BASE_GENERIC(paletteram2) |
| 67 | 63 | AM_RANGE(0x308000, 0x308001) AM_NOP |
| r7500 | r7501 | |
| 75 | 71 | |
| 76 | 72 | static READ8_HANDLER( vaportra_soundlatch_r ) |
| 77 | 73 | { |
| 78 | cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE); | |
| 74 | vaportra_state *state = (vaportra_state *)space->machine->driver_data; | |
| 75 | cpu_set_input_line(state->audiocpu, 0, CLEAR_LINE); | |
| 79 | 76 | return soundlatch_r(space, offset); |
| 80 | 77 | } |
| 81 | 78 | |
| r7500 | r7501 | |
| 193 | 190 | 32*16 |
| 194 | 191 | }; |
| 195 | 192 | |
| 196 | ||
| 197 | ||
| 198 | 193 | static GFXDECODE_START( vaportra ) |
| 199 | 194 | GFXDECODE_ENTRY( "gfx1", 0x000000, charlayout, 0x000, 0x500 ) /* Characters 8x8 */ |
| 200 | 195 | GFXDECODE_ENTRY( "gfx1", 0x000000, tilelayout, 0x000, 0x500 ) /* Tiles 16x16 */ |
| r7500 | r7501 | |
| 204 | 199 | |
| 205 | 200 | /******************************************************************************/ |
| 206 | 201 | |
| 207 | static void sound_irq(running_device *device, int state) | |
| 202 | static void sound_irq( running_device *device, int state ) | |
| 208 | 203 | { |
| 209 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 204 | vaportra_state *driver_state = (vaportra_state *)device->machine->driver_data; | |
| 205 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 210 | 206 | } |
| 211 | 207 | |
| 212 | 208 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 215 | 211 | }; |
| 216 | 212 | |
| 217 | 213 | |
| 214 | static int vaportra_bank_callback( const int bank ) | |
| 215 | { | |
| 216 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 217 | } | |
| 218 | 218 | |
| 219 | static const deco16ic_interface vaportra_deco16ic_intf = | |
| 220 | { | |
| 221 | "screen", | |
| 222 | 0, 0, 1, | |
| 223 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 224 | 0x00, 0x20, 0x30, 0x40, /* color base */ | |
| 225 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 226 | vaportra_bank_callback, | |
| 227 | vaportra_bank_callback, | |
| 228 | vaportra_bank_callback, | |
| 229 | vaportra_bank_callback | |
| 230 | }; | |
| 231 | ||
| 232 | ||
| 233 | static MACHINE_START( vaportra ) | |
| 234 | { | |
| 235 | vaportra_state *state = (vaportra_state *)machine->driver_data; | |
| 236 | ||
| 237 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 238 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 239 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 240 | ||
| 241 | state_save_register_global_array(machine, state->priority); | |
| 242 | } | |
| 243 | ||
| 244 | static MACHINE_RESET( vaportra ) | |
| 245 | { | |
| 246 | vaportra_state *state = (vaportra_state *)machine->driver_data; | |
| 247 | ||
| 248 | state->priority[0] = 0; | |
| 249 | state->priority[1] = 0; | |
| 250 | } | |
| 251 | ||
| 219 | 252 | static MACHINE_DRIVER_START( vaportra ) |
| 220 | 253 | |
| 254 | /* driver data */ | |
| 255 | MDRV_DRIVER_DATA(vaportra_state) | |
| 256 | ||
| 221 | 257 | /* basic machine hardware */ |
| 222 | 258 | MDRV_CPU_ADD("maincpu", M68000,12000000) /* Custom chip 59 */ |
| 223 | 259 | MDRV_CPU_PROGRAM_MAP(main_map) |
| r7500 | r7501 | |
| 226 | 262 | MDRV_CPU_ADD("audiocpu", H6280, 32220000/4) /* Custom chip 45; Audio section crystal is 32.220 MHz */ |
| 227 | 263 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 228 | 264 | |
| 265 | MDRV_MACHINE_START(vaportra) | |
| 266 | MDRV_MACHINE_RESET(vaportra) | |
| 267 | ||
| 229 | 268 | /* video hardware */ |
| 230 | 269 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 231 | 270 | |
| r7500 | r7501 | |
| 238 | 277 | MDRV_GFXDECODE(vaportra) |
| 239 | 278 | MDRV_PALETTE_LENGTH(1280) |
| 240 | 279 | |
| 241 | MDRV_VIDEO_START(vaportra) | |
| 242 | 280 | MDRV_VIDEO_UPDATE(vaportra) |
| 243 | 281 | |
| 282 | MDRV_DECO16IC_ADD("deco_custom", vaportra_deco16ic_intf) | |
| 283 | ||
| 244 | 284 | /* sound hardware */ |
| 245 | 285 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 246 | 286 | |
| r7500 | r7501 | |
| 766 | 806 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 767 | 807 | int i; |
| 768 | 808 | |
| 769 | for (i=0x00000; i<0x80000; i++) | |
| 770 | RAM[i]=(RAM[i] & 0x7e) | ((RAM[i] & 0x01) << 7) | ((RAM[i] & 0x80) >> 7); | |
| 809 | for (i = 0x00000; i < 0x80000; i++) | |
| 810 | RAM[i] = (RAM[i] & 0x7e) | ((RAM[i] & 0x01) << 7) | ((RAM[i] & 0x80) >> 7); | |
| 771 | 811 | } |
| 772 | 812 | |
| 773 | 813 | /******************************************************************************/ |
| 774 | 814 | |
| 775 | GAME( 1989, vaportra, 0, vaportra, vaportra, vaportra, ROT270, "Data East Corporation", "Vapor Trail - Hyper Offence Formation (World revision 1)", 0 ) | |
| 776 | GAME( 1989, vaportrau,vaportra, vaportra, vaportra, vaportra, ROT270, "Data East USA", "Vapor Trail - Hyper Offence Formation (US)", 0 ) | |
| 777 | GAME( 1989, kuhga, vaportra, vaportra, vaportra, vaportra, ROT270, "Data East Corporation", "Kuhga - Operation Code 'Vapor Trail' (Japan revision 3)", 0 ) | |
| 815 | GAME( 1989, vaportra, 0, vaportra, vaportra, vaportra, ROT270, "Data East Corporation", "Vapor Trail - Hyper Offence Formation (World revision 1)", GAME_SUPPORTS_SAVE ) | |
| 816 | GAME( 1989, vaportrau,vaportra, vaportra, vaportra, vaportra, ROT270, "Data East USA", "Vapor Trail - Hyper Offence Formation (US)", GAME_SUPPORTS_SAVE ) | |
| 817 | GAME( 1989, kuhga, vaportra, vaportra, vaportra, vaportra, ROT270, "Data East Corporation", "Kuhga - Operation Code 'Vapor Trail' (Japan revision 3)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 1468 | 1468 | static MACHINE_DRIVER_START( hardhead ) |
| 1469 | 1469 | |
| 1470 | 1470 | /* basic machine hardware */ |
| 1471 | MDRV_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) | |
| 1471 | MDRV_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) | |
| 1472 | 1472 | MDRV_CPU_PROGRAM_MAP(hardhead_map) |
| 1473 | 1473 | MDRV_CPU_IO_MAP(hardhead_io_map) |
| 1474 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) /* No NMI */ | |
| 1474 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) /* No NMI */ | |
| 1475 | 1475 | |
| 1476 | MDRV_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / | |
| 1476 | MDRV_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 8) | |
| 1477 | 1477 | MDRV_CPU_PROGRAM_MAP(hardhead_sound_map) |
| 1478 | 1478 | MDRV_CPU_IO_MAP(hardhead_sound_io_map) |
| 1479 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No NMI */ | |
| 1479 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No NMI */ | |
| 1480 | 1480 | |
| 1481 | 1481 | /* video hardware */ |
| 1482 | 1482 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1483 | MDRV_SCREEN_REFRESH_RATE( | |
| 1483 | MDRV_SCREEN_REFRESH_RATE(59.10) /* verified on pcb */ | |
| 1484 | 1484 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1485 | 1485 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1486 | 1486 | MDRV_SCREEN_SIZE(256, 256) |
| r7500 | r7501 | |
| 1495 | 1495 | /* sound hardware */ |
| 1496 | 1496 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1497 | 1497 | |
| 1498 | MDRV_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) | |
| 1498 | MDRV_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */ | |
| 1499 | 1499 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1500 | 1500 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1501 | 1501 | |
| 1502 | MDRV_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) | |
| 1502 | MDRV_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */ | |
| 1503 | 1503 | MDRV_SOUND_CONFIG(hardhead_ay8910_interface) |
| 1504 | 1504 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) |
| 1505 | 1505 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) |
| r7500 | r7501 | |
|---|---|---|
| 51 | 51 | #include "sound/2203intf.h" |
| 52 | 52 | |
| 53 | 53 | |
| 54 | typedef struct _chanbara_state chanbara_state; | |
| 55 | struct _chanbara_state | |
| 54 | class chanbara_state | |
| 56 | 55 | { |
| 56 | public: | |
| 57 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chanbara_state(machine)); } | |
| 58 | ||
| 59 | chanbara_state(running_machine &machine) { } | |
| 60 | ||
| 57 | 61 | /* memory pointers */ |
| 58 | 62 | UINT8 * videoram; |
| 59 | 63 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 54 | 54 | #include "cpu/i8085/i8085.h" |
| 55 | 55 | |
| 56 | 56 | |
| 57 | typedef struct _m14_state m14_state; | |
| 58 | struct _m14_state | |
| 57 | class m14_state | |
| 59 | 58 | { |
| 59 | public: | |
| 60 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, m14_state(machine)); } | |
| 61 | ||
| 62 | m14_state(running_machine &machine) { } | |
| 63 | ||
| 60 | 64 | /* video-related */ |
| 61 | 65 | tilemap_t *m14_tilemap; |
| 62 | 66 | UINT8 * video_ram; |
| r7500 | r7501 | |
|---|---|---|
| 99 | 99 | #include "sound/sn76496.h" |
| 100 | 100 | #include "sound/msm5205.h" |
| 101 | 101 | |
| 102 | typedef struct _jantotsu_state jantotsu_state; | |
| 103 | struct _jantotsu_state | |
| 102 | class jantotsu_state | |
| 104 | 103 | { |
| 104 | public: | |
| 105 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jantotsu_state(machine)); } | |
| 106 | ||
| 107 | jantotsu_state(running_machine &machine) { } | |
| 108 | ||
| 105 | 109 | /* video-related */ |
| 106 | 110 | UINT8 *bitmap; |
| 107 | 111 | UINT8 vram_bank, col_bank; |
| r7500 | r7501 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | int tile = ((vram[count+1]<<8) | vram[count]) & 0xffff; |
| 35 | 35 | |
| 36 | tile ^=chsuper_tilexor; | |
| 37 | //int colour = tile>>12; | |
| 36 | //tile ^=chsuper_tilexor; | |
| 38 | 37 | |
| 39 | 38 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*4,y*8); |
| 40 | 39 | count+=2; |
| r7500 | r7501 | |
| 187 | 186 | }; |
| 188 | 187 | |
| 189 | 188 | static GFXDECODE_START( chsuper ) |
| 190 | GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 1 | |
| 189 | GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 1 | |
| 191 | 190 | GFXDECODE_END |
| 192 | 191 | |
| 193 | 192 | static MACHINE_DRIVER_START( chsuper ) |
| r7500 | r7501 | |
| 253 | 252 | ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 ) |
| 254 | 253 | ROM_END |
| 255 | 254 | |
| 255 | ROM_START( chmpnum ) | |
| 256 | ROM_REGION( 0x80000, "maincpu", 0 ) // code + samples | |
| 257 | ROM_LOAD( "3.ic11", 0x00000, 0x80000, CRC(46aa2ce7) SHA1(036d67a26c890c4dc26599bfcd2c67f12e30fb52) ) | |
| 258 | ||
| 259 | ROM_REGION( 0x010000, "vram", ROMREGION_ERASE00 ) | |
| 260 | ||
| 261 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 262 | ROM_LOAD( "1.ic18", 0x00000, 0x80000, CRC(8e202eaa) SHA1(156b498873111e5890c00d447201ba4bcbe6e633) ) | |
| 263 | ROM_LOAD( "2.ic19", 0x80000, 0x80000, CRC(dc0790b0) SHA1(4550f85e609338635a3987f7832517ed1d6388d4) ) | |
| 264 | ||
| 265 | ROM_REGION( 0x80000, "adpcm", 0 ) | |
| 266 | ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 ) | |
| 267 | ROM_END | |
| 268 | ||
| 256 | 269 | static DRIVER_INIT( chsuper2 ) |
| 257 | 270 | { |
| 271 | UINT8 *buffer; | |
| 272 | UINT8 *rom = memory_region(machine,"gfx1"); | |
| 273 | int i; | |
| 274 | ||
| 258 | 275 | chsuper_tilexor = 0x7f00; |
| 276 | ||
| 277 | buffer = auto_alloc_array(machine, UINT8, 0x100000); | |
| 278 | ||
| 279 | for (i=0;i<0x100000;i++) | |
| 280 | { | |
| 281 | int j; | |
| 282 | ||
| 283 | j = i ^ (chsuper_tilexor << 5); | |
| 284 | ||
| 285 | buffer[j] = rom[i]; | |
| 286 | } | |
| 287 | ||
| 288 | memcpy(rom,buffer,0x100000); | |
| 289 | ||
| 290 | chsuper_tilexor = 0x0000; | |
| 259 | 291 | } |
| 260 | 292 | |
| 261 | 293 | static DRIVER_INIT( chsuper3 ) |
| 262 | 294 | { |
| 295 | UINT8 *buffer; | |
| 296 | UINT8 *rom = memory_region(machine,"gfx1"); | |
| 297 | int i; | |
| 298 | ||
| 263 | 299 | chsuper_tilexor = 0x0e00; |
| 300 | ||
| 301 | buffer = auto_alloc_array(machine, UINT8, 0x100000); | |
| 302 | ||
| 303 | for (i=0;i<0x100000;i++) | |
| 304 | { | |
| 305 | int j; | |
| 306 | ||
| 307 | j = i ^ (chsuper_tilexor << 5); | |
| 308 | ||
| 309 | buffer[j] = rom[i]; | |
| 310 | } | |
| 311 | ||
| 312 | memcpy(rom,buffer,0x100000); | |
| 313 | ||
| 314 | chsuper_tilexor = 0x0000; | |
| 264 | 315 | } |
| 265 | 316 | |
| 317 | static DRIVER_INIT( chmpnum ) | |
| 318 | { | |
| 319 | UINT8 *buffer; | |
| 320 | UINT8 *rom = memory_region(machine,"gfx1"); | |
| 321 | int i; | |
| 266 | 322 | |
| 267 | GAME( 1999, chsuper3, 0, chsuper, chsuper, chsuper3, ROT0, "<unknown>", "Champion Super 3 (V0.35)", GAME_NO_SOUND ) //24/02/99 | |
| 268 | GAME( 1999, chsuper2, chsuper3, chsuper, chsuper, chsuper2, ROT0, "<unknown>", "Champion Super 2 (V0.13)", GAME_NO_SOUND ) //26/01/99 | |
| 323 | chsuper_tilexor = 0x1800; | |
| 324 | ||
| 325 | buffer = auto_alloc_array(machine, UINT8, 0x100000); | |
| 326 | ||
| 327 | for (i=0;i<0x100000;i++) | |
| 328 | { | |
| 329 | int j; | |
| 330 | ||
| 331 | j = i ^ (chsuper_tilexor << 5); | |
| 332 | ||
| 333 | j = BITSWAP24(j,23,22,21,20,19,18,17,13, 15,14,16,12, 11,10,9,8, 7,6,5,4, 3,2,1,0); | |
| 334 | j = BITSWAP24(j,23,22,21,20,19,18,17,14, 15,16,13,12, 11,10,9,8, 7,6,5,4, 3,2,1,0); | |
| 335 | j = BITSWAP24(j,23,22,21,20,19,18,17,15, 16,14,13,12, 11,10,9,8, 7,6,5,4, 3,2,1,0); | |
| 336 | ||
| 337 | buffer[j] = rom[i]; | |
| 338 | } | |
| 339 | ||
| 340 | memcpy(rom,buffer,0x100000); | |
| 341 | ||
| 342 | chsuper_tilexor = 0x0000; | |
| 343 | } | |
| 344 | ||
| 345 | ||
| 346 | GAME( 1999, chsuper3, 0, chsuper, chsuper, chsuper3, ROT0, "<unknown>", "Champion Super 3 (V0.35)", GAME_IMPERFECT_SOUND ) //24/02/99 | |
| 347 | GAME( 1999, chsuper2, chsuper3, chsuper, chsuper, chsuper2, ROT0, "<unknown>", "Champion Super 2 (V0.13)", GAME_IMPERFECT_SOUND ) //26/01/99 | |
| 348 | GAME( 1999, chmpnum, chsuper3, chsuper, chsuper, chmpnum, ROT0, "<unknown>", "Champion Number (V0.74)", GAME_IMPERFECT_SOUND ) //10/11/99 |
| r7500 | r7501 | |
|---|---|---|
| 116 | 116 | #include "emu.h" |
| 117 | 117 | #include "cpu/z80/z80.h" |
| 118 | 118 | #include "sound/ay8910.h" |
| 119 | #include "includes/mermaid.h" | |
| 119 | 120 | |
| 120 | extern UINT8* mermaid_videoram; | |
| 121 | extern UINT8* mermaid_colorram; | |
| 122 | extern UINT8* mermaid_videoram2; | |
| 123 | extern UINT8* mermaid_bg_scrollram; | |
| 124 | extern UINT8* mermaid_fg_scrollram; | |
| 125 | ||
| 126 | WRITE8_HANDLER( mermaid_videoram2_w ); | |
| 127 | WRITE8_HANDLER( mermaid_videoram_w ); | |
| 128 | WRITE8_HANDLER( mermaid_colorram_w ); | |
| 129 | WRITE8_HANDLER( mermaid_flip_screen_x_w ); | |
| 130 | WRITE8_HANDLER( mermaid_flip_screen_y_w ); | |
| 131 | WRITE8_HANDLER( mermaid_bg_scroll_w ); | |
| 132 | WRITE8_HANDLER( mermaid_fg_scroll_w ); | |
| 133 | WRITE8_HANDLER( rougien_gfxbankswitch1_w ); | |
| 134 | WRITE8_HANDLER( rougien_gfxbankswitch2_w ); | |
| 135 | READ8_HANDLER( mermaid_collision_r ); | |
| 136 | ||
| 137 | PALETTE_INIT( mermaid ); | |
| 138 | VIDEO_START( mermaid ); | |
| 139 | VIDEO_UPDATE( mermaid ); | |
| 140 | VIDEO_EOF( mermaid ); | |
| 141 | ||
| 142 | ||
| 143 | 121 | /* Read/Write Handlers */ |
| 144 | 122 | |
| 145 | static UINT8 *mermaid_ay8910_enable; | |
| 146 | ||
| 147 | 123 | static WRITE8_HANDLER( mermaid_ay8910_write_port_w ) |
| 148 | 124 | { |
| 149 | if (mermaid_ay8910_enable[0]) ay8910_data_w(devtag_get_device(space->machine, "ay1"), offset, data); | |
| 150 | if (mermaid_ay8910_enable[1]) ay8910_data_w(devtag_get_device(space->machine, "ay2"), offset, data); | |
| 125 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 126 | if (state->ay8910_enable[0]) ay8910_data_w(state->ay1, offset, data); | |
| 127 | if (state->ay8910_enable[1]) ay8910_data_w(state->ay2, offset, data); | |
| 151 | 128 | } |
| 152 | 129 | |
| 153 | 130 | static WRITE8_HANDLER( mermaid_ay8910_control_port_w ) |
| 154 | 131 | { |
| 155 | if (mermaid_ay8910_enable[0]) ay8910_address_w(devtag_get_device(space->machine, "ay1"), offset, data); | |
| 156 | if (mermaid_ay8910_enable[1]) ay8910_address_w(devtag_get_device(space->machine, "ay2"), offset, data); | |
| 132 | mermaid_state *state = (mermaid_state *)space->machine->driver_data; | |
| 133 | if (state->ay8910_enable[0]) ay8910_address_w(state->ay1, offset, data); | |
| 134 | if (state->ay8910_enable[1]) ay8910_address_w(state->ay2, offset, data); | |
| 157 | 135 | } |
| 158 | 136 | |
| 159 | 137 | |
| r7500 | r7501 | |
| 162 | 140 | static ADDRESS_MAP_START( mermaid_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 163 | 141 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 164 | 142 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 165 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(mermaid_videoram2_w) AM_BASE(&mermaid_videoram2) | |
| 166 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(mermaid_videoram_w) AM_BASE(&mermaid_videoram) | |
| 167 | AM_RANGE(0xd800, 0xd81f) AM_RAM_WRITE(mermaid_bg_scroll_w) AM_BASE(&mermaid_bg_scrollram) | |
| 168 | AM_RANGE(0xd840, 0xd85f) AM_RAM_WRITE(mermaid_fg_scroll_w) AM_BASE(&mermaid_fg_scrollram) | |
| 169 | AM_RANGE(0xd880, 0xd8bf) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 170 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(mermaid_colorram_w) AM_BASE(&mermaid_colorram) | |
| 143 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(mermaid_videoram2_w) AM_BASE_MEMBER(mermaid_state, videoram2) | |
| 144 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(mermaid_videoram_w) AM_BASE_MEMBER(mermaid_state, videoram) | |
| 145 | AM_RANGE(0xd800, 0xd81f) AM_RAM_WRITE(mermaid_bg_scroll_w) AM_BASE_MEMBER(mermaid_state, bg_scrollram) | |
| 146 | AM_RANGE(0xd840, 0xd85f) AM_RAM_WRITE(mermaid_fg_scroll_w) AM_BASE_MEMBER(mermaid_state, fg_scrollram) | |
| 147 | AM_RANGE(0xd880, 0xd8bf) AM_RAM AM_BASE_SIZE_MEMBER(mermaid_state, spriteram, spriteram_size) | |
| 148 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(mermaid_colorram_w) AM_BASE_MEMBER(mermaid_state, colorram) | |
| 171 | 149 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW") |
| 172 | AM_RANGE(0xe000, 0xe001) AM_RAM AM_BASE( | |
| 150 | AM_RANGE(0xe000, 0xe001) AM_RAM AM_BASE_MEMBER( | |
| 173 | 151 | AM_RANGE(0xe002, 0xe002) AM_WRITENOP // ??? |
| 174 | 152 | AM_RANGE(0xe003, 0xe003) AM_WRITENOP // ??? |
| 175 | 153 | AM_RANGE(0xe004, 0xe004) AM_WRITENOP // ??? |
| r7500 | r7501 | |
| 348 | 326 | |
| 349 | 327 | /* Machine Driver */ |
| 350 | 328 | |
| 329 | static MACHINE_START( mermaid ) | |
| 330 | { | |
| 331 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 332 | ||
| 333 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 334 | state->ay1 = devtag_get_device(machine, "ay1"); | |
| 335 | state->ay2 = devtag_get_device(machine, "ay2"); | |
| 336 | ||
| 337 | state_save_register_global(machine, state->coll_bit0); | |
| 338 | state_save_register_global(machine, state->coll_bit1); | |
| 339 | state_save_register_global(machine, state->coll_bit2); | |
| 340 | state_save_register_global(machine, state->coll_bit3); | |
| 341 | state_save_register_global(machine, state->coll_bit6); | |
| 342 | state_save_register_global(machine, state->rougien_gfxbank1); | |
| 343 | state_save_register_global(machine, state->rougien_gfxbank2); | |
| 344 | } | |
| 345 | ||
| 346 | static MACHINE_RESET( mermaid ) | |
| 347 | { | |
| 348 | mermaid_state *state = (mermaid_state *)machine->driver_data; | |
| 349 | ||
| 350 | state->coll_bit0 = 0; | |
| 351 | state->coll_bit1 = 0; | |
| 352 | state->coll_bit2 = 0; | |
| 353 | state->coll_bit3 = 0; | |
| 354 | state->coll_bit6 = 0; | |
| 355 | state->rougien_gfxbank1 = 0; | |
| 356 | state->rougien_gfxbank2 = 0; | |
| 357 | } | |
| 358 | ||
| 351 | 359 | static MACHINE_DRIVER_START( mermaid ) |
| 352 | // basic machine hardware | |
| 360 | ||
| 361 | /* driver data */ | |
| 362 | MDRV_DRIVER_DATA(mermaid_state) | |
| 363 | ||
| 364 | /* basic machine hardware */ | |
| 353 | 365 | MDRV_CPU_ADD("maincpu", Z80, 4000000) // ??? |
| 354 | 366 | MDRV_CPU_PROGRAM_MAP(mermaid_map) |
| 355 | 367 | MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse) |
| 356 | 368 | |
| 357 | // video hardware | |
| 369 | MDRV_MACHINE_START(mermaid) | |
| 370 | MDRV_MACHINE_RESET(mermaid) | |
| 358 | 371 | |
| 372 | /* video hardware */ | |
| 359 | 373 | MDRV_SCREEN_ADD("screen", RASTER) |
| 360 | 374 | MDRV_SCREEN_REFRESH_RATE(60) |
| 361 | 375 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| r7500 | r7501 | |
| 371 | 385 | MDRV_VIDEO_UPDATE(mermaid) |
| 372 | 386 | MDRV_VIDEO_EOF(mermaid) |
| 373 | 387 | |
| 374 | / | |
| 388 | /* sound hardware */ | |
| 375 | 389 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 376 | 390 | |
| 377 | 391 | MDRV_SOUND_ADD("ay1", AY8910, 1500000) |
| r7500 | r7501 | |
| 486 | 500 | |
| 487 | 501 | /* Game Drivers */ |
| 488 | 502 | |
| 489 | GAME( 1982, mermaid, 0, mermaid, mermaid, 0, ROT0, "[Sanritsu] Rock-Ola", "Mermaid", 0 ) | |
| 490 | GAME( 1982, yachtmn, mermaid, mermaid, yachtmn, 0, ROT0, "[Sanritsu] Esco", "Yachtsman", 0 ) | |
| 491 | GAME( 1982, rougien, 0, mermaid, rougien, 0, ROT0, "Sanritsu", "Rougien", 0 ) | |
| 503 | GAME( 1982, mermaid, 0, mermaid, mermaid, 0, ROT0, "[Sanritsu] Rock-Ola", "Mermaid", GAME_SUPPORTS_SAVE ) | |
| 504 | GAME( 1982, yachtmn, mermaid, mermaid, yachtmn, 0, ROT0, "[Sanritsu] Esco", "Yachtsman", GAME_SUPPORTS_SAVE ) | |
| 505 | GAME( 1982, rougien, 0, mermaid, rougien, 0, ROT0, "Sanritsu", "Rougien", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | #include "emu.h" |
| 39 | 39 | #include "cpu/z80/z80.h" |
| 40 | #include "cpu/mcs48/mcs48.h" | |
| 41 | #include "machine/i8243.h" | |
| 42 | #include "sound/dac.h" | |
| 40 | 43 | #include "sound/ay8910.h" |
| 41 | 44 | #include "video/mc6845.h" |
| 42 | #include "machine/i8243.h" | |
| 43 | #include "cpu/mcs48/mcs48.h" | |
| 44 | #include "sound/dac.h" | |
| 45 | 45 | |
| 46 | static int ay_select=0; | |
| 47 | static int ack_data=0; | |
| 48 | 46 | |
| 49 | static UINT8 n7751_command; | |
| 50 | //static UINT32 n7751_rom_address; | |
| 47 | #define TILE_WIDTH 6 | |
| 51 | 48 | |
| 52 | static int tile_bank=0; | |
| 53 | 49 | |
| 54 | static int sound_addr; | |
| 55 | static int n7751_busy; | |
| 50 | class othello_state | |
| 51 | { | |
| 52 | public: | |
| 53 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, othello_state(machine)); } | |
| 56 | 54 | |
| 57 | ||
| 55 | othello_state(running | |
| 58 | 56 | |
| 57 | /* memory pointers */ | |
| 58 | UINT8 * videoram; | |
| 59 | ||
| 60 | /* video-related */ | |
| 61 | int tile_bank; | |
| 62 | ||
| 63 | /* misc */ | |
| 64 | int ay_select; | |
| 65 | int ack_data; | |
| 66 | UINT8 n7751_command; | |
| 67 | // UINT32 n7751_rom_address; | |
| 68 | int sound_addr; | |
| 69 | int n7751_busy; | |
| 70 | ||
| 71 | /* devices */ | |
| 72 | running_device *maincpu; | |
| 73 | running_device *mc6845; | |
| 74 | running_device *n7751; | |
| 75 | running_device *ay1; | |
| 76 | running_device *ay2; | |
| 77 | }; | |
| 78 | ||
| 79 | ||
| 59 | 80 | static MC6845_UPDATE_ROW( update_row ) |
| 60 | 81 | { |
| 61 | int cx,x; | |
| 82 | othello_state *state = (othello_state *)device->machine->driver_data; | |
| 83 | int cx, x; | |
| 62 | 84 | UINT32 data_address; |
| 63 | 85 | UINT32 tmp; |
| 64 | 86 | |
| 65 | 87 | const UINT8 *gfx = memory_region(device->machine, "gfx"); |
| 66 | 88 | |
| 67 | for(cx=0;cx<x_count;++cx) | |
| 89 | for(cx = 0; cx < x_count; ++cx) | |
| 68 | 90 | { |
| 69 | data_address=((device->machine->generic.videoram.u8[ma+cx]+tile_bank)<<4)|ra; | |
| 70 | tmp=gfx[data_address]|(gfx[data_address+0x2000]<<8)|(gfx[data_address+0x4000]<<16); | |
| 91 | data_address = ((state->videoram[ma + cx] + state->tile_bank) << 4) | ra; | |
| 92 | tmp = gfx[data_address] | (gfx[data_address + 0x2000] << 8) | (gfx[data_address + 0x4000] << 16); | |
| 71 | 93 | |
| 72 | for(x=0;x<TILE_WIDTH;++x) | |
| 94 | for(x = 0; x < TILE_WIDTH; ++x) | |
| 73 | 95 | { |
| 74 | *BITMAP_ADDR16(bitmap, y, (cx*TILE_WIDTH+x)^1) = tmp&0x0f; | |
| 75 | tmp>>=4; | |
| 96 | *BITMAP_ADDR16(bitmap, y, (cx * TILE_WIDTH + x) ^ 1) = tmp & 0x0f; | |
| 97 | tmp >>= 4; | |
| 76 | 98 | } |
| 77 | 99 | } |
| 78 | 100 | } |
| r7500 | r7501 | |
| 80 | 102 | static PALETTE_INIT( othello ) |
| 81 | 103 | { |
| 82 | 104 | int i; |
| 83 | for (i = 0;i < machine->config->total_colors;i++) | |
| 84 | { | |
| 85 | palette_set_color(machine,i,MAKE_RGB(0xff,0x00,0xff)); | |
| 86 | } | |
| 105 | for (i = 0; i < machine->config->total_colors; i++) | |
| 106 | { | |
| 107 | palette_set_color(machine, i, MAKE_RGB(0xff, 0x00, 0xff)); | |
| 108 | } | |
| 87 | 109 | |
| 88 | /* only colors 2,3,7,9,c,d,f are used */ | |
| 89 | palette_set_color(machine,0x02,MAKE_RGB(0x00,0xff,0x00)); | |
| 90 | palette_set_color(machine,0x03,MAKE_RGB(0xff,0x7f,0x00)); | |
| 91 | palette_set_color(machine,0x07,MAKE_RGB(0x00,0x00,0x00)); | |
| 92 | palette_set_color(machine,0x09,MAKE_RGB(0xff,0x00,0x00)); | |
| 93 | palette_set_color(machine,0x0c,MAKE_RGB(0x00,0x00,0xff)); | |
| 94 | palette_set_color(machine,0x0d,MAKE_RGB(0x7f,0x7f,0x00)); | |
| 95 | palette_set_color(machine,0x0f,MAKE_RGB(0xff,0xff,0xff)); | |
| 110 | /* only colors 2,3,7,9,c,d,f are used */ | |
| 111 | palette_set_color(machine, 0x02, MAKE_RGB(0x00, 0xff, 0x00)); | |
| 112 | palette_set_color(machine, 0x03, MAKE_RGB(0xff, 0x7f, 0x00)); | |
| 113 | palette_set_color(machine, 0x07, MAKE_RGB(0x00, 0x00, 0x00)); | |
| 114 | palette_set_color(machine, 0x09, MAKE_RGB(0xff, 0x00, 0x00)); | |
| 115 | palette_set_color(machine, 0x0c, MAKE_RGB(0x00, 0x00, 0xff)); | |
| 116 | palette_set_color(machine, 0x0d, MAKE_RGB(0x7f, 0x7f, 0x00)); | |
| 117 | palette_set_color(machine, 0x0f, MAKE_RGB(0xff, 0xff, 0xff)); | |
| 96 | 118 | } |
| 97 | 119 | |
| 98 | 120 | static VIDEO_UPDATE( othello ) |
| 99 | 121 | { |
| 100 | running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); | |
| 101 | mc6845_update(mc6845, bitmap, cliprect); | |
| 122 | othello_state *state = (othello_state *)screen->machine->driver_data; | |
| 123 | ||
| 124 | mc6845_update(state->mc6845, bitmap, cliprect); | |
| 102 | 125 | return 0; |
| 103 | 126 | } |
| 104 | 127 | |
| 105 | 128 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 106 | 129 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 107 | 130 | AM_RANGE(0x8000, 0x97ff) AM_NOP /* not populated */ |
| 108 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE_ | |
| 131 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE_MEMBER | |
| 109 | 132 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 110 | 133 | ADDRESS_MAP_END |
| 111 | 134 | |
| r7500 | r7501 | |
| 115 | 138 | return mame_rand(space->machine); |
| 116 | 139 | } |
| 117 | 140 | |
| 118 | static WRITE8_HANDLER(unk_8a_w) | |
| 141 | static WRITE8_HANDLER( unk_8a_w ) | |
| 119 | 142 | { |
| 120 | 143 | /* |
| 121 | n7751_command = (data & 0x07); | |
| 122 | cputag_set_input_line(space->machine, "n7751", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 123 | //cputag_set_input_line(device->machine, "n7751", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 144 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 145 | ||
| 146 | state->n7751_command = (data & 0x07); | |
| 147 | cpu_set_input_line(state->n7751, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 148 | //cpu_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 124 | 149 | cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(100)); |
| 125 | 150 | */ |
| 126 | 151 | |
| 127 | logerror("8a -> %x\n",data); | |
| 152 | logerror("8a -> %x\n", data); | |
| 128 | 153 | } |
| 129 | 154 | |
| 130 | static WRITE8_HANDLER(unk_8c_w) | |
| 155 | static WRITE8_HANDLER( unk_8c_w ) | |
| 131 | 156 | { |
| 132 | logerror("8c -> %x\n",data); | |
| 157 | logerror("8c -> %x\n", data); | |
| 133 | 158 | } |
| 134 | 159 | |
| 135 | 160 | static READ8_HANDLER( unk_8c_r ) |
| r7500 | r7501 | |
| 137 | 162 | return mame_rand(space->machine); |
| 138 | 163 | } |
| 139 | 164 | |
| 140 | static READ8_HANDLER(sound_ack_r) | |
| 165 | static READ8_HANDLER( sound_ack_r ) | |
| 141 | 166 | { |
| 142 | return ack_data; | |
| 167 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 168 | return state->ack_data; | |
| 143 | 169 | } |
| 144 | 170 | |
| 145 | static WRITE8_HANDLER(unk_8f_w) | |
| 171 | static WRITE8_HANDLER( unk_8f_w ) | |
| 146 | 172 | { |
| 147 | logerror("8f -> %x\n",data); | |
| 173 | logerror("8f -> %x\n", data); | |
| 148 | 174 | } |
| 149 | 175 | |
| 150 | static WRITE8_HANDLER(tilebank_w) | |
| 176 | static WRITE8_HANDLER( tilebank_w ) | |
| 151 | 177 | { |
| 152 | tile_bank=data==0x0f?0x100:0x00; | |
| 153 | logerror("tilebank -> %x\n",data); | |
| 178 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 179 | state->tile_bank = (data == 0x0f) ? 0x100 : 0x00; | |
| 180 | logerror("tilebank -> %x\n", data); | |
| 154 | 181 | } |
| 155 | 182 | |
| 156 | 183 | static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 ) |
| r7500 | r7501 | |
| 168 | 195 | AM_RANGE(0x8f, 0x8f) AM_WRITE(unk_8f_w) |
| 169 | 196 | ADDRESS_MAP_END |
| 170 | 197 | |
| 171 | static READ8_HANDLER(latch_r) | |
| 198 | static READ8_HANDLER( latch_r ) | |
| 172 | 199 | { |
| 173 | int retval=soundlatch_r(space,0); | |
| 174 | soundlatch_clear_w(space,0,0); | |
| 200 | int retval = soundlatch_r(space, 0); | |
| 201 | soundlatch_clear_w(space, 0, 0); | |
| 175 | 202 | return retval; |
| 176 | 203 | } |
| 177 | 204 | |
| 178 | static WRITE8_HANDLER(ay_select_w) | |
| 205 | static WRITE8_HANDLER( ay_select_w ) | |
| 179 | 206 | { |
| 180 | ay_select=data; | |
| 207 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 208 | state->ay_select = data; | |
| 181 | 209 | } |
| 182 | 210 | |
| 183 | static WRITE8_HANDLER(ack_w) | |
| 211 | static WRITE8_HANDLER( ack_w ) | |
| 184 | 212 | { |
| 185 | ack_data=data; | |
| 213 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 214 | state->ack_data = data; | |
| 186 | 215 | } |
| 187 | 216 | |
| 188 | static WRITE8_HANDLER(ay_address_w) | |
| 217 | static WRITE8_HANDLER( ay_address_w ) | |
| 189 | 218 | { |
| 190 | if(ay_select&1) ay8910_address_w(devtag_get_device(space->machine, "ay1"),0,data); | |
| 191 | if(ay_select&2) ay8910_address_w(devtag_get_device(space->machine, "ay2"),0,data); | |
| 219 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 220 | ||
| 221 | if (state->ay_select & 1) ay8910_address_w(state->ay1, 0, data); | |
| 222 | if (state->ay_select & 2) ay8910_address_w(state->ay2, 0, data); | |
| 192 | 223 | } |
| 193 | 224 | |
| 194 | static WRITE8_HANDLER(ay_data_w) | |
| 225 | static WRITE8_HANDLER( ay_data_w ) | |
| 195 | 226 | { |
| 196 | if(ay_select&1) ay8910_data_w(devtag_get_device(space->machine, "ay1"),0,data); | |
| 197 | if(ay_select&2) ay8910_data_w(devtag_get_device(space->machine, "ay2"),0,data); | |
| 227 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 198 | 228 | |
| 229 | if (state->ay_select & 1) ay8910_data_w(state->ay1, 0, data); | |
| 230 | if (state->ay_select & 2) ay8910_data_w(state->ay2, 0, data); | |
| 199 | 231 | } |
| 200 | 232 | |
| 201 | 233 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r7500 | r7501 | |
| 214 | 246 | |
| 215 | 247 | static WRITE8_DEVICE_HANDLER( n7751_rom_control_w ) |
| 216 | 248 | { |
| 249 | othello_state *state = (othello_state *)device->machine->driver_data; | |
| 250 | ||
| 217 | 251 | /* P4 - address lines 0-3 */ |
| 218 | 252 | /* P5 - address lines 4-7 */ |
| 219 | 253 | /* P6 - address lines 8-11 */ |
| r7500 | r7501 | |
| 221 | 255 | switch (offset) |
| 222 | 256 | { |
| 223 | 257 | case 0: |
| 224 | sound_addr = (sound_addr & ~0x00f) | ((data & 0x0f) << 0); | |
| 258 | state->sound_addr = (state->sound_addr & ~0x00f) | ((data & 0x0f) << 0); | |
| 225 | 259 | break; |
| 226 | 260 | |
| 227 | 261 | case 1: |
| 228 | sound_addr = (sound_addr & ~0x0f0) | ((data & 0x0f) << 4); | |
| 262 | state->sound_addr = (state->sound_addr & ~0x0f0) | ((data & 0x0f) << 4); | |
| 229 | 263 | break; |
| 230 | 264 | |
| 231 | 265 | case 2: |
| 232 | sound_addr = (sound_addr & ~0xf00) | ((data & 0x0f) << 8); | |
| 266 | state->sound_addr = (state->sound_addr & ~0xf00) | ((data & 0x0f) << 8); | |
| 233 | 267 | break; |
| 234 | 268 | |
| 235 | 269 | case 3: |
| 236 | sound_addr &= 0xfff; | |
| 270 | state->sound_addr &= 0xfff; | |
| 237 | 271 | { |
| 238 | 272 | |
| 239 | if (!(data & 0x01) ) sound_addr |= 0x0000; | |
| 240 | if (!(data & 0x02) ) sound_addr |= 0x1000; | |
| 241 | if (!(data & 0x04) ) sound_addr |= 0x2000; | |
| 242 | if (!(data & 0x08) ) sound_addr |= 0x3000; | |
| 273 | if (!BIT(data, 0)) state->sound_addr |= 0x0000; | |
| 274 | if (!BIT(data, 1)) state->sound_addr |= 0x1000; | |
| 275 | if (!BIT(data, 2)) state->sound_addr |= 0x2000; | |
| 276 | if (!BIT(data, 3)) state->sound_addr |= 0x3000; | |
| 243 | 277 | } |
| 244 | 278 | break; |
| 245 | 279 | } |
| r7500 | r7501 | |
| 247 | 281 | |
| 248 | 282 | static READ8_HANDLER( n7751_rom_r ) |
| 249 | 283 | { |
| 250 | return memory_region(space->machine, "n7751data")[sound_addr]; | |
| 284 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 285 | return memory_region(space->machine, "n7751data")[state->sound_addr]; | |
| 251 | 286 | } |
| 252 | 287 | |
| 253 | 288 | static READ8_HANDLER( n7751_command_r ) |
| 254 | 289 | { |
| 255 | return 0x80 | ((n7751_command & 0x07) << 4); | |
| 290 | othello_state *state = (othello_state *)space->machine->driver_data; | |
| 291 | return 0x80 | ((state->n7751_command & 0x07) << 4); | |
| 256 | 292 | } |
| 257 | 293 | |
| 258 | 294 | static WRITE8_DEVICE_HANDLER( n7751_p2_w ) |
| 259 | 295 | { |
| 296 | othello_state *state = (othello_state *)device->machine->driver_data; | |
| 297 | ||
| 260 | 298 | /* write to P2; low 4 bits go to 8243 */ |
| 261 | 299 | i8243_p2_w(device, offset, data & 0x0f); |
| 262 | 300 | |
| 263 | 301 | /* output of bit $80 indicates we are ready (1) or busy (0) */ |
| 264 | 302 | /* no other outputs are used */ |
| 265 | n7751_busy = data; | |
| 303 | state->n7751_busy = data; | |
| 266 | 304 | } |
| 267 | 305 | |
| 268 | 306 | static READ8_HANDLER( n7751_t1_r ) |
| r7500 | r7501 | |
| 340 | 378 | NULL /* update address callback */ |
| 341 | 379 | }; |
| 342 | 380 | |
| 381 | ||
| 382 | static MACHINE_START( othello ) | |
| 383 | { | |
| 384 | othello_state *state = (othello_state *)machine->driver_data; | |
| 385 | ||
| 386 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 387 | state->mc6845 = devtag_get_device(machine, "crtc"); | |
| 388 | state->n7751 = devtag_get_device(machine, "n7751"); | |
| 389 | state->ay1 = devtag_get_device(machine, "ay1"); | |
| 390 | state->ay2 = devtag_get_device(machine, "ay2"); | |
| 391 | ||
| 392 | state_save_register_global(machine, state->tile_bank); | |
| 393 | state_save_register_global(machine, state->ay_select); | |
| 394 | state_save_register_global(machine, state->ack_data); | |
| 395 | state_save_register_global(machine, state->n7751_command); | |
| 396 | state_save_register_global(machine, state->sound_addr); | |
| 397 | state_save_register_global(machine, state->n7751_busy); | |
| 398 | } | |
| 399 | ||
| 400 | static MACHINE_RESET( othello ) | |
| 401 | { | |
| 402 | othello_state *state = (othello_state *)machine->driver_data; | |
| 403 | ||
| 404 | state->tile_bank = 0; | |
| 405 | state->ay_select = 0; | |
| 406 | state->ack_data = 0; | |
| 407 | state->n7751_command = 0; | |
| 408 | state->sound_addr = 0; | |
| 409 | state->n7751_busy = 0; | |
| 410 | } | |
| 411 | ||
| 343 | 412 | static MACHINE_DRIVER_START( othello ) |
| 344 | 413 | |
| 414 | /* driver data */ | |
| 415 | MDRV_DRIVER_DATA(othello_state) | |
| 416 | ||
| 345 | 417 | /* basic machine hardware */ |
| 346 | 418 | MDRV_CPU_ADD("maincpu",Z80,XTAL_8MHz/2) |
| 347 | 419 | MDRV_CPU_PROGRAM_MAP(main_map) |
| r7500 | r7501 | |
| 357 | 429 | |
| 358 | 430 | MDRV_I8243_ADD("n7751_8243", NULL, n7751_rom_control_w) |
| 359 | 431 | |
| 432 | MDRV_MACHINE_START(othello) | |
| 433 | MDRV_MACHINE_RESET(othello) | |
| 360 | 434 | |
| 361 | 435 | /* video hardware */ |
| 362 | 436 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 406 | 480 | ROM_LOAD( "7.ic42", 0x4000, 0x2000, CRC(a76705f7) SHA1(b7d2a65d65d065732ddd0b3b738749369b382b48)) |
| 407 | 481 | ROM_END |
| 408 | 482 | |
| 409 | GAME( 1984, othello, 0, othello, othello, 0, ROT0, "Success", "Othello (version 3.0)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND ) | |
| 483 | GAME( 1984, othello, 0, othello, othello, 0, ROT0, "Success", "Othello (version 3.0)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #include "sound/2151intf.h" |
| 18 | 18 | #include "sound/okim6295.h" |
| 19 | 19 | |
| 20 | typedef struct _mosaicf2_state mosaicf2_state; | |
| 21 | struct _mosaicf2_state | |
| 20 | class mosaicf2_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mosaicf2_state(machine)); } | |
| 24 | ||
| 25 | mosaicf2_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* memory pointers */ |
| 24 | 28 | UINT32 * videoram; |
| 25 | 29 | }; |
| r7500 | r7501 | |
|---|---|---|
| 126 | 126 | #include "cpu/e132xs/e132xs.h" |
| 127 | 127 | #include "sound/okim6295.h" |
| 128 | 128 | |
| 129 | typedef struct _gstream_state gstream_state; | |
| 130 | struct _gstream_state | |
| 129 | class gstream_state | |
| 131 | 130 | { |
| 131 | public: | |
| 132 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gstream_state(machine)); } | |
| 133 | ||
| 134 | gstream_state(running_machine &machine) { } | |
| 135 | ||
| 132 | 136 | /* memory pointers */ |
| 133 | 137 | UINT32 * vram; |
| 134 | 138 | UINT32 * workram; |
| r7500 | r7501 | |
|---|---|---|
| 3366 | 3366 | ROM_LOAD16_WORD_SWAP( "hs2j.03", 0x000000, 0x80000, CRC(00738f73) SHA1(99947a621f21a88dc4c425d9bfbc30b3c5f76ecd) ) |
| 3367 | 3367 | ROM_LOAD16_WORD_SWAP( "hs2j.04", 0x080000, 0x80000, CRC(40072c4a) SHA1(85b95bd3c907b4276a31777e092b8c40d3763257) ) |
| 3368 | 3368 | ROM_LOAD16_WORD_SWAP( "hs2.05", 0x100000, 0x80000, CRC(dde34a35) SHA1(f5be2d2916db6e86e0886d61d55bddf138273ebc) ) |
| 3369 | ROM_LOAD16_WORD_SWAP( "hs2.06", 0x180000, 0x80000, CRC(f4e56dda) SHA1(c6490707c2a416ab88612c2d73abbe5853d8cb92) ) /* Rom 07 needs to be verified, US & Asia 07 match */ | |
| 3370 | ROM_LOAD16_WORD_SWAP( "hs2j.07", 0x200000, 0x80000, BAD_DUMP CRC(09fe85b4) SHA1(b15b3ae28a6a395d26580dc8f4b506507792df38) ) /* 1 bit difference at 7C1AD EF <-> FF */ | |
| 3369 | ROM_LOAD16_WORD_SWAP( "hs2.06", 0x180000, 0x80000, CRC(f4e56dda) SHA1(c6490707c2a416ab88612c2d73abbe5853d8cb92) ) | |
| 3370 | ROM_LOAD16_WORD_SWAP( "hs2.07", 0x200000, 0x80000, CRC(ee4420fc) SHA1(06cf76660b0c794d2460c52d9fe8334fff51e9de) ) | |
| 3371 | 3371 | ROM_LOAD16_WORD_SWAP( "hs2.08", 0x280000, 0x80000, CRC(c9441533) SHA1(bf178fac1f060fcce3ff9118333c8517dadc9429) ) |
| 3372 | 3372 | ROM_LOAD16_WORD_SWAP( "hs2.09", 0x300000, 0x80000, CRC(3fc638a8) SHA1(2a42877b26c8abc437da46225701f0bba6e40058) ) |
| 3373 | 3373 | ROM_LOAD16_WORD_SWAP( "hs2.10", 0x380000, 0x80000, CRC(20d0f9e4) SHA1(80a5eeef9472e327b0d4ee26434bad109a9434ea) ) |
| r7500 | r7501 | |
| 7093 | 7093 | |
| 7094 | 7094 | ROM_START( xmcotaj ) |
| 7095 | 7095 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| 7096 | ROM_LOAD16_WORD_SWAP( "xmnj.03e", 0x000000, 0x80000, CRC(0df29f5f) SHA1(83993ea90e7a602c3db137d08c008dcd9bee3055) ) | |
| 7097 | ROM_LOAD16_WORD_SWAP( "xmnj.04e", 0x080000, 0x80000, CRC(4a65833b) SHA1(cd899674ba6448fb3841247d3f434e82b19c5399) ) | |
| 7098 | ROM_LOAD16_WORD_SWAP( "xmn.05a", 0x100000, 0x80000, CRC(ac0d7759) SHA1(650d4474b13f16af7910a0f721fcda2ddb2414fd) ) | |
| 7099 | ROM_LOAD16_WORD_SWAP( "xmn.06a", 0x180000, 0x80000, CRC(1b86a328) SHA1(2469cd705139ee9f1142e6e379e68d0c9675b37e) ) | |
| 7100 | ROM_LOAD16_WORD_SWAP( "xmn.07a", 0x200000, 0x80000, CRC(2c142a44) SHA1(7624875f9c39b361fc83e52e87e0fd5e96279713) ) | |
| 7101 | ROM_LOAD16_WORD_SWAP( "xmn.08a", 0x280000, 0x80000, CRC(f712d44f) SHA1(0d18d4a4eacad94a66beca6ec509ac7f690c6882) ) | |
| 7102 | ROM_LOAD16_WORD_SWAP( "xmn.09a", 0x300000, 0x80000, CRC(9241cae8) SHA1(bb6980abf25aaf3eb14e230ca6942f3e2ab2c660) ) | |
| 7103 | ROM_LOAD16_WORD_SWAP( "xmn.10a", 0x380000, 0x80000, CRC(53c0eab9) SHA1(e3b1ec1fd517735f7801cfebb257c43185c6d3fb) ) | |
| 7104 | ||
| 7105 | ROM_REGION( 0x2000000, "gfx", 0 ) | |
| 7106 | ROMX_LOAD( "xmn.13m", 0x0000000, 0x400000, CRC(bf4df073) SHA1(4d2740c3a827f0ec2cf75ad99c65e393c6a11c23) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7107 | ROMX_LOAD( "xmn.15m", 0x0000002, 0x400000, CRC(4d7e4cef) SHA1(50b8797b8099a8d76ad063ba1201a13dbb88ae3a) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7108 | ROMX_LOAD( "xmn.17m", 0x0000004, 0x400000, CRC(513eea17) SHA1(a497477ad9ac13180911d8745ef6ee1955c0b877) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7109 | ROMX_LOAD( "xmn.19m", 0x0000006, 0x400000, CRC(d23897fc) SHA1(1e31627999736652252164d32662779a1ac6ca29) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7110 | ROMX_LOAD( "xmn.14m", 0x1000000, 0x400000, CRC(778237b7) SHA1(89a759ec383518ec52f5059d10ec342f2247aa20) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7111 | ROMX_LOAD( "xmn.16m", 0x1000002, 0x400000, CRC(67b36948) SHA1(692fb6e4096b880aa22996d554b160f664bbd907) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7112 | ROMX_LOAD( "xmn.18m", 0x1000004, 0x400000, CRC(015a7c4c) SHA1(cccc95dafd076a1a9fa004710006149c42d058ba) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7113 | ROMX_LOAD( "xmn.20m", 0x1000006, 0x400000, CRC(9dde2758) SHA1(17ba259cad03c7b5d56c0a5eda9ab53521665729) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 7114 | ||
| 7115 | ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ | |
| 7116 | ROM_LOAD( "xmn.01a", 0x00000, 0x08000, CRC(40f479ea) SHA1(f29e15f537675305264ae2138a0a537fb9e2008b) ) | |
| 7117 | ROM_CONTINUE( 0x10000, 0x18000 ) | |
| 7118 | ROM_LOAD( "xmn.02a", 0x28000, 0x20000, CRC(39d9b5ad) SHA1(af502debfd36100d4fc971ed25fdf9d7121d6f18) ) | |
| 7119 | ||
| 7120 | ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */ | |
| 7121 | ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) ) | |
| 7122 | ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) ) | |
| 7123 | ROM_END | |
| 7124 | ||
| 7125 | ROM_START( xmcotaj1 ) | |
| 7126 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ | |
| 7096 | 7127 | ROM_LOAD16_WORD_SWAP( "xmnj.03d", 0x000000, 0x80000, CRC(79086d62) SHA1(d99a48bd40593aa9c1ff1fcbfc40cfe3bc882fc5) ) |
| 7097 | 7128 | ROM_LOAD16_WORD_SWAP( "xmnj.04d", 0x080000, 0x80000, CRC(38eed613) SHA1(86ecb58bf03adda705a39a9779862fe2c85cadad) ) |
| 7098 | 7129 | ROM_LOAD16_WORD_SWAP( "xmn.05", 0x100000, 0x80000, CRC(c3ed62a2) SHA1(4e3317d7ca981e33318822103a16e59f4ce20deb) ) |
| r7500 | r7501 | |
| 7122 | 7153 | ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) ) |
| 7123 | 7154 | ROM_END |
| 7124 | 7155 | |
| 7125 | ROM_START( xmcotaj | |
| 7156 | ROM_START( xmcotaj2 ) | |
| 7126 | 7157 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| 7127 | 7158 | ROM_LOAD16_WORD_SWAP( "xmnj.03b", 0x000000, 0x80000, CRC(c8175fb3) SHA1(ea25bd165f8794324a1e07719312798cf9742924) ) |
| 7128 | 7159 | ROM_LOAD16_WORD_SWAP( "xmnj.04b", 0x080000, 0x80000, CRC(54b3fba3) SHA1(47eaff5d36a45e4196f87ed3d02e54d5407e7962) ) |
| r7500 | r7501 | |
| 7153 | 7184 | ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) ) |
| 7154 | 7185 | ROM_END |
| 7155 | 7186 | |
| 7156 | ROM_START( xmcotaj | |
| 7187 | ROM_START( xmcotaj3 ) | |
| 7157 | 7188 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| 7158 | 7189 | ROM_LOAD16_WORD_SWAP( "xmnj.03a", 0x000000, 0x80000, CRC(00761611) SHA1(e780dbe1d21a0d5b6981f0395942c9fa59688113) ) |
| 7159 | 7190 | ROM_LOAD16_WORD_SWAP( "xmnj.04a", 0x080000, 0x80000, CRC(614d3f60) SHA1(2272ae243557562a0bc85d2cd2b37dd876f6902c) ) |
| r7500 | r7501 | |
| 7719 | 7750 | GAME( 1994, xmcota, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Euro 950105)", GAME_SUPPORTS_SAVE ) |
| 7720 | 7751 | GAME( 1994, xmcotau, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (USA 950105)", GAME_SUPPORTS_SAVE ) |
| 7721 | 7752 | GAME( 1994, xmcotah, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", GAME_SUPPORTS_SAVE ) |
| 7722 | GAME( 1994, xmcotaj, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941222)", GAME_SUPPORTS_SAVE ) | |
| 7723 | GAME( 1994, xmcotaj1, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941219)", GAME_SUPPORTS_SAVE ) | |
| 7724 | GAME( 1994, xmcotaj2, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941217)", GAME_SUPPORTS_SAVE ) | |
| 7753 | GAME( 1994, xmcotaj, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 950105)", GAME_SUPPORTS_SAVE ) | |
| 7754 | GAME( 1994, xmcotaj1, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941222)", GAME_SUPPORTS_SAVE ) | |
| 7755 | GAME( 1994, xmcotaj2, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941219)", GAME_SUPPORTS_SAVE ) | |
| 7756 | GAME( 1994, xmcotaj3, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941217)", GAME_SUPPORTS_SAVE ) | |
| 7725 | 7757 | GAME( 1994, xmcotajr, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", GAME_SUPPORTS_SAVE ) |
| 7726 | 7758 | GAME( 1994, xmcotaa, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Asia 941217)", GAME_SUPPORTS_SAVE ) |
| 7727 | 7759 | GAME( 1995, nwarr, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | The hardware is actually very similar to F1-Dream and Tiger Road but |
| 16 | 16 | with a 68705 for protection. |
| 17 | 17 | |
| 18 | There is a Top Tronic licensed version currently not dumped | |
| 18 | Pushman is known to be released in a 2 PCB stack as well as a large | |
| 19 | single plane board. | |
| 19 | 20 | |
| 20 | 21 | ************************************************************************** |
| 21 | 22 | |
| r7500 | r7501 | |
| 507 | 508 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 508 | 509 | ROM_LOAD( "pushman.013", 0x00000, 0x08000, CRC(adfe66c1) SHA1(fa4ed13d655c664b06e9b91292d2c0a88cb5a569) ) |
| 509 | 510 | |
| 510 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 3 currently dumped versions */ | |
| 511 | ROM_LOAD( "pushman68705r3.bin", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 511 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 4 currently dumped versions */ | |
| 512 | ROM_LOAD( "pushman68705r3p.ic23", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 512 | 513 | |
| 513 | 514 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 514 | 515 | ROM_LOAD( "pushman.001", 0x00000, 0x08000, CRC(626e5865) SHA1(4ab96c8512f439d18390094d71a898f5c576399c) ) |
| r7500 | r7501 | |
| 527 | 528 | |
| 528 | 529 | ROM_REGION( 0x10000, "gfx4", 0 ) /* bg tilemaps */ |
| 529 | 530 | ROM_LOAD( "pushman.010", 0x00000, 0x08000, CRC(a500132d) SHA1(26b02c9fea69b51c5f7dc1b43b838cd336ebf862) ) |
| 531 | ||
| 532 | ROM_REGION( 0x0100, "proms", 0 ) /* this is the same as tiger road / f1-dream */ | |
| 533 | ROM_LOAD( "n82s129an.ic82", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) */ | |
| 530 | 534 | ROM_END |
| 531 | 535 | |
| 532 | 536 | ROM_START( pushmana ) |
| r7500 | r7501 | |
| 537 | 541 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 538 | 542 | ROM_LOAD( "pushman.013", 0x00000, 0x08000, CRC(adfe66c1) SHA1(fa4ed13d655c664b06e9b91292d2c0a88cb5a569) ) // missing from this set? |
| 539 | 543 | |
| 540 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 3 currently dumped versions */ | |
| 541 | ROM_LOAD( "pushman68705r3.bin", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 544 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 4 currently dumped versions */ | |
| 545 | ROM_LOAD( "pushman68705r3p.ic23", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 542 | 546 | |
| 543 | 547 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 544 | 548 | ROM_LOAD( "pushmana.130", 0x00000, 0x10000, CRC(f83f92e7) SHA1(37f337d7b496f8d81eed247c80390a6aabcf4b95) ) |
| r7500 | r7501 | |
| 557 | 561 | |
| 558 | 562 | ROM_REGION( 0x10000, "gfx4", 0 ) /* bg tilemaps */ |
| 559 | 563 | ROM_LOAD( "pushmana.189", 0x00000, 0x10000, CRC(59f25598) SHA1(ace33afd6e6d07376ed01048db99b13bcec790d7) ) |
| 564 | ||
| 565 | ROM_REGION( 0x0100, "proms", 0 ) /* this is the same as tiger road / f1-dream */ | |
| 566 | ROM_LOAD( "n82s129an.ic82", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) */ | |
| 560 | 567 | ROM_END |
| 561 | 568 | |
| 562 | 569 | ROM_START( pushmans ) |
| 563 | 570 | ROM_REGION( 0x20000, "maincpu", 0 ) |
| 564 | ROM_LOAD16_BYTE( "pman-12.212", 0x000000, 0x10000, CRC(4251109d) SHA1(d4b020e4ecc2005b3a4c1b34d88de82b09bf5a6b) ) | |
| 565 | ROM_LOAD16_BYTE( "pman-11.197", 0x000001, 0x10000, CRC(1167ed9f) SHA1(ca0296950a75ef15ff6f9d3a776b02180b941d61) ) | |
| 571 | ROM_LOAD16_BYTE( "pman-12.ic212", 0x000000, 0x10000, CRC(4251109d) SHA1(d4b020e4ecc2005b3a4c1b34d88de82b09bf5a6b) ) | |
| 572 | ROM_LOAD16_BYTE( "pman-11.ic197", 0x000001, 0x10000, CRC(1167ed9f) SHA1(ca0296950a75ef15ff6f9d3a776b02180b941d61) ) | |
| 566 | 573 | |
| 567 | 574 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 568 | ROM_LOAD( "pman-13.216", 0x00000, 0x08000, CRC(bc03827a) SHA1(b4d6ae164bbb7ba19e4934392fe2ba29575f28b9) ) | |
| 575 | ROM_LOAD( "pman-13.ic216", 0x00000, 0x08000, CRC(bc03827a) SHA1(b4d6ae164bbb7ba19e4934392fe2ba29575f28b9) ) | |
| 569 | 576 | |
| 570 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 3 currently dumped versions */ | |
| 571 | ROM_LOAD( "pushman68705r3.bin", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 577 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 4 currently dumped versions */ | |
| 578 | ROM_LOAD( "pushman68705r3p.ic23", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 572 | 579 | |
| 573 | 580 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 574 | ROM_LOAD( "pman-1.130", 0x00000, 0x08000, CRC(14497754) SHA1(a47d03c56add18c5d9aed221990550b18589ff43) ) | |
| 581 | ROM_LOAD( "pman-1.ic130", 0x00000, 0x08000, CRC(14497754) SHA1(a47d03c56add18c5d9aed221990550b18589ff43) ) | |
| 575 | 582 | |
| 576 | 583 | ROM_REGION( 0x40000, "gfx2", 0 ) |
| 577 | ROM_LOAD( "pman-4.58", 0x00000, 0x10000, CRC(16e5ce6b) SHA1(cb9c6094a853abc550eae29c35083f26a0d1de94) ) | |
| 578 | ROM_LOAD( "pman-5.59", 0x10000, 0x10000, CRC(b82140b8) SHA1(0a16b904eb2739bfa22a87d03266d3ff2b750b67) ) | |
| 584 | ROM_LOAD( "pman-4.ic58", 0x00000, 0x10000, CRC(16e5ce6b) SHA1(cb9c6094a853abc550eae29c35083f26a0d1de94) ) | |
| 585 | ROM_LOAD( "pman-5.ic59", 0x10000, 0x10000, CRC(b82140b8) SHA1(0a16b904eb2739bfa22a87d03266d3ff2b750b67) ) | |
| 579 | 586 | ROM_LOAD( "pman-2.56", 0x20000, 0x10000, CRC(2cb2ac29) SHA1(165447ad7eb8593c0d4346096ec13ac386e905c9) ) |
| 580 | 587 | ROM_LOAD( "pman-3.57", 0x30000, 0x10000, CRC(8ab957c8) SHA1(143501819920c521353930f83e49f1e19fbba34f) ) |
| 581 | 588 | |
| 582 | 589 | ROM_REGION( 0x40000, "gfx3", 0 ) |
| 583 | ROM_LOAD( "pman-6.131", 0x00000, 0x10000, CRC(bd0f9025) SHA1(7262410d4631f1b051c605d5cea5b91e9f68327e) ) | |
| 584 | ROM_LOAD( "pman-8.148", 0x10000, 0x10000, CRC(591bd5c0) SHA1(6e0e18e0912fa38e113420ac31c7f36853b830ec) ) | |
| 585 | ROM_LOAD( "pman-7.132", 0x20000, 0x10000, CRC(208cb197) SHA1(161633b6b0acf25447a5c0b3c6fbf18adc6e2243) ) | |
| 586 | ROM_LOAD( "pman-9.149", 0x30000, 0x10000, CRC(77ee8577) SHA1(63d13683dd097d8e7cb71ad3abe04e11f2a58bd3) ) | |
| 590 | ROM_LOAD( "pman-6.ic131", 0x00000, 0x10000, CRC(bd0f9025) SHA1(7262410d4631f1b051c605d5cea5b91e9f68327e) ) | |
| 591 | ROM_LOAD( "pman-8.ic148", 0x10000, 0x10000, CRC(591bd5c0) SHA1(6e0e18e0912fa38e113420ac31c7f36853b830ec) ) | |
| 592 | ROM_LOAD( "pman-7.ic132", 0x20000, 0x10000, CRC(208cb197) SHA1(161633b6b0acf25447a5c0b3c6fbf18adc6e2243) ) | |
| 593 | ROM_LOAD( "pman-9.ic149", 0x30000, 0x10000, CRC(77ee8577) SHA1(63d13683dd097d8e7cb71ad3abe04e11f2a58bd3) ) | |
| 587 | 594 | |
| 588 | 595 | ROM_REGION( 0x10000, "gfx4", 0 ) /* bg tilemaps */ |
| 589 | ROM_LOAD( "pman-10.189", 0x00000, 0x08000, CRC(5f9ae9a1) SHA1(87619918c28c942780f6dbd3818d4cc69932eefc) ) | |
| 596 | ROM_LOAD( "pman-10.ic189", 0x00000, 0x08000, CRC(5f9ae9a1) SHA1(87619918c28c942780f6dbd3818d4cc69932eefc) ) | |
| 597 | ||
| 598 | ROM_REGION( 0x0100, "proms", 0 ) /* this is the same as tiger road / f1-dream */ | |
| 599 | ROM_LOAD( "n82s129an.ic82", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) */ | |
| 590 | 600 | ROM_END |
| 591 | 601 | |
| 602 | ROM_START( pushmant ) /* Single plane PCB */ | |
| 603 | ROM_REGION( 0x20000, "maincpu", 0 ) | |
| 604 | ROM_LOAD16_BYTE( "12.ic212", 0x000000, 0x10000, CRC(f5c77d86) SHA1(66d2d5dc9f4662efc5a865c9cc1bba653e86a674) ) | |
| 605 | ROM_LOAD16_BYTE( "11.ic197", 0x000001, 0x10000, CRC(2e09ff08) SHA1(9bb05c51c985c3a12fb8d6fd915276e304651eb1) ) | |
| 606 | ||
| 607 | ROM_REGION( 0x10000, "audiocpu", 0 ) | |
| 608 | ROM_LOAD( "13.ic216", 0x00000, 0x08000, CRC(adfe66c1) SHA1(fa4ed13d655c664b06e9b91292d2c0a88cb5a569) ) /* Same as the Comad set */ | |
| 609 | ||
| 610 | ROM_REGION( 0x01000, "mcu", 0 ) /* Verified same for all 4 currently dumped versions */ | |
| 611 | ROM_LOAD( "pushman68705r3p.ic23", 0x00000, 0x01000, CRC(d7916657) SHA1(89c14c6044f082fffe2a8f86d0a82336f4a110a2) ) | |
| 612 | ||
| 613 | ROM_REGION( 0x10000, "gfx1", 0 ) | |
| 614 | ROM_LOAD( "1.ic130", 0x00000, 0x08000, CRC(14497754) SHA1(a47d03c56add18c5d9aed221990550b18589ff43) ) /* Same as the Sammy set */ | |
| 615 | ||
| 616 | ROM_REGION( 0x40000, "gfx2", 0 ) | |
| 617 | ROM_LOAD( "4.ic58", 0x00000, 0x10000, CRC(69209214) SHA1(c5b527234aefbdfb39864806e2b1784fdf2dd49c) ) | |
| 618 | ROM_LOAD( "5.ic59", 0x10000, 0x10000, CRC(75fc0ac4) SHA1(aa3a19573b96d89b94bfddda5b404d19cbb47335) ) | |
| 619 | ROM_LOAD( "2.ic56", 0x20000, 0x10000, CRC(2bb8093f) SHA1(e86048d676b06796a1d2ed325ea8ea9cada3c4b6) ) | |
| 620 | ROM_LOAD( "3.ic57", 0x30000, 0x10000, CRC(5f1c4e7a) SHA1(751caf2365eccbab6d7de5434c4656ac5bd7f13b) ) | |
| 621 | ||
| 622 | ROM_REGION( 0x40000, "gfx3", 0 ) | |
| 623 | ROM_LOAD( "6.ic131", 0x00000, 0x10000, CRC(bd0f9025) SHA1(7262410d4631f1b051c605d5cea5b91e9f68327e) ) /* These 4 are the same as the Sammy set */ | |
| 624 | ROM_LOAD( "8.ic148", 0x10000, 0x10000, CRC(591bd5c0) SHA1(6e0e18e0912fa38e113420ac31c7f36853b830ec) ) | |
| 625 | ROM_LOAD( "7.ic132", 0x20000, 0x10000, CRC(208cb197) SHA1(161633b6b0acf25447a5c0b3c6fbf18adc6e2243) ) | |
| 626 | ROM_LOAD( "9.ic149", 0x30000, 0x10000, CRC(77ee8577) SHA1(63d13683dd097d8e7cb71ad3abe04e11f2a58bd3) ) | |
| 627 | ||
| 628 | ROM_REGION( 0x10000, "gfx4", 0 ) /* bg tilemaps */ | |
| 629 | ROM_LOAD( "10.ic189", 0x00000, 0x08000, CRC(5f9ae9a1) SHA1(87619918c28c942780f6dbd3818d4cc69932eefc) ) /* Same as the Sammy set */ | |
| 630 | ||
| 631 | ROM_REGION( 0x0100, "proms", 0 ) /* this is the same as tiger road / f1-dream */ | |
| 632 | ROM_LOAD( "n82s129an.ic82", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) */ | |
| 633 | ROM_END | |
| 634 | ||
| 592 | 635 | ROM_START( bballs ) |
| 593 | 636 | ROM_REGION( 0x20000, "maincpu", 0 ) |
| 594 | 637 | ROM_LOAD16_BYTE( "bb12.m17", 0x000000, 0x10000, CRC(4501c245) SHA1(b03ace135b077e8c226dd3be04fa8e86ad096770) ) |
| r7500 | r7501 | |
| 619 | 662 | ROM_LOAD( "bb10.l6", 0x00000, 0x08000, CRC(d06498f9) SHA1(9f33bbc40ebe11c03aec29289f76f1c3ca5bf009) ) |
| 620 | 663 | |
| 621 | 664 | ROM_REGION( 0x0100, "proms", 0 ) /* this is the same as tiger road / f1-dream */ |
| 622 | ROM_LOAD( "bb_prom.e9", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) */ | |
| 665 | ROM_LOAD( "bb_prom.e9", 0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) ) /* priority (not used) N82S129 BPROM */ | |
| 623 | 666 | ROM_END |
| 624 | 667 | |
| 625 | 668 | GAME( 1990, pushman, 0, pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 1)", 0 ) |
| 626 | 669 | GAME( 1990, pushmana, pushman, pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 2)", 0 ) |
| 627 | 670 | GAME( 1990, pushmans, pushman, pushman, pushman, 0, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", 0 ) |
| 671 | GAME( 1990, pushmant, pushman, pushman, pushman, 0, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", 0 ) | |
| 628 | 672 | GAME( 1991, bballs, 0, bballs, bballs, 0, ROT0, "Comad", "Bouncing Balls", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 37 | 37 | Soul Calibur (SOC11/VER.B) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M5F2 KC020 |
| 38 | 38 | Soul Calibur (SOC11/VER.C) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M5F4 KC020 |
| 39 | 39 | Soul Calibur (SOC13/VER.B) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M5F4 KC020 |
| 40 | Soul Calibur (SOC14/VER.B) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M5F4 KC020 | |
| 40 | 41 | Soul Calibur (SOC14/VER.C) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER JO 11-04-98 none |
| 41 | 42 | Super World Stadium '98 (SS81/VER.A) (C) Namco, 1998 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M4F6 KC025 |
| 42 | 43 | Super World Stadium '99 (SS91/VER.A3) (C) Namco, 1999 COH-700 SYSTEM12 MOTHER(B) SYSTEM12 M5F4 KC043 |
| r7500 | r7501 | |
| 237 | 238 | Soul Calibur SOC1 Ver.A SOC11/VER.A2 MOTHER(B) |
| 238 | 239 | Soul Calibur SOC3 Ver.B SOC13/VER.B MOTHER(B) |
| 239 | 240 | Soul Calibur SOC1 Ver.C SOC11/VER.C MOTHER(B) |
| 241 | Soul Calibur SOC4 Ver.B SOC14/VER.B MOTHER(B) | |
| 240 | 242 | Super World Stadium 2000 SS01 Ver.A SS01/VER.A3 MOTHER(C) (ROMs serialised) |
| 241 | 243 | Super World Stadium 2001 SS11 Ver.A SS11/VER.A2 MOTHER(C) (ROMs serialised) |
| 242 | 244 | Tekken Tag Tournament TEG3 Ver.B TEG3/VER.B MOTHER(B) |
| r7500 | r7501 | |
| 476 | 478 | SOC1 FL4L, SOC1 FL4H |
| 477 | 479 | SOC1 FL3L, SOC1 FL3H |
| 478 | 480 | |
| 481 | Soul Calibur SOC14/VER.B SYSTEM 12 M5F4 PCB 8661961000 (8661971000) none SOC1 WAVE0 | |
| 482 | SOC1 ROM0, SOC1 ROM1, SOC1 ROM2 | |
| 483 | SOC1 FL4L, SOC1 FL4H | |
| 484 | SOC1 FL3L, SOC1 FL3H | |
| 485 | ||
| 486 | ||
| 479 | 487 | ******** |
| 480 | 488 | *Type 4* |
| 481 | 489 | ******** |
| r7500 | r7501 | |
| 1988 | 1996 | ROM_LOAD( "soc1wave0.2", 0x0000000, 0x800000, CRC(c100618d) SHA1(b87f88ee42ad9c5affa674e5f816d902143fed99) ) |
| 1989 | 1997 | ROM_END |
| 1990 | 1998 | |
| 1999 | ROM_START( soulclbrb ) | |
| 2000 | ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */ | |
| 2001 | ROM_LOAD16_BYTE( "soc14verb.2l", 0x000000, 0x200000, CRC(6af5c5f6) SHA1(51d1e7d78d95cfc765cd219ed07b405cd920044b) ) | |
| 2002 | ROM_LOAD16_BYTE( "soc14verb.2p", 0x000001, 0x200000, CRC(23e7a4c4) SHA1(a97f36cafdeff9e26fbd24e54ab8ac8080763761) ) | |
| 2003 | ||
| 2004 | ROM_REGION32_LE( 0x2000000, "user2", 0 ) /* main data */ | |
| 2005 | ROM_LOAD( "soc1rom0.7", 0x0000000, 0x800000, CRC(cdc47b55) SHA1(315ea6b819de5c4883aa400f1b9f4172637757bf) ) | |
| 2006 | ROM_LOAD( "soc1rom1.8", 0x0800000, 0x800000, CRC(30d2dd5a) SHA1(1c0c467ba339e0241efb8d5c3b025a046b2ca676) ) | |
| 2007 | ROM_LOAD( "soc1rom2.9", 0x1000000, 0x800000, CRC(dbb93955) SHA1(624cd8ad94e8ae53206f798bff81784afe95e5f1) ) | |
| 2008 | ROM_LOAD( "soc1fl3.6", 0x1800000, 0x400000, CRC(24d94c38) SHA1(0f9b9ab11dd4e02086d7b9104ce2f5d4e93cd696) ) | |
| 2009 | ROM_LOAD( "soc1fl4.5", 0x1c00000, 0x400000, CRC(6212090e) SHA1(ed5e50771180935a0c2e760e7369673098722201) ) | |
| 2010 | ||
| 2011 | ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */ | |
| 2012 | ROM_LOAD16_WORD_SWAP( "soc1vera.11s", 0x0000000, 0x080000, CRC(52aa206a) SHA1(5abe9d6f800fa1b9623aa08b16e9b959b840e50b) ) | |
| 2013 | ||
| 2014 | ROM_REGION( 0x0800000, "c352", 0 ) /* samples */ | |
| 2015 | ROM_LOAD( "soc1wave0.2", 0x0000000, 0x800000, CRC(c100618d) SHA1(b87f88ee42ad9c5affa674e5f816d902143fed99) ) | |
| 2016 | ROM_END | |
| 2017 | ||
| 1991 | 2018 | ROM_START( soulclbrj ) |
| 1992 | 2019 | ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */ |
| 1993 | 2020 | ROM_LOAD16_BYTE( "soc11verc.2l", 0x0000000, 0x200000, CRC(f5e3679c) SHA1(b426cfc7707a6772e6aabbaf4a19b7f008324d55) ) |
| r7500 | r7501 | |
| 2007 | 2034 | ROM_LOAD( "soc1wave0.2", 0x0000000, 0x800000, CRC(c100618d) SHA1(b87f88ee42ad9c5affa674e5f816d902143fed99) ) |
| 2008 | 2035 | ROM_END |
| 2009 | 2036 | |
| 2010 | ROM_START( soulclbrb ) | |
| 2037 | ROM_START( soulclbrb2 ) | |
| 2011 | 2038 | ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */ |
| 2012 | 2039 | ROM_LOAD16_BYTE( "soc13verb.2e", 0x0000000, 0x200000, CRC(ad7cfb1e) SHA1(7d1e7fd0024e31780335690906846e91ba063003) ) |
| 2013 | 2040 | ROM_LOAD16_BYTE( "soc13verb.2j", 0x0000001, 0x200000, CRC(7449c045) SHA1(1c7a8b659d0f12dded2a00bc83baeb392fd7a719) ) |
| r7500 | r7501 | |
| 2413 | 2440 | GAME( 1997, lbgrande, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Libero Grande (LG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */ |
| 2414 | 2441 | GAME( 1997, toukon3, 0, coh700, namcos12, namcos12, ROT0, "Tomy/Namco", "Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (Japan, TR1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC019 */ |
| 2415 | 2442 | GAME( 1998, soulclbr, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (SOC14/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 2443 | GAME( 1998, soulclbrb, soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (SOC14/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 2416 | 2444 | GAME( 1998, soulclbrj, soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (Japan, SOC11/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */ |
| 2417 | GAME( 1998, soulclbrb, soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (SOC13/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */ | |
| 2445 | GAME( 1998, soulclbrb2, soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (SOC13/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */ | |
| 2418 | 2446 | GAME( 1998, soulclbrjb,soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (Japan, SOC11/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */ |
| 2419 | 2447 | GAME( 1998, soulclbrja,soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (Japan, SOC11/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */ |
| 2420 | 2448 | GAME( 1998, ehrgeiz, 0, coh700, namcos12, namcos12, ROT0, "Square/Namco", "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */ |
| r7500 | r7501 | |
|---|---|---|
| 1 | /* | |
| 1 | /***************************************************************************** | |
| 2 | 2 | |
| 3 | MOLE ATTACK by Yachiyo Electronics Co.,LTD. 1982 | |
| 4 | ||
| 3 | 5 | Known Clones: |
| 4 | 6 | "Holey Moley", from tai (Thomas Automatics, Inc.) |
| 5 | 7 | |
| r7500 | r7501 | |
| 43 | 45 | 0x3DC affects mole popmessage |
| 44 | 46 | 0x3E5 round point/passing point control? |
| 45 | 47 | 0x3E7 round point/passing point control? |
| 46 | */ | |
| 47 | 48 | |
| 49 | ******************************************************************************/ | |
| 48 | 50 | |
| 49 | 51 | #include "emu.h" |
| 50 | 52 | #include "cpu/m6502/m6502.h" |
| 51 | 53 | #include "sound/ay8910.h" |
| 52 | 54 | |
| 53 | WRITE8_HANDLER(mole_videoram_w); | |
| 54 | WRITE8_HANDLER(mole_tilebank_w); | |
| 55 | WRITE8_HANDLER(mole_flipscreen_w); | |
| 56 | 55 | |
| 57 | PALETTE_INIT(mole); | |
| 58 | VIDEO_START(mole); | |
| 59 | VIDEO_UPDATE(mole); | |
| 56 | class mole_state | |
| 57 | { | |
| 58 | public: | |
| 59 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mole_state(machine)); } | |
| 60 | 60 | |
| 61 | mole_state(running_machine &machine) { } | |
| 61 | 62 | |
| 63 | /* memory pointers */ | |
| 64 | UINT16 * tileram; | |
| 65 | ||
| 66 | /* video-related */ | |
| 67 | tilemap_t *bg_tilemap; | |
| 68 | int tile_bank; | |
| 69 | }; | |
| 70 | ||
| 71 | ||
| 72 | /************************************* | |
| 73 | * | |
| 74 | * Video emulation | |
| 75 | * | |
| 76 | *************************************/ | |
| 77 | ||
| 78 | static PALETTE_INIT( mole ) | |
| 79 | { | |
| 80 | int i; | |
| 81 | ||
| 82 | for (i = 0; i < 8; i++) | |
| 83 | palette_set_color_rgb(machine, i, pal1bit(i >> 0), pal1bit(i >> 2), pal1bit(i >> 1)); | |
| 84 | } | |
| 85 | ||
| 86 | static TILE_GET_INFO( get_bg_tile_info ) | |
| 87 | { | |
| 88 | mole_state *state = (mole_state *)machine->driver_data; | |
| 89 | UINT16 code = state->tileram[tile_index]; | |
| 90 | ||
| 91 | SET_TILE_INFO((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0); | |
| 92 | } | |
| 93 | ||
| 94 | static VIDEO_START( mole ) | |
| 95 | { | |
| 96 | mole_state *state = (mole_state *)machine->driver_data; | |
| 97 | state->tileram = auto_alloc_array_clear(machine, UINT16, 0x400); | |
| 98 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25); | |
| 99 | ||
| 100 | state_save_register_global_pointer(machine, state->tileram, 0x400); | |
| 101 | } | |
| 102 | ||
| 103 | static WRITE8_HANDLER( mole_videoram_w ) | |
| 104 | { | |
| 105 | mole_state *state = (mole_state *)space->machine->driver_data; | |
| 106 | ||
| 107 | state->tileram[offset] = data | (state->tile_bank << 8); | |
| 108 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 109 | } | |
| 110 | ||
| 111 | static WRITE8_HANDLER( mole_tilebank_w ) | |
| 112 | { | |
| 113 | mole_state *state = (mole_state *)space->machine->driver_data; | |
| 114 | ||
| 115 | state->tile_bank = data; | |
| 116 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 117 | } | |
| 118 | ||
| 119 | static WRITE8_HANDLER( mole_flipscreen_w ) | |
| 120 | { | |
| 121 | flip_screen_set(space->machine, data & 0x01); | |
| 122 | } | |
| 123 | ||
| 124 | static VIDEO_UPDATE( mole ) | |
| 125 | { | |
| 126 | mole_state *state = (mole_state *)screen->machine->driver_data; | |
| 127 | ||
| 128 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 129 | return 0; | |
| 130 | } | |
| 131 | ||
| 132 | ||
| 133 | ||
| 134 | /************************************* | |
| 135 | * | |
| 136 | * Memory handlers | |
| 137 | * | |
| 138 | *************************************/ | |
| 139 | ||
| 62 | 140 | static READ8_HANDLER( mole_protection_r ) |
| 63 | 141 | { |
| 64 | 142 | |
| r7500 | r7501 | |
| 109 | 187 | } |
| 110 | 188 | |
| 111 | 189 | |
| 190 | /************************************* | |
| 191 | * | |
| 192 | * Address maps | |
| 193 | * | |
| 194 | *************************************/ | |
| 195 | ||
| 112 | 196 | static ADDRESS_MAP_START( mole_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 113 | 197 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 114 | 198 | AM_RANGE(0x0800, 0x08ff) AM_READ(mole_protection_r) |
| r7500 | r7501 | |
| 128 | 212 | ADDRESS_MAP_END |
| 129 | 213 | |
| 130 | 214 | |
| 215 | /************************************* | |
| 216 | * | |
| 217 | * Input ports | |
| 218 | * | |
| 219 | *************************************/ | |
| 220 | ||
| 131 | 221 | static INPUT_PORTS_START( mole ) |
| 132 | 222 | PORT_START("DSW") /* 0x8d00 */ |
| 133 | 223 | PORT_DIPNAME( 0x01, 0x00, "Round Points" ) |
| r7500 | r7501 | |
| 181 | 271 | INPUT_PORTS_END |
| 182 | 272 | |
| 183 | 273 | |
| 274 | /************************************* | |
| 275 | * | |
| 276 | * Graphics definitions | |
| 277 | * | |
| 278 | *************************************/ | |
| 279 | ||
| 184 | 280 | static const gfx_layout tile_layout = |
| 185 | 281 | { |
| 186 | 282 | 8,8, /* character size */ |
| r7500 | r7501 | |
| 199 | 295 | GFXDECODE_END |
| 200 | 296 | |
| 201 | 297 | |
| 298 | /************************************* | |
| 299 | * | |
| 300 | * Machine driver | |
| 301 | * | |
| 302 | *************************************/ | |
| 303 | ||
| 304 | static MACHINE_START( mole ) | |
| 305 | { | |
| 306 | mole_state *state = (mole_state *)machine->driver_data; | |
| 307 | ||
| 308 | state_save_register_global(machine, state->tile_bank); | |
| 309 | } | |
| 310 | ||
| 311 | static MACHINE_RESET( mole ) | |
| 312 | { | |
| 313 | mole_state *state = (mole_state *)machine->driver_data; | |
| 314 | ||
| 315 | state->tile_bank = 0; | |
| 316 | } | |
| 317 | ||
| 202 | 318 | static MACHINE_DRIVER_START( mole ) |
| 203 | // basic machine hardware | |
| 319 | ||
| 320 | /* driver data */ | |
| 321 | MDRV_DRIVER_DATA(mole_state) | |
| 322 | ||
| 323 | /* basic machine hardware */ | |
| 204 | 324 | MDRV_CPU_ADD("maincpu", M6502, 4000000) // ??? |
| 205 | 325 | MDRV_CPU_PROGRAM_MAP(mole_map) |
| 206 | 326 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 207 | 327 | |
| 208 | // video hardware | |
| 328 | MDRV_MACHINE_START(mole) | |
| 329 | MDRV_MACHINE_RESET(mole) | |
| 209 | 330 | |
| 331 | /* video hardware */ | |
| 210 | 332 | MDRV_SCREEN_ADD("screen", RASTER) |
| 211 | 333 | MDRV_SCREEN_REFRESH_RATE(60) |
| 212 | 334 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r7500 | r7501 | |
| 221 | 343 | MDRV_VIDEO_START(mole) |
| 222 | 344 | MDRV_VIDEO_UPDATE(mole) |
| 223 | 345 | |
| 224 | / | |
| 346 | /* sound hardware */ | |
| 225 | 347 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 226 | 348 | |
| 227 | 349 | MDRV_SOUND_ADD("aysnd", AY8910, 2000000) |
| r7500 | r7501 | |
| 229 | 351 | MACHINE_DRIVER_END |
| 230 | 352 | |
| 231 | 353 | |
| 354 | /************************************* | |
| 355 | * | |
| 356 | * ROM definition(s) | |
| 357 | * | |
| 358 | *************************************/ | |
| 359 | ||
| 232 | 360 | ROM_START( mole ) // ALL ROMS ARE 2732 |
| 233 | 361 | ROM_REGION( 0x10000, "maincpu", 0 ) // 64k for 6502 code |
| 234 | 362 | ROM_LOAD( "m3a.5h", 0x5000, 0x1000, CRC(5fbbdfef) SHA1(8129e90a05b3ca50f47f7610eec51c16c8609590) ) |
| r7500 | r7501 | |
| 245 | 373 | ROM_END |
| 246 | 374 | |
| 247 | 375 | |
| 248 | GAME( 1982, mole, 0, mole, mole, 0, ROT0, "Yachiyo Electronics, Ltd.", "Mole Attack", 0 ) | |
| 376 | /************************************* | |
| 377 | * | |
| 378 | * Game driver(s) | |
| 379 | * | |
| 380 | *************************************/ | |
| 381 | ||
| 382 | GAME( 1982, mole, 0, mole, mole, 0, ROT0, "Yachiyo Electronics, Ltd.", "Mole Attack", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 37 | 37 | #include "sound/ay8910.h" |
| 38 | 38 | |
| 39 | 39 | |
| 40 | typedef struct _dynadice_state dynadice_state; | |
| 41 | struct _dynadice_state | |
| 40 | class dynadice_state | |
| 42 | 41 | { |
| 42 | public: | |
| 43 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dynadice_state(machine)); } | |
| 44 | ||
| 45 | dynadice_state(running_machine &machine) { } | |
| 46 | ||
| 43 | 47 | /* memory pointers */ |
| 44 | 48 | UINT8 * videoram; |
| 45 | 49 | // UINT8 * nvram; // currently this uses generic nvram handling |
| r7500 | r7501 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | #define MASTER_CLOCK XTAL_19_968MHz |
| 35 | 35 | |
| 36 | typedef struct _jangou_state jangou_state; | |
| 37 | struct _jangou_state | |
| 36 | class jangou_state | |
| 38 | 37 | { |
| 38 | public: | |
| 39 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jangou_state(machine)); } | |
| 40 | ||
| 41 | jangou_state(running_machine &machine) { } | |
| 42 | ||
| 39 | 43 | /* video-related */ |
| 40 | 44 | UINT8 *blit_buffer; |
| 41 | 45 | UINT8 pen_data[0x10]; |
| r7500 | r7501 | |
|---|---|---|
| 331 | 331 | |
| 332 | 332 | |
| 333 | 333 | #define DSP_BUF_MAX (4096*12) |
| 334 | typedef struct _dsp_state dsp_state; | |
| 335 | struct _dsp_state | |
| 334 | struct dsp_state | |
| 336 | 335 | { |
| 337 | 336 | unsigned masterSourceAddr; |
| 338 | 337 | UINT16 slaveInputBuffer[DSP_BUF_MAX]; |
| r7500 | r7501 | |
|---|---|---|
| 150 | 150 | #define NUM_PENS (4*8) |
| 151 | 151 | #define VMEM_SIZE 0x100 |
| 152 | 152 | |
| 153 | typedef struct _ssingles_state ssingles_state; | |
| 154 | struct _ssingles_state | |
| 153 | class ssingles_state | |
| 155 | 154 | { |
| 155 | public: | |
| 156 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ssingles_state(machine)); } | |
| 157 | ||
| 158 | ssingles_state(running_machine &machine) { } | |
| 159 | ||
| 156 | 160 | UINT8 *videoram; |
| 157 | 161 | UINT8 *colorram; |
| 158 | 162 | UINT8 prot_data; |
| r7500 | r7501 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | #define MASTER_CLOCK XTAL_18_432MHz |
| 114 | 114 | |
| 115 | typedef struct _sub_state sub_state; | |
| 116 | struct _sub_state | |
| 115 | class sub_state | |
| 117 | 116 | { |
| 117 | public: | |
| 118 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sub_state(machine)); } | |
| 119 | ||
| 120 | sub_state(running_machine &machine) { } | |
| 121 | ||
| 118 | 122 | UINT8* vid; |
| 119 | 123 | UINT8* attr; |
| 120 | 124 | UINT8* scrolly; |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include "cpu/z80/z80.h" |
| 25 | 25 | #include "sound/ay8910.h" |
| 26 | 26 | |
| 27 | typedef struct _skyarmy_state skyarmy_state; | |
| 28 | struct _skyarmy_state | |
| 27 | class skyarmy_state | |
| 29 | 28 | { |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, skyarmy_state(machine)); } | |
| 31 | ||
| 32 | skyarmy_state(running_machine &machine) { } | |
| 33 | ||
| 30 | 34 | UINT8 *spriteram; |
| 31 | 35 | UINT8 *videoram; |
| 32 | 36 | UINT8 *colorram; |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include "sound/2203intf.h" |
| 25 | 25 | #include "sound/msm5205.h" |
| 26 | 26 | |
| 27 | typedef struct _suprgolf_state suprgolf_state; | |
| 28 | struct _suprgolf_state | |
| 27 | class suprgolf_state | |
| 29 | 28 | { |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, suprgolf_state(machine)); } | |
| 31 | ||
| 32 | suprgolf_state(running_machine &machine) { } | |
| 33 | ||
| 30 | 34 | tilemap_t *tilemap; |
| 31 | 35 | UINT8 *videoram; |
| 32 | 36 | UINT8 *paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 152 | 152 | #include "machine/microtch.h" |
| 153 | 153 | #include "machine/68681.h" |
| 154 | 154 | |
| 155 | typedef struct _adp_state adp_state; | |
| 156 | struct _adp_state | |
| 155 | class adp_state | |
| 157 | 156 | { |
| 157 | public: | |
| 158 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, adp_state(machine)); } | |
| 159 | ||
| 160 | adp_state(running_machine &machine) { } | |
| 161 | ||
| 158 | 162 | /* misc */ |
| 159 | 163 | UINT8 mux_data; |
| 160 | 164 | UINT8 register_active; |
| r7500 | r7501 | |
| 714 | 718 | |
| 715 | 719 | MDRV_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 716 | 720 | |
| 721 | MDRV_MACHINE_START(skattv) | |
| 722 | MDRV_MACHINE_RESET(skattv) | |
| 723 | ||
| 717 | 724 | MDRV_SCREEN_ADD("screen", RASTER) |
| 718 | 725 | MDRV_SCREEN_REFRESH_RATE(60) |
| 719 | 726 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| r7500 | r7501 | |
|---|---|---|
| 141 | 141 | #include "sound/2610intf.h" |
| 142 | 142 | #include "includes/mcatadv.h" |
| 143 | 143 | |
| 144 | UINT16* mcatadv_videoram1, *mcatadv_videoram2; | |
| 145 | UINT16* mcatadv_scroll, *mcatadv_scroll2; | |
| 146 | UINT16* mcatadv_vidregs; | |
| 147 | 144 | |
| 148 | ||
| 149 | 145 | /*** Main CPU ***/ |
| 150 | 146 | |
| 151 | 147 | static WRITE16_HANDLER( mcat_soundlatch_w ) |
| 152 | 148 | { |
| 149 | mcatadv_state *state = (mcatadv_state *)space->machine->driver_data; | |
| 150 | ||
| 153 | 151 | soundlatch_w(space, 0, data); |
| 154 | cpu | |
| 152 | cpu | |
| 155 | 153 | } |
| 156 | 154 | |
| 157 | 155 | #if 0 // mcat only.. install read handler? |
| r7500 | r7501 | |
| 169 | 167 | |
| 170 | 168 | static READ16_HANDLER( mcat_wd_r ) |
| 171 | 169 | { |
| 172 | watchdog_reset_r(space,0); | |
| 170 | watchdog_reset_r(space, 0); | |
| 173 | 171 | return 0xc00; |
| 174 | 172 | } |
| 175 | 173 | |
| r7500 | r7501 | |
| 180 | 178 | |
| 181 | 179 | // AM_RANGE(0x180018, 0x18001f) AM_READNOP // ? |
| 182 | 180 | |
| 183 | AM_RANGE(0x200000, 0x200005) AM_RAM AM_BASE(&mcatadv_scroll) | |
| 184 | AM_RANGE(0x300000, 0x300005) AM_RAM AM_BASE(&mcatadv_scroll2) | |
| 181 | AM_RANGE(0x200000, 0x200005) AM_RAM AM_BASE_MEMBER(mcatadv_state, scroll1) | |
| 182 | AM_RANGE(0x300000, 0x300005) AM_RAM AM_BASE_MEMBER(mcatadv_state, scroll2) | |
| 185 | 183 | |
| 186 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(mcatadv_videoram1_w) AM_BASE(&mcatadv_videoram1) // Tilemap 0 | |
| 187 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(mcatadv_videoram2_w) AM_BASE(&mcatadv_videoram2) // Tilemap 1 | |
| 184 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(mcatadv_videoram1_w) AM_BASE_MEMBER(mcatadv_state, videoram1) // Tilemap 0 | |
| 185 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(mcatadv_videoram2_w) AM_BASE_MEMBER(mcatadv_state, videoram2) // Tilemap 1 | |
| 188 | 186 | |
| 189 | 187 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 190 | 188 | AM_RANGE(0x602000, 0x602fff) AM_RAM // Bigger than needs to be? |
| 191 | 189 | |
| 192 | AM_RANGE(0x700000, 0x707fff) AM_RAM AM_BASE_SIZE_ | |
| 190 | AM_RANGE(0x700000, 0x707fff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 193 | 191 | AM_RANGE(0x708000, 0x70ffff) AM_RAM // Tests more than is needed? |
| 194 | 192 | |
| 195 | 193 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("P1") |
| r7500 | r7501 | |
| 198 | 196 | AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("DSW1") |
| 199 | 197 | AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW2") |
| 200 | 198 | |
| 201 | AM_RANGE(0xb00000, 0xb0000f) AM_RAM AM_BASE( | |
| 199 | AM_RANGE(0xb00000, 0xb0000f) AM_RAM AM_BASE_MEMBER( | |
| 202 | 200 | |
| 203 | 201 | AM_RANGE(0xb00018, 0xb00019) AM_WRITE(watchdog_reset16_w) // NOST Only |
| 204 | 202 | AM_RANGE(0xb0001e, 0xb0001f) AM_READ(mcat_wd_r) // MCAT Only |
| 205 | AM_RANGE(0xc00000, 0xc00001) AM_READWRITE(soundlatch2_word_r,mcat_soundlatch_w) | |
| 203 | AM_RANGE(0xc00000, 0xc00001) AM_READWRITE(soundlatch2_word_r, mcat_soundlatch_w) | |
| 206 | 204 | ADDRESS_MAP_END |
| 207 | 205 | |
| 208 | 206 | /*** Sound ***/ |
| 209 | 207 | |
| 210 | 208 | static WRITE8_HANDLER ( mcatadv_sound_bw_w ) |
| 211 | 209 | { |
| 212 | UINT8 *rom = memory_region(space->machine, "soundcpu") + 0x10000; | |
| 213 | ||
| 214 | memory_set_bankptr(space->machine, "bank1",rom + data * 0x4000); | |
| 210 | memory_set_bank(space->machine, "bank1", data); | |
| 215 | 211 | } |
| 216 | 212 | |
| 217 | 213 | |
| r7500 | r7501 | |
| 420 | 416 | /* Stolen from Psikyo.c */ |
| 421 | 417 | static void sound_irq( running_device *device, int irq ) |
| 422 | 418 | { |
| 423 | cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 419 | mcatadv_state *state = (mcatadv_state *)device->machine->driver_data; | |
| 420 | cpu_set_input_line(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 424 | 421 | } |
| 422 | ||
| 425 | 423 | static const ym2610_interface mcatadv_ym2610_interface = |
| 426 | 424 | { |
| 427 | 425 | sound_irq /* irq */ |
| 428 | 426 | }; |
| 429 | 427 | |
| 430 | 428 | |
| 429 | static MACHINE_START( mcatadv ) | |
| 430 | { | |
| 431 | mcatadv_state *state = (mcatadv_state *)machine->driver_data; | |
| 432 | UINT8 *ROM = memory_region(machine, "soundcpu"); | |
| 433 | ||
| 434 | memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); | |
| 435 | memory_set_bank(machine, "bank1", 1); | |
| 436 | ||
| 437 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 438 | state->soundcpu = devtag_get_device(machine, "soundcpu"); | |
| 439 | ||
| 440 | state_save_register_global(machine, state->palette_bank1); | |
| 441 | state_save_register_global(machine, state->palette_bank2); | |
| 442 | } | |
| 443 | ||
| 431 | 444 | static MACHINE_DRIVER_START( mcatadv ) |
| 432 | 445 | |
| 446 | /* driver data */ | |
| 447 | MDRV_DRIVER_DATA(mcatadv_state) | |
| 448 | ||
| 433 | 449 | /* basic machine hardware */ |
| 434 | 450 | MDRV_CPU_ADD("maincpu", M68000, XTAL_16MHz) /* verified on pcb */ |
| 435 | 451 | MDRV_CPU_PROGRAM_MAP(mcatadv_map) |
| r7500 | r7501 | |
| 439 | 455 | MDRV_CPU_PROGRAM_MAP(mcatadv_sound_map) |
| 440 | 456 | MDRV_CPU_IO_MAP(mcatadv_sound_io_map) |
| 441 | 457 | |
| 458 | MDRV_MACHINE_START(mcatadv) | |
| 459 | ||
| 442 | 460 | /* video hardware */ |
| 443 | 461 | MDRV_SCREEN_ADD("screen", RASTER) |
| 444 | 462 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 476 | 494 | MACHINE_DRIVER_END |
| 477 | 495 | |
| 478 | 496 | |
| 479 | static DRIVER_INIT( mcatadv ) | |
| 480 | { | |
| 481 | UINT8 *z80rom = memory_region(machine, "soundcpu") + 0x10000; | |
| 482 | ||
| 483 | memory_set_bankptr(machine, "bank1", z80rom + 0x4000); | |
| 484 | } | |
| 485 | ||
| 486 | ||
| 487 | 497 | ROM_START( mcatadv ) |
| 488 | 498 | ROM_REGION( 0x100000, "maincpu", 0 ) /* M68000 */ |
| 489 | 499 | ROM_LOAD16_BYTE( "mca-u30e", 0x00000, 0x80000, CRC(c62fbb65) SHA1(39a30a165d4811141db8687a4849626bef8e778e) ) |
| r7500 | r7501 | |
| 662 | 672 | ROM_LOAD( "nossn-00.u53", 0x00000, 0x100000, CRC(3bd1bcbc) SHA1(1bcad43792e985402db4eca122676c2c555f3313) ) |
| 663 | 673 | ROM_END |
| 664 | 674 | |
| 665 | GAME( 1993, mcatadv, 0, mcatadv, mcatadv, mcatadv, ROT0, "Wintechno", "Magical Cat Adventure", GAME_NO_COCKTAIL ) | |
| 666 | GAME( 1993, mcatadvj, mcatadv, mcatadv, mcatadv, mcatadv, ROT0, "Wintechno", "Magical Cat Adventure (Japan)", GAME_NO_COCKTAIL ) | |
| 667 | GAME( 1993, catt, mcatadv, mcatadv, mcatadv, mcatadv, ROT0, "Wintechno", "Catt (Japan)", GAME_NO_COCKTAIL ) | |
| 668 | GAME( 1993, nost, 0, nost, nost, mcatadv, ROT270, "Face", "Nostradamus", GAME_NO_COCKTAIL ) | |
| 669 | GAME( 1993, nostj, nost, nost, nost, mcatadv, ROT270, "Face", "Nostradamus (Japan)", GAME_NO_COCKTAIL ) | |
| 670 | GAME( 1993, nostk, nost, nost, nost, mcatadv, ROT270, "Face", "Nostradamus (Korea)", GAME_NO_COCKTAIL ) | |
| 675 | ||
| 676 | GAME( 1993, mcatadv, 0, mcatadv, mcatadv, 0, ROT0, "Wintechno", "Magical Cat Adventure", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 677 | GAME( 1993, mcatadvj, mcatadv, mcatadv, mcatadv, 0, ROT0, "Wintechno", "Magical Cat Adventure (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 678 | GAME( 1993, catt, mcatadv, mcatadv, mcatadv, 0, ROT0, "Wintechno", "Catt (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 679 | GAME( 1993, nost, 0, nost, nost, 0, ROT270, "Face", "Nostradamus", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 680 | GAME( 1993, nostj, nost, nost, nost, 0, ROT270, "Face", "Nostradamus (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 681 | GAME( 1993, nostk, nost, nost, nost, 0, ROT270, "Face", "Nostradamus (Korea)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 5257 | 5257 | ROM_LOAD( "rom-6.bin", 0x040000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) |
| 5258 | 5258 | ROM_END |
| 5259 | 5259 | |
| 5260 | /* Version A is older, might have been only released in Japan? */ | |
| 5260 | /* Version A is older, might have been only released in Japan and Taiwan? */ | |
| 5261 | 5261 | ROM_START( batridja ) |
| 5262 | 5262 | ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ |
| 5263 | 5263 | ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(f93ea27c) SHA1(41023c2ee1efd70b5aa9c70e1ddd9e5c3d51d68a) ) |
| r7500 | r7501 | |
| 5282 | 5282 | ROM_LOAD( "rom-6.bin", 0x040000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) |
| 5283 | 5283 | ROM_END |
| 5284 | 5284 | |
| 5285 | ROM_START( batridta ) | |
| 5286 | ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ | |
| 5287 | ROM_LOAD16_BYTE( "u22.bin", 0x000000, 0x080000, CRC(b135820e) SHA1(c222887d18a0a3ea0fcc973b95b29d69c86f7ec3) ) | |
| 5288 | ROM_LOAD16_BYTE( "u23.bin", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) | |
| 5289 | ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) | |
| 5290 | ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) | |
| 5285 | 5291 | |
| 5292 | ROM_REGION( 0x48000, "audiocpu", 0 ) /* Sound Z80 code + bank */ | |
| 5293 | ROM_LOAD( "snd.u77", 0x00000, 0x08000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) | |
| 5294 | ROM_CONTINUE( 0x10000, 0x38000 ) | |
| 5286 | 5295 | |
| 5296 | ROM_REGION( 0x1000000, "gfx1", 0 ) | |
| 5297 | ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) | |
| 5298 | ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) | |
| 5299 | ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) | |
| 5300 | ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) | |
| 5287 | 5301 | |
| 5302 | ROM_REGION( 0x140000, "oki1", 0 ) /* ADPCM Samples 1 */ | |
| 5303 | ROM_LOAD( "rom-5.bin", 0x040000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) | |
| 5304 | ||
| 5305 | ROM_REGION( 0x140000, "oki2", 0 ) /* ADPCM Samples 2 */ | |
| 5306 | ROM_LOAD( "rom-6.bin", 0x040000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) | |
| 5307 | ROM_END | |
| 5308 | ||
| 5309 | ||
| 5310 | ||
| 5288 | 5311 | /* |
| 5289 | 5312 | Battle Bakraid |
| 5290 | 5313 | Raizing/8ing, 1999 |
| r7500 | r7501 | |
| 5466 | 5489 | GAME( 1998, batridj, batrid, batrider, batridrj, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider - B Version (Japan) (Fri Feb 13 1998)", GAME_SUPPORTS_SAVE ) |
| 5467 | 5490 | GAME( 1998, batridk, batrid, batrider, batrider, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Korea) (Fri Feb 13 1998)", GAME_SUPPORTS_SAVE ) |
| 5468 | 5491 | // version A is older code |
| 5469 | GAME( 1998, batridja, batrid, batrider, batridrj, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan) (Mon Dec 22 1997)", GAME_SUPPORTS_SAVE ) | |
| 5492 | GAME( 1998, batridja, batrid, batrider, batridrj, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider - A Version (Japan) (Mon Dec 22 1997)", GAME_SUPPORTS_SAVE ) | |
| 5493 | GAME( 1998, batridta, batrid, batrider, batridrj, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider - A Version (Taiwan) (Mon Dec 22 1997)", GAME_SUPPORTS_SAVE ) | |
| 5470 | 5494 | |
| 5471 | 5495 | // Battle Bakraid |
| 5472 | 5496 | // the 'unlimited' version is a newer revision of the code. |
| r7500 | r7501 | |
|---|---|---|
| 28 | 28 | #include "deprecat.h" |
| 29 | 29 | #include "cpu/z80/z80.h" |
| 30 | 30 | #include "sound/ay8910.h" |
| 31 | #include "includes/munchmo.h" | |
| 31 | 32 | |
| 32 | extern UINT8 *mnchmobl_vreg; | |
| 33 | extern UINT8 *mnchmobl_status_vram; | |
| 34 | extern UINT8 *mnchmobl_sprite_xpos; | |
| 35 | extern UINT8 *mnchmobl_sprite_attr; | |
| 36 | extern UINT8 *mnchmobl_sprite_tile; | |
| 37 | 33 | |
| 38 | PALETTE_INIT( mnchmobl ); | |
| 39 | VIDEO_START( mnchmobl ); | |
| 40 | WRITE8_HANDLER( mnchmobl_palette_bank_w ); | |
| 41 | WRITE8_HANDLER( mnchmobl_flipscreen_w ); | |
| 42 | VIDEO_UPDATE( mnchmobl ); | |
| 34 | /************************************* | |
| 35 | * | |
| 36 | * Memory handlers | |
| 37 | * | |
| 38 | *************************************/ | |
| 43 | 39 | |
| 44 | ||
| 45 | /***************************************************************************/ | |
| 46 | ||
| 47 | static int mnchmobl_nmi_enable = 0; | |
| 48 | ||
| 49 | 40 | static WRITE8_HANDLER( mnchmobl_nmi_enable_w ) |
| 50 | 41 | { |
| 51 | mnchmobl_nmi_enable = data; | |
| 42 | munchmo_state *state = (munchmo_state *)space->machine->driver_data; | |
| 43 | state->nmi_enable = data; | |
| 52 | 44 | } |
| 53 | 45 | |
| 54 | 46 | static INTERRUPT_GEN( mnchmobl_interrupt ) |
| 55 | 47 | { |
| 56 | static int which; | |
| 57 | which = !which; | |
| 58 | if( which ) cpu_set_input_line(device, 0, HOLD_LINE); | |
| 59 | else if( mnchmobl_nmi_enable ) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 48 | munchmo_state *state = (munchmo_state *)device->machine->driver_data; | |
| 49 | state->which = !state->which; | |
| 50 | ||
| 51 | if (state->which) | |
| 52 | cpu_set_input_line(device, 0, HOLD_LINE); | |
| 53 | else if (state->nmi_enable) | |
| 54 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 60 | 55 | } |
| 61 | 56 | |
| 62 | 57 | static WRITE8_HANDLER( mnchmobl_soundlatch_w ) |
| 63 | 58 | { |
| 64 | soundlatch_w( space, offset, data ); | |
| 65 | cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE ); | |
| 59 | munchmo_state *state = (munchmo_state *)space->machine->driver_data; | |
| 60 | ||
| 61 | soundlatch_w(space, offset, data); | |
| 62 | cpu_set_input_line(state->audiocpu, 0, HOLD_LINE ); | |
| 66 | 63 | } |
| 67 | 64 | |
| 68 | 65 | static WRITE8_HANDLER( sound_nmi_ack_w ) |
| 69 | 66 | { |
| 70 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); | |
| 67 | munchmo_state *state = (munchmo_state *)space->machine->driver_data; | |
| 68 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); | |
| 71 | 69 | } |
| 72 | 70 | |
| 73 | 71 | |
| 72 | /************************************* | |
| 73 | * | |
| 74 | * Address maps | |
| 75 | * | |
| 76 | *************************************/ | |
| 77 | ||
| 74 | 78 | static ADDRESS_MAP_START( mnchmobl_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 75 | 79 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 76 | 80 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 77 | AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_xpos) | |
| 78 | AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_tile) | |
| 79 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_attr) | |
| 80 | AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_RAM AM_BASE_GENERIC(videoram) | |
| 81 | AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(munchmo_state, sprite_xpos) | |
| 82 | AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(munchmo_state, sprite_tile) | |
| 83 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(munchmo_state, sprite_attr) | |
| 84 | AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_RAM AM_BASE_MEMBER(munchmo_state, videoram) | |
| 81 | 85 | AM_RANGE(0xbaba, 0xbaba) AM_WRITENOP /* ? */ |
| 82 | AM_RANGE(0xbc00, 0xbc7f) AM_RAM AM_BASE( | |
| 86 | AM_RANGE(0xbc00, 0xbc7f) AM_RAM AM_BASE_MEMBER( | |
| 83 | 87 | AM_RANGE(0xbe00, 0xbe00) AM_WRITE(mnchmobl_soundlatch_w) |
| 84 | 88 | AM_RANGE(0xbe01, 0xbe01) AM_WRITE(mnchmobl_palette_bank_w) |
| 85 | 89 | AM_RANGE(0xbe02, 0xbe02) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 89 | 93 | AM_RANGE(0xbe31, 0xbe31) AM_WRITENOP /* ? */ |
| 90 | 94 | AM_RANGE(0xbe41, 0xbe41) AM_WRITE(mnchmobl_flipscreen_w) |
| 91 | 95 | AM_RANGE(0xbe61, 0xbe61) AM_WRITE(mnchmobl_nmi_enable_w) /* ENI 1-10C */ |
| 92 | AM_RANGE(0xbf00, 0xbf07) AM_WRITEONLY AM_BASE( | |
| 96 | AM_RANGE(0xbf00, 0xbf07) AM_WRITEONLY AM_BASE_MEMBER( | |
| 93 | 97 | AM_RANGE(0xbf01, 0xbf01) AM_READ_PORT("SYSTEM") |
| 94 | 98 | AM_RANGE(0xbf02, 0xbf02) AM_READ_PORT("P1") |
| 95 | 99 | AM_RANGE(0xbf03, 0xbf03) AM_READ_PORT("P2") |
| r7500 | r7501 | |
| 109 | 113 | ADDRESS_MAP_END |
| 110 | 114 | |
| 111 | 115 | |
| 116 | /************************************* | |
| 117 | * | |
| 118 | * Input ports | |
| 119 | * | |
| 120 | *************************************/ | |
| 121 | ||
| 112 | 122 | static INPUT_PORTS_START( mnchmobl ) |
| 113 | 123 | PORT_START("SYSTEM") |
| 114 | 124 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r7500 | r7501 | |
| 199 | 209 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 200 | 210 | INPUT_PORTS_END |
| 201 | 211 | |
| 212 | /************************************* | |
| 213 | * | |
| 214 | * Graphics definitions | |
| 215 | * | |
| 216 | *************************************/ | |
| 217 | ||
| 202 | 218 | static const gfx_layout char_layout = |
| 203 | 219 | { |
| 204 | 220 | 8,8, |
| r7500 | r7501 | |
| 268 | 284 | GFXDECODE_ENTRY( "gfx4", 0, sprite_layout2, 128, 16 ) /* colors 128-255 */ |
| 269 | 285 | GFXDECODE_END |
| 270 | 286 | |
| 287 | /************************************* | |
| 288 | * | |
| 289 | * Machine driver | |
| 290 | * | |
| 291 | *************************************/ | |
| 292 | ||
| 293 | static MACHINE_START( munchmo ) | |
| 294 | { | |
| 295 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 296 | ||
| 297 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 298 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 299 | ||
| 300 | state_save_register_global(machine, state->palette_bank); | |
| 301 | state_save_register_global(machine, state->flipscreen); | |
| 302 | state_save_register_global(machine, state->nmi_enable); | |
| 303 | state_save_register_global(machine, state->which); | |
| 304 | } | |
| 305 | ||
| 306 | static MACHINE_RESET( munchmo ) | |
| 307 | { | |
| 308 | munchmo_state *state = (munchmo_state *)machine->driver_data; | |
| 309 | ||
| 310 | state->palette_bank = 0; | |
| 311 | state->flipscreen = 0; | |
| 312 | state->nmi_enable = 0; | |
| 313 | state->which = 0; | |
| 314 | } | |
| 315 | ||
| 271 | 316 | static MACHINE_DRIVER_START( mnchmobl ) |
| 272 | 317 | |
| 318 | /* driver data */ | |
| 319 | MDRV_DRIVER_DATA(munchmo_state) | |
| 320 | ||
| 273 | 321 | /* basic machine hardware */ |
| 274 | 322 | MDRV_CPU_ADD("maincpu", Z80, XTAL_15MHz/4) /* ? */ |
| 275 | 323 | MDRV_CPU_PROGRAM_MAP(mnchmobl_map) |
| r7500 | r7501 | |
| 279 | 327 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 280 | 328 | MDRV_CPU_VBLANK_INT("screen", nmi_line_assert) |
| 281 | 329 | |
| 330 | MDRV_MACHINE_START(munchmo) | |
| 331 | MDRV_MACHINE_RESET(munchmo) | |
| 332 | ||
| 282 | 333 | /* video hardware */ |
| 283 | 334 | MDRV_SCREEN_ADD("screen", RASTER) |
| 284 | 335 | MDRV_SCREEN_REFRESH_RATE(57) |
| r7500 | r7501 | |
| 306 | 357 | MACHINE_DRIVER_END |
| 307 | 358 | |
| 308 | 359 | |
| 360 | /************************************* | |
| 361 | * | |
| 362 | * ROM definition(s) | |
| 363 | * | |
| 364 | *************************************/ | |
| 365 | ||
| 309 | 366 | ROM_START( joyfulr ) |
| 310 | 367 | ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for CPUA */ |
| 311 | 368 | ROM_LOAD( "m1j.10e", 0x0000, 0x2000, CRC(1fe86e25) SHA1(e13abc20741dfd8a260f354efda3b3a25c820343) ) |
| r7500 | r7501 | |
| 363 | 420 | ROM_END |
| 364 | 421 | |
| 365 | 422 | |
| 366 | GAME( 1983, joyfulr, 0, mnchmobl, mnchmobl, 0, ROT270, "SNK", "Joyful Road (Japan)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL ) | |
| 367 | GAME( 1983, mnchmobl, joyfulr, mnchmobl, mnchmobl, 0, ROT270, "SNK (Centuri license)", "Munch Mobile (US)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL ) | |
| 423 | /************************************* | |
| 424 | * | |
| 425 | * Game driver(s) | |
| 426 | * | |
| 427 | *************************************/ | |
| 428 | ||
| 429 | GAME( 1983, joyfulr, 0, mnchmobl, mnchmobl, 0, ROT270, "SNK", "Joyful Road (Japan)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 430 | GAME( 1983, mnchmobl, joyfulr, mnchmobl, mnchmobl, 0, ROT270, "SNK (Centuri license)", "Munch Mobile (US)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 20 | 20 | * |
| 21 | 21 | *************************************/ |
| 22 | 22 | |
| 23 | typedef struct _boxer_state boxer_state; | |
| 24 | struct _boxer_state | |
| 23 | class boxer_state | |
| 25 | 24 | { |
| 25 | public: | |
| 26 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, boxer_state(machine)); } | |
| 27 | ||
| 28 | boxer_state(running_machine &machine) { } | |
| 29 | ||
| 26 | 30 | /* memory pointers */ |
| 27 | 31 | UINT8 * tile_ram; |
| 28 | 32 | UINT8 * sprite_ram; |
| r7500 | r7501 | |
|---|---|---|
| 227 | 227 | static ADDRESS_MAP_START( bigrun_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 228 | 228 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 229 | 229 | AM_RANGE(0x080000, 0x083fff) AM_READWRITE(bigrun_vregs_r, bigrun_vregs_w) AM_BASE(&megasys1_vregs) // Vregs |
| 230 | AM_RANGE(0x084000, 0x087fff) AM_ | |
| 230 | AM_RANGE(0x084000, 0x087fff) AM_ | |
| 231 | 231 | AM_RANGE(0x088000, 0x08bfff) AM_READWRITE(sharedram2_r, sharedram2_w) AM_BASE(&sharedram2) // Sharedram with sub CPU#2 |
| 232 | 232 | AM_RANGE(0x08c000, 0x08ffff) AM_READWRITE(sharedram1_r, sharedram1_w) AM_BASE(&sharedram1) // Sharedram with sub CPU#1 |
| 233 | 233 | |
| r7500 | r7501 | |
| 623 | 623 | |
| 624 | 624 | static ADDRESS_MAP_START( bigrun_map3, ADDRESS_SPACE_PROGRAM, 16 ) |
| 625 | 625 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 626 | AM_RANGE(0x040000, 0x047fff) AM_READWRITE(sharedram2_r, sharedram | |
| 626 | AM_RANGE(0x040000, 0x047fff) AM_READWRITE(sharedram2_r, sharedram2_w) // Shared RAM (with Main CPU) | |
| 627 | 627 | AM_RANGE(0x080000, 0x0807ff) AM_RAM AM_BASE(&cischeat_roadram[1]) // Road RAM |
| 628 | 628 | AM_RANGE(0x0c0000, 0x0c3fff) AM_RAM // RAM |
| 629 | 629 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 703 | 703 | AM_RANGE(0x040000, 0x040001) AM_READWRITE(soundlatch_word_r, bigrun_soundbank_w) // From Main CPU |
| 704 | 704 | AM_RANGE(0x060000, 0x060001) AM_WRITE(soundlatch2_word_w) // To Main CPU |
| 705 | 705 | AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 706 | AM_RANGE(0x0a0000, 0x0a0001) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x00ff) | |
| 707 | AM_RANGE(0x0c0000, 0x0c0001) AM_DEVREADWRITE8("oki2", okim6295_r, okim6295_w, 0x00ff) | |
| 706 | AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x00ff) | |
| 707 | AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_r, okim6295_w, 0x00ff) | |
| 708 | 708 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM // RAM |
| 709 | 709 | ADDRESS_MAP_END |
| 710 | 710 |
| r7500 | r7501 | |
|---|---|---|
| 2364 | 2364 | ROM_LOAD( "316-0042.u88", 0x0020, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) ) /* sequence PROM */ |
| 2365 | 2365 | ROM_END |
| 2366 | 2366 | |
| 2367 | ROM_START( safaria ) // bootleg board, but possibly a legit alt revision | |
| 2368 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2369 | ROM_LOAD( "hu1.22c", 0x0000, 0x0400, CRC(f27d5961) SHA1(9780e9659746c959206b8700598cfb3925ae7938) ) | |
| 2370 | ROM_LOAD( "hu2.20c", 0x0400, 0x0400, CRC(11a9cb59) SHA1(5132151a97146d973292b15284e4d58de9ee7cc6) ) | |
| 2371 | ROM_LOAD( "hu3.19c", 0x0800, 0x0400, CRC(4fe746cb) SHA1(b4b6eac78dd9a76c102994990c219ae832442cc1) ) | |
| 2372 | ROM_LOAD( "hu4.17c", 0x0c00, 0x0400, CRC(f0bad948) SHA1(5dda4513e96cfb0b6535184c611ac5832afbbfde) ) | |
| 2373 | ROM_LOAD( "hu5.16c", 0x1000, 0x0400, CRC(d994f98a) SHA1(a51db8b8975f1fa7ca3bae56d4d929b8d3d7bfb7) ) | |
| 2374 | ROM_LOAD( "hu6.15c", 0x1400, 0x0400, CRC(174b5964) SHA1(dfa88aaa572d4d46ffe3c8f247dbc370e624f5c4) ) | |
| 2375 | ROM_LOAD( "hu7.13c", 0x1800, 0x0400, CRC(3e94caa1) SHA1(520ae5924b970126c07368bba900b7603997c5cc) ) | |
| 2376 | ROM_LOAD( "hu8.12c", 0x1c00, 0x0400, CRC(a8a5dca0) SHA1(2424d9e3b4ed2c73b14ec0c26d63453fb4f7f6c2) ) | |
| 2377 | ROM_LOAD( "hu9.11c", 0x2000, 0x0400, CRC(0ace0939) SHA1(34704b836445628341fb6a77b1ebd47a76c5640d) ) | |
| 2378 | ROM_LOAD( "hu10.9c", 0x2400, 0x0400, CRC(9dae33ca) SHA1(91472e3b60ff055724ae574b182a450d2a00081c) ) | |
| 2367 | 2379 | |
| 2380 | ROM_REGION( 0x0040, "user1", 0 ) /* timing PROMs */ | |
| 2381 | ROM_LOAD( "32.21e", 0x0000, 0x0020, CRC(e60a7960) SHA1(b8b8716e859c57c35310efc4594262afedb84823) ) /* control PROM */ | |
| 2382 | ROM_LOAD( "31.22e", 0x0020, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) ) /* sequence PROM */ | |
| 2383 | ROM_END | |
| 2384 | ||
| 2385 | ||
| 2368 | 2386 | ROM_START( frogs ) |
| 2369 | 2387 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2370 | 2388 | ROM_LOAD( "316-119a.u48", 0x0000, 0x0400, CRC(b1d1fce4) SHA1(572015bede39b14526e93919b63b6d01ae38a09a) ) |
| r7500 | r7501 | |
| 3245 | 3263 | GAMEL(1977, depthch, 0, depthch, depthch, 0, ROT0, "Gremlin", "Depthcharge", GAME_IMPERFECT_SOUND, layout_depthch ) |
| 3246 | 3264 | GAMEL(1977, depthcho, depthch, depthch, depthch, 0, ROT0, "Gremlin", "Depthcharge (older)", GAME_IMPERFECT_SOUND, layout_depthch ) |
| 3247 | 3265 | GAME( 1977, subhunt, depthch, depthch, depthch, 0, ROT0, "Taito", "Sub Hunter", GAME_IMPERFECT_SOUND ) |
| 3248 | GAME( 1977, safari, 0, safari, safari, 0, ROT0, "Gremlin", "Safari", GAME_NO_SOUND ) | |
| 3266 | GAME( 1977, safari, 0, safari, safari, 0, ROT0, "Gremlin", "Safari (set 1)", GAME_NO_SOUND ) | |
| 3267 | GAME( 1977, safaria, safari, safari, safari, 0, ROT0, "Gremlin", "Safari (set 2, bootleg?)", GAME_NO_SOUND ) // on a bootleg board, but seems a different code revision too | |
| 3249 | 3268 | GAME( 1978, frogs, 0, frogs, frogs, 0, ROT0, "Gremlin", "Frogs", GAME_IMPERFECT_SOUND ) |
| 3250 | 3269 | GAME( 1979, sspaceat, 0, sspaceat, sspaceat, 0, ROT270, "Sega", "Space Attack (upright set 1)", GAME_NO_SOUND ) |
| 3251 | 3270 | GAME( 1979, sspaceat2,sspaceat, sspaceat, sspaceat, 0, ROT270, "Sega", "Space Attack (upright set 2)", GAME_NO_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 202 | 202 | return 0; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | static READ32_HANDLER(irq_ack_clear) | |
| 206 | { | |
| 207 | cputag_set_input_line(space->machine, "sub", R3000_IRQ4, CLEAR_LINE); | |
| 208 | return 0; | |
| 209 | } | |
| 210 | ||
| 205 | 211 | static ADDRESS_MAP_START( speglsht_mem, ADDRESS_SPACE_PROGRAM, 32 ) |
| 206 | 212 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM |
| 207 | 213 | AM_RANGE(0x01000000, 0x01007fff) AM_RAM //tested - STATIC RAM |
| r7500 | r7501 | |
| 214 | 220 | AM_RANGE(0x01c00000, 0x01dfffff) AM_ROM AM_REGION("user2", 0) |
| 215 | 221 | AM_RANGE(0x0a000000, 0x0a003fff) AM_READWRITE(shared_r, shared_w) |
| 216 | 222 | AM_RANGE(0x1eff0000, 0x1eff001f) AM_RAM |
| 217 | AM_RANGE(0x1eff003c, 0x1eff003f) AM_READ | |
| 223 | AM_RANGE(0x1eff003c, 0x1eff003f) AM_READ( | |
| 218 | 224 | AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) |
| 219 | 225 | AM_RANGE(0x2fc00000, 0x2fdfffff) AM_ROM AM_REGION("user1", 0) // mirror for interrupts |
| 220 | 226 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 301 | 307 | &st0016_charram |
| 302 | 308 | }; |
| 303 | 309 | |
| 304 | static INTERRUPT_GEN( irq4_gen ) | |
| 305 | { | |
| 306 | cpu_set_input_line(device, R3000_IRQ4, ASSERT_LINE); | |
| 307 | } | |
| 308 | ||
| 309 | 310 | static const r3000_cpu_core config = |
| 310 | 311 | { |
| 311 | 312 | 0, |
| r7500 | r7501 | |
| 329 | 330 | MDRV_CPU_ADD("sub", R3000LE, 25000000) |
| 330 | 331 | MDRV_CPU_CONFIG(config) |
| 331 | 332 | MDRV_CPU_PROGRAM_MAP(speglsht_mem) |
| 332 | MDRV_CPU_VBLANK_INT("screen", irq4_ | |
| 333 | MDRV_CPU_VBLANK_INT("screen", irq4_line_assert) | |
| 333 | 334 | |
| 334 | 335 | MDRV_QUANTUM_TIME(HZ(6000)) |
| 335 | 336 | MDRV_MACHINE_RESET(speglsht) |
| r7500 | r7501 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | Not dumped yet: |
| 52 | 52 | 94 Toride II |
| 53 | 94 Mouse Shooter GoGo (might be a prequel to Bang Bang Ball) | |
| 53 | 54 | |
| 54 | 55 | To Do: |
| 55 | 56 |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | #define MASTER_CLOCK XTAL_19_968MHz |
| 26 | 26 | |
| 27 | static UINT8 blit_raw_data[3]; | |
| 28 | static UINT8 *blit_buffer; | |
| 29 | static UINT8 pen_data[0x10]; | |
| 30 | static UINT8 pen_raw_data[0x10]; | |
| 27 | class nightgal_state | |
| 28 | { | |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nightgal_state(machine)); } | |
| 31 | 31 | |
| 32 | nightgal_state(running_machine &machine) { } | |
| 33 | ||
| 34 | /* memory pointers */ | |
| 35 | UINT8 * blit_buffer; | |
| 36 | ||
| 37 | /* video-related */ | |
| 38 | UINT8 blit_raw_data[3]; | |
| 39 | UINT8 true_blit[7]; | |
| 40 | UINT8 pen_data[0x10]; | |
| 41 | UINT8 pen_raw_data[0x10]; | |
| 42 | ||
| 43 | /* misc */ | |
| 44 | UINT8 nsc_latch, z80_latch; | |
| 45 | UINT8 mux_data; | |
| 46 | ||
| 47 | /* devices */ | |
| 48 | running_device *maincpu; | |
| 49 | running_device *subcpu; | |
| 50 | }; | |
| 51 | ||
| 52 | ||
| 53 | ||
| 32 | 54 | static READ8_HANDLER( blitter_status_r ) |
| 33 | 55 | { |
| 34 | 56 | return 0x80; |
| r7500 | r7501 | |
| 36 | 58 | |
| 37 | 59 | static VIDEO_START( nightgal ) |
| 38 | 60 | { |
| 39 | blit_buffer = auto_alloc_array(machine, UINT8, 256*256); | |
| 61 | nightgal_state *state = (nightgal_state *)machine->driver_data; | |
| 62 | state->blit_buffer = auto_alloc_array(machine, UINT8, 256*256); | |
| 63 | ||
| 64 | state_save_register_global_pointer(machine, state->blit_buffer, 256*256); | |
| 40 | 65 | } |
| 41 | 66 | |
| 42 | 67 | static VIDEO_UPDATE( nightgal ) |
| 43 | 68 | { |
| 69 | nightgal_state *state = (nightgal_state *)screen->machine->driver_data; | |
| 44 | 70 | int x, y; |
| 45 | 71 | |
| 46 | 72 | for (y = cliprect->min_y; y <= cliprect->max_y; ++y) |
| 47 | 73 | { |
| 48 | UINT8 *src = &blit_buffer[y * 512/2 + cliprect->min_x]; | |
| 74 | UINT8 *src = &state->blit_buffer[y * 512 / 2 + cliprect->min_x]; | |
| 49 | 75 | UINT16 *dst = BITMAP_ADDR16(bitmap, y, cliprect->min_x); |
| 50 | 76 | |
| 51 | 77 | for (x = cliprect->min_x; x <= cliprect->max_x; x += 2) |
| r7500 | r7501 | |
| 60 | 86 | return 0; |
| 61 | 87 | } |
| 62 | 88 | |
| 63 | static UINT8 nightgal_gfx_nibble(running_machine *machine,int niboffset) | |
| 89 | static UINT8 nightgal_gfx_nibble( running_machine *machine, int niboffset ) | |
| 64 | 90 | { |
| 65 | 91 | UINT8 *blit_rom = memory_region(machine,"gfx1"); |
| 66 | 92 | |
| 67 | if (niboffset&1) | |
| 93 | if (niboffset & 1) | |
| 68 | 94 | { |
| 69 | return (blit_rom[(niboffset>>1)&0x1ffff] & 0xf0)>>4; | |
| 95 | return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0xf0) >> 4; | |
| 70 | 96 | } |
| 71 | 97 | else |
| 72 | 98 | { |
| 73 | return (blit_rom[(niboffset>>1)&0x1ffff] & 0x0f); | |
| 99 | return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0x0f); | |
| 74 | 100 | } |
| 75 | 101 | } |
| 76 | 102 | |
| 77 | static void plot_nightgal_gfx_pixel(UINT8 pix, int x, int y) | |
| 103 | static void plot_nightgal_gfx_pixel( running_machine *machine, UINT8 pix, int x, int y ) | |
| 78 | 104 | { |
| 79 | if (y>=512) return; | |
| 80 | if (x>=512) return; | |
| 81 | if (y<0) return; | |
| 82 | if (x<0) return; | |
| 105 | nightgal_state *state = (nightgal_state *)machine->driver_data; | |
| 106 | if (y >= 512) return; | |
| 107 | if (x >= 512) return; | |
| 108 | if (y < 0) return; | |
| 109 | if (x < 0) return; | |
| 83 | 110 | |
| 84 | if (x&1) | |
| 85 | { | |
| 86 | blit_buffer[(y*256)+(x>>1)] = (blit_buffer[(y*256)+(x>>1)] & 0x0f) | ((pix<<4) & 0xf0); | |
| 87 | } | |
| 111 | if (x & 1) | |
| 112 | state->blit_buffer[(y * 256) + (x >> 1)] = (state->blit_buffer[(y * 256) + (x >> 1)] & 0x0f) | ((pix << 4) & 0xf0); | |
| 88 | 113 | else |
| 89 | { | |
| 90 | blit_buffer[(y*256)+(x>>1)] = (blit_buffer[(y*256)+(x>>1)] & 0xf0) | (pix & 0x0f); | |
| 91 | } | |
| 114 | state->blit_buffer[(y * 256) + (x >> 1)] = (state->blit_buffer[(y * 256) + (x >> 1)] & 0xf0) | (pix & 0x0f); | |
| 92 | 115 | } |
| 93 | 116 | |
| 94 | 117 | static WRITE8_HANDLER( nsc_true_blitter_w ) |
| 95 | 118 | { |
| 96 | static UINT8 true_blit[7]; | |
| 119 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 120 | int src, x, y, h, w, flipx; | |
| 121 | state->true_blit[offset] = data; | |
| 97 | 122 | |
| 98 | int src,x,y,h,w, flipx; | |
| 99 | true_blit[offset] = data; | |
| 100 | ||
| 101 | 123 | /*trigger blitter write to ram,might not be correct...*/ |
| 102 | if(offset == 5) | |
| 124 | if (offset == 5) | |
| 103 | 125 | { |
| 104 | //printf("%02x %02x %02x %02x %02x %02x %02x\n",true_blit[0],true_blit[1],true_blit[2],true_blit[3],true_blit[4],true_blit[5],true_blit[6]); | |
| 105 | w = (true_blit[4] & 0xff)+1; | |
| 106 | h = (true_blit[5] & 0xff)+1; | |
| 107 | src = ((true_blit[1]<<8)|(true_blit[0]<<0)); | |
| 108 | src |= (true_blit[6]&3)<<16; | |
| 126 | //printf("%02x %02x %02x %02x %02x %02x %02x\n", state->true_blit[0], state->true_blit[1], state->true_blit[2], state->true_blit[3], state->true_blit[4], state->true_blit[5], state->true_blit[6]); | |
| 127 | w = (state->true_blit[4] & 0xff) + 1; | |
| 128 | h = (state->true_blit[5] & 0xff) + 1; | |
| 129 | src = ((state->true_blit[1] << 8) | (state->true_blit[0] << 0)); | |
| 130 | src |= (state->true_blit[6] & 3) << 16; | |
| 109 | 131 | |
| 132 | x = (state->true_blit[2] & 0xff); | |
| 133 | y = (state->true_blit[3] & 0xff); | |
| 110 | 134 | |
| 111 | x = (true_blit[2] & 0xff); | |
| 112 | y = (true_blit[3] & 0xff); | |
| 113 | ||
| 114 | 135 | // lowest bit of src controls flipping / draw direction? |
| 115 | flipx=(true_blit[0] & 1); | |
| 136 | flipx = (state->true_blit[0] & 1); | |
| 116 | 137 | |
| 117 | if (!flipx) src += (w*h)-1; | |
| 118 | else src -= (w*h)-1; | |
| 138 | if (!flipx) | |
| 139 | src += (w * h) - 1; | |
| 140 | else | |
| 141 | src -= (w * h) - 1; | |
| 119 | 142 | |
| 120 | 143 | { |
| 121 | 144 | int count = 0; |
| 122 | int xcount,ycount; | |
| 123 | for(ycount=0;ycount<h;ycount++) | |
| 145 | int xcount, ycount; | |
| 146 | for (ycount = 0; ycount < h; ycount++) | |
| 124 | 147 | { |
| 125 | for(xcount=0;xcount<w;xcount++) | |
| 148 | for (xcount = 0; xcount < w; xcount++) | |
| 126 | 149 | { |
| 127 | int drawx = (x+xcount) & 0xff; | |
| 128 | int drawy = (y+ycount) & 0xff; | |
| 129 | UINT8 dat = nightgal_gfx_nibble(space->machine,src+count); | |
| 130 | UINT8 cur_pen_hi = pen_data[(dat & 0xf0)>>4]; | |
| 131 | UINT8 cur_pen_lo = pen_data[(dat & 0x0f)>>0]; | |
| 150 | int drawx = (x + xcount) & 0xff; | |
| 151 | int drawy = (y + ycount) & 0xff; | |
| 152 | UINT8 dat = nightgal_gfx_nibble(space->machine, src + count); | |
| 153 | UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4]; | |
| 154 | UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0]; | |
| 132 | 155 | |
| 133 | dat = cur_pen_lo | cur_pen_hi<<4; | |
| 156 | dat = cur_pen_lo | (cur_pen_hi << 4); | |
| 134 | 157 | |
| 135 | if((dat & 0xff) != 0) | |
| 136 | plot_nightgal_gfx_pixel(dat, drawx,drawy); | |
| 158 | if ((dat & 0xff) != 0) | |
| 159 | plot_nightgal_gfx_pixel(space->machine, dat, drawx, drawy); | |
| 137 | 160 | |
| 138 | if (!flipx) count--; | |
| 139 | else count++; | |
| 161 | if (!flipx) | |
| 162 | count--; | |
| 163 | else | |
| 164 | count++; | |
| 140 | 165 | } |
| 141 | 166 | } |
| 142 | 167 | } |
| r7500 | r7501 | |
| 146 | 171 | /* different register writes (probably a PAL line swapping).*/ |
| 147 | 172 | static WRITE8_HANDLER( sexygal_nsc_true_blitter_w ) |
| 148 | 173 | { |
| 149 | static UINT8 true_blit[7]; | |
| 174 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 175 | int src, x, y, h, w, flipx; | |
| 176 | state->true_blit[offset] = data; | |
| 150 | 177 | |
| 151 | int src,x,y,h,w, flipx; | |
| 152 | true_blit[offset] = data; | |
| 153 | ||
| 154 | 178 | /*trigger blitter write to ram,might not be correct...*/ |
| 155 | if(offset == 6) | |
| 179 | if (offset == 6) | |
| 156 | 180 | { |
| 157 | //printf("%02x %02x %02x %02x %02x %02x %02x\n",true_blit[0],true_blit[1],true_blit[2],true_blit[3],true_blit[4],true_blit[5],true_blit[6]); | |
| 158 | w = (true_blit[5] & 0xff)+1; | |
| 159 | h = (true_blit[6] & 0xff)+1; | |
| 160 | src = ((true_blit[1]<<8)|(true_blit[0]<<0)); | |
| 161 | src |= (true_blit[2]&3)<<16; | |
| 181 | //printf("%02x %02x %02x %02x %02x %02x %02x\n", state->true_blit[0], state->true_blit[1], state->true_blit[2], state->true_blit[3], state->true_blit[4], state->true_blit[5], state->true_blit[6]); | |
| 182 | w = (state->true_blit[5] & 0xff) + 1; | |
| 183 | h = (state->true_blit[6] & 0xff) + 1; | |
| 184 | src = ((state->true_blit[1] << 8) | (state->true_blit[0] << 0)); | |
| 185 | src |= (state->true_blit[2] & 3) << 16; | |
| 162 | 186 | |
| 163 | 187 | |
| 164 | x = (true_blit[3] & 0xff); | |
| 165 | y = (true_blit[4] & 0xff); | |
| 188 | x = (state->true_blit[3] & 0xff); | |
| 189 | y = (state->true_blit[4] & 0xff); | |
| 166 | 190 | |
| 167 | 191 | // lowest bit of src controls flipping / draw direction? |
| 168 | flipx=(true_blit[0] & 1); | |
| 192 | flipx = (state->true_blit[0] & 1); | |
| 169 | 193 | |
| 170 | if (!flipx) src += (w*h)-1; | |
| 171 | else src -= (w*h)-1; | |
| 194 | if (!flipx) | |
| 195 | src += (w * h) - 1; | |
| 196 | else | |
| 197 | src -= (w * h) - 1; | |
| 172 | 198 | |
| 173 | 199 | { |
| 174 | 200 | int count = 0; |
| 175 | int xcount,ycount; | |
| 176 | for(ycount=0;ycount<h;ycount++) | |
| 201 | int xcount, ycount; | |
| 202 | for (ycount = 0; ycount < h; ycount++) | |
| 177 | 203 | { |
| 178 | for(xcount=0;xcount<w;xcount++) | |
| 204 | for (xcount = 0; xcount < w; xcount++) | |
| 179 | 205 | { |
| 180 | int drawx = (x+xcount) & 0xff; | |
| 181 | int drawy = (y+ycount) & 0xff; | |
| 182 | UINT8 dat = nightgal_gfx_nibble(space->machine,src+count); | |
| 183 | UINT8 cur_pen_hi = pen_data[(dat & 0xf0)>>4]; | |
| 184 | UINT8 cur_pen_lo = pen_data[(dat & 0x0f)>>0]; | |
| 206 | int drawx = (x + xcount) & 0xff; | |
| 207 | int drawy = (y + ycount) & 0xff; | |
| 208 | UINT8 dat = nightgal_gfx_nibble(space->machine, src + count); | |
| 209 | UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4]; | |
| 210 | UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0]; | |
| 185 | 211 | |
| 186 | dat = cur_pen_lo | cur_pen_hi<<4; | |
| 212 | dat = cur_pen_lo | cur_pen_hi << 4; | |
| 187 | 213 | |
| 188 | if((dat & 0xff) != 0) | |
| 189 | plot_nightgal_gfx_pixel(dat, drawx,drawy); | |
| 214 | if ((dat & 0xff) != 0) | |
| 215 | plot_nightgal_gfx_pixel(space->machine, dat, drawx, drawy); | |
| 190 | 216 | |
| 191 | if (!flipx) count--; | |
| 192 | else count++; | |
| 217 | if (!flipx) | |
| 218 | count--; | |
| 219 | else | |
| 220 | count++; | |
| 193 | 221 | } |
| 194 | 222 | } |
| 195 | //printf("%02x %02x %02x %02x %02x %02x %02x\n",true_blit[0],true_blit[1],true_blit[2],true_blit[3],true_blit[4],true_blit[5],true_blit[6]); | |
| 196 | //cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE ); | |
| 223 | //cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE ); | |
| 197 | 224 | } |
| 198 | 225 | } |
| 199 | 226 | } |
| r7500 | r7501 | |
| 212 | 239 | 2, resistances_b, weights_b, 0, 0, |
| 213 | 240 | 0, 0, 0, 0, 0); |
| 214 | 241 | |
| 215 | for (i = 0;i < machine->config->total_colors; i++) | |
| 242 | for (i = 0; i < machine->config->total_colors; i++) | |
| 216 | 243 | { |
| 217 | 244 | int bit0, bit1, bit2; |
| 218 | 245 | int r, g, b; |
| 219 | 246 | |
| 220 | 247 | /* red component */ |
| 221 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 222 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 223 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 248 | bit0 = BIT(color_prom[i], 0); | |
| 249 | bit1 = BIT(color_prom[i], 1); | |
| 250 | bit2 = BIT(color_prom[i], 2); | |
| 224 | 251 | r = combine_3_weights(weights_rg, bit0, bit1, bit2); |
| 225 | 252 | |
| 226 | 253 | /* green component */ |
| 227 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 228 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 229 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 254 | bit0 = BIT(color_prom[i], 3); | |
| 255 | bit1 = BIT(color_prom[i], 4); | |
| 256 | bit2 = BIT(color_prom[i], 5); | |
| 230 | 257 | g = combine_3_weights(weights_rg, bit0, bit1, bit2); |
| 231 | 258 | |
| 232 | 259 | /* blue component */ |
| 233 | bit0 = (color_prom[i] >> 6) & 0x01; | |
| 234 | bit1 = (color_prom[i] >> 7) & 0x01; | |
| 260 | bit0 = BIT(color_prom[i], 6); | |
| 261 | bit1 = BIT(color_prom[i], 7); | |
| 235 | 262 | b = combine_2_weights(weights_b, bit0, bit1); |
| 236 | 263 | |
| 237 | 264 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 261 | 288 | -executes a wai (i.e. halt) opcode then expects to receive another irq... |
| 262 | 289 | */ |
| 263 | 290 | |
| 264 | #define MAIN_Z80_RUN if(offset == 2) z80_latch = 0x00 | |
| 265 | #define MAIN_Z80_HALT if(offset == 2) z80_latch = 0x80 | |
| 266 | //#define SUB_NCS_RUN ncs_latch = 0x00 | |
| 267 | //#define SUB_NCS_HALT ncs_latch = 0x80 | |
| 291 | #define MAIN_Z80_RUN if(offset == 2) state->z80_latch = 0x00 | |
| 292 | #define MAIN_Z80_HALT if(offset == 2) state->z80_latch = 0x80 | |
| 293 | //#define SUB_NCS_RUN state->ncs_latch = 0x00 | |
| 294 | //#define SUB_NCS_HALT state->ncs_latch = 0x80 | |
| 268 | 295 | |
| 269 | static UINT8 nsc_latch,z80_latch; | |
| 270 | ||
| 271 | 296 | static WRITE8_HANDLER( nsc_latch_w ) |
| 272 | 297 | { |
| 273 | cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE ); | |
| 298 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 299 | cpu_set_input_line(state->subcpu, 0, HOLD_LINE ); | |
| 274 | 300 | } |
| 275 | 301 | |
| 276 | 302 | static READ8_HANDLER( nsc_latch_r ) |
| 277 | 303 | { |
| 278 | return z80_latch; | |
| 304 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 305 | return state->z80_latch; | |
| 279 | 306 | } |
| 280 | 307 | |
| 281 | 308 | static WRITE8_HANDLER( z80_latch_w ) |
| 282 | 309 | { |
| 283 | nsc_latch = data; | |
| 310 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 311 | state->nsc_latch = data; | |
| 284 | 312 | } |
| 285 | 313 | |
| 286 | 314 | static READ8_HANDLER( z80_latch_r ) |
| 287 | 315 | { |
| 288 | return nsc_latch; | |
| 316 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 317 | return state->nsc_latch; | |
| 289 | 318 | } |
| 290 | 319 | |
| 291 | 320 | /*z80 -> MCU video params*/ |
| 292 | 321 | static WRITE8_HANDLER( blitter_w ) |
| 293 | 322 | { |
| 294 | blit_raw_data[offset] = data; | |
| 323 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 324 | state->blit_raw_data[offset] = data; | |
| 295 | 325 | MAIN_Z80_HALT; |
| 296 | 326 | } |
| 297 | 327 | |
| 298 | 328 | static READ8_HANDLER( nsc_blit_r ) |
| 299 | 329 | { |
| 330 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 300 | 331 | MAIN_Z80_RUN; |
| 301 | return blit_raw_data[offset]; | |
| 332 | return state->blit_raw_data[offset]; | |
| 302 | 333 | } |
| 303 | 334 | |
| 304 | 335 | static WRITE8_HANDLER( blit_vregs_w ) |
| 305 | 336 | { |
| 306 | pen_raw_data[offset] = data; | |
| 337 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 338 | state->pen_raw_data[offset] = data; | |
| 307 | 339 | } |
| 308 | 340 | |
| 309 | 341 | static READ8_HANDLER( blit_vregs_r ) |
| 310 | 342 | { |
| 311 | return pen_raw_data[offset]; | |
| 343 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 344 | return state->pen_raw_data[offset]; | |
| 312 | 345 | } |
| 313 | 346 | |
| 314 | 347 | static WRITE8_HANDLER( blit_true_vregs_w ) |
| 315 | 348 | { |
| 316 | pen_data[offset] = data; | |
| 349 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 350 | state->pen_data[offset] = data; | |
| 317 | 351 | } |
| 318 | 352 | |
| 319 | 353 | /******************************************** |
| r7500 | r7501 | |
| 322 | 356 | * |
| 323 | 357 | ********************************************/ |
| 324 | 358 | |
| 325 | static UINT8 mux_data; | |
| 326 | ||
| 327 | 359 | static WRITE8_HANDLER( mux_w ) |
| 328 | 360 | { |
| 329 | mux_data = ~data; | |
| 330 | // printf("%02x\n",mux_data); | |
| 361 | nightgal_state *state = (nightgal_state *)space->machine->driver_data; | |
| 362 | state->mux_data = ~data; | |
| 363 | //printf("%02x\n", state->mux_data); | |
| 331 | 364 | } |
| 332 | 365 | |
| 333 | 366 | static READ8_DEVICE_HANDLER( input_1p_r ) |
| 334 | 367 | { |
| 335 | static UINT8 cr_clear; | |
| 368 | nightgal_state *state = (nightgal_state *)device->machine->driver_data; | |
| 369 | UINT8 cr_clear = input_port_read(device->machine, "CR_CLEAR"); | |
| 336 | 370 | |
| 337 | cr_clear = input_port_read(device->machine, "CR_CLEAR"); | |
| 338 | ||
| 339 | switch(mux_data) | |
| 371 | switch (state->mux_data) | |
| 340 | 372 | { |
| 341 | 373 | case 0x01: return input_port_read(device->machine, "PL1_1") | cr_clear; |
| 342 | 374 | case 0x02: return input_port_read(device->machine, "PL1_2") | cr_clear; |
| r7500 | r7501 | |
| 345 | 377 | case 0x10: return input_port_read(device->machine, "PL1_5") | cr_clear; |
| 346 | 378 | case 0x20: return input_port_read(device->machine, "PL1_6") | cr_clear; |
| 347 | 379 | } |
| 348 | // | |
| 380 | // | |
| 349 | 381 | |
| 350 | 382 | return (input_port_read(device->machine, "PL1_1") & input_port_read(device->machine, "PL1_2") & input_port_read(device->machine, "PL1_3") & |
| 351 | input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear; | |
| 383 | input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear; | |
| 352 | 384 | } |
| 353 | 385 | |
| 354 | 386 | static READ8_DEVICE_HANDLER( input_2p_r ) |
| 355 | 387 | { |
| 356 | static UINT8 coin_port; | |
| 388 | nightgal_state *state = (nightgal_state *)device->machine->driver_data; | |
| 389 | UINT8 coin_port = input_port_read(device->machine, "COINS"); | |
| 357 | 390 | |
| 358 | coin_port = input_port_read(device->machine, "COINS"); | |
| 359 | ||
| 360 | switch(mux_data) | |
| 391 | switch (state->mux_data) | |
| 361 | 392 | { |
| 362 | 393 | case 0x01: return input_port_read(device->machine, "PL2_1") | coin_port; |
| 363 | 394 | case 0x02: return input_port_read(device->machine, "PL2_2") | coin_port; |
| r7500 | r7501 | |
| 366 | 397 | case 0x10: return input_port_read(device->machine, "PL2_5") | coin_port; |
| 367 | 398 | case 0x20: return input_port_read(device->machine, "PL2_6") | coin_port; |
| 368 | 399 | } |
| 369 | // | |
| 400 | // | |
| 370 | 401 | |
| 371 | 402 | return (input_port_read(device->machine, "PL2_1") & input_port_read(device->machine, "PL2_2") & input_port_read(device->machine, "PL2_3") & |
| 372 | input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port;//input_port_read(device->machine, "PL1_0") && ; | |
| 373 | ||
| 403 | input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port; | |
| 374 | 404 | } |
| 375 | 405 | |
| 376 | 406 | /******************************************** |
| r7500 | r7501 | |
| 481 | 511 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) |
| 482 | 512 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) |
| 483 | 513 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) |
| 514 | ||
| 484 | 515 | PORT_START("PL1_2") |
| 485 | 516 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) |
| 486 | 517 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) |
| r7500 | r7501 | |
| 488 | 519 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) |
| 489 | 520 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) |
| 490 | 521 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_3)//rate button |
| 522 | ||
| 491 | 523 | PORT_START("PL1_3") |
| 492 | 524 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) |
| 493 | 525 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) |
| r7500 | r7501 | |
| 495 | 527 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) |
| 496 | 528 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) |
| 497 | 529 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button |
| 530 | ||
| 498 | 531 | PORT_START("PL1_4") |
| 499 | 532 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) |
| 500 | 533 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) |
| 501 | 534 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) |
| 502 | 535 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) |
| 503 | 536 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button |
| 537 | ||
| 504 | 538 | PORT_START("PL1_5") |
| 505 | 539 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) |
| 506 | 540 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 1") |
| r7500 | r7501 | |
| 508 | 542 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) |
| 509 | 543 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 3") |
| 510 | 544 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 4") |
| 545 | ||
| 511 | 546 | PORT_START("PL1_6") |
| 512 | 547 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 513 | 548 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Pass") //??? |
| r7500 | r7501 | |
| 520 | 555 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) |
| 521 | 556 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) |
| 522 | 557 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) |
| 558 | ||
| 523 | 559 | PORT_START("PL2_2") |
| 524 | 560 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) |
| 525 | 561 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 527 | 563 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) |
| 528 | 564 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) |
| 529 | 565 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_4) PORT_PLAYER(2)//rate button |
| 566 | ||
| 530 | 567 | PORT_START("PL2_3") |
| 531 | 568 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) |
| 532 | 569 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 534 | 571 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) |
| 535 | 572 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) |
| 536 | 573 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button |
| 574 | ||
| 537 | 575 | PORT_START("PL2_4") |
| 538 | 576 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) |
| 539 | 577 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) |
| 540 | 578 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) |
| 541 | 579 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) |
| 542 | 580 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button |
| 581 | ||
| 543 | 582 | PORT_START("PL2_5") |
| 544 | 583 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) |
| 545 | 584 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 1") PORT_PLAYER(2) |
| r7500 | r7501 | |
| 547 | 586 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) |
| 548 | 587 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 3") PORT_PLAYER(2) |
| 549 | 588 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 4") PORT_PLAYER(2) |
| 589 | ||
| 550 | 590 | PORT_START("PL2_6") |
| 551 | 591 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 552 | 592 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Pass") PORT_PLAYER(2) //??? |
| r7500 | r7501 | |
| 693 | 733 | DEVCB_NULL |
| 694 | 734 | }; |
| 695 | 735 | |
| 736 | ||
| 737 | static MACHINE_START( nightgal ) | |
| 738 | { | |
| 739 | nightgal_state *state = (nightgal_state *)machine->driver_data; | |
| 740 | ||
| 741 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 742 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 743 | ||
| 744 | state_save_register_global(machine, state->nsc_latch); | |
| 745 | state_save_register_global(machine, state->z80_latch); | |
| 746 | state_save_register_global(machine, state->mux_data); | |
| 747 | ||
| 748 | state_save_register_global_array(machine, state->blit_raw_data); | |
| 749 | state_save_register_global_array(machine, state->true_blit); | |
| 750 | state_save_register_global_array(machine, state->pen_data); | |
| 751 | state_save_register_global_array(machine, state->pen_raw_data); | |
| 752 | } | |
| 753 | ||
| 754 | static MACHINE_RESET( nightgal ) | |
| 755 | { | |
| 756 | nightgal_state *state = (nightgal_state *)machine->driver_data; | |
| 757 | ||
| 758 | state->nsc_latch = 0; | |
| 759 | state->z80_latch = 0; | |
| 760 | state->mux_data = 0; | |
| 761 | ||
| 762 | memset(state->blit_raw_data, 0, ARRAY_LENGTH(state->blit_raw_data)); | |
| 763 | memset(state->true_blit, 0, ARRAY_LENGTH(state->true_blit)); | |
| 764 | memset(state->pen_data, 0, ARRAY_LENGTH(state->pen_data)); | |
| 765 | memset(state->pen_raw_data, 0, ARRAY_LENGTH(state->pen_raw_data)); | |
| 766 | } | |
| 767 | ||
| 696 | 768 | static MACHINE_DRIVER_START( nightgal ) |
| 769 | ||
| 770 | /* driver data */ | |
| 771 | MDRV_DRIVER_DATA(nightgal_state) | |
| 772 | ||
| 697 | 773 | /* basic machine hardware */ |
| 698 | 774 | MDRV_CPU_ADD("maincpu", Z80,MASTER_CLOCK / 4) /* ? MHz */ |
| 699 | 775 | MDRV_CPU_PROGRAM_MAP(nightgal_map) |
| r7500 | r7501 | |
| 705 | 781 | |
| 706 | 782 | MDRV_QUANTUM_PERFECT_CPU("maincpu") |
| 707 | 783 | |
| 784 | MDRV_MACHINE_START(nightgal) | |
| 785 | MDRV_MACHINE_RESET(nightgal) | |
| 786 | ||
| 708 | 787 | /* video hardware */ |
| 709 | 788 | MDRV_SCREEN_ADD("screen", RASTER) |
| 710 | 789 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 1026 | 1105 | |
| 1027 | 1106 | |
| 1028 | 1107 | /* Type 1 HW*/ |
| 1029 | GAME( 1984, nightgal, 0, nightgal, sexygal, 0, ROT0,"Nichibutsu", "Night Gal (Japan 840920 AG 1-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1030 | GAME( 1984, ngtbunny, 0, nightgal, sexygal, 0, ROT0,"Nichibutsu", "Night Bunny (Japan 840601 MRN 2-10)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1031 | GAME( 1984, royalngt, ngtbunny,nightgal, sexygal, 0, ROT0,"Royal Denshi", "Royal Night (Japan 840220 RN 2-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1108 | GAME( 1984, nightgal, 0, nightgal, sexygal, 0, ROT0, "Nichibutsu", "Night Gal (Japan 840920 AG 1-00)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) | |
| 1109 | GAME( 1984, ngtbunny, 0, nightgal, sexygal, 0, ROT0, "Nichibutsu", "Night Bunny (Japan 840601 MRN 2-10)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) | |
| 1110 | GAME( 1984, royalngt, ngtbunny, nightgal, sexygal, 0, ROT0, "Royal Denshi", "Royal Night (Japan 840220 RN 2-00)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) | |
| 1032 | 1111 | /* Type 2 HW*/ |
| 1033 | GAME( 1985, sexygal, 0, sexygal, sexygal, 0, ROT0,"Nichibutsu", "Sexy Gal (Japan 850501 SXG 1-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1034 | GAME( 1985, sweetgal, sexygal, sexygal, sexygal, 0, ROT0,"Nichibutsu", "Sweet Gal (Japan 850510 SWG 1-02)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1112 | GAME( 1985, sexygal, 0, sexygal, sexygal, 0, ROT0, "Nichibutsu", "Sexy Gal (Japan 850501 SXG 1-00)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) | |
| 1113 | GAME( 1985, sweetgal, sexygal, sexygal, sexygal, 0, ROT0, "Nichibutsu", "Sweet Gal (Japan 850510 SWG 1-02)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) | |
| 1035 | 1114 | /* Type 3 HW*/ |
| 1036 | GAME( 1985, ngalsumr, 0, nightgal, sexygal, 0, ROT0,"Nichibutsu", "Night Gal Summer", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) | |
| 1115 | GAME( 1985, ngalsumr, 0, nightgal, sexygal, 0, ROT0, "Nichibutsu", "Night Gal Summer", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | Walter Fath |
| 9 | 9 | |
| 10 | 10 | Currently Supported Games: |
| 11 | Namco Classics Vol #1 | |
| 12 | Namco Classics Vol #2 | |
| 11 | Namco Classic Vol #1 | |
| 12 | Namco Classic Vol #2 | |
| 13 | 13 | |
| 14 | 14 | PCB Layout |
| 15 | 15 | ---------- |
| r7500 | r7501 | |
| 408 | 408 | ROM_LOAD( "ncs1voic.7c", 0x000000, 0x200000, CRC(ed05fd88) SHA1(ad88632c89a9946708fc6b4c9247e1bae9b2944b) ) |
| 409 | 409 | ROM_END |
| 410 | 410 | |
| 411 | GAME( 1995, ncv1, 0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 412 | GAME( 1995, ncv1j, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 413 | GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 414 | GAME( 1996, ncv2, 0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) | |
| 415 | GAME( 1996, ncv2j, ncv2, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) | |
| 411 | GAME( 1995, ncv1, 0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classic Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 412 | GAME( 1995, ncv1j, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classic Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 413 | GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classic Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 414 | GAME( 1996, ncv2, 0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classic Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) | |
| 415 | GAME( 1996, ncv2j, ncv2, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classic Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) |
| r0 | r7501 | |
|---|---|---|
| 1 | /* | |
| 2 | ||
| 3 | Royal Gum | |
| 4 | ||
| 5 | Unknown CPU (either Z80 or Z180) | |
| 6 | ||
| 7 | Big Black Box in the middle of the PCB (for encryption, or containing roms?) | |
| 8 | ||
| 9 | */ | |
| 10 | ||
| 11 | #include "emu.h" | |
| 12 | #include "cpu/z80/z80.h" | |
| 13 | ||
| 14 | static ADDRESS_MAP_START( rgum_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 15 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 16 | ADDRESS_MAP_END | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( rgum ) | |
| 20 | INPUT_PORTS_END | |
| 21 | ||
| 22 | ||
| 23 | static const gfx_layout tiles8x8_layout = | |
| 24 | { | |
| 25 | 8,8, | |
| 26 | RGN_FRAC(1,3), | |
| 27 | 3, | |
| 28 | { RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3) }, | |
| 29 | { 0, 1,2,3,4,5,6,7 }, | |
| 30 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 31 | 8*8 | |
| 32 | }; | |
| 33 | ||
| 34 | static GFXDECODE_START( rgum ) | |
| 35 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) | |
| 36 | GFXDECODE_END | |
| 37 | ||
| 38 | VIDEO_START(royalgum) | |
| 39 | { | |
| 40 | ||
| 41 | } | |
| 42 | ||
| 43 | VIDEO_UPDATE(royalgum) | |
| 44 | { | |
| 45 | return 0; | |
| 46 | } | |
| 47 | ||
| 48 | ||
| 49 | static MACHINE_DRIVER_START( rgum ) | |
| 50 | /* basic machine hardware */ | |
| 51 | MDRV_CPU_ADD("maincpu", Z80,8000000) /* ? MHz */ | |
| 52 | MDRV_CPU_PROGRAM_MAP(rgum_map) | |
| 53 | // MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) | |
| 54 | ||
| 55 | /* video hardware */ | |
| 56 | MDRV_SCREEN_ADD("screen", RASTER) | |
| 57 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 58 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 59 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 60 | MDRV_SCREEN_SIZE(256, 256) | |
| 61 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) | |
| 62 | ||
| 63 | MDRV_GFXDECODE(rgum) | |
| 64 | MDRV_PALETTE_LENGTH(0x100) | |
| 65 | ||
| 66 | MDRV_VIDEO_START(royalgum) | |
| 67 | MDRV_VIDEO_UPDATE(royalgum) | |
| 68 | MACHINE_DRIVER_END | |
| 69 | ||
| 70 | ||
| 71 | ||
| 72 | ||
| 73 | ROM_START( rgum ) | |
| 74 | ROM_REGION( 0x20000, "maincpu", 0 ) | |
| 75 | ROM_LOAD( "rgum.u47", 0x00000, 0x20000, CRC(fe410eb9) SHA1(25180ba336269279f251be5483c210a581d27197) ) // encrypted.. 2nd half empty | |
| 76 | ||
| 77 | ROM_REGION( 0x10000, "data", 0 ) | |
| 78 | ROM_LOAD( "rgum.u5", 0x00000, 0x10000, CRC(9d2d1681) SHA1(1c1da0d970ea2cf58f7961417ab6986cc667da5c) ) // plaintext in here, but firt half is empty | |
| 79 | ||
| 80 | ROM_REGION( 0x10000, "unk", 0 ) | |
| 81 | ROM_LOAD( "rgum.u6", 0x00000, 0x2000, CRC(15a34117) SHA1(c7e0aef4007abfaaa533feb026148ba03230b79f) ) // near the data rom, mostly empty | |
| 82 | ||
| 83 | ROM_REGION( 0x18000, "gfx1", 0 ) | |
| 84 | ROM_LOAD( "rgum.u16", 0x00000, 0x8000, CRC(2a2c8d78) SHA1(2ce335b900dccbc34ad8ae7ae02ec7c75ffcd559) ) // first half empty | |
| 85 | ROM_CONTINUE(0x00000,0x8000) | |
| 86 | ROM_LOAD( "rgum.u17", 0x08000, 0x8000, CRC(fae4e41a) SHA1(421aac2b567040c3a56e01aa70880c94450eaf76) ) // first half empty | |
| 87 | ROM_CONTINUE(0x08000,0x8000) | |
| 88 | ROM_LOAD( "rgum.u18", 0x10000, 0x8000, CRC(79b17da7) SHA1(31e1845261b0152df56135c212e55c4048b7496f) ) // first half empty | |
| 89 | ROM_CONTINUE(0x10000,0x8000) | |
| 90 | ROM_END | |
| 91 | ||
| 92 | ||
| 93 | GAME( 199?, rgum, 0, rgum, rgum, 0, ROT0, "<unknown>", "Royal Gum (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | #include "emu.h" |
| 45 | 45 | #include "cpu/m6502/m6502.h" |
| 46 | #include " | |
| 46 | #include "so | |
| 47 | 47 | |
| 48 | 48 | |
| 49 | static UINT8 *mainram; | |
| 50 | static UINT8 *tileram; | |
| 49 | class attckufo_state | |
| 50 | { | |
| 51 | public: | |
| 52 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, attckufo_state(machine)); } | |
| 51 | 53 | |
| 54 | attckufo_state(running_machine &machine) { } | |
| 55 | ||
| 56 | /* memory pointers */ | |
| 57 | UINT8 * mainram; | |
| 58 | UINT8 * tileram; | |
| 59 | ||
| 60 | /* devices */ | |
| 61 | running_device *maincpu; | |
| 62 | running_device *mos6560; | |
| 63 | }; | |
| 64 | ||
| 65 | ||
| 66 | ||
| 67 | static const rgb_t attckufo_palette[] = | |
| 68 | { | |
| 69 | /* ripped from vice, a very excellent emulator */ | |
| 70 | MAKE_RGB(0x00, 0x00, 0x00), | |
| 71 | MAKE_RGB(0xff, 0xff, 0xff), | |
| 72 | MAKE_RGB(0xf0, 0x00, 0x00), | |
| 73 | MAKE_RGB(0x00, 0xf0, 0xf0), | |
| 74 | ||
| 75 | MAKE_RGB(0x60, 0x00, 0x60), | |
| 76 | MAKE_RGB(0x00, 0xa0, 0x00), | |
| 77 | MAKE_RGB(0x00, 0x00, 0xf0), | |
| 78 | MAKE_RGB(0xd0, 0xd0, 0x00), | |
| 79 | ||
| 80 | MAKE_RGB(0xc0, 0xa0, 0x00), | |
| 81 | MAKE_RGB(0xff, 0xa0, 0x00), | |
| 82 | MAKE_RGB(0xf0, 0x80, 0x80), | |
| 83 | MAKE_RGB(0x00, 0xff, 0xff), | |
| 84 | ||
| 85 | MAKE_RGB(0xff, 0x00, 0xff), | |
| 86 | MAKE_RGB(0x00, 0xff, 0x00), | |
| 87 | MAKE_RGB(0x00, 0xa0, 0xff), | |
| 88 | MAKE_RGB(0xff, 0xff, 0x00) | |
| 89 | }; | |
| 90 | ||
| 52 | 91 | static PALETTE_INIT( attckufo ) |
| 53 | 92 | { |
| 54 | 93 | palette_set_colors(machine, 0, attckufo_palette, ARRAY_LENGTH(attckufo_palette)); |
| r7500 | r7501 | |
| 79 | 118 | |
| 80 | 119 | static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 81 | 120 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 82 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&mainram) | |
| 83 | AM_RANGE(0x1000, 0x100f) AM_READWRITE(attckufo_port_r, attckufo_port_w) | |
| 121 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE_MEMBER(attckufo_state, mainram) | |
| 122 | AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("mos6560", mos6560_port_r, mos6560_port_w) | |
| 84 | 123 | AM_RANGE(0x1400, 0x1403) AM_READWRITE(attckufo_io_r, attckufo_io_w) |
| 85 | AM_RANGE(0x1c00, 0x1fff) AM_RAM AM_BASE( | |
| 124 | AM_RANGE(0x1c00, 0x1fff) AM_RAM AM_BASE_MEMBER(attckufo_state, tileram) | |
| 86 | 125 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 87 | 126 | ADDRESS_MAP_END |
| 88 | 127 | |
| r7500 | r7501 | |
| 114 | 153 | INPUT_PORTS_END |
| 115 | 154 | |
| 116 | 155 | |
| 156 | INTERRUPT_GEN( attckufo_raster_interrupt ) | |
| 157 | { | |
| 158 | attckufo_state *state = (attckufo_state *)device->machine->driver_data; | |
| 159 | mos6560_raster_interrupt_gen(state->mos6560); | |
| 160 | } | |
| 161 | ||
| 162 | VIDEO_UPDATE( attckufo ) | |
| 163 | { | |
| 164 | attckufo_state *state = (attckufo_state *)screen->machine->driver_data; | |
| 165 | mos6560_video_update(state->mos6560, bitmap, cliprect); | |
| 166 | return 0; | |
| 167 | } | |
| 168 | ||
| 169 | static int attckufo_dma_read( running_machine *machine, int offset ) | |
| 170 | { | |
| 171 | attckufo_state *state = (attckufo_state *)machine->driver_data; | |
| 172 | const address_space *program = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM); | |
| 173 | return memory_read_byte(program, offset); | |
| 174 | } | |
| 175 | ||
| 176 | static int attckufo_dma_read_color( running_machine *machine, int offset ) | |
| 177 | { | |
| 178 | attckufo_state *state = (attckufo_state *)machine->driver_data; | |
| 179 | const address_space *program = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM); | |
| 180 | return memory_read_byte(program, offset + 0x400); | |
| 181 | } | |
| 182 | ||
| 183 | static const mos6560_interface attckufo_6560_intf = | |
| 184 | { | |
| 185 | "screen", /* screen */ | |
| 186 | MOS6560_ATTACKUFO, | |
| 187 | NULL, NULL, NULL, /* lightgun cb */ | |
| 188 | NULL, NULL, /* paddle cb */ | |
| 189 | attckufo_dma_read, attckufo_dma_read_color /* DMA */ | |
| 190 | }; | |
| 191 | ||
| 192 | ||
| 193 | static MACHINE_START( attckufo ) | |
| 194 | { | |
| 195 | attckufo_state *state = (attckufo_state *)machine->driver_data; | |
| 196 | ||
| 197 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 198 | state->mos6560 = devtag_get_device(machine, "mos6560"); | |
| 199 | } | |
| 200 | ||
| 117 | 201 | static MACHINE_DRIVER_START( attckufo ) |
| 202 | ||
| 203 | /* driver data */ | |
| 204 | MDRV_DRIVER_DATA(attckufo_state) | |
| 205 | ||
| 206 | /* basic machine hardware */ | |
| 118 | 207 | MDRV_CPU_ADD("maincpu", M6502, 14318181/14) |
| 119 | 208 | MDRV_CPU_PROGRAM_MAP(cpu_map) |
| 120 | MDRV_CPU_PERIODIC_INT(attckufo_raster_interrupt, | |
| 209 | MDRV_CPU_PERIODIC_INT(attckufo_raster_interrupt, MOS6 | |
| 121 | 210 | |
| 122 | ||
| 211 | MDRV_MACHINE_START(attckufo) | |
| 123 | 212 | |
| 213 | /* video hardware */ | |
| 124 | 214 | MDRV_SCREEN_ADD("screen", RASTER) |
| 125 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 126 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 215 | MDRV_SCREEN_REFRESH_RATE(MOS6560_VRETRACERATE) | |
| 216 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ | |
| 127 | 217 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 128 | MDRV_SCREEN_SIZE(256, 256) | |
| 129 | MDRV_SCREEN_VISIBLE_AREA(0, 23*8-1, 0, 22*8-1) | |
| 218 | MDRV_SCREEN_SIZE((MOS6560_XSIZE + 7) & ~7, MOS6560_YSIZE) | |
| 219 | MDRV_SCREEN_VISIBLE_AREA(0, 23*8 - 1, 0, 22*8 - 1) | |
| 130 | 220 | |
| 131 | 221 | MDRV_PALETTE_LENGTH(ARRAY_LENGTH(attckufo_palette)) |
| 132 | MDRV_PALETTE_INIT( | |
| 222 | MDRV_PALETTE_INIT( | |
| 133 | 223 | |
| 134 | MDRV_VIDEO_UPDATE( | |
| 224 | MDRV_VIDEO_UPDATE( | |
| 135 | 225 | |
| 136 | 226 | /* sound hardware */ |
| 137 | 227 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 138 | MDRV_ | |
| 228 | MDRV_MOS656X_ADD("mos6560", attckufo_656 | |
| 139 | 229 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 140 | 230 | MACHINE_DRIVER_END |
| 141 | 231 | |
| r7500 | r7501 | |
| 154 | 244 | ROM_COPY( "maincpu", 0x02000, 0x00000, 0x400) |
| 155 | 245 | ROM_END |
| 156 | 246 | |
| 157 | GAME( 1980, attckufo, 0, | |
| 247 | GAME( 1980, attckufo, 0, |
| r7500 | r7501 | |
|---|---|---|
| 32 | 32 | #define JONGKYO_CLOCK 18432000 |
| 33 | 33 | |
| 34 | 34 | |
| 35 | typedef struct _jongkyo_state jongkyo_state; | |
| 36 | struct _jongkyo_state | |
| 35 | class jongkyo_state | |
| 37 | 36 | { |
| 37 | public: | |
| 38 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jongkyo_state(machine)); } | |
| 39 | ||
| 40 | jongkyo_state(running_machine &machine) { } | |
| 41 | ||
| 38 | 42 | /* memory pointers */ |
| 39 | 43 | UINT8 * videoram; |
| 40 | 44 | UINT8 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 23 | 23 | TODO: |
| 24 | 24 | - Palette is not right. |
| 25 | 25 | |
| 26 | - H8/3002 now communicates with the H8/3334 on the I/O board, but it's not reliable yet. | |
| 27 | ||
| 28 | - Hook up actual inputs (?) via the 2 serial latches at d00004 and d00006. | |
| 26 | - Hook up gun inputs (?) via the 2 serial latches at d00004 and d00006. | |
| 29 | 27 | Works like this: write to d00004, then read d00004 12 times. Ditto at |
| 30 | d00006. This gives 24 bits of inputs (?) from the I/O board (?) | |
| 28 | d00006. This gives 24 bits of inputs (?) from the I/O board (?) or guns (?) | |
| 31 | 29 | |
| 32 | 30 | - The entire 3D subsystem. Is there a DSP living down there? If not, why the 300k |
| 33 | 31 | download on initial startup? |
| r7500 | r7501 | |
| 39 | 37 | - Serial number data is at offset 0x201 in the BIOS. Until the games are running |
| 40 | 38 | and displaying it I'm not going to meddle with it though. |
| 41 | 39 | |
| 40 | - Ok, it's the "mt" roms, which the game calls data roms. One pair is | |
| 41 | at a8000000, the other at aa000000. Point roms are accessed for | |
| 42 | checksumming through a port at a200000x: | |
| 43 | - reset the port by writing 0000 to a2000006 | |
| 44 | - write offset >> 16 to a2000004 | |
| 45 | - write offset & ffff to a2000004 (yes, same address, hence the reset) | |
| 46 | - read 2 bytes from one rom at a200000a | |
| 47 | - read 2 bytes from one rom at a200000c | |
| 48 | ||
| 49 | - Super System 23 tests irqs in the post. timecrs2c's code can | |
| 50 | potentially test 7 sources, but only actually test 5. With each | |
| 51 | source there is code to clear the interrupt and code to raise it. | |
| 52 | Levels 0 and 1 are not connected to anything according to the code. | |
| 53 | ||
| 54 | VBlank (level 2): | |
| 55 | clear: ad00000a.h = 0 | |
| 56 | raise: just wait for it | |
| 57 | ||
| 58 | C361 (level 3): | |
| 59 | clear: a6820008.h = 1ff | |
| 60 | a100005c.w = 0 | |
| 61 | a100005c.w = 1 | |
| 62 | a4c3ff04.w = 0 | |
| 63 | raise: a6820008.h = c8 | |
| 64 | a100005c.w = 1 | |
| 65 | ||
| 66 | Subcpu (level 3, same as C361): | |
| 67 | clear: same as C361 | |
| 68 | raise: a4405002.h = 3170 | |
| 69 | ||
| 70 | C435 (level 4): | |
| 71 | clear: a200000e.h = 1 | |
| 72 | a200000e.h = 0 | |
| 73 | raise: a2000000.h = a200 | |
| 74 | a2000000.h = 1 | |
| 75 | a2000000.h = 1 (yes, twice) | |
| 76 | ||
| 77 | C422 (level 5): | |
| 78 | clear: a6400002.h = f | |
| 79 | ad000008.h = 0 | |
| 80 | raise: a640000e.h = 0 | |
| 81 | a6400006.h = 1 | |
| 82 | a640000a.h = 1 | |
| 83 | a6400006.h = fffb | |
| 84 | a6400006.h = 0 | |
| 85 | ||
| 86 | RS323 (level 6, not tested by timecrs2c): | |
| 87 | clear: nothing | |
| 88 | raise: nothing | |
| 89 | ||
| 90 | Timer (level 7, not tested by timecrs2c): | |
| 91 | clear: c0.Compare = 10d880 | |
| 92 | raise: c0.Count = 10c8e0 | |
| 93 | c0.Compare = 10d880 | |
| 42 | 94 | */ |
| 43 | 95 | |
| 44 | 96 | /* |
| r7500 | r7501 | |
| 394 | 446 | |
| 395 | 447 | Game Code and revision |
| 396 | 448 | -------------------------------- |
| 397 | GP500 5GP3 Ver.C | |
| 449 | GP500 5GP3 Ver.C (for Super System 23) | |
| 450 | Time Crisis 2 TSS4 Ver.A (for Super System 23) | |
| 451 | ||
| 398 | 452 | Other games dumps with unknown PCB information.... |
| 399 | 453 | |
| 400 | 454 | Game Code and revision |
| r7500 | r7501 | |
| 498 | 552 | PIC16F84 - Microchip PIC16F84 Programmable Interrupt Controller stamped 'CAP10' (SOIC20) |
| 499 | 553 | MCU - Fujitsu MB90F574 Microcontroller, stamped 'FCAF10' (QFP120) |
| 500 | 554 | ADM485 - Analog Devices ADM485 +5V Low Power EIA RS-485 Transceiver (SOIC8) |
| 555 | ||
| 556 | I/O Boards for Gun games | |
| 557 | ------------------------ | |
| 558 | ||
| 559 | Type 1: | |
| 560 | ||
| 561 | V185 I/O PCB | |
| 562 | 2479961102 (2479971102) | |
| 563 | |-----------------------------------------| | |
| 564 | | J601 LED1 LED2 |-------| | | |
| 565 | | DSW(4)JP1 |-------| |TSSIO | | | |
| 566 | | |-----| | C78 |14.746MHz|PLD | | | |
| 567 | | |TSSIO| | |PST592 |-------| | | |
| 568 | | |PROG | |-------| | | |
| 569 | | |-----| | | |
| 570 | | | | |
| 571 | | 62256 | | |
| 572 | |ADM485 | | |
| 573 | |J1 SLA4060 J5| | |
| 574 | | J3 J4 | | |
| 575 | |-----------------------------------------| | |
| 576 | Notes: | |
| 577 | TSSIOPROG - Atmel AT29C020 EEPROM stamped 'TSSIOP8' (PLCC32) | |
| 578 | C78 - Namco Custom C78, actually a rebadged Hitachi HD643334 MCU (PLCC84) | |
| 579 | TSSIOPLD - Altera MAX EPM7128ELC84 CPLD with label 'TSSIOPLD' (PLCC84) | |
| 580 | SLA4060 - | |
| 581 | J1 - 12 position connector for power and I/O | |
| 582 | J3 - 12 position connector for buttons and gun connection | |
| 583 | J4 - not used? | |
| 584 | J5 - 6 position connector for network | |
| 585 | J601 - not used? | |
| 586 | JP1 - jumper set to 1-2 (lower position), labelled 'WR' | |
| 587 | DSW - 4 position dipswitch block, all off | |
| 588 | ||
| 589 | This board is used only on Time Crisis II. | |
| 590 | Note the gun is a standard light gun. | |
| 591 | -------------- | |
| 592 | ||
| 593 | Type 2: | |
| 594 | ||
| 595 | V221 MIU PCB | |
| 596 | 2512960101 (2512970101) | |
| 597 | additional sticker for Time Crisis 3 says '2591961001 V291 XMIU PCB' | |
| 598 | |---------------------------------------------| | |
| 599 | |J10 J9 29C020 LC35256 DSW(4) | | |
| 600 | | M0105 PRG.8F LED | | |
| 601 | |2267 6393 LED | | |
| 602 | | T082 T082 |------| | | |
| 603 | | |--------| | C78 | J8 | | |
| 604 | | |ALTERA | | | | | |
| 605 | |J11 |MAX | |------| J7| | |
| 606 | | LM1881 |EPM7128 | 3771 | | |
| 607 | |R305526 |--------| | | |
| 608 | | ZUW1R51212 14.746MHz | | |
| 609 | | ADM485 J6| | |
| 610 | | | | |
| 611 | | J1 J2 J3 J4 J5 | | |
| 612 | |---------------------------------------------| | |
| 613 | Notes: | |
| 614 | 2267 - JRC2267 Current limiting diode array? (SOIC8) | |
| 615 | R305526 - Some kind of mini transformer or regulator? | |
| 616 | LC35256 - Sanyo LC35256 32k x8 SRAM (SOP28) | |
| 617 | LM1881 - National Semiconductor LM1881 Video Sync Separator (SOIC8) | |
| 618 | M0105 - Matsushita Panasonic 0105 = ? (SOIC16) | |
| 619 | T082 - Texas Instruments T082 (=TL082) JFET-Input operational amplifier (SOIC8) | |
| 620 | 6393 - Sanyo 6393 (LA6393) High Performance Dual Comparator (SOIC8) | |
| 621 | ADM485 - Analog Devices ADM485 5V Low Power EIA RS-485 Transceiver (SOIC8) | |
| 622 | 3771 - Fujitsu MB3771 Power Supply Monitor and Master Reset IC (SOIC8) | |
| 623 | EPM7128 - Altera MAX EPM7128SLC84-15 PLD labelled 'TMIU1/PLD0' (Time Crisis 3) | |
| 624 | 29C020 - location for 29C020 PLCC32 Flash/EP ROM (not populated) | |
| 625 | ZUW1R51212 - Cosel ZUW1R51212 DC to DC Power Supply Module (input 9-18VDC, output +-12VDC or +24VDC) | |
| 626 | DSW - 4 position dipswitch block, all off | |
| 627 | J1 - 6-pin power input connector | |
| 628 | J2 - 12-pin connector (cabinet buttons UP/DOWN/ENTER plus TEST/SERVICE/COIN etc) | |
| 629 | J3 - 4 pin connector (not used) | |
| 630 | J4 - 9 pin Namco female plug connector for gun (solenoid +24V/trigger/pedal/sensor) | |
| 631 | J5 - 5 pin connector used for I/O --> S246 communications (connects to USB link connection on main unit) | |
| 632 | J6 - 7-pin connector (not used) | |
| 633 | J9 - 6-pin connector (not used) | |
| 634 | J10 - 2-pin Namco female plug connector (not used) | |
| 635 | J11 - 6-pin Namco female plug connector (video input from CCD camera) | |
| 636 | PRG.8F - 27C1001 EPROM with label... | |
| 637 | 'XMIU1 PRG0' (I/O program for Time Crisis 3) | |
| 638 | 'CSZ1 PRG0A' (I/O program for Crisis Zone) | |
| 639 | ||
| 640 | This board is used on Crisis Zone (System 23 Evolution2) and Time Crisis 3 (System 246) | |
| 641 | Note both games use a CCD camera for the gun sensor. | |
| 501 | 642 | */ |
| 502 | 643 | |
| 503 | 644 | /* |
| r7500 | r7501 | |
| 742 | 883 | #include "cpu/h83002/h8.h" |
| 743 | 884 | #include "sound/c352.h" |
| 744 | 885 | |
| 745 | static int ss23_vstat = 0, hstat = 0, vstate = 0; | |
| 886 | #define S23_BUSCLOCK (66664460/2) // 33 MHz CPU bus clock / input, somehow derived from 14.31721 MHz crystal | |
| 887 | #define S23_VSYNC1 (59.8824) | |
| 888 | #define S23_VSYNC2 (59.915) | |
| 889 | #define S23_HSYNC (16666150) | |
| 890 | #define S23_MODECLOCK (130205) | |
| 891 | ||
| 892 | //static int ss23_vstat = 0, hstat = 0, vstate = 0; | |
| 746 | 893 | static tilemap_t *bgtilemap; |
| 747 | 894 | static UINT32 *namcos23_textram, *namcos23_shared_ram; |
| 748 | 895 | static UINT32 *namcos23_charram; |
| 749 | 896 | static UINT8 namcos23_jvssense; |
| 897 | static INT32 has_jvsio; | |
| 750 | 898 | |
| 899 | static bool ctl_vbl_active; | |
| 900 | static UINT8 ctl_led; | |
| 901 | static UINT16 ctl_inp_buffer[2]; | |
| 902 | ||
| 903 | static UINT16 c417_ram[0x10000], c417_adr = 0; | |
| 904 | ||
| 905 | static UINT16 c412_sdram_a[0x100000]; | |
| 906 | static UINT16 c412_sdram_b[0x100000]; | |
| 907 | static UINT16 c412_sram[0x20000]; | |
| 908 | static UINT16 c412_pczram[0x200]; | |
| 909 | static UINT32 c412_adr = 0; | |
| 910 | ||
| 911 | static UINT16 c421_dram_a[0x40000]; | |
| 912 | static UINT16 c421_dram_b[0x40000]; | |
| 913 | static UINT16 c421_sram[0x8000]; | |
| 914 | static UINT32 c421_adr = 0; | |
| 915 | ||
| 916 | ||
| 751 | 917 | static UINT16 nthword( const UINT32 *pSource, int offs ) |
| 752 | 918 | { |
| 753 | 919 | pSource += offs/2; |
| r7500 | r7501 | |
| 774 | 940 | static WRITE32_HANDLER( namcos23_textram_w ) |
| 775 | 941 | { |
| 776 | 942 | COMBINE_DATA( &namcos23_textram[offset] ); |
| 943 | tilemap_mark_tile_dirty(bgtilemap, offset*2); | |
| 944 | tilemap_mark_tile_dirty(bgtilemap, (offset*2)+1); | |
| 777 | 945 | } |
| 778 | 946 | |
| 779 | 947 | static VIDEO_START( ss23 ) |
| r7500 | r7501 | |
| 880 | 1048 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 881 | 1049 | bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); |
| 882 | 1050 | |
| 883 | tilemap_mark_all_tiles_dirty(bgtilemap); | |
| 884 | tilemap_set_palette_offset( bgtilemap, 0x7f00 ); | |
| 885 | 1051 | tilemap_draw( bitmap, cliprect, bgtilemap, 0/*flags*/, 0/*priority*/ ); /* opaque */ |
| 886 | 1052 | |
| 887 | 1053 | #if 0 |
| r7500 | r7501 | |
| 934 | 1100 | return 0; |
| 935 | 1101 | } |
| 936 | 1102 | |
| 937 | static | |
| 1103 | static R | |
| 938 | 1104 | { |
| 939 | return | |
| 1105 | return namcos23_charram[offset]; | |
| 940 | 1106 | } |
| 941 | 1107 | |
| 942 | 1108 | static WRITE32_HANDLER( s23_txtchar_w ) |
| r7500 | r7501 | |
| 944 | 1110 | COMBINE_DATA(&namcos23_charram[offset]); |
| 945 | 1111 | gfx_element_mark_dirty(space->machine->gfx[0], offset/32); |
| 946 | 1112 | } |
| 947 | ||
| 1113 | #if 0 | |
| 948 | 1114 | static READ32_HANDLER( ss23_vstat_r ) |
| 949 | 1115 | { |
| 950 | 1116 | if (offset == 1) |
| r7500 | r7501 | |
| 961 | 1127 | } |
| 962 | 1128 | return ss23_vstat; |
| 963 | 1129 | } |
| 964 | ||
| 1130 | #endif | |
| 965 | 1131 | static UINT8 nthbyte( const UINT32 *pSource, int offs ) |
| 966 | 1132 | { |
| 967 | 1133 | pSource += offs/4; |
| r7500 | r7501 | |
| 996 | 1162 | UpdatePalette(space->machine, (offset % (0x10000/4))*2); |
| 997 | 1163 | } |
| 998 | 1164 | |
| 999 | // must return this magic number | |
| 1000 | static UINT32 s23_vbl = 0; | |
| 1165 | static READ16_HANDLER(s23_c417_16_r) | |
| 1166 | { | |
| 1167 | switch(offset) { | |
| 1168 | case 0: return 0x8e | (video_screen_get_vblank(space->machine->primary_screen) ? 0x8000 : 0); | |
| 1169 | case 1: return c417_adr; | |
| 1170 | case 4: | |
| 1171 | // logerror("c417_r %04x = %04x (%08x, %08x)\n", c417_adr, c417_ram[c417_adr], cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1172 | return c417_ram[c417_adr]; | |
| 1173 | } | |
| 1001 | 1174 | |
| 1002 | static INTERRUPT_GEN(s23_interrupt) | |
| 1175 | logerror("c417_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1176 | return 0; | |
| 1177 | } | |
| 1178 | ||
| 1179 | static WRITE16_HANDLER(s23_c417_16_w) | |
| 1003 | 1180 | { |
| 1004 | s23_vbl ^= 0x80008000; | |
| 1181 | switch(offset) { | |
| 1182 | case 1: | |
| 1183 | COMBINE_DATA(&c417_adr); | |
| 1184 | break; | |
| 1185 | ||
| 1186 | case 4: | |
| 1187 | // logerror("c417_w %04x = %04x (%08x, %08x)\n", c417_adr, data, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1188 | COMBINE_DATA(c417_ram + c417_adr); | |
| 1189 | break; | |
| 1190 | default: | |
| 1191 | logerror("c417_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1192 | break; | |
| 1193 | } | |
| 1005 | 1194 | } |
| 1006 | 1195 | |
| 1007 | static READ32_HANDLER(s23_ | |
| 1196 | static READ32_HANDLER(s23_c417_32_r) | |
| 1008 | 1197 | { |
| 1009 | return 0x008e008e | s23_vbl; | |
| 1198 | UINT32 data = 0; | |
| 1199 | if (ACCESSING_BITS_16_31) | |
| 1200 | data |= s23_c417_16_r(space, offset*2, mem_mask >> 16) << 16; | |
| 1201 | if (ACCESSING_BITS_0_15) | |
| 1202 | data |= s23_c417_16_r(space, offset*2+1, mem_mask); | |
| 1203 | return data; | |
| 1010 | 1204 | } |
| 1011 | 1205 | |
| 1012 | // this & 8 and this & 4 are checked | |
| 1013 | // offset = 1 for magic latch | |
| 1014 | static READ32_HANDLER(sysctl_stat_r) | |
| 1206 | static WRITE32_HANDLER(s23_c417_32_w) | |
| 1015 | 1207 | { |
| 1016 | if (offset == 1) return 0x0000ffff; // all inputs in | |
| 1208 | if (ACCESSING_BITS_16_31) | |
| 1209 | s23_c417_16_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 1210 | if (ACCESSING_BITS_0_15) | |
| 1211 | s23_c417_16_w(space, offset*2+1, data, mem_mask); | |
| 1212 | } | |
| 1017 | 1213 | |
| 1018 | return 0xffffffff; | |
| 1214 | static READ16_HANDLER(s23_c412_ram_r) | |
| 1215 | { | |
| 1216 | // logerror("c412_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1217 | if(offset < 0x100000) | |
| 1218 | return c412_sdram_a[offset & 0xfffff]; | |
| 1219 | else if(offset < 0x200000) | |
| 1220 | return c412_sdram_b[offset & 0xfffff]; | |
| 1221 | else if(offset < 0x220000) | |
| 1222 | return c412_sram [offset & 0x1ffff]; | |
| 1223 | else if(offset < 0x220200) | |
| 1224 | return c412_pczram [offset & 0x001ff]; | |
| 1225 | ||
| 1226 | return 0xffff; | |
| 1019 | 1227 | } |
| 1020 | 1228 | |
| 1229 | static WRITE16_HANDLER(s23_c412_ram_w) | |
| 1230 | { | |
| 1231 | // logerror("c412_ram_w %06x = %04x (%08x, %08x)\n", offset, data, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1232 | if(offset < 0x100000) | |
| 1233 | COMBINE_DATA(c412_sdram_a + (offset & 0xfffff)); | |
| 1234 | else if(offset < 0x200000) | |
| 1235 | COMBINE_DATA(c412_sdram_b + (offset & 0xfffff)); | |
| 1236 | else if(offset < 0x220000) | |
| 1237 | COMBINE_DATA(c412_sram + (offset & 0x1ffff)); | |
| 1238 | else if(offset < 0x220200) | |
| 1239 | COMBINE_DATA(c412_pczram + (offset & 0x001ff)); | |
| 1240 | } | |
| 1241 | ||
| 1242 | static READ16_HANDLER(s23_c412_16_r) | |
| 1243 | { | |
| 1244 | switch(offset) { | |
| 1245 | case 8: return c412_adr; | |
| 1246 | case 9: return c412_adr >> 16; | |
| 1247 | case 10: return s23_c412_ram_r(space, c412_adr, mem_mask); | |
| 1248 | } | |
| 1249 | ||
| 1250 | logerror("c412_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1251 | return 0; | |
| 1252 | } | |
| 1253 | ||
| 1254 | static WRITE16_HANDLER(s23_c412_16_w) | |
| 1255 | { | |
| 1256 | switch(offset) { | |
| 1257 | case 8: c412_adr = (data & mem_mask) | (c412_adr & (0xffffffff ^ mem_mask)); break; | |
| 1258 | case 9: c412_adr = ((data & mem_mask) << 16) | (c412_adr & (0xffffffff ^ (mem_mask << 16))); break; | |
| 1259 | case 10: s23_c412_ram_w(space, c412_adr, data, mem_mask); break; | |
| 1260 | default: | |
| 1261 | logerror("c412_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1262 | break; | |
| 1263 | } | |
| 1264 | } | |
| 1265 | ||
| 1266 | static READ32_HANDLER(s23_c412_32_r) | |
| 1267 | { | |
| 1268 | UINT32 data = 0; | |
| 1269 | if (ACCESSING_BITS_16_31) | |
| 1270 | data |= s23_c412_16_r(space, offset*2, mem_mask >> 16) << 16; | |
| 1271 | if (ACCESSING_BITS_0_15) | |
| 1272 | data |= s23_c412_16_r(space, offset*2+1, mem_mask); | |
| 1273 | return data; | |
| 1274 | } | |
| 1275 | ||
| 1276 | static WRITE32_HANDLER(s23_c412_32_w) | |
| 1277 | { | |
| 1278 | if (ACCESSING_BITS_16_31) | |
| 1279 | s23_c412_16_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 1280 | if (ACCESSING_BITS_0_15) | |
| 1281 | s23_c412_16_w(space, offset*2+1, data, mem_mask); | |
| 1282 | } | |
| 1283 | ||
| 1284 | ||
| 1285 | static READ16_HANDLER(s23_c421_ram_r) | |
| 1286 | { | |
| 1287 | // logerror("c421_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1288 | if(offset < 0x40000) | |
| 1289 | return c421_dram_a[offset & 0x3ffff]; | |
| 1290 | else if(offset < 0x80000) | |
| 1291 | return c421_dram_b[offset & 0x3ffff]; | |
| 1292 | else if(offset < 0x88000) | |
| 1293 | return c421_sram [offset & 0x07fff]; | |
| 1294 | ||
| 1295 | return 0xffff; | |
| 1296 | } | |
| 1297 | ||
| 1298 | static WRITE16_HANDLER(s23_c421_ram_w) | |
| 1299 | { | |
| 1300 | // logerror("c421_ram_w %06x = %04x (%08x, %08x)\n", offset, data, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1301 | if(offset < 0x40000) | |
| 1302 | COMBINE_DATA(c421_dram_a + (offset & 0x3ffff)); | |
| 1303 | else if(offset < 0x80000) | |
| 1304 | COMBINE_DATA(c421_dram_b + (offset & 0x3ffff)); | |
| 1305 | else if(offset < 0x88000) | |
| 1306 | COMBINE_DATA(c421_sram + (offset & 0x07fff)); | |
| 1307 | } | |
| 1308 | ||
| 1309 | static READ16_HANDLER(s23_c421_16_r) | |
| 1310 | { | |
| 1311 | switch(offset) { | |
| 1312 | case 0: return s23_c421_ram_r(space, c421_adr & 0xfffff, mem_mask); | |
| 1313 | case 2: return c421_adr >> 16; | |
| 1314 | case 3: return c421_adr; | |
| 1315 | } | |
| 1316 | ||
| 1317 | logerror("c421_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1318 | return 0; | |
| 1319 | } | |
| 1320 | ||
| 1321 | static WRITE16_HANDLER(s23_c421_16_w) | |
| 1322 | { | |
| 1323 | switch(offset) { | |
| 1324 | case 0: s23_c421_ram_w(space, c421_adr & 0xfffff, data, mem_mask); break; | |
| 1325 | case 2: c421_adr = ((data & mem_mask) << 16) | (c421_adr & (0xffffffff ^ (mem_mask << 16))); break; | |
| 1326 | case 3: c421_adr = (data & mem_mask) | (c421_adr & (0xffffffff ^ mem_mask)); break; | |
| 1327 | default: | |
| 1328 | logerror("c421_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1329 | break; | |
| 1330 | } | |
| 1331 | } | |
| 1332 | ||
| 1333 | static READ32_HANDLER(s23_c421_32_r) | |
| 1334 | { | |
| 1335 | UINT32 data = 0; | |
| 1336 | if (ACCESSING_BITS_16_31) | |
| 1337 | data |= s23_c421_16_r(space, offset*2, mem_mask >> 16) << 16; | |
| 1338 | if (ACCESSING_BITS_0_15) | |
| 1339 | data |= s23_c421_16_r(space, offset*2+1, mem_mask); | |
| 1340 | return data; | |
| 1341 | } | |
| 1342 | ||
| 1343 | static WRITE32_HANDLER(s23_c421_32_w) | |
| 1344 | { | |
| 1345 | if (ACCESSING_BITS_16_31) | |
| 1346 | s23_c421_16_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 1347 | if (ACCESSING_BITS_0_15) | |
| 1348 | s23_c421_16_w(space, offset*2+1, data, mem_mask); | |
| 1349 | } | |
| 1350 | ||
| 1351 | static WRITE16_HANDLER(s23_ctl_16_w) | |
| 1352 | { | |
| 1353 | switch(offset) { | |
| 1354 | case 0: { | |
| 1355 | if(ctl_led != (data & 0xff)) { | |
| 1356 | ctl_led = data; | |
| 1357 | logerror("LEDS %c%c%c%c%c%c%c%c\n", | |
| 1358 | ctl_led & 0x80 ? '.' : '#', | |
| 1359 | ctl_led & 0x40 ? '.' : '#', | |
| 1360 | ctl_led & 0x20 ? '.' : '#', | |
| 1361 | ctl_led & 0x10 ? '.' : '#', | |
| 1362 | ctl_led & 0x08 ? '.' : '#', | |
| 1363 | ctl_led & 0x04 ? '.' : '#', | |
| 1364 | ctl_led & 0x02 ? '.' : '#', | |
| 1365 | ctl_led & 0x01 ? '.' : '#'); | |
| 1366 | } | |
| 1367 | break; | |
| 1368 | } | |
| 1369 | ||
| 1370 | case 2: case 3: | |
| 1371 | // These may be coming from another CPU, in particular the I/O one | |
| 1372 | ctl_inp_buffer[offset-2] = input_port_read(space->machine, offset == 2 ? "P1" : "P2"); | |
| 1373 | break; | |
| 1374 | case 5: | |
| 1375 | if(ctl_vbl_active) { | |
| 1376 | ctl_vbl_active = false; | |
| 1377 | cpu_set_input_line(space->cpu, MIPS3_IRQ0, CLEAR_LINE); | |
| 1378 | } | |
| 1379 | break; | |
| 1380 | ||
| 1381 | default: | |
| 1382 | logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1383 | } | |
| 1384 | } | |
| 1385 | ||
| 1386 | static READ16_HANDLER(s23_ctl_16_r) | |
| 1387 | { | |
| 1388 | switch(offset) { | |
| 1389 | // dips ? | |
| 1390 | // 0100 set freezes gorgon | |
| 1391 | // 0080 is service mode for gorgon | |
| 1392 | // 0004 unset freezes ss23 at the boot level | |
| 1393 | // 0002 unset skips the post on ss23 | |
| 1394 | case 1: return 0x0004; | |
| 1395 | case 2: case 3: { | |
| 1396 | UINT16 res = ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000; | |
| 1397 | ctl_inp_buffer[offset-2] = (ctl_inp_buffer[offset-2] << 1) | 1; | |
| 1398 | return res; | |
| 1399 | } | |
| 1400 | } | |
| 1401 | logerror("ctl_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1402 | return 0xffff; | |
| 1403 | } | |
| 1404 | ||
| 1405 | static WRITE32_HANDLER(s23_ctl_32_w) | |
| 1406 | { | |
| 1407 | if (ACCESSING_BITS_16_31) | |
| 1408 | s23_ctl_16_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 1409 | if (ACCESSING_BITS_0_15) | |
| 1410 | s23_ctl_16_w(space, offset*2+1, data, mem_mask); | |
| 1411 | } | |
| 1412 | ||
| 1413 | static READ32_HANDLER(s23_ctl_32_r) | |
| 1414 | { | |
| 1415 | UINT32 data = 0; | |
| 1416 | if (ACCESSING_BITS_16_31) | |
| 1417 | data |= s23_ctl_16_r(space, offset*2, mem_mask >> 16) << 16; | |
| 1418 | if (ACCESSING_BITS_0_15) | |
| 1419 | data |= s23_ctl_16_r(space, offset*2+1, mem_mask); | |
| 1420 | return data; | |
| 1421 | } | |
| 1422 | ||
| 1423 | ||
| 1424 | static WRITE16_HANDLER(s23_c361_16_w) | |
| 1425 | { | |
| 1426 | switch(offset) { | |
| 1427 | default: | |
| 1428 | logerror("c361_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1429 | } | |
| 1430 | } | |
| 1431 | ||
| 1432 | static READ16_HANDLER(s23_c361_16_r) | |
| 1433 | { | |
| 1434 | switch(offset) { | |
| 1435 | case 5: return video_screen_get_vpos(space->machine->primary_screen); | |
| 1436 | case 6: return video_screen_get_vblank(space->machine->primary_screen); | |
| 1437 | } | |
| 1438 | logerror("c361_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); | |
| 1439 | return 0xffff; | |
| 1440 | } | |
| 1441 | ||
| 1442 | static WRITE32_HANDLER(s23_c361_32_w) | |
| 1443 | { | |
| 1444 | if (ACCESSING_BITS_16_31) | |
| 1445 | s23_c361_16_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 1446 | if (ACCESSING_BITS_0_15) | |
| 1447 | s23_c361_16_w(space, offset*2+1, data, mem_mask); | |
| 1448 | } | |
| 1449 | ||
| 1450 | static READ32_HANDLER(s23_c361_32_r) | |
| 1451 | { | |
| 1452 | UINT32 data = 0; | |
| 1453 | if (ACCESSING_BITS_16_31) | |
| 1454 | data |= s23_c361_16_r(space, offset*2, mem_mask >> 16) << 16; | |
| 1455 | if (ACCESSING_BITS_0_15) | |
| 1456 | data |= s23_c361_16_r(space, offset*2+1, mem_mask); | |
| 1457 | return data; | |
| 1458 | } | |
| 1459 | ||
| 1460 | static INTERRUPT_GEN(s23_interrupt) | |
| 1461 | { | |
| 1462 | if(!ctl_vbl_active) { | |
| 1463 | ctl_vbl_active = true; | |
| 1464 | cpu_set_input_line(device, MIPS3_IRQ0, ASSERT_LINE); | |
| 1465 | } | |
| 1466 | } | |
| 1467 | ||
| 1468 | ||
| 1021 | 1469 | // as with System 22, we need to halt the MCU while checking shared RAM |
| 1022 | 1470 | static WRITE32_HANDLER( s23_mcuen_w ) |
| 1023 | 1471 | { |
| 1024 | | |
| 1472 | loge | |
| 1025 | 1473 | if (mem_mask == 0x0000ffff) |
| 1026 | 1474 | { |
| 1027 | 1475 | if (data) |
| r7500 | r7501 | |
| 1037 | 1485 | } |
| 1038 | 1486 | } |
| 1039 | 1487 | |
| 1040 | static UINT32 gorgon_vbl = 0; | |
| 1041 | static READ32_HANDLER( gorgon_vbl_r ) | |
| 1488 | static READ32_HANDLER( gorgon_magic_r ) | |
| 1042 | 1489 | { |
| 1043 | gorgon_vbl ^= 0xffffffff; | |
| 1490 | return 0xffffffff; // must be non-zero (rapidrvr @ 8000229C) | |
| 1491 | } | |
| 1044 | 1492 | |
| 1045 | return gorgon_vbl; | |
| 1493 | /* | |
| 1494 | Final Furlong has a bug: it forgets to halt the H8/3002 before it zeros out the shared RAM | |
| 1495 | which contains the H8's stack and other working set. This crashes MAME due to the PC going | |
| 1496 | off into the weeds, so we intercept | |
| 1497 | */ | |
| 1498 | ||
| 1499 | static READ32_HANDLER( gorgon_sharedram_r ) | |
| 1500 | { | |
| 1501 | return namcos23_shared_ram[offset]; | |
| 1046 | 1502 | } |
| 1047 | 1503 | |
| 1504 | static WRITE32_HANDLER( gorgon_sharedram_w ) | |
| 1505 | { | |
| 1506 | COMBINE_DATA(&namcos23_shared_ram[offset]); | |
| 1507 | ||
| 1508 | // hack for final furlong | |
| 1509 | if ((offset == 0x6000/4) && (data == 0) && (mem_mask == 0xff000000)) | |
| 1510 | { | |
| 1511 | logerror("S23: Final Furlong hack stopping H8/3002\n"); | |
| 1512 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1513 | } | |
| 1514 | } | |
| 1515 | ||
| 1048 | 1516 | static ADDRESS_MAP_START( gorgon_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 1049 | 1517 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM |
| 1050 | AM_RANGE(0x02000000, 0x02000003) AM_READ( gorgon_vbl_r ) | |
| 1051 | AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_BASE(&namcos23_shared_ram) | |
| 1518 | AM_RANGE(0x01000000, 0x010000ff) AM_READ( gorgon_magic_r ) | |
| 1519 | AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE( s23_c417_32_r, s23_c417_32_w ) | |
| 1520 | AM_RANGE(0x04400000, 0x0440ffff) AM_READWRITE( gorgon_sharedram_r, gorgon_sharedram_w ) AM_BASE(&namcos23_shared_ram) | |
| 1521 | ||
| 1522 | AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE( s23_mcuen_w ) | |
| 1052 | 1523 | AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM // 3d FIFO |
| 1053 | AM_RANGE(0x0d000000, 0x0d000007) AM_READ(sysctl_stat_r) | |
| 1524 | ||
| 1525 | AM_RANGE(0x06080000, 0x06081fff) AM_RAM | |
| 1526 | ||
| 1527 | AM_RANGE(0x06108000, 0x061087ff) AM_RAM // GAMMA (C404-3S) | |
| 1528 | AM_RANGE(0x06110000, 0x0613ffff) AM_READWRITE(namcos23_paletteram_r, namcos23_paletteram_w) AM_BASE_GENERIC(paletteram) | |
| 1529 | AM_RANGE(0x06400000, 0x06403fff) AM_READWRITE( s23_txtchar_r, s23_txtchar_w ) AM_BASE(&namcos23_charram) // text layer characters | |
| 1530 | AM_RANGE(0x06404000, 0x0641dfff) AM_RAM | |
| 1531 | AM_RANGE(0x0641e000, 0x0641ffff) AM_READWRITE(namcos23_textram_r, namcos23_textram_w) AM_BASE(&namcos23_textram) | |
| 1532 | ||
| 1533 | AM_RANGE(0x08000000, 0x087fffff) AM_ROM AM_REGION("data", 0) // data ROMs | |
| 1534 | ||
| 1535 | AM_RANGE(0x0c000000, 0x0c00ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // BACKUP | |
| 1536 | ||
| 1537 | AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE (s23_ctl_32_r, s23_ctl_32_w ) // write for LEDs at d000000, watchdog at d000004 | |
| 1538 | ||
| 1539 | AM_RANGE(0x0f200000, 0x0f201fff) AM_RAM | |
| 1540 | ||
| 1054 | 1541 | AM_RANGE(0x0fc00000, 0x0fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0) |
| 1055 | 1542 | AM_RANGE(0x1fc00000, 0x1fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0) |
| 1056 | 1543 | ADDRESS_MAP_END |
| 1057 | 1544 | |
| 1058 | 1545 | static ADDRESS_MAP_START( ss23_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 1059 | 1546 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM |
| 1060 | AM_RANGE(0x02000000, 0x02000003) AM_READ( s23_unk_r ) | |
| 1547 | AM_RANGE(0x01000000, 0x010000ff) AM_READ( gorgon_magic_r ) | |
| 1548 | AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE( s23_c417_32_r, s23_c417_32_w ) | |
| 1061 | 1549 | AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_BASE(&namcos23_shared_ram) |
| 1062 | 1550 | AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE( s23_mcuen_w ) |
| 1063 | 1551 | AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM // 3d FIFO |
| 1064 | AM_RANGE(0x06800000, 0x06800fff) AM_RAM // text layer palette | |
| 1065 | AM_RANGE(0x06800000, 0x06803fff) AM_WRITE( s23_txtchar_w ) AM_BASE(&namcos23_charram) // text layer characters | |
| 1552 | AM_RANGE(0x06000000, 0x0600ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // Backup | |
| 1553 | AM_RANGE(0x06200000, 0x06203fff) AM_RAM // C422 | |
| 1554 | AM_RANGE(0x06800000, 0x06807fff) AM_READWRITE( s23_txtchar_r, s23_txtchar_w ) AM_BASE(&namcos23_charram) // text layer characters (shown as CGRAM in POST) | |
| 1066 | 1555 | AM_RANGE(0x06804000, 0x0681dfff) AM_RAM |
| 1067 | AM_RANGE(0x0681e000, 0x0681ffff) AM_READ(namcos23_textram_r) AM_WRITE(namcos23_textram_w) AM_BASE(&namcos23_textram) | |
| 1068 | AM_RANGE(0x06a08000, 0x06a0ffff) AM_RAM //gamma? | |
| 1069 | AM_RANGE(0x06a10000, 0x06a3ffff) AM_READ(namcos23_paletteram_r) AM_WRITE(namcos23_paletteram_w) AM_BASE_GENERIC(paletteram) | |
| 1070 | AM_RANGE(0x06820008, 0x0682000f) AM_READ( ss23_vstat_r ) // vblank status? | |
| 1071 | AM_RANGE(0x08000000, 0x08017fff) AM_RAM | |
| 1072 | AM_RANGE(0x0d000000, 0x0d000007) AM_READ(sysctl_stat_r) AM_WRITENOP | |
| 1556 | AM_RANGE(0x0681e000, 0x0681ffff) AM_READWRITE(namcos23_textram_r, namcos23_textram_w) AM_BASE(&namcos23_textram) | |
| 1557 | AM_RANGE(0x06820000, 0x0682000f) AM_READWRITE( s23_c361_32_r, s23_c361_32_w ) // C361 | |
| 1558 | AM_RANGE(0x06a08000, 0x06a0ffff) AM_RAM // GAMMA (C404) | |
| 1559 | AM_RANGE(0x06a10000, 0x06a3ffff) AM_READWRITE(namcos23_paletteram_r, namcos23_paletteram_w) AM_BASE_GENERIC(paletteram) | |
| 1560 | AM_RANGE(0x08000000, 0x08ffffff) AM_ROM AM_REGION("data", 0x0000000) AM_MIRROR(0x01000000) // data ROMs | |
| 1561 | AM_RANGE(0x0a000000, 0x0affffff) AM_ROM AM_REGION("data", 0x1000000) AM_MIRROR(0x01000000) | |
| 1562 | AM_RANGE(0x0c000000, 0x0c00001f) AM_READWRITE( s23_c412_32_r, s23_c412_32_w ) | |
| 1563 | AM_RANGE(0x0c400000, 0x0c400007) AM_READWRITE( s23_c421_32_r, s23_c421_32_w ) | |
| 1564 | AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE( s23_ctl_32_r, s23_ctl_32_w ) | |
| 1073 | 1565 | AM_RANGE(0x0fc00000, 0x0fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0) |
| 1074 | 1566 | AM_RANGE(0x1fc00000, 0x1fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0) |
| 1075 | 1567 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 1078 | 1570 | { |
| 1079 | 1571 | UINT16 *shared16 = (UINT16 *)namcos23_shared_ram; |
| 1080 | 1572 | |
| 1081 | // fake that an I/O board is connected | |
| 1082 | if ((offset == 0x4052/2) && (data == 0x78)) | |
| 1573 | // fake that an I/O board is connected for games w/o a dump or that aren't properly communicating with it yet | |
| 1574 | if (!has_jvsio) | |
| 1083 | 1575 | { |
| 1084 | data = 0; | |
| 1576 | if ((offset == 0x4052/2) && (data == 0x78)) | |
| 1577 | { | |
| 1578 | data = 0; | |
| 1579 | } | |
| 1085 | 1580 | } |
| 1086 | 1581 | |
| 1087 | 1582 | COMBINE_DATA(&shared16[BYTE_XOR_BE(offset)]); |
| r7500 | r7501 | |
| 1099 | 1594 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1100 | 1595 | AM_RANGE(0x080000, 0x08ffff) AM_READWRITE( sharedram_sub_r, sharedram_sub_w ) |
| 1101 | 1596 | AM_RANGE(0x280000, 0x287fff) AM_DEVREADWRITE( "c352", c352_r, c352_w ) |
| 1102 | AM_RANGE(0x300000, 0x300001) AM_READNOP //AM_READ_PORT("IN1") | |
| 1103 | AM_RANGE(0x300002, 0x300003) AM_READNOP //AM_READ_PORT("IN2") | |
| 1597 | AM_RANGE(0x300000, 0x300003) AM_NOP // seems to be more inputs, maybe false leftover code from System 12? | |
| 1104 | 1598 | AM_RANGE(0x300010, 0x300011) AM_NOP |
| 1105 | 1599 | AM_RANGE(0x300030, 0x300031) AM_WRITENOP // timecrs2 writes this when writing to the sync shared ram location, motoxgo doesn't |
| 1106 | 1600 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 1222 | 1716 | s23_setstate ^= 1; |
| 1223 | 1717 | } |
| 1224 | 1718 | |
| 1225 | static UINT8 maintoio[64], mi_rd, mi_wr; | |
| 1226 | static UINT8 iotomain[64], im_rd, im_wr; | |
| 1719 | static UINT8 maintoio[128], mi_rd, mi_wr; | |
| 1720 | static UINT8 iotomain[128], im_rd, im_wr; | |
| 1227 | 1721 | |
| 1228 | 1722 | static READ8_HANDLER( s23_mcu_iob_r ) |
| 1229 | 1723 | { |
| 1230 | 1724 | UINT8 ret = iotomain[im_rd]; |
| 1231 | 1725 | |
| 1232 | 1726 | im_rd++; |
| 1233 | im_rd &= 0x | |
| 1727 | im_rd &= 0x7f; | |
| 1234 | 1728 | |
| 1235 | 1729 | if (im_rd == im_wr) |
| 1236 | 1730 | { |
| r7500 | r7501 | |
| 1248 | 1742 | static WRITE8_HANDLER( s23_mcu_iob_w ) |
| 1249 | 1743 | { |
| 1250 | 1744 | maintoio[mi_wr++] = data; |
| 1251 | mi_wr &= 0x | |
| 1745 | mi_wr &= 0x7f; | |
| 1252 | 1746 | |
| 1253 | 1747 | cputag_set_input_line(space->machine, "ioboard", H8_SCI_0_RX, ASSERT_LINE); |
| 1254 | 1748 | } |
| 1255 | 1749 | |
| 1256 | 1750 | static INPUT_PORTS_START( ss23 ) |
| 1257 | 1751 | PORT_START("H8PORT") |
| 1752 | ||
| 1753 | // No idea if start is actually there, but we need buttons to pass error screens | |
| 1754 | PORT_START("P1") | |
| 1755 | PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1756 | PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1757 | ||
| 1758 | PORT_START("P2") | |
| 1759 | PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1760 | PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1761 | ||
| 1762 | PORT_START("TC2P0") | |
| 1763 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1764 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1765 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // this is the "coin acceptor connected" signal | |
| 1766 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1767 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1768 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 1769 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 1770 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 1771 | ||
| 1772 | PORT_START("TC2P1") | |
| 1773 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // gun trigger | |
| 1774 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // foot pedal | |
| 1775 | PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1258 | 1776 | INPUT_PORTS_END |
| 1259 | 1777 | |
| 1260 | 1778 | |
| r7500 | r7501 | |
| 1273 | 1791 | AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE( s23_mcu_p6_r, s23_mcu_p6_w ) |
| 1274 | 1792 | AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT( "H8PORT" ) |
| 1275 | 1793 | AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ( s23_mcu_p8_r ) AM_WRITENOP |
| 1794 | AM_RANGE(H8_PORT_9, H8_PORT_9) AM_NOP // read on Gorgon, purpose unknown | |
| 1276 | 1795 | AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE( s23_mcu_pa_r, s23_mcu_pa_w ) |
| 1277 | 1796 | AM_RANGE(H8_PORT_B, H8_PORT_B) AM_READWRITE( s23_mcu_portB_r, s23_mcu_portB_w ) |
| 1278 | 1797 | AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE( s23_mcu_iob_r, s23_mcu_iob_w ) |
| r7500 | r7501 | |
| 1302 | 1821 | UINT8 ret = maintoio[mi_rd]; |
| 1303 | 1822 | |
| 1304 | 1823 | mi_rd++; |
| 1305 | mi_rd &= 0x | |
| 1824 | mi_rd &= 0x7f; | |
| 1306 | 1825 | |
| 1307 | 1826 | if (mi_rd == mi_wr) |
| 1308 | 1827 | { |
| r7500 | r7501 | |
| 1315 | 1834 | static WRITE8_HANDLER( s23_iob_mcu_w ) |
| 1316 | 1835 | { |
| 1317 | 1836 | iotomain[im_wr++] = data; |
| 1318 | im_wr &= 0x | |
| 1837 | im_wr &= 0x7f; | |
| 1319 | 1838 | |
| 1320 | 1839 | cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, ASSERT_LINE); |
| 1321 | 1840 | } |
| r7500 | r7501 | |
| 1334 | 1853 | namcos23_jvssense = (data & 0x04) ? 0 : 1; |
| 1335 | 1854 | } |
| 1336 | 1855 | |
| 1856 | static READ8_HANDLER(iob_r) | |
| 1857 | { | |
| 1858 | return mame_rand(space->machine); | |
| 1859 | } | |
| 1860 | ||
| 1337 | 1861 | /* H8/3334 (Namco C78) I/O board MCU */ |
| 1338 | 1862 | static ADDRESS_MAP_START( s23iobrdmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1339 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 1340 | AM_RANGE(0xc000, 0xdfff) AM_RAM | |
| 1863 | AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("ioboard", 0) | |
| 1864 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("TC2P0") // 0-1 = coin 0-3 = coin connect, 0-5 = test 0-6 = down select, 0-7 = up select, 0-8 = enter | |
| 1865 | AM_RANGE(0x6001, 0x6001) AM_READ_PORT("TC2P1") // 1-1 = gun trigger 1-2 = foot pedal | |
| 1866 | AM_RANGE(0x6002, 0x6003) AM_READ( iob_r ) | |
| 1867 | AM_RANGE(0x7000, 0x700f) AM_READ( iob_r ) | |
| 1868 | ||
| 1869 | AM_RANGE(0xc000, 0xf7ff) AM_RAM | |
| 1341 | 1870 | ADDRESS_MAP_END |
| 1342 | 1871 | |
| 1343 | 1872 | /* |
| r7500 | r7501 | |
| 1346 | 1875 | */ |
| 1347 | 1876 | static ADDRESS_MAP_START( s23iobrdiomap, ADDRESS_SPACE_IO, 8 ) |
| 1348 | 1877 | AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READWRITE( s23_iob_p4_r, s23_iob_p4_w ) |
| 1878 | AM_RANGE(H8_PORT_5, H8_PORT_5) AM_NOP // status LED in bit 2 | |
| 1879 | AM_RANGE(H8_PORT_6, H8_PORT_6) AM_NOP // unknown | |
| 1349 | 1880 | AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE( s23_iob_mcu_r, s23_iob_mcu_w ) |
| 1350 | 1881 | ADDRESS_MAP_END |
| 1351 | 1882 | |
| r7500 | r7501 | |
| 1353 | 1884 | { |
| 1354 | 1885 | mi_rd = mi_wr = im_rd = im_wr = 0; |
| 1355 | 1886 | namcos23_jvssense = 1; |
| 1356 | | |
| 1887 | ctl_vbl_active = false; | |
| 1357 | 1888 | s23_lastpB = 0x50; |
| 1358 | 1889 | s23_setstate = 0; |
| 1359 | 1890 | s23_setnum = 0; |
| 1360 | 1891 | memset(s23_settings, 0, sizeof(s23_settings)); |
| 1361 | 1892 | s23_tssio_port_4 = 0; |
| 1362 | 1893 | s23_porta = 0, s23_rtcstate = 0; |
| 1363 | gorgon_vbl = 0; | |
| 1894 | ||
| 1895 | if ((!strcmp(machine->gamedrv->name, "motoxgo")) || | |
| 1896 | (!strcmp(machine->gamedrv->name, "panicprk")) || | |
| 1897 | (!strcmp(machine->gamedrv->name, "rapidrvr")) || | |
| 1898 | (!strcmp(machine->gamedrv->name, "finlflng")) || | |
| 1899 | (!strcmp(machine->gamedrv->name, "timecrs2"))) | |
| 1900 | { | |
| 1901 | has_jvsio = 1; | |
| 1902 | } | |
| 1903 | else | |
| 1904 | { | |
| 1905 | has_jvsio = 0; | |
| 1906 | } | |
| 1364 | 1907 | } |
| 1365 | 1908 | |
| 1366 | 1909 | #define XOR(a) WORD2_XOR_BE(a) |
| r7500 | r7501 | |
| 1399 | 1942 | #endif |
| 1400 | 1943 | |
| 1401 | 1944 | static GFXDECODE_START( namcos23 ) |
| 1402 | GFXDECODE_ENTRY( NULL, 0, namcos23_cg_layout, | |
| 1945 | GFXDECODE_ENTRY( NULL, 0, namcos23_cg_layout, 0x7f00, 0x80 ) | |
| 1403 | 1946 | GFXDECODE_END |
| 1404 | 1947 | |
| 1405 | 1948 | static const mips3_config config = |
| r7500 | r7501 | |
| 1408 | 1951 | 8192 /* data cache size - VERIFIED */ |
| 1409 | 1952 | }; |
| 1410 | 1953 | |
| 1411 | static INTERRUPT_GEN( namcos23_interrupt ) | |
| 1412 | { | |
| 1413 | } | |
| 1414 | ||
| 1415 | 1954 | static MACHINE_DRIVER_START( gorgon ) |
| 1416 | 1955 | |
| 1417 | 1956 | /* basic machine hardware */ |
| 1418 | MDRV_CPU_ADD("maincpu", R4650BE, | |
| 1957 | MDRV_CPU_ADD("maincpu", R4650BE, S23_BUSCLOCK*4) | |
| 1419 | 1958 | MDRV_CPU_CONFIG(config) |
| 1420 | 1959 | MDRV_CPU_PROGRAM_MAP(gorgon_map) |
| 1960 | MDRV_CPU_VBLANK_INT("screen", s23_interrupt) | |
| 1421 | 1961 | |
| 1422 | 1962 | MDRV_CPU_ADD("audiocpu", H83002, 14745600 ) |
| 1423 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap) | |
| 1424 | MDRV_CPU_IO_MAP( s23h8ionoiobmap) | |
| 1963 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap ) | |
| 1964 | MDRV_CPU_IO_MAP( s23h8iomap ) | |
| 1425 | 1965 | MDRV_CPU_VBLANK_INT("screen", irq1_line_pulse) |
| 1426 | 1966 | |
| 1967 | MDRV_CPU_ADD("ioboard", H83334, 14745600 ) | |
| 1968 | MDRV_CPU_PROGRAM_MAP( s23iobrdmap ) | |
| 1969 | MDRV_CPU_IO_MAP( s23iobrdiomap ) | |
| 1970 | ||
| 1427 | 1971 | MDRV_QUANTUM_TIME(HZ(60000)) |
| 1428 | 1972 | |
| 1429 | 1973 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1430 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1431 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1974 | MDRV_SCREEN_REFRESH_RATE(S23_VSYNC1) | |
| 1975 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not in any way accurate | |
| 1432 | 1976 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1433 | MDRV_SCREEN_SIZE(64*16, 30*16) | |
| 1434 | MDRV_SCREEN_VISIBLE_AREA(0, 64*16-1, 0, 30*16-1) | |
| 1977 | MDRV_SCREEN_SIZE(640, 480) | |
| 1978 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479) | |
| 1435 | 1979 | |
| 1436 | 1980 | MDRV_PALETTE_LENGTH(0x8000) |
| 1437 | 1981 | |
| 1982 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 1983 | ||
| 1438 | 1984 | MDRV_GFXDECODE(namcos23) |
| 1439 | 1985 | |
| 1440 | 1986 | MDRV_VIDEO_START(ss23) |
| 1441 | MDRV_VIDEO_UPDATE( | |
| 1987 | MDRV_VIDEO_UPDATE(ss23 | |
| 1442 | 1988 | |
| 1443 | 1989 | /* sound hardware */ |
| 1444 | 1990 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r7500 | r7501 | |
| 1453 | 1999 | static MACHINE_DRIVER_START( s23 ) |
| 1454 | 2000 | |
| 1455 | 2001 | /* basic machine hardware */ |
| 1456 | MDRV_CPU_ADD("maincpu", R4650BE, | |
| 2002 | MDRV_CPU_ADD("maincpu", R4650BE, S23_BUSCLOCK*4) | |
| 1457 | 2003 | MDRV_CPU_CONFIG(config) |
| 1458 | 2004 | MDRV_CPU_PROGRAM_MAP(ss23_map) |
| 1459 | 2005 | MDRV_CPU_VBLANK_INT("screen", s23_interrupt) |
| 1460 | 2006 | |
| 1461 | 2007 | MDRV_CPU_ADD("audiocpu", H83002, 14745600 ) |
| 1462 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap) | |
| 1463 | MDRV_CPU_IO_MAP( s23h8iomap) | |
| 2008 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap ) | |
| 2009 | MDRV_CPU_IO_MAP( s23h8iomap ) | |
| 1464 | 2010 | MDRV_CPU_VBLANK_INT("screen", irq1_line_pulse) |
| 1465 | 2011 | |
| 1466 | 2012 | MDRV_CPU_ADD("ioboard", H83334, 14745600 ) |
| 1467 | MDRV_CPU_PROGRAM_MAP( s23iobrdmap) | |
| 1468 | MDRV_CPU_IO_MAP( s23iobrdiomap) | |
| 2013 | MDRV_CPU_PROGRAM_MAP( s23iobrdmap ) | |
| 2014 | MDRV_CPU_IO_MAP( s23iobrdiomap ) | |
| 1469 | 2015 | |
| 1470 | 2016 | MDRV_QUANTUM_TIME(HZ(60*18000)) // higher than 60*20000 causes timecrs2 crash after power-on test $1e |
| 1471 | 2017 | |
| 1472 | 2018 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1473 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1474 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 2019 | MDRV_SCREEN_REFRESH_RATE(S23_VSYNC1) | |
| 2020 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not in any way accurate | |
| 1475 | 2021 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1476 | MDRV_SCREEN_SIZE(64*16, 30*16) | |
| 1477 | MDRV_SCREEN_VISIBLE_AREA(0, 64*16-1, 0, 30*16-1) | |
| 2022 | MDRV_SCREEN_SIZE(640, 480) | |
| 2023 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479) | |
| 1478 | 2024 | |
| 1479 | 2025 | MDRV_PALETTE_LENGTH(0x8000) |
| 1480 | 2026 | |
| 1481 | 2027 | MDRV_GFXDECODE(namcos23) |
| 1482 | 2028 | |
| 2029 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 2030 | ||
| 1483 | 2031 | MDRV_VIDEO_START(ss23) |
| 1484 | 2032 | MDRV_VIDEO_UPDATE(ss23) |
| 1485 | 2033 | |
| r7500 | r7501 | |
| 1496 | 2044 | static MACHINE_DRIVER_START( ss23 ) |
| 1497 | 2045 | |
| 1498 | 2046 | /* basic machine hardware */ |
| 1499 | MDRV_CPU_ADD("maincpu", R4650BE, | |
| 2047 | MDRV_CPU_ADD("maincpu", R4650BE, S23_BUSCLOCK*5) | |
| 1500 | 2048 | MDRV_CPU_CONFIG(config) |
| 1501 | 2049 | MDRV_CPU_PROGRAM_MAP(ss23_map) |
| 1502 | MDRV_CPU_VBLANK_INT("screen", | |
| 2050 | MDRV_CPU_VBLANK_INT("screen", | |
| 1503 | 2051 | |
| 1504 | 2052 | MDRV_CPU_ADD("audiocpu", H83002, 14745600 ) |
| 1505 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap) | |
| 1506 | MDRV_CPU_IO_MAP( s23h8ionoiobmap) | |
| 2053 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap ) | |
| 2054 | MDRV_CPU_IO_MAP( s23h8ionoiobmap ) | |
| 1507 | 2055 | MDRV_CPU_VBLANK_INT("screen", irq1_line_pulse) |
| 1508 | 2056 | |
| 1509 | 2057 | MDRV_QUANTUM_TIME(HZ(60*40000)) |
| 1510 | 2058 | |
| 1511 | 2059 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1512 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1513 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 2060 | MDRV_SCREEN_REFRESH_RATE(S23_VSYNC1) | |
| 2061 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not in any way accurate | |
| 1514 | 2062 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1515 | MDRV_SCREEN_SIZE(48*16, 30*16) | |
| 1516 | MDRV_SCREEN_VISIBLE_AREA(0, 48*16-1, 0, 30*16-1) | |
| 2063 | MDRV_SCREEN_SIZE(640, 480) | |
| 2064 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479) | |
| 1517 | 2065 | |
| 1518 | 2066 | MDRV_PALETTE_LENGTH(0x8000) |
| 1519 | 2067 | |
| 1520 | 2068 | MDRV_GFXDECODE(namcos23) |
| 1521 | 2069 | |
| 2070 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 2071 | ||
| 1522 | 2072 | MDRV_VIDEO_START(ss23) |
| 1523 | 2073 | MDRV_VIDEO_UPDATE(ss23) |
| 1524 | 2074 | |
| r7500 | r7501 | |
| 1540 | 2090 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ |
| 1541 | 2091 | ROM_LOAD16_WORD_SWAP( "rd3verc.ic3", 0x000000, 0x080000, CRC(6e26fbaf) SHA1(4ab6637d22f0d26f7e1d10e9c80059c56f64303d) ) |
| 1542 | 2092 | |
| 1543 | ROM_REGION( 0x800000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1544 | ROM_LOAD16_BYTE( "rd1mtal.1j", 0x000000, 0x400000, CRC(8f0efa86) SHA1(9953461c258f2a96be275a7b18d6518ddfac3860) ) | |
| 1545 | ROM_LOAD16_BYTE( "rd1mtah.3j", 0x000001, 0x400000, CRC(d8fa0f3d) SHA1(0d5bdb3a2e7be1dffe11b74baa2c10bfe011ae92) ) | |
| 2093 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ | |
| 2094 | ROM_LOAD( "asca1_io-a.ic2", 0x000000, 0x040000, CRC(77cdf69a) SHA1(497af1059f85c07bea2dd0d303481623f6019dcf) ) | |
| 1546 | 2095 | |
| 2096 | ROM_REGION32_BE( 0x800000, "data", 0 ) /* data */ | |
| 2097 | ROM_LOAD16_BYTE( "rd1mtah.3j", 0x000000, 0x400000, CRC(d8fa0f3d) SHA1(0d5bdb3a2e7be1dffe11b74baa2c10bfe011ae92) ) | |
| 2098 | ROM_LOAD16_BYTE( "rd1mtal.1j", 0x000001, 0x400000, CRC(8f0efa86) SHA1(9953461c258f2a96be275a7b18d6518ddfac3860) ) | |
| 2099 | ||
| 1547 | 2100 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1548 | 2101 | ROM_LOAD( "rd1cguu.5b", 0x0000000, 0x800000, CRC(611bab41) SHA1(84cddb2b63bf8336e92aecb06eddf1b34af73540) ) |
| 1549 | 2102 | ROM_LOAD( "rd1cgum.6b", 0x0800000, 0x800000, CRC(c50de2ef) SHA1(24758a72b3569ce6a643a5786fce7c34b8aa692d) ) |
| r7500 | r7501 | |
| 1599 | 2152 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ |
| 1600 | 2153 | ROM_LOAD16_WORD_SWAP( "ff2vera.ic3", 0x000000, 0x080000, CRC(ab681078) SHA1(ec8367404458a54893ab6bea29c8a2ba3272b816) ) |
| 1601 | 2154 | |
| 1602 | ROM_REGION( 0x800000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1603 | ROM_LOAD16_BYTE( "ff2mtal.1j", 0x000000, 0x400000, CRC(ed1a5bf2) SHA1(bd05388a125a0201a41af95fb2aa5fe1c8b0f270) ) | |
| 1604 | ROM_LOAD16_BYTE( "ff2mtah.3j", 0x000001, 0x400000, CRC(161003cd) SHA1(04409333a4776b17700fc6d1aa06a39560132e03) ) | |
| 2155 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ | |
| 2156 | ROM_LOAD( "asca1_io-a.ic2", 0x000000, 0x040000, CRC(77cdf69a) SHA1(497af1059f85c07bea2dd0d303481623f6019dcf) ) | |
| 1605 | 2157 | |
| 2158 | ROM_REGION32_BE( 0x800000, "data", 0 ) /* data */ | |
| 2159 | ROM_LOAD16_BYTE( "ff2mtah.3j", 0x000000, 0x400000, CRC(161003cd) SHA1(04409333a4776b17700fc6d1aa06a39560132e03) ) | |
| 2160 | ROM_LOAD16_BYTE( "ff2mtal.1j", 0x000001, 0x400000, CRC(ed1a5bf2) SHA1(bd05388a125a0201a41af95fb2aa5fe1c8b0f270) ) | |
| 2161 | ||
| 1606 | 2162 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1607 | 2163 | ROM_LOAD( "ff2cguu.5b", 0x0000000, 0x400000, CRC(595deee4) SHA1(b29ff9c6ba17737f1f87c05b2d899d80b0b72dbb) ) |
| 1608 | 2164 | ROM_LOAD( "ff2cgum.6b", 0x0800000, 0x400000, CRC(b808be59) SHA1(906bfbb5d34feef9697da545a93930fe6e56685c) ) |
| r7500 | r7501 | |
| 1641 | 2197 | |
| 1642 | 2198 | ROM_REGION( 0x1000000, "c352", 0 ) /* C352 PCM samples */ |
| 1643 | 2199 | ROM_LOAD( "ff2wavel.2s", 0x000000, 0x800000, CRC(6235c605) SHA1(521eaee80ac17c0936877d49394e5390fa0ff8a0) ) |
| 1644 | ROM_LOAD( "ff2waveh.3s", 0x00000, 0x800000, CRC(2a59492a) SHA1(886ec0a4a71048d65f93c52df96416e74d23b3ec) ) | |
| 2200 | ROM_LOAD( "ff2waveh.3s", 0x800000, 0x800000, CRC(2a59492a) SHA1(886ec0a4a71048d65f93c52df96416e74d23b3ec) ) | |
| 1645 | 2201 | ROM_END |
| 1646 | 2202 | |
| 1647 | 2203 | ROM_START( motoxgo ) |
| r7500 | r7501 | |
| 1658 | 2214 | ROM_REGION( 0x20000, "exioboard", 0 ) /* "extra" I/O board (uses Fujitsu MB90611A MCU) */ |
| 1659 | 2215 | ROM_LOAD( "mg1prog0a.3a", 0x000000, 0x020000, CRC(b2b5be8f) SHA1(803652b7b8fde2196b7fb742ba8b9843e4fcd2de) ) |
| 1660 | 2216 | |
| 1661 | ROM_REGION( 0x2000000, "sprite", ROMREGION_ERASEFF ) /* sprite? tilemap? tiles */ | |
| 1662 | ROM_LOAD16_BYTE( "mg1mtal.2h", 0x000000, 0x800000, CRC(fdad0f0a) SHA1(420d50f012af40f80b196d3aae320376e6c32367) ) | |
| 1663 | ROM_LOAD16_BYTE( "mg1mtah.2j", 0x000001, 0x800000, CRC(845f4768) SHA1(9c03b1f6dcd9d1f43c2958d855221be7f9415c47) ) | |
| 2217 | ROM_REGION32_BE( 0x2000000, "data", ROMREGION_ERASEFF ) /* data roms */ | |
| 2218 | ROM_LOAD16_BYTE( "mg1mtah.2j", 0x000000, 0x800000, CRC(845f4768) SHA1(9c03b1f6dcd9d1f43c2958d855221be7f9415c47) ) | |
| 2219 | ROM_LOAD16_BYTE( "mg1mtal.2h", 0x000001, 0x800000, CRC(fdad0f0a) SHA1(420d50f012af40f80b196d3aae320376e6c32367) ) | |
| 1664 | 2220 | |
| 1665 | 2221 | ROM_REGION( 0x2000000, "textile", ROMREGION_ERASEFF ) /* texture tiles */ |
| 1666 | 2222 | ROM_LOAD( "mg1cgum.4j", 0x000000, 0x800000, CRC(46a77d73) SHA1(132ce2452ee68ba374e98b59032ac0a1a277078d) ) |
| r7500 | r7501 | |
| 1702 | 2258 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ |
| 1703 | 2259 | ROM_LOAD( "tssioprog.ic3", 0x000000, 0x040000, CRC(edad4538) SHA1(1330189184a636328d956c0e435f8d9ad2e96a80) ) |
| 1704 | 2260 | |
| 1705 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1706 | ROM_LOAD16_BYTE( "tss1mtal.2h", 0x0000000, 0x800000, CRC(bfc79190) SHA1(04bda00c4cc5660d27af4f3b0ee3550dea8d3805) ) | |
| 1707 | ROM_LOAD16_BYTE( "tss1mtah.2j", 0x0000001, 0x800000, CRC(697c26ed) SHA1(72f6f69e89496ba0c6183b35c3bde71f5a3c721f) ) | |
| 1708 | ROM_LOAD16_BYTE( "tss1mtbl.2f", 0x1000000, 0x800000, CRC(e648bea4) SHA1(3803d03e72b25fbcc124d5b25066d25629b76b94) ) | |
| 1709 | ROM_LOAD16_BYTE( "tss1mtbh.2m", 0x1000001, 0x800000, CRC(82582776) SHA1(7c790d09bac660ea1c62da3ffb21ab43f2461594) ) | |
| 2261 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2262 | ROM_LOAD16_BYTE( "tss1mtah.2j", 0x0000000, 0x800000, CRC(697c26ed) SHA1(72f6f69e89496ba0c6183b35c3bde71f5a3c721f) ) | |
| 2263 | ROM_LOAD16_BYTE( "tss1mtal.2h", 0x0000001, 0x800000, CRC(bfc79190) SHA1(04bda00c4cc5660d27af4f3b0ee3550dea8d3805) ) | |
| 2264 | ROM_LOAD16_BYTE( "tss1mtbh.2m", 0x1000000, 0x800000, CRC(82582776) SHA1(7c790d09bac660ea1c62da3ffb21ab43f2461594) ) | |
| 2265 | ROM_LOAD16_BYTE( "tss1mtbl.2f", 0x1000001, 0x800000, CRC(e648bea4) SHA1(3803d03e72b25fbcc124d5b25066d25629b76b94) ) | |
| 1710 | 2266 | |
| 1711 | 2267 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1712 | 2268 | ROM_LOAD( "tss1cguu.4f", 0x0000000, 0x800000, CRC(76924e04) SHA1(751065d6ce658cbbcd88f854f6937ebd2204ec68) ) |
| r7500 | r7501 | |
| 1742 | 2298 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ |
| 1743 | 2299 | ROM_LOAD( "tssioprog.ic3", 0x000000, 0x040000, CRC(edad4538) SHA1(1330189184a636328d956c0e435f8d9ad2e96a80) ) |
| 1744 | 2300 | |
| 1745 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1746 | ROM_LOAD16_BYTE( "tss1mtal.2h", 0x0000000, 0x800000, CRC(bfc79190) SHA1(04bda00c4cc5660d27af4f3b0ee3550dea8d3805) ) | |
| 1747 | ROM_LOAD16_BYTE( "tss1mtah.2j", 0x0000001, 0x800000, CRC(697c26ed) SHA1(72f6f69e89496ba0c6183b35c3bde71f5a3c721f) ) | |
| 1748 | ROM_LOAD16_BYTE( "tss1mtbl.2f", 0x1000000, 0x800000, CRC(e648bea4) SHA1(3803d03e72b25fbcc124d5b25066d25629b76b94) ) | |
| 1749 | ROM_LOAD16_BYTE( "tss1mtbh.2m", 0x1000001, 0x800000, CRC(82582776) SHA1(7c790d09bac660ea1c62da3ffb21ab43f2461594) ) | |
| 2301 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2302 | ROM_LOAD16_BYTE( "tss1mtah.2j", 0x0000000, 0x800000, CRC(697c26ed) SHA1(72f6f69e89496ba0c6183b35c3bde71f5a3c721f) ) | |
| 2303 | ROM_LOAD16_BYTE( "tss1mtal.2h", 0x0000001, 0x800000, CRC(bfc79190) SHA1(04bda00c4cc5660d27af4f3b0ee3550dea8d3805) ) | |
| 2304 | ROM_LOAD16_BYTE( "tss1mtbh.2m", 0x1000000, 0x800000, CRC(82582776) SHA1(7c790d09bac660ea1c62da3ffb21ab43f2461594) ) | |
| 2305 | ROM_LOAD16_BYTE( "tss1mtbl.2f", 0x1000001, 0x800000, CRC(e648bea4) SHA1(3803d03e72b25fbcc124d5b25066d25629b76b94) ) | |
| 1750 | 2306 | |
| 1751 | 2307 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1752 | 2308 | ROM_LOAD( "tss1cguu.4f", 0x0000000, 0x800000, CRC(76924e04) SHA1(751065d6ce658cbbcd88f854f6937ebd2204ec68) ) |
| r7500 | r7501 | |
| 1771 | 2327 | ROM_LOAD( "tss1waveh.2a", 0x800000, 0x800000, CRC(5c8758b4) SHA1(b85c8f6869900224ef83a2340b17f5bbb2801af9) ) |
| 1772 | 2328 | ROM_END |
| 1773 | 2329 | |
| 2330 | ROM_START( timecrs2c ) | |
| 2331 | ROM_REGION32_BE( 0x400000, "user1", 0 ) /* 4 megs for main R4650 code */ | |
| 2332 | ROM_LOAD16_BYTE( "tss4vera.2", 0x000000, 0x200000, CRC(c84edd3b) SHA1(0b577a8ef6e74afa991dd81c2db19041787724da) ) | |
| 2333 | ROM_LOAD16_BYTE( "tss4vera.1", 0x000001, 0x200000, CRC(26f57c83) SHA1(c8983c26b7524a35257a242b66a9413eb354ca0d) ) | |
| 2334 | ||
| 2335 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ | |
| 2336 | ROM_LOAD16_WORD_SWAP( "tss4vera.3", 0x000000, 0x080000, CRC(41e41994) SHA1(eabc1a307c329070bfc6486cb68169c94ff8a162) ) | |
| 2337 | ||
| 2338 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ | |
| 2339 | ROM_LOAD( "tssioprog.ic3", 0x000000, 0x040000, CRC(edad4538) SHA1(1330189184a636328d956c0e435f8d9ad2e96a80) ) | |
| 2340 | ||
| 2341 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2342 | ROM_LOAD16_BYTE( "tss1mtah.2j", 0x0000000, 0x800000, CRC(697c26ed) SHA1(72f6f69e89496ba0c6183b35c3bde71f5a3c721f) ) | |
| 2343 | ROM_LOAD16_BYTE( "tss1mtal.2h", 0x0000001, 0x800000, CRC(bfc79190) SHA1(04bda00c4cc5660d27af4f3b0ee3550dea8d3805) ) | |
| 2344 | ROM_LOAD16_BYTE( "tss1mtbh.2m", 0x1000000, 0x800000, CRC(82582776) SHA1(7c790d09bac660ea1c62da3ffb21ab43f2461594) ) | |
| 2345 | ROM_LOAD16_BYTE( "tss1mtbl.2f", 0x1000001, 0x800000, CRC(e648bea4) SHA1(3803d03e72b25fbcc124d5b25066d25629b76b94) ) | |
| 2346 | ||
| 2347 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ | |
| 2348 | ROM_LOAD( "tss1cguu.4f", 0x0000000, 0x800000, CRC(76924e04) SHA1(751065d6ce658cbbcd88f854f6937ebd2204ec68) ) | |
| 2349 | ROM_LOAD( "tss1cgum.4j", 0x0800000, 0x800000, CRC(c22739e1) SHA1(8671ee047bb248033656c50befd1c35e5e478e1a) ) | |
| 2350 | ROM_LOAD( "tss1cgll.4m", 0x1000000, 0x800000, CRC(18433aaa) SHA1(08539beb2e66ec4e41062621fc098b121c669546) ) | |
| 2351 | ROM_LOAD( "tss1cglm.4k", 0x1800000, 0x800000, CRC(669974c2) SHA1(cfebe199631e38f547b38fcd35f1645b74e8dd0a) ) | |
| 2352 | ||
| 2353 | ROM_REGION( 0x600000, "textilemap", 0 ) /* texture tilemap */ | |
| 2354 | ROM_LOAD( "tss1ccrl.7f", 0x000000, 0x400000, CRC(3a325fe7) SHA1(882735dce7aeb36f9e88a983498360f5de901e9d) ) | |
| 2355 | ROM_LOAD( "tss1ccrh.7e", 0x400000, 0x200000, CRC(f998de1a) SHA1(371f540f505608297c5ffcfb623b983ca8310afb) ) | |
| 2356 | ||
| 2357 | ROM_REGION32_LE( 0x2000000, "pointrom", 0 ) /* 3D model data */ | |
| 2358 | ROM_LOAD32_WORD( "tss1pt0l.7c", 0x0000000, 0x400000, CRC(896f0fb4) SHA1(bdfa99eb21ce4fc8021f9d95a5558a34f9942c57) ) | |
| 2359 | ROM_LOAD32_WORD( "tss1pt0h.7a", 0x0000002, 0x400000, CRC(cdbe0ba8) SHA1(f8c6da31654c0a2a8024888ffb7fc1c783b2d629) ) | |
| 2360 | ROM_LOAD32_WORD( "tss1pt1l.5c", 0x0800000, 0x400000, CRC(5a09921f) SHA1(c23885708c7adf0b81c2c9346e21b869634a5b35) ) | |
| 2361 | ROM_LOAD32_WORD( "tss1pt1h.5a", 0x0800002, 0x400000, CRC(63647596) SHA1(833412be8f61686bd7e06c2738df740e0e585d0f) ) | |
| 2362 | ROM_LOAD32_WORD( "tss1pt2l.4c", 0x1000000, 0x400000, CRC(4b230d79) SHA1(794cee0a19993e90913f58507c53224f361e9663) ) | |
| 2363 | ROM_LOAD32_WORD( "tss1pt2h.4a", 0x1000002, 0x400000, CRC(9b06e22d) SHA1(cff5ed098112a4f0a2bc8937e226f50066e605b1) ) | |
| 2364 | ||
| 2365 | ROM_REGION( 0x1000000, "c352", 0 ) /* C352 PCM samples */ | |
| 2366 | ROM_LOAD( "tss1wavel.2c", 0x000000, 0x800000, CRC(deaead26) SHA1(72dac0c3f41d4c3c290f9eb1b50236ae3040a472) ) | |
| 2367 | ROM_LOAD( "tss1waveh.2a", 0x800000, 0x800000, CRC(5c8758b4) SHA1(b85c8f6869900224ef83a2340b17f5bbb2801af9) ) | |
| 2368 | ROM_END | |
| 2369 | ||
| 1774 | 2370 | ROM_START( 500gp ) |
| 1775 | 2371 | /* r4650-generic-xrom-generic: NMON 1.0.8-sys23-19990105 P for SYSTEM23 P1 */ |
| 1776 | 2372 | ROM_REGION32_BE( 0x400000, "user1", 0 ) /* 4 megs for main R4650 code */ |
| r7500 | r7501 | |
| 1780 | 2376 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ |
| 1781 | 2377 | ROM_LOAD16_WORD_SWAP( "5gp3verc.3", 0x000000, 0x080000, CRC(b323abdf) SHA1(8962e39b48a7074a2d492afb5db3f5f3e5ae2389) ) |
| 1782 | 2378 | |
| 1783 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1784 | ROM_LOAD16_BYTE( "5gp1mtal.2h", 0x0000000, 0x800000, CRC(1bb00c7b) SHA1(922be45d57330c31853b2dc1642c589952b09188) ) | |
| 1785 | ROM_LOAD16_BYTE( "5gp1mtah.2j", 0x0000001, 0x800000, CRC(246e4b7a) SHA1(75743294b8f48bffb84f062febfbc02230d49ce9) ) | |
| 2379 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2380 | ROM_LOAD16_BYTE( "5gp1mtah.2j", 0x0000000, 0x800000, CRC(246e4b7a) SHA1(75743294b8f48bffb84f062febfbc02230d49ce9) ) | |
| 2381 | ROM_LOAD16_BYTE( "5gp1mtal.2h", 0x0000001, 0x800000, CRC(1bb00c7b) SHA1(922be45d57330c31853b2dc1642c589952b09188) ) | |
| 1786 | 2382 | |
| 1787 | 2383 | /* COMMON FUJII YASUI WAKAO KURE INOUE |
| 1788 | 2384 | * 0x000000..0x57ffff: all 0xff |
| r7500 | r7501 | |
| 1823 | 2419 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ |
| 1824 | 2420 | ROM_LOAD16_WORD_SWAP( "m29f400.ic3", 0x000000, 0x080000, CRC(9fd69bbd) SHA1(53a9bf505de70495dcccc43fdc722b3381aad97c) ) |
| 1825 | 2421 | |
| 1826 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1827 | ROM_LOAD16_BYTE( "ffs1mtal.2h", 0x0000000, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) ) | |
| 1828 | ROM_LOAD16_BYTE( "ffs1mtah.2j", 0x0000001, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) ) | |
| 1829 | ROM_LOAD16_BYTE( "ffs1mtbl.2f", 0x1000000, 0x800000, CRC(0abc9e50) SHA1(be5e5e2b637811c59804ef9442c6da5a5a1315e2) ) | |
| 1830 | ROM_LOAD16_BYTE( "ffs1mtbh.2m", 0x1000001, 0x800000, CRC(0f42c93b) SHA1(26b313fc5c33afb0a1ee42243486e38f052c95c2) ) | |
| 2422 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2423 | ROM_LOAD16_BYTE( "ffs1mtah.2j", 0x0000000, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) ) | |
| 2424 | ROM_LOAD16_BYTE( "ffs1mtal.2h", 0x0000001, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) ) | |
| 2425 | ROM_LOAD16_BYTE( "ffs1mtbh.2m", 0x1000000, 0x800000, CRC(0f42c93b) SHA1(26b313fc5c33afb0a1ee42243486e38f052c95c2) ) | |
| 2426 | ROM_LOAD16_BYTE( "ffs1mtbl.2f", 0x1000001, 0x800000, CRC(0abc9e50) SHA1(be5e5e2b637811c59804ef9442c6da5a5a1315e2) ) | |
| 1831 | 2427 | |
| 1832 | 2428 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1833 | 2429 | ROM_LOAD( "ffs1cguu.4f", 0x0000000, 0x800000, CRC(52c0a19f) SHA1(e6b4b90ff88da09cb2e653e450e7ae66942a719e) ) |
| r7500 | r7501 | |
| 1862 | 2458 | ROM_REGION( 0x80000, "audiocpu", 0 ) /* Hitachi H8/3002 MCU code */ |
| 1863 | 2459 | ROM_LOAD16_WORD_SWAP( "m29f400.ic3", 0x000000, 0x080000, CRC(9fd69bbd) SHA1(53a9bf505de70495dcccc43fdc722b3381aad97c) ) |
| 1864 | 2460 | |
| 1865 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1866 | ROM_LOAD16_BYTE( "ffs1mtal.2h", 0x0000000, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) ) | |
| 1867 | ROM_LOAD16_BYTE( "ffs1mtah.2j", 0x0000001, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) ) | |
| 1868 | ROM_LOAD16_BYTE( "ffs1mtbl.2f", 0x1000000, 0x800000, CRC(0abc9e50) SHA1(be5e5e2b637811c59804ef9442c6da5a5a1315e2) ) | |
| 1869 | ROM_LOAD16_BYTE( "ffs1mtbh.2m", 0x1000001, 0x800000, CRC(0f42c93b) SHA1(26b313fc5c33afb0a1ee42243486e38f052c95c2) ) | |
| 2461 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2462 | ROM_LOAD16_BYTE( "ffs1mtah.2j", 0x0000000, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) ) | |
| 2463 | ROM_LOAD16_BYTE( "ffs1mtal.2h", 0x0000001, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) ) | |
| 2464 | ROM_LOAD16_BYTE( "ffs1mtbh.2m", 0x1000000, 0x800000, CRC(0f42c93b) SHA1(26b313fc5c33afb0a1ee42243486e38f052c95c2) ) | |
| 2465 | ROM_LOAD16_BYTE( "ffs1mtbl.2f", 0x1000001, 0x800000, CRC(0abc9e50) SHA1(be5e5e2b637811c59804ef9442c6da5a5a1315e2) ) | |
| 1870 | 2466 | |
| 1871 | 2467 | ROM_REGION( 0x2000000, "textile", 0 ) /* texture tiles */ |
| 1872 | 2468 | ROM_LOAD( "ffs1cguu.4f", 0x0000000, 0x800000, CRC(52c0a19f) SHA1(e6b4b90ff88da09cb2e653e450e7ae66942a719e) ) |
| r7500 | r7501 | |
| 1902 | 2498 | ROM_LOAD16_WORD_SWAP( "pnp2ver-a.ic3", 0x000000, 0x080000, CRC(fe4bc6f4) SHA1(2114dc4bc63d589e6c3b26a73dbc60924f3b1765) ) |
| 1903 | 2499 | |
| 1904 | 2500 | ROM_REGION( 0x40000, "ioboard", 0 ) /* I/O board HD643334 H8/3334 MCU code */ |
| 1905 | // i/o program from motoxgo, as it's "general". however, game crashes(H8 unknown opcode) if add this program | |
| 1906 | // ROM_LOAD( "asca-3a.ic14", 0x000000, 0x040000, CRC(8e9266e5) SHA1(ffa8782ca641d71d57df23ed1c5911db05d3df97) ) | |
| 1907 | ROM_FILL( 0x00000, 0x40000, 0 ) // Temporary - fixes validity check warning | |
| 2501 | ROM_LOAD( "asca-3a.ic14", 0x000000, 0x040000, CRC(8e9266e5) SHA1(ffa8782ca641d71d57df23ed1c5911db05d3df97) ) | |
| 1908 | 2502 | |
| 1909 | ROM_REGION( 0x2000000, "sprite", 0 ) /* sprite? tilemap? tiles */ | |
| 1910 | ROM_LOAD16_BYTE( "pnp1mtal.2h", 0x000000, 0x800000, CRC(6490faaa) SHA1(03443746009b434e5d4074ea6314910418907360) ) | |
| 1911 | ROM_LOAD16_BYTE( "pnp1mtah.2j", 0x000001, 0x800000, CRC(37addddd) SHA1(3032989653304417df80606bc3fde6e9425d8cbb) ) | |
| 2503 | ROM_REGION32_BE( 0x2000000, "data", 0 ) /* data roms */ | |
| 2504 | ROM_LOAD16_BYTE( "pnp1mtah.2j", 0x000000, 0x800000, CRC(37addddd) SHA1(3032989653304417df80606bc3fde6e9425d8cbb) ) | |
| 2505 | ROM_LOAD16_BYTE( "pnp1mtal.2h", 0x000001, 0x800000, CRC(6490faaa) SHA1(03443746009b434e5d4074ea6314910418907360) ) | |
| 1912 | 2506 | |
| 1913 | 2507 | ROM_REGION( 0x4000000, "textile", 0 ) /* texture tiles */ |
| 1914 | 2508 | ROM_LOAD( "pnp1cguu.5f", 0x000000, 0x800000, CRC(cd64f57f) SHA1(8780270298e0823db1acbbf79396788df0c3c19c) ) |
| r7500 | r7501 | |
| 1944 | 2538 | GAME( 1997, motoxgo, 0, s23, ss23, ss23, ROT0, "Namco", "Motocross Go! (MG3 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| 1945 | 2539 | GAME( 1997, timecrs2, 0, s23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS3 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| 1946 | 2540 | GAME( 1997, timecrs2b,timecrs2, s23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS2 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| 2541 | GAME( 1997, timecrs2c,timecrs2, ss23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS4 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) | |
| 1947 | 2542 | GAME( 1998, panicprk, 0, s23, ss23, ss23, ROT0, "Namco", "Panic Park (PNP2 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| 1948 | 2543 | GAME( 1999, 500gp, 0, ss23, ss23, ss23, ROT0, "Namco", "500GP", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| 1949 | 2544 | GAME( 1999, finfurl2, 0, ss23, ss23, ss23, ROT0, "Namco", "Final Furlong 2 (World)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /***************************************************************************** |
| 2 | 2 | |
| 3 | Mahjong Sisters (c) 1986 Toa Plan | |
| 3 | Mahjong Sisters (c) 1986 Toa Plan | |
| 4 | 4 | |
| 5 | 5 | Driver by Uki |
| 6 | 6 | |
| r7500 | r7501 | |
| 14 | 14 | |
| 15 | 15 | #define MCLK 12000000 |
| 16 | 16 | |
| 17 | extern int mjsister_flip_screen; | |
| 18 | extern int mjsister_video_enable; | |
| 19 | extern int mjsister_screen_redraw; | |
| 20 | 17 | |
| 21 | extern int mjsister_vrambank; | |
| 22 | extern int mjsister_colorbank; | |
| 18 | class mjsister_state | |
| 19 | { | |
| 20 | public: | |
| 21 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mjsister_state(machine)); } | |
| 23 | 22 | |
| 24 | VIDEO_START( mjsister ); | |
| 25 | VIDEO_UPDATE( mjsister ); | |
| 26 | WRITE8_HANDLER( mjsister_videoram_w ); | |
| 23 | mjsister_state(running_machine &machine) { } | |
| 27 | 24 | |
| 28 | static int mjsister_input_sel1; | |
| 29 | static int mjsister_input_sel2; | |
| 25 | /* memory pointers */ | |
| 26 | UINT8 * videoram0, *videoram1; | |
| 30 | 27 | |
| 31 | static int rombank0,rombank1; | |
| 28 | /* video-related */ | |
| 29 | bitmap_t *tmpbitmap0, *tmpbitmap1; | |
| 30 | int flip_screen; | |
| 31 | int video_enable; | |
| 32 | int screen_redraw; | |
| 33 | int vrambank; | |
| 34 | int colorbank; | |
| 32 | 35 | |
| 33 | static UINT32 dac_adr,dac_bank,dac_adr_s,dac_adr_e,dac_busy; | |
| 36 | /* misc */ | |
| 37 | int input_sel1; | |
| 38 | int input_sel2; | |
| 34 | 39 | |
| 35 | ||
| 40 | int rombank0,rombank1; | |
| 36 | 41 | |
| 42 | UINT32 dac_adr, dac_bank, dac_adr_s, dac_adr_e, dac_busy; | |
| 43 | ||
| 44 | /* devices */ | |
| 45 | running_device *maincpu; | |
| 46 | running_device *dac; | |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 50 | /************************************* | |
| 51 | * | |
| 52 | * Video emulation | |
| 53 | * | |
| 54 | *************************************/ | |
| 55 | ||
| 56 | static VIDEO_START( mjsister ) | |
| 57 | { | |
| 58 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 59 | state->tmpbitmap0 = auto_bitmap_alloc(machine, 256, 256, video_screen_get_format(machine->primary_screen)); | |
| 60 | state->tmpbitmap1 = auto_bitmap_alloc(machine, 256, 256, video_screen_get_format(machine->primary_screen)); | |
| 61 | state->videoram0 = auto_alloc_array(machine, UINT8, 0x8000); | |
| 62 | state->videoram1 = auto_alloc_array(machine, UINT8, 0x8000); | |
| 63 | ||
| 64 | state_save_register_global_pointer(machine, state->videoram0, 0x8000); | |
| 65 | state_save_register_global_pointer(machine, state->videoram1, 0x8000); | |
| 66 | } | |
| 67 | ||
| 68 | static void mjsister_plot0( running_machine *machine, int offset, UINT8 data ) | |
| 69 | { | |
| 70 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 71 | int x, y, c1, c2; | |
| 72 | ||
| 73 | x = offset & 0x7f; | |
| 74 | y = offset / 0x80; | |
| 75 | ||
| 76 | c1 = (data & 0x0f) + state->colorbank * 0x20; | |
| 77 | c2 = ((data & 0xf0) >> 4) + state->colorbank * 0x20; | |
| 78 | ||
| 79 | *BITMAP_ADDR16(state->tmpbitmap0, y, x * 2 + 0) = c1; | |
| 80 | *BITMAP_ADDR16(state->tmpbitmap0, y, x * 2 + 1) = c2; | |
| 81 | } | |
| 82 | ||
| 83 | static void mjsister_plot1( running_machine *machine, int offset, UINT8 data ) | |
| 84 | { | |
| 85 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 86 | int x, y, c1, c2; | |
| 87 | ||
| 88 | x = offset & 0x7f; | |
| 89 | y = offset / 0x80; | |
| 90 | ||
| 91 | c1 = data & 0x0f; | |
| 92 | c2 = (data & 0xf0) >> 4; | |
| 93 | ||
| 94 | if (c1) | |
| 95 | c1 += state->colorbank * 0x20 + 0x10; | |
| 96 | if (c2) | |
| 97 | c2 += state->colorbank * 0x20 + 0x10; | |
| 98 | ||
| 99 | *BITMAP_ADDR16(state->tmpbitmap1, y, x * 2 + 0) = c1; | |
| 100 | *BITMAP_ADDR16(state->tmpbitmap1, y, x * 2 + 1) = c2; | |
| 101 | } | |
| 102 | ||
| 103 | static WRITE8_HANDLER( mjsister_videoram_w ) | |
| 104 | { | |
| 105 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 106 | if (state->vrambank) | |
| 107 | { | |
| 108 | state->videoram1[offset] = data; | |
| 109 | mjsister_plot1(space->machine, offset, data); | |
| 110 | } | |
| 111 | else | |
| 112 | { | |
| 113 | state->videoram0[offset] = data; | |
| 114 | mjsister_plot0(space->machine, offset, data); | |
| 115 | } | |
| 116 | } | |
| 117 | ||
| 118 | static VIDEO_UPDATE( mjsister ) | |
| 119 | { | |
| 120 | mjsister_state *state = (mjsister_state *)screen->machine->driver_data; | |
| 121 | int flip = state->flip_screen; | |
| 122 | int i, j; | |
| 123 | ||
| 124 | if (state->screen_redraw) | |
| 125 | { | |
| 126 | int offs; | |
| 127 | ||
| 128 | for (offs = 0; offs < 0x8000; offs++) | |
| 129 | { | |
| 130 | mjsister_plot0(screen->machine, offs, state->videoram0[offs]); | |
| 131 | mjsister_plot1(screen->machine, offs, state->videoram1[offs]); | |
| 132 | } | |
| 133 | state->screen_redraw = 0; | |
| 134 | } | |
| 135 | ||
| 136 | if (state->video_enable) | |
| 137 | { | |
| 138 | for (i = 0; i < 256; i++) | |
| 139 | for (j = 0; j < 4; j++) | |
| 140 | *BITMAP_ADDR16(bitmap, i, 256 + j) = state->colorbank * 0x20; | |
| 141 | ||
| 142 | copybitmap(bitmap, state->tmpbitmap0, flip, flip, 0, 0, cliprect); | |
| 143 | copybitmap_trans(bitmap, state->tmpbitmap1, flip, flip, 2, 0, cliprect, 0); | |
| 144 | } | |
| 145 | else | |
| 146 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 147 | return 0; | |
| 148 | } | |
| 149 | ||
| 150 | /************************************* | |
| 151 | * | |
| 152 | * Memory handlers | |
| 153 | * | |
| 154 | *************************************/ | |
| 155 | ||
| 37 | 156 | static TIMER_CALLBACK( dac_callback ) |
| 38 | 157 | { |
| 158 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 39 | 159 | UINT8 *DACROM = memory_region(machine, "samples"); |
| 40 | 160 | |
| 41 | dac_data_w( | |
| 161 | dac_data_w(s | |
| 42 | 162 | |
| 43 | if (((dac_adr & 0xff00 ) >> 8) != dac_adr_e | |
| 163 | if (((state->dac_adr & 0xff00 ) >> 8) != state->dac_adr_e | |
| 44 | 164 | timer_set(machine, attotime_mul(ATTOTIME_IN_HZ(MCLK), 1024), NULL, 0, dac_callback); |
| 45 | 165 | else |
| 46 | dac_busy = 0; | |
| 166 | state->dac_busy = 0; | |
| 47 | 167 | } |
| 48 | 168 | |
| 49 | 169 | static WRITE8_HANDLER( mjsister_dac_adr_s_w ) |
| 50 | 170 | { |
| 51 | dac_adr_s = data; | |
| 171 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 172 | state->dac_adr_s = data; | |
| 52 | 173 | } |
| 53 | 174 | |
| 54 | 175 | static WRITE8_HANDLER( mjsister_dac_adr_e_w ) |
| 55 | 176 | { |
| 56 | dac_adr_e = data; | |
| 57 | dac_adr = dac_adr_s << 8; | |
| 177 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 178 | state->dac_adr_e = data; | |
| 179 | state->dac_adr = state->dac_adr_s << 8; | |
| 58 | 180 | |
| 59 | if (dac_busy == 0) | |
| 60 | timer_call_after_resynch(space->machine, NULL, 0,dac_callback); | |
| 181 | if (state->dac_busy == 0) | |
| 182 | timer_call_after_resynch(space->machine, NULL, 0, dac_callback); | |
| 61 | 183 | |
| 62 | dac_busy = 1; | |
| 184 | state->dac_busy = 1; | |
| 63 | 185 | } |
| 64 | 186 | |
| 65 | static MACHINE_RESET( mjsister ) | |
| 66 | { | |
| 67 | dac_busy = 0; | |
| 68 | } | |
| 69 | ||
| 70 | 187 | static WRITE8_HANDLER( mjsister_banksel1_w ) |
| 71 | 188 | { |
| 72 | UINT8 *BANKROM = memory_region(space->machine, "maincpu"); | |
| 73 | int tmp = mjsister_colorbank; | |
| 189 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 190 | int tmp = state->colorbank; | |
| 74 | 191 | |
| 75 | 192 | switch (data) |
| 76 | 193 | { |
| 77 | case 0x0: rombank0 = 0 ; break; | |
| 78 | case 0x1: rombank0 = 1 ; break; | |
| 194 | case 0x0: state->rombank0 = 0 ; break; | |
| 195 | case 0x1: state->rombank0 = 1 ; break; | |
| 79 | 196 | |
| 80 | case 0x2: mjsister_flip_screen = 0 ; break; | |
| 81 | case 0x3: mjsister_flip_screen = 1 ; break; | |
| 197 | case 0x2: state->flip_screen = 0 ; break; | |
| 198 | case 0x3: state->flip_screen = 1 ; break; | |
| 82 | 199 | |
| 83 | case 0x4: mjsister_colorbank &=0xfe; break; | |
| 84 | case 0x5: mjsister_colorbank |=0x01; break; | |
| 85 | case 0x6: mjsister_colorbank &=0xfd; break; | |
| 86 | case 0x7: mjsister_colorbank |=0x02; break; | |
| 87 | case 0x8: mjsister_colorbank &=0xfb; break; | |
| 88 | case 0x9: mjsister_colorbank |=0x04; break; | |
| 200 | case 0x4: state->colorbank &= 0xfe; break; | |
| 201 | case 0x5: state->colorbank |= 0x01; break; | |
| 202 | case 0x6: state->colorbank &= 0xfd; break; | |
| 203 | case 0x7: state->colorbank |= 0x02; break; | |
| 204 | case 0x8: state->colorbank &= 0xfb; break; | |
| 205 | case 0x9: state->colorbank |= 0x04; break; | |
| 89 | 206 | |
| 90 | case 0xa: mjsister_video_enable = 0 ; break; | |
| 91 | case 0xb: mjsister_video_enable = 1 ; break; | |
| 207 | case 0xa: state->video_enable = 0 ; break; | |
| 208 | case 0xb: state->video_enable = 1 ; break; | |
| 92 | 209 | |
| 93 | case 0xe: mjsister_vrambank = 0 ; break; | |
| 94 | case 0xf: mjsister_vrambank = 1 ; break; | |
| 210 | case 0xe: state->vrambank = 0 ; break; | |
| 211 | case 0xf: state->vrambank = 1 ; break; | |
| 95 | 212 | |
| 96 | 213 | default: |
| 97 | logerror("%04x p30_w:%02x\n",cpu_get_pc(space->cpu),data); | |
| 214 | logerror("%04x p30_w:%02x\n", cpu_get_pc(space->cpu), data); | |
| 98 | 215 | } |
| 99 | 216 | |
| 100 | if (tmp != mjsister_colorbank) | |
| 101 | mjsister_screen_redraw = 1; | |
| 217 | if (tmp != state->colorbank) | |
| 218 | state->screen_redraw = 1; | |
| 102 | 219 | |
| 103 | memory_set_bank | |
| 220 | memory_set_bank | |
| 104 | 221 | } |
| 105 | 222 | |
| 106 | 223 | static WRITE8_HANDLER( mjsister_banksel2_w ) |
| 107 | 224 | { |
| 108 | | |
| 225 | mjsister_state *state | |
| 109 | 226 | |
| 110 | 227 | switch (data) |
| 111 | 228 | { |
| 112 | case 0xa: dac_bank = 0; break; | |
| 113 | case 0xb: dac_bank = 1; break; | |
| 229 | case 0xa: state->dac_bank = 0; break; | |
| 230 | case 0xb: state->dac_bank = 1; break; | |
| 114 | 231 | |
| 115 | case 0xc: rombank1 = 0; break; | |
| 116 | case 0xd: rombank1 = 1; break; | |
| 232 | case 0xc: state->rombank1 = 0; break; | |
| 233 | case 0xd: state->rombank1 = 1; break; | |
| 117 | 234 | |
| 118 | 235 | default: |
| 119 | logerror("%04x p31_w:%02x\n",cpu_get_pc(space->cpu),data); | |
| 236 | logerror("%04x p31_w:%02x\n", cpu_get_pc(space->cpu), data); | |
| 120 | 237 | } |
| 121 | 238 | |
| 122 | memory_set_bank | |
| 239 | memory_set_bank | |
| 123 | 240 | } |
| 124 | 241 | |
| 125 | 242 | static WRITE8_HANDLER( mjsister_input_sel1_w ) |
| 126 | 243 | { |
| 127 | mjsister_input_sel1 = data; | |
| 244 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 245 | state->input_sel1 = data; | |
| 128 | 246 | } |
| 129 | 247 | |
| 130 | 248 | static WRITE8_HANDLER( mjsister_input_sel2_w ) |
| 131 | 249 | { |
| 132 | mjsister_input_sel2 = data; | |
| 250 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 251 | state->input_sel2 = data; | |
| 133 | 252 | } |
| 134 | 253 | |
| 135 | 254 | static READ8_HANDLER( mjsister_keys_r ) |
| 136 | 255 | { |
| 137 | int p,i,ret = 0; | |
| 256 | mjsister_state *state = (mjsister_state *)space->machine->driver_data; | |
| 257 | int p, i, ret = 0; | |
| 138 | 258 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; |
| 139 | 259 | |
| 140 | p = mjsister_input_sel1 & 0x3f; | |
| 141 | // p |= ((mjsister_input_sel2 & 8) << 4) | ((mjsister_input_sel2 & 0x20) << 1); | |
| 260 | p = state->input_sel1 & 0x3f; | |
| 261 | // p |= ((state->input_sel2 & 8) << 4) | ((state->input_sel2 & 0x20) << 1); | |
| 142 | 262 | |
| 143 | for (i=0; i<6; i++) | |
| 263 | for (i = 0; i < 6; i++) | |
| 144 | 264 | { |
| 145 | if ( | |
| 265 | if (BIT | |
| 146 | 266 | ret |= input_port_read(space->machine, keynames[i]); |
| 147 | 267 | } |
| 148 | 268 | |
| 149 | 269 | return ret; |
| 150 | 270 | } |
| 151 | 271 | |
| 152 | /****************************************************************************/ | |
| 272 | /************************************* | |
| 273 | * | |
| 274 | * Address maps | |
| 275 | * | |
| 276 | *************************************/ | |
| 153 | 277 | |
| 154 | 278 | static ADDRESS_MAP_START( mjsister_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 155 | 279 | AM_RANGE(0x0000, 0x77ff) AM_ROM |
| r7500 | r7501 | |
| 174 | 298 | ADDRESS_MAP_END |
| 175 | 299 | |
| 176 | 300 | |
| 177 | /****************************************************************************/ | |
| 301 | /************************************* | |
| 302 | * | |
| 303 | * Input ports | |
| 304 | * | |
| 305 | *************************************/ | |
| 178 | 306 | |
| 179 | 307 | static INPUT_PORTS_START( mjsister ) |
| 180 | ||
| 181 | PORT_START("DSW1") /* DSW1 (0) */ | |
| 308 | PORT_START("DSW1") | |
| 182 | 309 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) |
| 183 | 310 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 184 | 311 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) |
| r7500 | r7501 | |
| 202 | 329 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 203 | 330 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 204 | 331 | |
| 205 | PORT_START("DSW2") | |
| 332 | PORT_START("DSW2") | |
| 206 | 333 | PORT_DIPNAME( 0x01, 0x01, "Unknown 2-1" ) |
| 207 | 334 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 208 | 335 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r7500 | r7501 | |
| 228 | 355 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 229 | 356 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 230 | 357 | |
| 231 | PORT_START("IN0") | |
| 358 | PORT_START("IN0") | |
| 232 | 359 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 233 | 360 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* memory reset 1 */ |
| 234 | 361 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* analyzer */ |
| r7500 | r7501 | |
| 238 | 365 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 239 | 366 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* hopper */ |
| 240 | 367 | |
| 241 | PORT_START("KEY0") /* (3) PORT 1-0 */ | |
| 242 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) | |
| 243 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) | |
| 244 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) | |
| 245 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) | |
| 246 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) | |
| 368 | PORT_START("KEY0") | |
| 369 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) | |
| 370 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) | |
| 371 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) | |
| 372 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) | |
| 373 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) | |
| 247 | 374 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 248 | 375 | |
| 249 | PORT_START("KEY1") /* (4) PORT 1-1 */ | |
| 250 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) | |
| 251 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) | |
| 252 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) | |
| 253 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) | |
| 254 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) | |
| 376 | PORT_START("KEY1") | |
| 377 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) | |
| 378 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) | |
| 379 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) | |
| 380 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) | |
| 381 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) | |
| 255 | 382 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 256 | 383 | |
| 257 | PORT_START("KEY2") /* (5) PORT 1-2 */ | |
| 258 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) | |
| 259 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) | |
| 260 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) | |
| 261 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) | |
| 262 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) | |
| 384 | PORT_START("KEY2") | |
| 385 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) | |
| 386 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) | |
| 387 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) | |
| 388 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) | |
| 389 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) | |
| 263 | 390 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 264 | 391 | |
| 265 | PORT_START("KEY3") /* (6) PORT 1-3 */ | |
| 266 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) | |
| 267 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) | |
| 268 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) | |
| 269 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) | |
| 270 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) | |
| 392 | PORT_START("KEY3") | |
| 393 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) | |
| 394 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) | |
| 395 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) | |
| 396 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) | |
| 397 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) | |
| 271 | 398 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 272 | 399 | |
| 273 | PORT_START("KEY4") /* (7) PORT 1-4 */ | |
| 274 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) | |
| 275 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) | |
| 276 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) | |
| 400 | PORT_START("KEY4") | |
| 401 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) | |
| 402 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) | |
| 403 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) | |
| 277 | 404 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 278 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG ) | |
| 405 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG ) | |
| 279 | 406 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 280 | 407 | |
| 281 | PORT_START("KEY5") | |
| 408 | PORT_START("KEY5") | |
| 282 | 409 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 283 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) | |
| 410 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) | |
| 284 | 411 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 285 | 412 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 286 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL ) | |
| 413 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL ) | |
| 287 | 414 | PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 288 | 415 | |
| 289 | 416 | INPUT_PORTS_END |
| 290 | 417 | |
| 291 | /****************************************************************************/ | |
| 418 | /************************************* | |
| 419 | * | |
| 420 | * Sound interface | |
| 421 | * | |
| 422 | *************************************/ | |
| 292 | 423 | |
| 293 | 424 | static const ay8910_interface ay8910_config = |
| 294 | 425 | { |
| r7500 | r7501 | |
| 300 | 431 | DEVCB_NULL |
| 301 | 432 | }; |
| 302 | 433 | |
| 434 | /************************************* | |
| 435 | * | |
| 436 | * Machine driver | |
| 437 | * | |
| 438 | *************************************/ | |
| 439 | ||
| 440 | static STATE_POSTLOAD( mjsister_redraw ) | |
| 441 | { | |
| 442 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 443 | ||
| 444 | /* we can skip saving tmpbitmaps because we can redraw them from vram */ | |
| 445 | state->screen_redraw = 1; | |
| 446 | } | |
| 447 | ||
| 448 | static MACHINE_START( mjsister ) | |
| 449 | { | |
| 450 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 451 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 452 | ||
| 453 | memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000); | |
| 454 | ||
| 455 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 456 | state->dac = devtag_get_device(machine, "dac"); | |
| 457 | ||
| 458 | state_save_register_global(machine, state->dac_busy); | |
| 459 | state_save_register_global(machine, state->flip_screen); | |
| 460 | state_save_register_global(machine, state->video_enable); | |
| 461 | state_save_register_global(machine, state->vrambank); | |
| 462 | state_save_register_global(machine, state->colorbank); | |
| 463 | state_save_register_global(machine, state->input_sel1); | |
| 464 | state_save_register_global(machine, state->input_sel2); | |
| 465 | state_save_register_global(machine, state->rombank0); | |
| 466 | state_save_register_global(machine, state->rombank1); | |
| 467 | state_save_register_global(machine, state->dac_adr); | |
| 468 | state_save_register_global(machine, state->dac_bank); | |
| 469 | state_save_register_global(machine, state->dac_adr_s); | |
| 470 | state_save_register_global(machine, state->dac_adr_e); | |
| 471 | state_save_register_postload(machine, mjsister_redraw, 0); | |
| 472 | } | |
| 473 | ||
| 474 | static MACHINE_RESET( mjsister ) | |
| 475 | { | |
| 476 | mjsister_state *state = (mjsister_state *)machine->driver_data; | |
| 477 | ||
| 478 | state->dac_busy = 0; | |
| 479 | state->flip_screen = 0; | |
| 480 | state->video_enable = 0; | |
| 481 | state->screen_redraw = 0; | |
| 482 | state->vrambank = 0; | |
| 483 | state->colorbank = 0; | |
| 484 | state->input_sel1 = 0; | |
| 485 | state->input_sel2 = 0; | |
| 486 | state->rombank0 = 0; | |
| 487 | state->rombank1 = 0; | |
| 488 | state->dac_adr = 0; | |
| 489 | state->dac_bank = 0; | |
| 490 | state->dac_adr_s = 0; | |
| 491 | state->dac_adr_e = 0; | |
| 492 | } | |
| 493 | ||
| 494 | ||
| 303 | 495 | static MACHINE_DRIVER_START( mjsister ) |
| 304 | 496 | |
| 497 | /* driver data */ | |
| 498 | MDRV_DRIVER_DATA(mjsister_state) | |
| 499 | ||
| 305 | 500 | /* basic machine hardware */ |
| 306 | 501 | MDRV_CPU_ADD("maincpu", Z80, MCLK/2) /* 6.000 MHz */ |
| 307 | 502 | MDRV_CPU_PROGRAM_MAP(mjsister_map) |
| 308 | 503 | MDRV_CPU_IO_MAP(mjsister_io_map) |
| 309 | 504 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 310 | 505 | |
| 506 | MDRV_MACHINE_START(mjsister) | |
| 311 | 507 | MDRV_MACHINE_RESET(mjsister) |
| 312 | 508 | |
| 313 | 509 | /* video hardware */ |
| r7500 | r7501 | |
| 335 | 531 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 336 | 532 | MACHINE_DRIVER_END |
| 337 | 533 | |
| 338 | /*************************************************************************** | |
| 534 | /************************************* | |
| 535 | * | |
| 536 | * ROM definition(s) | |
| 537 | * | |
| 538 | *************************************/ | |
| 339 | 539 | |
| 340 | Game driver(s) | |
| 341 | ||
| 342 | ***************************************************************************/ | |
| 343 | ||
| 344 | 540 | ROM_START( mjsister ) |
| 345 | 541 | ROM_REGION( 0x30000, "maincpu", 0 ) /* CPU */ |
| 346 | 542 | ROM_LOAD( "ms00.bin", 0x00000, 0x08000, CRC(9468c33b) SHA1(63aecdcaa8493d58549dfd1d217743210cf953bc) ) |
| r7500 | r7501 | |
| 358 | 554 | ROM_LOAD( "ms08.bpr", 0x0300, 0x0100, CRC(da2b3b38) SHA1(4de99c17b227653bc1b904f1309f447f5a0ab516) ) // ? |
| 359 | 555 | ROM_END |
| 360 | 556 | |
| 361 | GAME( 1986, mjsister, 0, mjsister, mjsister, 0, ROT0, "Toaplan", "Mahjong Sisters (Japan)", 0 ) | |
| 362 | 557 | |
| 558 | /************************************* | |
| 559 | * | |
| 560 | * Game driver(s) | |
| 561 | * | |
| 562 | *************************************/ | |
| 563 | ||
| 564 | GAME( 1986, mjsister, 0, mjsister, mjsister, 0, ROT0, "Toaplan", "Mahjong Sisters (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 44 | 44 | #include "sound/okim6295.h" |
| 45 | 45 | #include "sound/3812intf.h" |
| 46 | 46 | |
| 47 | static tilemap_t *fg_tilemap; | |
| 48 | static UINT8 *fgram; | |
| 47 | #define MASTER_CLOCK XTAL_4MHz | |
| 49 | 48 | |
| 50 | #define MASTER_CLOCK (XTAL_4MHz) | |
| 49 | class onetwo_state | |
| 50 | { | |
| 51 | public: | |
| 52 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, onetwo_state(machine)); } | |
| 51 | 53 | |
| 54 | onetwo_state(running_machine &machine) { } | |
| 55 | ||
| 56 | /* memory pointers */ | |
| 57 | UINT8 * fgram; | |
| 58 | UINT8 * paletteram; | |
| 59 | UINT8 * paletteram2; | |
| 60 | ||
| 61 | /* video-related */ | |
| 62 | tilemap_t *fg_tilemap; | |
| 63 | ||
| 64 | /* devices */ | |
| 65 | running_device *maincpu; | |
| 66 | running_device *audiocpu; | |
| 67 | }; | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | /************************************* | |
| 72 | * | |
| 73 | * Video emulation | |
| 74 | * | |
| 75 | *************************************/ | |
| 76 | ||
| 52 | 77 | static TILE_GET_INFO( get_fg_tile_info ) |
| 53 | 78 | { |
| 54 | int code = (fgram[tile_index*2+1]<<8) | fgram[tile_index*2]; | |
| 55 | int color = (fgram[tile_index*2+1] & 0x80) >> 7; | |
| 79 | onetwo_state *state = (onetwo_state *)machine->driver_data; | |
| 80 | int code = (state->fgram[tile_index * 2 + 1] << 8) | state->fgram[tile_index * 2]; | |
| 81 | int color = (state->fgram[tile_index * 2 + 1] & 0x80) >> 7; | |
| 56 | 82 | |
| 57 | 83 | code &= 0x7fff; |
| 58 | 84 | |
| 59 | 85 | SET_TILE_INFO(0, code, color, 0); |
| 60 | 86 | } |
| 61 | 87 | |
| 88 | static VIDEO_START( onetwo ) | |
| 89 | { | |
| 90 | onetwo_state *state = (onetwo_state *)machine->driver_data; | |
| 91 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 92 | } | |
| 93 | ||
| 94 | static VIDEO_UPDATE( onetwo ) | |
| 95 | { | |
| 96 | onetwo_state *state = (onetwo_state *)screen->machine->driver_data; | |
| 97 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 98 | return 0; | |
| 99 | } | |
| 100 | ||
| 101 | /************************************* | |
| 102 | * | |
| 103 | * Memory handlers | |
| 104 | * | |
| 105 | *************************************/ | |
| 106 | ||
| 62 | 107 | static WRITE8_HANDLER( onetwo_fgram_w ) |
| 63 | 108 | { |
| 64 | fgram[offset] = data; | |
| 65 | tilemap_mark_tile_dirty(fg_tilemap, offset / 2); | |
| 109 | onetwo_state *state = (onetwo_state *)space->machine->driver_data; | |
| 110 | state->fgram[offset] = data; | |
| 111 | tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2); | |
| 66 | 112 | } |
| 67 | 113 | |
| 68 | 114 | static WRITE8_HANDLER( onetwo_cpubank_w ) |
| 69 | 115 | { |
| 70 | UINT8 *RAM = memory_region(space->machine, "maincpu") + 0x10000; | |
| 71 | ||
| 72 | memory_set_bankptr(space->machine, "bank1", &RAM[data * 0x4000]); | |
| 116 | memory_set_bank(space->machine, "bank1", data); | |
| 73 | 117 | } |
| 74 | 118 | |
| 75 | 119 | static WRITE8_HANDLER( onetwo_coin_counters_w ) |
| 76 | 120 | { |
| 77 | 121 | watchdog_reset(space->machine); |
| 78 | coin_counter_w(space->machine, 0, data & 0x02); | |
| 79 | coin_counter_w(space->machine, 1, data & 0x04); | |
| 122 | coin_counter_w(space->machine, 0, BIT(data, 1)); | |
| 123 | coin_counter_w(space->machine, 1, BIT(data, 2)); | |
| 80 | 124 | } |
| 81 | 125 | |
| 82 | 126 | static WRITE8_HANDLER( onetwo_soundlatch_w ) |
| 83 | 127 | { |
| 128 | onetwo_state *state = (onetwo_state *)space->machine->driver_data; | |
| 84 | 129 | soundlatch_w(space, 0, data); |
| 85 | cpu | |
| 130 | cpu | |
| 86 | 131 | } |
| 87 | 132 | |
| 88 | static void set | |
| 133 | static void set_color(running_machine *machine, int offset) | |
| 89 | 134 | { |
| 90 | int r, g, b; | |
| 91 | r = machine->generic.paletteram.u8[offset] & 0x1f; | |
| 92 | g = machine->generic.paletteram2.u8[offset] & 0x1f; | |
| 93 | b = ((machine->generic.paletteram.u8[offset] & 0x60) >> 2) | ((machine->generic.paletteram2.u8[offset] & 0xe0) >> 5); | |
| 94 | palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 135 | onetwo_state *state = (onetwo_state *)machine->driver_data; | |
| 136 | int r, g, b; | |
| 137 | ||
| 138 | r = state->paletteram[offset] & 0x1f; | |
| 139 | g = state->paletteram2[offset] & 0x1f; | |
| 140 | b = ((state->paletteram[offset] & 0x60) >> 2) | ((state->paletteram2[offset] & 0xe0) >> 5); | |
| 141 | palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b)); | |
| 95 | 142 | } |
| 96 | 143 | |
| 97 | 144 | static WRITE8_HANDLER(palette1_w) |
| 98 | 145 | { |
| 99 | space->machine->generic.paletteram.u8[offset] = data; | |
| 100 | setColor(space->machine, offset); | |
| 146 | onetwo_state *state = (onetwo_state *)space->machine->driver_data; | |
| 147 | state->paletteram[offset] = data; | |
| 148 | set_color(space->machine, offset); | |
| 101 | 149 | } |
| 102 | 150 | |
| 103 | 151 | static WRITE8_HANDLER(palette2_w) |
| 104 | 152 | { |
| 105 | space->machine->generic.paletteram2.u8[offset] = data; | |
| 106 | setColor(space->machine, offset); | |
| 153 | onetwo_state *state = (onetwo_state *)space->machine->driver_data; | |
| 154 | state->paletteram2[offset] = data; | |
| 155 | set_color(space->machine, offset); | |
| 107 | 156 | } |
| 108 | 157 | |
| 109 | /* Main CPU */ | |
| 158 | /************************************* | |
| 159 | * | |
| 160 | * Address maps | |
| 161 | * | |
| 162 | *************************************/ | |
| 110 | 163 | |
| 111 | 164 | static ADDRESS_MAP_START( main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 112 | 165 | AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("maincpu", 0x10000) |
| 113 | 166 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 114 | AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_BASE_GENERIC(paletteram) | |
| 115 | AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_BASE_GENERIC(paletteram2) | |
| 116 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_BASE(&fgram) | |
| 167 | AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_BASE_MEMBER(onetwo_state, paletteram) | |
| 168 | AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_BASE_MEMBER(onetwo_state, paletteram2) | |
| 169 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_BASE_MEMBER(onetwo_state, fgram) | |
| 117 | 170 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 118 | 171 | ADDRESS_MAP_END |
| 119 | 172 | |
| r7500 | r7501 | |
| 126 | 179 | AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM") |
| 127 | 180 | ADDRESS_MAP_END |
| 128 | 181 | |
| 129 | /* Sound CPU */ | |
| 130 | ||
| 131 | 182 | static ADDRESS_MAP_START( sound_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 132 | 183 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 133 | 184 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| r7500 | r7501 | |
| 142 | 193 | AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_w) |
| 143 | 194 | ADDRESS_MAP_END |
| 144 | 195 | |
| 196 | /************************************* | |
| 197 | * | |
| 198 | * Input ports | |
| 199 | * | |
| 200 | *************************************/ | |
| 201 | ||
| 145 | 202 | static INPUT_PORTS_START( onetwo ) |
| 146 | 203 | PORT_START("DSW1") |
| 147 | 204 | PORT_DIPNAME( 0x03, 0x03, "Timer" ) PORT_DIPLOCATION("SW1:1,2") |
| r7500 | r7501 | |
| 240 | 297 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 241 | 298 | INPUT_PORTS_END |
| 242 | 299 | |
| 300 | /************************************* | |
| 301 | * | |
| 302 | * Graphics definitions | |
| 303 | * | |
| 304 | *************************************/ | |
| 305 | ||
| 243 | 306 | static const gfx_layout tiles8x8x6_layout = |
| 244 | 307 | { |
| 245 | 308 | 8,8, |
| r7500 | r7501 | |
| 255 | 318 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x6_layout, 0, 2 ) |
| 256 | 319 | GFXDECODE_END |
| 257 | 320 | |
| 258 | static VIDEO_START( onetwo ) | |
| 259 | { | |
| 260 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 261 | } | |
| 321 | /************************************* | |
| 322 | * | |
| 323 | * Sound interface | |
| 324 | * | |
| 325 | *************************************/ | |
| 262 | 326 | |
| 263 | static VIDEO_UPDATE( onetwo ) | |
| 264 | { | |
| 265 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 266 | return 0; | |
| 267 | } | |
| 268 | ||
| 269 | 327 | static void irqhandler(running_device *device, int linestate) |
| 270 | 328 | { |
| 271 | cputag_set_input_line(device->machine, "audiocpu", 0, linestate); | |
| 329 | onetwo_state *state = (onetwo_state *)device->machine->driver_data; | |
| 330 | cpu_set_input_line(state->audiocpu, 0, linestate); | |
| 272 | 331 | } |
| 273 | 332 | |
| 274 | 333 | static const ym3812_interface ym3812_config = |
| r7500 | r7501 | |
| 276 | 335 | irqhandler /* IRQ Line */ |
| 277 | 336 | }; |
| 278 | 337 | |
| 338 | /************************************* | |
| 339 | * | |
| 340 | * Machine driver | |
| 341 | * | |
| 342 | *************************************/ | |
| 343 | ||
| 344 | static MACHINE_START( onetwo ) | |
| 345 | { | |
| 346 | onetwo_state *state = (onetwo_state *)machine->driver_data; | |
| 347 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 348 | ||
| 349 | memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000); | |
| 350 | ||
| 351 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 352 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 353 | } | |
| 354 | ||
| 279 | 355 | static MACHINE_DRIVER_START( onetwo ) |
| 356 | ||
| 357 | /* driver data */ | |
| 358 | MDRV_DRIVER_DATA(onetwo_state) | |
| 359 | ||
| 280 | 360 | /* basic machine hardware */ |
| 281 | 361 | MDRV_CPU_ADD("maincpu", Z80,MASTER_CLOCK) /* 4 MHz */ |
| 282 | 362 | MDRV_CPU_PROGRAM_MAP(main_cpu) |
| r7500 | r7501 | |
| 287 | 367 | MDRV_CPU_PROGRAM_MAP(sound_cpu) |
| 288 | 368 | MDRV_CPU_IO_MAP(sound_cpu_io) |
| 289 | 369 | |
| 370 | MDRV_MACHINE_START(onetwo) | |
| 371 | ||
| 290 | 372 | /* video hardware */ |
| 291 | 373 | MDRV_SCREEN_ADD("screen", RASTER) |
| 292 | 374 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 313 | 395 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 314 | 396 | MACHINE_DRIVER_END |
| 315 | 397 | |
| 398 | /************************************* | |
| 399 | * | |
| 400 | * ROM definition(s) | |
| 401 | * | |
| 402 | *************************************/ | |
| 403 | ||
| 316 | 404 | ROM_START( onetwo ) |
| 317 | 405 | ROM_REGION( 0x30000, "maincpu", 0 ) /* main z80 */ |
| 318 | 406 | ROM_LOAD( "maincpu", 0x10000, 0x20000, CRC(83431e6e) SHA1(61ab386a1d0af050f091f5df28c55ad5ad1a0d4b) ) |
| r7500 | r7501 | |
| 345 | 433 | ROM_LOAD( "sample", 0x000000, 0x40000, CRC(b10d3132) SHA1(42613e17b6a1300063b8355596a2dc7bcd903777) ) |
| 346 | 434 | ROM_END |
| 347 | 435 | |
| 348 | GAME( 1997, onetwo, 0, onetwo, onetwo, 0, ROT0, "Barko", "One + Two", 0 ) | |
| 349 | GAME( 1997, onetwoe, onetwo, onetwo, onetwo, 0, ROT0, "Barko", "One + Two (earlier)", 0 ) | |
| 436 | /************************************* | |
| 437 | * | |
| 438 | * Game driver(s) | |
| 439 | * | |
| 440 | *************************************/ | |
| 441 | ||
| 442 | GAME( 1997, onetwo, 0, onetwo, onetwo, 0, ROT0, "Barko", "One + Two", GAME_SUPPORTS_SAVE ) | |
| 443 | GAME( 1997, onetwoe, onetwo, onetwo, onetwo, 0, ROT0, "Barko", "One + Two (earlier)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 35 | 35 | return ROM[offset]; |
| 36 | 36 | |
| 37 | 37 | /* Else the handler falls through to read the usual address */ |
| 38 | if (offset<0x400) return state->colorram[offset]; | |
| 39 | if (offset<0x800) return state->videoram[offset-0x400]; | |
| 40 | if (offset<0x1000) return space->machine->generic.spriteram.u8[offset-0x800]; | |
| 41 | if (offset<0x2200) { logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(space->cpu),offset); return 0; } | |
| 42 | if (offset<0x2800) return state->scratchram[offset-0x2200]; | |
| 38 | if (offset < 0x400) | |
| 39 | return state->colorram[offset]; | |
| 40 | if (offset < 0x800) | |
| 41 | return state->videoram[offset - 0x400]; | |
| 42 | if (offset < 0x1000) | |
| 43 | return state->spriteram[offset - 0x800]; | |
| 44 | if (offset < 0x2200) | |
| 45 | { | |
| 46 | logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(space->cpu), offset); | |
| 47 | return 0; | |
| 48 | } | |
| 49 | if (offset < 0x2800) | |
| 50 | return state->scratchram[offset - 0x2200]; | |
| 43 | 51 | |
| 44 | logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(space->cpu),offset); | |
| 52 | logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(space->cpu), offset); | |
| 45 | 53 | return 0; |
| 46 | 54 | } |
| 47 | 55 | |
| 48 | 56 | static READ8_HANDLER( deco16_io_r ) |
| 49 | 57 | { |
| 50 | if (offset==0) return input_port_read(space->machine, "IN1"); /* Player 1 controls */ | |
| 51 | if (offset==1) return input_port_read(space->machine, "IN2"); /* Player 2 controls */ | |
| 52 | if (offset==2) return input_port_read(space->machine, "IN3"); /* Vblank, coins */ | |
| 53 | if (offset==3) return input_port_read(space->machine, "DSW1"); /* Dip 1 */ | |
| 54 | if (offset==4) return input_port_read(space->machine, "DSW2"); /* Dip 2 */ | |
| 58 | if (offset == 0) return input_port_read(space->machine, "IN1"); /* Player 1 controls */ | |
| 59 | if (offset == 1) return input_port_read(space->machine, "IN2"); /* Player 2 controls */ | |
| 60 | if (offset == 2) return input_port_read(space->machine, "IN3"); /* Vblank, coins */ | |
| 61 | if (offset == 3) return input_port_read(space->machine, "DSW1"); /* Dip 1 */ | |
| 62 | if (offset == 4) return input_port_read(space->machine, "DSW2"); /* Dip 2 */ | |
| 55 | 63 | |
| 56 | logerror("%04x: Read input %d\n",cpu_get_pc(space->cpu),offset); | |
| 64 | logerror("%04x: Read input %d\n", cpu_get_pc(space->cpu), offset); | |
| 57 | 65 | return 0xff; |
| 58 | 66 | } |
| 59 | 67 | |
| r7500 | r7501 | |
| 63 | 71 | state->bank = data; |
| 64 | 72 | |
| 65 | 73 | if (state->bank) |
| 66 | memory_install_read8_handler(cpu | |
| 74 | memory_install_read8_handler(cpu | |
| 67 | 75 | else |
| 68 | memory_install_read_bank(cpu | |
| 76 | memory_install_read_bank(cpu | |
| 69 | 77 | } |
| 70 | 78 | |
| 71 | 79 | static READ8_HANDLER( prosoccr_bank_r ) |
| r7500 | r7501 | |
| 78 | 86 | return ROM[offset]; |
| 79 | 87 | |
| 80 | 88 | /* Else the handler falls through to read the usual address */ |
| 81 | if (offset<0x400) return state->colorram[offset]; | |
| 82 | if (offset<0x800) return state->videoram[offset-0x400]; | |
| 83 | if (offset<0xc00) return state->colorram[offset-0x800]; | |
| 84 | if (offset<0x1000) return space->machine->generic.spriteram.u8[offset-0xc00]; | |
| 85 | if (offset<0x2200) { logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(space->cpu),offset); return 0; } | |
| 86 | if (offset<0x2800) return state->scratchram[offset-0x2200]; | |
| 89 | if (offset < 0x400) | |
| 90 | return state->colorram[offset]; | |
| 91 | if (offset < 0x800) | |
| 92 | return state->videoram[offset - 0x400]; | |
| 93 | if (offset < 0xc00) | |
| 94 | return state->colorram[offset - 0x800]; | |
| 95 | if (offset < 0x1000) | |
| 96 | return state->spriteram[offset - 0xc00]; | |
| 97 | if (offset < 0x2200) | |
| 98 | { | |
| 99 | logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(space->cpu), offset); | |
| 100 | return 0; | |
| 101 | } | |
| 102 | if (offset < 0x2800) | |
| 103 | return state->scratchram[offset - 0x2200]; | |
| 87 | 104 | |
| 88 | logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(space->cpu),offset); | |
| 105 | logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(space->cpu), offset); | |
| 89 | 106 | return 0; |
| 90 | 107 | } |
| 91 | 108 | |
| r7500 | r7501 | |
| 96 | 113 | |
| 97 | 114 | if (state->gfx_rom_readback) |
| 98 | 115 | { |
| 99 | switch(offset & 0x1800) | |
| 116 | switch (offset & 0x1800) | |
| 100 | 117 | { |
| 101 | 118 | case 0x0000: |
| 102 | return SRC_GFX[(offset & 0x7ff)+(0x0000)+0x0000]; | |
| 119 | return SRC_GFX[(offset & 0x7ff) + (0x0000) + 0x0000]; | |
| 103 | 120 | case 0x0800: |
| 104 | return SRC_GFX[(offset & 0x7ff)+(0x0000)+0x2000]; | |
| 121 | return SRC_GFX[(offset & 0x7ff) + (0x0000) + 0x2000]; | |
| 105 | 122 | case 0x1000: |
| 106 | return SRC_GFX[(offset & 0x7ff)+(0x0000)+0x4000]; | |
| 123 | return SRC_GFX[(offset & 0x7ff) + (0x0000) + 0x4000]; | |
| 107 | 124 | } |
| 108 | 125 | } |
| 109 | 126 | |
| 110 | 127 | /* note: gfx_rom_readback == 1 never happens. */ |
| 111 | return state->charram[offset+state->gfx_rom_readback*0x1800]; | |
| 128 | return state->charram[offset + state->gfx_rom_readback * 0x1800]; | |
| 112 | 129 | } |
| 113 | 130 | |
| 114 | 131 | static WRITE8_HANDLER( prosoccr_charram_w ) |
| r7500 | r7501 | |
| 118 | 135 | |
| 119 | 136 | if (state->bank) |
| 120 | 137 | { |
| 121 | prosoccr_io_w(space,offset & 0xf,data); | |
| 138 | prosoccr_io_w(space, offset & 0x0f, data); | |
| 122 | 139 | } |
| 123 | 140 | else |
| 124 | 141 | { |
| 125 | 142 | /* note: gfx_rom_readback == 1 never happens. */ |
| 126 | state->charram[offset+state->gfx_rom_readback*0x1800] = data; | |
| 143 | state->charram[offset + state->gfx_rom_readback * 0x1800] = data; | |
| 127 | 144 | |
| 128 | switch(offset & 0x1800) | |
| 145 | switch (offset & 0x1800) | |
| 129 | 146 | { |
| 130 | 147 | case 0x0000: |
| 131 | FG_GFX[(offset & 0x7ff)+(0x0000)+0x0000] = data; | |
| 132 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x0000] = data; | |
| 148 | FG_GFX[(offset & 0x7ff) + (0x0000) + 0x0000] = data; | |
| 149 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x0000] = data; | |
| 133 | 150 | break; |
| 134 | 151 | case 0x0800: |
| 135 | FG_GFX[(offset & 0x7ff)+(0x0000)+0x2000] = data; | |
| 136 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x2000] = data; | |
| 152 | FG_GFX[(offset & 0x7ff) + (0x0000) + 0x2000] = data; | |
| 153 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x2000] = data; | |
| 137 | 154 | break; |
| 138 | 155 | case 0x1000: |
| 139 | FG_GFX[(offset & 0x7ff)+(0x0000)+0x4000] = data; | |
| 140 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x4000] = data; | |
| 156 | FG_GFX[(offset & 0x7ff) + (0x0000) + 0x4000] = data; | |
| 157 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x4000] = data; | |
| 141 | 158 | break; |
| 142 | 159 | } |
| 143 | 160 | } |
| 144 | 161 | |
| 145 | offset&=0x7ff; | |
| 162 | offset &= 0x7ff; | |
| 146 | 163 | |
| 147 | 164 | /* dirty char */ |
| 148 | 165 | gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3); |
| 149 | // gfx_element_mark_dirty(space->machine->gfx[0], (offset|0x1800) >> 3); | |
| 166 | // gfx_element_mark_dirty(space->machine->gfx[0], (offset | 0x1800) >> 3); | |
| 150 | 167 | } |
| 151 | 168 | |
| 152 | 169 | static WRITE8_HANDLER( prosoccr_char_bank_w ) |
| 153 | 170 | { |
| 154 | 171 | liberate_state *state = (liberate_state *)space->machine->driver_data; |
| 155 | 172 | state->gfx_rom_readback = data & 1; //enable GFX rom read-back |
| 156 | if(data & 0xfe) | |
| 157 | printf("%02x\n",data); | |
| 173 | ||
| 174 | if (data & 0xfe) | |
| 175 | printf("%02x\n", data); | |
| 158 | 176 | } |
| 159 | 177 | |
| 160 | 178 | static WRITE8_HANDLER( prosoccr_io_bank_w ) |
| r7500 | r7501 | |
| 163 | 181 | state->bank = data & 1; |
| 164 | 182 | |
| 165 | 183 | if (state->bank) |
| 166 | memory_install_read8_handler(cpu | |
| 184 | memory_install_read8_handler(cpu | |
| 167 | 185 | else |
| 168 | memory_install_read8_handler(cpu | |
| 186 | memory_install_read8_handler(cpu | |
| 169 | 187 | |
| 170 | 188 | } |
| 171 | 189 | |
| r7500 | r7501 | |
| 173 | 191 | { |
| 174 | 192 | UINT8 *FG_GFX = memory_region(space->machine, "progolf_fg_gfx"); |
| 175 | 193 | |
| 176 | switch(offset & 0x1800) | |
| 194 | switch (offset & 0x1800) | |
| 177 | 195 | { |
| 178 | 196 | case 0x0000: |
| 179 | return FG_GFX[(offset & 0x7ff)+(0x0800)+0x0000]; | |
| 180 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x0000] = data; | |
| 197 | return FG_GFX[(offset & 0x7ff) + (0x0800) + 0x0000]; | |
| 198 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x0000] = data; | |
| 181 | 199 | case 0x0800: |
| 182 | return FG_GFX[(offset & 0x7ff)+(0x0800)+0x2000]; | |
| 183 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x2000] = data; | |
| 200 | return FG_GFX[(offset & 0x7ff) + (0x0800) + 0x2000]; | |
| 201 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x2000] = data; | |
| 184 | 202 | case 0x1000: |
| 185 | return FG_GFX[(offset & 0x7ff)+(0x0800)+0x4000]; | |
| 186 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x4000] = data; | |
| 203 | return FG_GFX[(offset & 0x7ff) + (0x0800) + 0x4000]; | |
| 204 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x4000] = data; | |
| 187 | 205 | } |
| 188 | 206 | |
| 189 | 207 | return 0; |
| r7500 | r7501 | |
| 193 | 211 | { |
| 194 | 212 | UINT8 *FG_GFX = memory_region(space->machine, "progolf_fg_gfx"); |
| 195 | 213 | |
| 196 | switch(offset & 0x1800) | |
| 214 | switch (offset & 0x1800) | |
| 197 | 215 | { |
| 198 | 216 | case 0x0000: |
| 199 | FG_GFX[(offset & 0x7ff)+(0x0800)+0x0000] = data; | |
| 200 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x0000] = data; | |
| 217 | FG_GFX[(offset & 0x7ff) + (0x0800) + 0x0000] = data; | |
| 218 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x0000] = data; | |
| 201 | 219 | break; |
| 202 | 220 | case 0x0800: |
| 203 | FG_GFX[(offset & 0x7ff)+(0x0800)+0x2000] = data; | |
| 204 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x2000] = data; | |
| 221 | FG_GFX[(offset & 0x7ff) + (0x0800) + 0x2000] = data; | |
| 222 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x2000] = data; | |
| 205 | 223 | break; |
| 206 | 224 | case 0x1000: |
| 207 | FG_GFX[(offset & 0x7ff)+(0x0800)+0x4000] = data; | |
| 208 | //FG_GFX[(offset & 0x7ff)+(0x1800)+0x4000] = data; | |
| 225 | FG_GFX[(offset & 0x7ff) + (0x0800) + 0x4000] = data; | |
| 226 | //FG_GFX[(offset & 0x7ff) + (0x1800) + 0x4000] = data; | |
| 209 | 227 | break; |
| 210 | 228 | } |
| 211 | 229 | |
| 212 | offset&=0x7ff; | |
| 230 | offset &= 0x7ff; | |
| 213 | 231 | |
| 214 | 232 | /* dirty char */ |
| 215 | gfx_element_mark_dirty(space->machine->gfx[3], (offset+0x800) >> 3); | |
| 216 | gfx_element_mark_dirty(space->machine->gfx[3+4], (offset+0x800) >> 5); | |
| 233 | gfx_element_mark_dirty(space->machine->gfx[3], (offset + 0x800) >> 3); | |
| 234 | gfx_element_mark_dirty(space->machine->gfx[3 + 4], (offset + 0x800) >> 5); | |
| 217 | 235 | } |
| 218 | 236 | |
| 219 | 237 | |
| r7500 | r7501 | |
| 224 | 242 | *************************************/ |
| 225 | 243 | |
| 226 | 244 | static ADDRESS_MAP_START( prosport_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 227 | AM_RANGE(0x0200, 0x021f) AM_RAM_WRITE(prosport_paletteram_w) AM_BASE_ | |
| 245 | AM_RANGE(0x0200, 0x021f) AM_RAM_WRITE(prosport_paletteram_w) AM_BASE_MEMBER | |
| 228 | 246 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x2000) AM_RAM |
| 229 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(prosport_bg_vram_w) AM_BASE_MEMBER(liberate_state,bg_vram) | |
| 247 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(prosport_bg_vram_w) AM_BASE_MEMBER(liberate_state, bg_vram) | |
| 230 | 248 | AM_RANGE(0x0800, 0x1fff) AM_READWRITE(prosport_charram_r,prosport_charram_w) //0x1e00-0x1fff isn't charram! |
| 231 | 249 | AM_RANGE(0x2400, 0x2fff) AM_RAM |
| 232 | AM_RANGE(0x3000, 0x33ff) AM_RAM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state,colorram) | |
| 233 | AM_RANGE(0x3400, 0x37ff) AM_RAM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state,videoram) | |
| 234 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE_GENERIC(spriteram) | |
| 250 | AM_RANGE(0x3000, 0x33ff) AM_RAM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state, colorram) | |
| 251 | AM_RANGE(0x3400, 0x37ff) AM_RAM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state, videoram) | |
| 252 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE_MEMBER(liberate_state, spriteram) | |
| 235 | 253 | AM_RANGE(0x8000, 0x800f) AM_WRITE(prosport_io_w) |
| 236 | 254 | AM_RANGE(0x8000, 0x800f) AM_ROMBANK("bank1") |
| 237 | 255 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| r7500 | r7501 | |
| 241 | 259 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 242 | 260 | AM_RANGE(0x1000, 0x3fff) AM_ROM /* Mirror of main rom */ |
| 243 | 261 | AM_RANGE(0x4000, 0x7fff) AM_READ(deco16_bank_r) |
| 244 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state,colorram) | |
| 245 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state,videoram) | |
| 246 | AM_RANGE(0x4800, 0x4fff) AM_WRITEONLY AM_BASE_GENERIC(spriteram) | |
| 247 | AM_RANGE(0x6200, 0x67ff) AM_RAM AM_BASE_MEMBER(liberate_state,scratchram) | |
| 262 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state, colorram) | |
| 263 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state, videoram) | |
| 264 | AM_RANGE(0x4800, 0x4fff) AM_WRITEONLY AM_BASE_MEMBER(liberate_state, spriteram) | |
| 265 | AM_RANGE(0x6200, 0x67ff) AM_RAM AM_BASE_MEMBER(liberate_state, scratchram) | |
| 248 | 266 | AM_RANGE(0x8000, 0x800f) AM_WRITE(deco16_io_w) |
| 249 | 267 | AM_RANGE(0x8000, 0x800f) AM_ROMBANK("bank1") |
| 250 | 268 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r7500 | r7501 | |
| 254 | 272 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 255 | 273 | AM_RANGE(0x1000, 0x3fff) AM_ROM /* Mirror of main rom */ |
| 256 | 274 | AM_RANGE(0x4000, 0x7fff) AM_READ(prosoccr_bank_r) |
| 257 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x800) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state,colorram) | |
| 258 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state,videoram) | |
| 259 | AM_RANGE(0x4c00, 0x4fff) AM_WRITEONLY AM_BASE_GENERIC(spriteram) | |
| 260 | AM_RANGE(0x6200, 0x67ff) AM_RAM AM_BASE_MEMBER(liberate_state,scratchram) | |
| 261 | AM_RANGE(0x8000, 0x97ff) AM_READWRITE(prosoccr_charram_r,prosoccr_charram_w) | |
| 275 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x800) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state, colorram) | |
| 276 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state, videoram) | |
| 277 | AM_RANGE(0x4c00, 0x4fff) AM_WRITEONLY AM_BASE_MEMBER(liberate_state, spriteram) | |
| 278 | AM_RANGE(0x6200, 0x67ff) AM_RAM AM_BASE_MEMBER(liberate_state, scratchram) | |
| 279 | AM_RANGE(0x8000, 0x97ff) AM_READWRITE(prosoccr_charram_r, prosoccr_charram_w) | |
| 262 | 280 | AM_RANGE(0x9800, 0x9800) AM_WRITE(prosoccr_char_bank_w) |
| 263 | 281 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 264 | 282 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 278 | 296 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 279 | 297 | AM_RANGE(0x1000, 0x3fff) AM_ROM /* Mirror of main rom */ |
| 280 | 298 | AM_RANGE(0x4000, 0x7fff) AM_READ(deco16_bank_r) |
| 281 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state,colorram) | |
| 282 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state,videoram) | |
| 283 | AM_RANGE(0x4800, 0x4fff) AM_WRITEONLY AM_BASE_GENERIC(spriteram) | |
| 284 | AM_RANGE(0x6200, 0x67ff) AM_WRITEONLY AM_BASE_MEMBER(liberate_state,scratchram) | |
| 299 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(liberate_colorram_w) AM_BASE_MEMBER(liberate_state, colorram) | |
| 300 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(liberate_videoram_w) AM_BASE_MEMBER(liberate_state, videoram) | |
| 301 | AM_RANGE(0x4800, 0x4fff) AM_WRITEONLY AM_BASE_MEMBER(liberate_state, spriteram) | |
| 302 | AM_RANGE(0x6200, 0x67ff) AM_WRITEONLY AM_BASE_MEMBER(liberate_state, scratchram) | |
| 285 | 303 | AM_RANGE(0xf000, 0xf00f) AM_WRITE(deco16_io_w) |
| 286 | 304 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN1") |
| 287 | 305 | AM_RANGE(0xf001, 0xf001) AM_READ_PORT("IN2") |
| r7500 | r7501 | |
| 761 | 779 | else |
| 762 | 780 | { |
| 763 | 781 | if (!(p & 0x43)) |
| 764 | state->latch=0; | |
| 782 | state->latch = 0; | |
| 765 | 783 | } |
| 766 | 784 | } |
| 767 | 785 | |
| r7500 | r7501 | |
| 779 | 797 | * |
| 780 | 798 | *************************************/ |
| 781 | 799 | |
| 800 | static MACHINE_START( liberate ) | |
| 801 | { | |
| 802 | liberate_state *state = (liberate_state *)machine->driver_data; | |
| 803 | ||
| 804 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 805 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 806 | ||
| 807 | state_save_register_global(machine, state->background_disable); | |
| 808 | state_save_register_global(machine, state->background_color); | |
| 809 | state_save_register_global(machine, state->gfx_rom_readback); | |
| 810 | state_save_register_global(machine, state->latch); | |
| 811 | state_save_register_global(machine, state->bank); | |
| 812 | ||
| 813 | state_save_register_global_array(machine, state->io_ram); | |
| 814 | } | |
| 815 | ||
| 816 | static MACHINE_RESET( liberate ) | |
| 817 | { | |
| 818 | liberate_state *state = (liberate_state *)machine->driver_data; | |
| 819 | ||
| 820 | memset(state->io_ram, 0, ARRAY_LENGTH(state->io_ram)); | |
| 821 | ||
| 822 | state->background_disable = 0; | |
| 823 | state->background_color = 0; | |
| 824 | state->gfx_rom_readback = 0; | |
| 825 | state->latch = 0; | |
| 826 | state->bank = 0; | |
| 827 | } | |
| 828 | ||
| 782 | 829 | static MACHINE_DRIVER_START( liberate ) |
| 783 | 830 | |
| 784 | 831 | MDRV_DRIVER_DATA(liberate_state) |
| r7500 | r7501 | |
| 795 | 842 | |
| 796 | 843 | MDRV_QUANTUM_TIME(HZ(12000)) |
| 797 | 844 | |
| 845 | MDRV_MACHINE_START(liberate) | |
| 846 | MDRV_MACHINE_RESET(liberate) | |
| 847 | ||
| 798 | 848 | /* video hardware */ |
| 799 | 849 | MDRV_SCREEN_ADD("screen", RASTER) |
| 800 | 850 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 879 | 929 | |
| 880 | 930 | // MDRV_QUANTUM_TIME(HZ(12000)) |
| 881 | 931 | |
| 932 | MDRV_MACHINE_START(liberate) | |
| 933 | MDRV_MACHINE_RESET(liberate) | |
| 934 | ||
| 882 | 935 | /* video hardware */ |
| 883 | 936 | MDRV_SCREEN_ADD("screen", RASTER) |
| 884 | 937 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 1319 | 1372 | int i; |
| 1320 | 1373 | |
| 1321 | 1374 | /* Bit swapping on sound cpu - Opcodes only */ |
| 1322 | for (i=0xc000; i<0x10000; i++) | |
| 1323 | decrypted[i-0xc000]=((rom[i] & 0x20) << 1) | ((rom[i] & 0x40) >> 1) | (rom[i] & 0x9f); | |
| 1375 | for (i = 0xc000; i < 0x10000; i++) | |
| 1376 | decrypted[i - 0xc000] = ((rom[i] & 0x20) << 1) | ((rom[i] & 0x40) >> 1) | (rom[i] & 0x9f); | |
| 1324 | 1377 | |
| 1325 | 1378 | memory_set_decrypted_region(space, 0xc000, 0xffff, decrypted); |
| 1326 | 1379 | } |
| r7500 | r7501 | |
| 1331 | 1384 | int i; |
| 1332 | 1385 | |
| 1333 | 1386 | /* Main cpu has the nibbles swapped */ |
| 1334 | for (i=0; i<0x10000; i++) | |
| 1335 | RAM[i]=((RAM[i] & 0x0f) << 4) | ((RAM[i] & 0xf0) >> 4); | |
| 1387 | for (i = 0; i < 0x10000; i++) | |
| 1388 | RAM[i] = ((RAM[i] & 0x0f) << 4) | ((RAM[i] & 0xf0) >> 4); | |
| 1336 | 1389 | |
| 1337 | 1390 | sound_cpu_decrypt(machine); |
| 1338 | 1391 | } |
| r7500 | r7501 | |
| 1354 | 1407 | memory_set_decrypted_region(space, 0x0000, 0xffff, decrypted); |
| 1355 | 1408 | |
| 1356 | 1409 | /* Swap bits for opcodes only, not data */ |
| 1357 | for (A = 0;A < 0x10000;A++) { | |
| 1410 | for (A = 0; A < 0x10000; A++) { | |
| 1358 | 1411 | decrypted[A] = (ROM[A] & 0xd7) | ((ROM[A] & 0x08) << 2) | ((ROM[A] & 0x20) >> 2); |
| 1359 | 1412 | decrypted[A] = (decrypted[A] & 0xbb) | ((decrypted[A] & 0x04) << 4) | ((decrypted[A] & 0x40) >> 4); |
| 1360 | 1413 | decrypted[A] = (decrypted[A] & 0x7d) | ((decrypted[A] & 0x02) << 6) | ((decrypted[A] & 0x80) >> 6); |
| r7500 | r7501 | |
| 1371 | 1424 | * |
| 1372 | 1425 | *************************************/ |
| 1373 | 1426 | |
| 1374 | GAME( 1983, prosoccr, 0, prosoccr, prosoccr, prosport, ROT270, "Data East Corporation", "Pro Soccer", 0 ) | |
| 1375 | GAME( 1983, prosport, 0, prosport, prosport, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1376 | GAME( 1983, prosporta, prosport, prosport, prosport, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1377 | GAME( 1983, boomrang, 0, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 ) | |
| 1378 | GAME( 1983, boomranga, boomrang, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 ) | |
| 1379 | GAME( 1984, kamikcab, 0, boomrang, kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 ) | |
| 1380 | GAME( 1984, yellowcbj, kamikcab, boomrang, yellowcb, yellowcb, ROT270, "Data East Corporation", "Yellow Cab (Japan)", 0 ) | |
| 1381 | GAME( 1984, yellowcbb, kamikcab, boomrang, yellowcb, yellowcb, ROT270, "bootleg", "Yellow Cab (bootleg)", 0 ) | |
| 1382 | GAME( 1984, liberate, 0, liberate, liberate, liberate, ROT270, "Data East Corporation", "Liberation", 0 ) | |
| 1383 | GAME( 1984, dualaslt, liberate, liberate, dualaslt, liberate, ROT270, "Data East USA", "Dual Assault", 0 ) | |
| 1384 | GAME( 1984, liberateb, liberate, liberatb, liberatb, prosport, ROT270, "bootleg", "Liberation (bootleg)", 0 ) | |
| 1427 | GAME( 1983, prosoccr, 0, prosoccr, prosoccr, prosport, ROT270, "Data East Corporation", "Pro Soccer", GAME_SUPPORTS_SAVE ) | |
| 1428 | GAME( 1983, prosport, 0, prosport, prosport, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1429 | GAME( 1983, prosporta, prosport, prosport, prosport, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1430 | GAME( 1983, boomrang, 0, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", GAME_SUPPORTS_SAVE ) | |
| 1431 | GAME( 1983, boomranga, boomrang, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", GAME_SUPPORTS_SAVE ) | |
| 1432 | GAME( 1984, kamikcab, 0, boomrang, kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", GAME_SUPPORTS_SAVE ) | |
| 1433 | GAME( 1984, yellowcbj, kamikcab, boomrang, yellowcb, yellowcb, ROT270, "Data East Corporation", "Yellow Cab (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1434 | GAME( 1984, yellowcbb, kamikcab, boomrang, yellowcb, yellowcb, ROT270, "bootleg", "Yellow Cab (bootleg)", GAME_SUPPORTS_SAVE ) | |
| 1435 | GAME( 1984, liberate, 0, liberate, liberate, liberate, ROT270, "Data East Corporation", "Liberation", GAME_SUPPORTS_SAVE ) | |
| 1436 | GAME( 1984, dualaslt, liberate, liberate, dualaslt, liberate, ROT270, "Data East USA", "Dual Assault", GAME_SUPPORTS_SAVE ) | |
| 1437 | GAME( 1984, liberateb, liberate, liberatb, liberatb, prosport, ROT270, "bootleg", "Liberation (bootleg)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 2227 | 2227 | ROM_LOAD( "mpr-23508.ic5", 0x4800000, 0x1000000, CRC(0a3590aa) SHA1(84c0e1853f069b003d09b268caee97e58c4dacb6) ) |
| 2228 | 2228 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) |
| 2229 | 2229 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) |
| 2230 | ||
| 2231 | // trojaned protection data (filename is address read from) | |
| 2232 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2233 | ROM_LOAD( "a63a9260.bin", 0x000000, 0x008760, CRC(54efa963) SHA1(41874253567da56441d83de041f6e82111977fa4) ) | |
| 2234 | ROM_LOAD( "a63b19c0.bin", 0x010000, 0x008260, CRC(f0ca72ef) SHA1(87fc4654afaf763cdb3ea5b4501948bfe7b9e9dc) ) | |
| 2235 | ROM_LOAD( "a63b9c20.bin", 0x020000, 0x00a0c0, CRC(92eec22c) SHA1(c7267503a828e852edeb26f68f3f4b685b9b163e) ) | |
| 2236 | ROM_LOAD( "a63c3ce0.bin", 0x030000, 0x00d7e0, CRC(93201f32) SHA1(5aca43776306a5a5ecd68a7e8699a724703f329a) ) | |
| 2237 | ROM_LOAD( "a63d14c0.bin", 0x040000, 0x00a8e0, CRC(fb2e9f7b) SHA1(ae4fc9a82eafb5b511485eef1d65ee9d3adc27b6) ) | |
| 2238 | ROM_LOAD( "a63dbda0.bin", 0x050000, 0x008460, CRC(b4b74624) SHA1(6ae2f5d69e45d295a3d0dcf295b1fb76be201e8e) ) | |
| 2239 | ROM_LOAD( "a63e4200.bin", 0x060000, 0x00b500, CRC(69ee516d) SHA1(f358aff12b826d1685199a9d5950abd121b54192) ) | |
| 2240 | ROM_LOAD( "a63ef700.bin", 0x070000, 0x00cec0, CRC(b2f4df7e) SHA1(4aafcf65e3fc193ee191f06ffcce37e52fc12364) ) | |
| 2241 | ROM_LOAD( "a63fc5c0.bin", 0x080000, 0x004cfc, CRC(1d534f98) SHA1(32afbb1d1fd1abba9e49b7b4bcf310860e4e47dc) ) | |
| 2242 | ROM_LOAD( "a643a120.bin", 0x090000, 0x00d6e0, CRC(27a0deb7) SHA1(c8da2e212ca8f5985d9336e8200c3382d6d373a5) ) | |
| 2243 | ROM_LOAD( "a6447800.bin", 0x0a0000, 0x00c920, CRC(42c9e4b1) SHA1(d7ef0d23956b795fad888f49a4dc42d74899de71) ) | |
| 2244 | ROM_LOAD( "a6454120.bin", 0x0b0000, 0x00a540, CRC(69321860) SHA1(675767e9fd18a0d72de2decb68acd7d500b11de2) ) | |
| 2245 | ROM_LOAD( "a645e660.bin", 0x0c0000, 0x00ccc0, CRC(4919083d) SHA1(89dfc2837e5298dc691350ac470bc76557657736) ) | |
| 2246 | ROM_LOAD( "a646b320.bin", 0x0d0000, 0x00c120, CRC(a66da245) SHA1(48d543244cdc52887131e734e0643c69f9368681) ) | |
| 2247 | ROM_LOAD( "a6477440.bin", 0x0e0000, 0x0097a8, CRC(6289f812) SHA1(574459f7c79dd757ae94f8e06dbcefa5b203e510) ) | |
| 2248 | ROM_LOAD( "a6480c00.bin", 0x0f0000, 0x00eca0, CRC(a4128a65) SHA1(35625df0109a72cb508bb4a89641bcb86aa697fb) ) | |
| 2249 | ROM_LOAD( "a648f8a0.bin", 0x100000, 0x009520, CRC(45a06ed6) SHA1(e9ee99e329cf35a95440312b9d0bed40254481c2) ) | |
| 2250 | ROM_LOAD( "a6498dc0.bin", 0x110000, 0x009f40, CRC(2cea7b46) SHA1(5398b8f1ba01e21d5fee0b1c6a796ce396c9697f) ) | |
| 2251 | ROM_LOAD( "a64a2d00.bin", 0x120000, 0x00dbe0, CRC(9c75fc98) SHA1(aa1a630c77b29202a4045b1eade455f02f29b81a) ) | |
| 2252 | ROM_LOAD( "a64b08e0.bin", 0x130000, 0x00cb40, CRC(72ae0dd2) SHA1(f4e8face14dac9a5cc75c6ccdfb9911929e2d76e) ) | |
| 2253 | ROM_LOAD( "a64bd420.bin", 0x140000, 0x00e920, CRC(198e4aa9) SHA1(294b9c3f89b138898c3ef6db60ac5473516d74dc) ) | |
| 2254 | ROM_LOAD( "a64cbd40.bin", 0x150000, 0x005e94, CRC(cc4a4e58) SHA1(dce67374a8dc6d2c9b66c0cd7e68b4f9fdab3e27) ) | |
| 2255 | ROM_LOAD( "a6617be0.bin", 0x160000, 0x00e480, CRC(b7d6ce86) SHA1(c3d9a8cf6125c50a0129591d807bbb13a836a651) ) | |
| 2256 | ROM_LOAD( "a6626060.bin", 0x170000, 0x0078a8, CRC(8c258ad2) SHA1(51d4d227e037992905a7a7f2b5bb13646920670d) ) | |
| 2257 | 2230 | ROM_END |
| 2258 | 2231 | |
| 2259 | 2232 | // ver 000804 |
| r7500 | r7501 | |
| 2271 | 2244 | ROM_LOAD( "mpr-23508.ic5", 0x4800000, 0x1000000, CRC(0a3590aa) SHA1(84c0e1853f069b003d09b268caee97e58c4dacb6) ) |
| 2272 | 2245 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) |
| 2273 | 2246 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) |
| 2274 | ||
| 2275 | // trojaned protection data (filename is address read from) | |
| 2276 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2277 | ROM_LOAD( "a63a9260.bin", 0x000000, 0x008760, CRC(54efa963) SHA1(41874253567da56441d83de041f6e82111977fa4) ) | |
| 2278 | ROM_LOAD( "a63b19c0.bin", 0x010000, 0x008260, CRC(f0ca72ef) SHA1(87fc4654afaf763cdb3ea5b4501948bfe7b9e9dc) ) | |
| 2279 | ROM_LOAD( "a63b9c20.bin", 0x020000, 0x00a0c0, CRC(92eec22c) SHA1(c7267503a828e852edeb26f68f3f4b685b9b163e) ) | |
| 2280 | ROM_LOAD( "a63c3ce0.bin", 0x030000, 0x00d7e0, CRC(93201f32) SHA1(5aca43776306a5a5ecd68a7e8699a724703f329a) ) | |
| 2281 | ROM_LOAD( "a63d14c0.bin", 0x040000, 0x00a8e0, CRC(fb2e9f7b) SHA1(ae4fc9a82eafb5b511485eef1d65ee9d3adc27b6) ) | |
| 2282 | ROM_LOAD( "a63dbda0.bin", 0x050000, 0x008460, CRC(b4b74624) SHA1(6ae2f5d69e45d295a3d0dcf295b1fb76be201e8e) ) | |
| 2283 | ROM_LOAD( "a63e4200.bin", 0x060000, 0x00b500, CRC(69ee516d) SHA1(f358aff12b826d1685199a9d5950abd121b54192) ) | |
| 2284 | ROM_LOAD( "a63ef700.bin", 0x070000, 0x00cec0, CRC(b2f4df7e) SHA1(4aafcf65e3fc193ee191f06ffcce37e52fc12364) ) | |
| 2285 | ROM_LOAD( "a63fc5c0.bin", 0x080000, 0x004cfc, CRC(1d534f98) SHA1(32afbb1d1fd1abba9e49b7b4bcf310860e4e47dc) ) | |
| 2286 | ROM_LOAD( "a643a120.bin", 0x090000, 0x00d6e0, CRC(27a0deb7) SHA1(c8da2e212ca8f5985d9336e8200c3382d6d373a5) ) | |
| 2287 | ROM_LOAD( "a6447800.bin", 0x0a0000, 0x00c920, CRC(42c9e4b1) SHA1(d7ef0d23956b795fad888f49a4dc42d74899de71) ) | |
| 2288 | ROM_LOAD( "a6454120.bin", 0x0b0000, 0x00a540, CRC(69321860) SHA1(675767e9fd18a0d72de2decb68acd7d500b11de2) ) | |
| 2289 | ROM_LOAD( "a645e660.bin", 0x0c0000, 0x00ccc0, CRC(4919083d) SHA1(89dfc2837e5298dc691350ac470bc76557657736) ) | |
| 2290 | ROM_LOAD( "a646b320.bin", 0x0d0000, 0x00c120, CRC(a66da245) SHA1(48d543244cdc52887131e734e0643c69f9368681) ) | |
| 2291 | ROM_LOAD( "a6477440.bin", 0x0e0000, 0x0097a8, CRC(6289f812) SHA1(574459f7c79dd757ae94f8e06dbcefa5b203e510) ) | |
| 2292 | ROM_LOAD( "a6480c00.bin", 0x0f0000, 0x00eca0, CRC(a4128a65) SHA1(35625df0109a72cb508bb4a89641bcb86aa697fb) ) | |
| 2293 | ROM_LOAD( "a648f8a0.bin", 0x100000, 0x009520, CRC(45a06ed6) SHA1(e9ee99e329cf35a95440312b9d0bed40254481c2) ) | |
| 2294 | ROM_LOAD( "a6498dc0.bin", 0x110000, 0x009f40, CRC(2cea7b46) SHA1(5398b8f1ba01e21d5fee0b1c6a796ce396c9697f) ) | |
| 2295 | ROM_LOAD( "a64a2d00.bin", 0x120000, 0x00dbe0, CRC(9c75fc98) SHA1(aa1a630c77b29202a4045b1eade455f02f29b81a) ) | |
| 2296 | ROM_LOAD( "a64b08e0.bin", 0x130000, 0x00cb40, CRC(72ae0dd2) SHA1(f4e8face14dac9a5cc75c6ccdfb9911929e2d76e) ) | |
| 2297 | ROM_LOAD( "a64bd420.bin", 0x140000, 0x00e920, CRC(198e4aa9) SHA1(294b9c3f89b138898c3ef6db60ac5473516d74dc) ) | |
| 2298 | ROM_LOAD( "a64cbd40.bin", 0x150000, 0x005e94, CRC(cc4a4e58) SHA1(dce67374a8dc6d2c9b66c0cd7e68b4f9fdab3e27) ) | |
| 2299 | ROM_LOAD( "a6617be0.bin", 0x160000, 0x00e480, CRC(b7d6ce86) SHA1(c3d9a8cf6125c50a0129591d807bbb13a836a651) ) | |
| 2300 | ROM_LOAD( "a6626060.bin", 0x170000, 0x0078a8, CRC(8c258ad2) SHA1(51d4d227e037992905a7a7f2b5bb13646920670d) ) | |
| 2301 | 2247 | ROM_END |
| 2302 | 2248 | |
| 2303 | 2249 | /* |
| r7500 | r7501 | |
| 2338 | 2284 | ROM_LOAD("mpr-23425.ic6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) ) |
| 2339 | 2285 | ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) |
| 2340 | 2286 | ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) |
| 2341 | ||
| 2342 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2343 | ROM_COPY("user1", 0, 0, 0x200000) | |
| 2344 | 2287 | ROM_END |
| 2345 | 2288 | |
| 2346 | 2289 | ROM_START( csmasho ) |
| r7500 | r7501 | |
| 2359 | 2302 | ROM_LOAD("mpr-23425.ic6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) ) |
| 2360 | 2303 | ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) |
| 2361 | 2304 | ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) |
| 2362 | ||
| 2363 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2364 | ROM_COPY("user1", 0, 0, 0x200000) | |
| 2365 | 2305 | ROM_END |
| 2366 | 2306 | |
| 2367 | 2307 | /* |
| r7500 | r7501 | |
| 2861 | 2801 | NAOMI_DEFAULT_EEPROM |
| 2862 | 2802 | |
| 2863 | 2803 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) |
| 2864 | ROM_LOAD( "epr22848.ic22", 0x0000000, 0x800000, CRC(54de0bd5) SHA1(5f6be36d2d39eea681ecac14358b92eaf4bf6c1e) ) | |
| 2865 | ROM_LOAD( "mpr22827.ic1", 0x0800000, 0x800000, CRC(eeb1b975) SHA1(929f453eaf5565ae3e660dbbb8f406ff8aa7897d) ) | |
| 2866 | ROM_LOAD( "mpr22828.ic2", 0x1000000, 0x800000, CRC(691d246a) SHA1(a2d538bc2e0d592a4f18d65f52fea035e1d4c625) ) | |
| 2867 | ROM_LOAD( "mpr22829.ic3", 0x1800000, 0x800000, CRC(00719c9c) SHA1(f0f19af4ebe2720bd822a9ea7e0004db163c706a) ) | |
| 2868 | ROM_LOAD( "mpr22830.ic4", 0x2000000, 0x800000, CRC(bfeb0e95) SHA1(a2dac7887dec722bd4b90a526bbcb9910b636618) ) | |
| 2869 | ROM_LOAD( "mpr22831.ic5", 0x2800000, 0x800000, CRC(697e60a8) SHA1(805dd3fb7b86d1ad8afadba58c7c026444e62e32) ) | |
| 2870 | ROM_LOAD( "mpr22832.ic6", 0x3000000, 0x800000, CRC(78e146a0) SHA1(cb6f1313ae51addbc84f78b3fb1e5d3adbe9af7c) ) | |
| 2871 | ROM_LOAD( "mpr22834.ic7", 0x3800000, 0x800000, CRC(cbd847ea) SHA1(7c54f909d9bc10fda12bf28d5d4b83052a0583d4) ) | |
| 2872 | ROM_LOAD( "mpr22834.ic8", 0x4000000, 0x800000, CRC(3bfc6571) SHA1(c3d7e1a75a8a2490c3b9b6f475ec948c40c84085) ) | |
| 2873 | ROM_LOAD( "mpr22835.ic9", 0x4800000, 0x800000, CRC(c0a14f8e) SHA1(811d95d3741a14a215f34b3dc465e4944d746568) ) | |
| 2874 | ROM_LOAD( "mpr22836.ic10", 0x5000000, 0x800000, CRC(ee68d756) SHA1(319f5633c3a377461fcedcf4b01edac41a26ad4b) ) | |
| 2875 | ROM_LOAD( "mpr22837.ic11", 0x5800000, 0x800000, CRC(3b53f0c9) SHA1(b9be9c3de9af3eefb16b77eb0ee8d2f144d66919) ) | |
| 2876 | ROM_LOAD( "mpr22838.ic12", 0x6000000, 0x800000, CRC(c17a2228) SHA1(0fcea748f5bacfdc784275e6f810001897f07bf5) ) | |
| 2877 | ROM_LOAD( "mpr22839.ic13", 0x6800000, 0x800000, CRC(31ab7352) SHA1(3a5b5a04172d4d32c2fcff540dd71ddb99bf662c) ) | |
| 2878 | ROM_LOAD( "mpr22840.ic14", 0x7000000, 0x800000, CRC(af4c757b) SHA1(b17722fa1f762c38e777ba36ffaf967062f86eb9) ) | |
| 2879 | ROM_LOAD( "mpr22841.ic15", 0x7800000, 0x800000, CRC(7adceb6b) SHA1(17e1833d3d22a244cd16ba93c74bd25bbaa1018d) ) | |
| 2880 | ROM_LOAD( "mpr22842.ic16", 0x8000000, 0x800000, CRC(1ce2ec11) SHA1(279464955f3b10c71aef1e41c68337f85d871739) ) | |
| 2881 | ROM_LOAD( "mpr22843.ic17", 0x8800000, 0x800000, CRC(1c659384) SHA1(4c5ca20c9924c56e5f7a51ecaaafac3c5c6f91c8) ) | |
| 2882 | ROM_LOAD( "mpr22844.ic18", 0x9000000, 0x800000, CRC(361ea725) SHA1(b2d17b2f09b9ae1e19bdc395189fa966ba462c06) ) | |
| 2883 | ROM_LOAD( "mpr22845.ic19", 0x9800000, 0x800000, CRC(3327aed1) SHA1(8bd81aa79ffe764da5810fe79a317530a4f3c191) ) | |
| 2884 | ROM_LOAD( "mpr22846.ic20", 0xa000000, 0x800000, CRC(d4148f39) SHA1(b6598ce52bcaa42805c581de326c953d27c1b2b4) ) | |
| 2885 | ROM_LOAD( "mpr22847.ic21", 0xa800000, 0x800000, CRC(955ad42e) SHA1(e396ca02b5786557434632c4fac56af3a4a9f8ce) ) | |
| 2804 | ROM_LOAD( "epr-22848.ic22", 0x0000000, 0x800000, CRC(54de0bd5) SHA1(5f6be36d2d39eea681ecac14358b92eaf4bf6c1e) ) | |
| 2805 | ROM_LOAD( "mpr-22827.ic1", 0x0800000, 0x800000, CRC(eeb1b975) SHA1(929f453eaf5565ae3e660dbbb8f406ff8aa7897d) ) | |
| 2806 | ROM_LOAD( "mpr-22828.ic2", 0x1000000, 0x800000, CRC(691d246a) SHA1(a2d538bc2e0d592a4f18d65f52fea035e1d4c625) ) | |
| 2807 | ROM_LOAD( "mpr-22829.ic3", 0x1800000, 0x800000, CRC(00719c9c) SHA1(f0f19af4ebe2720bd822a9ea7e0004db163c706a) ) | |
| 2808 | ROM_LOAD( "mpr-22830.ic4", 0x2000000, 0x800000, CRC(bfeb0e95) SHA1(a2dac7887dec722bd4b90a526bbcb9910b636618) ) | |
| 2809 | ROM_LOAD( "mpr-22831.ic5", 0x2800000, 0x800000, CRC(697e60a8) SHA1(805dd3fb7b86d1ad8afadba58c7c026444e62e32) ) | |
| 2810 | ROM_LOAD( "mpr-22832.ic6", 0x3000000, 0x800000, CRC(78e146a0) SHA1(cb6f1313ae51addbc84f78b3fb1e5d3adbe9af7c) ) | |
| 2811 | ROM_LOAD( "mpr-22834.ic7", 0x3800000, 0x800000, CRC(cbd847ea) SHA1(7c54f909d9bc10fda12bf28d5d4b83052a0583d4) ) | |
| 2812 | ROM_LOAD( "mpr-22834.ic8", 0x4000000, 0x800000, CRC(3bfc6571) SHA1(c3d7e1a75a8a2490c3b9b6f475ec948c40c84085) ) | |
| 2813 | ROM_LOAD( "mpr-22835.ic9", 0x4800000, 0x800000, CRC(c0a14f8e) SHA1(811d95d3741a14a215f34b3dc465e4944d746568) ) | |
| 2814 | ROM_LOAD( "mpr-22836.ic10", 0x5000000, 0x800000, CRC(ee68d756) SHA1(319f5633c3a377461fcedcf4b01edac41a26ad4b) ) | |
| 2815 | ROM_LOAD( "mpr-22837.ic11", 0x5800000, 0x800000, CRC(3b53f0c9) SHA1(b9be9c3de9af3eefb16b77eb0ee8d2f144d66919) ) | |
| 2816 | ROM_LOAD( "mpr-22838.ic12", 0x6000000, 0x800000, CRC(c17a2228) SHA1(0fcea748f5bacfdc784275e6f810001897f07bf5) ) | |
| 2817 | ROM_LOAD( "mpr-22839.ic13", 0x6800000, 0x800000, CRC(31ab7352) SHA1(3a5b5a04172d4d32c2fcff540dd71ddb99bf662c) ) | |
| 2818 | ROM_LOAD( "mpr-22840.ic14", 0x7000000, 0x800000, CRC(af4c757b) SHA1(b17722fa1f762c38e777ba36ffaf967062f86eb9) ) | |
| 2819 | ROM_LOAD( "mpr-22841.ic15", 0x7800000, 0x800000, CRC(7adceb6b) SHA1(17e1833d3d22a244cd16ba93c74bd25bbaa1018d) ) | |
| 2820 | ROM_LOAD( "mpr-22842.ic16", 0x8000000, 0x800000, CRC(1ce2ec11) SHA1(279464955f3b10c71aef1e41c68337f85d871739) ) | |
| 2821 | ROM_LOAD( "mpr-22843.ic17", 0x8800000, 0x800000, CRC(1c659384) SHA1(4c5ca20c9924c56e5f7a51ecaaafac3c5c6f91c8) ) | |
| 2822 | ROM_LOAD( "mpr-22844.ic18", 0x9000000, 0x800000, CRC(361ea725) SHA1(b2d17b2f09b9ae1e19bdc395189fa966ba462c06) ) | |
| 2823 | ROM_LOAD( "mpr-22845.ic19", 0x9800000, 0x800000, CRC(3327aed1) SHA1(8bd81aa79ffe764da5810fe79a317530a4f3c191) ) | |
| 2824 | ROM_LOAD( "mpr-22846.ic20", 0xa000000, 0x800000, CRC(d4148f39) SHA1(b6598ce52bcaa42805c581de326c953d27c1b2b4) ) | |
| 2825 | ROM_LOAD( "mpr-22847.ic21", 0xa800000, 0x800000, CRC(955ad42e) SHA1(e396ca02b5786557434632c4fac56af3a4a9f8ce) ) | |
| 2886 | 2826 | ROM_END |
| 2887 | 2827 | |
| 2888 | 2828 | ROM_START( f355twn2 ) |
| r7500 | r7501 | |
| 2891 | 2831 | NAOMI_DEFAULT_EEPROM |
| 2892 | 2832 | |
| 2893 | 2833 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) |
| 2894 | ROM_LOAD( "epr23399.ic22", 0x0000000, 0x400000, CRC(36de514c) SHA1(1c32064169c233156921fdf170c1958dc0f8a750) ) | |
| 2895 | ROM_LOAD( "mpr23378.ic1", 0x0800000, 0x800000, CRC(1ad80f12) SHA1(415a021987e07bb298e43eacb54ff898619837b1) ) | |
| 2896 | ROM_LOAD( "mpr23379.ic2", 0x1000000, 0x800000, CRC(a198f0a8) SHA1(7025adfd26f80087fa405acb49797d5c77a55e98) ) | |
| 2897 | ROM_LOAD( "mpr23380.ic3", 0x1800000, 0x800000, CRC(b1993286) SHA1(01ddc81ba3542f37dd2dadac972114ec254059a1) ) | |
| 2898 | ROM_LOAD( "mpr23381.ic4", 0x2000000, 0x800000, CRC(1204d518) SHA1(5b272be2ff7d48ee8005194d03ae79a01cea1b92) ) | |
| 2899 | ROM_LOAD( "mpr23382.ic5", 0x2800000, 0x800000, CRC(f2f3f7ab) SHA1(3e662197d7cc0b606706a2edb9433093d2bcd2d9) ) | |
| 2900 | ROM_LOAD( "mpr23383.ic6", 0x3000000, 0x800000, CRC(f19069c1) SHA1(ccec4008d95f8305e9d77a5b34a3de8aec3606dc) ) | |
| 2901 | ROM_LOAD( "mpr23384.ic7", 0x3800000, 0x800000, CRC(5150bb17) SHA1(9fab19f02e6f79e68e8e10aad78e47135081957d) ) | |
| 2902 | ROM_LOAD( "mpr23385.ic8", 0x4000000, 0x800000, CRC(747e4025) SHA1(ad3ee65ac473fda8c82c5e3dd349abaa9312bd35) ) | |
| 2903 | ROM_LOAD( "mpr23386.ic9", 0x4800000, 0x800000, CRC(28e22914) SHA1(e57d627de314dd13c229de91d061588df53b2164) ) | |
| 2904 | ROM_LOAD( "mpr23387.ic10", 0x5000000, 0x800000, CRC(3b5c0fe4) SHA1(cbe93bf95d6386e5a0d44e27e6953e259f8667bd) ) | |
| 2905 | ROM_LOAD( "mpr23388.ic11", 0x5800000, 0x800000, CRC(35d55060) SHA1(7c566f2ee82478aa63689f96088138902d9ee710) ) | |
| 2906 | ROM_LOAD( "mpr23389.ic12", 0x6000000, 0x800000, CRC(360b9078) SHA1(26160273848d4f9c3992ea125b0d36bed58add49) ) | |
| 2907 | ROM_LOAD( "mpr23390.ic13", 0x6800000, 0x800000, CRC(d5878f2d) SHA1(d918a37198033c74dadc1c531889f61c88ef94a8) ) | |
| 2908 | ROM_LOAD( "mpr23391.ic14", 0x7000000, 0x800000, CRC(eef8b0c6) SHA1(0339a094cbecf97c785bb1071b2b598c1ab60e40) ) | |
| 2909 | ROM_LOAD( "mpr23392.ic15", 0x7800000, 0x800000, CRC(df16126b) SHA1(b932afe38dd8e5f96412807743f44043fe450f14) ) | |
| 2910 | ROM_LOAD( "mpr23393.ic16", 0x8000000, 0x800000, CRC(e6d383a3) SHA1(6a77318f718171fe998a8e18d542dd43b8a9b87d) ) | |
| 2911 | ROM_LOAD( "mpr23394.ic17", 0x8800000, 0x800000, CRC(045235c4) SHA1(f1c4e09847840769d26719a26bdcf3c9241280a5) ) | |
| 2912 | ROM_LOAD( "mpr23395.ic18", 0x9000000, 0x800000, CRC(ed645203) SHA1(b621c96c9ca49a7582a50bf5c513b910dead4e13) ) | |
| 2913 | ROM_LOAD( "mpr23396.ic19", 0x9800000, 0x800000, CRC(42826956) SHA1(386eca3cda2bddb1825dbae850f0c17d1374eb41) ) | |
| 2914 | ROM_LOAD( "mpr23397.ic20", 0xa000000, 0x800000, CRC(28d2caf6) SHA1(67a3bc19abccf7f211c3aae67e751815857bd564) ) | |
| 2915 | ROM_LOAD( "mpr23398.ic21", 0xa800000, 0x800000, CRC(ea4d4d2a) SHA1(3dc9c7164516ae7f3b988c088ab819d8fd40d75e) ) | |
| 2834 | ROM_LOAD( "epr-23399.ic22", 0x0000000, 0x400000, CRC(36de514c) SHA1(1c32064169c233156921fdf170c1958dc0f8a750) ) | |
| 2835 | ROM_LOAD( "mpr-23378.ic1", 0x0800000, 0x800000, CRC(1ad80f12) SHA1(415a021987e07bb298e43eacb54ff898619837b1) ) | |
| 2836 | ROM_LOAD( "mpr-23379.ic2", 0x1000000, 0x800000, CRC(a198f0a8) SHA1(7025adfd26f80087fa405acb49797d5c77a55e98) ) | |
| 2837 | ROM_LOAD( "mpr-23380.ic3", 0x1800000, 0x800000, CRC(b1993286) SHA1(01ddc81ba3542f37dd2dadac972114ec254059a1) ) | |
| 2838 | ROM_LOAD( "mpr-23381.ic4", 0x2000000, 0x800000, CRC(1204d518) SHA1(5b272be2ff7d48ee8005194d03ae79a01cea1b92) ) | |
| 2839 | ROM_LOAD( "mpr-23382.ic5", 0x2800000, 0x800000, CRC(f2f3f7ab) SHA1(3e662197d7cc0b606706a2edb9433093d2bcd2d9) ) | |
| 2840 | ROM_LOAD( "mpr-23383.ic6", 0x3000000, 0x800000, CRC(f19069c1) SHA1(ccec4008d95f8305e9d77a5b34a3de8aec3606dc) ) | |
| 2841 | ROM_LOAD( "mpr-23384.ic7", 0x3800000, 0x800000, CRC(5150bb17) SHA1(9fab19f02e6f79e68e8e10aad78e47135081957d) ) | |
| 2842 | ROM_LOAD( "mpr-23385.ic8", 0x4000000, 0x800000, CRC(747e4025) SHA1(ad3ee65ac473fda8c82c5e3dd349abaa9312bd35) ) | |
| 2843 | ROM_LOAD( "mpr-23386.ic9", 0x4800000, 0x800000, CRC(28e22914) SHA1(e57d627de314dd13c229de91d061588df53b2164) ) | |
| 2844 | ROM_LOAD( "mpr-23387.ic10", 0x5000000, 0x800000, CRC(3b5c0fe4) SHA1(cbe93bf95d6386e5a0d44e27e6953e259f8667bd) ) | |
| 2845 | ROM_LOAD( "mpr-23388.ic11", 0x5800000, 0x800000, CRC(35d55060) SHA1(7c566f2ee82478aa63689f96088138902d9ee710) ) | |
| 2846 | ROM_LOAD( "mpr-23389.ic12", 0x6000000, 0x800000, CRC(360b9078) SHA1(26160273848d4f9c3992ea125b0d36bed58add49) ) | |
| 2847 | ROM_LOAD( "mpr-23390.ic13", 0x6800000, 0x800000, CRC(d5878f2d) SHA1(d918a37198033c74dadc1c531889f61c88ef94a8) ) | |
| 2848 | ROM_LOAD( "mpr-23391.ic14", 0x7000000, 0x800000, CRC(eef8b0c6) SHA1(0339a094cbecf97c785bb1071b2b598c1ab60e40) ) | |
| 2849 | ROM_LOAD( "mpr-23392.ic15", 0x7800000, 0x800000, CRC(df16126b) SHA1(b932afe38dd8e5f96412807743f44043fe450f14) ) | |
| 2850 | ROM_LOAD( "mpr-23393.ic16", 0x8000000, 0x800000, CRC(e6d383a3) SHA1(6a77318f718171fe998a8e18d542dd43b8a9b87d) ) | |
| 2851 | ROM_LOAD( "mpr-23394.ic17", 0x8800000, 0x800000, CRC(045235c4) SHA1(f1c4e09847840769d26719a26bdcf3c9241280a5) ) | |
| 2852 | ROM_LOAD( "mpr-23395.ic18", 0x9000000, 0x800000, CRC(ed645203) SHA1(b621c96c9ca49a7582a50bf5c513b910dead4e13) ) | |
| 2853 | ROM_LOAD( "mpr-23396.ic19", 0x9800000, 0x800000, CRC(42826956) SHA1(386eca3cda2bddb1825dbae850f0c17d1374eb41) ) | |
| 2854 | ROM_LOAD( "mpr-23397.ic20", 0xa000000, 0x800000, CRC(28d2caf6) SHA1(67a3bc19abccf7f211c3aae67e751815857bd564) ) | |
| 2855 | ROM_LOAD( "mpr-23398.ic21", 0xa800000, 0x800000, CRC(ea4d4d2a) SHA1(3dc9c7164516ae7f3b988c088ab819d8fd40d75e) ) | |
| 2916 | 2856 | ROM_END |
| 2917 | 2857 | |
| 2918 | 2858 | ROM_START( alpiltdx ) |
| r7500 | r7501 | |
| 2921 | 2861 | NAOMI_DEFAULT_EEPROM |
| 2922 | 2862 | |
| 2923 | 2863 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) |
| 2924 | ROM_LOAD( "epr21787b.ic22", 0x0000000, 0x400000, CRC(56893156) SHA1(8e56e0633f92b1f50105421b7eb8428f51a78b27) ) | |
| 2925 | ROM_LOAD( "mpr21728.ic1", 0x0800000, 0x800000, CRC(872338d4) SHA1(04857b300196c0ec51361d7cf7bb57274a15a326) ) | |
| 2926 | ROM_LOAD( "mpr21729.ic2", 0x1000000, 0x800000, CRC(9a9b72ad) SHA1(ce96da7904dd82abaa448df45e954521dd834ed8) ) | |
| 2927 | ROM_LOAD( "mpr21730.ic3", 0x1800000, 0x800000, CRC(93c25058) SHA1(658374bca3cf615982ebcf493eeaaa9e40e70f03) ) | |
| 2928 | ROM_LOAD( "mpr21731.ic4", 0x2000000, 0x800000, CRC(f14e578b) SHA1(d572903f7021757aebbb903b25a11a5aaf9f7a71) ) | |
| 2929 | ROM_LOAD( "mpr21732.ic5", 0x2800000, 0x800000, CRC(28ea4e8c) SHA1(7f87fe08819e756bb7aadca2aaacb0f6e59c13f0) ) | |
| 2930 | ROM_LOAD( "mpr21733.ic6", 0x3000000, 0x800000, CRC(5aee9e99) SHA1(8db726a73723c931fd8a4be2dd99d7c32352ad21) ) | |
| 2931 | ROM_LOAD( "mpr21734.ic7", 0x3800000, 0x800000, CRC(0574390d) SHA1(5988bdd089d23035ee2dd3596ea9c822455311d3) ) | |
| 2932 | ROM_LOAD( "mpr21735.ic8", 0x4000000, 0x800000, CRC(811400b4) SHA1(5f8d8b70f499b293b2d952c754c853c53b39c438) ) | |
| 2933 | ROM_LOAD( "mpr21736.ic9", 0x4800000, 0x800000, CRC(d74eda63) SHA1(d6794fa433cea9f06dc0a20dc9e10388162e7fd8) ) | |
| 2934 | ROM_LOAD( "mpr21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) | |
| 2935 | ROM_LOAD( "mpr21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) | |
| 2864 | ROM_LOAD( "epr-21787b.ic22", 0x0000000, 0x400000, CRC(56893156) SHA1(8e56e0633f92b1f50105421b7eb8428f51a78b27) ) | |
| 2865 | ROM_LOAD( "mpr-21728.ic1", 0x0800000, 0x800000, CRC(872338d4) SHA1(04857b300196c0ec51361d7cf7bb57274a15a326) ) | |
| 2866 | ROM_LOAD( "mpr-21729.ic2", 0x1000000, 0x800000, CRC(9a9b72ad) SHA1(ce96da7904dd82abaa448df45e954521dd834ed8) ) | |
| 2867 | ROM_LOAD( "mpr-21730.ic3", 0x1800000, 0x800000, CRC(93c25058) SHA1(658374bca3cf615982ebcf493eeaaa9e40e70f03) ) | |
| 2868 | ROM_LOAD( "mpr-21731.ic4", 0x2000000, 0x800000, CRC(f14e578b) SHA1(d572903f7021757aebbb903b25a11a5aaf9f7a71) ) | |
| 2869 | ROM_LOAD( "mpr-21732.ic5", 0x2800000, 0x800000, CRC(28ea4e8c) SHA1(7f87fe08819e756bb7aadca2aaacb0f6e59c13f0) ) | |
| 2870 | ROM_LOAD( "mpr-21733.ic6", 0x3000000, 0x800000, CRC(5aee9e99) SHA1(8db726a73723c931fd8a4be2dd99d7c32352ad21) ) | |
| 2871 | ROM_LOAD( "mpr-21734.ic7", 0x3800000, 0x800000, CRC(0574390d) SHA1(5988bdd089d23035ee2dd3596ea9c822455311d3) ) | |
| 2872 | ROM_LOAD( "mpr-21735.ic8", 0x4000000, 0x800000, CRC(811400b4) SHA1(5f8d8b70f499b293b2d952c754c853c53b39c438) ) | |
| 2873 | ROM_LOAD( "mpr-21736.ic9", 0x4800000, 0x800000, CRC(d74eda63) SHA1(d6794fa433cea9f06dc0a20dc9e10388162e7fd8) ) | |
| 2874 | ROM_LOAD( "mpr-21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) | |
| 2875 | ROM_LOAD( "mpr-21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) | |
| 2936 | 2876 | |
| 2937 | 2877 | // on-cart X76F100 eeprom contents |
| 2938 | 2878 | ROM_REGION( 0x100, "naomibd_eeprom", ROMREGION_ERASE00 ) |
| r7500 | r7501 | |
| 2946 | 2886 | |
| 2947 | 2887 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) |
| 2948 | 2888 | ROM_LOAD( "epr-21739a.ic22", 0x000000, 0x400000, CRC(08f22bab) SHA1(fedc80eef7c824381fd834cc04202383c9340c4f) ) |
| 2949 | ROM_LOAD( "mpr21728.ic1", 0x0800000, 0x800000, CRC(872338d4) SHA1(04857b300196c0ec51361d7cf7bb57274a15a326) ) | |
| 2950 | ROM_LOAD( "mpr21729.ic2", 0x1000000, 0x800000, CRC(9a9b72ad) SHA1(ce96da7904dd82abaa448df45e954521dd834ed8) ) | |
| 2951 | ROM_LOAD( "mpr21730.ic3", 0x1800000, 0x800000, CRC(93c25058) SHA1(658374bca3cf615982ebcf493eeaaa9e40e70f03) ) | |
| 2952 | ROM_LOAD( "mpr21731.ic4", 0x2000000, 0x800000, CRC(f14e578b) SHA1(d572903f7021757aebbb903b25a11a5aaf9f7a71) ) | |
| 2953 | ROM_LOAD( "mpr21732.ic5", 0x2800000, 0x800000, CRC(28ea4e8c) SHA1(7f87fe08819e756bb7aadca2aaacb0f6e59c13f0) ) | |
| 2954 | ROM_LOAD( "mpr21733.ic6", 0x3000000, 0x800000, CRC(5aee9e99) SHA1(8db726a73723c931fd8a4be2dd99d7c32352ad21) ) | |
| 2955 | ROM_LOAD( "mpr21734.ic7", 0x3800000, 0x800000, CRC(0574390d) SHA1(5988bdd089d23035ee2dd3596ea9c822455311d3) ) | |
| 2956 | ROM_LOAD( "mpr21735.ic8", 0x4000000, 0x800000, CRC(811400b4) SHA1(5f8d8b70f499b293b2d952c754c853c53b39c438) ) | |
| 2957 | ROM_LOAD( "mpr21736.ic9", 0x4800000, 0x800000, CRC(d74eda63) SHA1(d6794fa433cea9f06dc0a20dc9e10388162e7fd8) ) | |
| 2958 | ROM_LOAD( "mpr21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) | |
| 2959 | ROM_LOAD( "mpr21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) | |
| 2889 | ROM_LOAD( "mpr-21728.ic1", 0x0800000, 0x800000, CRC(872338d4) SHA1(04857b300196c0ec51361d7cf7bb57274a15a326) ) | |
| 2890 | ROM_LOAD( "mpr-21729.ic2", 0x1000000, 0x800000, CRC(9a9b72ad) SHA1(ce96da7904dd82abaa448df45e954521dd834ed8) ) | |
| 2891 | ROM_LOAD( "mpr-21730.ic3", 0x1800000, 0x800000, CRC(93c25058) SHA1(658374bca3cf615982ebcf493eeaaa9e40e70f03) ) | |
| 2892 | ROM_LOAD( "mpr-21731.ic4", 0x2000000, 0x800000, CRC(f14e578b) SHA1(d572903f7021757aebbb903b25a11a5aaf9f7a71) ) | |
| 2893 | ROM_LOAD( "mpr-21732.ic5", 0x2800000, 0x800000, CRC(28ea4e8c) SHA1(7f87fe08819e756bb7aadca2aaacb0f6e59c13f0) ) | |
| 2894 | ROM_LOAD( "mpr-21733.ic6", 0x3000000, 0x800000, CRC(5aee9e99) SHA1(8db726a73723c931fd8a4be2dd99d7c32352ad21) ) | |
| 2895 | ROM_LOAD( "mpr-21734.ic7", 0x3800000, 0x800000, CRC(0574390d) SHA1(5988bdd089d23035ee2dd3596ea9c822455311d3) ) | |
| 2896 | ROM_LOAD( "mpr-21735.ic8", 0x4000000, 0x800000, CRC(811400b4) SHA1(5f8d8b70f499b293b2d952c754c853c53b39c438) ) | |
| 2897 | ROM_LOAD( "mpr-21736.ic9", 0x4800000, 0x800000, CRC(d74eda63) SHA1(d6794fa433cea9f06dc0a20dc9e10388162e7fd8) ) | |
| 2898 | ROM_LOAD( "mpr-21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) | |
| 2899 | ROM_LOAD( "mpr-21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) | |
| 2960 | 2900 | ROM_END |
| 2961 | 2901 | |
| 2962 | 2902 | ROM_START( hotd2 ) |
| r7500 | r7501 | |
| 3066 | 3006 | |
| 3067 | 3007 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) |
| 3068 | 3008 | ROM_LOAD("epr-23377.ic11", 0x0000000, 0x0400000, CRC(4ca3149c) SHA1(9d25fc659658b416202b033754669be2f3abcdbe) ) |
| 3069 | /* Test mode returns IC1 as bad dump, it looks like that is data provided by the Actel A54SX32 FPGA present on board | |
| 3070 | and mirrored there. Provided as documentation until we know more about it. */ | |
| 3071 | ROM_LOAD("gram2000.ic1", 0x0800000, 0x0800000, CRC(4a86556a) SHA1(61100dc84c95dd47d9f61c7cc52ea25579b90632) ) | |
| 3009 | // the 0x0800000 - 0x0ffffff space mirrors part of roms 17/18, see ROM_COPY below, gets tested as 'IC1' if actel_id is 0xffff | |
| 3072 | 3010 | ROM_LOAD32_WORD("mpr-23357.ic17", 0x1000000, 0x0800000, CRC(eaf77487) SHA1(bdfc4666a6724441c11b31d89fa30c4bd11cbdd1) ) //ic 2 |
| 3073 | 3011 | ROM_LOAD32_WORD("mpr-23358.ic18", 0x1000002, 0x0800000, CRC(96819a5b) SHA1(e28c9d7b0579ab5d6116401b49f30dc8e4961618) ) //ic 3 |
| 3074 | 3012 | ROM_LOAD32_WORD("mpr-23359.ic19", 0x2000000, 0x0800000, CRC(757b9e89) SHA1(b131af1cbcb4fcebb7081b208acc86841192ff14) ) //ic 4 |
| r7500 | r7501 | |
| 3089 | 3027 | ROM_LOAD32_WORD("mpr-23374.ic34", 0x9000002, 0x0800000, CRC(1f8a2e08) SHA1(ff9b9bfada831baeb4830a3d1a4bfb38570b9972) ) //ic 19 |
| 3090 | 3028 | ROM_LOAD32_WORD("mpr-23375.ic35", 0xa000000, 0x0800000, CRC(7d4043db) SHA1(cadf22419e5b63c33a179bb6b0742035fc9d8028) ) //ic 20 |
| 3091 | 3029 | ROM_LOAD32_WORD("mpr-23376.ic36", 0xa000002, 0x0800000, CRC(e09cb473) SHA1(c3ec980f1a56142a0e06bae9594d6038acf0690d) ) //ic 21 |
| 3030 | ||
| 3031 | ROM_COPY( "user1", 0x1400000, 0x0800000, 0x0800000 ) // mirror data so IC1 check can pass | |
| 3032 | //ROM_COPY( "user1", 0x1000000, 0x0400000, 0x0c00000 ) // or does it mirror the start of 17/18 from 0x0400000 upwards like this, check on real hw | |
| 3092 | 3033 | ROM_END |
| 3093 | 3034 | |
| 3094 | 3035 | ROM_START( crackndj ) |
| r7500 | r7501 | |
| 3206 | 3147 | ROM_LOAD("mpr-23713.ic9", 0x4800000, 0x0800000, CRC(2969bac7) SHA1(5f1cf6ac726c2fe183d66e4022962e44592f9ccd) ) |
| 3207 | 3148 | ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) ) |
| 3208 | 3149 | ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, CRC(c750abbd) SHA1(2a5bedc2b21cd3f991c7145ccfd8c7a9e7f647ae) ) |
| 3209 | // trojaned protection data | |
| 3210 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3211 | ROM_LOAD( "a3075ac0.bin", 0x000000, 0x00ff04, CRC(440dca2a) SHA1(4e261ff309e7e774fa2061de30174b0e4e967c00) ) | |
| 3212 | ROM_LOAD( "a30859c4.bin", 0x010000, 0x00ff04, CRC(c22c76a7) SHA1(76d9e47730e4551e6e1a96eeee937296f1153b8b) ) | |
| 3213 | ROM_LOAD( "a30958c8.bin", 0x020000, 0x00ff04, CRC(8f29ee4d) SHA1(e1ac1ccf85dc338e9d5381dfa8ededc8af8f3e92) ) | |
| 3214 | ROM_LOAD( "a30a57cc.bin", 0x030000, 0x00ff04, CRC(479846c1) SHA1(b063e2f7d521cd8a60b770477c13946679e06dd7) ) | |
| 3215 | ROM_LOAD( "a30b56d0.bin", 0x040000, 0x00ff04, CRC(107f777e) SHA1(002f062a2073dff5f0d4722803aef0a8ffc7a61a) ) | |
| 3216 | ROM_LOAD( "a30c55d4.bin", 0x050000, 0x00ff04, CRC(d73b35c1) SHA1(951cceaf6a53d4fc4b967c3675d3fa98a6874b2a) ) | |
| 3217 | ROM_LOAD( "a30d54d8.bin", 0x060000, 0x00ff04, CRC(969a6957) SHA1(ee6909f832b96ec3e6ae0cec3f18a7983cae89d9) ) | |
| 3218 | ROM_LOAD( "a30e53dc.bin", 0x070000, 0x00ff04, CRC(002f7b41) SHA1(12bb33f1229d74b32ab481f5a2e57332f0def6e7) ) | |
| 3219 | ROM_LOAD( "a30f52e0.bin", 0x080000, 0x00a904, CRC(97e32fdd) SHA1(a40f412e40544a45784b2f8d9d5494b6491efc4a) ) | |
| 3220 | ROM_LOAD( "a30ffbe4.bin", 0x090000, 0x000084, CRC(c4311af6) SHA1(7a53061a1a1a024d72880a9a9c2e6a61d2607a46) ) | |
| 3221 | ROM_LOAD( "a30ffc80.bin", 0x0a0000, 0x00ff04, CRC(b1b5e559) SHA1(2f5963d8aa46d7aeb869769a7052d3006d56d5a4) ) | |
| 3222 | ROM_LOAD( "a310fb84.bin", 0x0b0000, 0x00ff04, CRC(91bdc0b2) SHA1(3f77fe6b67dba605296c3c038265b4e0e7eabd97) ) | |
| 3223 | ROM_LOAD( "a311fa88.bin", 0x0c0000, 0x00ff04, CRC(dc5d1334) SHA1(52287bd3ade05be4511e43a7707de8cc38117316) ) | |
| 3224 | ROM_LOAD( "a312f98c.bin", 0x0d0000, 0x00ff04, CRC(e3d9ea36) SHA1(0860f5ac3086d16132f3d0d27266c644470b4f1e) ) | |
| 3225 | ROM_LOAD( "a313f890.bin", 0x0e0000, 0x00ff04, CRC(8b23c562) SHA1(fcc9d04c150f007dcd4a9a2bbee1e438a81b7c49) ) | |
| 3226 | ROM_LOAD( "a314f794.bin", 0x0f0000, 0x009104, CRC(0c0a9aa2) SHA1(1b9063a18703ce4a03ffe20e3f13e9bae06bdb57) ) | |
| 3227 | ROM_LOAD( "a3158898.bin", 0x100000, 0x0000ac, CRC(e23f61d5) SHA1(80ff570a6846f1af2b87e5888675257728e8e253) ) | |
| 3228 | ROM_LOAD( "a0800f40.bin", 0x110000, 0x000204, CRC(f4935846) SHA1(d7eaa710274080f378afa4fb2e14f3bd406c45fe) ) | |
| 3229 | ROM_LOAD( "a0801144.bin", 0x120000, 0x000034, CRC(28a62ac0) SHA1(d9bb6baf5feaca655f333e2f0b9b200f44ef1726) ) | |
| 3230 | ROM_LOAD( "a0801180.bin", 0x130000, 0x00ff04, CRC(4b9e08b7) SHA1(dab208f7af4475210135aeb648e6bed7db7399b9) ) | |
| 3231 | ROM_LOAD( "a0811084.bin", 0x140000, 0x00ff04, CRC(4003bab7) SHA1(0b1df4b9b1d1a1072719b559a71f5ae5811be63c) ) | |
| 3232 | ROM_LOAD( "a0820f88.bin", 0x150000, 0x007e04, CRC(67fb4342) SHA1(8b8c384a1628756a08aa8131095e49756967b5e2) ) | |
| 3233 | ROM_LOAD( "a0828d8c.bin", 0x160000, 0x0000f4, CRC(71c85e2b) SHA1(680b6ee02ea24a502bc42bade23e11e6a7ddc7ad) ) | |
| 3234 | 3150 | ROM_END |
| 3235 | 3151 | |
| 3236 | 3152 | /* |
| r7500 | r7501 | |
| 3253 | 3169 | IC9 64M 717F 40ED |
| 3254 | 3170 | IC10 64M 1E43 0F1A |
| 3255 | 3171 | |
| 3256 | byteswaped @ e0158 key b957 read count 400, write 404 | |
| 3257 | e055c key 37ca read count 400, write 404 | |
| 3258 | ||
| 3259 | 3172 | */ |
| 3260 | 3173 | |
| 3261 | 3174 | ROM_START( gwing2 ) |
| r7500 | r7501 | |
| 3270 | 3183 | ROM_LOAD("mpr-22273.ic3", 0x2800000, 0x1000000, CRC(cd633dcf) SHA1(f044d93802a4ba29d0e70c597d3fbe65da591335) ) |
| 3271 | 3184 | ROM_LOAD("mpr-22274.ic4", 0x3800000, 0x1000000, CRC(f8daaaf3) SHA1(8854d3f8e3d55715ede33ee918b641e251f752b4) ) |
| 3272 | 3185 | ROM_LOAD("mpr-22275.ic5", 0x4800000, 0x1000000, CRC(61aa1521) SHA1(7d9f5790e72a9151d128ac7887e236526fdf72a0) ) |
| 3273 | ||
| 3274 | // trojaned protection data (filename is address read from) | |
| 3275 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3276 | ROM_LOAD( "a085ddc0.bin", 0x000000, 0x00c960, CRC(77303f1c) SHA1(5dc8799b9ec102540c6e7647eccb69dfc5e6ecfb) ) | |
| 3277 | ROM_LOAD( "a080c6c0.bin", 0x010000, 0x020000, CRC(168e551a) SHA1(03bb8ce4bb233db75a0e07a8b5ad28149b5f126e) ) | |
| 3278 | ROM_LOAD( "a082c6c4.bin", 0x030000, 0x020000, CRC(bd2fcd3a) SHA1(2eefa22472d7caf30a3467c1f7ed8dc72f1665c1) ) | |
| 3279 | ROM_LOAD( "a084c6c8.bin", 0x050000, 0x020000, CRC(c1d28ba0) SHA1(5e497758c3756fe993b481ab2009402a105fbc63) ) | |
| 3280 | ROM_LOAD( "a08c67e0.bin", 0x070000, 0x020000, CRC(ceabcb70) SHA1(bbc97218f32913eefe52b1bb1606bad60d7c2894) ) | |
| 3281 | ROM_LOAD( "a08e67e4.bin", 0x090000, 0x020000, CRC(4bc98e7b) SHA1(5f506d05a05a129bf500f0112e39b722872f1220) ) | |
| 3282 | ROM_LOAD( "a09067e8.bin", 0x0b0000, 0x020000, CRC(4cd8a958) SHA1(d3a96287986ab851acced420c4ff9f4d2035188a) ) | |
| 3283 | ROM_LOAD( "a09267ec.bin", 0x0d0000, 0x020000, CRC(17c1df0d) SHA1(62964224f27c54651518a8622756c253d777629a) ) | |
| 3284 | ROM_LOAD( "a09467f0.bin", 0x0f0000, 0x020000, CRC(99c78505) SHA1(bbb95757bc0be76c680255a0e72d2eacc4ca525e) ) | |
| 3285 | ROM_LOAD( "a09667f4.bin", 0x110000, 0x016360, CRC(bec1fd2f) SHA1(e2e9d47d6d5d35bfa9a432c7f47f95c780b17551) ) | |
| 3286 | ROM_LOAD( "a088acc0.bin", 0x130000, 0x020000, CRC(abb1e0d9) SHA1(a1d5d484faaa806b365069755660ec14c1cecada) ) | |
| 3287 | ROM_LOAD( "a08aacc4.bin", 0x150000, 0x01bb00, CRC(2acc08c8) SHA1(c04276ec940a73e4b8fe140ef9f4bec8c629ecc9) ) | |
| 3288 | ROM_LOAD( "a086a740.bin", 0x170000, 0x020000, CRC(5d90c88c) SHA1(7af4107e1930292d3c64b80cb29d31aae8a565b6) ) | |
| 3289 | ROM_LOAD( "a088a744.bin", 0x190000, 0x000560, CRC(79c8eb0f) SHA1(0216fa128d9851b96f3864446ef71e0ed6f4ccd0) ) | |
| 3290 | ROM_LOAD( "a097cb60.bin", 0x1a0000, 0x010820, CRC(371e88d9) SHA1(04f0167000e96d556227e8abf6e06e0698e61e9f) ) | |
| 3291 | ROM_LOAD( "a0807fa0.bin", 0x1c0000, 0x004700, CRC(4eed5ff3) SHA1(26425baa06959d612b3b7e9f367fbb97258f544e) ) | |
| 3292 | ROM_LOAD( "a0800000.bin", 0x1d0000, 0x006040, CRC(17651005) SHA1(500806ba917133ae604817c6ee2913d10762e290) ) | |
| 3293 | ROM_LOAD( "a0806060.bin", 0x1e0000, 0x001f20, CRC(ff25a8fe) SHA1(e8c0ddf63802e3d35478e1a491dc7162283b2474) ) | |
| 3294 | 3186 | ROM_END |
| 3295 | 3187 | |
| 3296 | 3188 | /* |
| r7500 | r7501 | |
| 3401 | 3293 | ROM_LOAD("mpr-23059.ic28", 0x6000000, 0x0800000, CRC(64808024) SHA1(1a6c60c330642b273978d3dd02d95d17d36ee3f2) ) |
| 3402 | 3294 | ROM_LOAD("mpr-23060.ic29", 0x6800000, 0x0800000, CRC(67519942) SHA1(fc758d9075625f8140d5d828c8f6b7a91bcc9119) ) |
| 3403 | 3295 | ROM_LOAD("mpr-23061.ic30", 0x7000000, 0x0800000, CRC(fb1844c4) SHA1(1d1571516a6dbed0c4ded3b80efde9cc9281f66f) ) |
| 3404 | ROM_LOAD("mpr-23083.ic31", 0x7800000, 0x0400000, CRC(c61d2dfe) SHA1(a05fb979ed7c8040de91716fc8814e6bd995efa2) ) | |
| 3405 | ROM_LOAD("mpr-23084.ic32", 0x8000000, 0x0400000, CRC(e228cdfd) SHA1(d02a2e3557bd24cf34c5ddb42d41ca15e78ae885) ) | |
| 3296 | ROM_LOAD("mpr-23083.ic31", 0x7800000, 0x0400000, CRC(c61d2dfe) SHA1(a05fb979ed7c8040de91716fc8814e6bd995efa2) ) | |
| 3297 | ROM_LOAD("mpr-23084.ic32", 0x8000000, 0x0400000, CRC(e228cdfd) SHA1(d02a2e3557bd24cf34c5ddb42d41ca15e78ae885) ) | |
| 3406 | 3298 | |
| 3299 | ||
| 3300 | ||
| 3407 | 3301 | // DMA protection data |
| 3408 | ROM_LOAD("88000000.bin", 0x8800000, 0x025f00, CRC(77d79823) SHA1(2545d28eee47114e8ffb9bc6d7a910e90fc48420) ) | |
| 3409 | ROM_LOAD("88026440.bin", 0x8830000, 0x016520, CRC(dad9ebbd) SHA1(39c0697caa2b5ee11d99e75726e92ed86a23f10b) ) | |
| 3410 | ROM_LOAD("8803bda0.bin", 0x8850000, 0x01e5e0, CRC(9e0b8202) SHA1(729bed557c1a00da13c990603bbadab38d90285e) ) | |
| 3411 | ROM_LOAD("8805a560.bin", 0x8870000, 0x0017a0, CRC(7bc27482) SHA1(6ce6074cf47989f42af02deb7aac52883912784a) ) | |
| 3412 | ROM_LOAD("8805b720.bin", 0x8880000, 0x02b5a0, CRC(485d0aef) SHA1(853f4b49b489cc512c906edcaf3cd8b5bf4c64c0) ) | |
| 3413 | ROM_LOAD("8808b7e0.bin", 0x88a0000, 0x013ec0, CRC(0fc8f363) SHA1(dad30d43cef89d01ce80301b1d796aabad755de6) ) | |
| 3302 | ROM_LOAD("88000000.bin", 0x8800000, 0x025f00, CRC(77d79823) SHA1(2545d28eee47114e8ffb9bc6d7a910e90fc48420) ) | |
| 3303 | ROM_LOAD("88026440.bin", 0x8830000, 0x016520, CRC(dad9ebbd) SHA1(39c0697caa2b5ee11d99e75726e92ed86a23f10b) ) | |
| 3304 | ROM_LOAD("8803bda0.bin", 0x8850000, 0x01e5e0, CRC(9e0b8202) SHA1(729bed557c1a00da13c990603bbadab38d90285e) ) | |
| 3305 | ROM_LOAD("8805a560.bin", 0x8870000, 0x0017a0, CRC(7bc27482) SHA1(6ce6074cf47989f42af02deb7aac52883912784a) ) | |
| 3306 | ROM_LOAD("8805b720.bin", 0x8880000, 0x02b5a0, CRC(485d0aef) SHA1(853f4b49b489cc512c906edcaf3cd8b5bf4c64c0) ) | |
| 3307 | ROM_LOAD("8808b7e0.bin", 0x88a0000, 0x013ec0, CRC(0fc8f363) SHA1(dad30d43cef89d01ce80301b1d796aabad755de6) ) | |
| 3414 | 3308 | ROM_END |
| 3415 | 3309 | |
| 3416 | 3310 | /* toy fighter - 1999 sega */ |
| r7500 | r7501 | |
| 3433 | 3327 | ROM_LOAD("mpr-22032.ic8", 0x4000000, 0x0800000, CRC(3c48c9ba) SHA1(00be199b23040f8e81db2ec489ba98cbf615652c) ) |
| 3434 | 3328 | ROM_LOAD("mpr-22033.ic9", 0x4800000, 0x0800000, CRC(5fe5586e) SHA1(3ff41ae1f81469597684faadd88e62b5e0634352) ) |
| 3435 | 3329 | ROM_LOAD("mpr-22034.ic10",0x5000000, 0x0800000, CRC(3aa5ce5e) SHA1(f00a906235e4522d6fc2ac771324114346875314) ) |
| 3436 | ||
| 3437 | // protection data (also found in cleartext in the program ROM!) | |
| 3438 | ROM_REGION( 0x400000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3439 | ROM_COPY("user1", 0, 0, 0x400000) | |
| 3440 | 3330 | ROM_END |
| 3441 | 3331 | |
| 3442 | 3332 | /* Crazy Taxi */ |
| 3443 | /* protection: crypt data at 0x3ff000, key 0x0219, feed 0x504, read 0x500 */ | |
| 3444 | 3333 | ROM_START( crzytaxi ) |
| 3445 | 3334 | ROM_REGION( 0x200000, "maincpu", 0) |
| 3446 | 3335 | NAOMI_BIOS |
| 3447 | 3336 | NAOMI_DEFAULT_EEPROM |
| 3448 | 3337 | |
| 3449 | 3338 | ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF) |
| 3450 | ROM_LOAD( "epr21684.bin", 0x0000000, 0x400000, CRC(f1de77b7) SHA1(4490b828534db6676b2d0129498fd7694eb9e5ff) ) | |
| 3451 | ROM_LOAD( "mpr21671.ic1", 0x0800000, 0x800000, CRC(2d362137) SHA1(ed6eb45eadb784910eee44d0273534ab68ad6937) ) | |
| 3452 | ROM_LOAD( "mpr21672.ic2", 0x1000000, 0x800000, CRC(72c7da8e) SHA1(0ed3d71c052a2cccbbf0f7b20e2ec688316c7247) ) | |
| 3453 | ROM_LOAD( "mpr21673.ic3", 0x1800000, 0x800000, CRC(27481c0d) SHA1(08779e33eda1a45cb06319327cb4254dc3e4460f) ) | |
| 3454 | ROM_LOAD( "mpr21674.ic4", 0x2000000, 0x800000, CRC(c2e2a98c) SHA1(9a40456ca025c2a6314cef705f7d147bbf95c0f0) ) | |
| 3455 | ROM_LOAD( "mpr21675.ic5", 0x2800000, 0x800000, CRC(6b755510) SHA1(3fa967587e05c5bd45db3fe8a2cbc56f44166ef6) ) | |
| 3456 | ROM_LOAD( "mpr21676.ic6", 0x3000000, 0x800000, CRC(f33d1f39) SHA1(b1d589a9ab7ec4988e63bfb458ef006308e1de70) ) | |
| 3457 | ROM_LOAD( "mpr21677.ic7", 0x3800000, 0x800000, CRC(ab4dc61b) SHA1(d92ff434e7a2b9d3598f9d7004aa717b9bd21980) ) | |
| 3458 | ROM_LOAD( "mpr21678.ic10", 0x5000000, 0x800000, CRC(297c778a) SHA1(67e5685cd03a3aaaac1c47f15c7b3f3e341d34b1) ) | |
| 3459 | ROM_LOAD( "mpr21679.ic11", 0x5800000, 0x800000, CRC(6b540c4a) SHA1(9877c31b41110230182c0ee8d40753907981c7f9) ) | |
| 3460 | ROM_LOAD( "mpr21680.ic12s", 0x6000000, 0x800000, CRC(e76f03f9) SHA1(ea20aa86d02a77315cca8cb6be75ca4ca9cc7484) ) | |
| 3461 | ROM_LOAD( "mpr21681.ic13s", 0x6800000, 0x800000, CRC(e5dcde7d) SHA1(8a90d9fb4ce0d2ceb609fcf4c54cf5b55c266c50) ) | |
| 3462 | ROM_LOAD( "mpr21682.ic14s", 0x7000000, 0x800000, CRC(54c0290e) SHA1(6e07ab6e95c29a2aabed0ba1a7af0d7d605e0309) ) | |
| 3463 | ROM_LOAD( "mpr21683.ic15s", 0x7800000, 0x800000, CRC(ac8a27e0) SHA1(8e71d853a102dd6c164d5326e6d157ccfb8c7b36) ) | |
| 3464 | ||
| 3465 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3466 | ROM_LOAD( "a03ff000.bin", 0x000000, 0x000500, CRC(be5e415d) SHA1(baf87191236f332c8df7674a080c2be4824a4bcb) ) | |
| 3339 | ROM_LOAD( "epr-21684.ic22", 0x0000000, 0x400000, CRC(f1de77b7) SHA1(4490b828534db6676b2d0129498fd7694eb9e5ff) ) | |
| 3340 | ROM_LOAD( "mpr-21671.ic1", 0x0800000, 0x800000, CRC(2d362137) SHA1(ed6eb45eadb784910eee44d0273534ab68ad6937) ) | |
| 3341 | ROM_LOAD( "mpr-21672.ic2", 0x1000000, 0x800000, CRC(72c7da8e) SHA1(0ed3d71c052a2cccbbf0f7b20e2ec688316c7247) ) | |
| 3342 | ROM_LOAD( "mpr-21673.ic3", 0x1800000, 0x800000, CRC(27481c0d) SHA1(08779e33eda1a45cb06319327cb4254dc3e4460f) ) | |
| 3343 | ROM_LOAD( "mpr-21674.ic4", 0x2000000, 0x800000, CRC(c2e2a98c) SHA1(9a40456ca025c2a6314cef705f7d147bbf95c0f0) ) | |
| 3344 | ROM_LOAD( "mpr-21675.ic5", 0x2800000, 0x800000, CRC(6b755510) SHA1(3fa967587e05c5bd45db3fe8a2cbc56f44166ef6) ) | |
| 3345 | ROM_LOAD( "mpr-21676.ic6", 0x3000000, 0x800000, CRC(f33d1f39) SHA1(b1d589a9ab7ec4988e63bfb458ef006308e1de70) ) | |
| 3346 | ROM_LOAD( "mpr-21677.ic7", 0x3800000, 0x800000, CRC(ab4dc61b) SHA1(d92ff434e7a2b9d3598f9d7004aa717b9bd21980) ) | |
| 3347 | ROM_LOAD( "mpr-21678.ic10", 0x5000000, 0x800000, CRC(297c778a) SHA1(67e5685cd03a3aaaac1c47f15c7b3f3e341d34b1) ) | |
| 3348 | ROM_LOAD( "mpr-21679.ic11", 0x5800000, 0x800000, CRC(6b540c4a) SHA1(9877c31b41110230182c0ee8d40753907981c7f9) ) | |
| 3349 | ROM_LOAD( "mpr-21680.ic12s", 0x6000000, 0x800000, CRC(e76f03f9) SHA1(ea20aa86d02a77315cca8cb6be75ca4ca9cc7484) ) | |
| 3350 | ROM_LOAD( "mpr-21681.ic13s", 0x6800000, 0x800000, CRC(e5dcde7d) SHA1(8a90d9fb4ce0d2ceb609fcf4c54cf5b55c266c50) ) | |
| 3351 | ROM_LOAD( "mpr-21682.ic14s", 0x7000000, 0x800000, CRC(54c0290e) SHA1(6e07ab6e95c29a2aabed0ba1a7af0d7d605e0309) ) | |
| 3352 | ROM_LOAD( "mpr-21683.ic15s", 0x7800000, 0x800000, CRC(ac8a27e0) SHA1(8e71d853a102dd6c164d5326e6d157ccfb8c7b36) ) | |
| 3467 | 3353 | ROM_END |
| 3468 | 3354 | |
| 3469 | 3355 | /* Jambo! Safari */ |
| r7500 | r7501 | |
| 3473 | 3359 | NAOMI_DEFAULT_EEPROM |
| 3474 | 3360 | |
| 3475 | 3361 | ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF) |
| 3476 | ROM_LOAD( "epr22826a.bin", 0x0000000, 0x400000, CRC(18f8f3bc) SHA1(417f2282c9970775e51b56d2eeb671a50ca293a7) ) | |
| 3477 | ROM_LOAD( "mpr22818.ic1", 0x0800000, 0x800000, CRC(3a709e11) SHA1(e7dd71dd244e872c35595456bd428dd79a81f081) ) | |
| 3478 | ROM_LOAD( "mpr22819.ic2", 0x1000000, 0x800000, CRC(57b2d565) SHA1(be5e6404c8187dc75cd6f033a36af413bf28bdee) ) | |
| 3479 | ROM_LOAD( "mpr22820.ic3", 0x1800000, 0x800000, CRC(3284e16b) SHA1(bdf9249f19c0a444a9f00e831563e91c576a7cca) ) | |
| 3480 | ROM_LOAD( "mpr22821.ic4", 0x2000000, 0x800000, CRC(5ca54154) SHA1(7bb1ba3fae71368145fd68d31bdce0588f641f78) ) | |
| 3481 | ROM_LOAD( "mpr22822.ic5", 0x2800000, 0x800000, CRC(8bc0c4d5) SHA1(b250ddeaab904b15737f1348b62d7b3f11103609) ) | |
| 3482 | ROM_LOAD( "mpr22823.ic6", 0x3000000, 0x800000, CRC(00c33e51) SHA1(c55646a146ed259e6c61fd912c93fa784b5e6910) ) | |
| 3483 | ROM_LOAD( "mpr22824.ic7", 0x3800000, 0x800000, CRC(cc55304a) SHA1(e548d8de83469e5816c55dbbb00afbb894282fd6) ) | |
| 3484 | ROM_LOAD( "mpr22825.ic8", 0x4000000, 0x800000, CRC(85bada10) SHA1(b6e15d8f1d6bca12ffa4816ed0393c04ca500fba) ) | |
| 3485 | ||
| 3486 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3487 | ROM_LOAD( "a03ff000.bin", 0x000000, 0x000500, CRC(74ffc580) SHA1(8de297303b14a6773c0d944de1bc1dcc3b1d042e) ) | |
| 3362 | ROM_LOAD( "epr-22826a.ic22", 0x0000000, 0x400000, CRC(18f8f3bc) SHA1(417f2282c9970775e51b56d2eeb671a50ca293a7) ) | |
| 3363 | ROM_LOAD( "mpr-22818.ic1", 0x0800000, 0x800000, CRC(3a709e11) SHA1(e7dd71dd244e872c35595456bd428dd79a81f081) ) | |
| 3364 | ROM_LOAD( "mpr-22819.ic2", 0x1000000, 0x800000, CRC(57b2d565) SHA1(be5e6404c8187dc75cd6f033a36af413bf28bdee) ) | |
| 3365 | ROM_LOAD( "mpr-22820.ic3", 0x1800000, 0x800000, CRC(3284e16b) SHA1(bdf9249f19c0a444a9f00e831563e91c576a7cca) ) | |
| 3366 | ROM_LOAD( "mpr-22821.ic4", 0x2000000, 0x800000, CRC(5ca54154) SHA1(7bb1ba3fae71368145fd68d31bdce0588f641f78) ) | |
| 3367 | ROM_LOAD( "mpr-22822.ic5", 0x2800000, 0x800000, CRC(8bc0c4d5) SHA1(b250ddeaab904b15737f1348b62d7b3f11103609) ) | |
| 3368 | ROM_LOAD( "mpr-22823.ic6", 0x3000000, 0x800000, CRC(00c33e51) SHA1(c55646a146ed259e6c61fd912c93fa784b5e6910) ) | |
| 3369 | ROM_LOAD( "mpr-22824.ic7", 0x3800000, 0x800000, CRC(cc55304a) SHA1(e548d8de83469e5816c55dbbb00afbb894282fd6) ) | |
| 3370 | ROM_LOAD( "mpr-22825.ic8", 0x4000000, 0x800000, CRC(85bada10) SHA1(b6e15d8f1d6bca12ffa4816ed0393c04ca500fba) ) | |
| 3488 | 3371 | ROM_END |
| 3489 | 3372 | |
| 3490 | 3373 | /* 18 Wheeler */ |
| r7500 | r7501 | |
| 3494 | 3377 | NAOMI_DEFAULT_EEPROM |
| 3495 | 3378 | |
| 3496 | 3379 | ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) |
| 3497 | ROM_LOAD( "epr22185.bin", 0x0000000, 0x400000, CRC(219b29b0) SHA1(2f32caf3906fc1408fd8126a500e74c682ff20fa) ) | |
| 3498 | ROM_LOAD( "mpr22164.ic1", 0x0800000, 0x800000, CRC(ca045315) SHA1(0c5becb5220659fa86f1e7901032f8c9a1329a51) ) | |
| 3499 | ROM_LOAD( "mpr22165.ic2", 0x1000000, 0x800000, CRC(e43f4ba8) SHA1(768159bccae6a72c809e9f374538df304c92fbfe) ) | |
| 3500 | ROM_LOAD( "mpr22166.ic3", 0x1800000, 0x800000, CRC(ea67edb1) SHA1(1214fdbfd8ce9f7a2b33e97f7c4e22ebb3eee988) ) | |
| 3501 | ROM_LOAD( "mpr22167.ic4", 0x2000000, 0x800000, CRC(df6125e2) SHA1(7244278cf89b88dbc7b8b1e3a537bf0b3f521c3a) ) | |
| 3502 | ROM_LOAD( "mpr22168.ic5", 0x2800000, 0x800000, CRC(8a919f9c) SHA1(28f1f9d8943e0a0b7bc186808cdab5d21d914e05) ) | |
| 3503 | ROM_LOAD( "mpr22169.ic6", 0x3000000, 0x800000, CRC(a0fa7d68) SHA1(010fc87f0df3cf9e3d01a5ca4d4aa7e84728652d) ) | |
| 3504 | ROM_LOAD( "mpr22170.ic7", 0x3800000, 0x800000, CRC(1f407049) SHA1(3c11b25168715d200f8d78a3db7bfc8cb3c29897) ) | |
| 3505 | ROM_LOAD( "mpr22171.ic8", 0x4000000, 0x800000, CRC(03ce8dcd) SHA1(9bf1eb0a2628317bea5d8899e34f6f4363729c52) ) | |
| 3506 | ROM_LOAD( "mpr22172.ic9", 0x4800000, 0x800000, CRC(c3e8c978) SHA1(96cbaa0f13e22365b04818cb5cad2ddc2027e38a) ) | |
| 3507 | ROM_LOAD( "mpr22173.ic10", 0x5000000, 0x800000, CRC(3caec8fc) SHA1(88ee6b0a1735788570d0a6507eec14a31ebabb9a) ) | |
| 3508 | ROM_LOAD( "mpr22174.ic11", 0x5800000, 0x800000, CRC(17245a27) SHA1(b3701155b1bbdbcbfb5ea686470c3c432d2573b7) ) | |
| 3509 | ROM_LOAD( "mpr22175.ic12s", 0x6000000, 0x800000, CRC(4d984682) SHA1(60270d6caa3bbc0025a0c01cf4d7b10783216e0b) ) | |
| 3510 | ROM_LOAD( "mpr22176.ic13s", 0x6800000, 0x800000, CRC(3ea2403f) SHA1(efde74c621a8fe17d8aa3a24da35e2ca6bc0bd9a) ) | |
| 3511 | ROM_LOAD( "mpr22177.ic14s", 0x7000000, 0x800000, CRC(15514cbc) SHA1(0171d67560b8d72ca3f718dcce301acc60dee1fa) ) | |
| 3512 | ROM_LOAD( "mpr22178.ic15s", 0x7800000, 0x800000, CRC(9ea0552f) SHA1(4b282110ef9f60f942518f3849acfff4a5faf4bd) ) | |
| 3513 | ROM_LOAD( "mpr22179.ic16s", 0x8000000, 0x800000, CRC(6915c4e6) SHA1(b44d49edcfdc0f2958bf1a3856b09b5442e8f1a3) ) | |
| 3514 | ROM_LOAD( "mpr22180.ic17s", 0x8800000, 0x800000, CRC(744c3a40) SHA1(56fba6ebc45d542ba6e4f4dd205194344f127ac2) ) | |
| 3515 | ROM_LOAD( "mpr22181.ic18s", 0x9000000, 0x800000, CRC(5a39b68e) SHA1(0f81ed1116b1829262f320fc82f93df107b6f848) ) | |
| 3516 | ROM_LOAD( "mpr22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) | |
| 3517 | ROM_LOAD( "mpr22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) | |
| 3380 | ROM_LOAD( "epr-22185.ic22", 0x0000000, 0x400000, CRC(219b29b0) SHA1(2f32caf3906fc1408fd8126a500e74c682ff20fa) ) | |
| 3381 | ROM_LOAD( "mpr-22164.ic1", 0x0800000, 0x800000, CRC(ca045315) SHA1(0c5becb5220659fa86f1e7901032f8c9a1329a51) ) | |
| 3382 | ROM_LOAD( "mpr-22165.ic2", 0x1000000, 0x800000, CRC(e43f4ba8) SHA1(768159bccae6a72c809e9f374538df304c92fbfe) ) | |
| 3383 | ROM_LOAD( "mpr-22166.ic3", 0x1800000, 0x800000, CRC(ea67edb1) SHA1(1214fdbfd8ce9f7a2b33e97f7c4e22ebb3eee988) ) | |
| 3384 | ROM_LOAD( "mpr-22167.ic4", 0x2000000, 0x800000, CRC(df6125e2) SHA1(7244278cf89b88dbc7b8b1e3a537bf0b3f521c3a) ) | |
| 3385 | ROM_LOAD( "mpr-22168.ic5", 0x2800000, 0x800000, CRC(8a919f9c) SHA1(28f1f9d8943e0a0b7bc186808cdab5d21d914e05) ) | |
| 3386 | ROM_LOAD( "mpr-22169.ic6", 0x3000000, 0x800000, CRC(a0fa7d68) SHA1(010fc87f0df3cf9e3d01a5ca4d4aa7e84728652d) ) | |
| 3387 | ROM_LOAD( "mpr-22170.ic7", 0x3800000, 0x800000, CRC(1f407049) SHA1(3c11b25168715d200f8d78a3db7bfc8cb3c29897) ) | |
| 3388 | ROM_LOAD( "mpr-22171.ic8", 0x4000000, 0x800000, CRC(03ce8dcd) SHA1(9bf1eb0a2628317bea5d8899e34f6f4363729c52) ) | |
| 3389 | ROM_LOAD( "mpr-22172.ic9", 0x4800000, 0x800000, CRC(c3e8c978) SHA1(96cbaa0f13e22365b04818cb5cad2ddc2027e38a) ) | |
| 3390 | ROM_LOAD( "mpr-22173.ic10", 0x5000000, 0x800000, CRC(3caec8fc) SHA1(88ee6b0a1735788570d0a6507eec14a31ebabb9a) ) | |
| 3391 | ROM_LOAD( "mpr-22174.ic11", 0x5800000, 0x800000, CRC(17245a27) SHA1(b3701155b1bbdbcbfb5ea686470c3c432d2573b7) ) | |
| 3392 | ROM_LOAD( "mpr-22175.ic12s", 0x6000000, 0x800000, CRC(4d984682) SHA1(60270d6caa3bbc0025a0c01cf4d7b10783216e0b) ) | |
| 3393 | ROM_LOAD( "mpr-22176.ic13s", 0x6800000, 0x800000, CRC(3ea2403f) SHA1(efde74c621a8fe17d8aa3a24da35e2ca6bc0bd9a) ) | |
| 3394 | ROM_LOAD( "mpr-22177.ic14s", 0x7000000, 0x800000, CRC(15514cbc) SHA1(0171d67560b8d72ca3f718dcce301acc60dee1fa) ) | |
| 3395 | ROM_LOAD( "mpr-22178.ic15s", 0x7800000, 0x800000, CRC(9ea0552f) SHA1(4b282110ef9f60f942518f3849acfff4a5faf4bd) ) | |
| 3396 | ROM_LOAD( "mpr-22179.ic16s", 0x8000000, 0x800000, CRC(6915c4e6) SHA1(b44d49edcfdc0f2958bf1a3856b09b5442e8f1a3) ) | |
| 3397 | ROM_LOAD( "mpr-22180.ic17s", 0x8800000, 0x800000, CRC(744c3a40) SHA1(56fba6ebc45d542ba6e4f4dd205194344f127ac2) ) | |
| 3398 | ROM_LOAD( "mpr-22181.ic18s", 0x9000000, 0x800000, CRC(5a39b68e) SHA1(0f81ed1116b1829262f320fc82f93df107b6f848) ) | |
| 3399 | ROM_LOAD( "mpr-22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) | |
| 3400 | ROM_LOAD( "mpr-22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) | |
| 3518 | 3401 | |
| 3519 | 3402 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 3520 | 3403 | ROM_LOAD( "00800000.bin", 0x000000, 0x002000, CRC(7fc42084) SHA1(7c7b9e7e0b8885e690f3edd25e6d26201c899f2f) ) |
| r7500 | r7501 | |
| 3660 | 3543 | ROM_LOAD( "mpr-23545.ic9", 0x8800000, 0x1000000, CRC(60bd692f) SHA1(37b508f4a821d832eafff81574e7df3fe1c729f8) ) |
| 3661 | 3544 | ROM_LOAD( "mpr-23546.ic10", 0x9800000, 0x1000000, CRC(85db2248) SHA1(37845c269a2e65ee6181a8e7500c2e7dd9b2e343) ) |
| 3662 | 3545 | ROM_LOAD( "mpr-23547.ic11", 0xa800000, 0x1000000, CRC(18b369c7) SHA1(b61cb3fda8cc685865684f7afc7dad0b29d93ca5) ) |
| 3663 | ||
| 3664 | // trojaned protection data (filename is address read from) | |
| 3665 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3666 | ROM_LOAD( "a0820000.bin", 0x000000, 0x00267e, CRC(15db53ed) SHA1(a28ba1abc77ca559cff2fd34f3499c556ad8674e) ) | |
| 3667 | ROM_LOAD( "a0920000.bin", 0x010000, 0x00c91c, CRC(431436f8) SHA1(0136d6b210689b2023f982300bc8842b5c0914b4) ) | |
| 3668 | ROM_LOAD( "a092c920.bin", 0x020000, 0x00a53c, CRC(43e1a419) SHA1(34020cc7b10a1c5b2860db84d133489bce53d3d4) ) | |
| 3669 | ROM_LOAD( "a0936e60.bin", 0x030000, 0x001a32, CRC(2a998df6) SHA1(c7bed2777b2358bc0f1d7a3c23f3029591eb674d) ) | |
| 3670 | ROM_LOAD( "a3480000.bin", 0x040000, 0x008e9c, CRC(c8939e48) SHA1(a8d26c2b32211a50b8cc49b51c0d2e34416cc715) ) | |
| 3671 | 3546 | ROM_END |
| 3672 | 3547 | |
| 3673 | 3548 | /* |
| r7500 | r7501 | |
| 3749 | 3624 | ROM_LOAD("mpr-23124.ic7", 0x3800000, 0x0800000, CRC(508c0207) SHA1(e50d97a17cdd6771fbc63a254a4d638e7daa8f57) ) |
| 3750 | 3625 | ROM_LOAD("mpr-23125.ic8", 0x4000000, 0x0800000, CRC(b9938bbc) SHA1(d55d7adecb5a5a4a276a5a17c12808085d980fd9) ) |
| 3751 | 3626 | ROM_LOAD("mpr-23126.ic9", 0x4800000, 0x0800000, CRC(fbb0325b) SHA1(21b965519d7508d84344641d43e8af2c3ca29ba4) ) |
| 3752 | ||
| 3753 | // trojaned protection data (filename is address read from) | |
| 3754 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3755 | ROM_LOAD( "a2785e20.bin", 0x000000, 0x0072f0, CRC(52912418) SHA1(ec0992eda50953001801d152e09195a17132cb0f) ) | |
| 3756 | ROM_LOAD( "a2765e00.bin", 0x010000, 0x00e47c, CRC(d9acaa94) SHA1(6ab7ebc2dd78c0bc007f3656a67f3c24d23d48ae) ) | |
| 3757 | ROM_LOAD( "a2774280.bin", 0x020000, 0x00c61c, CRC(8dd9581f) SHA1(f852c44e423effa894769d3e156325a132b2df8e) ) | |
| 3758 | ROM_LOAD( "a27808a0.bin", 0x030000, 0x005568, CRC(4f4aee03) SHA1(453c0ec08ca69ad844f24be290e92bf16231a713) ) | |
| 3759 | ROM_LOAD( "a154bdc0.bin", 0x040000, 0x00ec9c, CRC(755a7343) SHA1(a4355850e1cb6f81d53d461e70884a5c51083454) ) | |
| 3760 | ROM_LOAD( "a155aa60.bin", 0x050000, 0x00951c, CRC(fc7a23d8) SHA1(a428114d89471f4b4c8af6d932376e7b0887c4cc) ) | |
| 3761 | ROM_LOAD( "a1563f80.bin", 0x060000, 0x009f3c, CRC(90903b9c) SHA1(da6fcda74710497bab97c4c8342d93b5dfb14184) ) | |
| 3762 | ROM_LOAD( "a156dec0.bin", 0x070000, 0x00dbdc, CRC(fb7b0b77) SHA1(ace73e925e5ffa3f805ff0ef68b564119cf4ce41) ) | |
| 3763 | ROM_LOAD( "a157baa0.bin", 0x080000, 0x00cb3c, CRC(60e5dad6) SHA1(db8880ebbc3ebb02d861aa3bcf2cc34071d613e8) ) | |
| 3764 | ROM_LOAD( "a15885e0.bin", 0x090000, 0x00e91c, CRC(6b2e1400) SHA1(8965e97e3d85a568c2bef2d1d0faf5b8aee289d0) ) | |
| 3765 | ROM_LOAD( "a1596f00.bin", 0x0a0000, 0x00a3bc, CRC(cf538afa) SHA1(b7f94195760a0b14c18654823ead2e28fe526b07) ) | |
| 3766 | ROM_LOAD( "a15a12c0.bin", 0x0b0000, 0x007f04, CRC(e07d589b) SHA1(60bc7f3e91d1f22b4854777644add346e5df58bb) ) | |
| 3767 | ROM_LOAD( "a15a91e0.bin", 0x0c0000, 0x00c91c, CRC(124fce0b) SHA1(8949df4586c736e22c88b7594221ae114848284a) ) | |
| 3768 | ROM_LOAD( "a15b5b00.bin", 0x0d0000, 0x00a53c, CRC(453bb126) SHA1(d5251f54e80504f3c427f6cc3443fe56edcd62c0) ) | |
| 3769 | ROM_LOAD( "a15c0040.bin", 0x0e0000, 0x0088e0, CRC(7d601fb3) SHA1(ff2aca546e0db05b79f48fdb086f0e8e7e0853e4) ) | |
| 3770 | ROM_LOAD( "a16203e0.bin", 0x0f0000, 0x00c61c, CRC(300c8e1e) SHA1(25f9c4af3bed0da5fc9e440096fb5cf4c29a89b3) ) | |
| 3771 | ROM_LOAD( "a162ca00.bin", 0x100000, 0x009e9c, CRC(8f0ccd81) SHA1(0ae2209912e31195bb8110e28d0791fc398b49cd) ) | |
| 3772 | ROM_LOAD( "a16368a0.bin", 0x110000, 0x00b2dc, CRC(e497f060) SHA1(05d8ffc0ead6c31ddc3197c877466fec354a71d9) ) | |
| 3773 | ROM_LOAD( "a1641b80.bin", 0x120000, 0x00ac5c, CRC(e6d81d57) SHA1(97cfe0b14e1e23c7428dad426848de3fe2496ddb) ) | |
| 3774 | ROM_LOAD( "a164c7e0.bin", 0x130000, 0x008b7c, CRC(ab6ca421) SHA1(84979f01f82f34a9d708b645e9f2cc45abed03a9) ) | |
| 3775 | ROM_LOAD( "a1655360.bin", 0x140000, 0x00c8bc, CRC(c5554803) SHA1(06b712aed14a489d167876217cec48ad0aee495f) ) | |
| 3776 | ROM_LOAD( "a1661c20.bin", 0x150000, 0x0083dc, CRC(4f5abf07) SHA1(3d03f8728ce445b6070f182d84f843f08420ad05) ) | |
| 3777 | ROM_LOAD( "a166a000.bin", 0x160000, 0x00f73c, CRC(bfddc3bf) SHA1(a89bdebefaffc235e163a022d85b7c3bdbffcaf6) ) | |
| 3778 | ROM_LOAD( "a1679740.bin", 0x170000, 0x00fb5c, CRC(ec9889a5) SHA1(d7f04b62a8a78b3bfc9a25f1b21be08dcb986546) ) | |
| 3779 | ROM_LOAD( "a1688d00.bin", 0x180000, 0x00e080, CRC(ad7adaf6) SHA1(516858081ebab25ef0561e4b0f8842026504c5dd) ) | |
| 3780 | ROM_LOAD( "a1696d80.bin", 0x190000, 0x007c10, CRC(4e0c7365) SHA1(0d564956c8330aa57c504a247aef6a230b1e8884) ) | |
| 3781 | 3627 | ROM_END |
| 3782 | 3628 | |
| 3783 | 3629 | |
| r7500 | r7501 | |
| 3879 | 3725 | ROM_LOAD32_WORD("mpr-23225.ic31", 0x8000000, 0x0800000, CRC(ea558614) SHA1(b7dfe5598639a8e59e3cbbee38b1d9a1d8e022ea) ) //ic 16 |
| 3880 | 3726 | ROM_LOAD32_WORD("mpr-23226.ic32", 0x8000002, 0x0800000, CRC(cd5da506) SHA1(2e76c8892c1d389b0f12a0046213f43d2ab07d78) ) //ic 17 |
| 3881 | 3727 | |
| 3728 | ROM_COPY( "user1", 0x1400000, 0x0800000, 0x0800000 ) // mirror data for IC1 (no test on this game, but layout is the same as gram2000) | |
| 3729 | ||
| 3882 | 3730 | // trojaned protection data (must be in the "user1" region because it's accessed via DMA) |
| 3883 | 3731 | ROM_LOAD( "81452000_dma.bin", 0x9000000, 0x000120, CRC(96049488) SHA1(e2b98e8986f8cbf026db50a652300081a8e470b0) ) |
| 3884 | 3732 | ROM_END |
| r7500 | r7501 | |
| 3981 | 3829 | NAOMI_DEFAULT_EEPROM |
| 3982 | 3830 | |
| 3983 | 3831 | ROM_REGION( 0x2800000, "user1", ROMREGION_ERASEFF) |
| 3984 | ROM_LOAD("epr-a-24065. | |
| 3832 | ROM_LOAD("epr-a-24065. | |
| 3985 | 3833 | ROM_RELOAD( 0x400000, 0x400000) |
| 3986 | ROM_LOAD32_WORD("opr-24060.rom1.ic17s", 0x0800000, 0x0800000, CRC(7f3d868c) SHA1(dc352981371c5479a69756bb1cbbbca43252216d) ) | |
| 3987 | ROM_LOAD32_WORD("opr-24061.rom2.ic18", 0x0800002, 0x0800000, CRC(e934267c) SHA1(fdbe2b80e309aa8d9fefd2634aef20153735019d) ) | |
| 3988 | ROM_LOAD32_WORD("opr-24062.rom3.ic19s", 0x1800000, 0x0800000, CRC(26e32af4) SHA1(49412a04198175240ef9adb4b7afb8a628eb127d) ) | |
| 3989 | ROM_LOAD32_WORD("opr-24063.rom4.ic20", 0x1800002, 0x0800000, CRC(683fdcff) SHA1(890816ef1b3e604e16289998cf66e221ef75a0fe) ) | |
| 3834 | ROM_LOAD32_WORD("opr-24060.ic17s", 0x0800000, 0x0800000, CRC(7f3d868c) SHA1(dc352981371c5479a69756bb1cbbbca43252216d) ) | |
| 3835 | ROM_LOAD32_WORD("opr-24061.ic18", 0x0800002, 0x0800000, CRC(e934267c) SHA1(fdbe2b80e309aa8d9fefd2634aef20153735019d) ) | |
| 3836 | ROM_LOAD32_WORD("opr-24062.ic19s", 0x1800000, 0x0800000, CRC(26e32af4) SHA1(49412a04198175240ef9adb4b7afb8a628eb127d) ) | |
| 3837 | ROM_LOAD32_WORD("opr-24063.ic20", 0x1800002, 0x0800000, CRC(683fdcff) SHA1(890816ef1b3e604e16289998cf66e221ef75a0fe) ) | |
| 3990 | 3838 | ROM_END |
| 3991 | 3839 | |
| 3992 | 3840 | // SHOOTOUT POOL (the original, the above set is a sequel) |
| r7500 | r7501 | |
| 3996 | 3844 | NAOMI_DEFAULT_EEPROM |
| 3997 | 3845 | |
| 3998 | 3846 | ROM_REGION( 0x2800000, "user1", ROMREGION_ERASEFF) |
| 3999 | ROM_LOAD( "epr23844. | |
| 3847 | ROM_LOAD( "epr-23844. | |
| 4000 | 3848 | ROM_RELOAD( 0x400000, 0x400000) |
| 4001 | ROM_LOAD32_WORD( "mpr23840.17s", 0x0800000, 0x800000, CRC(985e5ff4) SHA1(a6f529b1855cc2aef3bed8503746c2e38061f944) ) | |
| 4002 | ROM_LOAD32_WORD( "mpr23841.18", 0x0800002, 0x800000, CRC(255fc335) SHA1(34ffec963880383bb9c02642f73ba3c852699831) ) | |
| 4003 | ROM_LOAD32_WORD( "mpr23842.19s", 0x1800000, 0x800000, CRC(80724895) SHA1(ed4fa1160b35b3987702c0178bd31c3c5db69e6e) ) | |
| 4004 | ROM_LOAD32_WORD( "mpr23843.20", 0x1800002, 0x800000, CRC(3574f616) SHA1(40130e8f98fb31c98428d444b79491f6a06ac208) ) | |
| 3849 | ROM_LOAD32_WORD( "mpr-23840.17s", 0x0800000, 0x800000, CRC(985e5ff4) SHA1(a6f529b1855cc2aef3bed8503746c2e38061f944) ) | |
| 3850 | ROM_LOAD32_WORD( "mpr-23841.18", 0x0800002, 0x800000, CRC(255fc335) SHA1(34ffec963880383bb9c02642f73ba3c852699831) ) | |
| 3851 | ROM_LOAD32_WORD( "mpr-23842.19s", 0x1800000, 0x800000, CRC(80724895) SHA1(ed4fa1160b35b3987702c0178bd31c3c5db69e6e) ) | |
| 3852 | ROM_LOAD32_WORD( "mpr-23843.20", 0x1800002, 0x800000, CRC(3574f616) SHA1(40130e8f98fb31c98428d444b79491f6a06ac208) ) | |
| 4005 | 3853 | ROM_END |
| 4006 | 3854 | |
| 4007 | 3855 | /* |
| r7500 | r7501 | |
| 4297 | 4145 | ROM_LOAD( "mpr-22267.ic6", 0x5800000, 0x1000000, CRC(67ec1027) SHA1(2432b33983bbc9b07477459adb5ee1a62b6c0ea3) ) |
| 4298 | 4146 | ROM_LOAD( "mpr-22268.ic7", 0x6800000, 0x1000000, CRC(536f5eea) SHA1(f1de8624f82595adf75693b604fb026bf3f778ee) ) |
| 4299 | 4147 | ROM_LOAD( "mpr-22269.ic8", 0x7800000, 0x1000000, CRC(6c0cf740) SHA1(da10b33a6e54afbe1d7e52801216e7119b0b33b1) ) |
| 4300 | ||
| 4301 | // trojaned protection data (filename is address read from) | |
| 4302 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 4303 | ROM_LOAD( "a24db210.bin", 0x000000, 0x00005e, CRC(79fc852b) SHA1(58229b71d1a7067dd6ce3a617edc7d8bdd132036) ) | |
| 4304 | 4148 | ROM_END |
| 4305 | 4149 | |
| 4306 | 4150 | /* |
| r7500 | r7501 | |
| 4404 | 4248 | NAOMI_DEFAULT_EEPROM |
| 4405 | 4249 | |
| 4406 | 4250 | ROM_REGION( 0x10000000, "user1", ROMREGION_ERASEFF) |
| 4407 | ROM_LOAD( "epr22327a.bin", 0x000000, 0x400000, CRC(e949004c) SHA1(54db84c3e1db30b233612f68dcd094b597deffd0) ) | |
| 4408 | ROM_LOAD32_WORD( "mpr22307.17s", 0x0800000, 0x800000, CRC(db5c0818) SHA1(d39d2241adeb962d68bfb76a9d1c0dcd538c3538) ) | |
| 4409 | ROM_LOAD32_WORD( "mpr22308.18", 0x0800002, 0x800000, CRC(ac996a0e) SHA1(5cf110b79ef250cd64919205874278b4a85a42f6) ) | |
| 4410 | ROM_LOAD32_WORD( "mpr22309.19s", 0x1800000, 0x800000, CRC(fba79592) SHA1(09f2be133cf503e6f5e13eef1b1e38c268529b68) ) | |
| 4411 | ROM_LOAD32_WORD( "mpr22310.20", 0x1800002, 0x800000, CRC(10876476) SHA1(590fd5532c72c67e285a12acd33e828f2e1ff5b1) ) | |
| 4412 | ROM_LOAD32_WORD( "mpr22311.21s", 0x2800000, 0x800000, CRC(ad735e61) SHA1(6d340ae2f8fe44b82b1bbace02b5c10e89e40400) ) | |
| 4413 | ROM_LOAD32_WORD( "mpr22312.22", 0x2800002, 0x800000, CRC(46830ffa) SHA1(89b843588a48352b958a70e85deb625c19a2fcc7) ) | |
| 4414 | ROM_LOAD32_WORD( "mpr22313.23s", 0x3800000, 0x800000, CRC(44900a20) SHA1(3a82938a81fd6634c51595479d59ae4215fb8af3) ) | |
| 4415 | ROM_LOAD32_WORD( "mpr22314.24", 0x3800002, 0x800000, CRC(3b0ba6e9) SHA1(0ee1dd2d67dd688de19b1ede00c48234994a4832) ) | |
| 4416 | ROM_LOAD32_WORD( "mpr22315.25s", 0x4800000, 0x800000, CRC(eebe4877) SHA1(bc13e50d85f51aa2baf3c00440a089a8aff998ef) ) | |
| 4417 | ROM_LOAD32_WORD( "mpr22316.26", 0x4800002, 0x800000, CRC(0a82d403) SHA1(fc002210397eb792c27885d440671225d0bed71f) ) | |
| 4418 | ROM_LOAD32_WORD( "mpr22317.27s", 0x5800000, 0x800000, CRC(55ef3e71) SHA1(d7643c5d3bb6ccf4b35511be2b5c776fc46a2f45) ) | |
| 4419 | ROM_LOAD32_WORD( "mpr22318.28", 0x5800002, 0x800000, CRC(3dfabb96) SHA1(97863c939e5bb3e976c517839faa49bcfbee83c5) ) | |
| 4420 | ROM_LOAD32_WORD( "mpr22319.29s", 0x6800000, 0x800000, CRC(9b92fd02) SHA1(19c9b279aca1aa6575047494ce26a36dbc93812f) ) | |
| 4421 | ROM_LOAD32_WORD( "mpr22320.30", 0x6800002, 0x800000, CRC(9b762f6e) SHA1(7f787a89574e45f529970377e8b6394472cd001b) ) | |
| 4422 | ROM_LOAD32_WORD( "mpr22321.31s", 0x7800000, 0x800000, CRC(5ce2b3f1) SHA1(9bac49167ced0415ab3b2cac20c7bcf205aecfdf) ) | |
| 4423 | ROM_LOAD32_WORD( "mpr22322.32", 0x7800002, 0x800000, CRC(21bf1caf) SHA1(bc1828db2f5f71ef87153a81b49b2ba72ba176e1) ) | |
| 4424 | ROM_LOAD32_WORD( "mpr22323.33s", 0x8800000, 0x800000, CRC(0bd632ab) SHA1(21acab5336dd0ba317839176f2557df95917729e) ) | |
| 4425 | ROM_LOAD32_WORD( "mpr22324.34", 0x8800002, 0x800000, CRC(ff2571d4) SHA1(c2cbb2345163bbf1973e63cefb9a952e5a52a6cf) ) | |
| 4251 | ROM_LOAD( "epr-22327a.bin", 0x000000, 0x400000, CRC(e949004c) SHA1(54db84c3e1db30b233612f68dcd094b597deffd0) ) | |
| 4252 | ROM_LOAD32_WORD( "mpr-22307.17s", 0x0800000, 0x800000, CRC(db5c0818) SHA1(d39d2241adeb962d68bfb76a9d1c0dcd538c3538) ) | |
| 4253 | ROM_LOAD32_WORD( "mpr-22308.18", 0x0800002, 0x800000, CRC(ac996a0e) SHA1(5cf110b79ef250cd64919205874278b4a85a42f6) ) | |
| 4254 | ROM_LOAD32_WORD( "mpr-22309.19s", 0x1800000, 0x800000, CRC(fba79592) SHA1(09f2be133cf503e6f5e13eef1b1e38c268529b68) ) | |
| 4255 | ROM_LOAD32_WORD( "mpr-22310.20", 0x1800002, 0x800000, CRC(10876476) SHA1(590fd5532c72c67e285a12acd33e828f2e1ff5b1) ) | |
| 4256 | ROM_LOAD32_WORD( "mpr-22311.21s", 0x2800000, 0x800000, CRC(ad735e61) SHA1(6d340ae2f8fe44b82b1bbace02b5c10e89e40400) ) | |
| 4257 | ROM_LOAD32_WORD( "mpr-22312.22", 0x2800002, 0x800000, CRC(46830ffa) SHA1(89b843588a48352b958a70e85deb625c19a2fcc7) ) | |
| 4258 | ROM_LOAD32_WORD( "mpr-22313.23s", 0x3800000, 0x800000, CRC(44900a20) SHA1(3a82938a81fd6634c51595479d59ae4215fb8af3) ) | |
| 4259 | ROM_LOAD32_WORD( "mpr-22314.24", 0x3800002, 0x800000, CRC(3b0ba6e9) SHA1(0ee1dd2d67dd688de19b1ede00c48234994a4832) ) | |
| 4260 | ROM_LOAD32_WORD( "mpr-22315.25s", 0x4800000, 0x800000, CRC(eebe4877) SHA1(bc13e50d85f51aa2baf3c00440a089a8aff998ef) ) | |
| 4261 | ROM_LOAD32_WORD( "mpr-22316.26", 0x4800002, 0x800000, CRC(0a82d403) SHA1(fc002210397eb792c27885d440671225d0bed71f) ) | |
| 4262 | ROM_LOAD32_WORD( "mpr-22317.27s", 0x5800000, 0x800000, CRC(55ef3e71) SHA1(d7643c5d3bb6ccf4b35511be2b5c776fc46a2f45) ) | |
| 4263 | ROM_LOAD32_WORD( "mpr-22318.28", 0x5800002, 0x800000, CRC(3dfabb96) SHA1(97863c939e5bb3e976c517839faa49bcfbee83c5) ) | |
| 4264 | ROM_LOAD32_WORD( "mpr-22319.29s", 0x6800000, 0x800000, CRC(9b92fd02) SHA1(19c9b279aca1aa6575047494ce26a36dbc93812f) ) | |
| 4265 | ROM_LOAD32_WORD( "mpr-22320.30", 0x6800002, 0x800000, CRC(9b762f6e) SHA1(7f787a89574e45f529970377e8b6394472cd001b) ) | |
| 4266 | ROM_LOAD32_WORD( "mpr-22321.31s", 0x7800000, 0x800000, CRC(5ce2b3f1) SHA1(9bac49167ced0415ab3b2cac20c7bcf205aecfdf) ) | |
| 4267 | ROM_LOAD32_WORD( "mpr-22322.32", 0x7800002, 0x800000, CRC(21bf1caf) SHA1(bc1828db2f5f71ef87153a81b49b2ba72ba176e1) ) | |
| 4268 | ROM_LOAD32_WORD( "mpr-22323.33s", 0x8800000, 0x800000, CRC(0bd632ab) SHA1(21acab5336dd0ba317839176f2557df95917729e) ) | |
| 4269 | ROM_LOAD32_WORD( "mpr-22324.34", 0x8800002, 0x800000, CRC(ff2571d4) SHA1(c2cbb2345163bbf1973e63cefb9a952e5a52a6cf) ) | |
| 4426 | 4270 | |
| 4427 | 4271 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 4428 | 4272 | ROM_LOAD( "01f169c0.bin", 0x000000, 0x000100, CRC(b0a330f4) SHA1(10c7a7f4d6c7f265a32887beaca73686c4cb1e03) ) |
| r7500 | r7501 | |
| 4642 | 4486 | DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(615e19c22f32096f3aad557019a14313b60a4070) ) |
| 4643 | 4487 | |
| 4644 | 4488 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4489 | //ROM_LOAD("317-5069-com.data", 0x00, 0x50, CRC(8e2f0cbd) SHA1(a5f3a990a03bfa50a1a742593c5ec07645c8718d) ) | |
| 4490 | ||
| 4491 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4645 | 4492 | //PIC16C622A (317-5069-COM) |
| 4646 | 4493 | //(sticker 253-5509-5069) |
| 4647 | ROM_LOAD("317-5069-com.data", 0x00, 0x50, CRC(8e2f0cbd) SHA1(a5f3a990a03bfa50a1a742593c5ec07645c8718d) ) | |
| 4494 | ROM_LOAD("317-5069-com.pic", 0x00, 0x4000, CRC(44d0b242) SHA1(cac31c2ed317e2b44ee93d762188aacea2398949) ) | |
| 4495 | ||
| 4648 | 4496 | ROM_END |
| 4649 | 4497 | |
| 4650 | 4498 | |
| r7500 | r7501 | |
| 4658 | 4506 | DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(af4669fdd7ce8e6ec4a170748d401e322a3d7ae8) ) |
| 4659 | 4507 | |
| 4660 | 4508 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4509 | //ROM_LOAD("317-5072-com.data", 0x00, 0x50, CRC(6d2992b9) SHA1(88e6dc6711f9f883362ba1217a3350d452a70896) ) | |
| 4510 | ||
| 4511 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4661 | 4512 | //PIC16C622A (317-5072-COM) |
| 4662 | 4513 | //(sticker 253-5509-5072) |
| 4663 | ROM_LOAD("317-5072-com. | |
| 4514 | ROM_LOAD("317-5072-com.pic | |
| 4664 | 4515 | ROM_END |
| 4665 | 4516 | |
| 4666 | 4517 | ROM_START( cvsgd ) |
| r7500 | r7501 | |
| 4673 | 4524 | DISK_IMAGE_READONLY( "gdl-0004", 0, SHA1(7a7fba0fbbc769c5120b08e6d692f1ac63a42225) ) |
| 4674 | 4525 | |
| 4675 | 4526 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4527 | //ROM_LOAD("317-5076-jpn.data", 0x00, 0x50, CRC(5004161b) SHA1(8b2cdfec12ffd9160bc74659e08d07cbc46a4011) ) | |
| 4528 | ||
| 4529 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4676 | 4530 | //PIC16C622A (317-5076-JPN) |
| 4677 | 4531 | //(sticker 253-5509-5076J) |
| 4678 | ROM_LOAD("317-5076-jpn. | |
| 4532 | ROM_LOAD("317-5076-jpn.pic | |
| 4679 | 4533 | ROM_END |
| 4680 | 4534 | |
| 4681 | 4535 | |
| r7500 | r7501 | |
| 4689 | 4543 | DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b28d6598711b5a9c744bbf07ad03fc60962d2e28) ) |
| 4690 | 4544 | |
| 4691 | 4545 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4546 | //ROM_LOAD("317-5079-com.data", 0x00, 0x50, CRC(e6abe978) SHA1(700e610d84e517793a22d6cabd1aef9c3b8bc092) ) | |
| 4547 | ||
| 4548 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4692 | 4549 | //PIC16C622A (317-5079-COM) |
| 4693 | 4550 | //(sticker 253-5509-5079) |
| 4694 | ROM_LOAD("317-5079-com. | |
| 4551 | ROM_LOAD("317-5079-com.pic | |
| 4695 | 4552 | ROM_END |
| 4696 | 4553 | |
| 4697 | 4554 | |
| r7500 | r7501 | |
| 4705 | 4562 | DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(56510390667b39b3915d8bc078660cbe093cf566) ) |
| 4706 | 4563 | |
| 4707 | 4564 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4565 | //ROM_LOAD("317-5078-com.data", 0x00, 0x50, CRC(1c8d94ee) SHA1(bec4a6901f62dc8f76f7b9d72284b3eaac340bf3) ) | |
| 4566 | ||
| 4567 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4708 | 4568 | //PIC16C622A (317-5078-COM) |
| 4709 | 4569 | //(sticker 253-5509-5078) |
| 4710 | ROM_LOAD("317-5078-com. | |
| 4570 | ROM_LOAD("317-5078-com.pic | |
| 4711 | 4571 | ROM_END |
| 4712 | 4572 | |
| 4713 | 4573 | ROM_START( ikaruga ) |
| r7500 | r7501 | |
| 4720 | 4580 | DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(65dcc22dd9e9b70975096464ad8e31a4a73dc5fd) ) |
| 4721 | 4581 | |
| 4722 | 4582 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4583 | //ROM_LOAD("317-5081-jpn.data", 0x00, 0x50, CRC(d4cc5c8c) SHA1(44c0c5c2744fbd419b684cbc36f01973487bafbc) ) | |
| 4584 | ||
| 4585 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4723 | 4586 | //PIC16C622A (317-5081-JPN) |
| 4724 | 4587 | //(sticker 253-5509-5081J) |
| 4725 | ROM_LOAD("317-5081-jpn. | |
| 4588 | ROM_LOAD("317-5081-jpn.pic | |
| 4726 | 4589 | ROM_END |
| 4727 | 4590 | |
| 4728 | 4591 | |
| r7500 | r7501 | |
| 4736 | 4599 | DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(b7328eb2c588d55284bdcea0fe89bb8e629a8669) ) |
| 4737 | 4600 | |
| 4738 | 4601 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4602 | // ROM_LOAD("317-5082-com.data", 0x00, 0x50, CRC(fa31209d) SHA1(bb18e6412a02510832f7200a06a3179ef1695ef2) ) | |
| 4603 | // ROM_REGION( 0x9a49, "pichex", ROMREGION_ERASE) | |
| 4604 | // ROM_LOAD("gdl-0011.hex", 0x00, 0x0009a49, CRC(36361df8) SHA1(86aa50c9b3debd49c7b67f1c9bfd052c0fefc593) ) // actual decap results for ggxx in ascii/hex form | |
| 4605 | ||
| 4606 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4739 | 4607 | //PIC16C622A (317-5082-COM) |
| 4740 | 4608 | //(sticker 253-5509-5082) |
| 4741 | ROM_LOAD("317-5082-com. | |
| 4609 | ROM_LOAD("317-5082-com.pic | |
| 4742 | 4610 | ROM_END |
| 4743 | 4611 | |
| 4744 | 4612 | |
| r7500 | r7501 | |
| 4752 | 4620 | DISK_IMAGE_READONLY( "gdl-0013", 0, SHA1(c8869069c28bc8eec96d820886bc388d69d46143) ) |
| 4753 | 4621 | |
| 4754 | 4622 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4623 | //ROM_LOAD("317-5084-jpn.data", 0x00, 0x50, CRC(56de2066) SHA1(a16a6d9f7272d3f8d322c85222a0487a87811910) ) | |
| 4624 | ||
| 4625 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4755 | 4626 | //PIC16C622A (317-5084-JPN) |
| 4756 | 4627 | //(sticker 253-5509-5084J) |
| 4757 | ROM_LOAD("317-5084-jpn.data", 0x00, 0x50, CRC(56de2066) SHA1(a16a6d9f7272d3f8d322c85222a0487a87811910) ) | |
| 4628 | ROM_LOAD("317-5084-jpn.pic", 0x00, 0x4000, CRC(db7dac1e) SHA1(b6f7afe9d9d2681005c1abcd4fde24867e65d1e4) ) | |
| 4629 | ||
| 4758 | 4630 | ROM_END |
| 4759 | 4631 | |
| 4760 | 4632 | |
| r7500 | r7501 | |
| 4768 | 4640 | DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(f88d8203c8692f51c9492d5549a3ad7d9583dc6f) ) |
| 4769 | 4641 | |
| 4770 | 4642 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4643 | //ROM_LOAD("317-5085-jpn.data", 0x00, 0x50, CRC(eecd8140) SHA1(471fb6b242eff646173265df891109e3e0a37a7d) ) | |
| 4644 | ||
| 4645 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4771 | 4646 | //PIC16C622A (317-5085-JPN) |
| 4772 | 4647 | //(sticker 253-5509-5085J) |
| 4773 | ROM_LOAD("317-5085-jpn. | |
| 4648 | ROM_LOAD("317-5085-jpn.pic | |
| 4774 | 4649 | ROM_END |
| 4775 | 4650 | |
| 4776 | 4651 | |
| r7500 | r7501 | |
| 4784 | 4659 | DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(94a9319633388968611892e36691b45c94b4f83f) ) |
| 4785 | 4660 | |
| 4786 | 4661 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4662 | //ROM_LOAD("317-5090-jpn.data", 0x00, 0x50, CRC(b4dd88f6) SHA1(c9aacd79c1088225fa5a69b7bd31a7c1286160e1) ) | |
| 4663 | ||
| 4664 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4787 | 4665 | //PIC16C622A (317-5090-JPN) |
| 4788 | 4666 | //(sticker 253-5509-5090J) |
| 4789 | ROM_LOAD("317-5090-jpn. | |
| 4667 | ROM_LOAD("317-5090-jpn.pic | |
| 4790 | 4668 | ROM_END |
| 4791 | 4669 | |
| 4670 | ROM_START( azumanga ) | |
| 4671 | NAOMIGD_BIOS | |
| 4672 | NAOMI_DEFAULT_EEPROM | |
| 4792 | 4673 | |
| 4674 | ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? | |
| 4675 | ||
| 4676 | DISK_REGION( "gdrom" ) | |
| 4677 | DISK_IMAGE_READONLY( "gdl-0018", 0, SHA1(3e40ca7d43173fe7048d199fdc127b9411e10360) ) | |
| 4678 | ||
| 4679 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 4680 | //PIC16C622A (317-5091-JPN) | |
| 4681 | //(sticker 253-5509-5091J) | |
| 4682 | ROM_LOAD("317-5091-jpn.data", 0x00, 0x50, CRC(ca589c79) SHA1(ac44bfdfc8db2f9dbe4d563205719524bf43a674) ) | |
| 4683 | ROM_END | |
| 4684 | ||
| 4793 | 4685 | ROM_START( ggxxrl ) |
| 4794 | 4686 | NAOMIGD_BIOS |
| 4795 | 4687 | NAOMI_DEFAULT_EEPROM |
| r7500 | r7501 | |
| 4800 | 4692 | DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(d44906505ff698eda6feee6c2b9402e19f64e5d3) ) |
| 4801 | 4693 | |
| 4802 | 4694 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4695 | //ROM_LOAD("317-5092-jpn.data", 0x00, 0x50, CRC(7c8cca4b) SHA1(92c5a0fd8916744eefc023e64daea69803573928) ) | |
| 4696 | ||
| 4697 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4803 | 4698 | //PIC16C622A (317-5092-JPN) |
| 4804 | 4699 | //(sticker 253-5509-5092J) |
| 4805 | ROM_LOAD("317-5092-jpn. | |
| 4700 | ROM_LOAD("317-5092-jpn.pic | |
| 4806 | 4701 | ROM_END |
| 4807 | 4702 | |
| 4808 | 4703 | |
| r7500 | r7501 | |
| 4816 | 4711 | DISK_IMAGE_READONLY( "gdl-0020", 0, SHA1(7b2ef47ca2038d6a93615b760b03e8f7cb1b83c2) ) |
| 4817 | 4712 | |
| 4818 | 4713 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4714 | //ROM_LOAD("317-5093-jpn.data", 0x00, 0x50, CRC(06bc5013) SHA1(f7a46b7e34b20409ce2fdae80e5cdfff7adb9c64) ) | |
| 4715 | ||
| 4716 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4819 | 4717 | //PIC16C622A (317-5093-JPN) |
| 4820 | 4718 | //(sticker 253-5509-5093J) |
| 4821 | ROM_LOAD("317-5093-jpn. | |
| 4719 | ROM_LOAD("317-5093-jpn.pic | |
| 4822 | 4720 | ROM_END |
| 4823 | 4721 | |
| 4824 | 4722 | |
| r7500 | r7501 | |
| 4832 | 4730 | DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(f5036711a28a211e8d71400a8322db3172c5733f) ) |
| 4833 | 4731 | |
| 4834 | 4732 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4733 | //ROM_LOAD("317-5095-jpn.data", 0x00, 0x50, CRC(6033ec89) SHA1(9e99a8ad43fa29296dbf2e13b3a3d4552130b4e8) ) | |
| 4734 | ||
| 4735 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4835 | 4736 | //PIC16C622A (317-5095-JPN) |
| 4836 | 4737 | //(sticker 253-5509-5095J) |
| 4837 | ROM_LOAD("317-5095-jpn. | |
| 4738 | ROM_LOAD("317-5095-jpn.pic | |
| 4838 | 4739 | ROM_END |
| 4839 | 4740 | |
| 4840 | 4741 | |
| r7500 | r7501 | |
| 4848 | 4749 | DISK_IMAGE_READONLY( "gdl-0022", 0, SHA1(45deba05a12abbf6390c0fc0e4cdeaedfa7d2ca5) ) |
| 4849 | 4750 | |
| 4850 | 4751 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4752 | //ROM_LOAD("317-5096-jpn.data", 0x00, 0x50, CRC(621e827a) SHA1(cdc7580f5d1dfe85d2806233f22bc4f13fd62946) ) | |
| 4753 | ||
| 4754 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4851 | 4755 | //PIC16C622A (317-5096-JPN) |
| 4852 | 4756 | //(sticker 253-5509-5096J) |
| 4853 | ROM_LOAD("317-5096-jpn. | |
| 4757 | ROM_LOAD("317-5096-jpn.pic | |
| 4854 | 4758 | ROM_END |
| 4855 | 4759 | |
| 4856 | 4760 | |
| r7500 | r7501 | |
| 4864 | 4768 | DISK_IMAGE_READONLY( "gdl-0023a", 0, SHA1(caac915104d61f2122f5afe27da1ef5fa9cf9f9a) ) |
| 4865 | 4769 | |
| 4866 | 4770 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4771 | //ROM_LOAD("317-5097-jpn.data", 0x00, 0x50, CRC(e689d047) SHA1(7e3e298d9a8076af0254faeb0eb89fbfce94718d) ) | |
| 4772 | ||
| 4773 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4867 | 4774 | //PIC16C622A (317-5097-JPN) |
| 4868 | 4775 | //(sticker 253-5509-5097J) |
| 4869 | ROM_LOAD("317-5097-jpn.data", 0x00, 0x50, CRC(e689d047) SHA1(7e3e298d9a8076af0254faeb0eb89fbfce94718d) ) | |
| 4776 | ROM_LOAD("317-5097-jpn.pic", 0x00, 0x4000, CRC(16d2a748) SHA1(5358f89c26427428840fd9af7d584a55db5a76de) ) | |
| 4777 | ||
| 4870 | 4778 | ROM_END |
| 4871 | 4779 | |
| 4872 | 4780 | |
| r7500 | r7501 | |
| 4880 | 4788 | DISK_IMAGE_READONLY( "gdl-0024", 0, SHA1(d346762036fb1c40a261a434b50e63459f306f14) ) |
| 4881 | 4789 | |
| 4882 | 4790 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4791 | //ROM_LOAD("317-5100-jpn.data", 0x00, 0x50, CRC(94316f0f) SHA1(e1ec2b4225105dbaa1e59e8a05027e73f7b725a9) ) | |
| 4792 | ||
| 4793 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4883 | 4794 | //PIC16C621A (317-5100-JPN) |
| 4884 | 4795 | //(sticker 253-5509-5100J) |
| 4885 | ROM_LOAD("317-5100-jpn. | |
| 4796 | ROM_LOAD("317-5100-jpn.pic | |
| 4886 | 4797 | ROM_END |
| 4887 | 4798 | |
| 4888 | 4799 | |
| r7500 | r7501 | |
| 4897 | 4808 | |
| 4898 | 4809 | |
| 4899 | 4810 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4811 | //ROM_LOAD("317-5102-com.data", 0x00, 0x50, CRC(32adf2eb) SHA1(d86752e6fe9ccac093c512828fca5b7ae62a3ff2) ) | |
| 4812 | ||
| 4813 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4900 | 4814 | //PIC16C621A (317-5102-COM) |
| 4901 | 4815 | //(sticker 253-5509-5102) |
| 4902 | ROM_LOAD("317-5102-com. | |
| 4816 | ROM_LOAD("317-5102-com.pic | |
| 4903 | 4817 | ROM_END |
| 4904 | 4818 | |
| 4905 | 4819 | |
| r7500 | r7501 | |
| 4914 | 4828 | |
| 4915 | 4829 | |
| 4916 | 4830 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4831 | //ROM_LOAD("317-5103-jpn.data", 0x00, 0x50, CRC(3affbf82) SHA1(268746e86e7546f4bab54bdd268f7b58f10c1aaf) ) | |
| 4832 | ||
| 4833 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4917 | 4834 | //PIC16C621A (317-5103-JPN) |
| 4918 | 4835 | //(sticker 253-5509-5103J) |
| 4919 | ROM_LOAD("317-5103-jpn. | |
| 4836 | ROM_LOAD("317-5103-jpn.pic | |
| 4920 | 4837 | ROM_END |
| 4921 | 4838 | |
| 4922 | 4839 | |
| r7500 | r7501 | |
| 4930 | 4847 | DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(66de09738551e351784cc9695a58b35fdf6b6c4b) ) |
| 4931 | 4848 | |
| 4932 | 4849 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4850 | //ROM_LOAD("317-5104-jpn.data", 0x00, 0x50, CRC(fedc8305) SHA1(c535545937213f726f25e6aa8eb3746a794e9100) ) | |
| 4851 | ||
| 4852 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4933 | 4853 | //PIC16C622A (317-5104-JPN) |
| 4934 | 4854 | //(sticker 253-5509-5104J) |
| 4935 | ROM_LOAD("317-5104-jpn. | |
| 4855 | ROM_LOAD("317-5104-jpn.pic | |
| 4936 | 4856 | ROM_END |
| 4937 | 4857 | |
| 4938 | 4858 | |
| r7500 | r7501 | |
| 4946 | 4866 | DISK_IMAGE_READONLY( "gdl-0030a", 0, SHA1(1f7ade47e37a0026451b5baf3ba746400de8d156) ) |
| 4947 | 4867 | |
| 4948 | 4868 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4869 | //ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) ) | |
| 4870 | ||
| 4871 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4949 | 4872 | //PIC16C622A (317-5107-JPN) |
| 4950 | 4873 | //(sticker 253-5509-5107J) |
| 4951 | ROM_LOAD("317-5107-jpn. | |
| 4874 | ROM_LOAD("317-5107-jpn.pic | |
| 4952 | 4875 | ROM_END |
| 4953 | 4876 | |
| 4954 | 4877 | ROM_START( senkoo ) |
| r7500 | r7501 | |
| 4961 | 4884 | DISK_IMAGE_READONLY( "gdl-0030", 0, SHA1(c7f25c05f47a490c5da9369c588b6136e93c280e) ) |
| 4962 | 4885 | |
| 4963 | 4886 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4964 | //PIC16C621A (317-5107-JPN) | |
| 4887 | //ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) ) | |
| 4888 | ||
| 4889 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4890 | //PIC16C622A (317-5107-JPN) | |
| 4965 | 4891 | //(sticker 253-5509-5107J) |
| 4966 | ROM_LOAD("317-5107-jpn. | |
| 4892 | ROM_LOAD("317-5107-jpn.pic | |
| 4967 | 4893 | ROM_END |
| 4968 | 4894 | |
| 4969 | 4895 | |
| r7500 | r7501 | |
| 4977 | 4903 | DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(6091525845fc2042ed43cae5a1b60c603e16cf97) ) |
| 4978 | 4904 | |
| 4979 | 4905 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4906 | //ROM_LOAD("317-5108-jpn.data", 0x00, 0x50, CRC(6a2eb334) SHA1(cab407d2e994f33aa921d50f399b17e6fbf98eb0) ) | |
| 4907 | ||
| 4908 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4980 | 4909 | //PIC16C622A (317-5108-JPN) |
| 4981 | 4910 | //(sticker 253-5509-5108J) |
| 4982 | ROM_LOAD("317-5108-jpn. | |
| 4911 | ROM_LOAD("317-5108-jpn.pic | |
| 4983 | 4912 | ROM_END |
| 4984 | 4913 | |
| 4985 | 4914 | |
| r7500 | r7501 | |
| 4993 | 4922 | DISK_IMAGE_READONLY( "gdl-0032", 0, SHA1(ebd7a40e59082e660ebf9a2d4ae7cb64371dae8d) ) |
| 4994 | 4923 | |
| 4995 | 4924 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4925 | //ROM_LOAD("317-5110-jpn.data", 0x00, 0x50, CRC(04e4ac45) SHA1(4102a4d68f20a7e78f6c7e3494e7229018e30e39) ) | |
| 4926 | ||
| 4927 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 4996 | 4928 | //PIC16C621A (317-5110-JPN) |
| 4997 | 4929 | //(sticker 253-5509-5110J) |
| 4998 | ROM_LOAD("317-5110-jpn. | |
| 4930 | ROM_LOAD("317-5110-jpn.pic | |
| 4999 | 4931 | ROM_END |
| 5000 | 4932 | |
| 5001 | 4933 | |
| r7500 | r7501 | |
| 5009 | 4941 | DISK_IMAGE_READONLY( "gdl-0033a", 0, SHA1(29de69ae97a9099b1bbe936dfa965bb4a3195f68) ) |
| 5010 | 4942 | |
| 5011 | 4943 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4944 | //ROM_LOAD("317-5111-jpn.data", 0x00, 0x50, CRC(a517c70d) SHA1(5f9798941355fb9abce511508c860653d6369e72) ) | |
| 4945 | ||
| 4946 | ||
| 4947 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5012 | 4948 | //PIC16C621A (317-5111-JPN) |
| 5013 | 4949 | //(sticker 253-5509-5111J) |
| 5014 | ROM_LOAD("317-5111-jpn. | |
| 4950 | ROM_LOAD("317-5111-jpn.pic | |
| 5015 | 4951 | ROM_END |
| 5016 | 4952 | |
| 5017 | 4953 | |
| r7500 | r7501 | |
| 5025 | 4961 | DISK_IMAGE_READONLY( "gdl-0034", 0, SHA1(10fd7edb0b620133c003d686e5af2ed27004fa09) ) |
| 5026 | 4962 | |
| 5027 | 4963 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4964 | //ROM_LOAD("317-5115-jpn.data", 0x00, 0x50, CRC(f40072a8) SHA1(366df2079a4d2ff7a93082c9bf849aad40ab079d) ) | |
| 4965 | ||
| 4966 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5028 | 4967 | //PIC16C621A (317-5115-JPN) |
| 5029 | 4968 | //(sticker 253-5509-5115J) |
| 5030 | ROM_LOAD("317-5115-jpn. | |
| 4969 | ROM_LOAD("317-5115-jpn.pic | |
| 5031 | 4970 | ROM_END |
| 5032 | 4971 | |
| 5033 | 4972 | |
| r7500 | r7501 | |
| 5041 | 4980 | DISK_IMAGE_READONLY( "gdl-0035", 0, SHA1(91da482a6a082e48bee5b3bd20d9c92d23936965) ) |
| 5042 | 4981 | |
| 5043 | 4982 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 4983 | //ROM_LOAD("317-5117-jpn.data", 0x00, 0x50, CRC(f90f6d3b) SHA1(a18f803a8e951c375a3a55e4b0e74b698ae93f92) ) | |
| 4984 | ||
| 4985 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5044 | 4986 | //PIC16C622A (317-5117-JPN) |
| 5045 | 4987 | //(sticker 253-5509-5117J) |
| 5046 | ROM_LOAD("317-5117-jpn. | |
| 4988 | ROM_LOAD("317-5117-jpn.pic | |
| 5047 | 4989 | ROM_END |
| 5048 | 4990 | |
| 5049 | 4991 | |
| r7500 | r7501 | |
| 5057 | 4999 | DISK_IMAGE_READONLY( "gdl-0039", 0, SHA1(ffc7f6e113ad69422a4f22f318bdf9b1dc5c25db) ) |
| 5058 | 5000 | |
| 5059 | 5001 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5002 | //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) ) | |
| 5003 | ||
| 5004 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5060 | 5005 | //PIC16C622A (317-5124-JPN) |
| 5061 | 5006 | //(sticker 253-5509-5124J) |
| 5062 | ROM_LOAD("317-5124-jpn. | |
| 5007 | ROM_LOAD("317-5124-jpn.pic | |
| 5063 | 5008 | ROM_END |
| 5064 | 5009 | |
| 5065 | 5010 | ROM_START( meltyba ) |
| r7500 | r7501 | |
| 5072 | 5017 | DISK_IMAGE_READONLY( "gdl-0039a", 0, SHA1(e6aa3d65b43a20606e6754bcb8665438770a1f8c) ) |
| 5073 | 5018 | |
| 5074 | 5019 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5020 | //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) ) | |
| 5021 | ||
| 5022 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5075 | 5023 | //PIC16C622A (317-5124-JPN) |
| 5076 | 5024 | //(sticker 253-5509-5124J) |
| 5077 | ROM_LOAD("317-5124-jpn. | |
| 5025 | ROM_LOAD("317-5124-jpn.pic | |
| 5078 | 5026 | ROM_END |
| 5079 | 5027 | |
| 5080 | 5028 | |
| r7500 | r7501 | |
| 5088 | 5036 | DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) ) |
| 5089 | 5037 | |
| 5090 | 5038 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5039 | //ROM_LOAD("317-5121-jpn.data", 0x00, 0x50, CRC(a417b20f) SHA1(af6ed7ebf95948bff3e8df915b229189b8de1e46) ) | |
| 5040 | ||
| 5041 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5091 | 5042 | //PIC16C622A (317-5121-JPN) |
| 5092 | 5043 | //(sticker 253-5509-5121J) |
| 5093 | ROM_LOAD("317-5121-jpn. | |
| 5044 | ROM_LOAD("317-5121-jpn.pic | |
| 5094 | 5045 | ROM_END |
| 5095 | 5046 | |
| 5096 | 5047 | |
| r7500 | r7501 | |
| 5105 | 5056 | |
| 5106 | 5057 | |
| 5107 | 5058 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5059 | //ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) ) | |
| 5060 | ||
| 5061 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5108 | 5062 | //PIC16C622A (317-5122-JPN) |
| 5109 | 5063 | //(sticker 253-5509-5122J) |
| 5110 | ROM_LOAD("317-5122-jpn. | |
| 5064 | ROM_LOAD("317-5122-jpn.pic | |
| 5111 | 5065 | ROM_END |
| 5112 | 5066 | |
| 5113 | 5067 | |
| r7500 | r7501 | |
| 5121 | 5075 | DISK_IMAGE_READONLY( "gdl-0040", 0, SHA1(a62c8d4b6c5be44a4aeeea1a1a94f3d0fe542593) ) |
| 5122 | 5076 | |
| 5123 | 5077 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5078 | //ROM_LOAD("317-5125-com.data", 0x00, 0x50, CRC(9d37b5e3) SHA1(e1d3cdc2ed82c864c9ff54d9399a80b70ba150c5) ) | |
| 5079 | ||
| 5080 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5124 | 5081 | //PIC16C621A (317-5125-COM) |
| 5125 | 5082 | //(sticker 253-5509-5125) |
| 5126 | ROM_LOAD("317-5125-com. | |
| 5083 | ROM_LOAD("317-5125-com.pic | |
| 5127 | 5084 | ROM_END |
| 5128 | 5085 | |
| 5129 | 5086 | |
| r7500 | r7501 | |
| 5137 | 5094 | DISK_IMAGE_READONLY( "gdl-0042", 0, SHA1(984a4fa012d83dd8c748304958c847c9867f4125) ) |
| 5138 | 5095 | |
| 5139 | 5096 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5097 | //ROM_LOAD("317-5127-jpn.data", 0x00, 0x50, CRC(e1a6dbe4) SHA1(61b458937acca55e4010f86b684aaa86b8c10eac) ) | |
| 5098 | ||
| 5099 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5140 | 5100 | //PIC16C621A (317-5127-JPN) |
| 5141 | 5101 | //(sticker 253-5509-5127J) |
| 5142 | ROM_LOAD("317-5127-jpn. | |
| 5102 | ROM_LOAD("317-5127-jpn.pic | |
| 5143 | 5103 | ROM_END |
| 5144 | 5104 | |
| 5145 | 5105 | /* -------------------------------- 1st party -------------- */ |
| r7500 | r7501 | |
| 5176 | 5136 | DISK_IMAGE_READONLY( "gds-0001", 0, SHA1(bd05f197ba8643577883dd25d9d5a74c91b27ca9) ) |
| 5177 | 5137 | |
| 5178 | 5138 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5179 | ROM_LOAD("317-0298-com.data", 0x00, 0x50, CRC(c989b336) SHA1(40075500888626cc2261133eec496b3e753631e5) ) | |
| 5139 | //ROM_LOAD("317-0298-com.data", 0x00, 0x50, CRC(c989b336) SHA1(40075500888626cc2261133eec496b3e753631e5) ) | |
| 5140 | ||
| 5141 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5142 | ROM_LOAD("317-0298-com.pic", 0x00, 0x4000, CRC(15971bf6) SHA1(815152ab05edb1789a26898cfd66b5a7c4a1f765) ) | |
| 5180 | 5143 | ROM_END |
| 5181 | 5144 | |
| 5182 | 5145 | |
| r7500 | r7501 | |
| 5192 | 5155 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5193 | 5156 | //PIC16C622A (317-0300-COM) |
| 5194 | 5157 | //(sticker 253-5508-0300) |
| 5195 | ROM_LOAD("317-0300-com.data", 0x00, 0x50, CRC(9a08413f) SHA1(d57649dcc3af578d55a93dd7a3f41da62d580f54) ) | |
| 5158 | //ROM_LOAD("317-0300-com.data", 0x00, 0x50, CRC(9a08413f) SHA1(d57649dcc3af578d55a93dd7a3f41da62d580f54) ) | |
| 5159 | ||
| 5160 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5161 | ROM_LOAD("317-0300-com.pic", 0x00, 0x4000, CRC(19a97214) SHA1(bcee1af2c16daabc7a0f723e1f9281a7c95600c6) ) | |
| 5196 | 5162 | ROM_END |
| 5197 | 5163 | |
| 5198 | 5164 | |
| r7500 | r7501 | |
| 5206 | 5172 | DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(3cce788393ed194ba9b603f9896ff893691d6b00) ) |
| 5207 | 5173 | |
| 5208 | 5174 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5175 | //ROM_LOAD("317-0302-com.data", 0x00, 0x50, CRC(4bf6cd62) SHA1(c1fdf12a4d80fa3008170c89d2dc583f19e0450b) ) | |
| 5176 | ||
| 5177 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5209 | 5178 | //PIC16C622A (317-0302-COM) |
| 5210 | 5179 | //(sticker 253-5508-0302) |
| 5211 | ROM_LOAD("317-0302-com. | |
| 5180 | ROM_LOAD("317-0302-com.pic | |
| 5212 | 5181 | ROM_END |
| 5213 | 5182 | |
| 5214 | 5183 | |
| r7500 | r7501 | |
| 5222 | 5191 | DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(d1c3fb2350e4a89372373e7f629c42b741af29b3) ) |
| 5223 | 5192 | |
| 5224 | 5193 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5194 | //ROM_LOAD("317-0303-com.data", 0x00, 0x50, CRC(6e7888a3) SHA1(5ca78052bcfd9e9f81934cbddd9c173e88973e0e) ) | |
| 5195 | ||
| 5196 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5225 | 5197 | //PIC16C622A (317-0303-COM) |
| 5226 | 5198 | //(sticker 253-5508-0303) |
| 5227 | ROM_LOAD("317-0303-com. | |
| 5199 | ROM_LOAD("317-0303-com.pic | |
| 5228 | 5200 | ROM_END |
| 5229 | 5201 | |
| 5230 | 5202 | /* |
| r7500 | r7501 | |
| 5259 | 5231 | DISK_IMAGE_READONLY( "gds-0008", 0, SHA1(2fadcd141bdbde77b2b335b270959a516af44d99) ) |
| 5260 | 5232 | |
| 5261 | 5233 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5262 | ROM_LOAD("317-0307-com.data", 0x00, 0x50, CRC(448bedc7) SHA1(092dbe5e28890d3ee40d62ca8cbf225c3ce90304) ) | |
| 5234 | //ROM_LOAD("317-0307-com.data", 0x00, 0x50, CRC(448bedc7) SHA1(092dbe5e28890d3ee40d62ca8cbf225c3ce90304) ) | |
| 5235 | ||
| 5236 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5237 | ROM_LOAD("317-0307-com.pic", 0x00, 0x4000, CRC(4046de19) SHA1(8adda9f223e926148b36744bbbaa89557544a229) ) | |
| 5263 | 5238 | ROM_END |
| 5264 | 5239 | |
| 5265 | 5240 | /* |
| r7500 | r7501 | |
| 5295 | 5270 | NAOMIGD_BIOS |
| 5296 | 5271 | NAOMI_DEFAULT_EEPROM |
| 5297 | 5272 | |
| 5273 | ROM_REGION( 0x10000, "io_board", 0) | |
| 5274 | ROM_LOAD("epr-22084.ic3", 0x0000, 0x10000, CRC(18cf58bb) SHA1(1494f8215231929e41bbe2a133658d01882fbb0f) ) | |
| 5275 | ||
| 5298 | 5276 | ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? |
| 5299 | 5277 | |
| 5300 | 5278 | DISK_REGION( "gdrom" ) |
| 5301 | 5279 | DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d502155ddaf881c2c9505528004b9904aa32a59c) ) |
| 5302 | 5280 | |
| 5303 | 5281 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5282 | //ROM_LOAD("317-0308-com.data", 0x00, 0x50, CRC(56f63af0) SHA1(3c453226fc53d2f700b3634db3ef8ce206d94392) ) | |
| 5283 | ||
| 5284 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5304 | 5285 | //PIC16C622A (317-0308-COM) |
| 5305 | 5286 | //(sticker 253-5508-0308) |
| 5306 | ROM_LOAD("317-0308-com.data", 0x00, 0x50, CRC(56f63af0) SHA1(3c453226fc53d2f700b3634db3ef8ce206d94392) ) | |
| 5307 | ||
| 5308 | ROM_REGION( 0x10000, "io_board", 0) | |
| 5309 | ROM_LOAD("epr-22084.ic3", 0x0000, 0x10000, CRC(18cf58bb) SHA1(1494f8215231929e41bbe2a133658d01882fbb0f) ) | |
| 5287 | ROM_LOAD("317-0308-com.pic", 0x00, 0x4000, CRC(5e1ef2c4) SHA1(57fa3efbb24f8b54e62fe0a2133d863cc7638f53) ) | |
| 5310 | 5288 | ROM_END |
| 5311 | 5289 | |
| 5312 | 5290 | |
| r7500 | r7501 | |
| 5320 | 5298 | DISK_IMAGE_READONLY( "gds-0010", 0, SHA1(c3135ede3a8bdadab91aed49abacbfbde8037069) ) |
| 5321 | 5299 | |
| 5322 | 5300 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5301 | //ROM_LOAD("317-0309-com.data", 0x00, 0x50, CRC(8792c550) SHA1(e8d6d91583d1673d8d3fa9ccb0ab1097c5c5ad08) ) | |
| 5302 | ||
| 5303 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5323 | 5304 | //PIC16C622A (317-0309-COM) |
| 5324 | 5305 | //(sticker 253-5508-0309) |
| 5325 | ROM_LOAD("317-0309-com. | |
| 5306 | ROM_LOAD("317-0309-com.pic | |
| 5326 | 5307 | ROM_END |
| 5327 | 5308 | |
| 5328 | 5309 | |
| r7500 | r7501 | |
| 5336 | 5317 | DISK_IMAGE_READONLY( "gds-0011", 0, SHA1(b778403d73c8cdd13383691c9be2094ddfc1ba84) ) |
| 5337 | 5318 | |
| 5338 | 5319 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5320 | //ROM_LOAD("317-0312-com.data", 0x00, 0x50, CRC(6b24f78f) SHA1(43f89815ec46cf014d941b4b9238da044b338b4c) ) | |
| 5321 | ||
| 5322 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5339 | 5323 | //PIC16C621A (317-0312-COM) |
| 5340 | 5324 | //(sticker 253-5508-0312) |
| 5341 | ROM_LOAD("317-0312-com. | |
| 5325 | ROM_LOAD("317-0312-com.pic | |
| 5342 | 5326 | ROM_END |
| 5343 | 5327 | |
| 5344 | 5328 | ROM_START( keyboard ) |
| r7500 | r7501 | |
| 5351 | 5335 | DISK_IMAGE_READONLY( "gds-0017", 0, SHA1(fb86eff3ef38de7fd78cfde897d5332d2092c172) ) |
| 5352 | 5336 | |
| 5353 | 5337 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5354 | ROM_LOAD("317-0323-com.data", 0x00, 0x50, CRC(c1277eb3) SHA1(529ed5a133550e2854f8656cd377706060a7befa) ) | |
| 5338 | //ROM_LOAD("317-0323-com.data", 0x00, 0x50, CRC(c1277eb3) SHA1(529ed5a133550e2854f8656cd377706060a7befa) ) | |
| 5339 | ||
| 5340 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5341 | ROM_LOAD("317-0323-com.pic", 0x00, 0x4000, CRC(c8854ef2) SHA1(b43b956df142fe4167dcc2ec805921e25bba180f) ) | |
| 5342 | ||
| 5355 | 5343 | ROM_END |
| 5356 | 5344 | |
| 5357 | 5345 | |
| r7500 | r7501 | |
| 5365 | 5353 | DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(955d3c0cb991be3057138c562cff69c5ef887787) ) |
| 5366 | 5354 | |
| 5367 | 5355 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5356 | //ROM_LOAD("317-0330-com.data", 0x00, 0x50, CRC(f5e7f7d4) SHA1(3903337e82011d132993e4366475586866bd39b1) ) | |
| 5357 | ||
| 5358 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5368 | 5359 | //PIC16C622A (317-0330-COM) |
| 5369 | 5360 | //(sticker 253-5508-0330) |
| 5370 | ROM_LOAD("317-0330-com. | |
| 5361 | ROM_LOAD("317-0330-com.pic | |
| 5371 | 5362 | ROM_END |
| 5372 | 5363 | |
| 5373 | 5364 | /* |
| r7500 | r7501 | |
| 5404 | 5395 | DISK_IMAGE_READONLY( "gds-0015a", 0, SHA1(c6e9c9901bd4f075454b7f18baf08df81bc2f1ad) ) |
| 5405 | 5396 | |
| 5406 | 5397 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5407 | ROM_LOAD("317-0318-exp.data", 0x00, 0x50, CRC(7758ade6) SHA1(c62f35810bce466bfb0f55fd555066efd53e9bb6) ) | |
| 5398 | //ROM_LOAD("317-0318-exp.data", 0x00, 0x50, CRC(7758ade6) SHA1(c62f35810bce466bfb0f55fd555066efd53e9bb6) ) | |
| 5399 | ||
| 5400 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5401 | ROM_LOAD("317-0318-exp.pic", 0x00, 0x4000, CRC(83de4047) SHA1(1808ac0d8353b92296de37f98b490a42a0e141cf) ) | |
| 5402 | ||
| 5408 | 5403 | ROM_END |
| 5409 | 5404 | |
| 5410 | 5405 | |
| r7500 | r7501 | |
| 5418 | 5413 | DISK_IMAGE_READONLY( "gds-0018", 0, SHA1(0633a99a666f363ab30450a76b9753685d6b1f57) ) |
| 5419 | 5414 | |
| 5420 | 5415 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5421 | ROM_LOAD("317-0332-j.data", 0x00, 0x50, CRC(31f2b632) SHA1(bbf253bfe831308a7e7fde3a4a28e5bcd2fbb273) ) | |
| 5416 | //ROM_LOAD("317-0332-j.data", 0x00, 0x50, CRC(31f2b632) SHA1(bbf253bfe831308a7e7fde3a4a28e5bcd2fbb273) ) | |
| 5417 | ||
| 5418 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5419 | ROM_LOAD("317-0332-j.pic", 0x00, 0x4000, CRC(f71cb2fc) SHA1(281b3b3b03edf9a39e380976de528b7c9674de53) ) | |
| 5422 | 5420 | ROM_END |
| 5423 | 5421 | |
| 5424 | 5422 | |
| r7500 | r7501 | |
| 5432 | 5430 | DISK_IMAGE_READONLY( "gds-0021a", 0, SHA1(15c6f9434494a31693cbb8e33da36e0e8a8f7c62) ) |
| 5433 | 5431 | |
| 5434 | 5432 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5433 | //ROM_LOAD("317-0332-jpn.data", 0x00, 0x50, CRC(ab302661) SHA1(65164cf76d78b281772bfcbf5a733b0200e86e09) ) | |
| 5434 | ||
| 5435 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5435 | 5436 | //PIC16C622A (317-0332-JPN) |
| 5436 | 5437 | //(sticker 253-5508-0332J) |
| 5437 | ROM_LOAD("317-0332-jpn.data", 0x00, 0x50, CRC(ab302661) SHA1(65164cf76d78b281772bfcbf5a733b0200e86e09) ) | |
| 5438 | ROM_LOAD("317-0332-jpn.pic", 0x00, 0x4000, CRC(43e78ecf) SHA1(bbe4b036e965fbba6ab79c88cba4ea8f0ea3f9fc) ) | |
| 5439 | ||
| 5438 | 5440 | ROM_END |
| 5439 | 5441 | |
| 5440 | 5442 | /* |
| r7500 | r7501 | |
| 5469 | 5471 | DISK_IMAGE_READONLY( "gds-0022", 0, SHA1(70b41745225006e7876176cbd239edecd4c3f8b6) ) |
| 5470 | 5472 | |
| 5471 | 5473 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5472 | ROM_LOAD("317-0333-com.data", 0x00, 0x50, CRC(0c07970f) SHA1(8882dd2f8ed522790ea78eed80cfa9442f88f67b) ) | |
| 5474 | //ROM_LOAD("317-0333-com.data", 0x00, 0x50, CRC(0c07970f) SHA1(8882dd2f8ed522790ea78eed80cfa9442f88f67b) ) | |
| 5475 | ||
| 5476 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5477 | ROM_LOAD("317-0333-com.pic", 0x00, 0x4000, CRC(15fb7792) SHA1(03932ba9b1738d5ab75b2a465cc3254e75f59f63) ) | |
| 5478 | ||
| 5473 | 5479 | ROM_END |
| 5474 | 5480 | |
| 5475 | 5481 | |
| r7500 | r7501 | |
| 5482 | 5488 | DISK_REGION( "gdrom" ) |
| 5483 | 5489 | DISK_IMAGE_READONLY( "gds-0023a", 0, SHA1(cd9d808b59eb8f40673ec4353d476f2b9c7f783c) ) |
| 5484 | 5490 | |
| 5485 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) // uses the vf4 pic | |
| 5491 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 5492 | //ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5493 | ||
| 5494 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) // uses the vf4 pic | |
| 5486 | 5495 | //PIC16C622A (317-0314-COM) |
| 5487 | 5496 | //(sticker 253-5508-0314) |
| 5488 | ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5497 | ROM_LOAD("317-0314-com.pic", 0x00, 0x4000, CRC(fa0b6c70) SHA1(c29936cb18e1dd592563b1104281f031e3b12fc2) ) | |
| 5498 | ||
| 5489 | 5499 | ROM_END |
| 5490 | 5500 | |
| 5491 | 5501 | ROM_START( ngdup23c ) |
| r7500 | r7501 | |
| 5497 | 5507 | DISK_REGION( "gdrom" ) |
| 5498 | 5508 | DISK_IMAGE_READONLY( "gds-0023c", 0, SHA1(1fcb5530748886f4c4f45487d047859182ff7496)) |
| 5499 | 5509 | |
| 5500 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) // uses the vf4 evolution pic | |
| 5510 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 5511 | //ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) | |
| 5512 | ||
| 5513 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) // uses the vf4 evolution pic | |
| 5501 | 5514 | //PIC16C622A (317-0338-JPN) |
| 5502 | 5515 | //(sticker 253-5508-0338J) |
| 5503 | ROM_LOAD("317-0338-jpn. | |
| 5516 | ROM_LOAD("317-0338-jpn.pic | |
| 5504 | 5517 | ROM_END |
| 5505 | 5518 | |
| 5506 | 5519 | |
| r7500 | r7501 | |
| 5514 | 5527 | DISK_IMAGE_READONLY( "gds-0031", 0, SHA1(da2d421da9472b149619b6931bb2fe624be75fa2) ) |
| 5515 | 5528 | |
| 5516 | 5529 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5530 | //ROM_LOAD("317-0375-com.data", 0x00, 0x50, CRC(32bf1825) SHA1(42dfbc6777c154d8de6c6f7350da9ea737380220) ) | |
| 5531 | ||
| 5532 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5517 | 5533 | //PIC16C621A (317-0375-COM) |
| 5518 | 5534 | //(sticker 253-5508-0375) |
| 5519 | ROM_LOAD("317-0375-com. | |
| 5535 | ROM_LOAD("317-0375-com.pic | |
| 5520 | 5536 | ROM_END |
| 5521 | 5537 | |
| 5522 | 5538 | |
| r7500 | r7501 | |
| 5543 | 5559 | //GDL-0015 Mazan |
| 5544 | 5560 | //GDL-0016 Yonin Uchi Mahjong MJ |
| 5545 | 5561 | GAME( 2002, quizqgd, naomigd, naomigd, naomi, naomi, ROT270, "Amedio (Taito license)", "Quiz Keitai Q mode (GDL-0017)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5546 | ||
| 5562 | ||
| 5547 | 5563 | //GDL-0019 Guilty Gear XX #Reload |
| 5548 | 5564 | GAME( 2003, ggxxrl, naomigd, naomigd, naomi, ggxxrl, ROT0, "Arc System Works", "Guilty Gear XX #Reload (Rev A) (GDL-0019A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5549 | 5565 | GAME( 2004, tetkiwam, naomigd, naomigd, naomi, naomi, ROT0, "Success", "Tetris Kiwamemichi (GDL-0020)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r7500 | r7501 | |
| 5699 | 5715 | ROM_END |
| 5700 | 5716 | |
| 5701 | 5717 | /* |
| 5702 | This is the same nonsense layout rom board as gram2000, and just like | |
| 5703 | that it tests IC1 which doesn't exist - is it a mirror, or protection | |
| 5704 | related? There is no physical rom for it, also note, the roms are | |
| 5705 | interleaved, so each test is testing 2 roms and the labeling / ic | |
| 5706 | positions on the cart don't relate to the display in test mode. | |
| 5707 | ||
| 5708 | Desired IC1 @ 0x800000 sums from the header = 9f39 fdc4 | |
| 5709 | ||
| 5710 | We need a USB dump of this from 0x800000 to 0x1000000. | |
| 5718 | Tests IC1 like gram2000 if actel_id is 0xffff, see ROM_COPY | |
| 5711 | 5719 | */ |
| 5712 | 5720 | ROM_START( vf4evoct ) |
| 5713 | 5721 | NAOMI2_BIOS |
| r7500 | r7501 | |
| 5735 | 5743 | ROM_LOAD32_WORD( "mpr-23929.ic34s", 0x9000002, 0x800000, CRC(d768f242) SHA1(3ade29b094308d870ecac53cfe77b843d50af85a) ) |
| 5736 | 5744 | ROM_LOAD32_WORD( "mpr-23930.ic35", 0xa000000, 0x800000, CRC(0e45e4c4) SHA1(974b83d4cc35e8ac9f83d04ebd395f1e2196e829) ) |
| 5737 | 5745 | ROM_LOAD32_WORD( "mpr-23931.ic36s", 0xa000002, 0x800000, CRC(12ecd2f0) SHA1(3222d4d9d3e30c297a072a8888c28503306db40c) ) |
| 5746 | ||
| 5747 | ROM_COPY( "user1", 0x1400000, 0x0800000, 0x0800000 ) // mirror data so IC1 check can pass | |
| 5738 | 5748 | ROM_END |
| 5739 | 5749 | |
| 5740 | 5750 | ROM_START( clubkrte ) |
| r7500 | r7501 | |
| 5772 | 5782 | DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(aca09a88506f5e462ad3fb33eac5478a2a010609) ) |
| 5773 | 5783 | |
| 5774 | 5784 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5785 | //ROM_LOAD("317-0304-com.data", 0x00, 0x50, CRC(a181c601) SHA1(6a489904941e638ac1069b66e76ee0bcec7d0bab) ) | |
| 5786 | ||
| 5787 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5775 | 5788 | //PIC16C622A (317-0304-COM) |
| 5776 | 5789 | //(sticker 253-5508-0304) |
| 5777 | ROM_LOAD("317-0304-com. | |
| 5790 | ROM_LOAD("317-0304-com.bin | |
| 5778 | 5791 | ROM_END |
| 5779 | 5792 | |
| 5780 | 5793 | ROM_START( vf4 ) |
| r7500 | r7501 | |
| 5787 | 5800 | DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(c34588f59c6091cd1c3ef235171dad8d5247e707) ) |
| 5788 | 5801 | |
| 5789 | 5802 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5803 | //ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5804 | ||
| 5805 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5790 | 5806 | //PIC16C622A (317-0314-COM) |
| 5791 | 5807 | //(sticker 253-5508-0314) |
| 5792 | ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5808 | ROM_LOAD("317-0314-com.pic", 0x00, 0x4000, CRC(fa0b6c70) SHA1(c29936cb18e1dd592563b1104281f031e3b12fc2) ) | |
| 5809 | ||
| 5793 | 5810 | ROM_END |
| 5794 | 5811 | |
| 5795 | 5812 | ROM_START( vf4b ) |
| r7500 | r7501 | |
| 5802 | 5819 | DISK_IMAGE_READONLY( "gds-0012b", 0, SHA1(9b8e05c3d28a09323b13c198dfcc2b771bba67cd) ) |
| 5803 | 5820 | |
| 5804 | 5821 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5822 | //ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5823 | ||
| 5824 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5805 | 5825 | //PIC16C622A (317-0314-COM) |
| 5806 | 5826 | //(sticker 253-5508-0314) |
| 5807 | ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5827 | ROM_LOAD("317-0314-com.pic", 0x00, 0x4000, CRC(fa0b6c70) SHA1(c29936cb18e1dd592563b1104281f031e3b12fc2) ) | |
| 5828 | ||
| 5808 | 5829 | ROM_END |
| 5809 | 5830 | |
| 5810 | 5831 | ROM_START( vf4c ) |
| r7500 | r7501 | |
| 5817 | 5838 | DISK_IMAGE_READONLY( "gds-0012c", 0, SHA1(0ec149d7edfb326777cdc45a2ac8ad578a32aba1) ) |
| 5818 | 5839 | |
| 5819 | 5840 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5841 | //ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5842 | ||
| 5843 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5820 | 5844 | //PIC16C622A (317-0314-COM) |
| 5821 | 5845 | //(sticker 253-5508-0314) |
| 5822 | ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) | |
| 5846 | ROM_LOAD("317-0314-com.pic", 0x00, 0x4000, CRC(fa0b6c70) SHA1(c29936cb18e1dd592563b1104281f031e3b12fc2) ) | |
| 5847 | ||
| 5823 | 5848 | ROM_END |
| 5824 | 5849 | |
| 5825 | 5850 | |
| r7500 | r7501 | |
| 5833 | 5858 | DISK_IMAGE_READONLY( "gds-0024b", 0, SHA1(a829169542f3bed76095ad6bfbbde7d494d04d72) ) |
| 5834 | 5859 | |
| 5835 | 5860 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5861 | //ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) | |
| 5862 | ||
| 5863 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5836 | 5864 | //PIC16C622A (317-0338-JPN) |
| 5837 | 5865 | //(sticker 253-5508-0338J) |
| 5838 | ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) | |
| 5866 | ROM_LOAD("317-0338-jpn.pic", 0x00, 0x4000, CRC(b177ba7d) SHA1(f751ec43a8e944a01eeda58c01b7bc73e5df749d) ) | |
| 5867 | ||
| 5839 | 5868 | ROM_END |
| 5840 | 5869 | |
| 5841 | 5870 | ROM_START( vf4evoa ) |
| r7500 | r7501 | |
| 5848 | 5877 | DISK_IMAGE_READONLY( "gds-0024a", 0, SHA1(6225e778d73db18be26f882d4f9cd3b3a136d1c9) ) |
| 5849 | 5878 | |
| 5850 | 5879 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5880 | //ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) | |
| 5881 | ||
| 5882 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5851 | 5883 | //PIC16C622A (317-0338-JPN) |
| 5852 | 5884 | //(sticker 253-5508-0338J) |
| 5853 | ROM_LOAD("317-0338-jpn. | |
| 5885 | ROM_LOAD("317-0338-jpn.pic | |
| 5854 | 5886 | ROM_END |
| 5855 | 5887 | |
| 5856 | 5888 | ROM_START( initdv2j ) |
| r7500 | r7501 | |
| 5876 | 5908 | DISK_IMAGE_READONLY( "gds-0036f", 0, SHA1(ea35d6ecdf94e5c9a545952758da80f658755df0) ) |
| 5877 | 5909 | |
| 5878 | 5910 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5911 | //ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) | |
| 5912 | ||
| 5913 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5879 | 5914 | //PIC16C622A (317-0387-COM) |
| 5880 | 5915 | //(sticker 253-5508-0387) |
| 5881 | ROM_LOAD("317-0387-com. | |
| 5916 | ROM_LOAD("317-0387-com.pic | |
| 5882 | 5917 | ROM_END |
| 5883 | 5918 | |
| 5884 | 5919 | ROM_START( vf4tunedd ) |
| r7500 | r7501 | |
| 5891 | 5926 | DISK_IMAGE_READONLY( "gds-0036d", 0, SHA1(2f7654307a4c978c5af6c8238c44e70275dd34f9) ) |
| 5892 | 5927 | |
| 5893 | 5928 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5929 | //ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) | |
| 5930 | ||
| 5931 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5894 | 5932 | //PIC16C622A (317-0387-COM) |
| 5895 | 5933 | //(sticker 253-5508-0387) |
| 5896 | ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) | |
| 5934 | ROM_LOAD("317-0387-com.pic", 0x00, 0x4000, CRC(8728aeaa) SHA1(07983ab41d143f845c3150dfc9b7301968708e18) ) | |
| 5935 | ||
| 5897 | 5936 | ROM_END |
| 5898 | 5937 | |
| 5899 | 5938 | |
| r7500 | r7501 | |
| 5907 | 5946 | DISK_IMAGE_READONLY( "gds-0036a", 0, SHA1(cd630fc4e8f7ed5641b85c609584d7efe0eac137) ) |
| 5908 | 5947 | |
| 5909 | 5948 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5949 | //ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) | |
| 5950 | ||
| 5951 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5910 | 5952 | //PIC16C622A (317-0387-COM) |
| 5911 | 5953 | //(sticker 253-5508-0387) |
| 5912 | ROM_LOAD("317-0387-com. | |
| 5954 | ROM_LOAD("317-0387-com.pic | |
| 5913 | 5955 | ROM_END |
| 5914 | 5956 | |
| 5915 | 5957 | |
| r7500 | r7501 | |
| 5950 | 5992 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5951 | 5993 | //PIC16C622A (317-0317-COM) |
| 5952 | 5994 | //(sticker 253-5508-0317) |
| 5953 | ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) ) | |
| 5995 | //ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) ) | |
| 5996 | ||
| 5997 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5998 | ROM_LOAD("317-0317-com.pic", 0x00, 0x4000, CRC(ef65fe73) SHA1(2c02d1570c1fdad56bc684c60bb17255c73c6d45) ) | |
| 5999 | ||
| 5954 | 6000 | ROM_END |
| 5955 | 6001 | |
| 5956 | 6002 | ROM_START( initd ) |
| r7500 | r7501 | |
| 5963 | 6009 | DISK_REGION( "gdrom" ) |
| 5964 | 6010 | DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(c0e901623ef4fcd97b7e4d29ae556e6f2e91b8ad) ) |
| 5965 | 6011 | |
| 5966 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 6012 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) // custom format containing data returned from pic | |
| 6013 | //ROM_LOAD("317-0331-jpn.data", 0x00, 0x50, CRC(bb39742e) SHA1(b3100b18aeb80ebfd5312ba5c320e7e647710b55) ) | |
| 6014 | ||
| 6015 | //ROM_REGION( 0x9a49, "pichex", ROMREGION_ERASE) // actual pic dump (in hex/ascii mode) from decap | |
| 6016 | //ROM_LOAD("gds-0020b.hex", 0x00, 0x0009a49, CRC(80d9fe04) SHA1(7a6fe325ce2e12e9270205d32f549aaf66505de5) ) | |
| 6017 | ||
| 6018 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 5967 | 6019 | //PIC16C622A (317-0331-JPN) |
| 5968 | 6020 | //(sticker 253-5508-0331J) |
| 5969 | ROM_LOAD("317-0331-jpn. | |
| 6021 | ROM_LOAD("317-0331-jpn.pic | |
| 5970 | 6022 | ROM_END |
| 5971 | 6023 | |
| 5972 | 6024 | ROM_START( initdexp ) |
| r7500 | r7501 | |
| 5980 | 6032 | DISK_IMAGE_READONLY( "gds-0025", 0, SHA1(8ea92cf6b493f21b9453832edad7cbc5e5b350c1) ) |
| 5981 | 6033 | |
| 5982 | 6034 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) |
| 5983 | ROM_LOAD("317-0343-com.data", 0x00, 0x50, CRC(e9d8fac0) SHA1(85f5bbffbd9d1f7162bae46ddd49e7870fe93662) ) | |
| 6035 | //ROM_LOAD("317-0343-com.data", 0x00, 0x50, CRC(e9d8fac0) SHA1(85f5bbffbd9d1f7162bae46ddd49e7870fe93662) ) | |
| 6036 | ||
| 6037 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) | |
| 6038 | ROM_LOAD("317-0343-com.pic", 0x00, 0x4000, CRC(80eea4eb) SHA1(5aedc0d52a2a8a2d186ca591094835d972574092) ) | |
| 5984 | 6039 | ROM_END |
| 5985 | 6040 | |
| 5986 | 6041 | ROM_START( initdv3j ) |
| r7500 | r7501 | |
| 6009 | 6064 | GAME( 2002, clubkrte, naomi2, naomi, naomi, 0, ROT0, "Sega", "Club Kart: European Session", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6010 | 6065 | |
| 6011 | 6066 | /* GDS-xxxx (Sega first party games) */ |
| 6012 | GAME( 2001, vstrik3, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (GDS-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6013 | GAME( 2001, vf4, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (GDS-0012)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6014 | GAME( 2001, vf4b, vf4, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Rev B) (GDS-0012B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6015 | GAME( 2001, vf4c, vf4, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Rev C) (GDS-0012C)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6016 | GAME( 2002, initd, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D Arcade Stage (Rev B) (Japan) (GDS-0020B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6017 | GAME( 2002, beachspi,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Beach Spikers (GDS-0014)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6018 | GAME( 2002, initdexp,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D Arcade Stage (Export) (GDS-0025)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6019 | GAME( 2002, vf4evo, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev B) (GDS-0024B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6020 | GAME( 2002, vf4evoa, vf4evo, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev A) (GDS-0024A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6021 | GAME( 2002, initdv2j,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D : Arcade Stage Ver. 2 (Japan) (GDS-0026)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6022 | GAME( 2004, initdv3j,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D : Arcade Stage Ver. 3 (Japan) (Rev B) (GDS-0032B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6023 | GAME( 2004, vf4tuned,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev F) (GDS-0036F)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6024 | GAME( 2004, vf4tunedd,vf4tuned,naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev D) (GDS-0036D)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6025 | GAME( 2004, vf4tuneda,vf4tuned,naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev A) (GDS-0036A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6067 | GAME( 2001, vstrik3, naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Striker 3 (GDS-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6068 | GAME( 2001, vf4, naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 (GDS-0012)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6069 | GAME( 2001, vf4b, vf4, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 (Rev B) (GDS-0012B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6070 | GAME( 2001, vf4c, vf4, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 (Rev C) (GDS-0012C)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6071 | GAME( 2002, initd, naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Initial D Arcade Stage (Rev B) (Japan) (GDS-0020B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6072 | GAME( 2002, beachspi,naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Beach Spikers (GDS-0014)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6073 | GAME( 2002, initdexp,naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Initial D Arcade Stage (Export) (GDS-0025)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6074 | GAME( 2002, vf4evo, naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev B) (GDS-0024B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6075 | GAME( 2002, vf4evoa, vf4evo, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev A) (GDS-0024A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6076 | GAME( 2002, initdv2j,naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Initial D : Arcade Stage Ver. 2 (Japan) (GDS-0026)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6077 | GAME( 2004, initdv3j,naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Initial D : Arcade Stage Ver. 3 (Japan) (Rev B) (GDS-0032B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6078 | GAME( 2004, vf4tuned,naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev F) (GDS-0036F)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6079 | GAME( 2004, vf4tunedd,vf4tuned,naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev D) (GDS-0036D)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6080 | GAME( 2004, vf4tuneda,vf4tuned,naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev A) (GDS-0036A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6026 | 6081 | |
| 6027 | 6082 | /********************************************** |
| 6028 | 6083 | * |
| r7500 | r7501 | |
|---|---|---|
| 1211 | 1211 | /* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING ) |
| 1212 | 1212 | /* */ GAME( 1991, mt_sonia, mt_sonic, megatech, megatech, mtnew, ROT0, "Sega", "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING ) |
| 1213 | 1213 | /* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megatech, mtnew, ROT0, "Toaplan / Sega", "Fire Shark (Mega-Tech)", GAME_NOT_WORKING ) |
| 1214 | /* 54 */ // | |
| 1214 | /* 54 */ // Spider-Man | |
| 1215 | 1215 | /* 55 */ // unknown |
| 1216 | 1216 | /* 56 */ // unknown |
| 1217 | 1217 | /* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING ) |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | Mr. Kicker (c) 2001 SemiCom |
| 23 | 23 | Age Of Heroes - Silkroad 2 (c) 2001 Unico (v0.63 - 2001/02/07) |
| 24 | 24 | |
| 25 | Known games on simular hardware but not dumped: | |
| 26 | Mr. Dig (c) 2000 Sun (Mr. Driller clone) on a F-E1-16-002 PCB | |
| 27 | ||
| 25 | 28 | Real games bugs: |
| 26 | 29 | - dquizgo2: bugged video test |
| 27 | 30 | |
| r7500 | r7501 | |
| 1808 | 1811 | GAME( 2000, dquizgo2, 0, coolmini, common, dquizgo2, ROT0, "SemiCom", "Date Quiz Go Go Episode 2" , 0) |
| 1809 | 1812 | GAME( 2000, misncrft, 0, misncrft, common, misncrft, ROT90, "Sun", "Mission Craft (version 2.4)", GAME_NO_SOUND ) |
| 1810 | 1813 | GAME( 2001, finalgdr, 0, finalgdr, finalgdr, finalgdr, ROT0, "SemiCom", "Final Godori (Korea, version 2.20.5915)", 0 ) |
| 1811 | GAME( 2001, mrkicker, 0, finalgdr, finalgdr, mrkicker, ROT0, "SemiCom", "Mr. Kicker", | |
| 1814 | GAME( 2001, mrkicker, 0, finalgdr, finalgdr, mrkicker, ROT0, "SemiCom", "Mr. Kicker", GAME_NOT_WORKING ) | |
| 1812 | 1815 | GAME( 2001, wyvernwg, 0, wyvernwg, common, wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND ) |
| 1813 | 1816 | GAME( 2001, aoh, 0, aoh, aoh, aoh, ROT0, "Unico", "Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /***************************************************************************** |
| 2 | 2 | |
| 3 | Kikiippatsu Mayumi-chan (c) 1988 Victory L.L.C. | |
| 3 | Kikiippatsu Mayumi-chan (c) 1988 Victory L.L.C. | |
| 4 | 4 | |
| 5 | 5 | Driver by Uki |
| 6 | 6 | |
| r7500 | r7501 | |
| 12 | 12 | |
| 13 | 13 | #define MCLK 10000000 |
| 14 | 14 | |
| 15 | extern UINT8 *mayumi_videoram; | |
| 16 | WRITE8_HANDLER( mayumi_videoram_w ); | |
| 17 | VIDEO_START( mayumi ); | |
| 18 | VIDEO_UPDATE( mayumi ); | |
| 19 | 15 | |
| 20 | static int int_enable; | |
| 21 | static int input_sel; | |
| 16 | class mayumi_state | |
| 17 | { | |
| 18 | public: | |
| 19 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mayumi_state(machine)); } | |
| 22 | 20 | |
| 23 | ||
| 21 | mayumi_state(running_machine &machine) { } | |
| 24 | 22 | |
| 23 | /* memory pointers */ | |
| 24 | UINT8 * videoram; | |
| 25 | // UINT8 * nvram; // this currently uses generic nvram handlers | |
| 26 | ||
| 27 | /* video-related */ | |
| 28 | tilemap_t *tilemap; | |
| 29 | ||
| 30 | /* misc */ | |
| 31 | int int_enable; | |
| 32 | int input_sel; | |
| 33 | }; | |
| 34 | ||
| 35 | ||
| 36 | /************************************* | |
| 37 | * | |
| 38 | * Video emulation | |
| 39 | * | |
| 40 | *************************************/ | |
| 41 | ||
| 42 | static TILE_GET_INFO( get_tile_info ) | |
| 43 | { | |
| 44 | mayumi_state *state = (mayumi_state *)machine->driver_data; | |
| 45 | int code = state->videoram[tile_index] + (state->videoram[tile_index + 0x800] & 0x1f) * 0x100; | |
| 46 | int col = (state->videoram[tile_index + 0x1000] >> 3) & 0x1f; | |
| 47 | ||
| 48 | SET_TILE_INFO(0, code, col, 0); | |
| 49 | } | |
| 50 | ||
| 51 | static VIDEO_START( mayumi ) | |
| 52 | { | |
| 53 | mayumi_state *state = (mayumi_state *)machine->driver_data; | |
| 54 | state->tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 55 | } | |
| 56 | ||
| 57 | static WRITE8_HANDLER( mayumi_videoram_w ) | |
| 58 | { | |
| 59 | mayumi_state *state = (mayumi_state *)space->machine->driver_data; | |
| 60 | state->videoram[offset] = data; | |
| 61 | tilemap_mark_tile_dirty(state->tilemap, offset & 0x7ff); | |
| 62 | } | |
| 63 | ||
| 64 | static VIDEO_UPDATE( mayumi ) | |
| 65 | { | |
| 66 | mayumi_state *state = (mayumi_state *)screen->machine->driver_data; | |
| 67 | tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0); | |
| 68 | return 0; | |
| 69 | } | |
| 70 | ||
| 71 | /************************************* | |
| 72 | * | |
| 73 | * Interrupt generator | |
| 74 | * | |
| 75 | *************************************/ | |
| 76 | ||
| 25 | 77 | static INTERRUPT_GEN( mayumi_interrupt ) |
| 26 | 78 | { |
| 27 | if (int_enable) | |
| 79 | mayumi_state *state = (mayumi_state *)device->machine->driver_data; | |
| 80 | ||
| 81 | if (state->int_enable) | |
| 28 | 82 | cpu_set_input_line(device, 0, HOLD_LINE); |
| 29 | 83 | } |
| 30 | 84 | |
| 85 | /************************************* | |
| 86 | * | |
| 87 | * Memory handlers | |
| 88 | * | |
| 89 | *************************************/ | |
| 90 | ||
| 31 | 91 | static WRITE8_HANDLER( bank_sel_w ) |
| 32 | 92 | { |
| 33 | UINT8 *BANKROM = memory_region(space->machine, "maincpu"); | |
| 34 | int bank = ((data & 0x80)) >> 7 | ((data & 0x40) >> 5); | |
| 35 | memory_set_bankptr(space->machine, "bank1", &BANKROM[0x10000+bank*0x4000]); | |
| 93 | mayumi_state *state = (mayumi_state *)space->machine->driver_data; | |
| 94 | int bank = BIT(data, 7) | (BIT(data, 6) << 1); | |
| 36 | 95 | |
| 37 | | |
| 96 | memory_set_bank(spac | |
| 38 | 97 | |
| 98 | state->int_enable = data & 1; | |
| 99 | ||
| 39 | 100 | flip_screen_set(space->machine, data & 2); |
| 40 | 101 | } |
| 41 | 102 | |
| 42 | static MACHINE_RESET( mayumi ) | |
| 43 | { | |
| 44 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); | |
| 45 | bank_sel_w(space, 0, 0); | |
| 46 | } | |
| 47 | ||
| 48 | 103 | static WRITE8_HANDLER( input_sel_w ) |
| 49 | 104 | { |
| 50 | input_sel = data; | |
| 105 | mayumi_state *state = (mayumi_state *)space->machine->driver_data; | |
| 106 | state->input_sel = data; | |
| 51 | 107 | } |
| 52 | 108 | |
| 53 | 109 | static READ8_HANDLER( key_matrix_r ) |
| 54 | 110 | { |
| 55 | int p,i,ret; | |
| 111 | mayumi_state *state = (mayumi_state *)space->machine->driver_data; | |
| 112 | int p, i, ret; | |
| 56 | 113 | static const char *const keynames[2][5] = |
| 57 | 114 | { |
| 58 | 115 | { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }, |
| r7500 | r7501 | |
| 61 | 118 | |
| 62 | 119 | ret = 0xff; |
| 63 | 120 | |
| 64 | p = ~input_sel & 0x1f; | |
| 121 | p = ~state->input_sel & 0x1f; | |
| 65 | 122 | |
| 66 | for (i=0; i<5; i++) | |
| 123 | for (i = 0; i < 5; i++) | |
| 67 | 124 | { |
| 68 | if ( | |
| 125 | if (BIT | |
| 69 | 126 | ret &= input_port_read(space->machine, keynames[offset][i]); |
| 70 | 127 | } |
| 71 | 128 | |
| 72 | 129 | return ret; |
| 73 | 130 | } |
| 74 | 131 | |
| 75 | /****************************************************************************/ | |
| 132 | /************************************* | |
| 133 | * | |
| 134 | * Address maps | |
| 135 | * | |
| 136 | *************************************/ | |
| 76 | 137 | |
| 77 | 138 | static ADDRESS_MAP_START( mayumi_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 78 | 139 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 79 | 140 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 80 | 141 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) |
| 81 | AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(mayumi_videoram_w) AM_BASE( | |
| 142 | AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(mayumi_videoram_w) AM_BASE_MEMBER( | |
| 82 | 143 | ADDRESS_MAP_END |
| 83 | 144 | |
| 84 | 145 | |
| r7500 | r7501 | |
| 91 | 152 | AM_RANGE(0xd0, 0xd1) AM_DEVREADWRITE("ymsnd", ym2203_r, ym2203_w) |
| 92 | 153 | ADDRESS_MAP_END |
| 93 | 154 | |
| 94 | /****************************************************************************/ | |
| 155 | /************************************* | |
| 156 | * | |
| 157 | * Input ports | |
| 158 | * | |
| 159 | *************************************/ | |
| 95 | 160 | |
| 96 | 161 | static INPUT_PORTS_START( mayumi ) |
| 97 | ||
| 98 | PORT_START("DSW1") /* dsw1 */ | |
| 162 | PORT_START("DSW1") | |
| 99 | 163 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) |
| 100 | 164 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 101 | 165 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r7500 | r7501 | |
| 120 | 184 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 121 | 185 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 122 | 186 | |
| 123 | PORT_START("DSW2") | |
| 187 | PORT_START("DSW2") | |
| 124 | 188 | PORT_DIPNAME( 0x80, 0x80, "Unknown 2-1" ) |
| 125 | 189 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 126 | 190 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r7500 | r7501 | |
| 146 | 210 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 147 | 211 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 148 | 212 | |
| 149 | PORT_START("KEY0") | |
| 213 | PORT_START("KEY0") | |
| 150 | 214 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) |
| 151 | 215 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) |
| 152 | 216 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_I ) |
| r7500 | r7501 | |
| 155 | 219 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 156 | 220 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 157 | 221 | |
| 158 | PORT_START("KEY1") | |
| 222 | PORT_START("KEY1") | |
| 159 | 223 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) |
| 160 | 224 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) |
| 161 | 225 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J ) |
| r7500 | r7501 | |
| 164 | 228 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 165 | 229 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 166 | 230 | |
| 167 | PORT_START("KEY2") | |
| 231 | PORT_START("KEY2") | |
| 168 | 232 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) |
| 169 | 233 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) |
| 170 | 234 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_K ) |
| r7500 | r7501 | |
| 173 | 237 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 174 | 238 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 175 | 239 | |
| 176 | PORT_START("KEY3") | |
| 240 | PORT_START("KEY3") | |
| 177 | 241 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) |
| 178 | 242 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) |
| 179 | 243 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L ) |
| r7500 | r7501 | |
| 182 | 246 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 183 | 247 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 184 | 248 | |
| 185 | PORT_START("KEY4") | |
| 249 | PORT_START("KEY4") | |
| 186 | 250 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 187 | 251 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 188 | 252 | |
| 189 | PORT_START("KEY5") | |
| 253 | PORT_START("KEY5") | |
| 190 | 254 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) |
| 191 | 255 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) |
| 192 | 256 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 195 | 259 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) |
| 196 | 260 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 197 | 261 | |
| 198 | PORT_START("KEY6") | |
| 262 | PORT_START("KEY6") | |
| 199 | 263 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) |
| 200 | 264 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) |
| 201 | 265 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 204 | 268 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 205 | 269 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 206 | 270 | |
| 207 | PORT_START("KEY7") | |
| 271 | PORT_START("KEY7") | |
| 208 | 272 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) |
| 209 | 273 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) |
| 210 | 274 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 213 | 277 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 214 | 278 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 215 | 279 | |
| 216 | PORT_START("KEY8") | |
| 280 | PORT_START("KEY8") | |
| 217 | 281 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) |
| 218 | 282 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) |
| 219 | 283 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 222 | 286 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 223 | 287 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 224 | 288 | |
| 225 | PORT_START("KEY9") | |
| 289 | PORT_START("KEY9") | |
| 226 | 290 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 227 | 291 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 228 | 292 | |
| 229 | 293 | PORT_START("IN0") |
| 230 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 231 | PORT_BIT( 0x40, IP_ACTIVE_LOW , IPT_COIN1 ) | |
| 232 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 294 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 295 | PORT_BIT( 0x40, IP_ACTIVE_LOW , IPT_COIN1 ) | |
| 296 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 233 | 297 | PORT_SERVICE( 0x10, IP_ACTIVE_HIGH ) |
| 234 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE2 ) // analyzer | |
| 235 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 236 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 237 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE4 ) // memory reset | |
| 238 | ||
| 298 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE2 ) // analyzer | |
| 299 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 300 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 301 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE4 ) // memory reset | |
| 239 | 302 | INPUT_PORTS_END |
| 240 | 303 | |
| 241 | /****************************************************************************/ | |
| 304 | /************************************* | |
| 305 | * | |
| 306 | * Graphics definitions | |
| 307 | * | |
| 308 | *************************************/ | |
| 242 | 309 | |
| 243 | 310 | static const gfx_layout charlayout = |
| 244 | 311 | { |
| r7500 | r7501 | |
| 255 | 322 | GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 32 ) |
| 256 | 323 | GFXDECODE_END |
| 257 | 324 | |
| 325 | /************************************* | |
| 326 | * | |
| 327 | * Sound interfaces | |
| 328 | * | |
| 329 | *************************************/ | |
| 330 | ||
| 258 | 331 | static const ym2203_interface ym2203_config = |
| 259 | 332 | { |
| 260 | 333 | { |
| r7500 | r7501 | |
| 268 | 341 | NULL |
| 269 | 342 | }; |
| 270 | 343 | |
| 344 | /************************************* | |
| 345 | * | |
| 346 | * Machine driver | |
| 347 | * | |
| 348 | *************************************/ | |
| 349 | ||
| 350 | static MACHINE_START( mayumi ) | |
| 351 | { | |
| 352 | mayumi_state *state = (mayumi_state *)machine->driver_data; | |
| 353 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 354 | ||
| 355 | memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000); | |
| 356 | memory_set_bank(machine, "bank1", 0); | |
| 357 | ||
| 358 | state_save_register_global(machine, state->int_enable); | |
| 359 | state_save_register_global(machine, state->input_sel); | |
| 360 | } | |
| 361 | ||
| 362 | static MACHINE_RESET( mayumi ) | |
| 363 | { | |
| 364 | mayumi_state *state = (mayumi_state *)machine->driver_data; | |
| 365 | ||
| 366 | state->int_enable = 0; | |
| 367 | state->input_sel = 0; | |
| 368 | } | |
| 369 | ||
| 271 | 370 | static MACHINE_DRIVER_START( mayumi ) |
| 272 | 371 | |
| 372 | /* driver data */ | |
| 373 | MDRV_DRIVER_DATA(mayumi_state) | |
| 374 | ||
| 273 | 375 | /* basic machine hardware */ |
| 274 | 376 | MDRV_CPU_ADD("maincpu", Z80, MCLK/2) /* 5.000 MHz ? */ |
| 275 | 377 | MDRV_CPU_PROGRAM_MAP(mayumi_map) |
| 276 | 378 | MDRV_CPU_IO_MAP(mayumi_io_map) |
| 277 | 379 | MDRV_CPU_VBLANK_INT("screen", mayumi_interrupt) |
| 278 | 380 | |
| 381 | MDRV_MACHINE_START( mayumi ) | |
| 279 | 382 | MDRV_MACHINE_RESET( mayumi ) |
| 280 | 383 | |
| 281 | 384 | /* video hardware */ |
| r7500 | r7501 | |
| 307 | 410 | |
| 308 | 411 | MACHINE_DRIVER_END |
| 309 | 412 | |
| 310 | /****************************************************************************/ | |
| 413 | /************************************* | |
| 414 | * | |
| 415 | * ROM definition(s) | |
| 416 | * | |
| 417 | *************************************/ | |
| 311 | 418 | |
| 312 | 419 | ROM_START( mayumi ) |
| 313 | 420 | ROM_REGION( 0x20000, "maincpu", 0 ) /* CPU */ |
| r7500 | r7501 | |
| 326 | 433 | ROM_LOAD( "my-9k.bin", 0x0200, 0x0100, CRC(3e7a8012) SHA1(24129586a1c39f68dad274b5afbdd6c027ab0901) ) // B |
| 327 | 434 | ROM_END |
| 328 | 435 | |
| 329 | GAME( 1988, mayumi, 0, mayumi, mayumi, 0, ROT0, "[Sanritsu] Victory L.L.C.", "Kikiippatsu Mayumi-chan (Japan)", 0 ) | |
| 436 | /************************************* | |
| 437 | * | |
| 438 | * Game driver(s) | |
| 439 | * | |
| 440 | *************************************/ | |
| 441 | ||
| 442 | GAME( 1988, mayumi, 0, mayumi, mayumi, 0, ROT0, "[Sanritsu] Victory L.L.C.", "Kikiippatsu Mayumi-chan (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | typedef struct _diverboy_state diverboy_state; | |
| 57 | struct _diverboy_state | |
| 56 | class diverboy_state | |
| 58 | 57 | { |
| 58 | public: | |
| 59 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, diverboy_state(machine)); } | |
| 60 | ||
| 61 | diverboy_state(running_machine &machine) { } | |
| 62 | ||
| 59 | 63 | /* memory pointers */ |
| 60 | 64 | UINT16 * spriteram; |
| 61 | 65 | // UINT16 * paletteram; // currently this uses generic palette handling |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | #include "emu.h" |
| 23 | 23 | #include "cpu/z80/z80.h" |
| 24 | 24 | #include "sound/sn76496.h" |
| 25 | #include "includes/mrdo.h" | |
| 25 | 26 | |
| 27 | ||
| 26 | 28 | #define MAIN_CLOCK XTAL_8_2MHz |
| 27 | 29 | #define VIDEO_CLOCK XTAL_19_6MHz |
| 28 | 30 | |
| 29 | 31 | |
| 30 | extern UINT8 *mrdo_bgvideoram,*mrdo_fgvideoram; | |
| 31 | WRITE8_HANDLER( mrdo_bgvideoram_w ); | |
| 32 | WRITE8_HANDLER( mrdo_fgvideoram_w ); | |
| 33 | WRITE8_HANDLER( mrdo_scrollx_w ); | |
| 34 | WRITE8_HANDLER( mrdo_scrolly_w ); | |
| 35 | WRITE8_HANDLER( mrdo_flipscreen_w ); | |
| 36 | PALETTE_INIT( mrdo ); | |
| 37 | VIDEO_START( mrdo ); | |
| 38 | VIDEO_UPDATE( mrdo ); | |
| 39 | 32 | |
| 40 | ||
| 41 | ||
| 42 | 33 | /* this looks like some kind of protection. The game doesn't clear the screen */ |
| 43 | 34 | /* if a read from this address doesn't return the value it expects. */ |
| 44 | 35 | static READ8_HANDLER( mrdo_SECRE_r ) |
| 45 | 36 | { |
| 46 | 37 | UINT8 *RAM = memory_region(space->machine, "maincpu"); |
| 47 | return RAM[ | |
| 38 | return RAM[ | |
| 48 | 39 | } |
| 49 | 40 | |
| 50 | 41 | |
| 51 | 42 | |
| 52 | 43 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 53 | 44 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 54 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(mrdo_bgvideoram_w) AM_BASE(&mrdo_bgvideoram) | |
| 55 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(mrdo_fgvideoram_w) AM_BASE(&mrdo_fgvideoram) | |
| 56 | AM_RANGE(0x9000, 0x90ff) AM_WRITEONLY AM_BASE_SIZE_GENERIC(spriteram) | |
| 45 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(mrdo_bgvideoram_w) AM_BASE_MEMBER(mrdo_state, bgvideoram) | |
| 46 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(mrdo_fgvideoram_w) AM_BASE_MEMBER(mrdo_state, fgvideoram) | |
| 47 | AM_RANGE(0x9000, 0x90ff) AM_WRITEONLY AM_BASE_SIZE_MEMBER(mrdo_state, spriteram, spriteram_size) | |
| 57 | 48 | AM_RANGE(0x9800, 0x9800) AM_WRITE(mrdo_flipscreen_w) /* screen flip + playfield priority */ |
| 58 | 49 | AM_RANGE(0x9801, 0x9801) AM_DEVWRITE("sn1", sn76496_w) |
| 59 | 50 | AM_RANGE(0x9802, 0x9802) AM_DEVWRITE("sn2", sn76496_w) |
| r7500 | r7501 | |
| 176 | 167 | |
| 177 | 168 | static MACHINE_DRIVER_START( mrdo ) |
| 178 | 169 | |
| 170 | /* driver data */ | |
| 171 | MDRV_DRIVER_DATA(mrdo_state) | |
| 172 | ||
| 179 | 173 | /* basic machine hardware */ |
| 180 | 174 | MDRV_CPU_ADD("maincpu", Z80, MAIN_CLOCK/2) /* Verified */ |
| 181 | 175 | MDRV_CPU_PROGRAM_MAP(main_map) |
| r7500 | r7501 | |
|---|---|---|
| 1456 | 1456 | INPUT_PORTS_END |
| 1457 | 1457 | |
| 1458 | 1458 | |
| 1459 | static INPUT_PORTS_START( thepitm ) | |
| 1460 | PORT_START("IN0") | |
| 1461 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 1462 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 1463 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) | |
| 1464 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) | |
| 1465 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) | |
| 1466 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 1467 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL | |
| 1468 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) | |
| 1459 | 1469 | |
| 1470 | PORT_START("IN1") | |
| 1471 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 1472 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 1473 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 1474 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 1475 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL | |
| 1476 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 1477 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) // turning both of these on boots with 9 credits? | |
| 1478 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1479 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1480 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 1481 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1482 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 1483 | ||
| 1484 | PORT_START("IN2") | |
| 1485 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) | |
| 1486 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1487 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 1488 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) | |
| 1489 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1490 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 1491 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) ) | |
| 1492 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1493 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 1494 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) | |
| 1495 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 1496 | PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) ) | |
| 1497 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) | |
| 1498 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1499 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 1500 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) | |
| 1501 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1502 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 1503 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 1504 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1505 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1506 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 1507 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1508 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 1509 | INPUT_PORTS_END | |
| 1510 | ||
| 1460 | 1511 | /************************************* |
| 1461 | 1512 | * |
| 1462 | 1513 | * Input Ports |
| r7500 | r7501 | |
| 2048 | 2099 | INPUT_PORTS_END |
| 2049 | 2100 | |
| 2050 | 2101 | |
| 2102 | static INPUT_PORTS_START( aracnis ) | |
| 2103 | PORT_START("IN0") /* 0xa000 */ | |
| 2104 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) // COIN2? (it ALWAYS adds 1 credit) | |
| 2105 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 2106 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 2107 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 2108 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_8WAY | |
| 2109 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 2110 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 2111 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2112 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) | |
| 2113 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 2114 | ||
| 2115 | PORT_START("IN1") /* 0xa800 - needs verifying */ | |
| 2116 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 Button 1") /* also P1 Button 1 */ | |
| 2117 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Start 2 / P1 Button 2") /* also P1 Button 2 */ | |
| 2118 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 2119 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 2120 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 2121 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2122 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 2123 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 2124 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2125 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 2126 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 2127 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2128 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 2129 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 2130 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2131 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 2132 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 2133 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2134 | ||
| 2135 | ||
| 2136 | PORT_START("IN2") /* 0xb001 */ | |
| 2137 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 2138 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) | |
| 2139 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) | |
| 2140 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 2141 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) | |
| 2142 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 2143 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 2144 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2145 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 2146 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 2147 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2148 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 2149 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 2150 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2151 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 2152 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 2153 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2154 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 2155 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 2156 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2157 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 2158 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 2159 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2160 | ||
| 2161 | PORT_START("IN3") /* 0xb002 */ | |
| 2162 | PORT_DIPNAME( 0x01, 0x01, "0xb002" ) | |
| 2163 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 2164 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2165 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 2166 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 2167 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2168 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 2169 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 2170 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2171 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 2172 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 2173 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2174 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 2175 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 2176 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2177 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 2178 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 2179 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2180 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 2181 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 2182 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2183 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 2184 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 2185 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 2186 | INPUT_PORTS_END | |
| 2187 | ||
| 2188 | ||
| 2051 | 2189 | static INPUT_PORTS_START( sfx ) |
| 2052 | 2190 | PORT_START("IN0") |
| 2053 | 2191 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| r7500 | r7501 | |
| 3731 | 3869 | ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */ |
| 3732 | 3870 | ROM_END |
| 3733 | 3871 | |
| 3872 | ROM_START( mooncrstuk ) | |
| 3873 | ROM_REGION( 0x8000, "maincpu", 0 ) | |
| 3874 | ROM_LOAD( "mc1", 0x0000, 0x0800, CRC(7d954a7a) SHA1(a93ee403cfd7887538ad12d33f6dd6c71bea2a32) ) | |
| 3875 | ROM_LOAD( "mc2", 0x0800, 0x0800, CRC(44bb7cfa) SHA1(349c2e23a9fce73f95bb8168d369082fa129fe3d) ) | |
| 3876 | ROM_LOAD( "mc3", 0x1000, 0x0800, CRC(9c412104) SHA1(1b40054ebb1ace965a8522119bb23f09797bc5f6) ) | |
| 3877 | ROM_LOAD( "mc4", 0x1800, 0x0800, CRC(7e9b1ab5) SHA1(435f603c0c3e788a509dd144a7916a34e791ae44) ) | |
| 3878 | ROM_LOAD( "mc5.7r", 0x2000, 0x0800, CRC(16c759af) SHA1(3b48050411f65f9d3fb41ff22901e22d82bf1cf6) ) | |
| 3879 | ROM_LOAD( "mc6.8d", 0x2800, 0x0800, CRC(69bcafdb) SHA1(939c8c6ed1cd4660a3d99b8f17ed99cbd7e1352a) ) | |
| 3880 | ROM_LOAD( "mc7.8e", 0x3000, 0x0800, CRC(b50dbc46) SHA1(4fa084fd1ba5f78e7703e684c57af15ca7a844e4) ) | |
| 3881 | ROM_LOAD( "8_uk.bin", 0x3800, 0x0800, CRC(ce727ad4) SHA1(247fe0ea7dcc7cc50f19da0a54385b8545f03609) ) | |
| 3882 | ||
| 3883 | ROM_REGION( 0x2000, "gfx1", 0 ) | |
| 3884 | ROM_LOAD( "mcs_b", 0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) ) | |
| 3885 | ROM_LOAD( "mcs_d", 0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) ) | |
| 3886 | ROM_LOAD( "mcs_a", 0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) ) | |
| 3887 | ROM_LOAD( "mcs_c", 0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) ) | |
| 3888 | ||
| 3889 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 3890 | ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */ | |
| 3891 | ROM_END | |
| 3892 | ||
| 3734 | 3893 | ROM_START( mooncrstu ) |
| 3735 | 3894 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 3736 | 3895 | ROM_LOAD( "smc1f", 0x0000, 0x0800, CRC(389ca0d6) SHA1(51cf6d190a0ebf23b70c2bcf1ccaa4705e29cd09) ) |
| r7500 | r7501 | |
| 5100 | 5259 | ROM_LOAD( "mmi6331.bpr", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */ |
| 5101 | 5260 | ROM_END |
| 5102 | 5261 | |
| 5262 | ROM_START( aracnis ) | |
| 5263 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5264 | ROM_LOAD( "00sc.bin", 0x0000, 0x1000, CRC(c7e0d6b9) SHA1(3aac51d22939da8a595237ad26fe0f06a3acfb6a) ) | |
| 5265 | ROM_LOAD( "01sc.bin", 0x1000, 0x1000, CRC(03eb27dc) SHA1(8dae30006c9e81ab0d2b5c5faa7257813ea00a89) ) | |
| 5266 | ROM_LOAD( "02sc.bin", 0x2000, 0x1000, CRC(f3d49d4f) SHA1(19f603a2bda88e51608414f2748a33b4fb6e31c1) ) | |
| 5267 | ROM_LOAD( "03sc.bin", 0x3000, 0x1000, CRC(0e741984) SHA1(6e2c7820bbb1834c49f312664c786b50af0cff26) ) | |
| 5268 | ROM_LOAD( "05sc.bin", 0x5000, 0x1000, CRC(f27ee3e4) SHA1(e034507b99705492b6a8aa34764a1e3222ba31b2) ) | |
| 5269 | ROM_LOAD( "06sc.bin", 0x6000, 0x0800, CRC(fdfc2c82) SHA1(6b8914d6496c216de5bf160cd798b8f6facd44d2) ) | |
| 5103 | 5270 | |
| 5271 | ROM_REGION( 0x2000, "gfx1", 0 ) | |
| 5272 | ROM_LOAD( "08sc.1h", 0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) ) | |
| 5273 | ROM_LOAD( "07sc.1k", 0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) ) | |
| 5274 | ||
| 5275 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 5276 | // colours are wrong, but this is the prom that was on the board | |
| 5277 | ||
| 5278 | // note: pin 13 is marked with red paint, and is not connected | |
| 5279 | // ^ this is important for getting correct colours on real hw | |
| 5280 | ROM_LOAD( "mmi6331-1.6l", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) | |
| 5281 | ROM_END | |
| 5282 | ||
| 5104 | 5283 | ROM_START( sfx ) |
| 5105 | 5284 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 5106 | 5285 | ROM_LOAD( "sfx_b-0.1j", 0x0000, 0x1000, CRC(e5bc6952) SHA1(7bfb772418d738d3c49fd59c0bfc04590945977a) ) |
| r7500 | r7501 | |
| 5578 | 5757 | ROM_LOAD( "bprom.bin", 0x0000, 0x0020, CRC(2b4cf53f) SHA1(8d7eb0453173b9821eea32419b67559bfb4578d0) ) |
| 5579 | 5758 | ROM_END |
| 5580 | 5759 | |
| 5760 | /* | |
| 5581 | 5761 | |
| 5762 | The Pit (on Moon Quasar hardware) | |
| 5763 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 5764 | ||
| 5765 | Dumped by Andrew Welburn | |
| 5766 | on the sunny morning of 2/03/10 | |
| 5767 | ||
| 5768 | http://www.andys-arcade.com | |
| 5769 | ||
| 5770 | ************************************************* | |
| 5771 | **Do not seperate this text file from the roms.** | |
| 5772 | ************************************************* | |
| 5773 | ||
| 5774 | Nichibutsu Moon Quasar pcb largely unhacked, but | |
| 5775 | with an odd looking set of roms. One gfx rom | |
| 5776 | identifies itself as 'The Pit' so that is my only | |
| 5777 | guess at what the game actually is. | |
| 5778 | ||
| 5779 | Roms 1 through 8 read well in-circuit in the right | |
| 5780 | places in the memory map for moon cresta, | |
| 5781 | (through the fluke 9100) but the game does not | |
| 5782 | currently run. Roms dumped adn verified with no | |
| 5783 | anomolies. | |
| 5784 | ||
| 5785 | Rom 9 was placed on the through-socket and has | |
| 5786 | pins 20 and 18 (/E and A11 respectively) tied to | |
| 5787 | pin 5 of 8E (A14/A15/MREQ demux). This demux has | |
| 5788 | some patches, the trace to pin 13 is cut, and is | |
| 5789 | instead wired to pin 3. | |
| 5790 | ||
| 5791 | */ | |
| 5792 | ||
| 5793 | ROM_START( thepitm ) | |
| 5794 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5795 | ROM_LOAD( "1.bin", 0x0000, 0x0800, CRC(0f78d6ea) SHA1(e224b2fb9b4a26295b03af720fa647d4488a1287) ) | |
| 5796 | ROM_LOAD( "2.bin", 0x0800, 0x0800, CRC(ebacc6eb) SHA1(8b73d96ebe8070fbbb16434aa6a30ec8985ddec6) ) | |
| 5797 | ROM_LOAD( "3.bin", 0x1000, 0x0800, CRC(14fd0706) SHA1(5d905d8272731c307dc9f96caf4973b28413198e) ) | |
| 5798 | ROM_LOAD( "4.bin", 0x1800, 0x0800, CRC(613e920f) SHA1(078c7f36ba0145fbbd24bdae4cb6b03c5c27c1cc) ) | |
| 5799 | ROM_LOAD( "5.bin", 0x2000, 0x0800, CRC(5a791f3f) SHA1(166f07f7fe260e53e611784976792638a25485c1) ) | |
| 5800 | ROM_LOAD( "6.bin", 0x2800, 0x0800, CRC(0bb37f51) SHA1(32e31678388bad048c829bd43a18dc4e24869840) ) | |
| 5801 | ROM_LOAD( "7.bin", 0x3000, 0x0800, CRC(4dfdec6f) SHA1(eb88a278860998c343f94e27c8c6c723cffb2dd9) ) | |
| 5802 | ROM_LOAD( "8.bin", 0x3800, 0x0800, CRC(a39a9189) SHA1(aacd54edca6bc7f7feacd651a0de57b3d9592aad) ) | |
| 5803 | ROM_LOAD( "9.bin", 0x4000, 0x0800, CRC(2eb90e07) SHA1(92678fc5cfeb7119ce27f042571daa831fa1dad5) ) | |
| 5804 | ||
| 5805 | ROM_REGION( 0x2000, "gfx1", 0 ) | |
| 5806 | ROM_LOAD( "1h.bin", 0x0000, 0x0800, CRC(00dce65f) SHA1(ba0cce484d1f8693a85b85e0689d107588df9043) ) | |
| 5807 | ROM_LOAD( "1k.bin", 0x1000, 0x0800, CRC(3ec0056e) SHA1(1dd19e7535ab9abd62b4b32663437f8e8acb91b5) ) | |
| 5808 | ||
| 5809 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 5810 | ROM_LOAD( "6l.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) | |
| 5811 | ROM_END | |
| 5812 | ||
| 5582 | 5813 | /************************************* |
| 5583 | 5814 | * |
| 5584 | 5815 | * Game drivers |
| r7500 | r7501 | |
| 5671 | 5902 | |
| 5672 | 5903 | /* based on Galaxian, but with altered address map for more ROM */ |
| 5673 | 5904 | GAME( 1980, mooncrst, 0, mooncrst, mooncrst, mooncrst, ROT90, "Nichibutsu", "Moon Cresta (Nichibutsu)", GAME_SUPPORTS_SAVE ) |
| 5674 | GAME( 1980, mooncrstu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90, "Nichibutsu USA", "Moon Cresta (Nichibutsu, unencrypted)", GAME_SUPPORTS_SAVE ) | |
| 5905 | GAME( 1980, mooncrstuk,mooncrst, mooncrst, mooncrst, mooncrst, ROT90, "Nichibutsu UK", "Moon Cresta (Nichibutsu UK)", GAME_SUPPORTS_SAVE ) | |
| 5906 | GAME( 1980, mooncrstu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90, "Nichibutsu USA", "Moon Cresta (Nichibutsu USA, unencrypted)", GAME_SUPPORTS_SAVE ) | |
| 5675 | 5907 | GAME( 1980, mooncrsto, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90, "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE ) |
| 5676 | 5908 | GAME( 1980, mooncrstg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90, "Gremlin", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE ) |
| 5677 | 5909 | |
| r7500 | r7501 | |
| 5695 | 5927 | GAME( 1980, moonal2, galaxian, mooncrst, moonal2, galaxian, ROT90, "Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE ) |
| 5696 | 5928 | GAME( 1980, moonal2b, galaxian, mooncrst, moonal2, galaxian, ROT90, "Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE ) |
| 5697 | 5929 | |
| 5930 | /* larger romspace, interrupt enable moved */ | |
| 5931 | GAME( 198?, thepitm, thepit, mooncrst, thepitm, thepitm, ROT90, "KZH", "The Pit (bootleg on Moon Quasar hardware)", GAME_SUPPORTS_SAVE ) // on an original MQ-2FJ pcb, even if the memory map appears closer to Moon Cresta | |
| 5932 | ||
| 5933 | ||
| 5698 | 5934 | /* other games on basic mooncrst hardware */ |
| 5699 | 5935 | GAME( 1982, skybase, 0, mooncrst, skybase, skybase, ROT90, "Omori Electric Co., Ltd.", "Sky Base", GAME_SUPPORTS_SAVE ) |
| 5700 | 5936 | |
| r7500 | r7501 | |
| 5773 | 6009 | GAME( 1982, scorpiona,scorpion, scorpion, scorpion, scorpion, ROT90, "Zaccaria", "Scorpion (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE) |
| 5774 | 6010 | GAME( 1982, scorpionb,scorpion, scorpion, scorpion, scorpion, ROT90, "Zaccaria", "Scorpion (set 3)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE) |
| 5775 | 6011 | GAME( 19??, scorpionmc,scorpion, mooncrst, scorpnmc, scorpnmc, ROT90, "Dorneer", "Scorpion (Moon Cresta hardware)", GAME_SUPPORTS_SAVE ) |
| 6012 | GAME( 19??, aracnis, scorpion, mooncrst, aracnis, scorpnmc, ROT90, "bootleg", "Aracnis (bootleg of Scorpion on Moon Cresta hardware)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) | |
| 5776 | 6013 | |
| 5777 | 6014 | /* SF-X hardware; based on Scramble with extra Z80 and 8255 driving a DAC-based sample player */ |
| 5778 | 6015 | GAME( 1983, sfx, 0, sfx, sfx, sfx, ORIENTATION_FLIP_X, "Nichibutsu", "SF-X", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #define DE156CPU ARM |
| 16 | ||
| 16 | 17 | #include "emu.h" |
| 18 | #include "cpu/arm/arm.h" | |
| 17 | 19 | #include "includes/decocrpt.h" |
| 18 | #include "includes/deco32.h" | |
| 19 | 20 | #include "machine/eeprom.h" |
| 20 | 21 | #include "sound/okim6295.h" |
| 21 | 22 | #include "sound/ymz280b.h" |
| 22 | #include "cpu/arm/arm.h" | |
| 23 | #include "includes/deco16ic.h" | |
| 23 | #include "video/deco16ic.h" | |
| 24 | 24 | |
| 25 | ||
| 25 | ||
| 26 | 26 | { |
| 27 | return ((bank>>4)&0x7) * 0x1000; | |
| 28 | } | |
| 27 | public: | |
| 28 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, deco156_state(machine)); } | |
| 29 | 29 | |
| 30 | deco156_state(running_machine &machine) { } | |
| 30 | 31 | |
| 32 | /* memory pointers */ | |
| 33 | UINT16 * pf1_rowscroll; | |
| 34 | UINT16 * pf2_rowscroll; | |
| 35 | ||
| 36 | /* devices */ | |
| 37 | running_device *maincpu; | |
| 38 | running_device *deco16ic; | |
| 39 | running_device *oki2; | |
| 40 | }; | |
| 41 | ||
| 42 | ||
| 31 | 43 | static VIDEO_START( wcvol95 ) |
| 32 | 44 | { |
| 45 | deco156_state *state = (deco156_state *)machine->driver_data; | |
| 46 | ||
| 33 | 47 | /* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */ |
| 34 | deco16_pf1_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 35 | deco16_pf2_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 36 | deco16_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 37 | deco16_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 38 | deco16_pf12_control = auto_alloc_array(machine, UINT16, 0x10/2); | |
| 48 | state->pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 49 | state->pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2); | |
| 39 | 50 | machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2); |
| 40 | 51 | |
| 41 | 52 | /* and register the allocated ram so that save states still work */ |
| 42 | state_save_register_global_pointer(machine, deco16_pf1_data, 0x2000/2); | |
| 43 | state_save_register_global_pointer(machine, deco16_pf2_data, 0x2000/2); | |
| 44 | state_save_register_global_pointer(machine, deco16_pf1_rowscroll, 0x800/2); | |
| 45 | state_save_register_global_pointer(machine, deco16_pf2_rowscroll, 0x800/2); | |
| 46 | state_save_register_global_pointer(machine, deco16_pf12_control, 0x10/2); | |
| 53 | state_save_register_global_pointer(machine, state->pf1_rowscroll, 0x800/2); | |
| 54 | state_save_register_global_pointer(machine, state->pf2_rowscroll, 0x800/2); | |
| 47 | 55 | state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000/2); |
| 48 | ||
| 49 | deco16_1_video_init(machine); | |
| 50 | ||
| 51 | deco16_set_tilemap_bank_callback(0, simpl156_bank_callback); | |
| 52 | deco16_set_tilemap_bank_callback(1, simpl156_bank_callback); | |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | 58 | /* spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps |
| 56 | 59 | its the same sprite chip Data East used on many, many 16-bit era titles */ |
| 57 | 60 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) |
| 58 | 61 | { |
| 59 | UINT32 *spriteram | |
| 62 | UINT32 *spriteram | |
| 60 | 63 | int offs; |
| 61 | 64 | |
| 62 | 65 | flip_screen_set_no_update(machine, 1); |
| 63 | 66 | |
| 64 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien | |
| 67 | for (offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) // 0x1400 for charlien | |
| 65 | 68 | { |
| 66 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult, pri; | |
| 69 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri; | |
| 67 | 70 | |
| 68 | sprite = spriteram | |
| 71 | sprite = spriteram | |
| 69 | 72 | |
| 70 | y = spriteram32[offs]&0xffff; | |
| 71 | flash=y&0x1000; | |
| 72 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 73 | y = spriteram[offs] & 0xffff; | |
| 74 | flash = y & 0x1000; | |
| 75 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 76 | continue; | |
| 73 | 77 | |
| 74 | x = spriteram32[offs+2]&0xffff; | |
| 75 | colour = (x >>9) & 0x1f; | |
| 78 | x = spriteram[offs + 2] & 0xffff; | |
| 79 | colour = (x >> 9) & 0x1f; | |
| 76 | 80 | |
| 77 | pri = (x&0xc000); // 2 bits or 1? | |
| 81 | pri = (x & 0xc000); // 2 bits or 1? | |
| 78 | 82 | |
| 79 | switch (pri&0xc000) { | |
| 80 | case 0x0000: pri=0; break; | |
| 81 | case 0x4000: pri=0xf0; break; | |
| 82 | case 0x8000: pri=0xf0|0xcc; break; | |
| 83 | case 0xc000: pri=0xf0|0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 83 | switch (pri & 0xc000) | |
| 84 | { | |
| 85 | case 0x0000: pri = 0; break; | |
| 86 | case 0x4000: pri = 0xf0; break; | |
| 87 | case 0x8000: pri = 0xf0 | 0xcc; break; | |
| 88 | case 0xc000: pri = 0xf0 | 0xcc; break; /* or 0xf0|0xcc|0xaa ? */ | |
| 84 | 89 | } |
| 85 | 90 | |
| 86 | 91 | fx = y & 0x2000; |
| r7500 | r7501 | |
| 92 | 97 | if (x >= 320) x -= 512; |
| 93 | 98 | if (y >= 256) y -= 512; |
| 94 | 99 | y = 240 - y; |
| 95 | ||
| 100 | | |
| 96 | 101 | |
| 97 | if (x>320) continue; | |
| 102 | if (x > 320) | |
| 103 | continue; | |
| 98 | 104 | |
| 99 | 105 | sprite &= ~multi; |
| 100 | 106 | if (fy) |
| r7500 | r7501 | |
| 107 | 113 | |
| 108 | 114 | if (flip_screen_x_get(machine)) |
| 109 | 115 | { |
| 110 | y=240-y; | |
| 111 | x=304-x; | |
| 112 | if (fx) fx=0; else fx=1; | |
| 113 | if (fy) fy=0; else fy=1; | |
| 114 | mult=16; | |
| 116 | y = 240 - y; | |
| 117 | x = 304 - x; | |
| 118 | if (fx) fx = 0; else fx = 1; | |
| 119 | if (fy) fy = 0; else fy = 1; | |
| 120 | mult = 16; | |
| 115 | 121 | } |
| 116 | else mult=-16; | |
| 122 | else mult = -16; | |
| 117 | 123 | |
| 118 | 124 | while (multi >= 0) |
| 119 | 125 | { |
| r7500 | r7501 | |
| 133 | 139 | |
| 134 | 140 | static VIDEO_UPDATE( wcvol95 ) |
| 135 | 141 | { |
| 136 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 137 | bitmap_fill(bitmap,NULL,0); | |
| 142 | deco156_state *state = (deco156_state *)screen->machine->driver_data; | |
| 138 | 143 | |
| 139 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 144 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 145 | bitmap_fill(bitmap, NULL, 0); | |
| 140 | 146 | |
| 141 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 142 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 143 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 147 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 148 | ||
| 149 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 150 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 151 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 144 | 152 | return 0; |
| 145 | 153 | } |
| 146 | 154 | |
| r7500 | r7501 | |
| 148 | 156 | |
| 149 | 157 | static WRITE32_HANDLER(hvysmsh_eeprom_w) |
| 150 | 158 | { |
| 159 | deco156_state *state = (deco156_state *)space->machine->driver_data; | |
| 151 | 160 | if (ACCESSING_BITS_0_7) |
| 152 | 161 | { |
| 153 | okim6295_set_bank_base( | |
| 162 | okim6295_set_bank_base(s | |
| 154 | 163 | input_port_write(space->machine, "EEPROMOUT", data, 0xff); |
| 155 | 164 | } |
| 156 | 165 | } |
| r7500 | r7501 | |
| 166 | 175 | palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10)); |
| 167 | 176 | } |
| 168 | 177 | |
| 169 | /***************************************************************************/ | |
| 170 | static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { return deco16_pf1_rowscroll[offset]^0xffff0000; } | |
| 171 | static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { return deco16_pf2_rowscroll[offset]^0xffff0000; } | |
| 172 | static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf1_rowscroll[offset]); } | |
| 173 | static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf2_rowscroll[offset]); } | |
| 174 | static READ32_HANDLER ( wcvol95_pf12_control_r ) { return deco16_pf12_control[offset]^0xffff0000; } | |
| 175 | static WRITE32_HANDLER( wcvol95_pf12_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf12_control[offset]); } | |
| 176 | static READ32_HANDLER( wcvol95_pf1_data_r ) { return deco16_pf1_data[offset]^0xffff0000; } | |
| 177 | static READ32_HANDLER( wcvol95_pf2_data_r ) { return deco16_pf2_data[offset]^0xffff0000; } | |
| 178 | static WRITE32_HANDLER( wcvol95_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(space,offset,data,mem_mask); } | |
| 179 | static WRITE32_HANDLER( wcvol95_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(space,offset,data,mem_mask); } | |
| 178 | /* This is the same as deco32_nonbuffered_palette_w in video/deco32.c */ | |
| 179 | static WRITE32_HANDLER( deco156_nonbuffered_palette_w ) | |
| 180 | { | |
| 181 | int r,g,b; | |
| 180 | 182 | |
| 183 | COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]); | |
| 181 | 184 | |
| 185 | b = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff; | |
| 186 | g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff; | |
| 187 | r = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff; | |
| 188 | ||
| 189 | palette_set_color(space->machine,offset,MAKE_RGB(r,g,b)); | |
| 190 | } | |
| 191 | ||
| 192 | static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { deco156_state *state = (deco156_state *)space->machine->driver_data; return state->pf1_rowscroll[offset] ^ 0xffff0000; } | |
| 193 | static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { deco156_state *state = (deco156_state *)space->machine->driver_data; return state->pf2_rowscroll[offset] ^ 0xffff0000; } | |
| 194 | static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { deco156_state *state = (deco156_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); } | |
| 195 | static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { deco156_state *state = (deco156_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); } | |
| 196 | ||
| 197 | ||
| 182 | 198 | static ADDRESS_MAP_START( hvysmsh_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 183 | 199 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 184 | 200 | AM_RANGE(0x100000, 0x107fff) AM_RAM |
| r7500 | r7501 | |
| 189 | 205 | AM_RANGE(0x12000c, 0x12000f) AM_DEVWRITE("oki1", hvysmsh_oki_0_bank_w) |
| 190 | 206 | AM_RANGE(0x140000, 0x140003) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x000000ff) |
| 191 | 207 | AM_RANGE(0x160000, 0x160003) AM_DEVREADWRITE8("oki2", okim6295_r, okim6295_w, 0x000000ff) |
| 192 | AM_RANGE(0x180000, 0x18001f) AM_READWRITE( wcvol95_pf12_control_r, wcvol95_pf12_control_w ) | |
| 193 | AM_RANGE(0x190000, 0x191fff) AM_READWRITE( wcvol95_pf1_data_r, wcvol95_pf1_data_w ) | |
| 194 | AM_RANGE(0x194000, 0x195fff) AM_READWRITE( wcvol95_pf2_data_r, wcvol95_pf2_data_w ) | |
| 195 | AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE( wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w ) | |
| 196 | AM_RANGE(0x1a4000, 0x1a4fff) AM_READWRITE( wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w ) | |
| 197 | AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(deco32_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 208 | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 209 | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 210 | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 211 | AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w) | |
| 212 | AM_RANGE(0x1a4000, 0x1a4fff) AM_READWRITE(wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w) | |
| 213 | AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(deco156_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 198 | 214 | AM_RANGE(0x1d0010, 0x1d002f) AM_READNOP // Check for DMA complete? |
| 199 | 215 | AM_RANGE(0x1e0000, 0x1e1fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 200 | 216 | ADDRESS_MAP_END |
| 201 | 217 | |
| 202 | 218 | static ADDRESS_MAP_START( wcvol95_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 203 | 219 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 204 | AM_RANGE(0x100000, 0x10001f) AM_READWRITE( wcvol95_pf12_control_r, wcvol95_pf12_control_w ) | |
| 205 | AM_RANGE(0x110000, 0x111fff) AM_READWRITE( wcvol95_pf1_data_r, wcvol95_pf1_data_w ) | |
| 206 | AM_RANGE(0x114000, 0x115fff) AM_READWRITE( wcvol95_pf2_data_r, wcvol95_pf2_data_w ) | |
| 207 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE( wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w ) | |
| 208 | AM_RANGE(0x124000, 0x124fff) AM_READWRITE( wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w ) | |
| 220 | AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 221 | AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 222 | AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 223 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE(wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w) | |
| 224 | AM_RANGE(0x124000, 0x124fff) AM_READWRITE(wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w) | |
| 209 | 225 | AM_RANGE(0x130000, 0x137fff) AM_RAM |
| 210 | 226 | AM_RANGE(0x140000, 0x140003) AM_READ_PORT("INPUTS") |
| 211 | 227 | AM_RANGE(0x150000, 0x150003) AM_WRITE_PORT("EEPROMOUT") |
| r7500 | r7501 | |
| 366 | 382 | cpu_set_input_line(device, ARM_IRQ_LINE, HOLD_LINE); |
| 367 | 383 | } |
| 368 | 384 | |
| 385 | static int deco156_bank_callback(const int bank) | |
| 386 | { | |
| 387 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 388 | } | |
| 389 | ||
| 390 | static const deco16ic_interface deco156_deco16ic_intf = | |
| 391 | { | |
| 392 | "screen", | |
| 393 | 1, 0, 1, | |
| 394 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 395 | 0, 16, 0, 16, /* color base (default values) */ | |
| 396 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 397 | deco156_bank_callback, | |
| 398 | deco156_bank_callback, | |
| 399 | NULL, | |
| 400 | NULL | |
| 401 | }; | |
| 402 | ||
| 403 | static MACHINE_START( deco156 ) | |
| 404 | { | |
| 405 | deco156_state *state = (deco156_state *)machine->driver_data; | |
| 406 | ||
| 407 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 408 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 409 | state->oki2 = devtag_get_device(machine, "oki2"); | |
| 410 | } | |
| 411 | ||
| 369 | 412 | static MACHINE_DRIVER_START( hvysmsh ) |
| 370 | 413 | |
| 414 | /* driver data */ | |
| 415 | MDRV_DRIVER_DATA(deco156_state) | |
| 416 | ||
| 371 | 417 | /* basic machine hardware */ |
| 372 | 418 | MDRV_CPU_ADD("maincpu", ARM, 28000000) /* Unconfirmed */ |
| 373 | 419 | MDRV_CPU_PROGRAM_MAP(hvysmsh_map) |
| r7500 | r7501 | |
| 375 | 421 | |
| 376 | 422 | MDRV_EEPROM_93C46_ADD("eeprom") |
| 377 | 423 | |
| 424 | MDRV_MACHINE_START(deco156) | |
| 425 | ||
| 378 | 426 | /* video hardware */ |
| 379 | 427 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 380 | 428 | |
| r7500 | r7501 | |
| 391 | 439 | MDRV_VIDEO_START(wcvol95) |
| 392 | 440 | MDRV_VIDEO_UPDATE(wcvol95) |
| 393 | 441 | |
| 442 | MDRV_DECO16IC_ADD("deco_custom", deco156_deco16ic_intf) | |
| 443 | ||
| 394 | 444 | /* sound hardware */ |
| 395 | 445 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 396 | 446 | |
| r7500 | r7501 | |
| 407 | 457 | |
| 408 | 458 | static MACHINE_DRIVER_START( wcvol95 ) |
| 409 | 459 | |
| 460 | /* driver data */ | |
| 461 | MDRV_DRIVER_DATA(deco156_state) | |
| 462 | ||
| 410 | 463 | /* basic machine hardware */ |
| 411 | 464 | MDRV_CPU_ADD("maincpu", ARM, 28000000) /* Unconfirmed */ |
| 412 | 465 | MDRV_CPU_PROGRAM_MAP(wcvol95_map) |
| r7500 | r7501 | |
| 414 | 467 | |
| 415 | 468 | MDRV_EEPROM_93C46_ADD("eeprom") |
| 416 | 469 | |
| 470 | MDRV_MACHINE_START(deco156) | |
| 471 | ||
| 417 | 472 | /* video hardware */ |
| 418 | 473 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 419 | 474 | |
| r7500 | r7501 | |
| 430 | 485 | MDRV_VIDEO_START(wcvol95) |
| 431 | 486 | MDRV_VIDEO_UPDATE(wcvol95) |
| 432 | 487 | |
| 488 | MDRV_DECO16IC_ADD("deco_custom", deco156_deco16ic_intf) | |
| 489 | ||
| 433 | 490 | /* sound hardware */ |
| 434 | 491 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 435 | 492 | |
| r7500 | r7501 | |
| 639 | 696 | UINT8 *buf1 = auto_alloc_array(machine, UINT8, length); |
| 640 | 697 | UINT32 x; |
| 641 | 698 | |
| 642 | for (x=0;x<length;x++) | |
| 699 | for (x = 0; x < length; x++) | |
| 643 | 700 | { |
| 644 | 701 | UINT32 addr; |
| 645 | 702 | |
| r7500 | r7501 | |
| 655 | 712 | |
| 656 | 713 | memcpy(rom,buf1,length); |
| 657 | 714 | |
| 658 | auto_free | |
| 715 | auto_free | |
| 659 | 716 | } |
| 660 | 717 | |
| 661 | 718 | static DRIVER_INIT( hvysmsh ) |
| r7500 | r7501 | |
| 675 | 732 | |
| 676 | 733 | /**********************************************************************************/ |
| 677 | 734 | |
| 678 | GAME( 1993, hvysmsh, 0, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Europe version -2)", 0) | |
| 679 | GAME( 1993, hvysmsha, hvysmsh, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Asia version -4)", 0) | |
| 680 | GAME( 1993, hvysmshj, hvysmsh, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Japan version -2)", 0) | |
| 681 | GAME( 1995, wcvol95, 0, wcvol95, wcvol95, wcvol95, ROT0, "Data East Corporation", "World Cup Volley '95 (Japan v1.0)",0 ) | |
| 735 | GAME( 1993, hvysmsh, 0, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Europe version -2)", GAME_SUPPORTS_SAVE ) | |
| 736 | GAME( 1993, hvysmsha, hvysmsh, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Asia version -4)", GAME_SUPPORTS_SAVE ) | |
| 737 | GAME( 1993, hvysmshj, hvysmsh, hvysmsh, hvysmsh, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Japan version -2)", GAME_SUPPORTS_SAVE ) | |
| 738 | GAME( 1995, wcvol95, 0, wcvol95, wcvol95, wcvol95, ROT0, "Data East Corporation", "World Cup Volley '95 (Japan v1.0)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 278 | 278 | #include "cpu/i8085/i8085.h" |
| 279 | 279 | #include "sound/ay8910.h" |
| 280 | 280 | |
| 281 | typedef struct _dwarfd_state dwarfd_state; | |
| 282 | struct _dwarfd_state | |
| 281 | class dwarfd_state | |
| 283 | 282 | { |
| 283 | public: | |
| 284 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dwarfd_state(machine)); } | |
| 285 | ||
| 286 | dwarfd_state(running_machine &machine) { } | |
| 287 | ||
| 284 | 288 | /* memory pointers */ |
| 285 | 289 | UINT8 * dw_ram; |
| 286 | 290 | UINT8 * videobuf; |
| r7500 | r7501 | |
|---|---|---|
| 72 | 72 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 73 | 73 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY |
| 74 | 74 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY |
| 75 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 76 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 75 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 76 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 77 | 77 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 78 | 78 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 79 | 79 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Mr.Jong | |
| 4 | (c)1983 Kiwako (This game is distributed by Sanritsu.) | |
| 3 | Mr. Jong | |
| 4 | (c)1983 Kiwako (This game is distributed by Sanritsu.) | |
| 5 | 5 | |
| 6 | Crazy Blocks | |
| 7 | (c)1983 Kiwako/ECI | |
| 6 | Crazy Blocks | |
| 7 | (c)1983 Kiwako/ECI | |
| 8 | 8 | |
| 9 | Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 2000/03/20 - | |
| 9 | Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 2000/03/20 - | |
| 10 | 10 | |
| 11 | Block Buster | |
| 12 | (c)1983 Kiwako/ECI | |
| 11 | Block Buster | |
| 12 | (c)1983 Kiwako/ECI | |
| 13 | 13 | |
| 14 | ||
| 14 | 15 | PCB Layout |
| 15 | 16 | ---------- |
| 16 | 17 | |
| r7500 | r7501 | |
| 45 | 46 | #include "emu.h" |
| 46 | 47 | #include "cpu/z80/z80.h" |
| 47 | 48 | #include "sound/sn76496.h" |
| 49 | #include "includes/mrjong.h" | |
| 48 | 50 | |
| 49 | 51 | |
| 50 | extern UINT8 *mrjong_videoram; | |
| 51 | extern UINT8 *mrjong_colorram; | |
| 52 | /************************************* | |
| 53 | * | |
| 54 | * Memory handlers | |
| 55 | * | |
| 56 | *************************************/ | |
| 52 | 57 | |
| 53 | extern WRITE8_HANDLER( mrjong_videoram_w ); | |
| 54 | extern WRITE8_HANDLER( mrjong_colorram_w ); | |
| 55 | extern WRITE8_HANDLER( mrjong_flipscreen_w ); | |
| 58 | static READ8_HANDLER( io_0x03_r ) | |
| 59 | { | |
| 60 | return 0x00; | |
| 61 | } | |
| 56 | 62 | |
| 57 | extern PALETTE_INIT( mrjong ); | |
| 58 | extern VIDEO_START( mrjong ); | |
| 59 | extern VIDEO_UPDATE( mrjong ); | |
| 60 | 63 | |
| 64 | /************************************* | |
| 65 | * | |
| 66 | * Address maps | |
| 67 | * | |
| 68 | *************************************/ | |
| 61 | 69 | |
| 62 | 70 | static ADDRESS_MAP_START( mrjong_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 63 | 71 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 64 | 72 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 65 | 73 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| 66 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(mrjong_videoram_w) AM_BASE(&mrjong_videoram) | |
| 67 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(mrjong_colorram_w) AM_BASE(&mrjong_colorram) | |
| 74 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(mrjong_videoram_w) AM_BASE_MEMBER(mrjong_state, videoram) | |
| 75 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(mrjong_colorram_w) AM_BASE_MEMBER(mrjong_state, colorram) | |
| 68 | 76 | ADDRESS_MAP_END |
| 69 | 77 | |
| 70 | static WRITE8_HANDLER( io_0x00_w ) | |
| 71 | { | |
| 72 | mrjong_flipscreen_w(space, 0, ((data & 0x04) > 2)); | |
| 73 | } | |
| 74 | ||
| 75 | static READ8_HANDLER( io_0x03_r ) | |
| 76 | { | |
| 77 | return 0x00; | |
| 78 | } | |
| 79 | ||
| 80 | ||
| 81 | 78 | static ADDRESS_MAP_START( mrjong_io_map, ADDRESS_SPACE_IO, 8 ) |
| 82 | 79 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 83 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P2") AM_WRITE( | |
| 80 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P2") AM_WRITE(mrjong_flipscreen_w) | |
| 84 | 81 | AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_DEVWRITE("sn1", sn76496_w) |
| 85 | 82 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW") AM_DEVWRITE("sn2", sn76496_w) |
| 86 | 83 | AM_RANGE(0x03, 0x03) AM_READ(io_0x03_r) // Unknown |
| 87 | 84 | ADDRESS_MAP_END |
| 88 | 85 | |
| 86 | /************************************* | |
| 87 | * | |
| 88 | * Input ports | |
| 89 | * | |
| 90 | *************************************/ | |
| 91 | ||
| 89 | 92 | static INPUT_PORTS_START( mrjong ) |
| 90 | 93 | PORT_START("P2") |
| 91 | 94 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) |
| r7500 | r7501 | |
| 133 | 136 | INPUT_PORTS_END |
| 134 | 137 | |
| 135 | 138 | |
| 139 | /************************************* | |
| 140 | * | |
| 141 | * Graphics definitions | |
| 142 | * | |
| 143 | *************************************/ | |
| 144 | ||
| 136 | 145 | static const gfx_layout tilelayout = |
| 137 | 146 | { |
| 138 | 147 | 8, 8, /* 8*8 characters */ |
| r7500 | r7501 | |
| 163 | 172 | GFXDECODE_END |
| 164 | 173 | |
| 165 | 174 | |
| 175 | /************************************* | |
| 176 | * | |
| 177 | * Machine driver | |
| 178 | * | |
| 179 | *************************************/ | |
| 180 | ||
| 166 | 181 | static MACHINE_DRIVER_START( mrjong ) |
| 167 | 182 | |
| 183 | /* driver data */ | |
| 184 | MDRV_DRIVER_DATA(mrjong_state) | |
| 185 | ||
| 168 | 186 | /* basic machine hardware */ |
| 169 | 187 | MDRV_CPU_ADD("maincpu", Z80,15468000/6) /* 2.578 MHz?? */ |
| 170 | 188 | MDRV_CPU_PROGRAM_MAP(mrjong_map) |
| r7500 | r7501 | |
| 189 | 207 | /* sound hardware */ |
| 190 | 208 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 191 | 209 | |
| 192 | ||
| 210 | | |
| 193 | 211 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 194 | 212 | |
| 195 | ||
| 213 | | |
| 196 | 214 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 197 | 215 | MACHINE_DRIVER_END |
| 198 | 216 | |
| 199 | 217 | |
| 200 | /*************************************************************************** | |
| 218 | /************************************* | |
| 219 | * | |
| 220 | * ROM definition(s) | |
| 221 | * | |
| 222 | *************************************/ | |
| 201 | 223 | |
| 202 | Game driver(s) | |
| 203 | ||
| 204 | ***************************************************************************/ | |
| 205 | ||
| 206 | 224 | ROM_START( mrjong ) |
| 207 | 225 | ROM_REGION( 0x10000, "maincpu", 0 ) /* code */ |
| 208 | 226 | ROM_LOAD( "mj00", 0x0000, 0x2000, CRC(d211aed3) SHA1(01f252ca1d2399146fa3ed44cb2daa1d5925cae5) ) |
| r7500 | r7501 | |
| 251 | 269 | ROM_LOAD( "clr.g5", 0x0020, 0x0100, CRC(bcb1e2e3) SHA1(c09731836a9d4e50316a84b86f61b599a1ef944d) ) |
| 252 | 270 | ROM_END |
| 253 | 271 | |
| 254 | GAME( 1983, mrjong, 0, mrjong, mrjong, 0, ROT90, "Kiwako", "Mr. Jong (Japan)", 0 ) | |
| 255 | GAME( 1983, crazyblk, mrjong, mrjong, mrjong, 0, ROT90, "Kiwako (ECI license)", "Crazy Blocks", 0 ) | |
| 256 | GAME( 1983, blkbustr, mrjong, mrjong, mrjong, 0, ROT90, "Kiwako (ECI license)", "BlockBuster", 0 ) | |
| 272 | /************************************* | |
| 273 | * | |
| 274 | * Game driver(s) | |
| 275 | * | |
| 276 | *************************************/ | |
| 257 | 277 | |
| 278 | GAME( 1983, mrjong, 0, mrjong, mrjong, 0, ROT90, "Kiwako", "Mr. Jong (Japan)", GAME_SUPPORTS_SAVE ) | |
| 279 | GAME( 1983, crazyblk, mrjong, mrjong, mrjong, 0, ROT90, "Kiwako (ECI license)", "Crazy Blocks", GAME_SUPPORTS_SAVE ) | |
| 280 | GAME( 1983, blkbustr, mrjong, mrjong, mrjong, 0, ROT90, "Kiwako (ECI license)", "BlockBuster", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 58 | 58 | #include "includes/m79amb.h" |
| 59 | 59 | #include "cpu/i8085/i8085.h" |
| 60 | 60 | |
| 61 | static UINT8 *ramtek_videoram; | |
| 62 | static UINT8 *mask; | |
| 61 | class m79amb_state | |
| 62 | { | |
| 63 | public: | |
| 64 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, m79amb_state(machine)); } | |
| 63 | 65 | |
| 66 | m79amb_state(running_machine &machine) { } | |
| 64 | 67 | |
| 68 | /* memory pointers */ | |
| 69 | UINT8 * videoram; | |
| 70 | UINT8 * mask; | |
| 71 | ||
| 72 | /* misc */ | |
| 73 | UINT8 lut_gun1[0x100]; | |
| 74 | UINT8 lut_gun2[0x100]; | |
| 75 | }; | |
| 76 | ||
| 77 | ||
| 65 | 78 | static WRITE8_HANDLER( ramtek_videoram_w ) |
| 66 | 79 | { |
| 67 | ramtek_videoram[offset] = data & ~*mask; | |
| 80 | m79amb_state *state = (m79amb_state *)space->machine->driver_data; | |
| 81 | state->videoram[offset] = data & ~*state->mask; | |
| 68 | 82 | } |
| 69 | 83 | |
| 70 | 84 | static VIDEO_UPDATE( ramtek ) |
| 71 | 85 | { |
| 86 | m79amb_state *state = (m79amb_state *)screen->machine->driver_data; | |
| 72 | 87 | offs_t offs; |
| 73 | 88 | |
| 74 | 89 | for (offs = 0; offs < 0x2000; offs++) |
| 75 | 90 | { |
| 76 | 91 | int i; |
| 77 | 92 | |
| 78 | UINT8 data = | |
| 93 | UINT8 data = sta | |
| 79 | 94 | int y = offs >> 5; |
| 80 | 95 | int x = (offs & 0x1f) << 3; |
| 81 | 96 | |
| r7500 | r7501 | |
| 93 | 108 | } |
| 94 | 109 | |
| 95 | 110 | |
| 96 | /* grenade trajectory per gun position is inconsistent and sloppy in the game: | |
| 97 | 0, 1, 3, 2, 6, 7, 5, 4 - gun position | |
| 98 | 90.00, 90.00, 90.00, 90.00, 86.42, 86.42, 86.42, 86.42 - grenade trajectory (angle, est) | |
| 99 | 18.0, 18.0, 18.0, 18.0, 27.2, 27.2, 27.2, 31.2 - crosses with y=28 (x, est) | |
| 100 | ||
| 101 | 12, 13, 15, 14, 10, 11, 9, 8, | |
| 102 | 84.39, 84.39, 84.39, 80.87, 79.00, 80.87, 79.00, 79.00 | |
| 103 | 41.9, 48.9, 56.8, 75.8, 87.2, 88.8, 101.6, 107.6 | |
| 104 | ||
| 105 | 24, 25, 27, 26, 30, 31, 29, 28, | |
| 106 | 79.00, 79.00, 75.59, 75.59, 75.59, 73.72, 73.72, 73.72 | |
| 107 | 114.1, 121.5, 138.8, 146.0, 152.7, 162.6, 167.6, 172.7 | |
| 108 | ||
| 109 | 20, 21, 23, 22, 18, 19, 17, 16 | |
| 110 | 73.72, 70.08, 70.08, 70.08, 67.97, 67.97, 64.34, 64.34 | |
| 111 | 181.6, 199.9, 205.4, 211.9, 223.5, 232.4, 254.0, 254.0 | |
| 112 | */ | |
| 113 | static const UINT8 lut_cross[0x20] = { | |
| 114 | 19, 20, 21, 23, 25, 27, 29, 37, | |
| 115 | 45, 53, 66, 82, 88, 95, 105, 111, | |
| 116 | 118, 130, 142, 149, 158, 165, 170, 177, | |
| 117 | 191, 203, 209, 218, 228, 243, 249, 255, | |
| 118 | }; | |
| 119 | static const UINT8 lut_pos[0x20] = { | |
| 120 | 0x1f, 0x1e, 0x1c, 0x1d, 0x19, 0x18, 0x1a, 0x1b, | |
| 121 | 0x13, 0x12, 0x10, 0x11, 0x15, 0x14, 0x16, 0x17, | |
| 122 | 0x07, 0x06, 0x04, 0x05, 0x01, 0x00, 0x02, 0x03, | |
| 123 | 0x0b, 0x0a, 0x08, 0x09, 0x0d, 0x0c, 0x0e, 0x0f | |
| 124 | }; | |
| 125 | ||
| 126 | static UINT8 lut_gun1[0x100]; | |
| 127 | static UINT8 lut_gun2[0x100]; | |
| 128 | ||
| 129 | 111 | static READ8_HANDLER( gray5bit_controller0_r ) |
| 130 | 112 | { |
| 131 | UINT8 port_data = input_port_read(space->machine, "8004"); | |
| 132 | UINT8 gun_pos = input_port_read(space->machine, "GUN1"); | |
| 133 | return (port_data & 0xe0) | lut_gun1[gun_pos]; | |
| 113 | m79amb_state *state = (m79amb_state *)space->machine->driver_data; | |
| 114 | UINT8 port_data = input_port_read(space->machine, "8004"); | |
| 115 | UINT8 gun_pos = input_port_read(space->machine, "GUN1"); | |
| 116 | ||
| 117 | return (port_data & 0xe0) | state->lut_gun1[gun_pos]; | |
| 134 | 118 | } |
| 135 | 119 | |
| 136 | 120 | static READ8_HANDLER( gray5bit_controller1_r ) |
| 137 | 121 | { |
| 138 | UINT8 port_data = input_port_read(space->machine, "8005"); | |
| 139 | UINT8 gun_pos = input_port_read(space->machine, "GUN2"); | |
| 140 | return (port_data & 0xe0) | lut_gun2[gun_pos]; | |
| 122 | m79amb_state *state = (m79amb_state *)space->machine->driver_data; | |
| 123 | UINT8 port_data = input_port_read(space->machine, "8005"); | |
| 124 | UINT8 gun_pos = input_port_read(space->machine, "GUN2"); | |
| 125 | ||
| 126 | return (port_data & 0xe0) | state->lut_gun2[gun_pos]; | |
| 141 | 127 | } |
| 142 | 128 | |
| 143 | 129 | static WRITE8_HANDLER( m79amb_8002_w ) |
| r7500 | r7501 | |
| 149 | 135 | |
| 150 | 136 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 151 | 137 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 152 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(ramtek_videoram_w) AM_BASE( | |
| 138 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(ramtek_videoram_w) AM_BASE_MEMBER(m79amb_state, videoram) | |
| 153 | 139 | AM_RANGE(0x6000, 0x63ff) AM_RAM /* ?? */ |
| 154 | 140 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("8000") AM_DEVWRITE("discrete", m79amb_8000_w) |
| 155 | AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_BASE( | |
| 141 | AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_BASE_MEMBER(m79amb_state, mask) | |
| 156 | 142 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("8002") AM_WRITE(m79amb_8002_w) |
| 157 | 143 | AM_RANGE(0x8003, 0x8003) AM_DEVWRITE("discrete", m79amb_8003_w) |
| 158 | 144 | AM_RANGE(0x8004, 0x8004) AM_READ(gray5bit_controller0_r) |
| r7500 | r7501 | |
| 218 | 204 | cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 219 | 205 | } |
| 220 | 206 | |
| 221 | static DRIVER_INIT( m79amb ) | |
| 222 | { | |
| 223 | UINT8 *rom = memory_region(machine, "maincpu"); | |
| 224 | int i,j; | |
| 207 | static MACHINE_DRIVER_START( m79amb ) | |
| 225 | 208 | |
| 226 | /* PROM data is active low */ | |
| 227 | for (i = 0;i < 0x2000;i++) | |
| 228 | rom[i] = ~rom[i]; | |
| 209 | /* driver data */ | |
| 210 | MDRV_DRIVER_DATA(m79amb_state) | |
| 229 | 211 | |
| 230 | /* gun positions */ | |
| 231 | for (i=0;i<0x100;i++) { | |
| 232 | /* gun 1, start at left 18 */ | |
| 233 | for (j=0;j<0x20;j++) { | |
| 234 | if (i<=lut_cross[j]) { | |
| 235 | lut_gun1[i]=lut_pos[j]; | |
| 236 | break; | |
| 237 | } | |
| 238 | } | |
| 239 | ||
| 240 | /* gun 2, start at right 235 */ | |
| 241 | for (j=0;j<0x20;j++) { | |
| 242 | if (i>=(253-lut_cross[j])) { | |
| 243 | lut_gun2[i]=lut_pos[j]; | |
| 244 | break; | |
| 245 | } | |
| 246 | } | |
| 247 | } | |
| 248 | } | |
| 249 | ||
| 250 | static MACHINE_DRIVER_START( m79amb ) | |
| 251 | ||
| 252 | 212 | /* basic machine hardware */ |
| 253 | 213 | MDRV_CPU_ADD("maincpu", 8080, XTAL_19_6608MHz / 10) |
| 254 | 214 | MDRV_CPU_PROGRAM_MAP(main_map) |
| r7500 | r7501 | |
| 297 | 257 | |
| 298 | 258 | |
| 299 | 259 | |
| 300 | GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb, ROT0, "Ramtek", "M-79 Ambush", GAME_IMPERFECT_SOUND ) | |
| 260 | /* grenade trajectory per gun position is inconsistent and sloppy in the game: | |
| 261 | 0, 1, 3, 2, 6, 7, 5, 4 - gun position | |
| 262 | 90.00, 90.00, 90.00, 90.00, 86.42, 86.42, 86.42, 86.42 - grenade trajectory (angle, est) | |
| 263 | 18.0, 18.0, 18.0, 18.0, 27.2, 27.2, 27.2, 31.2 - crosses with y=28 (x, est) | |
| 264 | ||
| 265 | 12, 13, 15, 14, 10, 11, 9, 8, | |
| 266 | 84.39, 84.39, 84.39, 80.87, 79.00, 80.87, 79.00, 79.00 | |
| 267 | 41.9, 48.9, 56.8, 75.8, 87.2, 88.8, 101.6, 107.6 | |
| 268 | ||
| 269 | 24, 25, 27, 26, 30, 31, 29, 28, | |
| 270 | 79.00, 79.00, 75.59, 75.59, 75.59, 73.72, 73.72, 73.72 | |
| 271 | 114.1, 121.5, 138.8, 146.0, 152.7, 162.6, 167.6, 172.7 | |
| 272 | ||
| 273 | 20, 21, 23, 22, 18, 19, 17, 16 | |
| 274 | 73.72, 70.08, 70.08, 70.08, 67.97, 67.97, 64.34, 64.34 | |
| 275 | 181.6, 199.9, 205.4, 211.9, 223.5, 232.4, 254.0, 254.0 | |
| 276 | */ | |
| 277 | ||
| 278 | static const UINT8 lut_cross[0x20] = { | |
| 279 | 19, 20, 21, 23, 25, 27, 29, 37, | |
| 280 | 45, 53, 66, 82, 88, 95, 105, 111, | |
| 281 | 118, 130, 142, 149, 158, 165, 170, 177, | |
| 282 | 191, 203, 209, 218, 228, 243, 249, 255, | |
| 283 | }; | |
| 284 | ||
| 285 | static const UINT8 lut_pos[0x20] = { | |
| 286 | 0x1f, 0x1e, 0x1c, 0x1d, 0x19, 0x18, 0x1a, 0x1b, | |
| 287 | 0x13, 0x12, 0x10, 0x11, 0x15, 0x14, 0x16, 0x17, | |
| 288 | 0x07, 0x06, 0x04, 0x05, 0x01, 0x00, 0x02, 0x03, | |
| 289 | 0x0b, 0x0a, 0x08, 0x09, 0x0d, 0x0c, 0x0e, 0x0f | |
| 290 | }; | |
| 291 | ||
| 292 | ||
| 293 | static DRIVER_INIT( m79amb ) | |
| 294 | { | |
| 295 | m79amb_state *state = (m79amb_state *)machine->driver_data; | |
| 296 | UINT8 *rom = memory_region(machine, "maincpu"); | |
| 297 | int i, j; | |
| 298 | ||
| 299 | /* PROM data is active low */ | |
| 300 | for (i = 0; i < 0x2000; i++) | |
| 301 | rom[i] = ~rom[i]; | |
| 302 | ||
| 303 | /* gun positions */ | |
| 304 | for (i = 0; i < 0x100; i++) | |
| 305 | { | |
| 306 | /* gun 1, start at left 18 */ | |
| 307 | for (j = 0; j < 0x20; j++) | |
| 308 | { | |
| 309 | if (i <= lut_cross[j]) | |
| 310 | { | |
| 311 | state->lut_gun1[i] = lut_pos[j]; | |
| 312 | break; | |
| 313 | } | |
| 314 | } | |
| 315 | ||
| 316 | /* gun 2, start at right 235 */ | |
| 317 | for (j = 0; j < 0x20; j++) | |
| 318 | { | |
| 319 | if (i >= (253 - lut_cross[j])) | |
| 320 | { | |
| 321 | state->lut_gun2[i] = lut_pos[j]; | |
| 322 | break; | |
| 323 | } | |
| 324 | } | |
| 325 | } | |
| 326 | } | |
| 327 | ||
| 328 | GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb, ROT0, "Ramtek", "M-79 Ambush", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 299 | 299 | * |
| 300 | 300 | *************************************/ |
| 301 | 301 | |
| 302 | static int meritm_vint = 0x | |
| 302 | static int meritm_vint = 0x18; | |
| 303 | 303 | static int meritm_interrupt_vdp0_state = 0; |
| 304 | 304 | static int meritm_interrupt_vdp1_state = 0; |
| 305 | 305 | static bitmap_t *vdp0_bitmap, *vdp1_bitmap; |
| r7500 | r7501 | |
| 317 | 317 | |
| 318 | 318 | static void meritm_vdp0_interrupt(running_machine *machine, int i) |
| 319 | 319 | { |
| 320 | if ( meritm_interrupt_vdp0_state != i ) | |
| 321 | { | |
| 322 | meritm_interrupt_vdp0_state = i; | |
| 323 | if (i) | |
| 324 | meritm_vint &= ~0x08; | |
| 325 | else | |
| 326 | meritm_vint |= 0x08; | |
| 327 | ||
| 328 | if(i) | |
| 329 | z80pio_p_w(meritm_z80pio[0], 0, meritm_vint); | |
| 330 | } | |
| 320 | /* this is not used as the v9938 interrupt callbacks are broken | |
| 321 | interrupts seem to be fired quite randomly */ | |
| 331 | 322 | } |
| 332 | 323 | |
| 333 | 324 | static void meritm_vdp1_interrupt(running_machine *machine, int i) |
| 334 | 325 | { |
| 335 | if ( meritm_interrupt_vdp1_state != i ) | |
| 336 | { | |
| 337 | meritm_interrupt_vdp1_state = i; | |
| 338 | if (i) | |
| 339 | meritm_vint &= ~0x10; | |
| 340 | else | |
| 341 | meritm_vint |= 0x10; | |
| 342 | ||
| 343 | if(i) | |
| 344 | z80pio_p_w(meritm_z80pio[0], 0, meritm_vint); | |
| 345 | } | |
| 326 | /* this is not used as the v9938 interrupt callbacks are broken | |
| 327 | interrupts seem to be fired quite randomly */ | |
| 346 | 328 | } |
| 347 | 329 | |
| 348 | 330 | static int layer0_enabled, layer1_enabled; |
| r7500 | r7501 | |
| 587 | 569 | AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w) |
| 588 | 570 | AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w) |
| 589 | 571 | AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w) |
| 590 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_r, z80pio_w) | |
| 591 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_r, z80pio_w) | |
| 572 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 573 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 592 | 574 | AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_r) |
| 593 | 575 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_address_data_w) |
| 594 | 576 | AM_RANGE(0xff, 0xff) AM_WRITE(meritm_crt250_bank_w) |
| r7500 | r7501 | |
| 605 | 587 | AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w) |
| 606 | 588 | AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w) |
| 607 | 589 | AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w) |
| 608 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_r, z80pio_w) | |
| 609 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_r, z80pio_w) | |
| 590 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 591 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 610 | 592 | AM_RANGE(0x60, 0x67) AM_READWRITE(pc16552d_0_r,pc16552d_0_w) |
| 611 | 593 | AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_r) |
| 612 | 594 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_address_data_w) |
| r7500 | r7501 | |
| 632 | 614 | AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w) |
| 633 | 615 | AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w) |
| 634 | 616 | AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w) |
| 635 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_r, z80pio_w) | |
| 636 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_r, z80pio_w) | |
| 617 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 618 | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 637 | 619 | AM_RANGE(0x60, 0x67) AM_READWRITE(pc16552d_0_r,pc16552d_0_w) |
| 638 | 620 | AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_r) |
| 639 | 621 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_address_data_w) |
| r7500 | r7501 | |
| 833 | 815 | * |
| 834 | 816 | *************************************/ |
| 835 | 817 | |
| 836 | static | |
| 818 | static | |
| 837 | 819 | { |
| 838 | //logerror( "PIO(0) interrupt line: %d, V = %d, H = %d\n", state, video_screen_get_vpos(0), video_screen_get_hpos(0) ); | |
| 839 | cputag_set_input_line(device->machine, "maincpu", 0, state); | |
| 840 | } | |
| 820 | /* | |
| 841 | 821 | |
| 842 | static WRITE_LINE_DEVICE_HANDLER( meritm_io_pio_interrupt ) | |
| 843 | { | |
| 844 | //logerror( "PIO(1) interrupt line: %d, V = %d, H = %d\n", state, video_screen_get_vpos(0), video_screen_get_hpos(0) ); | |
| 845 | cputag_set_input_line(device->machine, "maincpu", 0, state); | |
| 846 | } | |
| 822 | bit signal description | |
| 847 | 823 | |
| 824 | 0 BANK0 | |
| 825 | 1 BANK1 | |
| 826 | 2 BANK2 | |
| 827 | 3 /VINT1 V9938 #1 INT | |
| 828 | 4 /VINT2 V9938 #2 INT | |
| 829 | 5 BANK3 | |
| 830 | 6 | |
| 831 | 7 | |
| 848 | 832 | |
| 849 | static READ8_DEVICE_HANDLER(meritm_audio_pio_port_a_r) | |
| 850 | { | |
| 833 | */ | |
| 834 | ||
| 851 | 835 | return meritm_vint; |
| 852 | 836 | }; |
| 853 | 837 | |
| 854 | 838 | static READ8_DEVICE_HANDLER(meritm_audio_pio_port_b_r) |
| 855 | 839 | { |
| 840 | /* | |
| 841 | ||
| 842 | bit description | |
| 843 | ||
| 844 | 0 J4 D0 | |
| 845 | 1 J4 D1 | |
| 846 | 2 J4 D2 | |
| 847 | 3 J4 D3 | |
| 848 | 4 J4 D4 | |
| 849 | 5 J4 D5 | |
| 850 | 6 J4 D6 | |
| 851 | 7 J4 D7 | |
| 852 | ||
| 853 | */ | |
| 854 | ||
| 856 | 855 | return ds1204_r(); |
| 857 | 856 | }; |
| 858 | 857 | |
| 859 | 858 | static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_a_w) |
| 860 | 859 | { |
| 860 | /* | |
| 861 | ||
| 862 | bit signal description | |
| 863 | ||
| 864 | 0 BANK0 | |
| 865 | 1 BANK1 | |
| 866 | 2 BANK2 | |
| 867 | 3 /VINT1 V9938 #1 INT | |
| 868 | 4 /VINT2 V9938 #2 INT | |
| 869 | 5 BANK3 | |
| 870 | 6 | |
| 871 | 7 | |
| 872 | ||
| 873 | */ | |
| 874 | ||
| 861 | 875 | meritm_bank = (data & 7) | ((data >> 2) & 0x18); |
| 862 | 876 | //logerror("Writing BANK with %x (raw = %x)\n", meritm_bank, data); |
| 863 | 877 | }; |
| 864 | 878 | |
| 865 | 879 | static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_b_w) |
| 866 | 880 | { |
| 881 | /* | |
| 882 | ||
| 883 | bit description | |
| 884 | ||
| 885 | 0 J4 D0 | |
| 886 | 1 J4 D1 | |
| 887 | 2 J4 D2 | |
| 888 | 3 J4 D3 | |
| 889 | 4 J4 D4 | |
| 890 | 5 J4 D5 | |
| 891 | 6 J4 D6 | |
| 892 | 7 J4 D7 | |
| 893 | ||
| 894 | */ | |
| 895 | ||
| 867 | 896 | ds1204_w((data & 0x4) >> 2, (data & 0x2) >> 1, data & 0x01); |
| 868 | 897 | }; |
| 869 | 898 | |
| 870 | 899 | static WRITE8_DEVICE_HANDLER(meritm_io_pio_port_a_w) |
| 871 | 900 | { |
| 901 | /* | |
| 902 | ||
| 903 | bit description | |
| 904 | ||
| 905 | 0 J3 PE0 | |
| 906 | 1 J3 PE1 | |
| 907 | 2 J3 PE2 | |
| 908 | 3 J3 PE3 | |
| 909 | 4 J3 PE4 | |
| 910 | 5 J3 PE5 | |
| 911 | 6 J3 PE6 | |
| 912 | 7 J3 PE7 | |
| 913 | ||
| 914 | */ | |
| 872 | 915 | }; |
| 873 | 916 | |
| 874 | 917 | static WRITE8_DEVICE_HANDLER(meritm_io_pio_port_b_w) |
| 875 | 918 | { |
| 919 | /* | |
| 920 | ||
| 921 | bit description | |
| 922 | ||
| 923 | 0 J3 PF0 | |
| 924 | 1 J3 PF1 | |
| 925 | 2 J3 PF2 | |
| 926 | 3 J3 PF3 | |
| 927 | 4 J3 PF4 | |
| 928 | 5 J3 PF5 | |
| 929 | 6 J3 PF6 | |
| 930 | 7 J3 PF7 | |
| 931 | ||
| 932 | */ | |
| 876 | 933 | }; |
| 877 | 934 | |
| 878 | static | |
| 935 | static Z | |
| 879 | 936 | { |
| 880 | DEVCB_LINE(m | |
| 937 | DEVCB_CPU_INPUT_LINE("m | |
| 881 | 938 | DEVCB_HANDLER(meritm_audio_pio_port_a_r), |
| 939 | DEVCB_HANDLER(meritm_audio_pio_port_a_w), | |
| 940 | DEVCB_NULL, | |
| 882 | 941 | DEVCB_HANDLER(meritm_audio_pio_port_b_r), |
| 883 | DEVCB_HANDLER(meritm_audio_pio_port_a_w), | |
| 884 | 942 | DEVCB_HANDLER(meritm_audio_pio_port_b_w), |
| 885 | DEVCB_NULL, | |
| 886 | 943 | DEVCB_NULL |
| 887 | 944 | }; |
| 888 | 945 | |
| 889 | static | |
| 946 | static Z | |
| 890 | 947 | { |
| 891 | DEVCB_LINE(m | |
| 948 | DEVCB_CPU_INPUT_LINE("ma | |
| 892 | 949 | DEVCB_INPUT_PORT("PIO1_PORTA"), |
| 950 | DEVCB_HANDLER(meritm_io_pio_port_a_w), | |
| 951 | DEVCB_NULL, | |
| 893 | 952 | DEVCB_INPUT_PORT("PIO1_PORTB"), |
| 894 | DEVCB_HANDLER(meritm_io_pio_port_a_w), | |
| 895 | 953 | DEVCB_HANDLER(meritm_io_pio_port_b_w), |
| 896 | DEVCB_NULL, | |
| 897 | 954 | DEVCB_NULL |
| 898 | 955 | }; |
| 899 | 956 | |
| 900 | 957 | static const z80_daisy_chain meritm_daisy_chain[] = |
| 901 | 958 | { |
| 959 | { "z80pio_0" }, | |
| 902 | 960 | { "z80pio_1" }, |
| 903 | { "z80pio_0" }, | |
| 904 | 961 | { NULL } |
| 905 | 962 | }; |
| 906 | 963 | |
| r7500 | r7501 | |
| 909 | 966 | meritm_z80pio[0] = devtag_get_device( machine, "z80pio_0" ); |
| 910 | 967 | meritm_z80pio[1] = devtag_get_device( machine, "z80pio_1" ); |
| 911 | 968 | |
| 969 | z80pio_astb_w(meritm_z80pio[0], 1); | |
| 970 | z80pio_bstb_w(meritm_z80pio[0], 1); | |
| 971 | z80pio_astb_w(meritm_z80pio[1], 1); | |
| 972 | z80pio_bstb_w(meritm_z80pio[1], 1); | |
| 912 | 973 | }; |
| 913 | 974 | |
| 914 | 975 | static MACHINE_START(meritm_crt250) |
| r7500 | r7501 | |
| 972 | 1033 | #define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2 |
| 973 | 1034 | #define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2 |
| 974 | 1035 | |
| 1036 | static TIMER_DEVICE_CALLBACK( vblank_start_tick ) | |
| 1037 | { | |
| 1038 | /* this is a workaround to signal the v9938 vblank interrupt correctly */ | |
| 1039 | meritm_vint = 0x08; | |
| 1040 | z80pio_pa_w(meritm_z80pio[0], 0, meritm_vint); | |
| 1041 | } | |
| 1042 | ||
| 1043 | static TIMER_DEVICE_CALLBACK( vblank_end_tick ) | |
| 1044 | { | |
| 1045 | /* this is a workaround to signal the v9938 vblank interrupt correctly */ | |
| 1046 | meritm_vint = 0x18; | |
| 1047 | z80pio_pa_w(meritm_z80pio[0], 0, meritm_vint); | |
| 1048 | } | |
| 1049 | ||
| 975 | 1050 | static MACHINE_DRIVER_START(meritm_crt250) |
| 976 | 1051 | MDRV_CPU_ADD("maincpu", Z80, SYSTEM_CLK/6) |
| 977 | 1052 | MDRV_CPU_PROGRAM_MAP(meritm_crt250_map) |
| r7500 | r7501 | |
| 983 | 1058 | |
| 984 | 1059 | MDRV_PPI8255_ADD( "ppi8255", crt250_ppi8255_intf ) |
| 985 | 1060 | |
| 986 | MDRV_Z80PIO_ADD( "z80pio_0", meritm_audio_pio_intf ) | |
| 987 | MDRV_Z80PIO_ADD( "z80pio_1", meritm_io_pio_intf ) | |
| 1061 | MDRV_Z80PIO_ADD( "z80pio_0", SYSTEM_CLK/6, meritm_audio_pio_intf ) | |
| 1062 | MDRV_Z80PIO_ADD( "z80pio_1", SYSTEM_CLK/6, meritm_io_pio_intf ) | |
| 988 | 1063 | |
| 1064 | MDRV_TIMER_ADD_SCANLINE("vblank_start", vblank_start_tick, "screen", 259, 262) | |
| 1065 | MDRV_TIMER_ADD_SCANLINE("vblank_end", vblank_end_tick, "screen", 262, 262) | |
| 1066 | ||
| 989 | 1067 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 990 | 1068 | |
| 991 | 1069 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r7500 | r7501 | |
|---|---|---|
| 18 | 18 | except for the Main CPU which is a Z80 here. |
| 19 | 19 | See twincobr.c machine and video drivers to complete the |
| 20 | 20 | hardware setup. |
| 21 | Also see Input Port definition header below, for instructions | |
| 22 | on how to enter test mode. | |
| 21 | To enter the "test mode", press START1 when the grid is displayed. | |
| 22 | Press F1 (initially P1 button 3) on startup to skip some video RAM tests | |
| 23 | (code at 0x6d25 in 'wardner', 0x6d2f in 'wardnerj' or 0x6d2c in 'pyros'). | |
| 23 | 24 | |
| 24 | 25 | **************************** Memory & I/O Maps ***************************** |
| 25 | 26 | Z80:(0) Main CPU |
| r7500 | r7501 | |
| 126 | 127 | #include "emu.h" |
| 127 | 128 | #include "cpu/z80/z80.h" |
| 128 | 129 | #include "cpu/tms32010/tms32010.h" |
| 130 | #include "includes/toaplipt.h" | |
| 129 | 131 | #include "includes/twincobr.h" |
| 130 | 132 | #include "sound/3812intf.h" |
| 131 | 133 | |
| r7500 | r7501 | |
| 255 | 257 | ADDRESS_MAP_END |
| 256 | 258 | |
| 257 | 259 | |
| 258 | ||
| 259 | ||
| 260 | 260 | /***************************************************************************** |
| 261 | ||
| 261 | 262 | Input Port definitions |
| 262 | 263 | |
| 263 | There is a test mode for button/switch tests. To enter Test mode, | |
| 264 | set the Cross Hatch Pattern DSW to on, restart and then press | |
| 265 | player 1 start button when in the cross-hatch screen. | |
| 266 | 264 | *****************************************************************************/ |
| 267 | 265 | |
| 268 | #define WARDNER_PLAYER_INPUT( player ) /* Player 1 button 3 skips video RAM tests */ \ | |
| 269 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(player) PORT_8WAY \ | |
| 270 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(player) PORT_8WAY \ | |
| 271 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(player) PORT_8WAY \ | |
| 272 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(player) PORT_8WAY \ | |
| 273 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(player) /* Fire */ \ | |
| 274 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(player) /* Jump */ \ | |
| 275 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(player) /* Shot C */ \ | |
| 276 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(player) /* Shot D */ | |
| 277 | ||
| 278 | static INPUT_PORTS_START( wardner ) | |
| 279 | PORT_START("SYSTEM") /* test button doesnt seem to do anything ? */ | |
| 280 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 ) /* Service button */ | |
| 281 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 282 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Test button */ | |
| 283 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 284 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 285 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 286 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 287 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) /* V-Blank */ | |
| 288 | ||
| 289 | PORT_START("P1") | |
| 290 | WARDNER_PLAYER_INPUT( 1 ) | |
| 291 | ||
| 292 | PORT_START("P2") | |
| 293 | WARDNER_PLAYER_INPUT( 2 ) | |
| 294 | ||
| 266 | /* verified from Z80 code */ | |
| 267 | static INPUT_PORTS_START( wardner_generic ) | |
| 295 | 268 | PORT_START("DSWA") |
| 296 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 297 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 298 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 299 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 300 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 301 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 302 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 303 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 304 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 305 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 306 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 307 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 308 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 309 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 310 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 311 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 312 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 313 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 314 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 315 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 316 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 317 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 269 | TOAPLAN_MACHINE_COCKTAIL | |
| 270 | TOAPLAN_COINAGE_WORLD | |
| 318 | 271 | |
| 319 | 272 | PORT_START("DSWB") |
| 320 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) | |
| 321 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 322 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 323 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 324 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 325 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 326 | PORT_DIPSETTING( 0x00, "30000 & 80000" ) | |
| 327 | PORT_DIPSETTING( 0x04, "50000 & 100000" ) | |
| 328 | PORT_DIPSETTING( 0x08, "50000" ) | |
| 329 | PORT_DIPSETTING( 0x0c, "100000" ) | |
| 273 | TOAPLAN_DIFFICULTY | |
| 274 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x13ce ('wardner') or 0x13de ('wardnerj') */ | |
| 275 | PORT_DIPSETTING( 0x00, "30k 80k 50k+" ) | |
| 276 | PORT_DIPSETTING( 0x04, "50k 100k 50k+" ) | |
| 277 | PORT_DIPSETTING( 0x08, "30k Only" ) | |
| 278 | PORT_DIPSETTING( 0x0c, "50k Only" ) | |
| 330 | 279 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) |
| 331 | 280 | PORT_DIPSETTING( 0x30, "1" ) |
| 332 | 281 | PORT_DIPSETTING( 0x00, "3" ) |
| 333 | 282 | PORT_DIPSETTING( 0x10, "4" ) |
| 334 | 283 | PORT_DIPSETTING( 0x20, "5" ) |
| 335 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 336 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 337 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 338 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 339 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 340 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 284 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_HIGH ) | |
| 285 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH ) | |
| 286 | ||
| 287 | PORT_START("P1") | |
| 288 | TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) /* buttons 3 & 4 named "SHOTC" and "SHOTD" in "test mode" */ | |
| 289 | ||
| 290 | PORT_START("P2") | |
| 291 | TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) /* buttons 3 & 4 named "SHOTC" and "SHOTD" in "test mode" */ | |
| 292 | ||
| 293 | PORT_START("SYSTEM") | |
| 294 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) | |
| 295 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 296 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* "TEST" in "test mode" - no effect outside */ | |
| 297 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 298 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 299 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 300 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 301 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) /* "V-BLANKING" in "test mode" */ | |
| 341 | 302 | INPUT_PORTS_END |
| 342 | 303 | |
| 304 | /* verified from Z80 code */ | |
| 305 | static INPUT_PORTS_START( wardner ) | |
| 306 | PORT_INCLUDE( wardner_generic ) | |
| 307 | ||
| 308 | PORT_MODIFY("P1") | |
| 309 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Skip Video RAM Tests") PORT_CODE(KEYCODE_F1) | |
| 310 | /* code at 0x6d25 ('wardner'), 0x6d2f ('wardnerj') or 0x6d2c ('pyros') */ | |
| 311 | INPUT_PORTS_END | |
| 312 | ||
| 313 | /* verified from Z80 code */ | |
| 343 | 314 | static INPUT_PORTS_START( wardnerj ) |
| 344 | 315 | PORT_INCLUDE( wardner ) |
| 345 | 316 | |
| 346 | 317 | PORT_MODIFY("DSWA") |
| 347 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 348 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 349 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 350 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 351 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 352 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 353 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 354 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 355 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 356 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 318 | TOAPLAN_COINAGE_JAPAN_OLD | |
| 357 | 319 | INPUT_PORTS_END |
| 358 | 320 | |
| 321 | /* verified from Z80 code */ | |
| 359 | 322 | static INPUT_PORTS_START( pyros ) |
| 360 | PORT_INCLUDE( wardner ) | |
| 323 | PORT_INCLUDE( wardnerj ) | |
| 361 | 324 | |
| 362 | PORT_MODIFY("DSWA") | |
| 363 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 364 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 365 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 366 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 367 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 368 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 369 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 370 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 371 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 372 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 373 | ||
| 374 | 325 | PORT_MODIFY("DSWB") |
| 375 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) | |
| 326 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x13ce */ | |
| 327 | PORT_DIPSETTING( 0x00, "30k 80k 50k+" ) | |
| 328 | PORT_DIPSETTING( 0x04, "50k 100k 50k+" ) | |
| 329 | PORT_DIPSETTING( 0x08, "50k Only" ) | |
| 330 | PORT_DIPSETTING( 0x0c, "100k Only" ) | |
| 331 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) /* additional code at 0x6037 */ | |
| 376 | 332 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 377 | 333 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 378 | 334 | INPUT_PORTS_END |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | #include "emu.h" |
| 44 | 44 | #include "cpu/z80/z80.h" |
| 45 | 45 | #include "cpu/m68000/m68000.h" |
| 46 | #include "cpu/h6280/h6280.h" | |
| 46 | 47 | #include "includes/cninja.h" |
| 47 | #include "cpu/h6280/h6280.h" | |
| 48 | #include "includes/deco16ic.h" | |
| 49 | 48 | #include "includes/decocrpt.h" |
| 50 | 49 | #include "includes/decoprot.h" |
| 51 | 50 | #include "sound/2203intf.h" |
| 52 | 51 | #include "sound/2151intf.h" |
| 53 | 52 | #include "sound/okim6295.h" |
| 53 | #include "video/deco16ic.h" | |
| 54 | 54 | |
| 55 | static int cninja_scanline, cninja_irq_mask; | |
| 56 | static running_device *raster_irq_timer; | |
| 57 | static UINT16 *cninja_ram; | |
| 58 | 55 | |
| 59 | /**********************************************************************************/ | |
| 60 | ||
| 61 | 56 | static WRITE16_HANDLER( cninja_sound_w ) |
| 62 | 57 | { |
| 63 | soundlatch_w(space,0,data&0xff); | |
| 64 | cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); | |
| 58 | cninja_state *state = (cninja_state *)space->machine->driver_data; | |
| 59 | ||
| 60 | soundlatch_w(space, 0, data & 0xff); | |
| 61 | cpu_set_input_line(state->audiocpu, 0, HOLD_LINE); | |
| 65 | 62 | } |
| 66 | 63 | |
| 67 | 64 | static WRITE16_HANDLER( stoneage_sound_w ) |
| 68 | 65 | { |
| 69 | soundlatch_w(space,0,data&0xff); | |
| 70 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 66 | cninja_state *state = (cninja_state *)space->machine->driver_data; | |
| 67 | ||
| 68 | soundlatch_w(space, 0, data & 0xff); | |
| 69 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 71 | 70 | } |
| 72 | 71 | |
| 73 | 72 | static TIMER_DEVICE_CALLBACK( interrupt_gen ) |
| 74 | 73 | { |
| 75 | cputag_set_input_line(timer->machine, "maincpu", (cninja_irq_mask&0x10) ? 3 : 4, ASSERT_LINE); | |
| 76 | timer_device_adjust_oneshot(raster_irq_timer, attotime_never, 0); | |
| 74 | cninja_state *state = (cninja_state *)timer->machine->driver_data; | |
| 75 | ||
| 76 | cpu_set_input_line(state->maincpu, (state->irq_mask & 0x10) ? 3 : 4, ASSERT_LINE); | |
| 77 | timer_device_adjust_oneshot(state->raster_irq_timer, attotime_never, 0); | |
| 77 | 78 | } |
| 78 | 79 | |
| 79 | 80 | static READ16_HANDLER( cninja_irq_r ) |
| 80 | 81 | { |
| 81 | | |
| 82 | cninja_state * | |
| 82 | 83 | |
| 84 | switch (offset) | |
| 85 | { | |
| 86 | ||
| 83 | 87 | case 1: /* Raster IRQ scanline position */ |
| 84 | return | |
| 88 | return st | |
| 85 | 89 | |
| 86 | 90 | case 2: /* Raster IRQ ACK - value read is not used */ |
| 87 | cputag_set_input_line(space->machine, "maincpu", 3, CLEAR_LINE); | |
| 88 | cputag_set_input_line(space->machine, "maincpu", 4, CLEAR_LINE); | |
| 91 | cpu_set_input_line(state->maincpu, 3, CLEAR_LINE); | |
| 92 | cpu_set_input_line(state->maincpu, 4, CLEAR_LINE); | |
| 89 | 93 | return 0; |
| 90 | 94 | } |
| 91 | 95 | |
| 92 | logerror("%08x: Unmapped IRQ read %d\n",cpu_get_pc(space->cpu),offset); | |
| 96 | logerror("%08x: Unmapped IRQ read %d\n", cpu_get_pc(space->cpu), offset); | |
| 93 | 97 | return 0; |
| 94 | 98 | } |
| 95 | 99 | |
| 96 | 100 | static WRITE16_HANDLER( cninja_irq_w ) |
| 97 | 101 | { |
| 98 | switch (offset) { | |
| 102 | cninja_state *state = (cninja_state *)space->machine->driver_data; | |
| 103 | ||
| 104 | switch (offset) | |
| 105 | { | |
| 99 | 106 | case 0: |
| 100 | 107 | /* IRQ enable: |
| 101 | 108 | 0xca: Raster IRQ turned off |
| 102 | 109 | 0xc8: Raster IRQ turned on (68k IRQ level 4) |
| 103 | 110 | 0xd8: Raster IRQ turned on (68k IRQ level 3) |
| 104 | 111 | */ |
| 105 | logerror("%08x: IRQ write %d %08x\n",cpu_get_pc(space->cpu),offset,data); | |
| 106 | cninja_irq_mask=data&0xff; | |
| 112 | logerror("%08x: IRQ write %d %08x\n", cpu_get_pc(space->cpu), offset, data); | |
| 113 | state->irq_mask = data & 0xff; | |
| 107 | 114 | return; |
| 108 | 115 | |
| 109 | 116 | case 1: /* Raster IRQ scanline position, only valid for values between 1 & 239 (0 and 240-256 do NOT generate IRQ's) */ |
| 110 | cninja_scanline=data&0xff; | |
| 111 | if ((cninja_irq_mask&0x2)==0 && cninja_scanline>0 && cninja_scanline<240) | |
| 112 | { | |
| 113 | timer_device_adjust_oneshot(raster_irq_timer, video_screen_get_time_until_pos(space->machine->primary_screen, cninja_scanline, 0), cninja_scanline); | |
| 114 | } | |
| 117 | state->scanline = data & 0xff; | |
| 118 | ||
| 119 | if (!BIT(state->irq_mask, 1) && state->scanline > 0 && state->scanline < 240) | |
| 120 | timer_device_adjust_oneshot(state->raster_irq_timer, video_screen_get_time_until_pos(space->machine->primary_screen, state->scanline, 0), state->scanline); | |
| 115 | 121 | else |
| 116 | timer_device_adjust_oneshot(raster_irq_timer,attotime_never,0); | |
| 122 | timer_device_adjust_oneshot(state->raster_irq_timer, attotime_never, 0); | |
| 117 | 123 | return; |
| 118 | 124 | |
| 119 | 125 | case 2: /* VBL irq ack */ |
| 120 | 126 | return; |
| 121 | 127 | } |
| 122 | 128 | |
| 123 | logerror("%08x: Unmapped IRQ write %d %04x\n",cpu_get_pc(space->cpu),offset,data); | |
| 129 | logerror("%08x: Unmapped IRQ write %d %04x\n", cpu_get_pc(space->cpu), offset, data); | |
| 124 | 130 | } |
| 125 | 131 | |
| 126 | 132 | static READ16_HANDLER( robocop2_prot_r ) |
| 127 | 133 | { |
| 128 | switch (offset<<1) { | |
| 134 | switch (offset << 1) | |
| 135 | { | |
| 129 | 136 | case 0x41a: /* Player 1 & 2 input ports */ |
| 130 | 137 | return input_port_read(space->machine, "IN0"); |
| 131 | 138 | case 0x320: /* Coins */ |
| r7500 | r7501 | |
| 133 | 140 | case 0x4e6: /* Dip switches */ |
| 134 | 141 | return input_port_read(space->machine, "DSW"); |
| 135 | 142 | case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */ |
| 136 | logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(space->cpu),offset); | |
| 143 | logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(space->cpu), offset); | |
| 137 | 144 | return 0x84; |
| 138 | 145 | } |
| 139 | logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(space->cpu),offset); | |
| 146 | logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(space->cpu), offset); | |
| 140 | 147 | return 0; |
| 141 | 148 | } |
| 142 | 149 | |
| 143 | 150 | /**********************************************************************************/ |
| 144 | 151 | |
| 145 | static WRITE16_HANDLER( | |
| 152 | static WRITE16_HANDLER( | |
| 146 | 153 | { |
| 147 | COMBINE_DATA(&deco16_pf12_control[offset]); | |
| 154 | cninja_state *state = (cninja_state *)space->machine->driver_data; | |
| 155 | deco16ic_pf12_control_w(state->deco16ic, offset, data, mem_mask); | |
| 148 | 156 | video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen)); |
| 149 | 157 | } |
| 150 | 158 | |
| 151 | 159 | |
| 152 | static WRITE16_HANDLER( | |
| 160 | static WRITE16_HANDLER( | |
| 153 | 161 | { |
| 154 | COMBINE_DATA(&deco16_pf34_control[offset]); | |
| 162 | cninja_state *state = (cninja_state *)space->machine->driver_data; | |
| 163 | deco16ic_pf34_control_w(state->deco16ic, offset, data, mem_mask); | |
| 155 | 164 | video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen)); |
| 156 | 165 | } |
| 157 | 166 | |
| r7500 | r7501 | |
| 159 | 168 | static ADDRESS_MAP_START( cninja_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 160 | 169 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 161 | 170 | |
| 162 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(deco16_pf12_control_w) AM_BASE(&deco16_pf12_control) | |
| 163 | AM_RANGE(0x144000, 0x144fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 164 | AM_RANGE(0x146000, 0x146fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 165 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll) | |
| 166 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 171 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) | |
| 172 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 173 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 174 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_BASE_MEMBER(cninja_state, pf1_rowscroll) | |
| 175 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf2_rowscroll) | |
| 167 | 176 | |
| 168 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(deco16_pf34_control_w) AM_BASE(&deco16_pf34_control) | |
| 169 | AM_RANGE(0x154000, 0x154fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 170 | AM_RANGE(0x156000, 0x156fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 171 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 172 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 177 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) | |
| 178 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 179 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 180 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf3_rowscroll) | |
| 181 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf4_rowscroll) | |
| 173 | 182 | |
| 174 | AM_RANGE(0x184000, 0x187fff) AM_RAM AM_BASE( | |
| 183 | AM_RANGE(0x184000, 0x187fff) AM_RAM AM_BASE_MEMBER( | |
| 175 | 184 | AM_RANGE(0x190000, 0x190007) AM_READWRITE(cninja_irq_r, cninja_irq_w) |
| 176 | AM_RANGE(0x19c000, 0x19dfff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 185 | AM_RANGE(0x19c000, 0x19dfff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 177 | 186 | |
| 178 | AM_RANGE(0x1a4000, 0x1a47ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 187 | AM_RANGE(0x1a4000, 0x1a47ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 179 | 188 | AM_RANGE(0x1b4000, 0x1b4001) AM_WRITE(buffer_spriteram16_w) /* DMA flag */ |
| 180 | 189 | AM_RANGE(0x1bc000, 0x1bc0ff) AM_WRITE(deco16_104_cninja_prot_w) AM_BASE(&deco16_prot_ram) /* Protection writes */ |
| 181 | 190 | AM_RANGE(0x1bc000, 0x1bcfff) AM_READ(deco16_104_cninja_prot_r) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| r7500 | r7501 | |
| 193 | 202 | |
| 194 | 203 | AM_RANGE(0x138000, 0x1387ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* bootleg sprite-ram (sprites rewritten here in new format) */ |
| 195 | 204 | |
| 196 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(deco16_pf12_control_w) AM_BASE(&deco16_pf12_control) | |
| 197 | AM_RANGE(0x144000, 0x144fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 198 | AM_RANGE(0x146000, 0x146fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 199 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll) | |
| 200 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 205 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) | |
| 206 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 207 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 208 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_BASE_MEMBER(cninja_state, pf1_rowscroll) | |
| 209 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf2_rowscroll) | |
| 201 | 210 | |
| 202 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(deco16_pf34_control_w) AM_BASE(&deco16_pf34_control) // not used / incorrect on this | |
| 203 | AM_RANGE(0x154000, 0x154fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 204 | AM_RANGE(0x156000, 0x156fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 205 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 206 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 211 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) // not used / incorrect on this | |
| 212 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 213 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 214 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf3_rowscroll) | |
| 215 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf4_rowscroll) | |
| 207 | 216 | |
| 208 | 217 | AM_RANGE(0x17ff22, 0x17ff23) AM_READ_PORT("DSW") |
| 209 | 218 | AM_RANGE(0x17ff28, 0x17ff29) AM_READ_PORT("IN1") |
| 210 | AM_RANGE(0x17ff2a, 0x17ff2b) AM_WRITE( | |
| 219 | AM_RANGE(0x17ff2a, 0x17ff2b) AM_WRITE( | |
| 211 | 220 | AM_RANGE(0x17ff2c, 0x17ff2d) AM_READ_PORT("IN0") |
| 212 | 221 | |
| 213 | 222 | AM_RANGE(0x180000, 0x187fff) AM_RAM // more ram on bootleg? |
| 214 | 223 | |
| 215 | 224 | AM_RANGE(0x190000, 0x190007) AM_READWRITE(cninja_irq_r, cninja_irq_w) |
| 216 | AM_RANGE(0x19c000, 0x19dfff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 225 | AM_RANGE(0x19c000, 0x19dfff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 217 | 226 | |
| 218 | 227 | AM_RANGE(0x1b4000, 0x1b4001) AM_WRITE(buffer_spriteram16_w) /* DMA flag */ |
| 219 | 228 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 221 | 230 | static ADDRESS_MAP_START( edrandy_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 222 | 231 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 223 | 232 | |
| 224 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(deco16_pf12_control_w) AM_BASE(&deco16_pf12_control) | |
| 225 | AM_RANGE(0x144000, 0x144fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 226 | AM_RANGE(0x146000, 0x146fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 227 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 228 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 233 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) | |
| 234 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 235 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 236 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf1_rowscroll) | |
| 237 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf2_rowscroll) | |
| 229 | 238 | |
| 230 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(deco16_pf34_control_w) AM_BASE(&deco16_pf34_control) | |
| 231 | AM_RANGE(0x154000, 0x154fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 232 | AM_RANGE(0x156000, 0x156fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 233 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 234 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 239 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) | |
| 240 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 241 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 242 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf3_rowscroll) | |
| 243 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf4_rowscroll) | |
| 235 | 244 | |
| 236 | AM_RANGE(0x188000, 0x189fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 237 | AM_RANGE(0x194000, 0x197fff) AM_RAM AM_BASE(&cninja_ram) /* Main ram */ | |
| 245 | AM_RANGE(0x188000, 0x189fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 246 | AM_RANGE(0x194000, 0x197fff) AM_RAM AM_BASE_MEMBER(cninja_state, ram) /* Main ram */ | |
| 238 | 247 | AM_RANGE(0x198000, 0x1987ff) AM_READWRITE(deco16_60_prot_r, deco16_60_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| 239 | 248 | AM_RANGE(0x199550, 0x199551) AM_WRITENOP /* Looks like a bug in game code, a protection write is referenced off a5 instead of a6 and ends up here */ |
| 240 | 249 | AM_RANGE(0x199750, 0x199751) AM_WRITENOP /* Looks like a bug in game code, a protection write is referenced off a5 instead of a6 and ends up here */ |
| r7500 | r7501 | |
| 249 | 258 | static ADDRESS_MAP_START( robocop2_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 250 | 259 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 251 | 260 | |
| 252 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(deco16_pf12_control_w) AM_BASE(&deco16_pf12_control) | |
| 253 | AM_RANGE(0x144000, 0x144fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 254 | AM_RANGE(0x146000, 0x146fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 255 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 256 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 261 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) | |
| 262 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 263 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 264 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf1_rowscroll) | |
| 265 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf2_rowscroll) | |
| 257 | 266 | |
| 258 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(deco16_pf34_control_w) AM_BASE(&deco16_pf34_control) | |
| 259 | AM_RANGE(0x154000, 0x154fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 260 | AM_RANGE(0x156000, 0x156fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 261 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 262 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 267 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) | |
| 268 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 269 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 270 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf3_rowscroll) | |
| 271 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf4_rowscroll) | |
| 263 | 272 | |
| 264 | 273 | AM_RANGE(0x180000, 0x1807ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 265 | 274 | // AM_RANGE(0x18c000, 0x18c0ff) AM_WRITE(cninja_loopback_w) /* Protection writes */ |
| 266 | 275 | AM_RANGE(0x18c000, 0x18c7ff) AM_READ(robocop2_prot_r) /* Protection device */ |
| 267 | 276 | AM_RANGE(0x18c064, 0x18c065) AM_WRITE(cninja_sound_w) |
| 268 | 277 | AM_RANGE(0x198000, 0x198001) AM_WRITE(buffer_spriteram16_w) /* DMA flag */ |
| 269 | AM_RANGE(0x1a8000, 0x1a9fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 278 | AM_RANGE(0x1a8000, 0x1a9fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 270 | 279 | AM_RANGE(0x1b0000, 0x1b0007) AM_READWRITE(cninja_irq_r, cninja_irq_w) |
| 271 | AM_RANGE(0x1b8000, 0x1bbfff) AM_RAM AM_BASE(&cninja_ram) /* Main ram */ | |
| 272 | AM_RANGE(0x1f0000, 0x1f0001) AM_WRITE(deco16_priority_w) | |
| 280 | AM_RANGE(0x1b8000, 0x1bbfff) AM_RAM AM_BASE_MEMBER(cninja_state, ram) /* Main ram */ | |
| 281 | AM_RANGE(0x1f0000, 0x1f0001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 273 | 282 | AM_RANGE(0x1f8000, 0x1f8001) AM_READ_PORT("DSW3") /* Dipswitch #3 */ |
| 274 | 283 | ADDRESS_MAP_END |
| 275 | 284 | |
| r7500 | r7501 | |
| 278 | 287 | AM_RANGE(0x100000, 0x103fff) AM_RAM |
| 279 | 288 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 280 | 289 | AM_RANGE(0x140000, 0x1407ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram2) |
| 281 | AM_RANGE(0x160000, 0x161fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 282 | AM_RANGE(0x180000, 0x180001) AM_WRITE(deco16_priority_w) | |
| 290 | AM_RANGE(0x160000, 0x161fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 291 | AM_RANGE(0x180000, 0x180001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 283 | 292 | AM_RANGE(0x180002, 0x180003) AM_WRITENOP /* VBL irq ack */ |
| 284 | 293 | AM_RANGE(0x1a0000, 0x1a07ff) AM_READWRITE(deco16_66_prot_r, deco16_66_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| 285 | AM_RANGE(0x1c0000, 0x1c0001) AM_ | |
| 294 | AM_RANGE(0x1c0000, 0x1c0001) AM_ | |
| 286 | 295 | AM_RANGE(0x1e0000, 0x1e0001) AM_WRITE(buffer_spriteram16_2_w) |
| 287 | 296 | |
| 288 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(deco16_pf12_control_w) AM_BASE(&deco16_pf12_control) | |
| 289 | AM_RANGE(0x304000, 0x305fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 290 | AM_RANGE(0x306000, 0x307fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 291 | AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 292 | AM_RANGE(0x30a000, 0x30a7ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 297 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(cninja_pf12_control_w) | |
| 298 | AM_RANGE(0x304000, 0x305fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 299 | AM_RANGE(0x306000, 0x307fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 300 | AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf1_rowscroll) | |
| 301 | AM_RANGE(0x30a000, 0x30a7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf2_rowscroll) | |
| 293 | 302 | |
| 294 | AM_RANGE(0x310000, 0x31000f) AM_WRITE(deco16_pf34_control_w) AM_BASE(&deco16_pf34_control) | |
| 295 | AM_RANGE(0x314000, 0x315fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 296 | AM_RANGE(0x316000, 0x317fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 297 | AM_RANGE(0x318000, 0x3187ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 298 | AM_RANGE(0x31a000, 0x31a7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 303 | AM_RANGE(0x310000, 0x31000f) AM_WRITE(cninja_pf34_control_w) | |
| 304 | AM_RANGE(0x314000, 0x315fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 305 | AM_RANGE(0x316000, 0x317fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 306 | AM_RANGE(0x318000, 0x3187ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf3_rowscroll) | |
| 307 | AM_RANGE(0x31a000, 0x31a7ff) AM_RAM AM_BASE_MEMBER(cninja_state, pf4_rowscroll) | |
| 299 | 308 | |
| 300 | 309 | AM_RANGE(0xad00ac, 0xad00ff) AM_READNOP /* Reads from here seem to be a game code bug */ |
| 301 | 310 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 710 | 719 | |
| 711 | 720 | /**********************************************************************************/ |
| 712 | 721 | |
| 713 | static MACHINE_RESET( cninja ) | |
| 714 | { | |
| 715 | raster_irq_timer = devtag_get_device(machine, "raster_timer"); | |
| 716 | cninja_scanline=0; | |
| 717 | cninja_irq_mask=0; | |
| 718 | } | |
| 719 | ||
| 720 | 722 | static void sound_irq(running_device *device, int state) |
| 721 | 723 | { |
| 722 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 724 | cninja_state *driver_state = (cninja_state *)device->machine->driver_data; | |
| 725 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 723 | 726 | } |
| 724 | 727 | |
| 725 | 728 | static void sound_irq2(running_device *device, int state) |
| 726 | 729 | { |
| 727 | cputag_set_input_line(device->machine, "audiocpu", 0, state); | |
| 730 | cninja_state *driver_state = (cninja_state *)device->machine->driver_data; | |
| 731 | cpu_set_input_line(driver_state->audiocpu, 0, state); | |
| 728 | 732 | } |
| 729 | 733 | |
| 730 | 734 | static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) |
| 731 | 735 | { |
| 736 | cninja_state *state = (cninja_state *)device->machine->driver_data; | |
| 737 | ||
| 732 | 738 | /* the second OKIM6295 ROM is bank switched */ |
| 733 | okim6295_set_bank_base( | |
| 739 | okim6295_set_bank_base(s | |
| 734 | 740 | } |
| 735 | 741 | |
| 736 | 742 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 746 | 752 | |
| 747 | 753 | /**********************************************************************************/ |
| 748 | 754 | |
| 755 | static int cninja_bank_callback( const int bank ) | |
| 756 | { | |
| 757 | if ((bank >> 4) & 0xf) | |
| 758 | return 0x0000; /* Only 2 banks */ | |
| 759 | return 0x1000; | |
| 760 | } | |
| 761 | ||
| 762 | static int robocop2_bank_callback( const int bank ) | |
| 763 | { | |
| 764 | return (bank & 0x30) << 8; | |
| 765 | } | |
| 766 | ||
| 767 | static int mutantf_1_bank_callback( const int bank ) | |
| 768 | { | |
| 769 | return ((bank >> 4) & 0x3) << 12; | |
| 770 | } | |
| 771 | ||
| 772 | static int mutantf_2_bank_callback( const int bank ) | |
| 773 | { | |
| 774 | return ((bank >> 5) & 0x1) << 14; | |
| 775 | } | |
| 776 | ||
| 777 | static const deco16ic_interface cninja_deco16ic_intf = | |
| 778 | { | |
| 779 | "screen", | |
| 780 | 0, 1, 1, | |
| 781 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 782 | 0, 16, 0, 48, /* color base */ | |
| 783 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 784 | NULL, | |
| 785 | NULL, | |
| 786 | cninja_bank_callback, | |
| 787 | cninja_bank_callback | |
| 788 | }; | |
| 789 | ||
| 790 | static const deco16ic_interface edrandy_deco16ic_intf = | |
| 791 | { | |
| 792 | "screen", | |
| 793 | 0, 0, 1, | |
| 794 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 795 | 0, 16, 0, 48, /* color base */ | |
| 796 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 797 | NULL, | |
| 798 | NULL, | |
| 799 | cninja_bank_callback, | |
| 800 | cninja_bank_callback | |
| 801 | }; | |
| 802 | ||
| 803 | static const deco16ic_interface robocop2_deco16ic_intf = | |
| 804 | { | |
| 805 | "screen", | |
| 806 | 0, 0, 1, | |
| 807 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 808 | 0, 16, 0, 48, /* color base */ | |
| 809 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 810 | NULL, | |
| 811 | robocop2_bank_callback, | |
| 812 | robocop2_bank_callback, | |
| 813 | robocop2_bank_callback | |
| 814 | }; | |
| 815 | ||
| 816 | static const deco16ic_interface mutantf_deco16ic_intf = | |
| 817 | { | |
| 818 | "screen", | |
| 819 | 0, 0, 1, | |
| 820 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 821 | 0, 0x30, 0x20, 0x40, /* color base */ | |
| 822 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 823 | mutantf_1_bank_callback, | |
| 824 | mutantf_2_bank_callback, | |
| 825 | mutantf_1_bank_callback, | |
| 826 | mutantf_1_bank_callback | |
| 827 | }; | |
| 828 | ||
| 829 | static MACHINE_START( cninja ) | |
| 830 | { | |
| 831 | cninja_state *state = (cninja_state *)machine->driver_data; | |
| 832 | ||
| 833 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 834 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 835 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 836 | state->raster_irq_timer = devtag_get_device(machine, "raster_timer"); | |
| 837 | state->oki2 = devtag_get_device(machine, "oki2"); | |
| 838 | ||
| 839 | state_save_register_global(machine, state->scanline); | |
| 840 | state_save_register_global(machine, state->irq_mask); | |
| 841 | } | |
| 842 | ||
| 843 | static MACHINE_RESET( cninja ) | |
| 844 | { | |
| 845 | cninja_state *state = (cninja_state *)machine->driver_data; | |
| 846 | ||
| 847 | state->scanline = 0; | |
| 848 | state->irq_mask = 0; | |
| 849 | } | |
| 850 | ||
| 749 | 851 | static MACHINE_DRIVER_START( cninja ) |
| 750 | 852 | |
| 853 | /* driver data */ | |
| 854 | MDRV_DRIVER_DATA(cninja_state) | |
| 855 | ||
| 751 | 856 | /* basic machine hardware */ |
| 752 | 857 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 753 | 858 | MDRV_CPU_PROGRAM_MAP(cninja_map) |
| r7500 | r7501 | |
| 756 | 861 | MDRV_CPU_ADD("audiocpu", H6280,32220000/8) /* Accurate */ |
| 757 | 862 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 758 | 863 | |
| 864 | MDRV_MACHINE_START(cninja) | |
| 759 | 865 | MDRV_MACHINE_RESET(cninja) |
| 760 | 866 | |
| 761 | 867 | MDRV_TIMER_ADD("raster_timer", interrupt_gen) |
| r7500 | r7501 | |
| 772 | 878 | MDRV_GFXDECODE(cninja) |
| 773 | 879 | MDRV_PALETTE_LENGTH(2048) |
| 774 | 880 | |
| 775 | MDRV_VIDEO_START(cninja) | |
| 776 | 881 | MDRV_VIDEO_UPDATE(cninja) |
| 777 | 882 | |
| 883 | MDRV_DECO16IC_ADD("deco_custom", cninja_deco16ic_intf) | |
| 884 | ||
| 778 | 885 | /* sound hardware */ |
| 779 | 886 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 780 | 887 | |
| r7500 | r7501 | |
| 797 | 904 | |
| 798 | 905 | static MACHINE_DRIVER_START( stoneage ) |
| 799 | 906 | |
| 907 | /* driver data */ | |
| 908 | MDRV_DRIVER_DATA(cninja_state) | |
| 909 | ||
| 800 | 910 | /* basic machine hardware */ |
| 801 | 911 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 802 | 912 | MDRV_CPU_PROGRAM_MAP(cninja_map) |
| r7500 | r7501 | |
| 805 | 915 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) |
| 806 | 916 | MDRV_CPU_PROGRAM_MAP(stoneage_s_map) |
| 807 | 917 | |
| 918 | MDRV_MACHINE_START(cninja) | |
| 808 | 919 | MDRV_MACHINE_RESET(cninja) |
| 809 | 920 | |
| 810 | 921 | MDRV_TIMER_ADD("raster_timer", interrupt_gen) |
| r7500 | r7501 | |
| 824 | 935 | MDRV_VIDEO_START(stoneage) |
| 825 | 936 | MDRV_VIDEO_UPDATE(cninja) |
| 826 | 937 | |
| 938 | MDRV_DECO16IC_ADD("deco_custom", cninja_deco16ic_intf) | |
| 939 | ||
| 827 | 940 | /* sound hardware */ |
| 828 | 941 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 829 | 942 | |
| r7500 | r7501 | |
| 844 | 957 | |
| 845 | 958 | static MACHINE_DRIVER_START( cninjabl ) |
| 846 | 959 | |
| 960 | /* driver data */ | |
| 961 | MDRV_DRIVER_DATA(cninja_state) | |
| 962 | ||
| 847 | 963 | /* basic machine hardware */ |
| 848 | 964 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 849 | 965 | MDRV_CPU_PROGRAM_MAP(cninjabl_map) |
| r7500 | r7501 | |
| 852 | 968 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) |
| 853 | 969 | MDRV_CPU_PROGRAM_MAP(stoneage_s_map) |
| 854 | 970 | |
| 971 | MDRV_MACHINE_START(cninja) | |
| 855 | 972 | MDRV_MACHINE_RESET(cninja) |
| 856 | 973 | |
| 857 | 974 | MDRV_TIMER_ADD("raster_timer", interrupt_gen) |
| r7500 | r7501 | |
| 868 | 985 | MDRV_GFXDECODE(cninjabl) |
| 869 | 986 | MDRV_PALETTE_LENGTH(2048) |
| 870 | 987 | |
| 871 | MDRV_VIDEO_START(cninja) | |
| 872 | 988 | MDRV_VIDEO_UPDATE(cninjabl) |
| 873 | 989 | |
| 990 | MDRV_DECO16IC_ADD("deco_custom", cninja_deco16ic_intf) | |
| 991 | ||
| 874 | 992 | /* sound hardware */ |
| 875 | 993 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 876 | 994 | |
| r7500 | r7501 | |
| 887 | 1005 | |
| 888 | 1006 | static MACHINE_DRIVER_START( edrandy ) |
| 889 | 1007 | |
| 1008 | /* driver data */ | |
| 1009 | MDRV_DRIVER_DATA(cninja_state) | |
| 1010 | ||
| 890 | 1011 | /* basic machine hardware */ |
| 891 | 1012 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 892 | 1013 | MDRV_CPU_PROGRAM_MAP(edrandy_map) |
| r7500 | r7501 | |
| 895 | 1016 | MDRV_CPU_ADD("audiocpu", H6280,32220000/8) /* Accurate */ |
| 896 | 1017 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 897 | 1018 | |
| 1019 | MDRV_MACHINE_START(cninja) | |
| 898 | 1020 | MDRV_MACHINE_RESET(cninja) |
| 899 | 1021 | |
| 900 | 1022 | MDRV_TIMER_ADD("raster_timer", interrupt_gen) |
| r7500 | r7501 | |
| 911 | 1033 | MDRV_GFXDECODE(cninja) |
| 912 | 1034 | MDRV_PALETTE_LENGTH(2048) |
| 913 | 1035 | |
| 914 | MDRV_VIDEO_START(edrandy) | |
| 915 | 1036 | MDRV_VIDEO_UPDATE(edrandy) |
| 916 | 1037 | |
| 1038 | MDRV_DECO16IC_ADD("deco_custom", edrandy_deco16ic_intf) | |
| 1039 | ||
| 917 | 1040 | /* sound hardware */ |
| 918 | 1041 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 919 | 1042 | |
| r7500 | r7501 | |
| 936 | 1059 | |
| 937 | 1060 | static MACHINE_DRIVER_START( robocop2 ) |
| 938 | 1061 | |
| 1062 | /* driver data */ | |
| 1063 | MDRV_DRIVER_DATA(cninja_state) | |
| 1064 | ||
| 939 | 1065 | /* basic machine hardware */ |
| 940 | 1066 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 941 | 1067 | MDRV_CPU_PROGRAM_MAP(robocop2_map) |
| r7500 | r7501 | |
| 944 | 1070 | MDRV_CPU_ADD("audiocpu", H6280,32220000/8) /* Accurate */ |
| 945 | 1071 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 946 | 1072 | |
| 1073 | MDRV_MACHINE_START(cninja) | |
| 947 | 1074 | MDRV_MACHINE_RESET(cninja) |
| 948 | 1075 | |
| 949 | 1076 | MDRV_TIMER_ADD("raster_timer", interrupt_gen) |
| r7500 | r7501 | |
| 960 | 1087 | MDRV_GFXDECODE(robocop2) |
| 961 | 1088 | MDRV_PALETTE_LENGTH(2048) |
| 962 | 1089 | |
| 963 | MDRV_VIDEO_START(robocop2) | |
| 964 | 1090 | MDRV_VIDEO_UPDATE(robocop2) |
| 965 | 1091 | |
| 1092 | MDRV_DECO16IC_ADD("deco_custom", robocop2_deco16ic_intf) | |
| 1093 | ||
| 966 | 1094 | /* sound hardware */ |
| 967 | 1095 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 968 | 1096 | |
| r7500 | r7501 | |
| 988 | 1116 | |
| 989 | 1117 | static MACHINE_DRIVER_START( mutantf ) |
| 990 | 1118 | |
| 1119 | /* driver data */ | |
| 1120 | MDRV_DRIVER_DATA(cninja_state) | |
| 1121 | ||
| 991 | 1122 | /* basic machine hardware */ |
| 992 | 1123 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 993 | 1124 | MDRV_CPU_PROGRAM_MAP(mutantf_map) |
| r7500 | r7501 | |
| 996 | 1127 | MDRV_CPU_ADD("audiocpu", H6280,32220000/8) |
| 997 | 1128 | MDRV_CPU_PROGRAM_MAP(sound_map_mutantf) |
| 998 | 1129 | |
| 1130 | MDRV_MACHINE_START(cninja) | |
| 1131 | MDRV_MACHINE_RESET(cninja) | |
| 1132 | ||
| 999 | 1133 | /* video hardware */ |
| 1000 | 1134 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 1001 | 1135 | |
| r7500 | r7501 | |
| 1008 | 1142 | MDRV_GFXDECODE(mutantf) |
| 1009 | 1143 | MDRV_PALETTE_LENGTH(2048) |
| 1010 | 1144 | |
| 1011 | MDRV_VIDEO_START(mutantf) | |
| 1012 | 1145 | MDRV_VIDEO_UPDATE(mutantf) |
| 1013 | 1146 | |
| 1147 | MDRV_DECO16IC_ADD("deco_custom", mutantf_deco16ic_intf) | |
| 1148 | ||
| 1014 | 1149 | /* sound hardware */ |
| 1015 | 1150 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1016 | 1151 | |
| r7500 | r7501 | |
| 1793 | 1928 | |
| 1794 | 1929 | /**********************************************************************************/ |
| 1795 | 1930 | |
| 1796 | static void cninja_patch(running_machine *machine) | |
| 1931 | static void cninja_patch( running_machine *machine ) | |
| 1797 | 1932 | { |
| 1798 | 1933 | UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu"); |
| 1799 | 1934 | int i; |
| 1800 | 1935 | |
| 1801 | for (i=0; i<0x80000/2; i++) { | |
| 1802 | int aword=RAM[i]; | |
| 1936 | for (i = 0; i < 0x80000 / 2; i++) | |
| 1937 | { | |
| 1938 | int aword = RAM[i]; | |
| 1803 | 1939 | |
| 1804 | if (aword==0x66ff || aword==0x67ff) { | |
| 1805 | UINT16 doublecheck=RAM[i-4]; | |
| 1940 | if (aword == 0x66ff || aword == 0x67ff) | |
| 1941 | { | |
| 1942 | UINT16 doublecheck = RAM[i - 4]; | |
| 1806 | 1943 | |
| 1807 | 1944 | /* Cmpi + btst controlling opcodes */ |
| 1808 | if (doublecheck==0xc39 || doublecheck==0x839) { | |
| 1809 | RAM[i]=0x4E71; | |
| 1810 | RAM[i-1]=0x4E71; | |
| 1811 | RAM[i-2]=0x4E71; | |
| 1812 | RAM[i-3]=0x4E71; | |
| 1813 | RAM[i-4]=0x4E71; | |
| 1945 | if (doublecheck == 0xc39 || doublecheck == 0x839) | |
| 1946 | { | |
| 1947 | RAM[i] = 0x4e71; | |
| 1948 | RAM[i - 1] = 0x4e71; | |
| 1949 | RAM[i - 2] = 0x4e71; | |
| 1950 | RAM[i - 3] = 0x4e71; | |
| 1951 | RAM[i - 4] = 0x4e71; | |
| 1814 | 1952 | } |
| 1815 | 1953 | } |
| 1816 | 1954 | } |
| r7500 | r7501 | |
| 1835 | 1973 | UINT8 *dst = memory_region(machine, "gfx1"); |
| 1836 | 1974 | |
| 1837 | 1975 | /* The 16x16 graphic has some 8x8 chars in it - decode them in GFX1 */ |
| 1838 | memcpy(dst+0x50000,dst+0x10000,0x10000); | |
| 1839 | memcpy(dst+0x10000,src,0x40000); | |
| 1840 | memcpy(dst+0x60000,src+0x40000,0x40000); | |
| 1976 | memcpy(dst + 0x50000, dst + 0x10000, 0x10000); | |
| 1977 | memcpy(dst + 0x10000, src, 0x40000); | |
| 1978 | memcpy(dst + 0x60000, src + 0x40000, 0x40000); | |
| 1841 | 1979 | |
| 1842 | 1980 | deco56_decrypt_gfx(machine, "gfx1"); |
| 1843 | 1981 | deco56_decrypt_gfx(machine, "gfx2"); |
| r7500 | r7501 | |
| 1845 | 1983 | |
| 1846 | 1984 | /**********************************************************************************/ |
| 1847 | 1985 | |
| 1848 | GAME( 1990, edrandy, 0, edrandy, edrandy, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 3)", 0 ) | |
| 1849 | GAME( 1990, edrandy2, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 2)", 0 ) | |
| 1850 | GAME( 1990, edrandy1, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 1)", 0 ) | |
| 1851 | GAME( 1990, edrandyj, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (Japan ver 3)", 0 ) | |
| 1852 | GAME( 1991, cninja, 0, cninja, cninja, cninja, ROT0, "Data East Corporation", "Caveman Ninja (World ver 4)", 0 ) | |
| 1853 | GAME( 1991, cninja1, cninja, cninja, cninja, cninja, ROT0, "Data East Corporation", "Caveman Ninja (World ver 1)", 0 ) | |
| 1854 | GAME( 1991, cninjau, cninja, cninja, cninjau, cninja, ROT0, "Data East Corporation", "Caveman Ninja (US ver 4)", 0 ) | |
| 1855 | GAME( 1991, joemac, cninja, cninja, cninja, cninja, ROT0, "Data East Corporation", "Tatakae Genshizin Joe & Mac (Japan ver 1)", 0 ) | |
| 1856 | GAME( 1991, stoneage, cninja, stoneage, cninja, stoneage, ROT0, "bootleg", "Stoneage (bootleg of Caveman Ninja)", 0 ) | |
| 1857 | GAME( 1991, cninjabl, cninja, cninjabl, cninja, 0, ROT0, "bootleg", "Caveman Ninja (bootleg)", GAME_NOT_WORKING ) | |
| 1858 | GAME( 1991, robocop2, 0, robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (Euro/Asia v0.10)", 0 ) | |
| 1859 | GAME( 1991, robocop2u,robocop2,robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (US v0.05)", 0 ) | |
| 1860 | GAME( 1991, robocop2j,robocop2,robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (Japan v0.11)", 0 ) | |
| 1861 | GAME( 1992, mutantf, 0, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-5)", 0 ) | |
| 1862 | GAME( 1992, mutantf4, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-4)", 0 ) | |
| 1863 | GAME( 1992, mutantf3, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-3)", 0 ) | |
| 1864 | GAME( 1992, deathbrd, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Death Brade (Japan ver JM-3)", 0 ) | |
| 1986 | GAME( 1990, edrandy, 0, edrandy, edrandy, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 3)", GAME_SUPPORTS_SAVE ) | |
| 1987 | GAME( 1990, edrandy2, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 2)", GAME_SUPPORTS_SAVE ) | |
| 1988 | GAME( 1990, edrandy1, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (World ver 1)", GAME_SUPPORTS_SAVE ) | |
| 1989 | GAME( 1990, edrandyj, edrandy, edrandy, edrandc, 0, ROT0, "Data East Corporation", "The Cliffhanger - Edward Randy (Japan ver 3)", GAME_SUPPORTS_SAVE ) | |
| 1990 | GAME( 1991, cninja, 0, cninja, cninja, cninja, ROT0, "Data East Corporation", "Caveman Ninja (World ver 4)", GAME_SUPPORTS_SAVE ) | |
| 1991 | GAME( 1991, cninja1, cninja, cninja, cninja, cninja, ROT0, "Data East Corporation", "Caveman Ninja (World ver 1)", GAME_SUPPORTS_SAVE ) | |
| 1992 | GAME( 1991, cninjau, cninja, cninja, cninjau, cninja, ROT0, "Data East Corporation", "Caveman Ninja (US ver 4)", GAME_SUPPORTS_SAVE ) | |
| 1993 | GAME( 1991, joemac, cninja, cninja, cninja, cninja, ROT0, "Data East Corporation", "Tatakae Genshizin Joe & Mac (Japan ver 1)", GAME_SUPPORTS_SAVE ) | |
| 1994 | GAME( 1991, stoneage, cninja, stoneage, cninja, stoneage, ROT0, "bootleg", "Stoneage (bootleg of Caveman Ninja)", GAME_SUPPORTS_SAVE ) | |
| 1995 | GAME( 1991, cninjabl, cninja, cninjabl, cninja, 0, ROT0, "bootleg", "Caveman Ninja (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 1996 | GAME( 1991, robocop2, 0, robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (Euro/Asia v0.10)", GAME_SUPPORTS_SAVE ) | |
| 1997 | GAME( 1991, robocop2u,robocop2,robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (US v0.05)", GAME_SUPPORTS_SAVE ) | |
| 1998 | GAME( 1991, robocop2j,robocop2,robocop2, robocop2,0, ROT0, "Data East Corporation", "Robocop 2 (Japan v0.11)", GAME_SUPPORTS_SAVE ) | |
| 1999 | GAME( 1992, mutantf, 0, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-5)", GAME_SUPPORTS_SAVE ) | |
| 2000 | GAME( 1992, mutantf4, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-4)", GAME_SUPPORTS_SAVE ) | |
| 2001 | GAME( 1992, mutantf3, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-3)", GAME_SUPPORTS_SAVE ) | |
| 2002 | GAME( 1992, deathbrd, mutantf, mutantf, mutantf, mutantf, ROT0, "Data East Corporation", "Death Brade (Japan ver JM-3)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 34 | 34 | #include "cpu/z80/z80.h" |
| 35 | 35 | #include "sound/dac.h" |
| 36 | 36 | |
| 37 | typedef struct _go2000_state go2000_state; | |
| 38 | struct _go2000_state | |
| 37 | class go2000_state | |
| 39 | 38 | { |
| 39 | public: | |
| 40 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, go2000_state(machine)); } | |
| 41 | ||
| 42 | go2000_state(running_machine &machine) { } | |
| 43 | ||
| 40 | 44 | /* memory pointers */ |
| 41 | 45 | UINT16 * videoram; |
| 42 | 46 | UINT16 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 121 | 121 | #include "sound/ay8910.h" |
| 122 | 122 | #include "sound/samples.h" |
| 123 | 123 | |
| 124 | typedef struct _m63_state m63_state; | |
| 125 | struct _m63_state | |
| 124 | class m63_state | |
| 126 | 125 | { |
| 126 | public: | |
| 127 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, m63_state(machine)); } | |
| 128 | ||
| 129 | m63_state(running_machine &machine) { } | |
| 130 | ||
| 127 | 131 | UINT8 * videoram; |
| 128 | 132 | UINT8 * colorram; |
| 129 | 133 | UINT8 * spriteram; |
| r7500 | r7501 | |
|---|---|---|
| 124 | 124 | #include "emu.h" |
| 125 | 125 | #include "cpu/m68000/m68000.h" |
| 126 | 126 | #include "cpu/h6280/h6280.h" |
| 127 | #include "includes/d | |
| 127 | #include "includes/dassault.h" | |
| 128 | 128 | #include "sound/2203intf.h" |
| 129 | 129 | #include "sound/2151intf.h" |
| 130 | 130 | #include "sound/okim6295.h" |
| 131 | #include "video/deco16ic.h" | |
| 131 | 132 | |
| 132 | VIDEO_START( dassault ); | |
| 133 | VIDEO_UPDATE( dassault ); | |
| 134 | 133 | |
| 135 | static UINT16 *dassault_ram,*shared_ram,*dassault_ram2; | |
| 136 | ||
| 137 | 134 | /**********************************************************************************/ |
| 138 | 135 | |
| 139 | 136 | static READ16_HANDLER( dassault_control_r ) |
| 140 | 137 | { |
| 141 | switch (offset<<1) | |
| 138 | switch (offset << 1) | |
| 142 | 139 | { |
| 143 | 140 | case 0: /* Player 1 & Player 2 joysticks & fire buttons */ |
| 144 | 141 | return input_port_read(space->machine, "P1_P2"); |
| r7500 | r7501 | |
| 161 | 158 | |
| 162 | 159 | static WRITE16_HANDLER( dassault_control_w ) |
| 163 | 160 | { |
| 164 | coin_counter_w(space->machine, 0,data&1); | |
| 165 | if (data&0xfffe) | |
| 166 | logerror("Coin cointrol %04x\n",data); | |
| 161 | coin_counter_w(space->machine, 0, data & 1); | |
| 162 | if (data & 0xfffe) | |
| 163 | logerror("Coin cointrol %04x\n", data); | |
| 167 | 164 | } |
| 168 | 165 | |
| 169 | 166 | static READ16_HANDLER( dassault_sub_control_r ) |
| r7500 | r7501 | |
| 173 | 170 | |
| 174 | 171 | static WRITE16_HANDLER( dassault_sound_w ) |
| 175 | 172 | { |
| 173 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 176 | 174 | soundlatch_w(space, 0, data & 0xff); |
| 177 | cpu | |
| 175 | cpu | |
| 178 | 176 | } |
| 179 | 177 | |
| 180 | 178 | /* The CPU-CPU irq controller is overlaid onto the end of the shared memory */ |
| 181 | 179 | static READ16_HANDLER( dassault_irq_r ) |
| 182 | 180 | { |
| 183 | switch (offset) { | |
| 184 | case 0: cputag_set_input_line(space->machine, "maincpu", 5, CLEAR_LINE); break; | |
| 185 | case 1: cputag_set_input_line(space->machine, "sub", 6, CLEAR_LINE); break; | |
| 181 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 182 | switch (offset) | |
| 183 | { | |
| 184 | case 0: cpu_set_input_line(state->maincpu, 5, CLEAR_LINE); break; | |
| 185 | case 1: cpu_set_input_line(state->subcpu, 6, CLEAR_LINE); break; | |
| 186 | 186 | } |
| 187 | return shared_ram[(0xffc/2)+offset]; /* The values probably don't matter */ | |
| 187 | return state->shared_ram[(0xffc / 2) + offset]; /* The values probably don't matter */ | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static WRITE16_HANDLER( dassault_irq_w ) |
| 191 | 191 | { |
| 192 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 192 | 193 | switch (offset) |
| 193 | 194 | { |
| 194 | case 0: cputag_set_input_line(space->machine, "maincpu", 5, ASSERT_LINE); break; | |
| 195 | case 1: cputag_set_input_line(space->machine, "sub", 6, ASSERT_LINE); break; | |
| 195 | case 0: cpu_set_input_line(state->maincpu, 5, ASSERT_LINE); break; | |
| 196 | case 1: cpu_set_input_line(state->subcpu, 6, ASSERT_LINE); break; | |
| 196 | 197 | } |
| 197 | 198 | |
| 198 | COMBINE_DATA(&shared_ram[(0xffc / 2) + offset]); /* The values probably don't matter */ | |
| 199 | COMBINE_DATA(&state->shared_ram[(0xffc / 2) + offset]); /* The values probably don't matter */ | |
| 199 | 200 | } |
| 200 | 201 | |
| 201 | 202 | static WRITE16_HANDLER( shared_ram_w ) |
| 202 | 203 | { |
| 203 | COMBINE_DATA(&shared_ram[offset]); | |
| 204 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 205 | COMBINE_DATA(&state->shared_ram[offset]); | |
| 204 | 206 | } |
| 205 | 207 | |
| 206 | 208 | static READ16_HANDLER( shared_ram_r ) |
| 207 | 209 | { |
| 208 | return shared_ram[offset]; | |
| 210 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 211 | return state->shared_ram[offset]; | |
| 209 | 212 | } |
| 210 | 213 | |
| 211 | 214 | /**********************************************************************************/ |
| r7500 | r7501 | |
| 213 | 216 | static ADDRESS_MAP_START( dassault_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 214 | 217 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 215 | 218 | |
| 216 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 219 | AM_RANGE(0x100000, 0x103fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 217 | 220 | |
| 218 | 221 | AM_RANGE(0x140004, 0x140007) AM_WRITENOP /* ? */ |
| 219 | 222 | AM_RANGE(0x180000, 0x180001) AM_WRITE(dassault_sound_w) |
| 220 | 223 | |
| 221 | 224 | AM_RANGE(0x1c0000, 0x1c000f) AM_READ(dassault_control_r) |
| 222 | AM_RANGE(0x1c000a, 0x1c000b) AM_WRITE(deco16_priority_w) | |
| 225 | AM_RANGE(0x1c000a, 0x1c000b) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 223 | 226 | AM_RANGE(0x1c000c, 0x1c000d) AM_WRITE(buffer_spriteram16_2_w) |
| 224 | 227 | AM_RANGE(0x1c000e, 0x1c000f) AM_WRITE(dassault_control_w) |
| 225 | 228 | |
| 226 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 227 | AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 228 | AM_RANGE(0x212000, 0x212fff) AM_WRITEONLY AM_BASE(&deco16_pf2_rowscroll) | |
| 229 | AM_RANGE(0x220000, 0x22000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 229 | AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 230 | AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 231 | AM_RANGE(0x212000, 0x212fff) AM_WRITEONLY AM_BASE_MEMBER(dassault_state, pf2_rowscroll) | |
| 232 | AM_RANGE(0x220000, 0x22000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 230 | 233 | |
| 231 | AM_RANGE(0x240000, 0x240fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 232 | AM_RANGE(0x242000, 0x242fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 233 | AM_RANGE(0x252000, 0x252fff) AM_WRITEONLY AM_BASE(&deco16_pf4_rowscroll) | |
| 234 | AM_RANGE(0x260000, 0x26000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 234 | AM_RANGE(0x240000, 0x240fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 235 | AM_RANGE(0x242000, 0x242fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 236 | AM_RANGE(0x252000, 0x252fff) AM_WRITEONLY AM_BASE_MEMBER(dassault_state, pf4_rowscroll) | |
| 237 | AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 235 | 238 | |
| 236 | AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_BASE( | |
| 239 | AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_BASE_MEMBER( | |
| 237 | 240 | AM_RANGE(0x3fc000, 0x3fcfff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram2) /* Spriteram (2nd) */ |
| 238 | 241 | AM_RANGE(0x3feffc, 0x3fefff) AM_READWRITE(dassault_irq_r, dassault_irq_w) |
| 239 | AM_RANGE(0x3fe000, 0x3fefff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE( | |
| 242 | AM_RANGE(0x3fe000, 0x3fefff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE_MEMBER(dassault_state, shared_ram) /* Shared ram */ | |
| 240 | 243 | ADDRESS_MAP_END |
| 241 | 244 | |
| 242 | 245 | static ADDRESS_MAP_START( dassault_sub_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r7500 | r7501 | |
| 246 | 249 | AM_RANGE(0x100002, 0x100007) AM_WRITENOP /* ? */ |
| 247 | 250 | AM_RANGE(0x100004, 0x100005) AM_READ(dassault_sub_control_r) |
| 248 | 251 | |
| 249 | AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_BASE( | |
| 252 | AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_BASE_MEMBER( | |
| 250 | 253 | AM_RANGE(0x3fc000, 0x3fcfff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* Sprite ram */ |
| 251 | 254 | AM_RANGE(0x3feffc, 0x3fefff) AM_READWRITE(dassault_irq_r, dassault_irq_w) |
| 252 | 255 | AM_RANGE(0x3fe000, 0x3fefff) AM_READWRITE(shared_ram_r, shared_ram_w) |
| r7500 | r7501 | |
| 510 | 513 | |
| 511 | 514 | static void sound_irq(running_device *device, int state) |
| 512 | 515 | { |
| 513 | cputag_set_input_line(device->machine, "audiocpu", 1, state); | |
| 516 | dassault_state *driver_state = (dassault_state *)device->machine->driver_data; | |
| 517 | cpu_set_input_line(driver_state->audiocpu, 1, state); | |
| 514 | 518 | } |
| 515 | 519 | |
| 516 | 520 | static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) |
| 517 | 521 | { |
| 522 | dassault_state *state = (dassault_state *)device->machine->driver_data; | |
| 523 | ||
| 518 | 524 | /* the second OKIM6295 ROM is bank switched */ |
| 519 | okim6295_set_bank_base( | |
| 525 | okim6295_set_bank_base(s | |
| 520 | 526 | } |
| 521 | 527 | |
| 522 | 528 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 527 | 533 | |
| 528 | 534 | /**********************************************************************************/ |
| 529 | 535 | |
| 536 | static int dassault_bank_callback( const int bank ) | |
| 537 | { | |
| 538 | return ((bank >> 4) & 0xf) << 12; | |
| 539 | } | |
| 540 | ||
| 541 | static const deco16ic_interface dassault_deco16ic_intf = | |
| 542 | { | |
| 543 | "screen", | |
| 544 | 0, 0, 1, | |
| 545 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 546 | 0, 16, 0, 16, /* color base (default values) */ | |
| 547 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 548 | dassault_bank_callback, | |
| 549 | dassault_bank_callback, | |
| 550 | dassault_bank_callback, | |
| 551 | dassault_bank_callback | |
| 552 | }; | |
| 553 | ||
| 554 | static MACHINE_START( dassault ) | |
| 555 | { | |
| 556 | dassault_state *state = (dassault_state *)machine->driver_data; | |
| 557 | ||
| 558 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 559 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 560 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 561 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 562 | state->oki2 = devtag_get_device(machine, "oki2"); | |
| 563 | } | |
| 564 | ||
| 530 | 565 | static MACHINE_DRIVER_START( dassault ) |
| 531 | 566 | |
| 567 | /* driver data */ | |
| 568 | MDRV_DRIVER_DATA(dassault_state) | |
| 569 | ||
| 532 | 570 | /* basic machine hardware */ |
| 533 | 571 | MDRV_CPU_ADD("maincpu", M68000, 14000000) /* Accurate */ |
| 534 | 572 | MDRV_CPU_PROGRAM_MAP(dassault_map) |
| r7500 | r7501 | |
| 543 | 581 | |
| 544 | 582 | MDRV_QUANTUM_TIME(HZ(8400)) /* 140 CPU slices per frame */ |
| 545 | 583 | |
| 584 | MDRV_MACHINE_START(dassault) | |
| 585 | ||
| 546 | 586 | /* video hardware */ |
| 547 | 587 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 548 | 588 | |
| r7500 | r7501 | |
| 556 | 596 | MDRV_GFXDECODE(dassault) |
| 557 | 597 | MDRV_PALETTE_LENGTH(4096) |
| 558 | 598 | |
| 559 | MDRV_VIDEO_START(dassault) | |
| 560 | 599 | MDRV_VIDEO_UPDATE(dassault) |
| 561 | 600 | |
| 601 | MDRV_DECO16IC_ADD("deco_custom", dassault_deco16ic_intf) | |
| 602 | ||
| 562 | 603 | /* sound hardware */ |
| 563 | 604 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 564 | 605 | |
| r7500 | r7501 | |
| 786 | 827 | |
| 787 | 828 | static READ16_HANDLER( dassault_main_skip ) |
| 788 | 829 | { |
| 789 | int ret=dassault_ram[0]; | |
| 830 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 831 | int ret = state->ram[0]; | |
| 790 | 832 | |
| 791 | if (cpu_get_previouspc(space->cpu)==0x1170 && ret&0x8000) | |
| 833 | if (cpu_get_previouspc(space->cpu) == 0x1170 && ret & 0x8000) | |
| 792 | 834 | cpu_spinuntil_int(space->cpu); |
| 793 | 835 | |
| 794 | 836 | return ret; |
| r7500 | r7501 | |
| 796 | 838 | |
| 797 | 839 | static READ16_HANDLER( thndzone_main_skip ) |
| 798 | 840 | { |
| 799 | int ret=dassault_ram[0]; | |
| 841 | dassault_state *state = (dassault_state *)space->machine->driver_data; | |
| 842 | int ret = state->ram[0]; | |
| 800 | 843 | |
| 801 | if (cpu_get_pc(space->cpu)==0x114c && ret&0x8000) | |
| 844 | if (cpu_get_pc(space->cpu) == 0x114c && ret & 0x8000) | |
| 802 | 845 | cpu_spinuntil_int(space->cpu); |
| 803 | 846 | |
| 804 | 847 | return ret; |
| r7500 | r7501 | |
| 813 | 856 | /* Playfield 4 also has access to the char graphics, make things easier |
| 814 | 857 | by just copying the chars to both banks (if I just used a different gfx |
| 815 | 858 | bank then the colours would be wrong). */ |
| 816 | memcpy(tmp+0x000000,dst+0x80000,0x80000); | |
| 817 | memcpy(dst+0x090000,tmp+0x00000,0x80000); | |
| 818 | memcpy(dst+0x080000,src+0x00000,0x10000); | |
| 819 | memcpy(dst+0x110000,src+0x10000,0x10000); | |
| 859 | memcpy(tmp + 0x000000, dst + 0x80000, 0x80000); | |
| 860 | memcpy(dst + 0x090000, tmp + 0x00000, 0x80000); | |
| 861 | memcpy(dst + 0x080000, src + 0x00000, 0x10000); | |
| 862 | memcpy(dst + 0x110000, src + 0x10000, 0x10000); | |
| 820 | 863 | |
| 821 | 864 | auto_free(machine, tmp); |
| 822 | 865 | |
| r7500 | r7501 | |
| 833 | 876 | /* Playfield 4 also has access to the char graphics, make things easier |
| 834 | 877 | by just copying the chars to both banks (if I just used a different gfx |
| 835 | 878 | bank then the colours would be wrong). */ |
| 836 | memcpy(tmp+0x000000,dst+0x80000,0x80000); | |
| 837 | memcpy(dst+0x090000,tmp+0x00000,0x80000); | |
| 838 | memcpy(dst+0x080000,src+0x00000,0x10000); | |
| 839 | memcpy(dst+0x110000,src+0x10000,0x10000); | |
| 879 | memcpy(tmp + 0x000000, dst + 0x80000, 0x80000); | |
| 880 | memcpy(dst + 0x090000, tmp + 0x00000, 0x80000); | |
| 881 | memcpy(dst + 0x080000, src + 0x00000, 0x10000); | |
| 882 | memcpy(dst + 0x110000, src + 0x10000, 0x10000); | |
| 840 | 883 | |
| 841 | 884 | auto_free(machine, tmp); |
| 842 | 885 | |
| r7500 | r7501 | |
| 846 | 889 | |
| 847 | 890 | /**********************************************************************************/ |
| 848 | 891 | |
| 849 | GAME( 1991, thndzone, 0, dassault, thndzone, thndzone, ROT0, "Data East Corporation", "Thunder Zone (World)", 0 ) | |
| 850 | GAME( 1991, dassault, thndzone, dassault, dassault, dassault, ROT0, "Data East Corporation", "Desert Assault (US)", 0 ) | |
| 851 | GAME( 1991, dassault4,thndzone, dassault, dassault4,dassault, ROT0, "Data East Corporation", "Desert Assault (US 4 Players)", 0 ) | |
| 892 | GAME( 1991, thndzone, 0, dassault, thndzone, thndzone, ROT0, "Data East Corporation", "Thunder Zone (World)", GAME_SUPPORTS_SAVE ) | |
| 893 | GAME( 1991, dassault, thndzone, dassault, dassault, dassault, ROT0, "Data East Corporation", "Desert Assault (US)", GAME_SUPPORTS_SAVE ) | |
| 894 | GAME( 1991, dassault4,thndzone, dassault, dassault4,dassault, ROT0, "Data East Corporation", "Desert Assault (US 4 Players)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 25 | 25 | #include "cpu/h6280/h6280.h" |
| 26 | 26 | #include "sound/2151intf.h" |
| 27 | 27 | #include "sound/okim6295.h" |
| 28 | #include "includes/deco16ic.h" | |
| 28 | #include "video/deco16ic.h" | |
| 29 | #include "includes/supbtime.h" | |
| 29 | 30 | |
| 30 | VIDEO_START( supbtime ); | |
| 31 | VIDEO_UPDATE( supbtime ); | |
| 32 | 31 | |
| 33 | 32 | /******************************************************************************/ |
| 34 | 33 | |
| 35 | 34 | static READ16_HANDLER( supbtime_controls_r ) |
| 36 | 35 | { |
| 37 | switch (offset<<1) | |
| 36 | switch (offset << 1) | |
| 38 | 37 | { |
| 39 | 38 | case 0: |
| 40 | 39 | return input_port_read(space->machine, "INPUTS"); |
| r7500 | r7501 | |
| 47 | 46 | return 0; |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(space->cpu),offset); | |
| 49 | logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(space->cpu), offset); | |
| 51 | 50 | return ~0; |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | static WRITE16_HANDLER( sound_w ) |
| 55 | 54 | { |
| 55 | supbtime_state *state = (supbtime_state *)space->machine->driver_data; | |
| 56 | 56 | soundlatch_w(space, 0, data & 0xff); |
| 57 | cpu | |
| 57 | cpu | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /******************************************************************************/ |
| r7500 | r7501 | |
| 63 | 63 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 64 | 64 | AM_RANGE(0x100000, 0x103fff) AM_RAM |
| 65 | 65 | AM_RANGE(0x104000, 0x11ffff) AM_WRITENOP /* Nothing there */ |
| 66 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_ | |
| 66 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 67 | 67 | AM_RANGE(0x120800, 0x13ffff) AM_WRITENOP /* Nothing there */ |
| 68 | 68 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 69 | 69 | AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r) |
| 70 | 70 | AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP |
| 71 | 71 | AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(sound_w) |
| 72 | AM_RANGE(0x300000, 0x30000f) AM_RAM AM_BASE(&deco16_pf12_control) | |
| 73 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 74 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 75 | AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 76 | AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 72 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_r, deco16ic_pf12_control_w) | |
| 73 | AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 74 | AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 75 | AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf1_rowscroll) | |
| 76 | AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf2_rowscroll) | |
| 77 | 77 | ADDRESS_MAP_END |
| 78 | 78 | |
| 79 | 79 | static ADDRESS_MAP_START( chinatwn_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 80 | 80 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 81 | 81 | AM_RANGE(0x100000, 0x100001) AM_WRITE(sound_w) |
| 82 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_ | |
| 82 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 83 | 83 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 84 | 84 | AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r) |
| 85 | 85 | AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP |
| 86 | 86 | AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM |
| 87 | AM_RANGE(0x300000, 0x30000f) AM_RAM AM_BASE(&deco16_pf12_control) | |
| 88 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 89 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 90 | AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) // unused | |
| 91 | AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) // unused | |
| 87 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_r, deco16ic_pf12_control_w) | |
| 88 | AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 89 | AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 90 | AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf1_rowscroll) // unused | |
| 91 | AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf2_rowscroll) // unused | |
| 92 | 92 | ADDRESS_MAP_END |
| 93 | 93 | |
| 94 | 94 | /******************************************************************************/ |
| r7500 | r7501 | |
| 311 | 311 | |
| 312 | 312 | static void sound_irq(running_device *device, int state) |
| 313 | 313 | { |
| 314 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 314 | supbtime_state *driver_state = (supbtime_state *)device->machine->driver_data; | |
| 315 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 315 | 316 | } |
| 316 | 317 | |
| 317 | 318 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 319 | 320 | sound_irq |
| 320 | 321 | }; |
| 321 | 322 | |
| 323 | static const deco16ic_interface supbtime_deco16ic_intf = | |
| 324 | { | |
| 325 | "screen", | |
| 326 | 1, 0, 1, | |
| 327 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 328 | 0, 16, 0, 16, /* color base (default values) */ | |
| 329 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 330 | NULL, NULL, NULL, NULL | |
| 331 | }; | |
| 332 | ||
| 333 | static MACHINE_START( supbtime ) | |
| 334 | { | |
| 335 | supbtime_state *state = (supbtime_state *)machine->driver_data; | |
| 336 | ||
| 337 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 338 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 339 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 340 | } | |
| 341 | ||
| 322 | 342 | static MACHINE_DRIVER_START( supbtime ) |
| 323 | 343 | |
| 344 | /* driver data */ | |
| 345 | MDRV_DRIVER_DATA(supbtime_state) | |
| 346 | ||
| 324 | 347 | /* basic machine hardware */ |
| 325 | 348 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 326 | 349 | MDRV_CPU_PROGRAM_MAP(supbtime_map) |
| r7500 | r7501 | |
| 329 | 352 | MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */ |
| 330 | 353 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 331 | 354 | |
| 355 | MDRV_MACHINE_START(supbtime) | |
| 356 | ||
| 332 | 357 | /* video hardware */ |
| 333 | 358 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 334 | 359 | |
| r7500 | r7501 | |
| 342 | 367 | MDRV_GFXDECODE(supbtime) |
| 343 | 368 | MDRV_PALETTE_LENGTH(1024) |
| 344 | 369 | |
| 345 | MDRV_VIDEO_START(supbtime) | |
| 346 | 370 | MDRV_VIDEO_UPDATE(supbtime) |
| 347 | 371 | |
| 372 | MDRV_DECO16IC_ADD("deco_custom", supbtime_deco16ic_intf) | |
| 373 | ||
| 348 | 374 | /* sound hardware */ |
| 349 | 375 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 350 | 376 | |
| r7500 | r7501 | |
| 361 | 387 | |
| 362 | 388 | static MACHINE_DRIVER_START( chinatwn ) |
| 363 | 389 | |
| 390 | /* driver data */ | |
| 391 | MDRV_DRIVER_DATA(supbtime_state) | |
| 392 | ||
| 364 | 393 | /* basic machine hardware */ |
| 365 | 394 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 366 | 395 | MDRV_CPU_PROGRAM_MAP(chinatwn_map) |
| r7500 | r7501 | |
| 369 | 398 | MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */ |
| 370 | 399 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 371 | 400 | |
| 401 | MDRV_MACHINE_START(supbtime) | |
| 402 | ||
| 372 | 403 | /* video hardware */ |
| 373 | 404 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 374 | 405 | |
| r7500 | r7501 | |
| 382 | 413 | MDRV_GFXDECODE(supbtime) |
| 383 | 414 | MDRV_PALETTE_LENGTH(1024) |
| 384 | 415 | |
| 385 | MDRV_VIDEO_START(supbtime) | |
| 386 | 416 | MDRV_VIDEO_UPDATE(supbtime) |
| 387 | 417 | |
| 418 | MDRV_DECO16IC_ADD("deco_custom", supbtime_deco16ic_intf) | |
| 419 | ||
| 388 | 420 | /* sound hardware */ |
| 389 | 421 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 390 | 422 | |
| r7500 | r7501 | |
| 479 | 511 | |
| 480 | 512 | /******************************************************************************/ |
| 481 | 513 | |
| 482 | GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", 0 ) | |
| 483 | GAME( 1990, supbtimea,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", 0 ) | |
| 484 | GAME( 1990, supbtimej,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", 0 ) | |
| 485 | GAME( 1991, chinatwn, 0, chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", 0 ) | |
| 514 | GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", GAME_SUPPORTS_SAVE ) | |
| 515 | GAME( 1990, supbtimea,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", GAME_SUPPORTS_SAVE ) | |
| 516 | GAME( 1990, supbtimej,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", GAME_SUPPORTS_SAVE ) | |
| 517 | GAME( 1991, chinatwn, 0, chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 23 | 23 | #include "sound/sn76477.h" |
| 24 | 24 | |
| 25 | 25 | |
| 26 | typedef struct _toratora_state toratora_state; | |
| 27 | struct _toratora_state | |
| 26 | class toratora_state | |
| 28 | 27 | { |
| 28 | public: | |
| 29 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, toratora_state(machine)); } | |
| 30 | ||
| 31 | toratora_state(running_machine &machine) { } | |
| 32 | ||
| 29 | 33 | /* memory pointers */ |
| 30 | 34 | UINT8 * videoram; |
| 31 | 35 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | /* |
| 629 | This (rev 7) is the most recent Pit Fighter pcb that we have documented. | |
| 630 | It has printed Atari stickers that show the following: | |
| 629 | Pit Fighter (rev 9) | |
| 631 | 630 | |
| 631 | There are printed Atari stickers that show the following: | |
| 632 | ||
| 632 | 633 | 2 main board stickers: |
| 633 | 634 | |
| 635 | PITFIGHTER | |
| 636 | A0478936-03 | |
| 637 | ||
| 638 | WO#-PITPCB08 | |
| 639 | G1 REV.D BD. | |
| 640 | ||
| 641 | 2 stickers on JSA Audio II board: | |
| 642 | ||
| 643 | JSA II PITJSA10 | |
| 644 | PIT | |
| 645 | FIGHTER | |
| 646 | A047184-05 | |
| 647 | ||
| 648 | SBOM | |
| 649 | 00R5 | |
| 650 | 001 | |
| 651 | ||
| 652 | The card stuck into location 10P has 1 sticker: | |
| 653 | ||
| 654 | OOPSPCB01 | |
| 655 | G1 OOPS | |
| 656 | PCB | |
| 657 | A048490-01 | |
| 658 | ||
| 659 | The chip on the 10P card is labeled 136079-2053 | |
| 660 | */ | |
| 661 | ROM_START( pitfight ) | |
| 662 | ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ | |
| 663 | ROM_LOAD16_BYTE( "136081-9028.05d", 0x00000, 0x10000, CRC(427713e9) SHA1(8b4913188cac9fe3845c812a07c81f5fdb4a2ded) ) | |
| 664 | ROM_LOAD16_BYTE( "136081-9029.05b", 0x00001, 0x10000, CRC(2cdeaeba) SHA1(e02c99d7f5a7080ea75dc2dd59d4678b62f6bd55) ) | |
| 665 | ROM_LOAD16_BYTE( "136081-9030.15d", 0x20000, 0x10000, CRC(3bace9ef) SHA1(29072871b268f343fa1e7fcc9682674df2b2e34f) ) | |
| 666 | ROM_LOAD16_BYTE( "136081-9031.15b", 0x20001, 0x10000, CRC(c717f011) SHA1(3c5d6c12b85285422345a1aba3f8c497f74c6889) ) | |
| 667 | ||
| 668 | ROM_REGION( 0x14000, "jsa", 0 ) /* 64k for 6502 code */ | |
| 669 | ROM_LOAD( "136081-1060.1b", 0x10000, 0x4000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) | |
| 670 | ROM_CONTINUE( 0x04000, 0xc000 ) | |
| 671 | ||
| 672 | ROM_REGION( 0x0a0000, "gfx1", 0 ) | |
| 673 | ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ | |
| 674 | ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) | |
| 675 | ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ | |
| 676 | ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) | |
| 677 | ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ | |
| 678 | ||
| 679 | ROM_REGION( 0x020000, "gfx2", 0 ) | |
| 680 | ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ | |
| 681 | ||
| 682 | ROM_REGION16_BE( 0x200000, "gfx3", 0 ) | |
| 683 | ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) ) | |
| 684 | ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) ) | |
| 685 | ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) ) | |
| 686 | ROM_LOAD16_BYTE( "136081-1004.70n", 0x040000, 0x20000, CRC(977744da) SHA1(10f388eef999f702863e2b1a02a188df9a0a6086) ) | |
| 687 | ROM_LOAD16_BYTE( "136081-1005.75r", 0x080001, 0x20000, CRC(ae59aef2) SHA1(44eda8a01016f6911b47df973b9427ff9f2ecef0) ) | |
| 688 | ROM_LOAD16_BYTE( "136081-1006.75n", 0x080000, 0x20000, CRC(b6ccd77e) SHA1(f09a829143abd972699f3e671d4a1362fd362b19) ) | |
| 689 | ROM_LOAD16_BYTE( "136081-1007.90r", 0x0c0001, 0x20000, CRC(ba33b0c0) SHA1(be09ba8796d3db2a859a2776336c1e9acbdaee95) ) | |
| 690 | ROM_LOAD16_BYTE( "136081-1008.90n", 0x0c0000, 0x20000, CRC(09bd047c) SHA1(c283d526c7b08ce06e3981d1fc69433ea0dae657) ) | |
| 691 | ROM_LOAD16_BYTE( "136081-1009.100r", 0x100001, 0x20000, CRC(ab85b00b) SHA1(6c60b9b58ff93ffdd1cffc49c3ea67400d56bf61) ) | |
| 692 | ROM_LOAD16_BYTE( "136081-1010.100n", 0x100000, 0x20000, CRC(eca94bdc) SHA1(c474dfc9dc4460cd2f40cc6012214e760b133c0d) ) | |
| 693 | ROM_LOAD16_BYTE( "136081-1011.115r", 0x140001, 0x20000, CRC(a86582fd) SHA1(8b557622c53c8ff388248ea54d3cc85b0d77cafb) ) | |
| 694 | ROM_LOAD16_BYTE( "136081-1012.115n", 0x140000, 0x20000, CRC(efd1152d) SHA1(77d1752b76b079c9e834a8b73e8601873d3afdbe) ) | |
| 695 | ROM_LOAD16_BYTE( "136081-1013.120r", 0x180001, 0x20000, CRC(a141379e) SHA1(d4c98b364495e19e2e7bee5431834f38ba20a514) ) | |
| 696 | ROM_LOAD16_BYTE( "136081-1014.120n", 0x180000, 0x20000, CRC(93bfcc15) SHA1(4d8f6c8c279533b2fc35f87c3eb5ed614cb03248) ) | |
| 697 | ROM_LOAD16_BYTE( "136081-1015.130r", 0x1c0001, 0x20000, CRC(9378ad0b) SHA1(909f9879f5b8fc3ed0622fd27d903ccb1f7a90c6) ) | |
| 698 | ROM_LOAD16_BYTE( "136081-1016.130n", 0x1c0000, 0x20000, CRC(19c3fbe0) SHA1(ba28f71edb04387f009afe39bfe0ffeff8fbf5e9) ) | |
| 699 | ||
| 700 | ROM_REGION( 0x40000, "adpcm", 0 ) /* 256k for ADPCM samples */ | |
| 701 | ROM_LOAD( "136081-1061.7k", 0x00000, 0x10000, CRC(5b0468c6) SHA1(c910344622386e6be336fe04bc0be758ac6c59db) ) | |
| 702 | ROM_LOAD( "136081-1062.7j", 0x10000, 0x10000, CRC(f73fe3cb) SHA1(547b5c4add617237c4c851751a27cda091fb7933) ) | |
| 703 | ROM_LOAD( "136081-1063.7e", 0x20000, 0x10000, CRC(aa93421d) SHA1(f319057dadcb77a489d0bcffb24e0afe88adc769) ) | |
| 704 | ROM_LOAD( "136081-1064.7d", 0x30000, 0x10000, CRC(33f045d5) SHA1(1fc7bedafeb3c1ffa0f115538cc300959c8d4601) ) | |
| 705 | ||
| 706 | ROM_REGION( 0x0600, "proms", 0 ) /* microcode for growth renderer */ | |
| 707 | ROM_LOAD( "136081-1040.30s", 0x0000, 0x0200, CRC(9b0f8b95) SHA1(d03987fe2d50a9f7769c600885bd1c7e1dee0789) ) | |
| 708 | ROM_LOAD( "136081-1041.25s", 0x0200, 0x0200, CRC(f7ba6153) SHA1(d58792c9e9ea72d8f53f41ac1b420a86db6da3a3) ) | |
| 709 | ROM_LOAD( "136081-1042.20s", 0x0400, 0x0200, CRC(3572fe68) SHA1(ab34ff337c16cd4d568cd2bd6a5063f5ed97368f) ) | |
| 710 | ||
| 711 | ROM_REGION( 0x1200, "plds", 0 ) | |
| 712 | ROM_LOAD( "gal16v8a-136081-1043.15e", 0x0000, 0x0117, CRC(649d9c0d) SHA1(bba2f3cf4607946340de27157c799f6b84c48584) ) | |
| 713 | ROM_LOAD( "gal16v8a-136079-1045.40p", 0x0200, 0x0117, CRC(535c4d2e) SHA1(a428eef81723546566216e6af0db3baebda9a1f2) ) | |
| 714 | ROM_LOAD( "gal16v8a-136079-1046.65d", 0x0400, 0x0117, CRC(38b22b2c) SHA1(cf9051129a790f3427e1c6d74a5c66f16acbd4be) ) | |
| 715 | ROM_LOAD( "gal16v8a-136079-1047.40s", 0x0600, 0x0117, CRC(20839904) SHA1(134d1b379b7708ce33fbbf75e5c879dad971cd22) ) | |
| 716 | ROM_LOAD( "gal16v8a-136079-1048.125f", 0x0800, 0x0117, CRC(d16e8d6e) SHA1(61cc270d80cb34f63fc407e41b55f95d59717757) ) | |
| 717 | ROM_LOAD( "gal16v8a-136079-1049.120f", 0x0a00, 0x0117, CRC(68440ab1) SHA1(2f4eabac27d9a5778fcba0d9aa47460bcb153378) ) | |
| 718 | ROM_LOAD( "gal16v8a-136079-1050.115f", 0x0c00, 0x0117, CRC(20dc296a) SHA1(9179fca2efcdd0782bb15cbf1923670806755bc8) ) | |
| 719 | ROM_LOAD( "gal16v8a-136079-1051.105f", 0x0e00, 0x0117, CRC(45f0cb5f) SHA1(a7043231f68374871253da50cfd905519f283d9e) ) | |
| 720 | ROM_LOAD( "gal16v8a-136079-1052.30n", 0x1000, 0x0117, CRC(6b3d2669) SHA1(143178d9c36a87aa58034faea2e4d4038ae565e7) ) | |
| 721 | ROM_END | |
| 722 | ||
| 723 | ||
| 724 | /* | |
| 725 | Pit Fighter (rev 7) | |
| 726 | ||
| 727 | There are printed Atari stickers that show the following: | |
| 728 | ||
| 729 | 2 main board stickers: | |
| 730 | ||
| 634 | 731 | PIT FIGHTER |
| 635 | 732 | A0478936-03 |
| 636 | 733 | |
| r7500 | r7501 | |
| 657 | 754 | |
| 658 | 755 | The chip on the 10P card is labeled 136079-2053. |
| 659 | 756 | */ |
| 660 | ||
| 661 | ROM_START( pitfight ) | |
| 757 | ROM_START( pitfight7 ) | |
| 662 | 758 | ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ |
| 663 | 759 | ROM_LOAD16_BYTE( "136081-7028.05d", 0x00000, 0x10000, CRC(7391dc8b) SHA1(2140b21e71871c2cb81cccd92f536763d955ec97) ) |
| 664 | 760 | ROM_LOAD16_BYTE( "136081-7029.05b", 0x00001, 0x10000, CRC(b3b88382) SHA1(0a0de330d7261c7eaa5aa705328d6c0c28d27536) ) |
| r7500 | r7501 | |
| 1093 | 1189 | static DRIVER_INIT( hydra ) { init_g1_common(machine, 0x078000, 116, 0); } |
| 1094 | 1190 | static DRIVER_INIT( hydrap ) { init_g1_common(machine, 0x000000, 0, 0); } |
| 1095 | 1191 | |
| 1096 | static DRIVER_INIT( pitfight7 ) { init_g1_common(machine, 0x038000, 112, 2); } | |
| 1097 | static DRIVER_INIT( pitfight ) { init_g1_common(machine, 0x038000, 111, 1); } | |
| 1192 | static DRIVER_INIT( pitfight9 ) { init_g1_common(machine, 0x038000, 114, 1); } | |
| 1193 | static DRIVER_INIT( pitfight7 ) { init_g1_common(machine, 0x038000, 112, 1); } | |
| 1194 | static DRIVER_INIT( pitfight ) { init_g1_common(machine, 0x038000, 111, 1); } | |
| 1098 | 1195 | static DRIVER_INIT( pitfightj ) { init_g1_common(machine, 0x038000, 113, 1); } |
| 1099 | 1196 | static DRIVER_INIT( pitfightb ) { init_g1_common(machine, 0x038000, -1, 1); } |
| 1100 | 1197 | |
| r7500 | r7501 | |
| 1109 | 1206 | GAME( 1990, hydrap, hydra, atarig1, hydra, hydrap, ROT0, "Atari Games", "Hydra (prototype 5/14/90)", GAME_SUPPORTS_SAVE ) |
| 1110 | 1207 | GAME( 1990, hydrap2, hydra, atarig1, hydra, hydrap, ROT0, "Atari Games", "Hydra (prototype 5/25/90)", GAME_SUPPORTS_SAVE ) |
| 1111 | 1208 | |
| 1112 | GAME( 1990, pitfight, 0, atarig1, pitfight, pitfight7,ROT0, "Atari Games", "Pit Fighter (rev 7)", GAME_SUPPORTS_SAVE ) | |
| 1113 | GAME( 1990, pitfight6, pitfight, atarig1, pitfight, pitfightj,ROT0, "Atari Games", "Pit Fighter (rev 6)", GAME_SUPPORTS_SAVE ) | |
| 1114 | GAME( 1990, pitfight5, pitfight, atarig1, pitfight, pitfight7,ROT0, "Atari Games", "Pit Fighter (rev 5)", GAME_SUPPORTS_SAVE ) | |
| 1115 | GAME( 1990, pitfight4, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 4)", GAME_SUPPORTS_SAVE ) | |
| 1116 | GAME( 1990, pitfight3, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 3)", GAME_SUPPORTS_SAVE ) | |
| 1117 | GAME( 1990, pitfightj, pitfight, atarig1, pitfightj,pitfightj,ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", GAME_SUPPORTS_SAVE ) | |
| 1118 | GAME( 1990, pitfightb, pitfight, atarig1, pitfight, pitfightb,ROT0, "Atari Games", "Pit Fighter (bootleg)", GAME_SUPPORTS_SAVE ) | |
| 1209 | GAME( 1990, pitfight, 0, atarig1, pitfight, pitfight9, ROT0, "Atari Games", "Pit Fighter (rev 9)", GAME_SUPPORTS_SAVE ) | |
| 1210 | GAME( 1990, pitfight7, pitfight, atarig1, pitfight, pitfight7, ROT0, "Atari Games", "Pit Fighter (rev 7)", GAME_SUPPORTS_SAVE ) | |
| 1211 | GAME( 1990, pitfight6, pitfight, atarig1, pitfight, pitfightj, ROT0, "Atari Games", "Pit Fighter (rev 6)", GAME_SUPPORTS_SAVE ) | |
| 1212 | GAME( 1990, pitfight5, pitfight, atarig1, pitfight, pitfight7, ROT0, "Atari Games", "Pit Fighter (rev 5)", GAME_SUPPORTS_SAVE ) | |
| 1213 | GAME( 1990, pitfight4, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 4)", GAME_SUPPORTS_SAVE ) | |
| 1214 | GAME( 1990, pitfight3, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 3)", GAME_SUPPORTS_SAVE ) | |
| 1215 | GAME( 1990, pitfightj, pitfight, atarig1, pitfightj,pitfightj, ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", GAME_SUPPORTS_SAVE ) | |
| 1216 | GAME( 1990, pitfightb, pitfight, atarig1, pitfight, pitfightb, ROT0, "Atari Games", "Pit Fighter (bootleg)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #include "cpu/z80/z80.h" |
| 15 | 15 | #include "sound/ay8910.h" |
| 16 | 16 | |
| 17 | typedef struct _albazc_state albazc_state; | |
| 18 | struct _albazc_state | |
| 17 | class albazc_state | |
| 19 | 18 | { |
| 19 | public: | |
| 20 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazc_state(machine)); } | |
| 21 | ||
| 22 | albazc_state(running_machine &machine) { } | |
| 23 | ||
| 20 | 24 | /* video-related */ |
| 21 | 25 | UINT8 * spriteram1; |
| 22 | 26 | UINT8 * spriteram2; |
| r7500 | r7501 | |
|---|---|---|
| 44 | 44 | #include "sound/okim6295.h" |
| 45 | 45 | #include "galaxi.lh" |
| 46 | 46 | |
| 47 | typedef struct _galaxi_state galaxi_state; | |
| 48 | struct _galaxi_state | |
| 47 | class galaxi_state | |
| 49 | 48 | { |
| 49 | public: | |
| 50 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, galaxi_state(machine)); } | |
| 51 | ||
| 52 | galaxi_state(running_machine &machine) { } | |
| 53 | ||
| 50 | 54 | /* memory pointers */ |
| 51 | 55 | UINT16 * bg1_ram; |
| 52 | 56 | UINT16 * bg2_ram; |
| r7500 | r7501 | |
|---|---|---|
| 322 | 322 | #define FNCYWLD_HACK 0 |
| 323 | 323 | |
| 324 | 324 | static WRITE16_HANDLER( semicom_soundcmd_w ); |
| 325 | static UINT16* tumblepb_mainram; | |
| 326 | UINT16* jumppop_control; | |
| 327 | UINT16* suprtrio_control; | |
| 328 | 325 | |
| 329 | 326 | /******************************************************************************/ |
| 330 | 327 | |
| 331 | 328 | static WRITE16_DEVICE_HANDLER( tumblepb_oki_w ) |
| 332 | 329 | { |
| 333 | if (mem_mask==0xffff) | |
| 330 | if (mem_mask == 0xffff) | |
| 334 | 331 | { |
| 335 | okim6295_w(device,0,data&0xff); | |
| 336 | //printf("tumbleb_oki_w %04x %04x\n",data,mem_mask); | |
| 332 | okim6295_w(device, 0, data & 0xff); | |
| 333 | //printf("tumbleb_oki_w %04x %04x\n", data, mem_mask); | |
| 337 | 334 | } |
| 338 | 335 | else |
| 339 | 336 | { |
| 340 | okim6295_w(device,0,(data>>8)&0xff); | |
| 341 | //printf("tumbleb_oki_w %04x %04x\n",data,mem_mask); | |
| 337 | okim6295_w(device, 0, (data >> 8) & 0xff); | |
| 338 | //printf("tumbleb_oki_w %04x %04x\n", data, mem_mask); | |
| 342 | 339 | } |
| 343 | 340 | /* STUFF IN OTHER BYTE TOO..*/ |
| 344 | 341 | } |
| r7500 | r7501 | |
| 351 | 348 | #ifdef UNUSED_FUNCTION |
| 352 | 349 | static WRITE16_HANDLER( tumblepb_sound_w ) |
| 353 | 350 | { |
| 354 | soundlatch_w(space,0,data & 0xff); | |
| 355 | cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); | |
| 351 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 352 | soundlatch_w(space, 0, data & 0xff); | |
| 353 | cpu_set_input_line(state->audiocpu, 0, HOLD_LINE); | |
| 356 | 354 | } |
| 357 | 355 | #endif |
| 358 | 356 | |
| 359 | 357 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 360 | 358 | { |
| 361 | soundlatch_w(space,0,data & 0xff); | |
| 362 | cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE ); | |
| 359 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 360 | soundlatch_w(space, 0, data & 0xff); | |
| 361 | cpu_set_input_line(state->audiocpu, 0, ASSERT_LINE); | |
| 363 | 362 | } |
| 364 | 363 | |
| 365 | 364 | /******************************************************************************/ |
| 366 | 365 | |
| 367 | 366 | static READ16_HANDLER( tumblepopb_controls_r ) |
| 368 | 367 | { |
| 369 | switch (offset<<1) | |
| 368 | switch (offset << 1) | |
| 370 | 369 | { |
| 371 | 370 | case 0: |
| 372 | 371 | return input_port_read(space->machine, "PLAYERS"); |
| r7500 | r7501 | |
| 451 | 450 | */ |
| 452 | 451 | |
| 453 | 452 | |
| 454 | ||
| 455 | static int tumblep_music_command; | |
| 456 | static int tumblep_music_bank; | |
| 457 | static int tumbleb2_music_is_playing; | |
| 458 | ||
| 459 | static void tumbleb2_playmusic(running_device *device) | |
| 453 | static void tumbleb2_playmusic( running_device *device ) | |
| 460 | 454 | { |
| 461 | int status = okim6295_r(device,0); | |
| 455 | tumbleb_state *state = (tumbleb_state *)device->machine->driver_data; | |
| 456 | int status = okim6295_r(device, 0); | |
| 462 | 457 | |
| 463 | if (t | |
| 458 | if (stat | |
| 464 | 459 | { |
| 465 | if ((status | |
| 460 | if (!BIT(status, 3 | |
| 466 | 461 | { |
| 467 | okim6295_w(device,0,0x80|tumblep_music_command); | |
| 468 | okim6295_w(device,0,0x00|0x82); | |
| 462 | okim6295_w(device, 0, 0x80 | state->music_command); | |
| 463 | okim6295_w(device, 0, 0x00 | 0x82); | |
| 469 | 464 | } |
| 470 | 465 | } |
| 471 | 466 | } |
| r7500 | r7501 | |
| 473 | 468 | |
| 474 | 469 | static INTERRUPT_GEN( tumbleb2_interrupt ) |
| 475 | 470 | { |
| 471 | tumbleb_state *state = (tumbleb_state *)device->machine->driver_data; | |
| 476 | 472 | cpu_set_input_line(device, 6, HOLD_LINE); |
| 477 | tumbleb2_playmusic( | |
| 473 | tumbleb2_playmusic(s | |
| 478 | 474 | } |
| 479 | 475 | |
| 480 | 476 | static const int tumbleb_sound_lookup[256] = { |
| r7500 | r7501 | |
| 498 | 494 | }; |
| 499 | 495 | |
| 500 | 496 | /* we use channels 1,2,3 for sound effects, and channel 4 for music */ |
| 501 | static void tumbleb2_set_music_bank(running_machine *machine, int bank) | |
| 497 | static void tumbleb2_set_music_bank( running_machine *machine, int bank ) | |
| 502 | 498 | { |
| 503 | 499 | UINT8 *oki = memory_region(machine, "oki"); |
| 504 | memcpy(&oki[0x38000], &oki[0x80000+0x38000+0x8000*bank],0x8000); | |
| 500 | memcpy(&oki[0x38000], &oki[0x80000 + 0x38000 + 0x8000 * bank], 0x8000); | |
| 505 | 501 | } |
| 506 | 502 | |
| 507 | static void tumbleb2_play_sound | |
| 503 | static void tumbleb2_play_sound | |
| 508 | 504 | { |
| 509 | int status = okim6295_r(device,0); | |
| 505 | int status = okim6295_r(device, 0); | |
| 510 | 506 | |
| 511 | if ((status | |
| 507 | if (!BIT(status, 0 | |
| 512 | 508 | { |
| 513 | okim6295_w(device,0,0x80|data); | |
| 514 | okim6295_w(device,0,0x00|0x12); | |
| 509 | okim6295_w(device, 0, 0x80 | data); | |
| 510 | okim6295_w(device, 0, 0x00 | 0x12); | |
| 515 | 511 | } |
| 516 | else if ((status | |
| 512 | else if (!BIT(status, 1 | |
| 517 | 513 | { |
| 518 | okim6295_w(device,0,0x80|data); | |
| 519 | okim6295_w(device,0,0x00|0x22); | |
| 514 | okim6295_w(device, 0, 0x80 | data); | |
| 515 | okim6295_w(device, 0, 0x00 | 0x22); | |
| 520 | 516 | } |
| 521 | else if ((status | |
| 517 | else if (!BIT(status, 2 | |
| 522 | 518 | { |
| 523 | okim6295_w(device,0,0x80|data); | |
| 524 | okim6295_w(device,0,0x00|0x42); | |
| 519 | okim6295_w(device, 0, 0x80 | data); | |
| 520 | okim6295_w(device, 0, 0x00 | 0x42); | |
| 525 | 521 | } |
| 526 | 522 | } |
| 527 | 523 | |
| r7500 | r7501 | |
| 537 | 533 | // bank 7 = how to play? |
| 538 | 534 | // bank 8 = boss??? |
| 539 | 535 | |
| 540 | static void process_tumbleb2_music_command(running_device *device, int data) | |
| 536 | static void process_tumbleb2_music_command( running_device *device, int data ) | |
| 541 | 537 | { |
| 542 | int status = okim6295_r(device,0); | |
| 538 | tumbleb_state *state = (tumbleb_state *)device->machine->driver_data; | |
| 539 | int status = okim6295_r(device, 0); | |
| 543 | 540 | |
| 544 | 541 | if (data == 1) // stop? |
| 545 | 542 | { |
| 546 | if ((status | |
| 543 | if (BIT(status, 3 | |
| 547 | 544 | { |
| 548 | okim6295_w(device,0,0x40); /* Stop playing music */ | |
| 549 | tumbleb2_music_is_playing = 0; | |
| 545 | okim6295_w(device, 0, 0x40); /* Stop playing music */ | |
| 546 | state->music_is_playing = 0; | |
| 550 | 547 | } |
| 551 | 548 | } |
| 552 | 549 | else |
| 553 | 550 | { |
| 554 | if (t | |
| 551 | if (stat | |
| 555 | 552 | { |
| 556 | tumbleb2_music_is_playing = data; | |
| 557 | okim6295_w(device,0,0x40); // stop the current music | |
| 553 | state->music_is_playing = data; | |
| 554 | okim6295_w(device, 0, 0x40); // stop the current music | |
| 558 | 555 | switch (data) |
| 559 | 556 | { |
| 560 | 557 | case 0x04: // map screen |
| 561 | tumblep_music_bank = 1; | |
| 562 | tumblep_music_command = 0x38; | |
| 558 | state->music_bank = 1; | |
| 559 | state->music_command = 0x38; | |
| 563 | 560 | break; |
| 564 | 561 | |
| 565 | 562 | case 0x05: // america |
| 566 | tumblep_music_bank = 6; | |
| 567 | tumblep_music_command = 0x38; | |
| 563 | state->music_bank = 6; | |
| 564 | state->music_command = 0x38; | |
| 568 | 565 | break; |
| 569 | 566 | |
| 570 | 567 | case 0x06: // asia |
| 571 | tumblep_music_bank = 2; | |
| 572 | tumblep_music_command = 0x38; | |
| 568 | state->music_bank = 2; | |
| 569 | state->music_command = 0x38; | |
| 573 | 570 | break; |
| 574 | 571 | |
| 575 | 572 | case 0x07: // africa/egypt -- don't seem to have a tune for this one |
| 576 | tumblep_music_bank = 4; | |
| 577 | tumblep_music_command = 0x38; | |
| 573 | state->music_bank = 4; | |
| 574 | state->music_command = 0x38; | |
| 578 | 575 | break; |
| 579 | 576 | |
| 580 | 577 | case 0x08: // antartica |
| 581 | tumblep_music_bank = 3; | |
| 582 | tumblep_music_command = 0x38; | |
| 578 | state->music_bank = 3; | |
| 579 | state->music_command = 0x38; | |
| 583 | 580 | break; |
| 584 | 581 | |
| 585 | 582 | case 0x09: // brazil / south america |
| 586 | tumblep_music_bank = 4; | |
| 587 | tumblep_music_command = 0x38; | |
| 583 | state->music_bank = 4; | |
| 584 | state->music_command = 0x38; | |
| 588 | 585 | break; |
| 589 | 586 | |
| 590 | 587 | case 0x0a: // japan -- don't seem to have a tune |
| 591 | tumblep_music_bank = 2; | |
| 592 | tumblep_music_command = 0x38; | |
| 588 | state->music_bank = 2; | |
| 589 | state->music_command = 0x38; | |
| 593 | 590 | break; |
| 594 | 591 | |
| 595 | 592 | case 0x0b: // australia |
| 596 | tumblep_music_bank = 5; | |
| 597 | tumblep_music_command = 0x38; | |
| 593 | state->music_bank = 5; | |
| 594 | state->music_command = 0x38; | |
| 598 | 595 | break; |
| 599 | 596 | |
| 600 | 597 | case 0x0c: // france/europe |
| 601 | tumblep_music_bank = 6; | |
| 602 | tumblep_music_command = 0x38; | |
| 598 | state->music_bank = 6; | |
| 599 | state->music_command = 0x38; | |
| 603 | 600 | break; |
| 604 | 601 | |
| 605 | 602 | case 0x0d: // how to play |
| 606 | tumblep_music_bank = 7; | |
| 607 | tumblep_music_command = 0x38; | |
| 603 | state->music_bank = 7; | |
| 604 | state->music_command = 0x38; | |
| 608 | 605 | break; |
| 609 | 606 | |
| 610 | 607 | case 0x0f: // stage clear |
| 611 | tumblep_music_bank = 0; | |
| 612 | tumblep_music_command = 0x33; | |
| 608 | state->music_bank = 0; | |
| 609 | state->music_command = 0x33; | |
| 613 | 610 | break; |
| 614 | 611 | |
| 615 | 612 | case 0x10: // boss stage |
| 616 | tumblep_music_bank = 8; | |
| 617 | tumblep_music_command = 0x38; | |
| 613 | state->music_bank = 8; | |
| 614 | state->music_command = 0x38; | |
| 618 | 615 | break; |
| 619 | 616 | |
| 620 | 617 | case 0x12: // world clear |
| 621 | tumblep_music_bank = 0; | |
| 622 | tumblep_music_command = 0x34; | |
| 618 | state->music_bank = 0; | |
| 619 | state->music_command = 0x34; | |
| 623 | 620 | break; |
| 624 | 621 | |
| 625 | 622 | default: // anything else.. |
| 626 | tumblep_music_bank = 8; | |
| 627 | tumblep_music_command = 0x38; | |
| 623 | state->music_bank = 8; | |
| 624 | state->music_command = 0x38; | |
| 628 | 625 | break; |
| 629 | 626 | } |
| 630 | tumbleb2_set_music_bank(device->machine, tumblep_music_bank); | |
| 627 | ||
| 628 | tumbleb2_set_music_bank(device->machine, state->music_bank); | |
| 631 | 629 | tumbleb2_playmusic(device); |
| 632 | ||
| 633 | 630 | } |
| 634 | ||
| 635 | ||
| 636 | 631 | } |
| 637 | 632 | } |
| 638 | 633 | |
| 639 | 634 | |
| 640 | 635 | static WRITE16_DEVICE_HANDLER( tumbleb2_soundmcu_w ) |
| 641 | 636 | { |
| 642 | int sound; | |
| 637 | int sound = tumbleb_sound_lookup[data & 0xff]; | |
| 643 | 638 | |
| 644 | sound = tumbleb_sound_lookup[data&0xff]; | |
| 645 | ||
| 646 | 639 | if (sound == 0x00) |
| 647 | 640 | { |
| 648 | 641 | /* pangpang has more commands than tumbleb2, extra sounds */ |
| 649 | //mame_printf_debug("Command %04x\n",data); | |
| 642 | //mame_printf_debug("Command %04x\n", data); | |
| 650 | 643 | } |
| 651 | 644 | else if (sound == -2) |
| 652 | 645 | { |
| r7500 | r7501 | |
| 666 | 659 | AM_RANGE(0x000000, 0x07ffff) AM_WRITEONLY /* To write levels modifications */ |
| 667 | 660 | #endif |
| 668 | 661 | AM_RANGE(0x100000, 0x100001) AM_READ(tumblepb_prot_r) AM_DEVWRITE("oki", tumblepb_oki_w) |
| 669 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 662 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 670 | 663 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 671 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_ | |
| 664 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 672 | 665 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY /* writes past the end of spriteram */ |
| 673 | 666 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 674 | 667 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 675 | 668 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM |
| 676 | 669 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(tumblepb_control_0_w) |
| 677 | AM_RANGE(0x320000, 0x320fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 678 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 670 | AM_RANGE(0x320000, 0x320fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 671 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 679 | 672 | AM_RANGE(0x340000, 0x3401ff) AM_WRITENOP /* Unused row scroll */ |
| 680 | 673 | AM_RANGE(0x340400, 0x34047f) AM_WRITENOP /* Unused col scroll */ |
| 681 | 674 | AM_RANGE(0x342000, 0x3421ff) AM_WRITENOP |
| r7500 | r7501 | |
| 690 | 683 | AM_RANGE(0x100000, 0x100003) AM_DEVREADWRITE8("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 691 | 684 | AM_RANGE(0x100004, 0x100005) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff) |
| 692 | 685 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 693 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_ | |
| 686 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 694 | 687 | AM_RANGE(0x160800, 0x16080f) AM_WRITEONLY /* goes slightly past the end of spriteram? */ |
| 695 | 688 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 696 | 689 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 697 | 690 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM |
| 698 | 691 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(tumblepb_control_0_w) |
| 699 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(fncywld_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 700 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fncywld_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 692 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(fncywld_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 693 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fncywld_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 701 | 694 | AM_RANGE(0x340000, 0x3401ff) AM_WRITENOP /* Unused row scroll */ |
| 702 | 695 | AM_RANGE(0x340400, 0x34047f) AM_WRITENOP /* Unused col scroll */ |
| 703 | 696 | AM_RANGE(0x342000, 0x3421ff) AM_WRITENOP |
| r7500 | r7501 | |
| 710 | 703 | { |
| 711 | 704 | return mame_rand(space->machine); |
| 712 | 705 | } |
| 706 | ||
| 713 | 707 | static ADDRESS_MAP_START( htchctch_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 714 | 708 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 715 | 709 | AM_RANGE(0x100000, 0x10000f) AM_READ(semibase_unknown_r) |
| 716 | 710 | AM_RANGE(0x100000, 0x100001) AM_WRITE(semicom_soundcmd_w) |
| 717 | 711 | AM_RANGE(0x100002, 0x100003) AM_WRITE(bcstory_tilebank_w) |
| 718 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 712 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 719 | 713 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 720 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE_ | |
| 714 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 721 | 715 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 722 | 716 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 723 | 717 | AM_RANGE(0x1a0000, 0x1a0fff) AM_RAM |
| 724 | 718 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(tumblepb_control_0_w) |
| 725 | AM_RANGE(0x320000, 0x321fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 726 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 719 | AM_RANGE(0x320000, 0x321fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 720 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 727 | 721 | AM_RANGE(0x341000, 0x342fff) AM_RAM // Extra ram? |
| 728 | 722 | ADDRESS_MAP_END |
| 729 | 723 | |
| 730 | 724 | |
| 731 | 725 | static ADDRESS_MAP_START( jumppop_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 732 | 726 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 733 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 727 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 734 | 728 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 735 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE_ | |
| 729 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 736 | 730 | AM_RANGE(0x180000, 0x180001) AM_NOP /* IRQ ack? */ |
| 737 | 731 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("PLAYERS") |
| 738 | 732 | AM_RANGE(0x180004, 0x180005) AM_READ_PORT("SYSTEM") |
| 739 | 733 | AM_RANGE(0x180006, 0x180007) AM_READ_PORT("DSW") |
| 740 | 734 | AM_RANGE(0x18000c, 0x18000d) AM_WRITE(jumppop_sound_w) |
| 741 | 735 | AM_RANGE(0x1a0000, 0x1a7fff) AM_RAM |
| 742 | AM_RANGE(0x300000, 0x303fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 743 | AM_RANGE(0x320000, 0x323fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 744 | AM_RANGE(0x380000, 0x38000f) AM_WRITEONLY AM_BASE(&jumppop_control) | |
| 736 | AM_RANGE(0x300000, 0x303fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 737 | AM_RANGE(0x320000, 0x323fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 738 | AM_RANGE(0x380000, 0x38000f) AM_WRITEONLY AM_BASE_MEMBER(tumbleb_state, control) | |
| 745 | 739 | ADDRESS_MAP_END |
| 746 | 740 | |
| 747 | 741 | static WRITE16_HANDLER( jumpkids_sound_w ) |
| 748 | 742 | { |
| 743 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 749 | 744 | soundlatch_w(space, 0, data & 0xff); |
| 750 | cpu | |
| 745 | cpu | |
| 751 | 746 | } |
| 752 | 747 | |
| 753 | ||
| 754 | 748 | static ADDRESS_MAP_START( suprtrio_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 755 | 749 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 756 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 757 | AM_RANGE(0xa00000, 0xa0000f) AM_RAM AM_BASE(&suprtrio_control) | |
| 758 | AM_RANGE(0xa20000, 0xa20fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 759 | AM_RANGE(0xa22000, 0xa22fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 750 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE_MEMBER(tumbleb_state, spriteram, spriteram_size) | |
| 751 | AM_RANGE(0xa00000, 0xa0000f) AM_RAM AM_BASE_MEMBER(tumbleb_state, control) | |
| 752 | AM_RANGE(0xa20000, 0xa20fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 753 | AM_RANGE(0xa22000, 0xa22fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 760 | 754 | AM_RANGE(0xcf0000, 0xcf05ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 761 | 755 | AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("PLAYERS") AM_WRITE(suprtrio_tilebank_w) |
| 762 | 756 | AM_RANGE(0xe40000, 0xe40001) AM_READ_PORT("SYSTEM") |
| r7500 | r7501 | |
| 767 | 761 | |
| 768 | 762 | static ADDRESS_MAP_START( pangpang_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 769 | 763 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 770 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 764 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 771 | 765 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 772 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_ | |
| 766 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 773 | 767 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY // writes past the end of spriteram |
| 774 | 768 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 775 | 769 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM |
| 776 | 770 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(tumblepb_control_0_w) |
| 777 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(pangpang_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 778 | AM_RANGE(0x340000, 0x341fff) AM_RAM_WRITE(pangpang_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 771 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(pangpang_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 772 | AM_RANGE(0x340000, 0x341fff) AM_RAM_WRITE(pangpang_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 779 | 773 | ADDRESS_MAP_END |
| 780 | 774 | |
| 781 | 775 | |
| r7500 | r7501 | |
| 785 | 779 | { |
| 786 | 780 | if (ACCESSING_BITS_0_7) |
| 787 | 781 | { |
| 788 | soundlatch_w(space,0,data & 0xff); | |
| 782 | soundlatch_w(space, 0, data & 0xff); | |
| 789 | 783 | // needed for Super Trio which reads the sound with polling |
| 790 | // | |
| 784 | // | |
| 791 | 785 | cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(20)); |
| 792 | 786 | |
| 793 | 787 | } |
| r7500 | r7501 | |
| 804 | 798 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 805 | 799 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w) |
| 806 | 800 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_r, okim6295_w) |
| 807 | // | |
| 801 | // | |
| 808 | 802 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) |
| 809 | 803 | AM_RANGE(0xf00e, 0xf00e) AM_WRITE(oki_sound_bank_w) |
| 810 | 804 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 813 | 807 | AM_RANGE(0x0000, 0xcfff) AM_ROM |
| 814 | 808 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 815 | 809 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_r, okim6295_w) |
| 816 | // | |
| 810 | // | |
| 817 | 811 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) |
| 818 | 812 | AM_RANGE(0xf00e, 0xf00e) AM_WRITE(oki_sound_bank_w) |
| 819 | 813 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 831 | 825 | |
| 832 | 826 | static READ8_HANDLER(jumppop_z80latch_r) |
| 833 | 827 | { |
| 834 | cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE); | |
| 828 | tumbleb_state *state = (tumbleb_state *)space->machine->driver_data; | |
| 829 | cpu_set_input_line(state->audiocpu, 0, CLEAR_LINE); | |
| 835 | 830 | return soundlatch_r(space, 0); |
| 836 | 831 | } |
| 837 | 832 | |
| r7500 | r7501 | |
| 850 | 845 | static ADDRESS_MAP_START( jumpkids_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 851 | 846 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 852 | 847 | AM_RANGE(0x100000, 0x100001) AM_WRITE(jumpkids_sound_w) |
| 853 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 848 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 854 | 849 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 855 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_ | |
| 850 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 856 | 851 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY /* writes past the end of spriteram */ |
| 857 | 852 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 858 | 853 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 859 | 854 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM |
| 860 | 855 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(tumblepb_control_0_w) |
| 861 | AM_RANGE(0x320000, 0x320fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 862 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 856 | AM_RANGE(0x320000, 0x320fff) AM_WRITE(tumblepb_pf1_data_w) AM_BASE_MEMBER(tumbleb_state, pf1_data) | |
| 857 | AM_RANGE(0x322000, 0x322fff) AM_WRITE(tumblepb_pf2_data_w) AM_BASE_MEMBER(tumbleb_state, pf2_data) | |
| 863 | 858 | AM_RANGE(0x340000, 0x3401ff) AM_WRITENOP /* Unused row scroll */ |
| 864 | 859 | AM_RANGE(0x340400, 0x34047f) AM_WRITENOP /* Unused col scroll */ |
| 865 | 860 | AM_RANGE(0x342000, 0x3421ff) AM_WRITENOP |
| r7500 | r7501 | |
| 872 | 867 | UINT8* sound2 = memory_region(space->machine, "oki2"); |
| 873 | 868 | int bank = data & 0x03; |
| 874 | 869 | |
| 875 | memcpy | |
| 870 | memcpy | |
| 876 | 871 | } |
| 877 | 872 | |
| 878 | 873 | static ADDRESS_MAP_START( jumpkids_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r7500 | r7501 | |
| 1988 | 1983 | /******************************************************************************/ |
| 1989 | 1984 | |
| 1990 | 1985 | |
| 1986 | static MACHINE_START( tumbleb ) | |
| 1987 | { | |
| 1988 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 1989 | ||
| 1990 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 1991 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 1992 | state->oki = devtag_get_device(machine, "oki"); | |
| 1993 | ||
| 1994 | state_save_register_global(machine, state->music_command); | |
| 1995 | state_save_register_global(machine, state->music_bank); | |
| 1996 | state_save_register_global(machine, state->music_is_playing); | |
| 1997 | ||
| 1998 | state_save_register_global_array(machine, state->control_0); | |
| 1999 | state_save_register_global(machine, state->flipscreen); | |
| 2000 | state_save_register_global(machine, state->tilebank); | |
| 2001 | } | |
| 2002 | ||
| 2003 | static MACHINE_RESET( tumbleb ) | |
| 2004 | { | |
| 2005 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 2006 | ||
| 2007 | state->music_command = 0; | |
| 2008 | state->music_bank = 0; | |
| 2009 | state->music_is_playing = 0; | |
| 2010 | state->flipscreen = 0; | |
| 2011 | state->tilebank = 0; | |
| 2012 | memset(state->control_0, 0, ARRAY_LENGTH(state->control_0)); | |
| 2013 | } | |
| 2014 | ||
| 1991 | 2015 | static MACHINE_DRIVER_START( tumblepb ) |
| 1992 | 2016 | |
| 2017 | /* driver data */ | |
| 2018 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2019 | ||
| 1993 | 2020 | /* basic machine hardware */ |
| 1994 | 2021 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 1995 | 2022 | MDRV_CPU_PROGRAM_MAP(tumblepopb_main_map) |
| 1996 | 2023 | MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 1997 | 2024 | |
| 2025 | MDRV_MACHINE_START(tumbleb) | |
| 2026 | MDRV_MACHINE_RESET(tumbleb) | |
| 2027 | ||
| 1998 | 2028 | /* video hardware */ |
| 1999 | 2029 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2000 | 2030 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 2020 | 2050 | |
| 2021 | 2051 | static MACHINE_DRIVER_START( tumbleb2 ) |
| 2022 | 2052 | |
| 2053 | /* driver data */ | |
| 2054 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2055 | ||
| 2023 | 2056 | /* basic machine hardware */ |
| 2024 | 2057 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 2025 | 2058 | MDRV_CPU_PROGRAM_MAP(tumblepopb_main_map) |
| 2026 | 2059 | MDRV_CPU_VBLANK_INT("screen", tumbleb2_interrupt) |
| 2027 | 2060 | |
| 2061 | MDRV_MACHINE_START(tumbleb) | |
| 2062 | MDRV_MACHINE_RESET(tumbleb) | |
| 2063 | ||
| 2028 | 2064 | /* video hardware */ |
| 2029 | 2065 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2030 | 2066 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 2049 | 2085 | |
| 2050 | 2086 | static MACHINE_DRIVER_START( jumpkids ) |
| 2051 | 2087 | |
| 2088 | /* driver data */ | |
| 2089 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2090 | ||
| 2052 | 2091 | /* basic machine hardware */ |
| 2053 | 2092 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 2054 | 2093 | MDRV_CPU_PROGRAM_MAP(jumpkids_main_map) |
| r7500 | r7501 | |
| 2058 | 2097 | MDRV_CPU_ADD("audiocpu", Z80, 8000000/2) |
| 2059 | 2098 | MDRV_CPU_PROGRAM_MAP(jumpkids_sound_map) |
| 2060 | 2099 | |
| 2100 | MDRV_MACHINE_START(tumbleb) | |
| 2101 | MDRV_MACHINE_RESET(tumbleb) | |
| 2102 | ||
| 2061 | 2103 | /* video hardware */ |
| 2062 | 2104 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2063 | 2105 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 2081 | 2123 | MACHINE_DRIVER_END |
| 2082 | 2124 | |
| 2083 | 2125 | static MACHINE_DRIVER_START( fncywld ) |
| 2126 | ||
| 2127 | /* driver data */ | |
| 2128 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2129 | ||
| 2084 | 2130 | /* basic machine hardware */ |
| 2085 | 2131 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 2086 | 2132 | MDRV_CPU_PROGRAM_MAP(fncywld_main_map) |
| 2087 | 2133 | MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 2088 | 2134 | |
| 2135 | MDRV_MACHINE_START(tumbleb) | |
| 2136 | MDRV_MACHINE_RESET(tumbleb) | |
| 2137 | ||
| 2089 | 2138 | /* video hardware */ |
| 2090 | 2139 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2091 | 2140 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 2115 | 2164 | |
| 2116 | 2165 | |
| 2117 | 2166 | |
| 2118 | static void semicom_irqhandler(running_device *device, int irq) | |
| 2167 | static void semicom_irqhandler( running_device *device, int irq ) | |
| 2119 | 2168 | { |
| 2120 | cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2169 | tumbleb_state *state = (tumbleb_state *)device->machine->driver_data; | |
| 2170 | cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2121 | 2171 | } |
| 2122 | 2172 | |
| 2123 | 2173 | |
| r7500 | r7501 | |
| 2128 | 2178 | |
| 2129 | 2179 | static MACHINE_RESET (htchctch) |
| 2130 | 2180 | { |
| 2181 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 2182 | ||
| 2131 | 2183 | /* copy protection data every reset */ |
| 2132 | ||
| 2133 | 2184 | UINT16 *PROTDATA = (UINT16*)memory_region(machine, "user1"); |
| 2134 | 2185 | int i, len = memory_region_length(machine, "user1"); |
| 2135 | 2186 | |
| 2136 | for (i = 0;i < len/2;i++) | |
| 2137 | tumblepb_mainram[0x000/2 + i] = PROTDATA[i]; | |
| 2187 | for (i = 0; i < len / 2; i++) | |
| 2188 | state->mainram[0x000/2 + i] = PROTDATA[i]; | |
| 2138 | 2189 | |
| 2190 | MACHINE_RESET_CALL(tumbleb); | |
| 2139 | 2191 | } |
| 2140 | 2192 | |
| 2141 | 2193 | static MACHINE_DRIVER_START( htchctch ) |
| 2194 | ||
| 2195 | /* driver data */ | |
| 2196 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2197 | ||
| 2142 | 2198 | /* basic machine hardware */ |
| 2143 | 2199 | MDRV_CPU_ADD("maincpu", M68000, 15000000) /* verified */ |
| 2144 | 2200 | MDRV_CPU_PROGRAM_MAP(htchctch_main_map) |
| r7500 | r7501 | |
| 2147 | 2203 | MDRV_CPU_ADD("audiocpu", Z80, 15000000/4) /* verified on dquizgo */ |
| 2148 | 2204 | MDRV_CPU_PROGRAM_MAP(semicom_sound_map) |
| 2149 | 2205 | |
| 2150 | MDRV_MACHINE_RESET ( htchctch ) | |
| 2206 | MDRV_MACHINE_START(tumbleb) | |
| 2207 | MDRV_MACHINE_RESET(htchctch) | |
| 2151 | 2208 | |
| 2152 | 2209 | /* video hardware */ |
| 2153 | 2210 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 2184 | 2241 | |
| 2185 | 2242 | static MACHINE_DRIVER_START( bcstory ) |
| 2186 | 2243 | MDRV_IMPORT_FROM(htchctch) |
| 2187 | MDRV_VIDEO_UPDATE( | |
| 2244 | MDRV_VIDEO_UPDATE( | |
| 2188 | 2245 | |
| 2189 | 2246 | MDRV_SOUND_REPLACE("ymsnd", YM2151, 3427190) |
| 2190 | 2247 | MDRV_SOUND_CONFIG(semicom_ym2151_interface) |
| r7500 | r7501 | |
| 2214 | 2271 | MACHINE_DRIVER_END |
| 2215 | 2272 | |
| 2216 | 2273 | static MACHINE_DRIVER_START( jumppop ) |
| 2274 | ||
| 2275 | /* driver data */ | |
| 2276 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2277 | ||
| 2217 | 2278 | /* basic machine hardware */ |
| 2218 | 2279 | MDRV_CPU_ADD("maincpu", M68000, 16000000) |
| 2219 | 2280 | MDRV_CPU_PROGRAM_MAP(jumppop_main_map) |
| r7500 | r7501 | |
| 2224 | 2285 | MDRV_CPU_IO_MAP(jumppop_sound_io_map) |
| 2225 | 2286 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1953) /* measured */ |
| 2226 | 2287 | |
| 2288 | MDRV_MACHINE_START(tumbleb) | |
| 2289 | MDRV_MACHINE_RESET(tumbleb) | |
| 2290 | ||
| 2227 | 2291 | /* video hardware */ |
| 2228 | 2292 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2229 | 2293 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 2252 | 2316 | |
| 2253 | 2317 | static MACHINE_DRIVER_START( suprtrio ) |
| 2254 | 2318 | |
| 2319 | /* driver data */ | |
| 2320 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2321 | ||
| 2255 | 2322 | /* basic machine hardware */ |
| 2256 | 2323 | MDRV_CPU_ADD("maincpu", M68000, 14000000) /* 14mhz should be correct, but lots of sprite flicker later in game */ |
| 2257 | 2324 | MDRV_CPU_PROGRAM_MAP(suprtrio_main_map) |
| r7500 | r7501 | |
| 2260 | 2327 | MDRV_CPU_ADD("audiocpu", Z80, 8000000) |
| 2261 | 2328 | MDRV_CPU_PROGRAM_MAP(suprtrio_sound_map) |
| 2262 | 2329 | |
| 2330 | MDRV_MACHINE_START(tumbleb) | |
| 2331 | MDRV_MACHINE_RESET(tumbleb) | |
| 2332 | ||
| 2263 | 2333 | /* video hardware */ |
| 2264 | 2334 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2265 | 2335 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 2285 | 2355 | |
| 2286 | 2356 | static MACHINE_DRIVER_START( pangpang ) |
| 2287 | 2357 | |
| 2358 | /* driver data */ | |
| 2359 | MDRV_DRIVER_DATA(tumbleb_state) | |
| 2360 | ||
| 2288 | 2361 | /* basic machine hardware */ |
| 2289 | 2362 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 2290 | 2363 | MDRV_CPU_PROGRAM_MAP(pangpang_main_map) |
| 2291 | 2364 | MDRV_CPU_VBLANK_INT("screen", tumbleb2_interrupt) |
| 2292 | 2365 | |
| 2366 | MDRV_MACHINE_START(tumbleb) | |
| 2367 | MDRV_MACHINE_RESET(tumbleb) | |
| 2368 | ||
| 2293 | 2369 | /* video hardware */ |
| 2294 | 2370 | MDRV_SCREEN_ADD("screen", RASTER) |
| 2295 | 2371 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 3255 | 3331 | int i; |
| 3256 | 3332 | |
| 3257 | 3333 | /* gfx data is in the wrong order */ |
| 3258 | for (i = 0;i < len;i++) | |
| 3334 | for (i = 0; i < len; i++) | |
| 3259 | 3335 | { |
| 3260 | 3336 | if ((i & 0x20) == 0) |
| 3261 | 3337 | { |
| r7500 | r7501 | |
| 3263 | 3339 | } |
| 3264 | 3340 | } |
| 3265 | 3341 | /* low/high half are also swapped */ |
| 3266 | for (i = 0;i < len/2;i++) | |
| 3342 | for (i = 0; i < len/2; i++) | |
| 3267 | 3343 | { |
| 3268 | 3344 | int t = rom[i]; rom[i] = rom[i + len/2]; rom[i + len/2] = t; |
| 3269 | 3345 | } |
| r7500 | r7501 | |
| 3315 | 3391 | } |
| 3316 | 3392 | |
| 3317 | 3393 | |
| 3318 | ||
| 3319 | ||
| 3320 | 3394 | static READ16_HANDLER( bcstory_1a0_read ) |
| 3321 | 3395 | { |
| 3322 | ||
| 3323 | 3396 | //mame_printf_debug("bcstory_io %06x\n",cpu_get_pc(space->cpu)); |
| 3324 | 3397 | |
| 3325 | 3398 | if (cpu_get_pc(space->cpu)==0x0560) return 0x1a0; |
| r7500 | r7501 | |
| 3336 | 3409 | static DRIVER_INIT( htchctch ) |
| 3337 | 3410 | { |
| 3338 | 3411 | |
| 3412 | tumbleb_state *state = (tumbleb_state *)machine->driver_data; | |
| 3339 | 3413 | // UINT16 *HCROM = (UINT16*)memory_region(machine, "maincpu"); |
| 3340 | 3414 | UINT16 *PROTDATA = (UINT16*)memory_region(machine, "user1"); |
| 3341 | 3415 | int i, len = memory_region_length(machine, "user1"); |
| r7500 | r7501 | |
| 3347 | 3421 | // }; |
| 3348 | 3422 | |
| 3349 | 3423 | |
| 3350 | // for (i = 0;i < sizeof(htchctch_mcu68k)/sizeof(htchctch_mcu68k[0]);i++) | |
| 3351 | // tumblepb_mainram[0x000/2 + i] = htchctch_mcu68k[i]; | |
| 3424 | // for (i = 0; i < sizeof(htchctch_mcu68k) / sizeof(htchctch_mcu68k[0]); i++) | |
| 3425 | // state->mainram[0x000/2 + i] = htchctch_mcu68k[i]; | |
| 3352 | 3426 | |
| 3353 | for (i = 0;i < len/2;i++) | |
| 3354 | tumblepb_mainram[0x000/2 + i] = PROTDATA[i]; | |
| 3427 | for (i = 0; i < len / 2; i++) | |
| 3428 | state->mainram[0x000/2 + i] = PROTDATA[i]; | |
| 3355 | 3429 | |
| 3356 | 3430 | |
| 3357 | 3431 | |
| r7500 | r7501 | |
| 3595 | 3669 | int i; |
| 3596 | 3670 | |
| 3597 | 3671 | /* decrypt main ROMs */ |
| 3598 | memcpy(buf,rom,0x80000); | |
| 3599 | for (i = 0;i < 0x40000;i++) | |
| 3672 | memcpy(buf, rom, 0x80000); | |
| 3673 | for (i = 0; i < 0x40000; i++) | |
| 3600 | 3674 | { |
| 3601 | 3675 | int j = i ^ 0x06; |
| 3602 | 3676 | if ((i & 1) == 0) j ^= 0x02; |
| r7500 | r7501 | |
| 3613 | 3687 | int i; |
| 3614 | 3688 | |
| 3615 | 3689 | /* decrypt tiles */ |
| 3616 | memcpy(buf,rom,0x100000); | |
| 3617 | for (i = 0;i < 0x80000;i++) | |
| 3690 | memcpy(buf, rom, 0x100000); | |
| 3691 | for (i = 0; i < 0x80000; i++) | |
| 3618 | 3692 | { |
| 3619 | 3693 | int j = i ^ 0x02; |
| 3620 | 3694 | if (i & 1) j ^= 0x04; |
| r7500 | r7501 | |
| 3656 | 3730 | |
| 3657 | 3731 | /******************************************************************************/ |
| 3658 | 3732 | |
| 3659 | GAME( 1991, tumbleb, tumblep, tumblepb, tumblepb, tumblepb, ROT0, "bootleg", "Tumble Pop (bootleg set 1)", GAME_IMPERFECT_SOUND ) | |
| 3660 | GAME( 1991, tumbleb2, tumblep, tumbleb2, tumblepb, tumbleb2, ROT0, "bootleg", "Tumble Pop (bootleg set 2)", GAME_IMPERFECT_SOUND ) // PIC is protected, sound simulation not 100% | |
| 3661 | GAME( 1993, jumpkids, 0, jumpkids, tumblepb, jumpkids, ROT0, "Comad", "Jump Kids", 0 ) | |
| 3662 | GAME( 1994, metlsavr, 0, metlsavr, metlsavr, chokchok, ROT0, "First Amusement", "Metal Saver", 0 ) | |
| 3663 | GAME( 1994, pangpang, 0, pangpang, tumblepb, tumbleb2, ROT0, "Dong Gue La Mi Ltd.", "Pang Pang", GAME_IMPERFECT_SOUND ) // PIC is protected, sound simulation not 100% | |
| 3664 | GAME( 1994, suprtrio, 0, suprtrio, suprtrio, suprtrio, ROT0, "Gameace", "Super Trio", 0 ) | |
| 3733 | GAME( 1991, tumbleb, tumblep, tumblepb, tumblepb, tumblepb, ROT0, "bootleg", "Tumble Pop (bootleg set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 3734 | GAME( 1991, tumbleb2, tumblep, tumbleb2, tumblepb, tumbleb2, ROT0, "bootleg", "Tumble Pop (bootleg set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% | |
| 3735 | GAME( 1993, jumpkids, 0, jumpkids, tumblepb, jumpkids, ROT0, "Comad", "Jump Kids", GAME_SUPPORTS_SAVE ) | |
| 3736 | GAME( 1994, metlsavr, 0, metlsavr, metlsavr, chokchok, ROT0, "First Amusement", "Metal Saver", GAME_SUPPORTS_SAVE ) | |
| 3737 | GAME( 1994, pangpang, 0, pangpang, tumblepb, tumbleb2, ROT0, "Dong Gue La Mi Ltd.", "Pang Pang", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% | |
| 3738 | GAME( 1994, suprtrio, 0, suprtrio, suprtrio, suprtrio, ROT0, "Gameace", "Super Trio", GAME_SUPPORTS_SAVE ) | |
| 3665 | 3739 | // Should also be 'Magicball Fighting' (c)1994 see http://kmrb.or.kr/Game_Image/1999/%EC%A0%9C1248%ED%98%B8.jpg |
| 3666 | GAME( 1995, htchctch, 0, htchctch, htchctch, htchctch, ROT0, "SemiCom", "Hatch Catch" , 0 ) // not 100% sure about gfx offsets | |
| 3667 | GAME( 1995, cookbib, 0, cookbib, cookbib, htchctch, ROT0, "SemiCom", "Cookie & Bibi" , 0 ) // not 100% sure about gfx offsets | |
| 3668 | GAME( 1995, chokchok, 0, cookbib, chokchok, chokchok, ROT0, "SemiCom", "Choky! Choky!", GAME_IMPERFECT_GRAPHICS ) // corruption during attract mode (tmap disable?) | |
| 3669 | GAME( 1995, wlstar, 0, cookbib, wlstar, wlstar, ROT0, "Mijin", "Wonder League Star - Sok-Magicball Fighting (Korea)", 0) // translates to 'Wonder League Star - Return of Magicball Fighting' | |
| 3670 | GAME( 1996, wondl96, 0, cookbib, wondl96, wlstar, ROT0, "SemiCom", "Wonder League '96 (Korea)", 0) | |
| 3671 | GAME( 1996, fncywld, 0, fncywld, fncywld, fncywld, ROT0, "Unico", "Fancy World - Earth of Crisis" , 0 ) // game says 1996, testmode 1995? | |
| 3672 | GAME( 1996, sdfight, 0, sdfight, sdfight, bcstory, ROT0, "SemiCom", "SD Fighters (Korea)", 0) | |
| 3673 | GAME( 1997, bcstry, 0, bcstory, bcstory, bcstory, ROT0, "SemiCom", "B.C. Story (set 1)", GAME_IMPERFECT_GRAPHICS) // gfx offsets? | |
| 3674 | GAME( 1997, bcstrya, bcstry, bcstory, bcstory, bcstory, ROT0, "SemiCom", "B.C. Story (set 2)", GAME_IMPERFECT_GRAPHICS) // gfx offsets? | |
| 3675 | GAME( 1997, semibase, 0, semibase, semibase, bcstory, ROT0, "SemiCom", "MuHanSeungBu (SemiCom Baseball) (Korea)", GAME_IMPERFECT_GRAPHICS)// sprite offsets.. | |
| 3676 | GAME( 1998, dquizgo, 0, cookbib, dquizgo, dquizgo, ROT0, "SemiCom", "Date Quiz Go Go (Korea)", GAME_IMPERFECT_GRAPHICS) // check layer offsets | |
| 3677 | GAME( 2001, jumppop, 0, jumppop, jumppop, 0, ORIENTATION_FLIP_X, "ESD", "Jumping Pop", 0 ) | |
| 3740 | GAME( 1995, htchctch, 0, htchctch, htchctch, htchctch, ROT0, "SemiCom", "Hatch Catch" , GAME_SUPPORTS_SAVE ) // not 100% sure about gfx offsets | |
| 3741 | GAME( 1995, cookbib, 0, cookbib, cookbib, htchctch, ROT0, "SemiCom", "Cookie & Bibi" , GAME_SUPPORTS_SAVE ) // not 100% sure about gfx offsets | |
| 3742 | GAME( 1995, chokchok, 0, cookbib, chokchok, chokchok, ROT0, "SemiCom", "Choky! Choky!", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // corruption during attract mode (tmap disable?) | |
| 3743 | GAME( 1995, wlstar, 0, cookbib, wlstar, wlstar, ROT0, "Mijin", "Wonder League Star - Sok-Magicball Fighting (Korea)", GAME_SUPPORTS_SAVE ) // translates to 'Wonder League Star - Return of Magicball Fighting' | |
| 3744 | GAME( 1996, wondl96, 0, cookbib, wondl96, wlstar, ROT0, "SemiCom", "Wonder League '96 (Korea)", GAME_SUPPORTS_SAVE ) | |
| 3745 | GAME( 1996, fncywld, 0, fncywld, fncywld, fncywld, ROT0, "Unico", "Fancy World - Earth of Crisis" , GAME_SUPPORTS_SAVE ) // game says 1996, testmode 1995? | |
| 3746 | GAME( 1996, sdfight, 0, sdfight, sdfight, bcstory, ROT0, "SemiCom", "SD Fighters (Korea)", GAME_SUPPORTS_SAVE ) | |
| 3747 | GAME( 1997, bcstry, 0, bcstory, bcstory, bcstory, ROT0, "SemiCom", "B.C. Story (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets? | |
| 3748 | GAME( 1997, bcstrya, bcstry, bcstory, bcstory, bcstory, ROT0, "SemiCom", "B.C. Story (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets? | |
| 3749 | GAME( 1997, semibase, 0, semibase, semibase, bcstory, ROT0, "SemiCom", "MuHanSeungBu (SemiCom Baseball) (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )// sprite offsets.. | |
| 3750 | GAME( 1998, dquizgo, 0, cookbib, dquizgo, dquizgo, ROT0, "SemiCom", "Date Quiz Go Go (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // check layer offsets | |
| 3751 | GAME( 2001, jumppop, 0, jumppop, jumppop, 0, ORIENTATION_FLIP_X, "ESD", "Jumping Pop", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /***************************************************************************** |
| 2 | 2 | |
| 3 | Momoko 120% (c) 1986 Jaleco | |
| 3 | Momoko 120% (c) 1986 Jaleco | |
| 4 | 4 | |
| 5 | 5 | Driver by Uki |
| 6 | 6 | |
| r7500 | r7501 | |
| 44 | 44 | #include "emu.h" |
| 45 | 45 | #include "cpu/z80/z80.h" |
| 46 | 46 | #include "sound/2203intf.h" |
| 47 | #include "includes/momoko.h" | |
| 47 | 48 | |
| 48 | extern UINT8 *momoko_bg_scrollx; | |
| 49 | extern UINT8 *momoko_bg_scrolly; | |
| 50 | 49 | |
| 51 | VIDEO_UPDATE( momoko ); | |
| 52 | ||
| 53 | WRITE8_HANDLER( momoko_fg_scrollx_w ); | |
| 54 | WRITE8_HANDLER( momoko_fg_scrolly_w ); | |
| 55 | WRITE8_HANDLER( momoko_text_scrolly_w ); | |
| 56 | WRITE8_HANDLER( momoko_text_mode_w ); | |
| 57 | WRITE8_HANDLER( momoko_bg_scrollx_w ); | |
| 58 | WRITE8_HANDLER( momoko_bg_scrolly_w ); | |
| 59 | WRITE8_HANDLER( momoko_flipscreen_w ); | |
| 60 | WRITE8_HANDLER( momoko_fg_select_w); | |
| 61 | WRITE8_HANDLER( momoko_bg_select_w); | |
| 62 | WRITE8_HANDLER( momoko_bg_priority_w); | |
| 63 | ||
| 64 | 50 | static WRITE8_HANDLER( momoko_bg_read_bank_w ) |
| 65 | 51 | { |
| 66 | UINT8 *BG_MAP = memory_region(space->machine, "user1"); | |
| 67 | int bank_address = (data & 0x1f) * 0x1000; | |
| 68 | memory_set_bankptr(space->machine, "bank1", &BG_MAP[bank_address]); | |
| 52 | memory_set_bank(space->machine, "bank1", data & 0x1f); | |
| 69 | 53 | } |
| 70 | 54 | |
| 71 | 55 | /****************************************************************************/ |
| r7500 | r7501 | |
| 73 | 57 | static ADDRESS_MAP_START( momoko_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 74 | 58 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 75 | 59 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 76 | AM_RANGE(0xd064, 0xd0ff) AM_RAM AM_BASE_SIZE_ | |
| 60 | AM_RANGE(0xd064, 0xd0ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 77 | 61 | AM_RANGE(0xd400, 0xd400) AM_READ_PORT("IN0") AM_WRITENOP /* interrupt ack? */ |
| 78 | 62 | AM_RANGE(0xd402, 0xd402) AM_READ_PORT("IN1") AM_WRITE(momoko_flipscreen_w) |
| 79 | 63 | AM_RANGE(0xd404, 0xd404) AM_WRITE(watchdog_reset_w) |
| r7500 | r7501 | |
| 83 | 67 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(momoko_fg_scrolly_w) |
| 84 | 68 | AM_RANGE(0xdc01, 0xdc01) AM_WRITE(momoko_fg_scrollx_w) |
| 85 | 69 | AM_RANGE(0xdc02, 0xdc02) AM_WRITE(momoko_fg_select_w) |
| 86 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE_ | |
| 70 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 87 | 71 | AM_RANGE(0xe800, 0xe800) AM_WRITE(momoko_text_scrolly_w) |
| 88 | 72 | AM_RANGE(0xe801, 0xe801) AM_WRITE(momoko_text_mode_w) |
| 89 | 73 | AM_RANGE(0xf000, 0xffff) AM_ROMBANK("bank1") |
| 90 | AM_RANGE(0xf000, 0xf001) AM_WRITE(momoko_bg_scrolly_w) AM_BASE(&momoko_bg_scrolly) | |
| 91 | AM_RANGE(0xf002, 0xf003) AM_WRITE(momoko_bg_scrollx_w) AM_BASE(&momoko_bg_scrollx) | |
| 74 | AM_RANGE(0xf000, 0xf001) AM_WRITE(momoko_bg_scrolly_w) AM_BASE_MEMBER(momoko_state, bg_scrolly) | |
| 75 | AM_RANGE(0xf002, 0xf003) AM_WRITE(momoko_bg_scrollx_w) AM_BASE_MEMBER(momoko_state, bg_scrollx) | |
| 92 | 76 | AM_RANGE(0xf004, 0xf004) AM_WRITE(momoko_bg_read_bank_w) |
| 93 | 77 | AM_RANGE(0xf006, 0xf006) AM_WRITE(momoko_bg_select_w) |
| 94 | 78 | AM_RANGE(0xf007, 0xf007) AM_WRITE(momoko_bg_priority_w) |
| r7500 | r7501 | |
| 241 | 225 | NULL |
| 242 | 226 | }; |
| 243 | 227 | |
| 228 | static MACHINE_START( momoko ) | |
| 229 | { | |
| 230 | momoko_state *state = (momoko_state *)machine->driver_data; | |
| 231 | UINT8 *BG_MAP = memory_region(machine, "user1"); | |
| 232 | ||
| 233 | memory_configure_bank(machine, "bank1", 0, 32, &BG_MAP[0x0000], 0x1000); | |
| 234 | ||
| 235 | state_save_register_global(machine, state->fg_scrollx); | |
| 236 | state_save_register_global(machine, state->fg_scrolly); | |
| 237 | state_save_register_global(machine, state->fg_select); | |
| 238 | state_save_register_global(machine, state->text_scrolly); | |
| 239 | state_save_register_global(machine, state->text_mode); | |
| 240 | state_save_register_global(machine, state->bg_select); | |
| 241 | state_save_register_global(machine, state->bg_priority); | |
| 242 | state_save_register_global(machine, state->bg_mask); | |
| 243 | state_save_register_global(machine, state->fg_mask); | |
| 244 | state_save_register_global(machine, state->flipscreen); | |
| 245 | } | |
| 246 | ||
| 247 | static MACHINE_RESET( momoko ) | |
| 248 | { | |
| 249 | momoko_state *state = (momoko_state *)machine->driver_data; | |
| 250 | ||
| 251 | state->fg_scrollx = 0; | |
| 252 | state->fg_scrolly = 0; | |
| 253 | state->fg_select = 0; | |
| 254 | state->text_scrolly = 0; | |
| 255 | state->text_mode = 0; | |
| 256 | state->bg_select = 0; | |
| 257 | state->bg_priority = 0; | |
| 258 | state->bg_mask = 0; | |
| 259 | state->fg_mask = 0; | |
| 260 | state->flipscreen = 0; | |
| 261 | } | |
| 262 | ||
| 244 | 263 | static MACHINE_DRIVER_START( momoko ) |
| 245 | 264 | |
| 265 | /* driver data */ | |
| 266 | MDRV_DRIVER_DATA(momoko_state) | |
| 267 | ||
| 246 | 268 | /* basic machine hardware */ |
| 247 | 269 | MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 5.0MHz */ |
| 248 | 270 | MDRV_CPU_PROGRAM_MAP(momoko_map) |
| r7500 | r7501 | |
| 251 | 273 | MDRV_CPU_ADD("audiocpu", Z80, 2500000) /* 2.5MHz */ |
| 252 | 274 | MDRV_CPU_PROGRAM_MAP(momoko_sound_map) |
| 253 | 275 | |
| 276 | MDRV_MACHINE_START(momoko) | |
| 277 | MDRV_MACHINE_RESET(momoko) | |
| 278 | ||
| 254 | 279 | /* video hardware */ |
| 255 | 280 | MDRV_SCREEN_ADD("screen", RASTER) |
| 256 | 281 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 324 | 349 | ROM_LOAD( "momoko-b.bin", 0x0100, 0x0020, CRC(427b0e5c) SHA1(aa2797b899571527cc96013fd3420b841954ee67) ) |
| 325 | 350 | ROM_END |
| 326 | 351 | |
| 327 | GAME( 1986, momoko, 0, momoko, momoko, 0, ROT0, "Jaleco", "Momoko 120%", | |
| 352 | GAME( 1986, momoko, 0, momoko, momoko, 0, ROT0, "Jaleco", "Momoko 120%", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 56 | 56 | #include "deprecat.h" |
| 57 | 57 | #include "sound/ay8910.h" |
| 58 | 58 | |
| 59 | static UINT8 *videoram; | |
| 60 | static UINT8 *colorram; | |
| 61 | static tilemap_t *bg_tilemap; | |
| 59 | class olibochu_state | |
| 60 | { | |
| 61 | public: | |
| 62 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, olibochu_state(machine)); } | |
| 62 | 63 | |
| 64 | olibochu_state(running_machine &machine) { } | |
| 65 | ||
| 66 | /* memory pointers */ | |
| 67 | UINT8 * videoram; | |
| 68 | UINT8 * colorram; | |
| 69 | UINT8 * spriteram; | |
| 70 | UINT8 * spriteram2; | |
| 71 | // UINT8 * paletteram; // currently this uses generic palette handling | |
| 72 | size_t spriteram_size; | |
| 73 | size_t spriteram2_size; | |
| 74 | ||
| 75 | /* video-related */ | |
| 76 | tilemap_t *bg_tilemap; | |
| 77 | ||
| 78 | /* misc */ | |
| 79 | int cmd; | |
| 80 | }; | |
| 81 | ||
| 82 | ||
| 83 | ||
| 63 | 84 | static PALETTE_INIT( olibochu ) |
| 64 | 85 | { |
| 65 | 86 | int i; |
| r7500 | r7501 | |
| 77 | 98 | pen = (color_prom[0x120 + (i - 0x100)] & 0x0f) | 0x00; |
| 78 | 99 | |
| 79 | 100 | /* red component */ |
| 80 | bit0 = (color_prom[pen] >> 0) & 0x01; | |
| 81 | bit1 = (color_prom[pen] >> 1) & 0x01; | |
| 82 | bit2 = (color_prom[pen] >> 2) & 0x01; | |
| 101 | bit0 = BIT(color_prom[pen], 0); | |
| 102 | bit1 = BIT(color_prom[pen], 1); | |
| 103 | bit2 = BIT(color_prom[pen], 2); | |
| 83 | 104 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 84 | 105 | |
| 85 | 106 | /* green component */ |
| 86 | bit0 = (color_prom[pen] >> 3) & 0x01; | |
| 87 | bit1 = (color_prom[pen] >> 4) & 0x01; | |
| 88 | bit2 = (color_prom[pen] >> 5) & 0x01; | |
| 107 | bit0 = BIT(color_prom[pen], 3); | |
| 108 | bit1 = BIT(color_prom[pen], 4); | |
| 109 | bit2 = BIT(color_prom[pen], 5); | |
| 89 | 110 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 90 | 111 | |
| 91 | 112 | /* blue component */ |
| 92 | bit0 = (color_prom[pen] >> 6) & 0x01; | |
| 93 | bit1 = (color_prom[pen] >> 7) & 0x01; | |
| 113 | bit0 = BIT(color_prom[pen], 6); | |
| 114 | bit1 = BIT(color_prom[pen], 7); | |
| 94 | 115 | b = 0x4f * bit0 + 0xa8 * bit1; |
| 95 | 116 | |
| 96 | 117 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); |
| r7500 | r7501 | |
| 99 | 120 | |
| 100 | 121 | static WRITE8_HANDLER( olibochu_videoram_w ) |
| 101 | 122 | { |
| 102 | videoram[offset] = data; | |
| 103 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 123 | olibochu_state *state = (olibochu_state *)space->machine->driver_data; | |
| 124 | state->videoram[offset] = data; | |
| 125 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 104 | 126 | } |
| 105 | 127 | |
| 106 | 128 | static WRITE8_HANDLER( olibochu_colorram_w ) |
| 107 | 129 | { |
| 108 | colorram[offset] = data; | |
| 109 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 130 | olibochu_state *state = (olibochu_state *)space->machine->driver_data; | |
| 131 | state->colorram[offset] = data; | |
| 132 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 110 | 133 | } |
| 111 | 134 | |
| 112 | 135 | static WRITE8_HANDLER( olibochu_flipscreen_w ) |
| r7500 | r7501 | |
| 122 | 145 | |
| 123 | 146 | static TILE_GET_INFO( get_bg_tile_info ) |
| 124 | 147 | { |
| 125 | int attr = colorram[tile_index]; | |
| 126 | int code = videoram[tile_index] + ((attr & 0x20) << 3); | |
| 148 | olibochu_state *state = (olibochu_state *)machine->driver_data; | |
| 149 | int attr = state->colorram[tile_index]; | |
| 150 | int code = state->videoram[tile_index] + ((attr & 0x20) << 3); | |
| 127 | 151 | int color = (attr & 0x1f) + 0x20; |
| 128 | 152 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 129 | 153 | |
| r7500 | r7501 | |
| 132 | 156 | |
| 133 | 157 | static VIDEO_START( olibochu ) |
| 134 | 158 | { |
| 135 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 136 | 8, 8, 32, 32); | |
| 159 | olibochu_state *state = (olibochu_state *)machine->driver_data; | |
| 160 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 137 | 161 | } |
| 138 | 162 | |
| 139 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 163 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 140 | 164 | { |
| 141 | UINT8 *spriteram = machine->generic.spriteram.u8; | |
| 142 | UINT8 *spriteram_2 = machine->generic.spriteram2.u8; | |
| 165 | olibochu_state *state = (olibochu_state *)machine->driver_data; | |
| 166 | UINT8 *spriteram = state->spriteram; | |
| 167 | UINT8 *spriteram_2 = state->spriteram2; | |
| 143 | 168 | int offs; |
| 144 | 169 | |
| 145 | 170 | /* 16x16 sprites */ |
| 146 | ||
| 147 | for (offs = 0;offs < machine->generic.spriteram_size;offs += 4) | |
| 171 | for (offs = 0; offs < state->spriteram_size; offs += 4) | |
| 148 | 172 | { |
| 149 | int attr = spriteram[offs+1]; | |
| 173 | int attr = spriteram[offs + 1]; | |
| 150 | 174 | int code = spriteram[offs]; |
| 151 | 175 | int color = attr & 0x3f; |
| 152 | 176 | int flipx = attr & 0x40; |
| 153 | 177 | int flipy = attr & 0x80; |
| 154 | int sx = spriteram[offs+3]; | |
| 155 | int sy = ((spriteram[offs+2] + 8) & 0xff) - 8; | |
| 178 | int sx = spriteram[offs + 3]; | |
| 179 | int sy = ((spriteram[offs + 2] + 8) & 0xff) - 8; | |
| 156 | 180 | |
| 157 | 181 | if (flip_screen_get(machine)) |
| 158 | 182 | { |
| r7500 | r7501 | |
| 170 | 194 | } |
| 171 | 195 | |
| 172 | 196 | /* 8x8 sprites */ |
| 173 | ||
| 174 | for (offs = 0;offs < machine->generic.spriteram2_size;offs += 4) | |
| 197 | for (offs = 0; offs < state->spriteram2_size; offs += 4) | |
| 175 | 198 | { |
| 176 | int attr = spriteram_2[offs+1]; | |
| 199 | int attr = spriteram_2[offs + 1]; | |
| 177 | 200 | int code = spriteram_2[offs]; |
| 178 | 201 | int color = attr & 0x3f; |
| 179 | 202 | int flipx = attr & 0x40; |
| 180 | 203 | int flipy = attr & 0x80; |
| 181 | int sx = spriteram_2[offs+3]; | |
| 182 | int sy = spriteram_2[offs+2]; | |
| 204 | int sx = spriteram_2[offs + 3]; | |
| 205 | int sy = spriteram_2[offs + 2]; | |
| 183 | 206 | |
| 184 | 207 | if (flip_screen_get(machine)) |
| 185 | 208 | { |
| r7500 | r7501 | |
| 199 | 222 | |
| 200 | 223 | static VIDEO_UPDATE( olibochu ) |
| 201 | 224 | { |
| 202 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 225 | olibochu_state *state = (olibochu_state *)screen->machine->driver_data; | |
| 226 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 203 | 227 | draw_sprites(screen->machine, bitmap, cliprect); |
| 204 | 228 | return 0; |
| 205 | 229 | } |
| r7500 | r7501 | |
| 207 | 231 | |
| 208 | 232 | static WRITE8_HANDLER( sound_command_w ) |
| 209 | 233 | { |
| 210 | stat | |
| 234 | olibochu_state | |
| 211 | 235 | int c; |
| 212 | 236 | |
| 213 | if (offset == 0) cmd = (cmd & 0x00ff) | (data << 8); | |
| 214 | else cmd = (cmd & 0xff00) | data; | |
| 237 | if (offset == 0) | |
| 238 | state->cmd = (state->cmd & 0x00ff) | (data << 8); | |
| 239 | else | |
| 240 | state->cmd = (state->cmd & 0xff00) | data; | |
| 215 | 241 | |
| 216 | for (c = 15;c >= 0;c--) | |
| 217 | if (cmd & (1 << c)) break; | |
| 242 | for (c = 15; c >= 0; c--) | |
| 243 | if (state->cmd & (1 << c)) break; | |
| 218 | 244 | |
| 219 | if (c >= 0) soundlatch_w(space,0,15-c); | |
| 245 | if (c >= 0) soundlatch_w(space, 0, 15 - c); | |
| 220 | 246 | } |
| 221 | 247 | |
| 222 | 248 | |
| 223 | 249 | static ADDRESS_MAP_START( olibochu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 224 | 250 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 225 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(olibochu_videoram_w) AM_BASE(&videoram) | |
| 226 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(olibochu_colorram_w) AM_BASE(&colorram) | |
| 251 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(olibochu_videoram_w) AM_BASE_MEMBER(olibochu_state, videoram) | |
| 252 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(olibochu_colorram_w) AM_BASE_MEMBER(olibochu_state, colorram) | |
| 227 | 253 | AM_RANGE(0x9000, 0x903f) AM_RAM //??? |
| 228 | 254 | AM_RANGE(0x9800, 0x983f) AM_RAM //??? |
| 229 | 255 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| r7500 | r7501 | |
| 234 | 260 | AM_RANGE(0xa005, 0xa005) AM_READ_PORT("DSW2") |
| 235 | 261 | AM_RANGE(0xa800, 0xa801) AM_WRITE(sound_command_w) |
| 236 | 262 | AM_RANGE(0xa802, 0xa802) AM_WRITE(olibochu_flipscreen_w) /* bit 6 = enable sound? */ |
| 237 | AM_RANGE(0xf400, 0xf41f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 238 | AM_RANGE(0xf440, 0xf47f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram2) | |
| 263 | AM_RANGE(0xf400, 0xf41f) AM_RAM AM_BASE_SIZE_MEMBER(olibochu_state, spriteram, spriteram_size) | |
| 264 | AM_RANGE(0xf440, 0xf47f) AM_RAM AM_BASE_SIZE_MEMBER(olibochu_state, spriteram2, spriteram2_size) | |
| 239 | 265 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 240 | 266 | ADDRESS_MAP_END |
| 241 | 267 | |
| r7500 | r7501 | |
| 397 | 423 | cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h */ |
| 398 | 424 | } |
| 399 | 425 | |
| 426 | static MACHINE_START( olibochu ) | |
| 427 | { | |
| 428 | olibochu_state *state = (olibochu_state *)machine->driver_data; | |
| 429 | ||
| 430 | state_save_register_global(machine, state->cmd); | |
| 431 | } | |
| 432 | ||
| 433 | static MACHINE_RESET( olibochu ) | |
| 434 | { | |
| 435 | olibochu_state *state = (olibochu_state *)machine->driver_data; | |
| 436 | ||
| 437 | state->cmd = 0; | |
| 438 | } | |
| 439 | ||
| 400 | 440 | static MACHINE_DRIVER_START( olibochu ) |
| 401 | 441 | |
| 442 | /* driver data */ | |
| 443 | MDRV_DRIVER_DATA(olibochu_state) | |
| 444 | ||
| 402 | 445 | /* basic machine hardware */ |
| 403 | 446 | MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ?? */ |
| 404 | 447 | MDRV_CPU_PROGRAM_MAP(olibochu_map) |
| r7500 | r7501 | |
| 410 | 453 | |
| 411 | 454 | // MDRV_QUANTUM_PERFECT_CPU("maincpu") |
| 412 | 455 | |
| 456 | MDRV_MACHINE_START(olibochu) | |
| 457 | MDRV_MACHINE_RESET(olibochu) | |
| 458 | ||
| 413 | 459 | /* video hardware */ |
| 414 | 460 | MDRV_SCREEN_ADD("screen", RASTER) |
| 415 | 461 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 477 | 523 | |
| 478 | 524 | |
| 479 | 525 | |
| 480 | GAME( 1981, olibochu, 0, olibochu, olibochu, 0, ROT270, "Irem + GDI", "Oli-Boo-Chu", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND ) | |
| 526 | GAME( 1981, olibochu, 0, olibochu, olibochu, 0, ROT270, "Irem + GDI", "Oli-Boo-Chu", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 3 | 3 | King Derby (c) 1981 Tatsumi |
| 4 | 4 | |
| 5 | 5 | driver by Andrew Gardner, Angelo Salese & Roberto Fresca |
| 6 | original cowrace.c by Luca Elia | |
| 6 | 7 | |
| 7 | 8 | TODO: |
| 8 | 9 | - remaining video issues, priorities, sprites etc.; |
| r7500 | r7501 | |
| 13 | 14 | - unknown memories; |
| 14 | 15 | - Garbage on the window tilemap if you win, it could be a BTANB (masked by the color prom). |
| 15 | 16 | - the name "King Derby" is a raw guess, there's a chance that it uses a different name |
| 16 | (but there isn't any title screen on the game?) | |
| 17 | (but there isn't any title screen in the game?) | |
| 18 | - Fix I/O in the 1986 bootleg version; | |
| 17 | 19 | |
| 18 | 20 | ============================================================================================ |
| 19 | 21 | |
| r7500 | r7501 | |
| 65 | 67 | #include "video/mc6845.h" |
| 66 | 68 | #include "machine/8255ppi.h" |
| 67 | 69 | #include "sound/ay8910.h" |
| 70 | #include "sound/okim6295.h" | |
| 71 | #include "sound/2203intf.h" | |
| 68 | 72 | |
| 69 | 73 | #define CLK_1 XTAL_20MHz |
| 70 | 74 | #define CLK_2 XTAL_3_579545MHz |
| r7500 | r7501 | |
| 364 | 368 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("DSW") |
| 365 | 369 | ADDRESS_MAP_END |
| 366 | 370 | |
| 371 | static ADDRESS_MAP_START( slave_1986_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 372 | AM_RANGE(0x0000, 0x2fff) AM_ROM | |
| 373 | AM_RANGE(0x3000, 0x3fff) AM_ROM //sound rom tested for the post check | |
| 374 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) //backup ram | |
| 375 | AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) /* I/O Ports */ | |
| 376 | AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) /* I/O Ports */ | |
| 377 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1") | |
| 378 | AM_RANGE(0x7400, 0x74ff) AM_RAM AM_BASE_GENERIC(spriteram) | |
| 379 | AM_RANGE(0x7600, 0x7600) AM_DEVWRITE("crtc", mc6845_address_w) | |
| 380 | AM_RANGE(0x7601, 0x7601) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) | |
| 381 | // AM_RANGE(0x7800, 0x7803) AM_READ(test_r) | |
| 382 | AM_RANGE(0x7a00, 0x7a00) AM_RAM //buffer for the key matrix | |
| 383 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("DSW") | |
| 384 | ADDRESS_MAP_END | |
| 385 | ||
| 367 | 386 | static ADDRESS_MAP_START( slave_io_map, ADDRESS_SPACE_IO, 8 ) |
| 368 | 387 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 369 | 388 | AM_RANGE(0x00, 0x00) AM_NOP //interrupt ack |
| r7500 | r7501 | |
| 380 | 399 | AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_data_address_w) |
| 381 | 400 | ADDRESS_MAP_END |
| 382 | 401 | |
| 402 | static ADDRESS_MAP_START( cowrace_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 403 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 404 | AM_RANGE(0x2000, 0x23ff) AM_RAM | |
| 405 | ADDRESS_MAP_END | |
| 406 | ||
| 407 | static ADDRESS_MAP_START( cowrace_sound_io, ADDRESS_SPACE_IO, 8 ) | |
| 408 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 409 | AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ym2203_w) | |
| 410 | ADDRESS_MAP_END | |
| 411 | ||
| 412 | ||
| 383 | 413 | /************************************* |
| 384 | 414 | * |
| 385 | 415 | * PPI configuration |
| r7500 | r7501 | |
| 412 | 442 | } |
| 413 | 443 | }; |
| 414 | 444 | |
| 445 | static const ppi8255_interface ppi8255_1986_intf[2] = | |
| 446 | { | |
| 447 | /* C as input, (all) as output */ | |
| 448 | { | |
| 449 | DEVCB_NULL, /* Port A read */ | |
| 450 | DEVCB_INPUT_PORT("IN0"), /* Port B read */ | |
| 451 | DEVCB_INPUT_PORT("IN1"), /* Port C read */ | |
| 452 | DEVCB_NULL, /* Port A write */ | |
| 453 | DEVCB_NULL, /* Port B write */ | |
| 454 | DEVCB_NULL /* Port C write */ | |
| 455 | }, | |
| 456 | ||
| 457 | /* */ | |
| 458 | { | |
| 459 | DEVCB_NULL, /* Port A read */ | |
| 460 | DEVCB_HANDLER(key_matrix_r),/* Port B read */ | |
| 461 | DEVCB_HANDLER(input_mux_r), /* Port C read */ | |
| 462 | DEVCB_HANDLER(sound_cmd_w), /* Port A write */ | |
| 463 | DEVCB_NULL, /* Port B write */ | |
| 464 | DEVCB_HANDLER(outport2_w) /* Port C write */ | |
| 465 | } | |
| 466 | }; | |
| 467 | ||
| 415 | 468 | /************************************* |
| 416 | 469 | * |
| 417 | 470 | * Input Port Definitions |
| r7500 | r7501 | |
| 575 | 628 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 576 | 629 | INPUT_PORTS_END |
| 577 | 630 | |
| 631 | static INPUT_PORTS_START( kingdrbb ) | |
| 632 | /*this might be different.*/ | |
| 633 | PORT_START("HPIO") // ppi0 (5000) | |
| 634 | PORT_DIPNAME( 0x01, 0x01, "HPIO" ) | |
| 635 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 636 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 637 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 638 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 639 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 640 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 641 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 642 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 643 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 644 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 645 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 646 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 647 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 648 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 649 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 650 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 651 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 652 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) //1p hopper i/o | |
| 653 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) //2p hopper i/o | |
| 654 | ||
| 655 | PORT_START("IN0") // ppi0 (5001) | |
| 656 | PORT_DIPNAME( 0x01, 0x01, "IN0" ) | |
| 657 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 658 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 659 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 660 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 661 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 662 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 663 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 664 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 665 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 666 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 667 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 668 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 669 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 670 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 671 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 672 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 673 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 674 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 675 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 676 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 677 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 678 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 679 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 680 | ||
| 681 | PORT_START("IN1") // ppi0 (5001) | |
| 682 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK ) //? | |
| 683 | PORT_DIPNAME( 0x02, 0x02, "IN1" ) | |
| 684 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 685 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 686 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 687 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 688 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 689 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 690 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 691 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 692 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 693 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 694 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 695 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 696 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 697 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 698 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 699 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 700 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 701 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 702 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 703 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 704 | ||
| 705 | PORT_START("KEY_1P") // ppi1 (6001) | |
| 706 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("1P 1-2") PORT_CODE(KEYCODE_Q) | |
| 707 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("1P 1-3") PORT_CODE(KEYCODE_W) | |
| 708 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("1P 1-4") PORT_CODE(KEYCODE_E) | |
| 709 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1P 1-5") PORT_CODE(KEYCODE_R) | |
| 710 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("1P 1-6") PORT_CODE(KEYCODE_T) | |
| 711 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("1P 2-3") PORT_CODE(KEYCODE_A) | |
| 712 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("1P 2-4") PORT_CODE(KEYCODE_S) | |
| 713 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("1P 2-5") PORT_CODE(KEYCODE_D) | |
| 714 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("1P 2-6") PORT_CODE(KEYCODE_F) | |
| 715 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("1P 3-4") PORT_CODE(KEYCODE_G) | |
| 716 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("1P 3-5") PORT_CODE(KEYCODE_H) | |
| 717 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("1P 3-6") PORT_CODE(KEYCODE_Z) | |
| 718 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("1P 4-5") PORT_CODE(KEYCODE_X) | |
| 719 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("1P 4-6") PORT_CODE(KEYCODE_C) | |
| 720 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("1P 5-6") PORT_CODE(KEYCODE_V) | |
| 721 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 722 | ||
| 723 | PORT_START("KEY_2P") // ppi1 (6001) | |
| 724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("2P 1-2") PORT_CODE(KEYCODE_Q) PORT_COCKTAIL | |
| 725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("2P 1-3") PORT_CODE(KEYCODE_W) PORT_COCKTAIL | |
| 726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("2P 1-4") PORT_CODE(KEYCODE_E) PORT_COCKTAIL | |
| 727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("2P 1-5") PORT_CODE(KEYCODE_R) PORT_COCKTAIL | |
| 728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("2P 1-6") PORT_CODE(KEYCODE_T) PORT_COCKTAIL | |
| 729 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("2P 2-3") PORT_CODE(KEYCODE_A) PORT_COCKTAIL | |
| 730 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("2P 2-4") PORT_CODE(KEYCODE_S) PORT_COCKTAIL | |
| 731 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("2P 2-5") PORT_CODE(KEYCODE_D) PORT_COCKTAIL | |
| 732 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("2P 2-6") PORT_CODE(KEYCODE_F) PORT_COCKTAIL | |
| 733 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("2P 3-4") PORT_CODE(KEYCODE_G) PORT_COCKTAIL | |
| 734 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("2P 3-5") PORT_CODE(KEYCODE_H) PORT_COCKTAIL | |
| 735 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("2P 3-6") PORT_CODE(KEYCODE_Z) PORT_COCKTAIL | |
| 736 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("2P 4-5") PORT_CODE(KEYCODE_X) PORT_COCKTAIL | |
| 737 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("2P 4-6") PORT_CODE(KEYCODE_C) PORT_COCKTAIL | |
| 738 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("2P 5-6") PORT_CODE(KEYCODE_V) PORT_COCKTAIL | |
| 739 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 740 | ||
| 741 | PORT_START("MUX0") // ppi1 (6002) | |
| 742 | PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) | |
| 743 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 744 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 745 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 746 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 747 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 748 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 749 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 750 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 751 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 752 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 753 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 754 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 755 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 756 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 757 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 758 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 759 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 760 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 761 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 762 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 763 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 764 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 765 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 766 | ||
| 767 | PORT_START("MUX1") | |
| 768 | PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) | |
| 769 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 770 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 771 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 772 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 773 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 774 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 775 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 776 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 777 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 778 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 779 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 780 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 781 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 782 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 783 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 784 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 785 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 786 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 787 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 788 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 789 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 790 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 791 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 792 | ||
| 793 | PORT_START("DSW") | |
| 794 | PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) | |
| 795 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 796 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 797 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 798 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 799 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 800 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 801 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 802 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 803 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 804 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 805 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 806 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 807 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 808 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 809 | PORT_DIPNAME( 0x20, 0x20, "Game Type?" ) //enables two new msgs "advance" and "exchange" in analyzer mode | |
| 810 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 811 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 812 | PORT_DIPNAME( 0x40, 0x40, "POST Check" ) | |
| 813 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 814 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 815 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 816 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 817 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 818 | INPUT_PORTS_END | |
| 819 | ||
| 578 | 820 | /************************************* |
| 579 | 821 | * |
| 580 | 822 | * GFX decoding |
| r7500 | r7501 | |
| 609 | 851 | 16*16 |
| 610 | 852 | }; |
| 611 | 853 | |
| 854 | /* seems more suitable with 2bpp?*/ | |
| 855 | static const gfx_layout cowrace_layout16x16x2 = | |
| 856 | { | |
| 857 | 16,16, | |
| 858 | RGN_FRAC(1,2), | |
| 859 | 2, | |
| 860 | { | |
| 861 | RGN_FRAC(1,2), | |
| 862 | RGN_FRAC(0,2), | |
| 863 | }, | |
| 864 | { 16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7,0,1,2,3,4,5,6,7 }, | |
| 865 | { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, | |
| 866 | 16*16 | |
| 867 | }; | |
| 868 | ||
| 612 | 869 | static GFXDECODE_START( kingdrby ) |
| 613 | 870 | GFXDECODE_ENTRY( "gfx1", 0x0000, layout16x16x2, 0x080, 0x10 ) |
| 614 | 871 | GFXDECODE_ENTRY( "gfx2", 0x0000, layout8x8x2, 0x000, 0x80 ) |
| 615 | 872 | GFXDECODE_END |
| 616 | 873 | |
| 874 | static GFXDECODE_START( cowrace ) | |
| 875 | GFXDECODE_ENTRY( "gfx1", 0x000000, cowrace_layout16x16x2, 0x080, 0x10 ) | |
| 876 | GFXDECODE_ENTRY( "gfx2", 0x000000, layout8x8x2, 0x000, 0x80 ) | |
| 877 | GFXDECODE_END | |
| 878 | ||
| 617 | 879 | /********************************************************************************************************** |
| 618 | 880 | * |
| 619 | 881 | * MC6845 interface |
| r7500 | r7501 | |
| 655 | 917 | DEVCB_NULL /* discrete write? */ |
| 656 | 918 | }; |
| 657 | 919 | |
| 920 | static const ym2203_interface cowrace_ym2203_interface = | |
| 921 | { | |
| 922 | { | |
| 923 | AY8910_LEGACY_OUTPUT, | |
| 924 | AY8910_DEFAULT_LOADS, | |
| 925 | DEVCB_HANDLER(sound_cmd_r), // read A | |
| 926 | DEVCB_DEVICE_HANDLER("oki", okim6295_r), // read B | |
| 927 | DEVCB_NULL, // write A | |
| 928 | DEVCB_DEVICE_HANDLER("oki", okim6295_w) // write B | |
| 929 | }, | |
| 930 | NULL | |
| 931 | }; | |
| 932 | ||
| 658 | 933 | static PALETTE_INIT(kingdrby) |
| 659 | 934 | { |
| 660 | 935 | int bit0, bit1, bit2 , r, g, b; |
| r7500 | r7501 | |
| 726 | 1001 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 727 | 1002 | MACHINE_DRIVER_END |
| 728 | 1003 | |
| 1004 | static MACHINE_DRIVER_START( kingdrbb ) | |
| 1005 | MDRV_IMPORT_FROM( kingdrby ) | |
| 729 | 1006 | |
| 1007 | MDRV_CPU_MODIFY("slave") | |
| 1008 | MDRV_CPU_PROGRAM_MAP(slave_1986_map) | |
| 1009 | ||
| 1010 | MDRV_PPI8255_RECONFIG( "ppi8255_0", ppi8255_1986_intf[0] ) | |
| 1011 | MDRV_PPI8255_RECONFIG( "ppi8255_1", ppi8255_1986_intf[1] ) | |
| 1012 | MACHINE_DRIVER_END | |
| 1013 | ||
| 1014 | static MACHINE_DRIVER_START( cowrace ) | |
| 1015 | MDRV_IMPORT_FROM( kingdrbb ) | |
| 1016 | ||
| 1017 | MDRV_CPU_MODIFY("soundcpu") | |
| 1018 | MDRV_CPU_PROGRAM_MAP(cowrace_sound_map) | |
| 1019 | MDRV_CPU_IO_MAP(cowrace_sound_io) | |
| 1020 | ||
| 1021 | MDRV_GFXDECODE(cowrace) | |
| 1022 | ||
| 1023 | MDRV_SOUND_ADD("oki", OKIM6295, 1056000) | |
| 1024 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified | |
| 1025 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 1026 | ||
| 1027 | MDRV_SOUND_REPLACE("aysnd", YM2203, 3000000) | |
| 1028 | MDRV_SOUND_CONFIG(cowrace_ym2203_interface) | |
| 1029 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 1030 | MACHINE_DRIVER_END | |
| 1031 | ||
| 730 | 1032 | ROM_START( kingdrby ) |
| 731 | 1033 | ROM_REGION( 0x3000, "master", 0 ) |
| 732 | 1034 | ROM_LOAD( "im4_d.d6", 0x0000, 0x1000, CRC(20f2d999) SHA1(91db46059f32b4791460df3330260f4e60f016a5) ) |
| r7500 | r7501 | |
| 763 | 1065 | ROM_LOAD( "147.f8", 0x000, 0x200, CRC(9245c4af) SHA1(813d628ac55913542a4deabe6ac0a4f9db09cf19) ) |
| 764 | 1066 | ROM_END |
| 765 | 1067 | |
| 766 | GAME( 1981, kingdrby, 0, kingdrby, kingdrby, 0, ROT0, "Tazmi", "King Derby", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS| GAME_IMPERFECT_SOUND ) | |
| 1068 | // might be closer to the original than the cowrace bootleg even if it shares some roms with cowrace? | |
| 1069 | ROM_START( kingdrbb ) // has 'Made in Taiwan' on the PCB. | |
| 1070 | ROM_REGION( 0x8000, "master", 0 ) | |
| 1071 | ROM_LOAD( "kingdrbb_u3.bin", 0x0000, 0x4000, CRC(90a14686) SHA1(ce2ee8c0cbb4212aa8e71d7145b1eefb4f282590) ) | |
| 1072 | ROM_CONTINUE(0x0000,0x4000) | |
| 1073 | ||
| 1074 | ROM_REGION( 0x4000, "slave", 0 ) // slave z80? | |
| 1075 | ROM_LOAD( "kingdrbb_u30.bin", 0x0000, 0x4000, CRC(98717214) SHA1(70ca61c15f66642b85dd248b24638a95a8254bbb) ) | |
| 1076 | ROM_CONTINUE(0x0000,0x4000) | |
| 1077 | ||
| 1078 | ROM_REGION( 0x4000, "soundcpu", 0 ) // audio z80? | |
| 1079 | ROM_LOAD( "kingdrbb_u161.bin", 0x0000, 0x4000, CRC(7d84b577) SHA1(d230b49df19bf68793a561f4c07413d22fa8ff28) ) | |
| 1080 | ||
| 1081 | ROM_REGION( 0x8000, "gfx1", 0 ) | |
| 1082 | ROM_LOAD( "kingdrbb_u94.bin", 0x0000, 0x4000, CRC(ba59e4b8) SHA1(425dc4055d5ea400eeef33e26fcc73fa726f414d) ) | |
| 1083 | ROM_LOAD( "kingdrbb_u95.bin", 0x4000, 0x4000, CRC(fa97deb6) SHA1(1630281f0cac3fe3bfaf924e1c6316107200eb4a) ) | |
| 1084 | ||
| 1085 | ROM_REGION( 0x4000, "gfx2", 0 ) | |
| 1086 | ROM_LOAD( "kingdrbb_u39.bin", 0x0000, 0x2000, CRC(4a34cef0) SHA1(b54f1f2ccd3dd773e47bfb044c5aec15c11426c2) ) | |
| 1087 | ROM_LOAD( "kingdrbb_u140.bin", 0x2000, 0x2000, CRC(7e24b674) SHA1(c774efeb8e4e833e73c29007d5294c93df1abef4) ) | |
| 1088 | ||
| 1089 | ROM_REGION( 0x4000, "raw_prom", 0 ) | |
| 1090 | ROM_LOAD( "kingdrbb_u1.bin", 0x0000, 0x4000, CRC(97931952) SHA1(a0ef3be105f2ed7f744c73e92c583d25bb322e6a) ) // palette but in a normal rom? | |
| 1091 | ||
| 1092 | ROM_REGION( 0x200, "proms", 0 ) | |
| 1093 | ROM_COPY( "raw_prom", 0x1000, 0x000, 0x200 ) | |
| 1094 | // ROM_COPY( "raw_prom", 0x3000, 0x200, 0x200 ) //identical to 0x1000 bank | |
| 1095 | ||
| 1096 | ROM_REGION( 0x4000, "pals", 0 ) // all read protected | |
| 1097 | ROM_LOAD( "palce16v.u101.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1098 | ROM_LOAD( "palce16v.u113.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1099 | ROM_LOAD( "palce16v.u160.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1100 | ROM_LOAD( "palce16v.u2.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1101 | ROM_LOAD( "palce16v.u29.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1102 | ROM_LOAD( "palce16v.u4.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1103 | ROM_LOAD( "palce16v.u75.bin", 0x0000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) | |
| 1104 | // jedutil just complains these are invalid.. | |
| 1105 | ROM_LOAD( "palce16v8q.u53.jed", 0x0000, 0x892, CRC(123d539a) SHA1(cccf0cbae3175b091a998eedf4aa44a55b679400) ) | |
| 1106 | ROM_LOAD( "palce16v8q.u77.jed", 0x0000, 0x892, CRC(b7956421) SHA1(57db38b571adf6cf49d7c221cd65a068a9a3383a) ) | |
| 1107 | ROM_LOAD( "palce16v8q.u87.jed", 0x0000, 0x892, CRC(b7956421) SHA1(57db38b571adf6cf49d7c221cd65a068a9a3383a) ) | |
| 1108 | ROM_END | |
| 1109 | ||
| 1110 | ROM_START( cowrace ) | |
| 1111 | ROM_REGION( 0x8000, "master", 0 ) | |
| 1112 | ROM_LOAD( "u3.bin", 0x0000, 0x8000, CRC(c05c3bd3) SHA1(b7199a069ab45edd25e021589b79105cdfa5511a) ) | |
| 1113 | ||
| 1114 | ROM_REGION( 0x8000, "slave", ROMREGION_ERASEFF ) // slave z80? | |
| 1115 | /* I've tried the kingdrbb slave CPU rom ... game works until the auto race in attract mode. We need to locate and dump this on the PCB. */ | |
| 1116 | ROM_LOAD( "slave.bin", 0x0000, 0x8000, NO_DUMP ) | |
| 1117 | ROM_FILL( 0x0000, 0x8000, 0xff ) // <- to remove once that the above is dumped | |
| 1118 | ||
| 1119 | ROM_REGION( 0x2000, "soundcpu", 0 ) | |
| 1120 | ROM_LOAD( "u164.bin", 0x0000, 0x2000, CRC(9affa1c8) SHA1(bfc07693e8f749cbf20ab8cda33975b66f567962) ) | |
| 1121 | ||
| 1122 | ROM_REGION( 0x10000, "gfx1", 0 ) | |
| 1123 | ROM_LOAD( "u94.bin", 0x8000, 0x8000, CRC(945dc115) SHA1(bdd145234e6361c42ed20e8ca4cac64f07332748) ) | |
| 1124 | ROM_LOAD( "u95.bin", 0x0000, 0x8000, CRC(fc1fc006) SHA1(326a67c1ea0f487ecc8b7aef2d90124a01e6dee3) ) | |
| 1125 | ||
| 1126 | ROM_REGION( 0x4000, "gfx2", 0 ) | |
| 1127 | ROM_LOAD( "u139.bin", 0x2000, 0x2000, CRC(b746bb2f) SHA1(5f5f48752689079ed65fe7bb4a69512ada5db05d) ) | |
| 1128 | ROM_LOAD( "u140.bin", 0x0000, 0x2000, CRC(7e24b674) SHA1(c774efeb8e4e833e73c29007d5294c93df1abef4) ) | |
| 1129 | ||
| 1130 | ROM_REGION( 0x40000, "oki", 0 ) | |
| 1131 | ROM_LOAD( "u4.bin", 0x00000, 0x20000, CRC(f92a3ab5) SHA1(fc164492793597eadb8a50154410936edb74fa23) ) | |
| 1132 | ||
| 1133 | ROM_REGION( 0x20000, "proms", 0 ) | |
| 1134 | ROM_LOAD( "u149.bin", 0x00000, 0x200, CRC(f41a5eca) SHA1(797f2d95d4e00f96e5a99604935810e1add59689) ) | |
| 1135 | ROM_END | |
| 1136 | ||
| 1137 | ||
| 1138 | GAME( 1981, kingdrby, 0, kingdrby, kingdrby, 0, ROT0, "Tazmi", "King Derby (1981)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS| GAME_IMPERFECT_SOUND ) | |
| 1139 | GAME( 1986, kingdrbb, kingdrby, kingdrbb, kingdrbb, 0, ROT0, "bootleg", "King Derby (1986 Taiwan bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND ) | |
| 1140 | GAME( 2000, cowrace, kingdrby, cowrace, kingdrbb, 0, ROT0, "bootleg", "Cow Race (1986 King Derby hack)", GAME_NOT_WORKING | GAME_WRONG_COLORS ) |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #include "cpu/s2650/s2650.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | typedef struct _embargo_state embargo_state; | |
| 12 | struct _embargo_state | |
| 11 | class embargo_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, embargo_state(machine)); } | |
| 15 | ||
| 16 | embargo_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT8 * videoram; |
| 16 | 20 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 66 | 66 | #include "deprecat.h" |
| 67 | 67 | #include "cpu/h83002/h8.h" |
| 68 | 68 | |
| 69 | typedef struct _lastfght_state lastfght_state; | |
| 70 | struct _lastfght_state | |
| 69 | class lastfght_state | |
| 71 | 70 | { |
| 71 | public: | |
| 72 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, lastfght_state(machine)); } | |
| 73 | ||
| 74 | lastfght_state(running_machine &machine) { } | |
| 75 | ||
| 72 | 76 | /* memory pointers */ |
| 73 | 77 | UINT8 * colorram; |
| 74 | 78 | // UINT8 * nvram; // currently this uses generic nvram handling |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /***************************************************************************** |
| 2 | 2 | |
| 3 | Markham (c) 1983 Sun Electronics | |
| 3 | Markham (c) 1983 Sun Electronics | |
| 4 | 4 | |
| 5 | 5 | Driver by Uki |
| 6 | 6 | |
| r7500 | r7501 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "cpu/z80/z80.h" |
| 13 | 13 | #include "sound/sn76496.h" |
| 14 | #include "includes/markham.h" | |
| 14 | 15 | |
| 15 | WRITE8_HANDLER( markham_videoram_w ); | |
| 16 | WRITE8_HANDLER( markham_flipscreen_w ); | |
| 17 | 16 | |
| 18 | PALETTE_INIT( markham ); | |
| 19 | VIDEO_START( markham ); | |
| 20 | VIDEO_UPDATE( markham ); | |
| 21 | ||
| 22 | extern UINT8 *markham_xscroll; | |
| 23 | ||
| 24 | ||
| 25 | 17 | static READ8_HANDLER( markham_e004_r ) |
| 26 | 18 | { |
| 27 | 19 | return 0; |
| r7500 | r7501 | |
| 33 | 25 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 34 | 26 | |
| 35 | 27 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 36 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 37 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(markham_videoram_w) AM_BASE_GENERIC(videoram) | |
| 28 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE_SIZE_MEMBER(markham_state, spriteram, spriteram_size) | |
| 29 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(markham_videoram_w) AM_BASE_MEMBER(markham_state, videoram) | |
| 38 | 30 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("share1") |
| 39 | 31 | |
| 40 | 32 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW2") |
| r7500 | r7501 | |
| 49 | 41 | AM_RANGE(0xe008, 0xe008) AM_WRITENOP /* coin counter? */ |
| 50 | 42 | AM_RANGE(0xe009, 0xe009) AM_WRITENOP /* to CPU2 busreq */ |
| 51 | 43 | |
| 52 | AM_RANGE(0xe00c, 0xe00d) AM_WRITEONLY AM_BASE( | |
| 44 | AM_RANGE(0xe00c, 0xe00d) AM_WRITEONLY AM_BASE_MEMBER( | |
| 53 | 45 | AM_RANGE(0xe00e, 0xe00e) AM_WRITE(markham_flipscreen_w) |
| 54 | 46 | ADDRESS_MAP_END |
| 55 | 47 | |
| r7500 | r7501 | |
| 182 | 174 | |
| 183 | 175 | static MACHINE_DRIVER_START( markham ) |
| 184 | 176 | |
| 177 | /* driver data */ | |
| 178 | MDRV_DRIVER_DATA(markham_state) | |
| 179 | ||
| 185 | 180 | /* basic machine hardware */ |
| 186 | 181 | MDRV_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */ |
| 187 | 182 | MDRV_CPU_PROGRAM_MAP(markham_master_map) |
| r7500 | r7501 | |
| 249 | 244 | ROM_END |
| 250 | 245 | |
| 251 | 246 | |
| 252 | GAME( 1983, markham, 0, markham, markham, 0, ROT0, "Sun Electronics", "Markham", | |
| 247 | GAME( 1983, markham, 0, markham, markham, 0, ROT0, "Sun Electronics", "Markham", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | #include "sound/flt_vol.h" |
| 17 | 17 | #include "includes/lockon.h" |
| 18 | 18 | |
| 19 | #define V30_GND_ADDR ((lockon_ctrl_reg & 0x3) << 16) | |
| 20 | #define V30_OBJ_ADDR ((lockon_ctrl_reg & 0x18) << 13) | |
| 19 | #define V30_GND_ADDR ((state->ctrl_reg & 0x3) << 16) | |
| 20 | #define V30_OBJ_ADDR ((state->ctrl_reg & 0x18) << 13) | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | /************************************* |
| r7500 | r7501 | |
| 32 | 32 | |
| 33 | 33 | /************************************* |
| 34 | 34 | * |
| 35 | * Globals | |
| 36 | * | |
| 37 | *************************************/ | |
| 38 | ||
| 39 | UINT32 lockon_main_inten; | |
| 40 | UINT8 lockon_ctrl_reg; | |
| 41 | ||
| 42 | ||
| 43 | /************************************* | |
| 44 | * | |
| 45 | 35 | * Machine functions |
| 46 | 36 | * |
| 47 | 37 | *************************************/ |
| r7500 | r7501 | |
| 63 | 53 | |
| 64 | 54 | static WRITE16_HANDLER( adrst_w ) |
| 65 | 55 | { |
| 66 | lockon_ctrl_reg = data & 0xff; | |
| 56 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 57 | state->ctrl_reg = data & 0xff; | |
| 67 | 58 | |
| 68 | 59 | /* Bus mastering for shared access */ |
| 69 | cputag_set_input_line(space->machine, "ground", INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE); | |
| 70 | cputag_set_input_line(space->machine, "object", INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE); | |
| 71 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); | |
| 60 | cpu_set_input_line(state->ground, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE); | |
| 61 | cpu_set_input_line(state->object, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE); | |
| 62 | cpu_set_input_line(state->audiocpu, INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); | |
| 72 | 63 | } |
| 73 | 64 | |
| 74 | 65 | static READ16_HANDLER( main_gnd_r ) |
| 75 | 66 | { |
| 76 | const address_space *gndspace = cputag_get_address_space(space->machine, "ground", ADDRESS_SPACE_PROGRAM); | |
| 67 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 68 | const address_space *gndspace = cpu_get_address_space(state->ground, ADDRESS_SPACE_PROGRAM); | |
| 77 | 69 | return memory_read_word(gndspace, V30_GND_ADDR | offset * 2); |
| 78 | 70 | } |
| 79 | 71 | |
| 80 | 72 | static WRITE16_HANDLER( main_gnd_w ) |
| 81 | 73 | { |
| 82 | const address_space *gndspace = cputag_get_address_space(space->machine, "ground", ADDRESS_SPACE_PROGRAM); | |
| 74 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 75 | const address_space *gndspace = cpu_get_address_space(state->ground, ADDRESS_SPACE_PROGRAM); | |
| 83 | 76 | |
| 84 | 77 | if (ACCESSING_BITS_0_7) |
| 85 | 78 | memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data); |
| r7500 | r7501 | |
| 89 | 82 | |
| 90 | 83 | static READ16_HANDLER( main_obj_r ) |
| 91 | 84 | { |
| 92 | const address_space *objspace = cputag_get_address_space(space->machine, "object", ADDRESS_SPACE_PROGRAM); | |
| 85 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 86 | const address_space *objspace = cpu_get_address_space(state->object, ADDRESS_SPACE_PROGRAM); | |
| 93 | 87 | return memory_read_word(objspace, V30_OBJ_ADDR | offset * 2); |
| 94 | 88 | } |
| 95 | 89 | |
| 96 | 90 | static WRITE16_HANDLER( main_obj_w ) |
| 97 | 91 | { |
| 98 | const address_space *objspace = cputag_get_address_space(space->machine, "object", ADDRESS_SPACE_PROGRAM); | |
| 92 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 93 | const address_space *objspace = cpu_get_address_space(state->object, ADDRESS_SPACE_PROGRAM); | |
| 99 | 94 | |
| 100 | 95 | if (ACCESSING_BITS_0_7) |
| 101 | 96 | memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 0), data); |
| r7500 | r7501 | |
| 105 | 100 | |
| 106 | 101 | static WRITE16_HANDLER( tst_w ) |
| 107 | 102 | { |
| 103 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 104 | ||
| 108 | 105 | if (offset < 0x800) |
| 109 | 106 | { |
| 110 | const address_space *gndspace = cputag_get_address_space(space->machine, "ground", ADDRESS_SPACE_PROGRAM); | |
| 111 | const address_space *objspace = cputag_get_address_space(space->machine, "object", ADDRESS_SPACE_PROGRAM); | |
| 107 | const address_space *gndspace = cpu_get_address_space(state->ground, ADDRESS_SPACE_PROGRAM); | |
| 108 | const address_space *objspace = cpu_get_address_space(state->object, ADDRESS_SPACE_PROGRAM); | |
| 112 | 109 | |
| 113 | 110 | if (ACCESSING_BITS_0_7) |
| 114 | 111 | memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data); |
| r7500 | r7501 | |
| 124 | 121 | |
| 125 | 122 | static READ16_HANDLER( main_z80_r ) |
| 126 | 123 | { |
| 127 | const address_space *sndspace = cputag_get_address_space(space->machine, "audiocpu", ADDRESS_SPACE_PROGRAM); | |
| 124 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 125 | const address_space *sndspace = cpu_get_address_space(state->audiocpu, ADDRESS_SPACE_PROGRAM); | |
| 128 | 126 | return 0xff00 | memory_read_byte(sndspace, offset); |
| 129 | 127 | } |
| 130 | 128 | |
| 131 | 129 | static WRITE16_HANDLER( main_z80_w ) |
| 132 | 130 | { |
| 133 | const address_space *sndspace = cputag_get_address_space(space->machine, "audiocpu", ADDRESS_SPACE_PROGRAM); | |
| 131 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 132 | const address_space *sndspace = cpu_get_address_space(state->audiocpu, ADDRESS_SPACE_PROGRAM); | |
| 134 | 133 | memory_write_byte(sndspace, offset, data); |
| 135 | 134 | } |
| 136 | 135 | |
| 137 | 136 | static WRITE16_HANDLER( inten_w ) |
| 138 | 137 | { |
| 139 | lockon_main_inten = 1; | |
| 138 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 139 | state->main_inten = 1; | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | static WRITE16_HANDLER( emres_w ) |
| 143 | 143 | { |
| 144 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 144 | 145 | watchdog_reset(space->machine); |
| 145 | | |
| 146 | state->main_inten = 0; | |
| 146 | 147 | } |
| 147 | 148 | |
| 148 | 149 | |
| r7500 | r7501 | |
| 157 | 158 | AM_RANGE(0x00000, 0x03fff) AM_RAM |
| 158 | 159 | AM_RANGE(0x04000, 0x04003) AM_READWRITE(lockon_crtc_r, lockon_crtc_w) |
| 159 | 160 | AM_RANGE(0x06000, 0x06001) AM_READ_PORT("DSW") |
| 160 | AM_RANGE(0x08000, 0x081ff) AM_RAM AM_BASE(&lockon_hud_ram) AM_SIZE(&lockon_hudram_size) | |
| 161 | AM_RANGE(0x09000, 0x09fff) AM_RAM_WRITE(lockon_char_w) AM_BASE(&lockon_char_ram) | |
| 161 | AM_RANGE(0x08000, 0x081ff) AM_RAM AM_BASE_SIZE_MEMBER(lockon_state, hud_ram, hudram_size) | |
| 162 | AM_RANGE(0x09000, 0x09fff) AM_RAM_WRITE(lockon_char_w) AM_BASE_MEMBER(lockon_state, char_ram) | |
| 162 | 163 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w) |
| 163 | 164 | AM_RANGE(0x0b000, 0x0bfff) AM_WRITE(lockon_rotate_w) |
| 164 | 165 | AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(lockon_fb_clut_w) |
| r7500 | r7501 | |
| 177 | 178 | static ADDRESS_MAP_START( ground_v30, ADDRESS_SPACE_PROGRAM, 16 ) |
| 178 | 179 | ADDRESS_MAP_UNMAP_HIGH |
| 179 | 180 | AM_RANGE(0x00000, 0x03fff) AM_RAM |
| 180 | AM_RANGE(0x04000, 0x04fff) AM_RAM AM_BASE(&lockon_scene_ram) | |
| 181 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(&lockon_ground_ram) AM_SIZE(&lockon_groundram_size) | |
| 181 | AM_RANGE(0x04000, 0x04fff) AM_RAM AM_BASE_MEMBER(lockon_state, scene_ram) | |
| 182 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE_SIZE_MEMBER(lockon_state, ground_ram, groundram_size) | |
| 182 | 183 | AM_RANGE(0x0C000, 0x0C001) AM_WRITE(lockon_scene_h_scr_w) |
| 183 | 184 | AM_RANGE(0x0C002, 0x0C003) AM_WRITE(lockon_scene_v_scr_w) |
| 184 | 185 | AM_RANGE(0x0C004, 0x0C005) AM_WRITE(lockon_ground_ctrl_w) |
| r7500 | r7501 | |
| 192 | 193 | AM_RANGE(0x00000, 0x03fff) AM_RAM |
| 193 | 194 | AM_RANGE(0x04000, 0x04001) AM_READWRITE(lockon_obj_4000_r, lockon_obj_4000_w) |
| 194 | 195 | AM_RANGE(0x08000, 0x08fff) AM_WRITE(lockon_tza112_w) |
| 195 | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE( | |
| 196 | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE_SIZE_MEMBER( | |
| 196 | 197 | AM_RANGE(0x30000, 0x3ffff) AM_MIRROR(0xc0000) AM_ROM |
| 197 | 198 | ADDRESS_MAP_END |
| 198 | 199 | |
| r7500 | r7501 | |
| 391 | 392 | #define LO_RI 100000.0 |
| 392 | 393 | #define LO_RP 100000.0 |
| 393 | 394 | |
| 395 | lockon_state *state = (lockon_state *)space->machine->driver_data; | |
| 396 | ||
| 394 | 397 | static const double gains[16] = |
| 395 | 398 | { |
| 396 | 399 | -( 1 / (1/LO_RP + 1/(LO_R3 + LO_R2 + LO_R1 + LO_R0)) ) / LO_RI, |
| r7500 | r7501 | |
| 414 | 417 | double lgain = gains[data & 0xf]; |
| 415 | 418 | double rgain = gains[data >> 4]; |
| 416 | 419 | |
| 417 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.1l"), lgain); | |
| 418 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.2l"), lgain); | |
| 419 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.3l"), lgain); | |
| 420 | flt_volume_set_volume(state->f2203_1l, lgain); | |
| 421 | flt_volume_set_volume(state->f2203_2l, lgain); | |
| 422 | flt_volume_set_volume(state->f2203_3l, lgain); | |
| 420 | 423 | |
| 421 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.1r"), rgain); | |
| 422 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.2r"), rgain); | |
| 423 | flt_volume_set_volume(devtag_get_device(space->machine, "f2203.3r"), rgain); | |
| 424 | flt_volume_set_volume(state->f2203_1r, rgain); | |
| 425 | flt_volume_set_volume(state->f2203_2r, rgain); | |
| 426 | flt_volume_set_volume(state->f2203_3r, rgain); | |
| 424 | 427 | } |
| 425 | 428 | |
| 426 | 429 | static void ym2203_irq(running_device *device, int irq) |
| 427 | 430 | { |
| 428 | cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 431 | lockon_state *state = (lockon_state *)device->machine->driver_data; | |
| 432 | cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 429 | 433 | } |
| 430 | 434 | |
| 431 | 435 | static WRITE8_DEVICE_HANDLER( ym2203_out_b ) |
| r7500 | r7501 | |
| 458 | 462 | * |
| 459 | 463 | *************************************/ |
| 460 | 464 | |
| 465 | static MACHINE_START( lockon ) | |
| 466 | { | |
| 467 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 468 | ||
| 469 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 470 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 471 | state->ground = devtag_get_device(machine, "ground"); | |
| 472 | state->object = devtag_get_device(machine, "object"); | |
| 473 | state->f2203_1l = devtag_get_device(machine, "f2203.1l"); | |
| 474 | state->f2203_2l = devtag_get_device(machine, "f2203.2l"); | |
| 475 | state->f2203_3l = devtag_get_device(machine, "f2203.3l"); | |
| 476 | state->f2203_1r = devtag_get_device(machine, "f2203.1r"); | |
| 477 | state->f2203_2r = devtag_get_device(machine, "f2203.2r"); | |
| 478 | state->f2203_3r = devtag_get_device(machine, "f2203.3r"); | |
| 479 | ||
| 480 | state_save_register_global(machine, state->ground_ctrl); | |
| 481 | state_save_register_global(machine, state->scroll_h); | |
| 482 | state_save_register_global(machine, state->scroll_v); | |
| 483 | state_save_register_global(machine, state->xsal); | |
| 484 | state_save_register_global(machine, state->x0ll); | |
| 485 | state_save_register_global(machine, state->dx0ll); | |
| 486 | state_save_register_global(machine, state->dxll); | |
| 487 | state_save_register_global(machine, state->ysal); | |
| 488 | state_save_register_global(machine, state->y0ll); | |
| 489 | state_save_register_global(machine, state->dy0ll); | |
| 490 | state_save_register_global(machine, state->dyll); | |
| 491 | state_save_register_global(machine, state->iden); | |
| 492 | state_save_register_global(machine, state->obj_pal_latch); | |
| 493 | state_save_register_global(machine, state->obj_pal_addr); | |
| 494 | state_save_register_global(machine, state->ctrl_reg); | |
| 495 | state_save_register_global(machine, state->main_inten); | |
| 496 | } | |
| 497 | ||
| 498 | static MACHINE_RESET( lockon ) | |
| 499 | { | |
| 500 | lockon_state *state = (lockon_state *)machine->driver_data; | |
| 501 | ||
| 502 | state->ground_ctrl = 0; | |
| 503 | state->scroll_h = 0; | |
| 504 | state->scroll_v = 0; | |
| 505 | state->xsal = 0; | |
| 506 | state->x0ll = 0; | |
| 507 | state->dx0ll = 0; | |
| 508 | state->dxll = 0; | |
| 509 | state->ysal = 0; | |
| 510 | state->y0ll = 0; | |
| 511 | state->dy0ll = 0; | |
| 512 | state->dyll = 0; | |
| 513 | state->iden = 0; | |
| 514 | state->obj_pal_latch = 0; | |
| 515 | state->obj_pal_addr = 0; | |
| 516 | state->ctrl_reg = 0; | |
| 517 | state->main_inten = 0; | |
| 518 | } | |
| 519 | ||
| 461 | 520 | static MACHINE_DRIVER_START( lockon ) |
| 521 | ||
| 522 | /* driver data */ | |
| 523 | MDRV_DRIVER_DATA(lockon_state) | |
| 524 | ||
| 462 | 525 | MDRV_CPU_ADD("maincpu", V30, XTAL_16MHz / 2) |
| 463 | 526 | MDRV_CPU_PROGRAM_MAP(main_v30) |
| 464 | 527 | |
| r7500 | r7501 | |
| 475 | 538 | MDRV_WATCHDOG_TIME_INIT(NSEC(PERIOD_OF_555_ASTABLE_NSEC(10000, 4700, 10000e-12) * 4096)) |
| 476 | 539 | MDRV_QUANTUM_TIME(HZ(600)) |
| 477 | 540 | |
| 541 | MDRV_MACHINE_START(lockon) | |
| 542 | MDRV_MACHINE_RESET(lockon) | |
| 543 | ||
| 478 | 544 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| 479 | 545 | |
| 480 | 546 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 754 | 820 | * |
| 755 | 821 | *************************************/ |
| 756 | 822 | |
| 757 | GAME( 1986, lockon, 0, lockon, lockon, 0, ROT0, "Tatsumi", "Lock-On (rev. E)", 0 ) | |
| 758 | GAME( 1986, lockonc, lockon, lockon, lockone, 0, ROT0, "Tatsumi", "Lock-On (rev. C)", 0 ) | |
| 823 | GAME( 1986, lockon, 0, lockon, lockon, 0, ROT0, "Tatsumi", "Lock-On (rev. E)", GAME_SUPPORTS_SAVE ) | |
| 824 | GAME( 1986, lockonc, lockon, lockon, lockone, 0, ROT0, "Tatsumi", "Lock-On (rev. C)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 173 | 173 | * |
| 174 | 174 | *************************************/ |
| 175 | 175 | |
| 176 | typedef struct _spaceg_state spaceg_state; | |
| 177 | struct _spaceg_state | |
| 176 | class spaceg_state | |
| 178 | 177 | { |
| 178 | public: | |
| 179 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, spaceg_state(machine)); } | |
| 180 | ||
| 181 | spaceg_state(running_machine &machine) { } | |
| 182 | ||
| 179 | 183 | UINT8 * videoram; |
| 180 | 184 | UINT8 * unkram; |
| 181 | 185 | UINT8 * io9400; |
| r7500 | r7501 | |
|---|---|---|
| 1877 | 1877 | PORT_INCLUDE( multi32_generic ) |
| 1878 | 1878 | |
| 1879 | 1879 | PORT_MODIFY("P1_A") |
| 1880 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_SPACE) /* */ | |
| 1881 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LSHIFT) /* */ | |
| 1882 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LALT) /* brake */ | |
| 1880 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_SPACE) /* P1 Attack */ | |
| 1881 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LSHIFT) /* P1 Wheelie */ | |
| 1882 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LALT) /* P1 Brake */ | |
| 1883 | 1883 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1884 | 1884 | |
| 1885 | 1885 | PORT_MODIFY("P1_B") |
| 1886 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_Q) /* */ | |
| 1887 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_W) /* */ | |
| 1888 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_S) /* brake */ | |
| 1886 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_Q) /* P2 Attack */ | |
| 1887 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_W) /* P2 Wheelie */ | |
| 1888 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_S) /* P2 Brake */ | |
| 1889 | 1889 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1890 | 1890 | |
| 1891 | 1891 | PORT_MODIFY("P2_A") |
| r7500 | r7501 | |
| 1894 | 1894 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1895 | 1895 | |
| 1896 | 1896 | PORT_START("ANALOG1") |
| 1897 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1) | |
| 1897 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) | |
| 1898 | 1898 | |
| 1899 | 1899 | PORT_START("ANALOG2") |
| 1900 | 1900 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| 1901 | 1901 | |
| 1902 | 1902 | PORT_START("ANALOG3") |
| 1903 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2) | |
| 1903 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2) | |
| 1904 | 1904 | |
| 1905 | 1905 | PORT_START("ANALOG4") |
| 1906 | 1906 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| r7500 | r7501 | |
|---|---|---|
| 95 | 95 | * |
| 96 | 96 | *************************************/ |
| 97 | 97 | |
| 98 | typedef struct _looping_state looping_state; | |
| 99 | struct _looping_state | |
| 98 | class looping_state | |
| 100 | 99 | { |
| 100 | public: | |
| 101 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, looping_state(machine)); } | |
| 102 | ||
| 103 | looping_state(running_machine &machine) { } | |
| 104 | ||
| 101 | 105 | /* memory pointers */ |
| 102 | 106 | UINT8 * videoram; |
| 103 | 107 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 47 | 47 | #define MASTER_CLOCK XTAL_16MHz |
| 48 | 48 | |
| 49 | 49 | |
| 50 | typedef struct _k3_state k3_state; | |
| 51 | struct _k3_state | |
| 50 | class k3_state | |
| 52 | 51 | { |
| 52 | public: | |
| 53 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); } | |
| 54 | ||
| 55 | k3_state(running_machine &machine) { } | |
| 56 | ||
| 53 | 57 | /* memory pointers */ |
| 54 | 58 | UINT16 * spriteram_1; |
| 55 | 59 | UINT16 * spriteram_2; |
| r7500 | r7501 | |
|---|---|---|
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | 43 | |
| 44 | typedef struct _astinvad_state astinvad_state; | |
| 45 | struct _astinvad_state | |
| 44 | class astinvad_state | |
| 46 | 45 | { |
| 46 | public: | |
| 47 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astinvad_state(machine)); } | |
| 48 | ||
| 49 | astinvad_state(running_machine &machine) { } | |
| 50 | ||
| 47 | 51 | UINT8 * colorram; |
| 48 | 52 | UINT8 * videoram; |
| 49 | 53 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 105 | 105 | every 8 bytes */ |
| 106 | 106 | #define NUM_PENS (8) |
| 107 | 107 | |
| 108 | typedef struct _supertnk_state supertnk_state; | |
| 109 | struct _supertnk_state | |
| 108 | class supertnk_state | |
| 110 | 109 | { |
| 110 | public: | |
| 111 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, supertnk_state(machine)); } | |
| 112 | ||
| 113 | supertnk_state(running_machine &machine) { } | |
| 114 | ||
| 111 | 115 | UINT8 *videoram[3]; |
| 112 | 116 | UINT8 rom_bank; |
| 113 | 117 | UINT8 bitplane_select; |
| r7500 | r7501 | |
|---|---|---|
| 81 | 81 | #include "emu.h" |
| 82 | 82 | #include "cpu/m68000/m68000.h" |
| 83 | 83 | #include "cpu/h6280/h6280.h" |
| 84 | #include "includes/boogwing.h" | |
| 84 | 85 | #include "includes/decocrpt.h" |
| 85 | #include "includes/deco16ic.h" | |
| 86 | 86 | #include "includes/decoprot.h" |
| 87 | 87 | #include "sound/2151intf.h" |
| 88 | 88 | #include "sound/okim6295.h" |
| 89 | #include "video/deco16ic.h" | |
| 89 | 90 | |
| 90 | VIDEO_START(boogwing); | |
| 91 | VIDEO_UPDATE(boogwing); | |
| 92 | 91 | |
| 93 | /**********************************************************************************/ | |
| 94 | ||
| 95 | 92 | static ADDRESS_MAP_START( boogwing_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 96 | 93 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 97 | 94 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 98 | 95 | |
| 99 | AM_RANGE(0x220000, 0x220001) AM_WRITE(deco16_priority_w) | |
| 96 | AM_RANGE(0x220000, 0x220001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 100 | 97 | AM_RANGE(0x220002, 0x22000f) AM_NOP |
| 101 | 98 | |
| 102 | 99 | AM_RANGE(0x240000, 0x240001) AM_WRITE(buffer_spriteram16_w) |
| r7500 | r7501 | |
| 109 | 106 | AM_RANGE(0x24e344, 0x24e345) AM_READ_PORT("INPUTS") |
| 110 | 107 | AM_RANGE(0x24e000, 0x24e7ff) AM_WRITE(deco16_104_prot_w) AM_BASE(&deco16_prot_ram) |
| 111 | 108 | |
| 112 | AM_RANGE(0x260000, 0x26000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 113 | AM_RANGE(0x264000, 0x265fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 114 | AM_RANGE(0x266000, 0x267fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 115 | AM_RANGE(0x268000, 0x268fff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 116 | AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 109 | AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 110 | AM_RANGE(0x264000, 0x265fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 111 | AM_RANGE(0x266000, 0x267fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 112 | AM_RANGE(0x268000, 0x268fff) AM_RAM AM_BASE_MEMBER(boogwing_state, pf1_rowscroll) | |
| 113 | AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_BASE_MEMBER(boogwing_state, pf2_rowscroll) | |
| 117 | 114 | |
| 118 | AM_RANGE(0x270000, 0x27000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 119 | AM_RANGE(0x274000, 0x275fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 120 | AM_RANGE(0x276000, 0x277fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 121 | AM_RANGE(0x278000, 0x278fff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 122 | AM_RANGE(0x27a000, 0x27afff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 115 | AM_RANGE(0x270000, 0x27000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 116 | AM_RANGE(0x274000, 0x275fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_pf3_data_w) | |
| 117 | AM_RANGE(0x276000, 0x277fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_pf4_data_w) | |
| 118 | AM_RANGE(0x278000, 0x278fff) AM_RAM AM_BASE_MEMBER(boogwing_state, pf3_rowscroll) | |
| 119 | AM_RANGE(0x27a000, 0x27afff) AM_RAM AM_BASE_MEMBER(boogwing_state, pf4_rowscroll) | |
| 123 | 120 | |
| 124 | 121 | AM_RANGE(0x280000, 0x28000f) AM_NOP // ? |
| 125 | 122 | AM_RANGE(0x282000, 0x282001) AM_NOP // Palette setup? |
| 126 | AM_RANGE(0x282008, 0x282009) AM_WRITE(deco16_palette_dma_w) | |
| 127 | AM_RANGE(0x284000, 0x285fff) AM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 123 | AM_RANGE(0x282008, 0x282009) AM_DEVWRITE("deco_custom", deco16ic_palette_dma_w) | |
| 124 | AM_RANGE(0x284000, 0x285fff) AM_DEVWRITE("deco_custom", deco16ic_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 128 | 125 | |
| 129 | 126 | AM_RANGE(0x3c0000, 0x3c004f) AM_RAM // ? |
| 130 | 127 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 146 | 143 | /**********************************************************************************/ |
| 147 | 144 | |
| 148 | 145 | static INPUT_PORTS_START( boogwing ) |
| 149 | PORT_START("SYSTEM") | |
| 146 | PORT_START("SYSTEM") | |
| 150 | 147 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 151 | 148 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 152 | 149 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 153 | 150 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 154 | 151 | |
| 155 | PORT_START("DSW") | |
| 152 | PORT_START("DSW") | |
| 156 | 153 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") |
| 157 | 154 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) |
| 158 | 155 | PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) |
| r7500 | r7501 | |
| 200 | 197 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 201 | 198 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 202 | 199 | |
| 203 | PORT_START("INPUTS") | |
| 200 | PORT_START("INPUTS") | |
| 204 | 201 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 205 | 202 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 206 | 203 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 279 | 276 | |
| 280 | 277 | static void sound_irq(running_device *device, int state) |
| 281 | 278 | { |
| 282 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 279 | boogwing_state *driver_state = (boogwing_state *)device->machine->driver_data; | |
| 280 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 283 | 281 | } |
| 284 | 282 | |
| 285 | 283 | static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) |
| 286 | 284 | { |
| 287 | okim6295_set_bank_base(devtag_get_device(device->machine, "oki2"), ((data & 2)>>1) * 0x40000); | |
| 288 | okim6295_set_bank_base(devtag_get_device(device->machine, "oki1"), (data & 1) * 0x40000); | |
| 285 | boogwing_state *state = (boogwing_state *)device->machine->driver_data; | |
| 286 | okim6295_set_bank_base(state->oki2, ((data & 2) >> 1) * 0x40000); | |
| 287 | okim6295_set_bank_base(state->oki1, (data & 1) * 0x40000); | |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 295 | 294 | }; |
| 296 | 295 | |
| 297 | 296 | |
| 297 | static int boogwing_bank_callback( const int bank ) | |
| 298 | { | |
| 299 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 300 | } | |
| 301 | ||
| 302 | static int boogwing_bank_callback2( const int bank ) | |
| 303 | { | |
| 304 | int offset = ((bank >> 4) & 0x7) * 0x1000; | |
| 305 | if ((bank & 0xf) == 0xa) | |
| 306 | offset += 0x800; // strange - transporter level | |
| 307 | ||
| 308 | return offset; | |
| 309 | } | |
| 310 | ||
| 311 | static const deco16ic_interface boogwing_deco16ic_intf = | |
| 312 | { | |
| 313 | "screen", | |
| 314 | 0, 0, 1, | |
| 315 | 0x0f, 0x1f, 0x0f, 0x0f, /* trans masks (pf2 has 5bpp graphics) */ | |
| 316 | 0, 0, 0, 16, /* color base (pf2 is non default) */ | |
| 317 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 318 | NULL, | |
| 319 | boogwing_bank_callback, | |
| 320 | boogwing_bank_callback2, | |
| 321 | boogwing_bank_callback2 | |
| 322 | }; | |
| 323 | ||
| 324 | ||
| 325 | static MACHINE_START( boogwing ) | |
| 326 | { | |
| 327 | boogwing_state *state = (boogwing_state *)machine->driver_data; | |
| 328 | ||
| 329 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 330 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 331 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 332 | state->oki1 = devtag_get_device(machine, "oki1"); | |
| 333 | state->oki2 = devtag_get_device(machine, "oki2"); | |
| 334 | } | |
| 335 | ||
| 298 | 336 | static MACHINE_DRIVER_START( boogwing ) |
| 337 | ||
| 338 | /* driver data */ | |
| 339 | MDRV_DRIVER_DATA(boogwing_state) | |
| 340 | ||
| 299 | 341 | /* basic machine hardware */ |
| 300 | 342 | MDRV_CPU_ADD("maincpu", M68000, 14000000) /* DE102 */ |
| 301 | 343 | MDRV_CPU_PROGRAM_MAP(boogwing_map) |
| r7500 | r7501 | |
| 304 | 346 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4) |
| 305 | 347 | MDRV_CPU_PROGRAM_MAP(audio_map) |
| 306 | 348 | |
| 349 | MDRV_MACHINE_START(boogwing) | |
| 350 | ||
| 307 | 351 | /* video hardware */ |
| 308 | 352 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 309 | 353 | |
| r7500 | r7501 | |
| 317 | 361 | MDRV_PALETTE_LENGTH(2048) |
| 318 | 362 | MDRV_GFXDECODE(boogwing) |
| 319 | 363 | |
| 320 | MDRV_VIDEO_START(boogwing) | |
| 321 | 364 | MDRV_VIDEO_UPDATE(boogwing) |
| 322 | 365 | |
| 366 | MDRV_DECO16IC_ADD("deco_custom", boogwing_deco16ic_intf) | |
| 367 | ||
| 323 | 368 | /* sound hardware */ |
| 324 | 369 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 325 | 370 | |
| r7500 | r7501 | |
| 519 | 564 | |
| 520 | 565 | static DRIVER_INIT( boogwing ) |
| 521 | 566 | { |
| 522 | const UINT8* src=memory_region(machine, "gfx6"); | |
| 523 | UINT8* dst=memory_region(machine, "tiles2") + 0x200000; | |
| 567 | const UINT8* src = memory_region(machine, "gfx6"); | |
| 568 | UINT8* dst = memory_region(machine, "tiles2") + 0x200000; | |
| 524 | 569 | |
| 525 | 570 | deco56_decrypt_gfx(machine, "tiles1"); |
| 526 | 571 | deco56_decrypt_gfx(machine, "tiles2"); |
| r7500 | r7501 | |
| 530 | 575 | memcpy(dst, src, 0x100000); |
| 531 | 576 | } |
| 532 | 577 | |
| 533 | GAME( 1992, boogwing, 0, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "Boogie Wings (Euro v1.5, 92.12.07)", 0 ) | |
| 534 | GAME( 1992, boogwinga,boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "Boogie Wings (Asia v1.5, 92.12.07)", 0 ) | |
| 535 | GAME( 1992, ragtime, boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.5, 92.12.07)", 0 ) | |
| 536 | GAME( 1992, ragtimea, boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.3, 92.11.26)", 0 ) | |
| 578 | GAME( 1992, boogwing, 0, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "Boogie Wings (Euro v1.5, 92.12.07)", GAME_SUPPORTS_SAVE ) | |
| 579 | GAME( 1992, boogwinga,boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "Boogie Wings (Asia v1.5, 92.12.07)", GAME_SUPPORTS_SAVE ) | |
| 580 | GAME( 1992, ragtime, boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.5, 92.12.07)", GAME_SUPPORTS_SAVE ) | |
| 581 | GAME( 1992, ragtimea, boogwing, boogwing, boogwing, boogwing, ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.3, 92.11.26)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 7901 | 7901 | GAME( 1996, aof3k, aof3, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", GAME_SUPPORTS_SAVE ) // no Japanese title / mode |
| 7902 | 7902 | GAME( 1996, kof96, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 1)", GAME_SUPPORTS_SAVE ) |
| 7903 | 7903 | GAME( 1996, kof96h, kof96, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 2)", GAME_SUPPORTS_SAVE ) |
| 7904 | GAME( 1996, ssideki4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero | |
| 7904 | GAME( 1996, ssideki4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero | |
| 7905 | 7905 | GAME( 1996, kizuna, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", GAME_SUPPORTS_SAVE ) |
| 7906 | 7906 | GAME( 1996, samsho4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", GAME_SUPPORTS_SAVE ) |
| 7907 | 7907 | GAME( 1996, samsho4k, samsho4, neogeo, neogeo, neogeo, ROT0, "SNK", "Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
| 7910 | 7910 | GAME( 1997, kof97h, kof97, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 2)", GAME_SUPPORTS_SAVE ) |
| 7911 | 7911 | GAME( 1997, kof97pls, kof97, neogeo, neogeo, neogeo, ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", GAME_SUPPORTS_SAVE ) |
| 7912 | 7912 | GAME( 1997, kog, kof97, neogeo, kog, kog, ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // protected bootleg |
| 7913 | GAME( 1997, lastblad, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", GAME_SUPPORTS_SAVE ) | |
| 7914 | GAME( 1997, lastbladh, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", GAME_SUPPORTS_SAVE ) | |
| 7913 | GAME( 1997, lastblad, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Blade / Bakumatsu Roman - Gekka no Kenshi (set 1)", GAME_SUPPORTS_SAVE ) | |
| 7914 | GAME( 1997, lastbladh, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Blade / Bakumatsu Roman - Gekka no Kenshi (set 2)", GAME_SUPPORTS_SAVE ) | |
| 7915 | 7915 | GAME( 1997, lastsold, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", GAME_SUPPORTS_SAVE ) |
| 7916 | 7916 | GAME( 1997, irrmaze, neogeo, neogeo, irrmaze, neogeo, ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", GAME_SUPPORTS_SAVE ) |
| 7917 | 7917 | GAME( 1998, rbff2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
| 7921 | 7921 | GAME( 1998, kof98, neogeo, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", GAME_SUPPORTS_SAVE ) |
| 7922 | 7922 | GAME( 1998, kof98k, kof98, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", GAME_SUPPORTS_SAVE ) |
| 7923 | 7923 | GAME( 1998, kof98n, kof98, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", GAME_SUPPORTS_SAVE ) |
| 7924 | GAME( 1998, lastbld2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi | |
| 7924 | GAME( 1998, lastbld2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi | |
| 7925 | 7925 | GAME( 1998, neocup98, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", GAME_SUPPORTS_SAVE ) |
| 7926 | 7926 | GAME( 1999, mslugx, neogeo, neogeo, neogeo, mslugx, ROT0, "SNK", "Metal Slug X - Super Vehicle-001", GAME_SUPPORTS_SAVE ) |
| 7927 | 7927 | GAME( 1999, kof99, neogeo, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ |
| r7500 | r7501 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | #define SPRITE_DATA_GRANULARITY 0x80 |
| 64 | 64 | |
| 65 | typedef struct _srmp5_state srmp5_state; | |
| 66 | struct _srmp5_state | |
| 65 | class srmp5_state | |
| 67 | 66 | { |
| 67 | public: | |
| 68 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, srmp5_state(machine)); } | |
| 69 | ||
| 70 | srmp5_state(running_machine &machine) { } | |
| 71 | ||
| 68 | 72 | UINT32 databank; |
| 69 | 73 | UINT16 *tileram; |
| 70 | 74 | UINT16 *palram; |
| r7500 | r7501 | |
| 336 | 340 | logerror("vidregs write %08X %08X\n", offset << 2, state->vidregs[offset]); |
| 337 | 341 | } |
| 338 | 342 | |
| 343 | static READ32_HANDLER(irq_ack_clear) | |
| 344 | { | |
| 345 | cputag_set_input_line(space->machine, "sub", R3000_IRQ4, CLEAR_LINE); | |
| 346 | return 0; | |
| 347 | } | |
| 348 | ||
| 339 | 349 | static ADDRESS_MAP_START( srmp5_mem, ADDRESS_SPACE_PROGRAM, 32 ) |
| 340 | 350 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM //maybe 0 - 2fffff ? |
| 341 | 351 | AM_RANGE(0x002f0000, 0x002f7fff) AM_RAM |
| r7500 | r7501 | |
| 362 | 372 | AM_RANGE(0x0a200000, 0x0a3fffff) AM_READWRITE(tileram_r, tileram_w) |
| 363 | 373 | |
| 364 | 374 | AM_RANGE(0x1eff0000, 0x1eff001f) AM_WRITEONLY |
| 365 | AM_RANGE(0x1eff003c, 0x1eff003f) AM_READ | |
| 375 | AM_RANGE(0x1eff003c, 0x1eff003f) AM_READ(irq_ack_clear) | |
| 366 | 376 | AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) |
| 367 | 377 | AM_RANGE(0x2fc00000, 0x2fdfffff) AM_ROM AM_REGION("user1", 0) |
| 368 | 378 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 510 | 520 | &st0016_charram |
| 511 | 521 | }; |
| 512 | 522 | |
| 513 | //It seems that interrupt flags are never cleared, so I use last line only. | |
| 514 | ||
| 515 | static INTERRUPT_GEN( irq4_gen ) | |
| 516 | { | |
| 517 | if(cpu_getiloops(device) == 0) | |
| 518 | cpu_set_input_line(device, R3000_IRQ4, ASSERT_LINE); | |
| 519 | else | |
| 520 | cpu_set_input_line(device, R3000_IRQ4, CLEAR_LINE); | |
| 521 | } | |
| 522 | ||
| 523 | 523 | static const r3000_cpu_core config = |
| 524 | 524 | { |
| 525 | 525 | 1, /* 1 if we have an FPU, 0 otherwise */ |
| r7500 | r7501 | |
| 569 | 569 | MDRV_CPU_ADD("sub", R3000LE, 25000000) |
| 570 | 570 | MDRV_CPU_CONFIG(config) |
| 571 | 571 | MDRV_CPU_PROGRAM_MAP(srmp5_mem) |
| 572 | //256???K?? | |
| 573 | MDRV_CPU_VBLANK_INT_HACK(irq4_gen, 256) | |
| 572 | MDRV_CPU_VBLANK_INT("screen", irq4_line_assert) | |
| 574 | 573 | |
| 575 | 574 | MDRV_QUANTUM_TIME(HZ(6000)) |
| 576 | 575 |
| r7500 | r7501 | |
|---|---|---|
| 9 | 9 | #include "deprecat.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | typedef struct _destroyr_state destroyr_state; | |
| 13 | struct _destroyr_state | |
| 12 | class destroyr_state | |
| 14 | 13 | { |
| 14 | public: | |
| 15 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, destroyr_state(machine)); } | |
| 16 | ||
| 17 | destroyr_state(running_machine &machine) { } | |
| 18 | ||
| 15 | 19 | /* memory pointers */ |
| 16 | 20 | UINT8 * major_obj_ram; |
| 17 | 21 | UINT8 * minor_obj_ram; |
| r7500 | r7501 | |
|---|---|---|
| 27 | 27 | #include "machine/pxa255.h" |
| 28 | 28 | #include "sound/dmadac.h" |
| 29 | 29 | |
| 30 | typedef struct __39in1_state _39in1_state; | |
| 31 | struct __39in1_state | |
| 30 | class _39in1_state | |
| 32 | 31 | { |
| 32 | public: | |
| 33 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _39in1_state(machine)); } | |
| 34 | ||
| 35 | _39in1_state(running_machine &machine) { } | |
| 36 | ||
| 33 | 37 | UINT32 seed; |
| 34 | 38 | UINT32 magic; |
| 35 | 39 | UINT32 state; |
| r7500 | r7501 | |
|---|---|---|
| 708 | 708 | static ADDRESS_MAP_START( ipu_91695_portmap, ADDRESS_SPACE_IO, 8 ) |
| 709 | 709 | ADDRESS_MAP_UNMAP_HIGH |
| 710 | 710 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 711 | AM_RANGE(0x00, 0x03) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_pio0", z80pio_r, z80pio_w) | |
| 711 | AM_RANGE(0x00, 0x03) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_pio0", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 712 | 712 | AM_RANGE(0x04, 0x07) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_sio", mcr_ipu_sio_r, mcr_ipu_sio_w) |
| 713 | 713 | AM_RANGE(0x08, 0x0b) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_ctc", z80ctc_r, z80ctc_w) |
| 714 | AM_RANGE(0x0c, 0x0f) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_pio1", z80pio_r, z80pio_w) | |
| 714 | AM_RANGE(0x0c, 0x0f) AM_MIRROR(0xe0) AM_DEVREADWRITE("ipu_pio1", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 715 | 715 | AM_RANGE(0x10, 0x13) AM_MIRROR(0xe0) AM_WRITE(mcr_ipu_laserdisk_w) |
| 716 | 716 | AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xe0) AM_READWRITE(mcr_ipu_watchdog_r, mcr_ipu_watchdog_w) |
| 717 | 717 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 1670 | 1670 | MDRV_CPU_VBLANK_INT_HACK(mcr_ipu_interrupt,2) |
| 1671 | 1671 | |
| 1672 | 1672 | MDRV_Z80CTC_ADD("ipu_ctc", 7372800/2 /* same as "ipu" */, nflfoot_ctc_intf) |
| 1673 | MDRV_Z80PIO_ADD("ipu_pio0", nflfoot_pio_intf) | |
| 1674 | MDRV_Z80PIO_ADD("ipu_pio1", nflfoot_pio_intf) | |
| 1673 | MDRV_Z80PIO_ADD("ipu_pio0", 7372800/2, nflfoot_pio_intf) | |
| 1674 | MDRV_Z80PIO_ADD("ipu_pio1", 7372800/2, nflfoot_pio_intf) | |
| 1675 | 1675 | MDRV_Z80SIO_ADD("ipu_sio", 7372800/2 /* same as "ipu" */, nflfoot_sio_intf) |
| 1676 | 1676 | MACHINE_DRIVER_END |
| 1677 | 1677 |
| r7500 | r7501 | |
|---|---|---|
| 55 | 55 | #include "cpu/z80/z80.h" |
| 56 | 56 | |
| 57 | 57 | |
| 58 | typedef struct _beaminv_state beaminv_state; | |
| 59 | struct _beaminv_state | |
| 58 | class beaminv_state | |
| 60 | 59 | { |
| 60 | public: | |
| 61 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, beaminv_state(machine)); } | |
| 62 | ||
| 63 | beaminv_state(running_machine &machine) { } | |
| 64 | ||
| 61 | 65 | /* memory pointers */ |
| 62 | 66 | UINT8 * videoram; |
| 63 | 67 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 39 | 39 | #include "sound/3526intf.h" |
| 40 | 40 | #include "includes/matmania.h" |
| 41 | 41 | |
| 42 | /************************************* | |
| 43 | * | |
| 44 | * Memory handlers | |
| 45 | * | |
| 46 | *************************************/ | |
| 47 | ||
| 42 | 48 | static WRITE8_HANDLER( matmania_sh_command_w ) |
| 43 | 49 | { |
| 44 | soundlatch_w(space,offset,data); | |
| 45 | cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE); | |
| 50 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 51 | soundlatch_w(space, offset, data); | |
| 52 | cpu_set_input_line(state->audiocpu, M6502_IRQ_LINE, HOLD_LINE); | |
| 46 | 53 | } |
| 47 | 54 | |
| 48 | 55 | static WRITE8_HANDLER( maniach_sh_command_w ) |
| 49 | 56 | { |
| 57 | matmania_state *state = (matmania_state *)space->machine->driver_data; | |
| 50 | 58 | soundlatch_w(space, offset, data); |
| 51 | cpu | |
| 59 | cpu | |
| 52 | 60 | } |
| 53 | 61 | |
| 54 | 62 | |
| 63 | /************************************* | |
| 64 | * | |
| 65 | * Address maps | |
| 66 | * | |
| 67 | *************************************/ | |
| 55 | 68 | |
| 56 | 69 | static ADDRESS_MAP_START( matmania_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 57 | 70 | AM_RANGE(0x0000, 0x077f) AM_RAM |
| 58 | AM_RANGE(0x0780, 0x07df) AM_WRITEONLY AM_BASE_SIZE_GENERIC(spriteram) | |
| 59 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&matmania_videoram2) AM_SIZE(&matmania_videoram2_size) | |
| 60 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE(&matmania_colorram2) | |
| 61 | AM_RANGE(0x2000, 0x21ff) AM_RAM AM_BASE(&matmania_videoram) AM_SIZE(&matmania_videoram_size) | |
| 62 | AM_RANGE(0x2200, 0x23ff) AM_RAM AM_BASE(&matmania_colorram) | |
| 63 | AM_RANGE(0x2400, 0x25ff) AM_RAM AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size) | |
| 64 | AM_RANGE(0x2600, 0x27ff) AM_RAM AM_BASE(&matmania_colorram3) | |
| 65 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") AM_WRITEONLY AM_BASE(&matmania_pageselect) | |
| 71 | AM_RANGE(0x0780, 0x07df) AM_WRITEONLY AM_BASE_SIZE_MEMBER(matmania_state, spriteram, spriteram_size) | |
| 72 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram2, videoram2_size) | |
| 73 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram2) | |
| 74 | AM_RANGE(0x2000, 0x21ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram, videoram_size) | |
| 75 | AM_RANGE(0x2200, 0x23ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram) | |
| 76 | AM_RANGE(0x2400, 0x25ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram3, videoram3_size) | |
| 77 | AM_RANGE(0x2600, 0x27ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram3) | |
| 78 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") AM_WRITEONLY AM_BASE_MEMBER(matmania_state, pageselect) | |
| 66 | 79 | AM_RANGE(0x3010, 0x3010) AM_READ_PORT("IN1") AM_WRITE(matmania_sh_command_w) |
| 67 | AM_RANGE(0x3020, 0x3020) AM_READ_PORT("DSW2") AM_WRITEONLY AM_BASE( | |
| 80 | AM_RANGE(0x3020, 0x3020) AM_READ_PORT("DSW2") AM_WRITEONLY AM_BASE_MEMBER( | |
| 68 | 81 | AM_RANGE(0x3030, 0x3030) AM_READ_PORT("DSW1") AM_WRITENOP /* ?? */ |
| 69 | AM_RANGE(0x3050, 0x307f) AM_WRITE(matmania_paletteram_w) AM_BASE_ | |
| 82 | AM_RANGE(0x3050, 0x307f) AM_WRITE(matmania_paletteram_w) AM_BASE_MEMBER | |
| 70 | 83 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 71 | 84 | ADDRESS_MAP_END |
| 72 | 85 | |
| 73 | 86 | static ADDRESS_MAP_START( maniach_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 74 | 87 | AM_RANGE(0x0000, 0x077f) AM_RAM |
| 75 | AM_RANGE(0x0780, 0x07df) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 76 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&matmania_videoram2) AM_SIZE(&matmania_videoram2_size) | |
| 77 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE(&matmania_colorram2) | |
| 78 | AM_RANGE(0x2000, 0x21ff) AM_RAM AM_BASE(&matmania_videoram) AM_SIZE(&matmania_videoram_size) | |
| 79 | AM_RANGE(0x2200, 0x23ff) AM_RAM AM_BASE(&matmania_colorram) | |
| 80 | AM_RANGE(0x2400, 0x25ff) AM_RAM AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size) | |
| 81 | AM_RANGE(0x2600, 0x27ff) AM_RAM AM_BASE(&matmania_colorram3) | |
| 82 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") AM_WRITEONLY AM_BASE(&matmania_pageselect) | |
| 88 | AM_RANGE(0x0780, 0x07df) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, spriteram, spriteram_size) | |
| 89 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram2, videoram2_size) | |
| 90 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram2) | |
| 91 | AM_RANGE(0x2000, 0x21ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram, videoram_size) | |
| 92 | AM_RANGE(0x2200, 0x23ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram) | |
| 93 | AM_RANGE(0x2400, 0x25ff) AM_RAM AM_BASE_SIZE_MEMBER(matmania_state, videoram3, videoram3_size) | |
| 94 | AM_RANGE(0x2600, 0x27ff) AM_RAM AM_BASE_MEMBER(matmania_state, colorram3) | |
| 95 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") AM_WRITEONLY AM_BASE_MEMBER(matmania_state, pageselect) | |
| 83 | 96 | AM_RANGE(0x3010, 0x3010) AM_READ_PORT("IN1") AM_WRITE(maniach_sh_command_w) |
| 84 | AM_RANGE(0x3020, 0x3020) AM_READ_PORT("DSW2") AM_WRITEONLY AM_BASE( | |
| 97 | AM_RANGE(0x3020, 0x3020) AM_READ_PORT("DSW2") AM_WRITEONLY AM_BASE_MEMBER( | |
| 85 | 98 | AM_RANGE(0x3030, 0x3030) AM_READ_PORT("DSW1") AM_WRITENOP /* ?? */ |
| 86 | 99 | AM_RANGE(0x3040, 0x3040) AM_READWRITE(maniach_mcu_r,maniach_mcu_w) |
| 87 | 100 | AM_RANGE(0x3041, 0x3041) AM_READ(maniach_mcu_status_r) |
| 88 | AM_RANGE(0x3050, 0x307f) AM_WRITE(matmania_paletteram_w) AM_BASE_ | |
| 101 | AM_RANGE(0x3050, 0x307f) AM_WRITE(matmania_paletteram_w) AM_BASE_MEMBER | |
| 89 | 102 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 90 | 103 | ADDRESS_MAP_END |
| 91 | 104 | |
| r7500 | r7501 | |
| 110 | 123 | |
| 111 | 124 | static ADDRESS_MAP_START( maniach_mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 112 | 125 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 113 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(maniach_68705_portA_r,maniach_68705_portA_w) | |
| 114 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(maniach_68705_portB_r,maniach_68705_portB_w) | |
| 115 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(maniach_68705_portC_r,maniach_68705_portC_w) | |
| 116 | AM_RANGE(0x0004, 0x0004) AM_WRITE(maniach_68705_ddrA_w) | |
| 117 | AM_RANGE(0x0005, 0x0005) AM_WRITE(maniach_68705_ddrB_w) | |
| 118 | AM_RANGE(0x0006, 0x0006) AM_WRITE(maniach_68705_ddrC_w) | |
| 126 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(maniach_68705_port_a_r,maniach_68705_port_a_w) | |
| 127 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(maniach_68705_port_b_r,maniach_68705_port_b_w) | |
| 128 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(maniach_68705_port_c_r,maniach_68705_port_c_w) | |
| 129 | AM_RANGE(0x0004, 0x0004) AM_WRITE(maniach_68705_ddr_a_w) | |
| 130 | AM_RANGE(0x0005, 0x0005) AM_WRITE(maniach_68705_ddr_b_w) | |
| 131 | AM_RANGE(0x0006, 0x0006) AM_WRITE(maniach_68705_ddr_c_w) | |
| 119 | 132 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| 120 | 133 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 121 | 134 | ADDRESS_MAP_END |
| 122 | 135 | |
| 123 | 136 | |
| 137 | /************************************* | |
| 138 | * | |
| 139 | * Input ports | |
| 140 | * | |
| 141 | *************************************/ | |
| 142 | ||
| 124 | 143 | static INPUT_PORTS_START( matmania ) |
| 125 | 144 | PORT_START("IN0") |
| 126 | 145 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| r7500 | r7501 | |
| 191 | 210 | INPUT_PORTS_END |
| 192 | 211 | |
| 193 | 212 | |
| 213 | /************************************* | |
| 214 | * | |
| 215 | * Graphics definitions | |
| 216 | * | |
| 217 | *************************************/ | |
| 218 | ||
| 194 | 219 | static const gfx_layout charlayout = |
| 195 | 220 | { |
| 196 | 221 | 8,8, /* 8*8 characters */ |
| r7500 | r7501 | |
| 268 | 293 | |
| 269 | 294 | |
| 270 | 295 | |
| 296 | /************************************* | |
| 297 | * | |
| 298 | * Machine driver | |
| 299 | * | |
| 300 | *************************************/ | |
| 301 | ||
| 302 | static MACHINE_START( matmania ) | |
| 303 | { | |
| 304 | matmania_state *state = (matmania_state *)machine->driver_data; | |
| 305 | ||
| 306 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 307 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 308 | state->mcu = devtag_get_device(machine, "mcu"); | |
| 309 | } | |
| 310 | ||
| 271 | 311 | static MACHINE_DRIVER_START( matmania ) |
| 272 | 312 | |
| 313 | /* driver data */ | |
| 314 | MDRV_DRIVER_DATA(matmania_state) | |
| 315 | ||
| 273 | 316 | /* basic machine hardware */ |
| 274 | 317 | MDRV_CPU_ADD("maincpu", M6502, 1500000) /* 1.5 MHz ???? */ |
| 275 | 318 | MDRV_CPU_PROGRAM_MAP(matmania_map) |
| r7500 | r7501 | |
| 281 | 324 | /* IRQs are caused by the main CPU */ |
| 282 | 325 | MDRV_QUANTUM_TIME(HZ(600)) |
| 283 | 326 | |
| 327 | MDRV_MACHINE_START(matmania) | |
| 328 | ||
| 284 | 329 | /* video hardware */ |
| 285 | 330 | MDRV_SCREEN_ADD("screen", RASTER) |
| 286 | 331 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 314 | 359 | /* handler called by the 3526 emulator when the internal timers cause an IRQ */ |
| 315 | 360 | static void irqhandler(running_device *device, int linestate) |
| 316 | 361 | { |
| 317 | cputag_set_input_line(device->machine, "audiocpu", 1, linestate); | |
| 362 | matmania_state *state = (matmania_state *)device->machine->driver_data; | |
| 363 | cpu_set_input_line(state->audiocpu, 1, linestate); | |
| 318 | 364 | } |
| 319 | 365 | |
| 320 | 366 | static const ym3526_interface ym3526_config = |
| r7500 | r7501 | |
| 323 | 369 | }; |
| 324 | 370 | |
| 325 | 371 | |
| 372 | static MACHINE_START( maniach ) | |
| 373 | { | |
| 374 | matmania_state *state = (matmania_state *)machine->driver_data; | |
| 375 | ||
| 376 | MACHINE_START_CALL(matmania); | |
| 377 | ||
| 378 | state_save_register_global(machine, state->port_a_in); | |
| 379 | state_save_register_global(machine, state->port_a_out); | |
| 380 | state_save_register_global(machine, state->ddr_a); | |
| 381 | state_save_register_global(machine, state->port_b_in); | |
| 382 | state_save_register_global(machine, state->port_b_out); | |
| 383 | state_save_register_global(machine, state->ddr_b); | |
| 384 | state_save_register_global(machine, state->port_c_in); | |
| 385 | state_save_register_global(machine, state->port_c_out); | |
| 386 | state_save_register_global(machine, state->ddr_c); | |
| 387 | state_save_register_global(machine, state->mcu_sent); | |
| 388 | state_save_register_global(machine, state->main_sent); | |
| 389 | state_save_register_global(machine, state->from_main); | |
| 390 | state_save_register_global(machine, state->from_mcu); | |
| 391 | } | |
| 392 | ||
| 393 | static MACHINE_RESET( maniach ) | |
| 394 | { | |
| 395 | matmania_state *state = (matmania_state *)machine->driver_data; | |
| 396 | ||
| 397 | state->port_a_in = 0; | |
| 398 | state->port_a_out = 0; | |
| 399 | state->ddr_a = 0; | |
| 400 | state->port_b_in = 0; | |
| 401 | state->port_b_out = 0; | |
| 402 | state->ddr_b = 0; | |
| 403 | state->port_c_in = 0; | |
| 404 | state->port_c_out = 0; | |
| 405 | state->ddr_c = 0; | |
| 406 | state->mcu_sent = 0; | |
| 407 | state->main_sent = 0; | |
| 408 | state->from_main = 0; | |
| 409 | state->from_mcu = 0; | |
| 410 | } | |
| 411 | ||
| 326 | 412 | static MACHINE_DRIVER_START( maniach ) |
| 327 | 413 | |
| 414 | /* driver data */ | |
| 415 | MDRV_DRIVER_DATA(matmania_state) | |
| 416 | ||
| 328 | 417 | /* basic machine hardware */ |
| 329 | 418 | MDRV_CPU_ADD("maincpu", M6502, 1500000) /* 1.5 MHz ???? */ |
| 330 | 419 | MDRV_CPU_PROGRAM_MAP(maniach_map) |
| r7500 | r7501 | |
| 339 | 428 | |
| 340 | 429 | MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slice per frame - high interleaving to sync main and mcu */ |
| 341 | 430 | |
| 431 | MDRV_MACHINE_START(maniach) | |
| 432 | MDRV_MACHINE_RESET(maniach) | |
| 433 | ||
| 342 | 434 | /* video hardware */ |
| 343 | 435 | MDRV_SCREEN_ADD("screen", RASTER) |
| 344 | 436 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 365 | 457 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 366 | 458 | MACHINE_DRIVER_END |
| 367 | 459 | |
| 368 | /*************************************************************************** | |
| 460 | /************************************* | |
| 461 | * | |
| 462 | * ROM definition(s) | |
| 463 | * | |
| 464 | *************************************/ | |
| 369 | 465 | |
| 370 | Mat Mania driver | |
| 371 | ||
| 372 | ***************************************************************************/ | |
| 373 | ||
| 374 | 466 | ROM_START( matmania ) |
| 375 | 467 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 376 | 468 | ROM_LOAD( "k0-03", 0x4000, 0x4000, CRC(314ab8a4) SHA1(dc86b2f71a9af8524edad2317343b0d05fe5ef4a) ) |
| r7500 | r7501 | |
| 593 | 685 | |
| 594 | 686 | |
| 595 | 687 | |
| 596 | GAME( 1985, matmania, 0, matmania, matmania, 0, ROT270, "Technos Japan (Taito America license)", "Mat Mania", 0 ) | |
| 597 | GAME( 1985, excthour, matmania, matmania, maniach, 0, ROT270, "Technos Japan (Taito license)", "Exciting Hour", 0 ) | |
| 598 | GAME( 1986, maniach, 0, maniach, maniach, 0, ROT270, "Technos Japan (Taito America license)", "Mania Challenge (set 1)", 0 ) | |
| 599 | GAME( 1986, maniach2, maniach, maniach, maniach, 0, ROT270, "Technos Japan (Taito America license)", "Mania Challenge (set 2)" , 0) /* earlier version? */ | |
| 688 | /************************************* | |
| 689 | * | |
| 690 | * Game driver(s) | |
| 691 | * | |
| 692 | *************************************/ | |
| 693 | ||
| 694 | GAME( 1985, matmania, 0, matmania, matmania, 0, ROT270, "Technos Japan (Taito America license)", "Mat Mania", GAME_SUPPORTS_SAVE ) | |
| 695 | GAME( 1985, excthour, matmania, matmania, maniach, 0, ROT270, "Technos Japan (Taito license)", "Exciting Hour", GAME_SUPPORTS_SAVE ) | |
| 696 | GAME( 1986, maniach, 0, maniach, maniach, 0, ROT270, "Technos Japan (Taito America license)", "Mania Challenge (set 1)", GAME_SUPPORTS_SAVE ) | |
| 697 | GAME( 1986, maniach2, maniach, maniach, maniach, 0, ROT270, "Technos Japan (Taito America license)", "Mania Challenge (set 2)", GAME_SUPPORTS_SAVE ) /* earlier version? */ |
| r7500 | r7501 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | static WRITE8_HANDLER( lsasquad_bankswitch_w ) |
| 157 | 157 | { |
| 158 | UINT8 *ROM = memory_region(space->machine, "maincpu"); | |
| 159 | ||
| 160 | 158 | /* bits 0-2 select ROM bank */ |
| 161 | memory_set_bank | |
| 159 | memory_set_bank | |
| 162 | 160 | |
| 163 | 161 | /* bit 3 is zeroed on startup, maybe reset sound CPU */ |
| 164 | 162 | |
| r7500 | r7501 | |
| 172 | 170 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 173 | 171 | AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") |
| 174 | 172 | AM_RANGE(0xa000, 0xbfff) AM_RAM /* SRAM */ |
| 175 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE_GENERIC(videoram) AM_SIZE_GENERIC(videoram) /* SCREEN RAM */ | |
| 176 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE(&lsasquad_scrollram) /* SCROLL RAM */ | |
| 177 | AM_RANGE(0xe400, 0xe5ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* OBJECT RAM */ | |
| 173 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(lsasquad_state, videoram, videoram_size) /* SCREEN RAM */ | |
| 174 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE_MEMBER(lsasquad_state, scrollram) /* SCROLL RAM */ | |
| 175 | AM_RANGE(0xe400, 0xe5ff) AM_RAM AM_BASE_SIZE_MEMBER(lsasquad_state, spriteram, spriteram_size) /* OBJECT RAM */ | |
| 178 | 176 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("DSWA") |
| 179 | 177 | AM_RANGE(0xe801, 0xe801) AM_READ_PORT("DSWB") |
| 180 | 178 | AM_RANGE(0xe802, 0xe802) AM_READ_PORT("DSWC") |
| r7500 | r7501 | |
| 194 | 192 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 195 | 193 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2203_r,ym2203_w) |
| 196 | 194 | AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("aysnd", ay8910_address_data_w) |
| 197 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(lsasquad_sh_sound_command_r,lsasquad_sh_result_w) | |
| 195 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(lsasquad_sh_sound_command_r, lsasquad_sh_result_w) | |
| 198 | 196 | AM_RANGE(0xd400, 0xd400) AM_WRITE(lsasquad_sh_nmi_disable_w) |
| 199 | 197 | AM_RANGE(0xd800, 0xd800) AM_WRITE(lsasquad_sh_nmi_enable_w) |
| 200 | 198 | AM_RANGE(0xd800, 0xd800) AM_READ(lsasquad_sound_status_r) |
| r7500 | r7501 | |
| 203 | 201 | |
| 204 | 202 | static ADDRESS_MAP_START( lsasquad_m68705_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 205 | 203 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 206 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(lsasquad_68705_portA_r,lsasquad_68705_portA_w) | |
| 207 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(lsasquad_68705_portB_r,lsasquad_68705_portB_w) | |
| 204 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(lsasquad_68705_port_a_r,lsasquad_68705_port_a_w) | |
| 205 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(lsasquad_68705_port_b_r,lsasquad_68705_port_b_w) | |
| 208 | 206 | AM_RANGE(0x0002, 0x0002) AM_READ(lsasquad_mcu_status_r) |
| 209 | AM_RANGE(0x0004, 0x0004) AM_WRITE(lsasquad_68705_ddrA_w) | |
| 210 | AM_RANGE(0x0005, 0x0005) AM_WRITE(lsasquad_68705_ddrB_w) | |
| 207 | AM_RANGE(0x0004, 0x0004) AM_WRITE(lsasquad_68705_ddr_a_w) | |
| 208 | AM_RANGE(0x0005, 0x0005) AM_WRITE(lsasquad_68705_ddr_b_w) | |
| 211 | 209 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| 212 | 210 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 213 | 211 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 342 | 340 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 343 | 341 | AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") |
| 344 | 342 | AM_RANGE(0xa000, 0xbfff) AM_RAM /* SRAM */ |
| 345 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE_GENERIC(videoram) AM_SIZE_GENERIC(videoram) /* SCREEN RAM */ | |
| 346 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE(&lsasquad_scrollram) /* SCROLL RAM */ | |
| 347 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* OBJECT RAM */ | |
| 343 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(lsasquad_state, videoram, videoram_size) /* SCREEN RAM */ | |
| 344 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE_MEMBER(lsasquad_state, scrollram) /* SCROLL RAM */ | |
| 345 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_BASE_SIZE_MEMBER(lsasquad_state, spriteram, spriteram_size) /* OBJECT RAM */ | |
| 348 | 346 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("DSWA") |
| 349 | 347 | AM_RANGE(0xe801, 0xe801) AM_READ_PORT("DSWB") |
| 350 | 348 | AM_RANGE(0xe803, 0xe803) AM_READ(daikaiju_mcu_status_r) /* COIN + 68705 status */ |
| r7500 | r7501 | |
| 505 | 503 | |
| 506 | 504 | static void irqhandler(running_device *device, int irq) |
| 507 | 505 | { |
| 508 | cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 506 | lsasquad_state *state = (lsasquad_state *)device->machine->driver_data; | |
| 507 | cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 509 | 508 | } |
| 510 | 509 | |
| 511 | 510 | static WRITE8_DEVICE_HANDLER( unk ) |
| r7500 | r7501 | |
| 528 | 527 | }; |
| 529 | 528 | |
| 530 | 529 | |
| 530 | static MACHINE_START( lsasquad ) | |
| 531 | { | |
| 532 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 533 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 534 | ||
| 535 | memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000); | |
| 536 | ||
| 537 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 538 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 539 | state->mcu = devtag_get_device(machine, "mcu"); | |
| 540 | ||
| 541 | state_save_register_global(machine, state->port_a_in); | |
| 542 | state_save_register_global(machine, state->port_a_out); | |
| 543 | state_save_register_global(machine, state->ddr_a); | |
| 544 | state_save_register_global(machine, state->port_b_in); | |
| 545 | state_save_register_global(machine, state->port_b_out); | |
| 546 | state_save_register_global(machine, state->ddr_b); | |
| 547 | state_save_register_global(machine, state->mcu_sent); | |
| 548 | state_save_register_global(machine, state->main_sent); | |
| 549 | state_save_register_global(machine, state->from_main); | |
| 550 | state_save_register_global(machine, state->from_mcu); | |
| 551 | ||
| 552 | state_save_register_global(machine, state->sound_pending); | |
| 553 | state_save_register_global(machine, state->sound_nmi_enable); | |
| 554 | state_save_register_global(machine, state->pending_nmi); | |
| 555 | state_save_register_global(machine, state->sound_cmd); | |
| 556 | state_save_register_global(machine, state->sound_result); | |
| 557 | ||
| 558 | state_save_register_global(machine, state->daikaiju_xor); | |
| 559 | state_save_register_global(machine, state->daikaiju_command); | |
| 560 | state_save_register_global(machine, state->daikaiju_length); | |
| 561 | state_save_register_global(machine, state->daikaiju_prev); | |
| 562 | state_save_register_global(machine, state->daikaiju_cnt); | |
| 563 | state_save_register_global(machine, state->daikaiju_cntr); | |
| 564 | ||
| 565 | state_save_register_global_array(machine, state->daikaiju_buffer); | |
| 566 | } | |
| 567 | ||
| 568 | static MACHINE_RESET( lsasquad ) | |
| 569 | { | |
| 570 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 571 | ||
| 572 | state->sound_pending = 0; | |
| 573 | state->sound_nmi_enable = 0; | |
| 574 | state->pending_nmi = 0; | |
| 575 | state->sound_cmd = 0; | |
| 576 | state->sound_result = 0; | |
| 577 | ||
| 578 | state->port_a_in = 0; | |
| 579 | state->port_a_out = 0; | |
| 580 | state->ddr_a = 0; | |
| 581 | state->port_b_in = 0; | |
| 582 | state->port_b_out = 0; | |
| 583 | state->ddr_b = 0; | |
| 584 | state->mcu_sent = 0; | |
| 585 | state->main_sent = 0; | |
| 586 | state->from_main = 0; | |
| 587 | state->from_mcu = 0; | |
| 588 | ||
| 589 | /* daikaiju */ | |
| 590 | state->daikaiju_xor = -1; | |
| 591 | state->daikaiju_command = 0; | |
| 592 | state->daikaiju_length = 0; | |
| 593 | state->daikaiju_prev = 0; | |
| 594 | state->daikaiju_cnt = 0; | |
| 595 | state->daikaiju_cntr = 0; | |
| 596 | ||
| 597 | memset(state->daikaiju_buffer, 0, ARRAY_LENGTH(state->daikaiju_buffer)); | |
| 598 | } | |
| 599 | ||
| 531 | 600 | static MACHINE_DRIVER_START( lsasquad ) |
| 532 | 601 | |
| 602 | /* driver data */ | |
| 603 | MDRV_DRIVER_DATA(lsasquad_state) | |
| 604 | ||
| 533 | 605 | /* basic machine hardware */ |
| 534 | 606 | MDRV_CPU_ADD("maincpu", Z80, 6000000) /* 6 MHz? */ |
| 535 | 607 | MDRV_CPU_PROGRAM_MAP(lsasquad_map) |
| r7500 | r7501 | |
| 545 | 617 | /* synchronization of the CPUs */ |
| 546 | 618 | /* main<->sound synchronization depends on this */ |
| 547 | 619 | |
| 620 | MDRV_MACHINE_START(lsasquad) | |
| 621 | MDRV_MACHINE_RESET(lsasquad) | |
| 622 | ||
| 548 | 623 | /* video hardware */ |
| 549 | 624 | MDRV_SCREEN_ADD("screen", RASTER) |
| 550 | 625 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 575 | 650 | |
| 576 | 651 | static MACHINE_DRIVER_START( daikaiju ) |
| 577 | 652 | |
| 653 | /* driver data */ | |
| 654 | MDRV_DRIVER_DATA(lsasquad_state) | |
| 655 | ||
| 578 | 656 | /* basic machine hardware */ |
| 579 | 657 | MDRV_CPU_ADD("maincpu", Z80, 6000000) |
| 580 | 658 | MDRV_CPU_PROGRAM_MAP(daikaiju_map) |
| r7500 | r7501 | |
| 588 | 666 | /* synchronization of the CPUs */ |
| 589 | 667 | /* main<->sound synchronization depends on this */ |
| 590 | 668 | |
| 591 | MDRV_MACHINE_RESET(daikaiju) | |
| 669 | MDRV_MACHINE_START(lsasquad) | |
| 670 | MDRV_MACHINE_RESET(lsasquad) | |
| 592 | 671 | |
| 593 | 672 | /* video hardware */ |
| 594 | 673 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 730 | 809 | |
| 731 | 810 | |
| 732 | 811 | /* coin inputs are inverted in storming */ |
| 733 | static DRIVER_INIT( lsasquad ) { lsasquad_invertcoin = 0x00; } | |
| 734 | static DRIVER_INIT( storming ) { lsasquad_invertcoin = 0x0c; } | |
| 812 | static DRIVER_INIT( lsasquad ) | |
| 813 | { | |
| 814 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 815 | state->invertcoin = 0x00; | |
| 816 | } | |
| 735 | 817 | |
| 818 | static DRIVER_INIT( storming ) | |
| 819 | { | |
| 820 | lsasquad_state *state = (lsasquad_state *)machine->driver_data; | |
| 821 | state->invertcoin = 0x0c; | |
| 822 | } | |
| 736 | 823 | |
| 737 | GAME( 1986, lsasquad, 0, lsasquad, lsasquad, lsasquad, ROT270, "Taito", "Land Sea Air Squad / Riku Kai Kuu Saizensen", GAME_IMPERFECT_GRAPHICS ) | |
| 738 | GAME( 1986, storming, lsasquad, lsasquad, lsasquad, storming, ROT270, "Taito", "Storming Party / Riku Kai Kuu Saizensen", GAME_IMPERFECT_GRAPHICS ) | |
| 739 | GAME( 1986, daikaiju, 0, daikaiju, daikaiju, 0, ROT270, "Taito", "Daikaiju no Gyakushu", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION) | |
| 740 | 824 | |
| 825 | GAME( 1986, lsasquad, 0, lsasquad, lsasquad, lsasquad, ROT270, "Taito", "Land Sea Air Squad / Riku Kai Kuu Saizensen", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 826 | GAME( 1986, storming, lsasquad, lsasquad, lsasquad, storming, ROT270, "Taito", "Storming Party / Riku Kai Kuu Saizensen", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 827 | GAME( 1986, daikaiju, 0, daikaiju, daikaiju, 0, ROT270, "Taito", "Daikaiju no Gyakushu", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 61 | 61 | #include "machine/8255ppi.h" |
| 62 | 62 | |
| 63 | 63 | |
| 64 | typedef struct _albazg_state albazg_state; | |
| 65 | struct _albazg_state | |
| 64 | class albazg_state | |
| 66 | 65 | { |
| 66 | public: | |
| 67 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazg_state(machine)); } | |
| 68 | ||
| 69 | albazg_state(running_machine &machine) { } | |
| 70 | ||
| 67 | 71 | /* memory pointers */ |
| 68 | 72 | UINT8 * cus_ram; |
| 69 | 73 | UINT8 * videoram; |
| r7500 | r7501 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #define NUM_PENS (8) |
| 14 | 14 | |
| 15 | typedef struct _sstrangr_state sstrangr_state; | |
| 16 | struct _sstrangr_state | |
| 15 | class sstrangr_state | |
| 17 | 16 | { |
| 17 | public: | |
| 18 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sstrangr_state(machine)); } | |
| 19 | ||
| 20 | sstrangr_state(running_machine &machine) { } | |
| 21 | ||
| 18 | 22 | UINT8 *ram; |
| 19 | 23 | UINT8 flip_screen; |
| 20 | 24 | UINT8 *proms; |
| r7500 | r7501 | |
|---|---|---|
| 13 | 13 | #define DE156CPU ARM |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "includes/decocrpt.h" |
| 16 | #include "includes/deco32.h" | |
| 17 | 16 | #include "machine/eeprom.h" |
| 18 | 17 | #include "sound/okim6295.h" |
| 19 | 18 | #include "sound/ymz280b.h" |
| 20 | 19 | #include "cpu/arm/arm.h" |
| 21 | #include "i | |
| 20 | #include "vi | |
| 22 | 21 | #include "rendlay.h" |
| 23 | 22 | |
| 24 | static UINT32 *backfire_spriteram32_1; | |
| 25 | static UINT32 *backfire_spriteram32_2; | |
| 26 | static UINT32 *backfire_mainram; | |
| 27 | static bitmap_t *backfire_left; | |
| 28 | static bitmap_t *backfire_right; | |
| 29 | ||
| 30 | //UINT32 *backfire_180010, *backfire_188010; | |
| 31 | static UINT32 *backfire_left_priority, *backfire_right_priority; | |
| 32 | ||
| 33 | /* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */ | |
| 34 | ||
| 35 | static int backfire_bank_callback(int bank) | |
| 23 | class backfire_state | |
| 36 | 24 | { |
| 37 | // mame_printf_debug("bank callback %04x\n",bank); // bit 1 gets set too? | |
| 25 | public: | |
| 26 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, backfire_state(machine)); } | |
| 38 | 27 | |
| 39 | ba | |
| 28 | backfire_state(running_machine &m | |
| 40 | 29 | |
| 41 | bank = (bank & 1) | ( (bank & 4) >> 1 ) | ((bank & 2) << 1); | |
| 30 | /* memory pointers */ | |
| 31 | UINT16 * pf1_rowscroll; | |
| 32 | UINT16 * pf2_rowscroll; | |
| 33 | UINT16 * pf3_rowscroll; | |
| 34 | UINT16 * pf4_rowscroll; | |
| 35 | UINT32 * spriteram_1; | |
| 36 | UINT32 * spriteram_2; | |
| 37 | UINT32 * mainram; | |
| 38 | UINT32 * left_priority; | |
| 39 | UINT32 * right_priority; | |
| 42 | 40 | |
| 43 | return bank * 0x1000; | |
| 44 | } | |
| 41 | /* video related */ | |
| 42 | bitmap_t *left; | |
| 43 | bitmap_t *right; | |
| 45 | 44 | |
| 45 | /* devices */ | |
| 46 | running_device *maincpu; | |
| 47 | running_device *deco16ic; | |
| 48 | running_device *lscreen; | |
| 49 | running_device *rscreen; | |
| 50 | running_device *eeprom; | |
| 51 | }; | |
| 46 | 52 | |
| 53 | //UINT32 *backfire_180010, *backfire_188010; | |
| 47 | 54 | |
| 48 | static VIDEO_START(backfire) | |
| 55 | /* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */ | |
| 56 | static VIDEO_START( backfire ) | |
| 49 | 57 | { |
| 58 | backfire_state *state = (backfire_state *)machine->driver_data; | |
| 59 | ||
| 50 | 60 | /* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */ |
| 51 | deco16_pf1_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 52 | deco16_pf2_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 53 | deco16_pf3_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 54 | deco16_pf4_data = auto_alloc_array(machine, UINT16, 0x2000/2); | |
| 55 | deco16_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 56 | deco16_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 57 | deco16_pf3_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 58 | deco16_pf4_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 59 | deco16_pf12_control = auto_alloc_array(machine, UINT16, 0x10/2); | |
| 60 | deco16_pf34_control =auto_alloc_array(machine, UINT16, 0x10/2); | |
| 61 | state->pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 62 | state->pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 63 | state->pf3_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 64 | state->pf4_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2); | |
| 61 | 65 | |
| 62 | 66 | /* and register the allocated ram so that save states still work */ |
| 63 | state_save_register_global_pointer(machine, deco16_pf1_data, 0x2000/2); | |
| 64 | state_save_register_global_pointer(machine, deco16_pf2_data, 0x2000/2); | |
| 65 | state_save_register_global_pointer(machine, deco16_pf3_data, 0x2000/2); | |
| 66 | state_save_register_global_pointer(machine, deco16_pf4_data, 0x2000/2); | |
| 67 | state_save_register_global_pointer(machine, deco16_pf1_rowscroll, 0x800/2); | |
| 68 | state_save_register_global_pointer(machine, deco16_pf2_rowscroll, 0x800/2); | |
| 69 | state_save_register_global_pointer(machine, deco16_pf3_rowscroll, 0x800/2); | |
| 70 | state_save_register_global_pointer(machine, deco16_pf4_rowscroll, 0x800/2); | |
| 71 | state_save_register_global_pointer(machine, deco16_pf12_control, 0x10/2); | |
| 72 | state_save_register_global_pointer(machine, deco16_pf34_control, 0x10/2); | |
| 67 | state_save_register_global_pointer(machine, state->pf1_rowscroll, 0x800/2); | |
| 68 | state_save_register_global_pointer(machine, state->pf2_rowscroll, 0x800/2); | |
| 69 | state_save_register_global_pointer(machine, state->pf3_rowscroll, 0x800/2); | |
| 70 | state_save_register_global_pointer(machine, state->pf4_rowscroll, 0x800/2); | |
| 73 | 71 | |
| 74 | deco16_2_video_init(machine, 0); | |
| 72 | state->left = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16); | |
| 73 | state->right = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16); | |
| 75 | 74 | |
| 76 | deco16_pf1_colour_bank = 0x00; | |
| 77 | deco16_pf2_colour_bank = 0x40; | |
| 78 | deco16_pf3_colour_bank = 0x10; | |
| 79 | deco16_pf4_colour_bank = 0x50; | |
| 80 | ||
| 81 | deco16_set_tilemap_bank_callback(0, backfire_bank_callback); | |
| 82 | deco16_set_tilemap_bank_callback(1, backfire_bank_callback); | |
| 83 | deco16_set_tilemap_bank_callback(2, backfire_bank_callback); | |
| 84 | deco16_set_tilemap_bank_callback(3, backfire_bank_callback); | |
| 85 | ||
| 86 | backfire_left = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16); | |
| 87 | backfire_right = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16); | |
| 75 | state_save_register_global_bitmap(machine, state->left); | |
| 76 | state_save_register_global_bitmap(machine, state->right); | |
| 88 | 77 | } |
| 89 | 78 | |
| 90 | static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect, UINT32 * | |
| 79 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 * | |
| 91 | 80 | { |
| 92 | 81 | int offs; |
| 93 | 82 | |
| 94 | 83 | flip_screen_set_no_update(machine, 1); |
| 95 | 84 | |
| 96 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien | |
| 85 | for (offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) // 0x1400 for charlien | |
| 97 | 86 | { |
| 98 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult, pri; | |
| 87 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri; | |
| 99 | 88 | |
| 100 | sprite = | |
| 89 | sprite = | |
| 101 | 90 | |
| 102 | y = backfire_spriteram32[offs]&0xffff; | |
| 103 | flash=y&0x1000; | |
| 104 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 91 | y = spriteram[offs] & 0xffff; | |
| 92 | flash = y & 0x1000; | |
| 93 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 94 | continue; | |
| 105 | 95 | |
| 106 | x = backfire_spriteram32[offs+2]&0xffff; | |
| 107 | colour = (x >>9) & 0x1f; | |
| 96 | x = spriteram[offs + 2] & 0xffff; | |
| 97 | colour = (x >> 9) & 0x1f; | |
| 108 | 98 | |
| 109 | pri = (x&0xc000); // 2 bits or 1? | |
| 99 | pri = (x & 0xc000); // 2 bits or 1? | |
| 110 | 100 | |
| 111 | switch (pri&0xc000) { | |
| 112 | case 0x0000: pri=0; break; // numbers, people, cars when in the air, status display.. | |
| 113 | case 0x4000: pri=0xf0;break; // cars most of the time | |
| 114 | case 0x8000: pri=0; break; // car wheels during jump? | |
| 115 | case 0xc000: pri=0xf0;break; /* car wheels in race? */ | |
| 101 | switch (pri & 0xc000) | |
| 102 | { | |
| 103 | case 0x0000: pri = 0; break; // numbers, people, cars when in the air, status display.. | |
| 104 | case 0x4000: pri = 0xf0;break; // cars most of the time | |
| 105 | case 0x8000: pri = 0; break; // car wheels during jump? | |
| 106 | case 0xc000: pri = 0xf0;break; /* car wheels in race? */ | |
| 116 | 107 | } |
| 117 | 108 | |
| 118 | 109 | // pri 0 = ontop of everything// |
| 119 | 110 | |
| 120 | // | |
| 111 | // | |
| 121 | 112 | |
| 122 | 113 | fx = y & 0x2000; |
| 123 | 114 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 128 | 119 | if (x >= 320) x -= 512; |
| 129 | 120 | if (y >= 256) y -= 512; |
| 130 | 121 | y = 240 - y; |
| 131 | ||
| 122 | | |
| 132 | 123 | |
| 133 | if (x>320) continue; | |
| 124 | if (x > 320) continue; | |
| 134 | 125 | |
| 135 | 126 | sprite &= ~multi; |
| 136 | 127 | if (fy) |
| r7500 | r7501 | |
| 143 | 134 | |
| 144 | 135 | if (flip_screen_x_get(machine)) |
| 145 | 136 | { |
| 146 | y=240-y; | |
| 147 | x=304-x; | |
| 148 | if (fx) fx=0; else fx=1; | |
| 149 | if (fy) fy=0; else fy=1; | |
| 150 | mult=16; | |
| 137 | y = 240 - y; | |
| 138 | x = 304 - x; | |
| 139 | if (fx) fx = 0; else fx = 1; | |
| 140 | if (fy) fy = 0; else fy = 1; | |
| 141 | mult = 16; | |
| 151 | 142 | } |
| 152 | else mult=-16; | |
| 143 | else mult = -16; | |
| 153 | 144 | |
| 154 | 145 | while (multi >= 0) |
| 155 | 146 | { |
| r7500 | r7501 | |
| 167 | 158 | |
| 168 | 159 | |
| 169 | 160 | |
| 170 | static VIDEO_UPDATE(backfire) | |
| 161 | static VIDEO_UPDATE( backfire ) | |
| 171 | 162 | { |
| 172 | running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); | |
| 173 | running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); | |
| 163 | backfire_state *state = (backfire_state *)screen->machine->driver_data; | |
| 174 | 164 | |
| 175 | 165 | /* screen 1 uses pf1 as the forground and pf3 as the background */ |
| 176 | 166 | /* screen 2 uses pf2 as the foreground and pf4 as the background */ |
| 167 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 168 | deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll); | |
| 177 | 169 | |
| 178 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 179 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); | |
| 180 | ||
| 181 | if (screen == left_screen) | |
| 170 | if (screen == state->lscreen) | |
| 182 | 171 | { |
| 183 | 172 | |
| 184 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 185 | bitmap_fill(bitmap,cliprect,0x100); | |
| 173 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 174 | bitmap_fill(bitmap, cliprect, 0x100); | |
| 186 | 175 | |
| 187 | if ( | |
| 176 | if (stat | |
| 188 | 177 | { |
| 189 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,1); | |
| 190 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,2); | |
| 191 | draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_1,3); | |
| 178 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 1); | |
| 179 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 180 | draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 3); | |
| 192 | 181 | } |
| 193 | else if ( | |
| 182 | else if (stat | |
| 194 | 183 | { |
| 195 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,2); | |
| 196 | deco16_tilemap_3_draw(screen,bitmap,cliprect,0,4); | |
| 197 | draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_1,3); | |
| 184 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 185 | deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 186 | draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 3); | |
| 198 | 187 | } |
| 199 | 188 | else |
| 200 | popmessage( "unknown left priority %08x", | |
| 189 | popmessage( "unknown left priority %08x", stat | |
| 201 | 190 | } |
| 202 | else if (screen == | |
| 191 | else if (screen == s | |
| 203 | 192 | { |
| 204 | bitmap_fill(screen->machine->priority_bitmap,NULL,0); | |
| 205 | bitmap_fill(bitmap,cliprect,0x500); | |
| 193 | bitmap_fill(screen->machine->priority_bitmap, NULL, 0); | |
| 194 | bitmap_fill(bitmap, cliprect, 0x500); | |
| 206 | 195 | |
| 207 | if ( | |
| 196 | if (stat | |
| 208 | 197 | { |
| 209 | deco16_tilemap_4_draw(screen,bitmap,cliprect,0,1); | |
| 210 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 211 | draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_2,4); | |
| 198 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, 0, 1); | |
| 199 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 200 | draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 4); | |
| 212 | 201 | } |
| 213 | else if ( | |
| 202 | else if (stat | |
| 214 | 203 | { |
| 215 | deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2); | |
| 216 | deco16_tilemap_4_draw(screen,bitmap,cliprect,0,4); | |
| 217 | draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_2,4); | |
| 204 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2); | |
| 205 | deco16ic_tilemap_4_draw(state->deco16ic, bitmap, cliprect, 0, 4); | |
| 206 | draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 4); | |
| 218 | 207 | } |
| 219 | 208 | else |
| 220 | popmessage( "unknown right priority %08x", | |
| 209 | popmessage( "unknown right priority %08x", stat | |
| 221 | 210 | } |
| 222 | 211 | return 0; |
| 223 | 212 | } |
| 224 | 213 | |
| 225 | 214 | |
| 226 | 215 | |
| 227 | static READ32_DEVICE_HANDLER(backfire_eeprom_r) | |
| 216 | static READ32_DEVICE_HANDLER( backfire_eeprom_r ) | |
| 228 | 217 | { |
| 229 | 218 | /* some kind of screen indicator? checked by backfirea set before it will boot */ |
| 230 | 219 | int backfire_screen = mame_rand(device->machine) & 1; |
| r7500 | r7501 | |
| 233 | 222 | | ((input_port_read(device->machine, "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ; |
| 234 | 223 | } |
| 235 | 224 | |
| 236 | static READ32_HANDLER(backfire_control2_r) | |
| 225 | static READ32_HANDLER( backfire_control2_r ) | |
| 237 | 226 | { |
| 227 | backfire_state *state = (backfire_state *)space->machine->driver_data; | |
| 228 | ||
| 238 | 229 | // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask); |
| 239 | return (eeprom_read_bit( | |
| 230 | return (eeprom_read_bit(s | |
| 240 | 231 | } |
| 241 | 232 | |
| 242 | 233 | #ifdef UNUSED_FUNCTION |
| 243 | 234 | static READ32_HANDLER(backfire_control3_r) |
| 244 | 235 | { |
| 236 | backfire_state *state = (backfire_state *)space->machine->driver_data; | |
| 237 | ||
| 245 | 238 | // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask); |
| 246 | return (eeprom_read_bit( | |
| 239 | return (eeprom_read_bit(s | |
| 247 | 240 | } |
| 248 | 241 | #endif |
| 249 | 242 | |
| r7500 | r7501 | |
| 251 | 244 | static WRITE32_DEVICE_HANDLER(backfire_eeprom_w) |
| 252 | 245 | { |
| 253 | 246 | logerror("%s:write eprom %08x (%08x) %08x\n",cpuexec_describe_context(device->machine),offset<<1,mem_mask,data); |
| 254 | if (ACCESSING_BITS_0_7) { | |
| 255 | eeprom_set_clock_line(device, (data & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 256 | eeprom_write_bit(device, data & 0x1); | |
| 257 | eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 247 | if (ACCESSING_BITS_0_7) | |
| 248 | { | |
| 249 | eeprom_set_clock_line(device, BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 250 | eeprom_write_bit(device, BIT(data, 0)); | |
| 251 | eeprom_set_cs_line(device, BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE); | |
| 258 | 252 | } |
| 259 | 253 | } |
| 260 | 254 | |
| 261 | 255 | |
| 262 | static WRITE32_HANDLER( | |
| 256 | static WRITE32_HANDLER(backfire_nonbuffered_palette_w) | |
| 263 | 257 | { |
| 264 | 258 | COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]); |
| 265 | 259 | palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10)); |
| r7500 | r7501 | |
| 267 | 261 | |
| 268 | 262 | /* map 32-bit writes to 16-bit */ |
| 269 | 263 | |
| 270 | static READ32_HANDLER( backfire_pf1_rowscroll_r ) { return deco16_pf1_rowscroll[offset]^0xffff0000; } | |
| 271 | static READ32_HANDLER( backfire_pf2_rowscroll_r ) { return deco16_pf2_rowscroll[offset]^0xffff0000; } | |
| 272 | static READ32_HANDLER( backfire_pf3_rowscroll_r ) { return deco16_pf3_rowscroll[offset]^0xffff0000; } | |
| 273 | static READ32_HANDLER( backfire_pf4_rowscroll_r ) { return deco16_pf4_rowscroll[offset]^0xffff0000; } | |
| 274 | static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf1_rowscroll[offset]); } | |
| 275 | static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf2_rowscroll[offset]); } | |
| 276 | static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf3_rowscroll[offset]); } | |
| 277 | static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf4_rowscroll[offset]); } | |
| 278 | static READ32_HANDLER ( backfire_pf12_control_r ) { return deco16_pf12_control[offset]^0xffff0000; } | |
| 279 | static READ32_HANDLER ( backfire_pf34_control_r ) { return deco16_pf34_control[offset]^0xffff0000; } | |
| 280 | static WRITE32_HANDLER( backfire_pf12_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf12_control[offset]); } | |
| 281 | static WRITE32_HANDLER( backfire_pf34_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf34_control[offset]); } | |
| 282 | static READ32_HANDLER( backfire_pf1_data_r ) { return deco16_pf1_data[offset]^0xffff0000; } | |
| 283 | static READ32_HANDLER( backfire_pf2_data_r ) { return deco16_pf2_data[offset]^0xffff0000; } | |
| 284 | static READ32_HANDLER( backfire_pf3_data_r ) { return deco16_pf3_data[offset]^0xffff0000; } | |
| 285 | static READ32_HANDLER( backfire_pf4_data_r ) { return deco16_pf4_data[offset]^0xffff0000; } | |
| 286 | static WRITE32_HANDLER( backfire_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(space,offset,data,mem_mask); } | |
| 287 | static WRITE32_HANDLER( backfire_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(space,offset,data,mem_mask); } | |
| 288 | static WRITE32_HANDLER( backfire_pf3_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf3_data_w(space,offset,data,mem_mask); } | |
| 289 | static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf4_data_w(space,offset,data,mem_mask); } | |
| 264 | static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf1_rowscroll[offset] ^ 0xffff0000; } | |
| 265 | static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf2_rowscroll[offset] ^ 0xffff0000; } | |
| 266 | static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf3_rowscroll[offset] ^ 0xffff0000; } | |
| 267 | static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf4_rowscroll[offset] ^ 0xffff0000; } | |
| 268 | static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); } | |
| 269 | static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); } | |
| 270 | static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); } | |
| 271 | static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); } | |
| 290 | 272 | |
| 273 | ||
| 291 | 274 | #ifdef UNUSED_FUNCTION |
| 292 | 275 | READ32_HANDLER( backfire_unknown_wheel_r ) |
| 293 | 276 | { |
| r7500 | r7501 | |
| 308 | 291 | |
| 309 | 292 | static ADDRESS_MAP_START( backfire_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 310 | 293 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 311 | AM_RANGE(0x100000, 0x10001f) AM_READWRITE( backfire_pf12_control_r, backfire_pf12_control_w) | |
| 312 | AM_RANGE(0x110000, 0x111fff) AM_READWRITE( backfire_pf1_data_r, backfire_pf1_data_w) | |
| 313 | AM_RANGE(0x114000, 0x115fff) AM_READWRITE( backfire_pf2_data_r, backfire_pf2_data_w) | |
| 314 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE( backfire_pf1_rowscroll_r, backfire_pf1_rowscroll_w) | |
| 315 | AM_RANGE(0x124000, 0x124fff) AM_READWRITE( backfire_pf2_rowscroll_r, backfire_pf2_rowscroll_w) | |
| 316 | AM_RANGE(0x130000, 0x13001f) AM_READWRITE( backfire_pf34_control_r, backfire_pf34_control_w) | |
| 317 | AM_RANGE(0x140000, 0x141fff) AM_READWRITE( backfire_pf3_data_r, backfire_pf3_data_w) | |
| 318 | AM_RANGE(0x144000, 0x145fff) AM_READWRITE( backfire_pf4_data_r, backfire_pf4_data_w) | |
| 319 | AM_RANGE(0x150000, 0x150fff) AM_READWRITE( backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w) | |
| 320 | AM_RANGE(0x154000, 0x154fff) AM_READWRITE( backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w) | |
| 321 | AM_RANGE(0x160000, 0x161fff) AM_WRITE(wcvol95_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 322 | AM_RANGE(0x170000, 0x177fff) AM_RAM AM_BASE( &backfire_mainram )// main ram | |
| 294 | AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 295 | AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 296 | AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 297 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE(backfire_pf1_rowscroll_r, backfire_pf1_rowscroll_w) | |
| 298 | AM_RANGE(0x124000, 0x124fff) AM_READWRITE(backfire_pf2_rowscroll_r, backfire_pf2_rowscroll_w) | |
| 299 | AM_RANGE(0x130000, 0x13001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf34_control_dword_r, deco16ic_pf34_control_dword_w) | |
| 300 | AM_RANGE(0x140000, 0x141fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_dword_r, deco16ic_pf3_data_dword_w) | |
| 301 | AM_RANGE(0x144000, 0x145fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_dword_r, deco16ic_pf4_data_dword_w) | |
| 302 | AM_RANGE(0x150000, 0x150fff) AM_READWRITE(backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w) | |
| 303 | AM_RANGE(0x154000, 0x154fff) AM_READWRITE(backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w) | |
| 304 | AM_RANGE(0x160000, 0x161fff) AM_WRITE(backfire_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 305 | AM_RANGE(0x170000, 0x177fff) AM_RAM AM_BASE_MEMBER(backfire_state, mainram)// main ram | |
| 323 | 306 | |
| 324 | 307 | // AM_RANGE(0x180010, 0x180013) AM_RAM AM_BASE(&backfire_180010) // always 180010 ? |
| 325 | 308 | // AM_RANGE(0x188010, 0x188013) AM_RAM AM_BASE(&backfire_188010) // always 188010 ? |
| 326 | 309 | |
| 327 | AM_RANGE(0x184000, 0x185fff) AM_RAM AM_BASE( &backfire_spriteram32_1 ) | |
| 328 | AM_RANGE(0x18c000, 0x18dfff) AM_RAM AM_BASE( &backfire_spriteram32_2 ) | |
| 310 | AM_RANGE(0x184000, 0x185fff) AM_RAM AM_BASE_MEMBER(backfire_state, spriteram_1) | |
| 311 | AM_RANGE(0x18c000, 0x18dfff) AM_RAM AM_BASE_MEMBER(backfire_state, spriteram_2) | |
| 329 | 312 | AM_RANGE(0x190000, 0x190003) AM_DEVREAD("eeprom", backfire_eeprom_r) |
| 330 | 313 | AM_RANGE(0x194000, 0x194003) AM_READ(backfire_control2_r) |
| 331 | 314 | AM_RANGE(0x1a4000, 0x1a4003) AM_DEVWRITE("eeprom", backfire_eeprom_w) |
| 332 | 315 | |
| 333 | AM_RANGE(0x1a8000, 0x1a8003) AM_RAM AM_BASE(&backfire_left_priority) | |
| 334 | AM_RANGE(0x1ac000, 0x1ac003) AM_RAM AM_BASE(&backfire_right_priority) | |
| 316 | AM_RANGE(0x1a8000, 0x1a8003) AM_RAM AM_BASE_MEMBER(backfire_state, left_priority) | |
| 317 | AM_RANGE(0x1ac000, 0x1ac003) AM_RAM AM_BASE_MEMBER(backfire_state, right_priority) | |
| 335 | 318 | // AM_RANGE(0x1b0000, 0x1b0003) AM_WRITENOP // always 1b0000 |
| 336 | 319 | |
| 337 | 320 | /* when set to pentometer in test mode */ |
| r7500 | r7501 | |
| 462 | 445 | |
| 463 | 446 | |
| 464 | 447 | |
| 448 | static int backfire_bank_callback( int bank ) | |
| 449 | { | |
| 450 | // mame_printf_debug("bank callback %04x\n",bank); // bit 1 gets set too? | |
| 451 | bank = bank >> 4; | |
| 452 | bank = (bank & 1) | ((bank & 4) >> 1) | ((bank & 2) << 1); | |
| 453 | ||
| 454 | return bank * 0x1000; | |
| 455 | } | |
| 456 | ||
| 457 | static const deco16ic_interface backfire_deco16ic_intf = | |
| 458 | { | |
| 459 | "lscreen", | |
| 460 | 0, 0, 1, | |
| 461 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 462 | 0x00, 0x40, 0x10, 0x50, /* color base */ | |
| 463 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 464 | backfire_bank_callback, | |
| 465 | backfire_bank_callback, | |
| 466 | backfire_bank_callback, | |
| 467 | backfire_bank_callback | |
| 468 | }; | |
| 469 | ||
| 470 | static MACHINE_START( backfire ) | |
| 471 | { | |
| 472 | backfire_state *state = (backfire_state *)machine->driver_data; | |
| 473 | ||
| 474 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 475 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 476 | state->lscreen = devtag_get_device(machine, "lscreen"); | |
| 477 | state->rscreen = devtag_get_device(machine, "rscreen"); | |
| 478 | state->eeprom = devtag_get_device(machine, "eeprom"); | |
| 479 | } | |
| 480 | ||
| 465 | 481 | static MACHINE_DRIVER_START( backfire ) |
| 466 | 482 | |
| 483 | /* driver data */ | |
| 484 | MDRV_DRIVER_DATA(backfire_state) | |
| 485 | ||
| 467 | 486 | /* basic machine hardware */ |
| 468 | 487 | MDRV_CPU_ADD("maincpu", ARM, 28000000/4) /* Unconfirmed */ |
| 469 | 488 | MDRV_CPU_PROGRAM_MAP(backfire_map) |
| r7500 | r7501 | |
| 471 | 490 | |
| 472 | 491 | MDRV_EEPROM_93C46_ADD("eeprom") |
| 473 | 492 | |
| 493 | MDRV_MACHINE_START(backfire) | |
| 494 | ||
| 474 | 495 | /* video hardware */ |
| 475 | 496 | MDRV_PALETTE_LENGTH(2048) |
| 476 | 497 | MDRV_GFXDECODE(backfire) |
| r7500 | r7501 | |
| 493 | 514 | MDRV_VIDEO_START(backfire) |
| 494 | 515 | MDRV_VIDEO_UPDATE(backfire) |
| 495 | 516 | |
| 517 | MDRV_DECO16IC_ADD("deco_custom", backfire_deco16ic_intf) | |
| 518 | ||
| 496 | 519 | /* sound hardware */ |
| 497 | 520 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 498 | 521 | |
| r7500 | r7501 | |
| 631 | 654 | UINT8 *buf1 = auto_alloc_array(machine, UINT8, length); |
| 632 | 655 | UINT32 x; |
| 633 | 656 | |
| 634 | for (x=0;x<length;x++) | |
| 657 | for (x = 0; x < length; x++) | |
| 635 | 658 | { |
| 636 | 659 | UINT32 addr; |
| 637 | 660 | |
| r7500 | r7501 | |
| 645 | 668 | buf1[addr] = rom[x]; |
| 646 | 669 | } |
| 647 | 670 | |
| 648 | memcpy(rom,buf1,length); | |
| 671 | memcpy(rom, buf1, length); | |
| 649 | 672 | |
| 650 | auto_free | |
| 673 | auto_free | |
| 651 | 674 | } |
| 652 | 675 | |
| 653 | 676 | static READ32_HANDLER( backfire_speedup_r ) |
| 654 | 677 | { |
| 655 | ||
| 678 | b | |
| 656 | 679 | |
| 657 | if (cpu_get_pc(space->cpu)==0xce44) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfire | |
| 658 | if (cpu_get_pc(space->cpu)==0xcee4) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfirea | |
| 680 | //mame_printf_debug( "%08x\n",cpu_get_pc(space->cpu)); | |
| 659 | 681 | |
| 660 | return backfire_mainram[0x18/4]; | |
| 682 | if (cpu_get_pc(space->cpu )== 0xce44) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfire | |
| 683 | if (cpu_get_pc(space->cpu) == 0xcee4) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfirea | |
| 684 | ||
| 685 | return state->mainram[0x18/4]; | |
| 661 | 686 | } |
| 662 | 687 | |
| 663 | 688 | |
| r7500 | r7501 | |
| 671 | 696 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); |
| 672 | 697 | } |
| 673 | 698 | |
| 674 | GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 ) | |
| 675 | GAME( 1995, backfirea,backfire, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 2)", 0 ) // defaults to wheel controls, must change to joystick to play | |
| 699 | GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", GAME_SUPPORTS_SAVE ) | |
| 700 | GAME( 1995, backfirea, backfire, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 2)", GAME_SUPPORTS_SAVE ) // defaults to wheel controls, must change to joystick to play |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | * The freakish graphics encoding scheme, which no other MAME-supported game uses |
| 12 | 12 | * The sprite-ram, and all the funky parameters that go along with it |
| 13 | 13 | |
| 14 | ||
| 15 | Stephh's notes (based on the games Z80 code and some tests) : | |
| 16 | ||
| 17 | 1) 'exerion' | |
| 18 | ||
| 19 | - The coin insertion routine (code at 0x0066) is buggy as you get a credit | |
| 20 | on first coin after initialisation even if you need more than 1 coin for 1 credit : | |
| 21 | * when coinage is set to 2C_1C, you get a credit when inserting | |
| 22 | 1, 2, 4, 6 ... multiples of 2 coins | |
| 23 | * when coinage is set to 3C_1C, you get a credit when inserting | |
| 24 | 1, 3, 6, 9 ... multiples of 3 coins | |
| 25 | * when coinage is set to 4C_1C, you get a credit when inserting | |
| 26 | 1, 4, 8, 12 ... multiples of 4 coins | |
| 27 | * when coinage is set to 5C_1C, you get a credit when inserting | |
| 28 | 1, 5, 10, 15 ... multiples of 5 coins | |
| 29 | - According to the Dip Switches sheet, difficulty is handled by DSW0 bits 5 and 6. | |
| 30 | In fact, bit 6 determines the overall difficulty (0x40 = OFF easy - 0x00 = ON hard) | |
| 31 | while bit 5 determines enemies' number of bullets (0x20 = OFF for less bullets and | |
| 32 | 0x00 = ON for more bullets). | |
| 33 | - When starting a 1 or 2 players game, 2 checksums are computed (code at 0x00e4) : | |
| 34 | one from 0x05f0 to 0x06ee (stored at 0x6030), one from 0x00d8 to 0x01d6 (stored | |
| 35 | at 0x6031). Contents of 0x0625 is also stored to 0x6032. | |
| 36 | - Each time before attract mode sequence starts, a checksum is computed from 0x0000 | |
| 37 | to 0x1fff (code at 0x28b8) if 17th score in the high-score table is not 0. | |
| 38 | If checksum doesn't match the hardcoded value (0xb5), you get one more credit | |
| 39 | and you are allowed to continue the game with an extra life (score, charge and | |
| 40 | level are not reset to original values). | |
| 41 | - At the begining of each life of each player, a checksum is computed from 0x4100 | |
| 42 | to 0x4dff (code at 0x07d8) if 1st score in the high-score table is >= 80000. | |
| 43 | If checksum doesn't match the hardcoded value (0x63), you get 255 credits ! | |
| 44 | Notice that the displayed number of credits won't be correct as the game | |
| 45 | isn't suppose to allow more than 9 credits. | |
| 46 | - In a 2 players game, when player changes, if player it was player 2 turn, | |
| 47 | values from 0x6030 to 0x6032 (see above) are compared with hard-coded values | |
| 48 | (code at 0x04c8). If they don't match respectively 0xfe, 0xb3 and 0x4c, | |
| 49 | and if 9th score in the high-score table is not 0, the game resets ! | |
| 50 | - Before entering player's initials, a checksum is computed from 0x5f00 to 0x5fff | |
| 51 | (code at 0x5bd0) if player has reached level 6 (2nd kind of enemies after bonus | |
| 52 | stage). If checksum doesn't match the hardcoded value (0x9a), the game resets ! | |
| 53 | - There is sort of protection routine at 0x4120 which has an effect when | |
| 54 | player loses a life on reaching first bonus stage or after. If values read | |
| 55 | from 0x6008 to 0x600b don't match values from ROM area 0x33c0-0x33ff, | |
| 56 | the game resets. See 'exerion_protection_r' read handler. | |
| 57 | - There is an unknown routine at 0x5f70 which is called when the game boots | |
| 58 | which reads value from 0x600c and see if it matches a hardcoded value (0xbe). | |
| 59 | If they don't match, the game resets after displaying the high-scores table. | |
| 60 | - There is another unknown routine at 0x414e which is called when a game is over | |
| 61 | which reads value from 0x600c and see if it matches value from ROM area | |
| 62 | 0x4000-0x400f based on internal timer value for a game at 0x604a. If they don't | |
| 63 | match, its only effect is to set lives to 0, which is always the case when the | |
| 64 | game is over, so it doesn't seem to have any real effect. | |
| 65 | Was it supposed to be called at another time ? | |
| 66 | - The routine at 0x5f90 writes to adresses 0x6008-0x600c values read from AY port A | |
| 67 | (one write after one read). This routine is called by the 2 unknown routines. | |
| 68 | ||
| 69 | 2) 'exeriont' | |
| 70 | ||
| 71 | - The coin insertion routine is fixed in this set (see the subttle changes | |
| 72 | in the code from 0x0077 to 0x0082). | |
| 73 | - The routine at 0x28b8 is the same as in 'exerion' (same hardcoded value). | |
| 74 | - The routine at 0x07d8 is the same as in 'exerion' (same hardcoded value). | |
| 75 | - The routine at 0x04c8 is the same as in 'exerion' (same hardcoded values). | |
| 76 | - The routine at 0x5bd0 is the same as in 'exerion' (same hardcoded value). | |
| 77 | - The routine at 0x4120 is the same as in 'exerion', but data from 0x33c0 to 0x33ff | |
| 78 | is slightly different : | |
| 79 | ||
| 80 | address exerion exeriont | |
| 81 | 0x33c1: 0x3e 0x36 | |
| 82 | 0x33c2: 0x37 0x32 | |
| 83 | 0x33c8: 0x76 0x7e | |
| 84 | 0x33ca: 0x32 0x26 | |
| 85 | 0x33cb: 0x34 0x1e | |
| 86 | 0x33d5: 0x07 0x3f | |
| 87 | 0x33fc: 0x76 0x40 | |
| 88 | 0x33fd: 0x37 0x00 | |
| 89 | 0x33fe: 0x32 0x00 | |
| 90 | 0x33ff: 0x26 0x00 | |
| 91 | ||
| 92 | - The routine at 0x5f70 is similar to the one in 'exerion' (hardcoded value = 0x9e). | |
| 93 | - The routine at 0x414e is the same as in 'exerion', but data from 0x4000 to 0x400f | |
| 94 | is slightly different : | |
| 95 | ||
| 96 | address exerion exeriont | |
| 97 | 0x4002: 0xb2 0x9e | |
| 98 | 0x400f: 0xbe 0x9e | |
| 99 | ||
| 100 | - The routine at 0x5f90 is the same as in 'exerion'. | |
| 101 | ||
| 102 | 3) 'exerionb' | |
| 103 | ||
| 104 | - This set is based on 'exerion' as the coin insertion routine at 0x0066 | |
| 105 | (and as a consequence the bug) is the same. | |
| 106 | - The routine at 0x28b8 has been patched, so you can never see the "continue" feature. | |
| 107 | - The routine at 0x07d8 has been patched, so you can never get 255 credits. | |
| 108 | - The routine at 0x04c8 and the computed values from 0x6030 to 0x6032 are surprisingly | |
| 109 | the same as in 'exerion'. | |
| 110 | - The routine at 0x5bd0 has been patched, so the game can't reset. | |
| 111 | - The "protection" routine at 0x4120 has been patched, so the game can't reset. | |
| 112 | - The first unknown routine at 0x5f70 has been patched, so the game can't reset. | |
| 113 | - The second unknown routine at 0x414e has been patched, so lives can't be set to 0. | |
| 114 | - The routine at 0x5f90 is completely different : it reads values from AY port A, | |
| 115 | but nothing is written to adresses 0x6008-0x600c, and there are lots of writes | |
| 116 | to AY port B (0xd001) due to extra code at 0x0050 and extra data at 0x0040. | |
| 117 | ||
| 14 | 118 | ***************************************************************************/ |
| 15 | 119 | |
| 16 | 120 | #include "emu.h" |
| r7500 | r7501 | |
| 25 | 129 | * |
| 26 | 130 | *************************************/ |
| 27 | 131 | |
| 28 | static READ8_HANDLER( exerion_port01_r ) | |
| 132 | /* Players inputs are muxed at 0xa000 */ | |
| 133 | static CUSTOM_INPUT( exerion_controls_r ) | |
| 29 | 134 | { |
| 30 | exerion_state *state = (exerion_state *)space->machine->driver_data; | |
| 31 | /* the cocktail flip bit muxes between ports 0 and 1 */ | |
| 32 | return state->cocktail_flip ? input_port_read(space->machine, "IN1") : input_port_read(space->machine, "IN0"); | |
| 135 | static const char *const inname[2] = { "P1", "P2" }; | |
| 136 | exerion_state *state = (exerion_state *)field->port->machine->driver_data; | |
| 137 | return input_port_read(field->port->machine, inname[state->cocktail_flip]) & 0x3f; | |
| 33 | 138 | } |
| 34 | 139 | |
| 35 | 140 | |
| r7500 | r7501 | |
| 48 | 153 | * |
| 49 | 154 | *************************************/ |
| 50 | 155 | |
| 51 | /* This is the first of many Exerion "features | |
| 156 | /* This is the first of many Exerion "features | |
| 52 | 157 | /* protection or some sort of timer. */ |
| 53 | 158 | static READ8_DEVICE_HANDLER( exerion_porta_r ) |
| 54 | 159 | { |
| r7500 | r7501 | |
| 61 | 166 | static WRITE8_DEVICE_HANDLER( exerion_portb_w ) |
| 62 | 167 | { |
| 63 | 168 | exerion_state *state = (exerion_state *)device->machine->driver_data; |
| 64 | ||
| 65 | 169 | /* pull the expected value from the ROM */ |
| 66 | 170 | state->porta = memory_region(device->machine, "maincpu")[0x5f76]; |
| 67 | 171 | state->portb = data; |
| r7500 | r7501 | |
| 73 | 177 | static READ8_HANDLER( exerion_protection_r ) |
| 74 | 178 | { |
| 75 | 179 | exerion_state *state = (exerion_state *)space->machine->driver_data; |
| 76 | ||
| 77 | 180 | if (cpu_get_pc(space->cpu) == 0x4143) |
| 78 | 181 | return memory_region(space->machine, "maincpu")[0x33c0 + (state->main_ram[0xd] << 2) + offset]; |
| 79 | 182 | else |
| r7500 | r7501 | |
| 95 | 198 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_SIZE_MEMBER(exerion_state, videoram, videoram_size) |
| 96 | 199 | AM_RANGE(0x8800, 0x887f) AM_RAM AM_BASE_SIZE_MEMBER(exerion_state, spriteram, spriteram_size) |
| 97 | 200 | AM_RANGE(0x8800, 0x8bff) AM_RAM |
| 98 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 201 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 99 | 202 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW0") |
| 100 | 203 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1") |
| 101 | 204 | AM_RANGE(0xc000, 0xc000) AM_WRITE(exerion_videoreg_w) |
| r7500 | r7501 | |
| 129 | 232 | * |
| 130 | 233 | *************************************/ |
| 131 | 234 | |
| 235 | /* verified from Z80 code */ | |
| 132 | 236 | static INPUT_PORTS_START( exerion ) |
| 133 | PORT_START("IN0") /* player 1 inputs (muxed on 0xa000) */ | |
| 134 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
| 135 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
| 136 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
| 137 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
| 138 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 139 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 237 | PORT_START("IN0") | |
| 238 | PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(exerion_controls_r, (void *)0) | |
| 140 | 239 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) |
| 141 | 240 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 142 | 241 | |
| 143 | PORT_START("IN1") /* player 2 inputs (muxed on 0xa000) */ | |
| 144 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
| 145 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 146 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 147 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 148 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 149 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 150 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) | |
| 151 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) | |
| 152 | ||
| 153 | PORT_START("DSW0") /* dip switches (0xa800) */ | |
| 242 | PORT_START("DSW0") | |
| 154 | 243 | PORT_DIPNAME( 0x07, 0x02, DEF_STR( Lives ) ) |
| 155 | 244 | PORT_DIPSETTING( 0x00, "1" ) |
| 156 | 245 | PORT_DIPSETTING( 0x01, "2" ) |
| 157 | 246 | PORT_DIPSETTING( 0x02, "3" ) |
| 158 | 247 | PORT_DIPSETTING( 0x03, "4" ) |
| 159 | 248 | PORT_DIPSETTING( 0x04, "5" ) |
| 160 | PORT_DIPSETTING( 0x07, "Infinite (Cheat)") | |
| 249 | // PORT_DIPSETTING( 0x05, "5" ) /* duplicated setting */ | |
| 250 | // PORT_DIPSETTING( 0x06, "5" ) /* duplicated setting */ | |
| 251 | PORT_DIPSETTING( 0x07, "254 (Cheat)") | |
| 161 | 252 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Bonus_Life ) ) |
| 162 | 253 | PORT_DIPSETTING( 0x00, "10000" ) |
| 163 | 254 | PORT_DIPSETTING( 0x08, "20000" ) |
| 164 | 255 | PORT_DIPSETTING( 0x10, "30000" ) |
| 165 | 256 | PORT_DIPSETTING( 0x18, "40000" ) |
| 166 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* used */ | |
| 167 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 168 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 169 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) | |
| 257 | PORT_DIPNAME( 0x60, 0x00, DEF_STR( Difficulty ) ) /* see notes */ | |
| 170 | 258 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 259 | PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) | |
| 171 | 260 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 261 | PORT_DIPSETTING( 0x60, DEF_STR( Hardest ) ) | |
| 172 | 262 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) |
| 173 | 263 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 174 | 264 | PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) |
| 175 | 265 | |
| 176 | PORT_START("DSW1") | |
| 266 | PORT_START("DSW1") | |
| 177 | 267 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 178 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) | |
| 179 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 180 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 181 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) | |
| 268 | PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) ) /* see notes */ | |
| 269 | PORT_DIPSETTING( 0x0e, DEF_STR( 5C_1C ) ) | |
| 270 | PORT_DIPSETTING( 0x0a, DEF_STR( 4C_1C ) ) | |
| 271 | PORT_DIPSETTING( 0x06, DEF_STR( 3C_1C ) ) | |
| 272 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 182 | 273 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 183 | 274 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 184 | 275 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) |
| r7500 | r7501 | |
| 187 | 278 | |
| 188 | 279 | PORT_START("COIN") |
| 189 | 280 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) |
| 281 | ||
| 282 | PORT_START("P1") /* fake input port */ | |
| 283 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 284 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 285 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 286 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 287 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 288 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 289 | ||
| 290 | PORT_START("P2") /* fake input port */ | |
| 291 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 292 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 293 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 294 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 295 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 296 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 190 | 297 | INPUT_PORTS_END |
| 191 | 298 | |
| 192 | 299 |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Mosaic (c) 1990 Space | |
| 3 | Mosaic (c) 1990 Space | |
| 4 | 4 | |
| 5 | Notes: | |
| 6 | - the ROM OK / RAM OK message in service mode is fake: ROM and RAM are not tested. | |
| 5 | Notes: | |
| 6 | - the ROM OK / RAM OK message in service mode is fake: ROM and RAM are not tested. | |
| 7 | 7 | |
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z180/z180.h" |
| 12 | 12 | #include "sound/2203intf.h" |
| 13 | #include "includes/mosaic.h" | |
| 13 | 14 | |
| 14 | ||
| 15 | extern UINT8 *mosaic_fgvideoram; | |
| 16 | extern UINT8 *mosaic_bgvideoram; | |
| 17 | WRITE8_HANDLER( mosaic_fgvideoram_w ); | |
| 18 | WRITE8_HANDLER( mosaic_bgvideoram_w ); | |
| 19 | VIDEO_START( mosaic ); | |
| 20 | VIDEO_UPDATE( mosaic ); | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | static int prot_val; | |
| 25 | ||
| 26 | 15 | static WRITE8_HANDLER( protection_w ) |
| 27 | 16 | { |
| 28 | if ((data & 0x80) == 0) | |
| 17 | mosaic_state *state = (mosaic_state *)space->machine->driver_data; | |
| 18 | ||
| 19 | if (!BIT(data, 7)) | |
| 29 | 20 | { |
| 30 | 21 | /* simply increment given value */ |
| 31 | prot_val = (data + 1) << 8; | |
| 22 | state->prot_val = (data + 1) << 8; | |
| 32 | 23 | } |
| 33 | 24 | else |
| 34 | 25 | { |
| r7500 | r7501 | |
| 43 | 34 | 0x411f, 0x473f |
| 44 | 35 | }; |
| 45 | 36 | |
| 46 | prot_val = jumptable[data & 0x7f]; | |
| 37 | state->prot_val = jumptable[data & 0x7f]; | |
| 47 | 38 | } |
| 48 | 39 | } |
| 49 | 40 | |
| 50 | 41 | static READ8_HANDLER( protection_r ) |
| 51 | 42 | { |
| 52 | int res = (prot_val >> 8) & 0xff; | |
| 43 | mosaic_state *state = (mosaic_state *)space->machine->driver_data; | |
| 44 | int res = (state->prot_val >> 8) & 0xff; | |
| 53 | 45 | |
| 54 | logerror("%06x: protection_r %02x\n",cpu_get_pc(space->cpu),res); | |
| 46 | logerror("%06x: protection_r %02x\n", cpu_get_pc(space->cpu), res); | |
| 55 | 47 | |
| 56 | prot_val <<= 8; | |
| 48 | state->prot_val <<= 8; | |
| 57 | 49 | |
| 58 | 50 | return res; |
| 59 | 51 | } |
| 60 | 52 | |
| 61 | 53 | static WRITE8_HANDLER( gfire2_protection_w ) |
| 62 | 54 | { |
| 63 | | |
| 55 | mosaic_state | |
| 64 | 56 | |
| 57 | logerror("%06x: protection_w %02x\n", cpu_get_pc(space->cpu), data); | |
| 58 | ||
| 65 | 59 | switch(data) |
| 66 | 60 | { |
| 67 | 61 | case 0x01: |
| 68 | 62 | /* written repeatedly; no effect?? */ |
| 69 | 63 | break; |
| 70 | 64 | case 0x02: |
| 71 | prot_val = 0x0a10; | |
| 65 | state->prot_val = 0x0a10; | |
| 72 | 66 | break; |
| 73 | 67 | case 0x04: |
| 74 | prot_val = 0x0a15; | |
| 68 | state->prot_val = 0x0a15; | |
| 75 | 69 | break; |
| 76 | 70 | case 0x06: |
| 77 | prot_val = 0x80e3; | |
| 71 | state->prot_val = 0x80e3; | |
| 78 | 72 | break; |
| 79 | 73 | case 0x08: |
| 80 | prot_val = 0x0965; | |
| 74 | state->prot_val = 0x0965; | |
| 81 | 75 | break; |
| 82 | 76 | case 0x0a: |
| 83 | prot_val = 0x04b4; | |
| 77 | state->prot_val = 0x04b4; | |
| 84 | 78 | break; |
| 85 | 79 | } |
| 86 | 80 | } |
| 87 | 81 | |
| 88 | 82 | static READ8_HANDLER( gfire2_protection_r ) |
| 89 | 83 | { |
| 90 | int res = prot_val & 0xff; | |
| 84 | mosaic_state *state = (mosaic_state *)space->machine->driver_data; | |
| 85 | int res = state->prot_val & 0xff; | |
| 91 | 86 | |
| 92 | prot_val >>= 8; | |
| 87 | state->prot_val >>= 8; | |
| 93 | 88 | |
| 94 | 89 | return res; |
| 95 | 90 | } |
| r7500 | r7501 | |
| 99 | 94 | static ADDRESS_MAP_START( mosaic_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 100 | 95 | AM_RANGE(0x00000, 0x0ffff) AM_ROM |
| 101 | 96 | AM_RANGE(0x20000, 0x21fff) AM_RAM |
| 102 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE(&mosaic_bgvideoram) | |
| 103 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE(&mosaic_fgvideoram) | |
| 97 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE_MEMBER(mosaic_state, bgvideoram) | |
| 98 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE_MEMBER(mosaic_state, fgvideoram) | |
| 104 | 99 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_BASE_GENERIC(paletteram) |
| 105 | 100 | ADDRESS_MAP_END |
| 106 | 101 | |
| 107 | 102 | static ADDRESS_MAP_START( gfire2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 108 | 103 | AM_RANGE(0x00000, 0x0ffff) AM_ROM |
| 109 | 104 | AM_RANGE(0x10000, 0x17fff) AM_RAM |
| 110 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE(&mosaic_bgvideoram) | |
| 111 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE(&mosaic_fgvideoram) | |
| 105 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE_MEMBER(mosaic_state, bgvideoram) | |
| 106 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE_MEMBER(mosaic_state, fgvideoram) | |
| 112 | 107 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_BASE_GENERIC(paletteram) |
| 113 | 108 | ADDRESS_MAP_END |
| 114 | 109 | |
| r7500 | r7501 | |
| 258 | 253 | |
| 259 | 254 | |
| 260 | 255 | |
| 256 | static MACHINE_START( mosaic ) | |
| 257 | { | |
| 258 | mosaic_state *state = (mosaic_state *)machine->driver_data; | |
| 259 | ||
| 260 | state_save_register_global(machine, state->prot_val); | |
| 261 | } | |
| 262 | ||
| 263 | static MACHINE_RESET( mosaic ) | |
| 264 | { | |
| 265 | mosaic_state *state = (mosaic_state *)machine->driver_data; | |
| 266 | ||
| 267 | state->prot_val = 0; | |
| 268 | } | |
| 269 | ||
| 261 | 270 | static MACHINE_DRIVER_START( mosaic ) |
| 271 | ||
| 272 | /* driver data */ | |
| 273 | MDRV_DRIVER_DATA(mosaic_state) | |
| 274 | ||
| 275 | /* basic machine hardware */ | |
| 262 | 276 | MDRV_CPU_ADD("maincpu", Z180, 7000000) /* ??? */ |
| 263 | 277 | MDRV_CPU_PROGRAM_MAP(mosaic_map) |
| 264 | 278 | MDRV_CPU_IO_MAP(mosaic_io_map) |
| 265 | 279 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 266 | 280 | |
| 281 | MDRV_MACHINE_START(mosaic) | |
| 282 | MDRV_MACHINE_RESET(mosaic) | |
| 283 | ||
| 267 | 284 | /* video hardware */ |
| 268 | 285 | MDRV_SCREEN_ADD("screen", RASTER) |
| 269 | 286 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include "machine/ticket.h" |
| 25 | 25 | #include "sound/okim6295.h" |
| 26 | 26 | |
| 27 | typedef struct _astrocorp_state astrocorp_state; | |
| 28 | struct _astrocorp_state | |
| 27 | class astrocorp_state | |
| 29 | 28 | { |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astrocorp_state(machine)); } | |
| 31 | ||
| 32 | astrocorp_state(running_machine &machine) { } | |
| 33 | ||
| 30 | 34 | /* memory pointers */ |
| 31 | 35 | UINT16 * spriteram; |
| 32 | 36 | UINT16 * paletteram; |
| r7500 | r7501 | |
|---|---|---|
| 65 | 65 | #include "video/resnet.h" |
| 66 | 66 | #include "sound/ay8910.h" |
| 67 | 67 | |
| 68 | static UINT16 *shared_ram; | |
| 69 | static unsigned deposits1=0, deposits2=0, credits=0; | |
| 68 | class meijinsn_state | |
| 69 | { | |
| 70 | public: | |
| 71 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, meijinsn_state(machine)); } | |
| 70 | 72 | |
| 73 | meijinsn_state(running_machine &machine) { } | |
| 74 | ||
| 75 | /* memory pointers */ | |
| 76 | UINT16 * shared_ram; | |
| 77 | UINT16 * videoram; | |
| 78 | ||
| 79 | /* video-related */ | |
| 80 | tilemap_t *bg_tilemap,*fg_tilemap; | |
| 81 | UINT8 bg_bank; | |
| 82 | ||
| 83 | /* misc */ | |
| 84 | UINT8 deposits1, deposits2, credits; | |
| 85 | UINT8 coinvalue; | |
| 86 | int mcu_latch; | |
| 87 | }; | |
| 88 | ||
| 89 | ||
| 90 | ||
| 71 | 91 | static WRITE16_HANDLER( sound_w ) |
| 72 | 92 | { |
| 73 | if(ACCESSING_BITS_0_7) | |
| 74 | soundlatch_w(space, 0, data&0xff); | |
| 93 | if (ACCESSING_BITS_0_7) | |
| 94 | soundlatch_w(space, 0, data & 0xff); | |
| 75 | 95 | } |
| 76 | 96 | |
| 77 | 97 | static READ16_HANDLER( alpha_mcu_r ) |
| 78 | 98 | { |
| 79 | static unsigned coinvalue=0; | |
| 80 | static const UINT8 coinage1[2][2]={{1,1},{1,2}}; | |
| 81 | static const UINT8 coinage2[2][2]={{1,5},{2,1}}; | |
| 99 | meijinsn_state *state = (meijinsn_state *)space->machine->driver_data; | |
| 100 | static const UINT8 coinage1[2][2] = {{1,1}, {1,2}}; | |
| 101 | static const UINT8 coinage2[2][2] = {{1,5}, {2,1}}; | |
| 82 | 102 | |
| 83 | static int latch; | |
| 84 | int source=shared_ram[offset]; | |
| 103 | int source = state->shared_ram[offset]; | |
| 85 | 104 | |
| 86 | 105 | switch (offset) |
| 87 | 106 | { |
| 88 | 107 | case 0: /* Dipswitch 2 */ |
| 89 | shared_ram[0] = (source&0xff00)|input_port_read(space->machine, "DSW"); | |
| 108 | state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "DSW"); | |
| 90 | 109 | return 0; |
| 91 | 110 | |
| 92 | 111 | case 0x22: /* Coin value */ |
| 93 | shared_ram[0x22] = (source&0xff00)|(credits&0x00ff); | |
| 112 | state->shared_ram[0x22] = (source & 0xff00) | (state->credits & 0x00ff); | |
| 94 | 113 | return 0; |
| 95 | 114 | |
| 96 | 115 | case 0x29: /* Query microcontroller for coin insert */ |
| 97 | 116 | |
| 98 | credits=0; | |
| 117 | state->credits = 0; | |
| 99 | 118 | |
| 100 | if ((input_port_read(space->machine, "COINS")&0x3)==3) latch=0; | |
| 119 | if ((input_port_read(space->machine, "COINS") & 0x3) == 3) | |
| 120 | state->mcu_latch = 0; | |
| 101 | 121 | |
| 102 | if ((input_port_read(space->machine, "COINS")&0x1)==0 && !latch) | |
| 122 | if ((input_port_read(space->machine, "COINS") & 0x1) == 0 && !state->mcu_latch) | |
| 103 | 123 | { |
| 104 | shared_ram[0x29] = (source&0xff00)|(0x22); // coinA | |
| 105 | shared_ram[0x22] = (source&0xff00)|0x0; | |
| 106 | latch=1; | |
| 124 | state->shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 125 | state->shared_ram[0x22] = (source & 0xff00) | 0x00; | |
| 126 | state->mcu_latch = 1; | |
| 107 | 127 | |
| 108 | coinvalue = (~input_port_read(space->machine, "DSW")>>3) & 1; | |
| 128 | state->coinvalue = (~input_port_read(space->machine, "DSW")>>3) & 1; | |
| 109 | 129 | |
| 110 | deposits1++; | |
| 111 | if (deposits1 == coinage1[coinvalue][0]) | |
| 130 | state->deposits1++; | |
| 131 | if (state->deposits1 == coinage1[state->coinvalue][0]) | |
| 112 | 132 | { |
| 113 | credits = coinage1[coinvalue][1]; | |
| 114 | deposits1 = 0; | |
| 133 | state->credits = coinage1[state->coinvalue][1]; | |
| 134 | state->deposits1 = 0; | |
| 115 | 135 | } |
| 116 | 136 | else |
| 117 | credits = 0; | |
| 137 | state->credits = 0; | |
| 118 | 138 | } |
| 119 | else if ((input_port_read(space->machine, "COINS")&0x2)==0 && !latch) | |
| 139 | else if ((input_port_read(space->machine, "COINS") & 0x2) == 0 && !state->mcu_latch) | |
| 120 | 140 | { |
| 121 | shared_ram[0x29] = (source&0xff00)|(0x22); // coinA | |
| 122 | shared_ram[0x22] = (source&0xff00)|0x0; | |
| 123 | latch=1; | |
| 141 | state->shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 142 | state->shared_ram[0x22] = (source & 0xff00) | 0x00; | |
| 143 | state->mcu_latch = 1; | |
| 124 | 144 | |
| 125 | coinvalue = (~input_port_read(space->machine, "DSW")>>3) & 1; | |
| 145 | state->coinvalue = (~input_port_read(space->machine, "DSW") >> 3) & 1; | |
| 126 | 146 | |
| 127 | deposits2++; | |
| 128 | if (deposits2 == coinage2[coinvalue][0]) | |
| 147 | state->deposits2++; | |
| 148 | if (state->deposits2 == coinage2[state->coinvalue][0]) | |
| 129 | 149 | { |
| 130 | credits = coinage2[coinvalue][1]; | |
| 131 | deposits2 = 0; | |
| 150 | state->credits = coinage2[state->coinvalue][1]; | |
| 151 | state->deposits2 = 0; | |
| 132 | 152 | } |
| 133 | 153 | else |
| 134 | credits = 0; | |
| 154 | state->credits = 0; | |
| 135 | 155 | } |
| 136 | 156 | else |
| 137 | 157 | { |
| 138 | shared_ram[0x29] = (source&0xff00)|0x22; | |
| 158 | state->shared_ram[0x29] = (source & 0xff00) | 0x22; | |
| 139 | 159 | } |
| 140 | 160 | return 0; |
| 141 | 161 | } |
| r7500 | r7501 | |
| 147 | 167 | static ADDRESS_MAP_START( meijinsn_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 148 | 168 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 149 | 169 | AM_RANGE(0x080e00, 0x080fff) AM_READ(alpha_mcu_r) AM_WRITENOP |
| 150 | AM_RANGE(0x100000, 0x107fff) AM_RAM AM_BASE_ | |
| 170 | AM_RANGE(0x100000, 0x107fff) AM_RAM AM_BASE_MEMBER | |
| 151 | 171 | AM_RANGE(0x180000, 0x180dff) AM_RAM |
| 152 | AM_RANGE(0x180e00, 0x180fff) AM_RAM AM_BASE( | |
| 172 | AM_RANGE(0x180e00, 0x180fff) AM_RAM AM_BASE_MEMBER(meijinsn_state, shared_ram) | |
| 153 | 173 | AM_RANGE(0x181000, 0x181fff) AM_RAM |
| 154 | 174 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("P2") |
| 155 | 175 | AM_RANGE(0x1a0000, 0x1a0001) AM_READ_PORT("P1") AM_WRITE(sound_w) |
| r7500 | r7501 | |
| 232 | 252 | 3, resistances_rg, weights_g, 0, 1000+1000, |
| 233 | 253 | 2, resistances_b, weights_b, 0, 1000+1000); |
| 234 | 254 | |
| 235 | for (i = 0;i < machine->config->total_colors;i++) | |
| 255 | for (i = 0; i < machine->config->total_colors; i++) | |
| 236 | 256 | { |
| 237 | int bit0,bit1,bit2,r,g,b; | |
| 257 | int bit0, bit1, bit2, r, g, b; | |
| 238 | 258 | |
| 239 | 259 | /* red component */ |
| 240 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 241 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 242 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 260 | bit0 = BIT(color_prom[i], 0); | |
| 261 | bit1 = BIT(color_prom[i], 1); | |
| 262 | bit2 = BIT(color_prom[i], 2); | |
| 243 | 263 | r = combine_3_weights(weights_r, bit0, bit1, bit2); |
| 244 | 264 | |
| 245 | 265 | /* green component */ |
| 246 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 247 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 248 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 266 | bit0 = BIT(color_prom[i], 3); | |
| 267 | bit1 = BIT(color_prom[i], 4); | |
| 268 | bit2 = BIT(color_prom[i], 5); | |
| 249 | 269 | g = combine_3_weights(weights_g, bit0, bit1, bit2); |
| 250 | 270 | |
| 251 | 271 | /* blue component */ |
| 252 | bit0 = (color_prom[i] >> 6) & 0x01; | |
| 253 | bit1 = (color_prom[i] >> 7) & 0x01; | |
| 272 | bit0 = BIT(color_prom[i], 6); | |
| 273 | bit1 = BIT(color_prom[i], 7); | |
| 254 | 274 | b = combine_2_weights(weights_b, bit0, bit1); |
| 255 | 275 | |
| 256 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); | |
| 276 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 257 | 277 | } |
| 258 | 278 | } |
| 259 | 279 | |
| 260 | 280 | |
| 261 | 281 | static VIDEO_UPDATE(meijinsn) |
| 262 | 282 | { |
| 283 | meijinsn_state *state = (meijinsn_state *)screen->machine->driver_data; | |
| 263 | 284 | int offs; |
| 264 | 285 | |
| 265 | for (offs = 0;offs <0x4000; offs++) | |
| 286 | for (offs = 0; offs < 0x4000; offs++) | |
| 266 | 287 | { |
| 267 | 288 | int sx, sy, x, data1, data2, color, data; |
| 268 | 289 | |
| 269 | 290 | sx = offs >> 8; |
| 270 | 291 | sy = offs & 0xff; |
| 271 | 292 | |
| 272 | data1 = screen->machine->generic.videoram.u16[offs]>>8; | |
| 273 | data2 = screen->machine->generic.videoram.u16[offs]&0xff; | |
| 293 | data1 = state->videoram[offs] >> 8; | |
| 294 | data2 = state->videoram[offs] & 0xff; | |
| 274 | 295 | |
| 275 | for (x=0; x<4; x++) | |
| 296 | for (x = 0; x < 4; x++) | |
| 276 | 297 | { |
| 277 | color= ((data1>>x) & 1) | (((data1>>(4+x)) & 1)<<1); | |
| 278 | data = ((data2>>x) & 1) | (((data2>>(4+x)) & 1)<<1); | |
| 279 | *BITMAP_ADDR16(bitmap, sy, (sx*4 + (3-x))) = color*4 + data; | |
| 298 | color= BIT(data1, x) | (BIT(data1, x + 4) << 1); | |
| 299 | data = BIT(data2, x) | (BIT(data2, x + 4) << 1); | |
| 300 | *BITMAP_ADDR16(bitmap, sy, (sx * 4 + (3 - x))) = color * 4 + data; | |
| 280 | 301 | } |
| 281 | 302 | } |
| 282 | 303 | return 0; |
| r7500 | r7501 | |
| 298 | 319 | DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r) |
| 299 | 320 | }; |
| 300 | 321 | |
| 322 | static MACHINE_START( meijinsn ) | |
| 323 | { | |
| 324 | meijinsn_state *state = (meijinsn_state *)machine->driver_data; | |
| 325 | ||
| 326 | state_save_register_global(machine, state->deposits1); | |
| 327 | state_save_register_global(machine, state->deposits2); | |
| 328 | state_save_register_global(machine, state->credits); | |
| 329 | } | |
| 330 | ||
| 301 | 331 | static MACHINE_RESET( meijinsn ) |
| 302 | 332 | { |
| 303 | deposits1 = 0; | |
| 304 | deposits2 = 0; | |
| 305 | credits = 0; | |
| 333 | meijinsn_state *state = (meijinsn_state *)machine->driver_data; | |
| 334 | ||
| 335 | state->deposits1 = 0; | |
| 336 | state->deposits2 = 0; | |
| 337 | state->credits = 0; | |
| 306 | 338 | } |
| 307 | 339 | |
| 308 | 340 | |
| 309 | 341 | static MACHINE_DRIVER_START( meijinsn ) |
| 342 | ||
| 343 | /* driver data */ | |
| 344 | MDRV_DRIVER_DATA(meijinsn_state) | |
| 345 | ||
| 346 | /* basic machine hardware */ | |
| 310 | 347 | MDRV_CPU_ADD("maincpu", M68000, 9000000 ) |
| 311 | 348 | MDRV_CPU_PROGRAM_MAP(meijinsn_map) |
| 312 | 349 | MDRV_CPU_VBLANK_INT_HACK(meijinsn_interrupt,2) |
| r7500 | r7501 | |
| 316 | 353 | MDRV_CPU_IO_MAP(meijinsn_sound_io_map) |
| 317 | 354 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 160) |
| 318 | 355 | |
| 356 | MDRV_MACHINE_START(meijinsn) | |
| 319 | 357 | MDRV_MACHINE_RESET(meijinsn) |
| 320 | 358 | |
| 321 | 359 | /* video hardware */ |
| r7500 | r7501 | |
| 369 | 407 | ROM_LOAD( "clr", 0x00, 0x20, CRC(7b95b5a7) SHA1(c15be28bcd6f5ffdde659f2d352ae409f04b2557) ) |
| 370 | 408 | ROM_END |
| 371 | 409 | |
| 372 | GAME( 1986, meijinsn, 0, meijinsn, meijinsn, 0, ROT0, "SNK Electronics corp.", "Meijinsen", | |
| 410 | GAME( 1986, meijinsn, 0, meijinsn, meijinsn, 0, ROT0, "SNK Electronics corp.", "Meijinsen", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | static ADDRESS_MAP_START( nitedrvr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 46 | 46 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x100) // SCRAM |
| 47 | AM_RANGE(0x0200, 0x027f) AM_RAM_WRITE(nitedrvr_videoram_w) AM_MIRROR(0x180) AM_BASE_GENERIC(videoram) // PFW | |
| 48 | AM_RANGE(0x0400, 0x05ff) AM_WRITE(nitedrvr_hvc_w) AM_BASE(&nitedrvr_hvc) // POSH, POSV, CHAR, Watchdog | |
| 47 | AM_RANGE(0x0200, 0x027f) AM_RAM_WRITE(nitedrvr_videoram_w) AM_MIRROR(0x180) AM_BASE_MEMBER(nitedrvr_state, videoram) // PFW | |
| 48 | AM_RANGE(0x0400, 0x05ff) AM_WRITE(nitedrvr_hvc_w) AM_BASE_MEMBER(nitedrvr_state, hvc) // POSH, POSV, CHAR, Watchdog | |
| 49 | 49 | AM_RANGE(0x0600, 0x07ff) AM_READ(nitedrvr_in0_r) |
| 50 | 50 | AM_RANGE(0x0800, 0x09ff) AM_READ(nitedrvr_in1_r) |
| 51 | 51 | AM_RANGE(0x0a00, 0x0bff) AM_WRITE(nitedrvr_out0_w) |
| 52 | 52 | AM_RANGE(0x0c00, 0x0dff) AM_WRITE(nitedrvr_out1_w) |
| 53 | AM_RANGE(0x8000, 0x807f) AM_RAM AM_MIRROR(0x380) AM_BASE_ | |
| 53 | AM_RANGE(0x8000, 0x807f) AM_RAM AM_MIRROR(0x380) AM_BASE_MEMBER | |
| 54 | 54 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(nitedrvr_steering_reset_r, nitedrvr_steering_reset_w) |
| 55 | 55 | AM_RANGE(0x9000, 0x9fff) AM_ROM // ROM1-ROM2 |
| 56 | 56 | AM_RANGE(0xfff0, 0xffff) AM_ROM // ROM2 for 6502 vectors |
| r7500 | r7501 | |
| 135 | 135 | /* Machine Driver */ |
| 136 | 136 | |
| 137 | 137 | static MACHINE_DRIVER_START( nitedrvr ) |
| 138 | // basic machine hardware | |
| 138 | ||
| 139 | /* driver data */ | |
| 140 | MDRV_DRIVER_DATA(nitedrvr_state) | |
| 141 | ||
| 142 | /* basic machine hardware */ | |
| 139 | 143 | MDRV_CPU_ADD("maincpu", M6502, XTAL_12_096MHz/12) // 1 MHz |
| 140 | 144 | MDRV_CPU_PROGRAM_MAP(nitedrvr_map) |
| 141 | 145 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r7500 | r7501 | |
| 146 | 150 | |
| 147 | 151 | MDRV_TIMER_ADD_PERIODIC("crash_timer", nitedrvr_crash_toggle_callback, NSEC(PERIOD_OF_555_ASTABLE_NSEC(RES_K(180), 330, CAP_U(1)))) |
| 148 | 152 | |
| 149 | // video hardware | |
| 150 | ||
| 153 | /* video hardware */ | |
| 151 | 154 | MDRV_SCREEN_ADD("screen", RASTER) |
| 152 | 155 | MDRV_SCREEN_REFRESH_RATE(57) // how is this derived? |
| 153 | 156 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| r7500 | r7501 | |
| 162 | 165 | MDRV_VIDEO_START(nitedrvr) |
| 163 | 166 | MDRV_VIDEO_UPDATE(nitedrvr) |
| 164 | 167 | |
| 165 | / | |
| 168 | /* sound hardware */ | |
| 166 | 169 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 167 | 170 | |
| 168 | 171 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) |
| r7500 | r7501 | |
| 201 | 204 | |
| 202 | 205 | /* Game Drivers */ |
| 203 | 206 | |
| 204 | GAME( 1976, nitedrvr, 0, nitedrvr, nitedrvr, 0, ROT0, "Atari", "Night Driver", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE) | |
| 207 | GAME( 1976, nitedrvr, 0, nitedrvr, nitedrvr, 0, ROT0, "Atari", "Night Driver", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 46 | 46 | Older versions are named as: parent + 'o' + progressive number |
| 47 | 47 | In a couple of cases, due to too many older revisions, I used: parent + version + 'o' + progr. num. |
| 48 | 48 | |
| 49 | ||
| 50 | ------------------------------------------------------------ | |
| 51 | ||
| 52 | There is known to be a "Classic Edition Compact Format" PCB | |
| 53 | ||
| 54 | ROM1 (program rom) and ROM2 (sound sample) are stadard 32 pin | |
| 55 | style PROMs. The graphics are stored in ROM3 & ROM4 which | |
| 56 | appear to be surface mounted 8 Mbit roms. | |
| 57 | ||
| 58 | ------------------------------------------------------------ | |
| 59 | ||
| 60 | Model No. S2000-B | |
| 61 | +---------+ +-------------+ +--------------------+ | |
| 62 | | +---+ Connector +---+ | | |
| 63 | | 386D VR1 +---+ +---+ +---+ +---+ | | |
| 64 | | +---+ | R | | R | | R | | R | U | | |
| 65 | +-+ | R | | O | | O | | O | | O | 2 | | |
| 66 | | | O | | M | | M | | M | | M | 1 | | |
| 67 | +-+ | M | | 3 | | 4 | | 5 | | 6 | | | |
| 68 | | | 2 | | | | | | | | | | | |
| 69 | | | | +---+ +---+ +---+ +---+ U | | |
| 70 | |8 ULN2003A +---+ 1 | | |
| 71 | | 5 | | |
| 72 | |L ULN2003A +----+ +----------+ | | |
| 73 | |i |6295| | | MH61C256AH-15 | | |
| 74 | |n +----+ | AMCOE | | | |
| 75 | |e | SGC2000 | | | |
| 76 | |r +------+ | | 25MHz | | |
| 77 | | | | +----------+ 75176 CN2| | |
| 78 | |C | 9536 | CN1| | |
| 79 | |o | | 12MHz 4.9152MHz | | |
| 80 | |n +------+ +-+ | |
| 81 | |n +---+ +---+ +---+ |P| | |
| 82 | |e | 8 | | R | | 5 | |r| | |
| 83 | |c | 6 | | O | | 1 | S |i| | |
| 84 | |t | 1 | | M | | 8 | W |n| | |
| 85 | |o | 7 | | 1 | | 6 | 6 |t| | |
| 86 | |r | 1 | | | | 4 | |e| | |
| 87 | | +---+ +---+ +---+ |r| | |
| 88 | +-+ S S S S S B R +-+ | |
| 89 | | W W W W W A S | | |
| 90 | +-+ 1 2 3 4 5 T T | | |
| 91 | +---------------------------------------------------+ | |
| 92 | ||
| 93 | CPU: Amcoe SGC2000 208PQFP (Z80 core) | |
| 94 | Graphics: HM86171 | |
| 95 | OSC: 25.000MHz, 12.000MHz & 4.9152MHz | |
| 96 | Sound: OKI M6295 | |
| 97 | Other: XILINX XC9536XL (socketted) | |
| 98 | ||
| 99 | HM86171-120 - HMC 28 pin DIP Color Pallete RAMDAC | |
| 100 | ULN2003A - 16 pin DIP Seven Darlington Arrays | |
| 101 | 51864 - V62C51864L-35P 64Kb SRAM | |
| 102 | 75176 - SN75176BP Differential BUS Transceiver (Bidirectional data communication on multipoint bus transmission line) | |
| 103 | 386D - JRC 386D low voltage AMP | |
| 104 | VR1 - Sound adjust pot | |
| 105 | ||
| 106 | BAT - 3.6v battery | |
| 107 | RST - Reset switch (to clear ram?) | |
| 108 | ||
| 109 | CN1 & CN2 are 4 pin link connectors | |
| 110 | ||
| 111 | U15 & U21 are unpopulated 32 pin DIP ROM sockets | |
| 112 | SW1 - SW4 are unpopulated | |
| 113 | ||
| 114 | ------------------------------------------------------------ | |
| 115 | ||
| 116 | Model No. S2000C SALTIRE | |
| 117 | +-------+ +-------------+ +---+----++----+-----+ | |
| 118 | | +---+ Connector +---+ |CN2 ||CN1 |75176| | |
| 119 | | VR1 +----++----+ | | |
| 120 | | 386D +----------+ +----------+ | | |
| 121 | | | ROM2 | | ROM4 | +----------+ | | |
| 122 | | +----------+ +----------+ | ROM5 | | | |
| 123 | +-+ +----+ +----------+ +----------+ | | |
| 124 | | |6295| | ROM3 | +----------+ | | |
| 125 | | +----+ +----------+ | ROM6 | | | |
| 126 | |8 ULN2003A +----------+ | | |
| 127 | | +------+ | | |
| 128 | |L ULN2003A | | | | |
| 129 | |i | 9536 | +----------+ IC61C256AH-12 | | |
| 130 | |n | | | | | | |
| 131 | |e +------+ | AMCOE | | | |
| 132 | |r | SALTIRE | | | |
| 133 | | | | | | |
| 134 | |C +----------+ 25MHz SW1| | |
| 135 | |o | | |
| 136 | |n +-+ | |
| 137 | |n 12MHz 4.9152MHz |P| | |
| 138 | |e |r| | |
| 139 | |c +----------+ |i| | |
| 140 | |t +---------+ | ROM1 | |n| | |
| 141 | |o | HM86171 | +----------+ SW4 |t| | |
| 142 | |r +---------+ |e| | |
| 143 | | FM1608-120 SW5 |r| | |
| 144 | | +-------+ +-+ | |
| 145 | +-+ | VGA | H3 | | |
| 146 | +----------+-------+-------------------------------+ | |
| 147 | ||
| 148 | Basicly the same as the VCG-1 SALTIRE below, but the | |
| 149 | XILINX chip is socketted and no H1 or H2 connector. | |
| 150 | ||
| 151 | ------------------------------------------------------------ | |
| 152 | ||
| 153 | Starting in 2005 with Money Machine and later | |
| 154 | ||
| 155 | Model No. VCG-1 SALTIRE | |
| 156 | +-------+ +-------------+ +---+----++----+-----+ | |
| 157 | | +---+ Connector +---+ |CN2 ||CN1 |75176| | |
| 158 | | VR1 +----++----+ | | |
| 159 | | 386D +----------+ +----------+ | | |
| 160 | | | ROM2 | | ROM4 | +----------+ | | |
| 161 | | +----------+ +----------+ | ROM5 | | | |
| 162 | +-+ +----+ +----------+ +----------+ | | |
| 163 | | |6295| | ROM3 | +----------+ | | |
| 164 | | +----+ +----------+ | ROM6 | | | |
| 165 | |8 ULN2003A +----------+ | | |
| 166 | | +----+ | | |
| 167 | |L ULN2003A |9536| | | |
| 168 | |i +----+ +----------+ IC61C256AH-12 | | |
| 169 | |n | | | | |
| 170 | |e H2 | AMCOE | | | |
| 171 | |r | SALTIRE | | | |
| 172 | | | | | | |
| 173 | |C +----------+ H1 25MHz SW1| | |
| 174 | |o | | |
| 175 | |n +-+ | |
| 176 | |n 12MHz 4.9152MHz |P| | |
| 177 | |e |r| | |
| 178 | |c +----------+ |i| | |
| 179 | |t +---------+ | ROM1 | SW4 |n| | |
| 180 | |o | HM86171 | +----------+ |t| | |
| 181 | |r +---------+ |e| | |
| 182 | | FM1608-120 |r| | |
| 183 | | +-------+ SW5 +-+ | |
| 184 | +-+ | VGA | H3 | | |
| 185 | +----------+-------+-------------------------------+ | |
| 186 | ||
| 187 | CPU: Amcoe Saltire 208PQFP (Z80 core) | |
| 188 | Graphics: HM86171 | |
| 189 | OSC: 25.000MHz, 12.000MHz & 4.9152MHz | |
| 190 | Sound: OKI M6295 | |
| 191 | Other: XILINX XC9536XL (used for programable protection, connected to H2) | |
| 192 | ||
| 193 | HM86171-120 - HMC 28 pin DIP Color Pallete RAMDAC | |
| 194 | FM1608-120 - RAMTRON 64Kb bytewide Ferroelectric Nonvolatile RAM | |
| 195 | ULN2003A - 16 pin DIP Seven Darlington Arrays | |
| 196 | 75176 - SN75176BP Differential BUS Transceiver (Bidirectional data communication on multipoint bus transmission line) | |
| 197 | 386D - JRC 386D low voltage AMP | |
| 198 | VR1 - Sound adjust pot | |
| 199 | ||
| 200 | H1 - 3 pin Jumper (Pins 1+2 is CGA, pins 2+3 is XVGA) | |
| 201 | H2 - 6 pin header used to program the XC9536XL (JTAG?) | |
| 202 | H3 - 20 pin dual row connector | |
| 203 | ||
| 204 | CN1 & CN2 are RJ45 LINK connectors | |
| 205 | ||
| 206 | ROMs 1 & 3-6 are AMIC 29040B | |
| 207 | ROM 2 is a AMIC 290021T | |
| 208 | ||
| 209 | -------------------------------------------------------------------- | |
| 210 | ||
| 211 | MH86171 Color Pallete RAMDAC | |
| 212 | Hardware & software compatible with VGA, MCGA & 8514/A graphics | |
| 213 | Compatible with the RS170 video stadard | |
| 214 | Single monolithic, high performance CMOS | |
| 215 | Pixel rates up to 50MHz | |
| 216 | 256K possible colors | |
| 217 | Pixel word mask | |
| 218 | Up to 8 bits per pixel | |
| 219 | RGB analogue output, 6 bit DAC per gun, composite blank | |
| 220 | Triple six-bit video DAC | |
| 221 | 256 x 18 bit high speed SRAM | |
| 222 | ||
| 49 | 223 | */ |
| 50 | 224 | |
| 225 | ||
| 51 | 226 | #include "emu.h" |
| 52 | 227 | #include "cpu/z80/z80.h" |
| 53 | 228 | #include "sound/okim6295.h" |
| r7500 | r7501 | |
| 3525 | 3700 | ROM_LOAD_OPTIONAL( "fb415e.id", 0x00, 0x20, CRC(f1663488) SHA1(93ba94df442d90790cb0eafb6e5db0506ffa8bc5)) |
| 3526 | 3701 | ROM_END |
| 3527 | 3702 | |
| 3528 | ||
| 3529 | /* | |
| 3530 | ||
| 3531 | Action 2000 by AMCOE | |
| 3532 | ||
| 3533 | ||
| 3534 | Graphics - HM86171-80 ? 28DIP | |
| 3535 | Processor - Amcoe Saltire ? 208PQFP | |
| 3536 | ||
| 3537 | QUARTZ OSCILLATORS 12.000, 4.9152 and 27.000 | |
| 3538 | ||
| 3539 | RAM | |
| 3540 | ||
| 3541 | HM6264ALP-15 - 28DIP | |
| 3542 | UN61256FK-15 - 28DIP | |
| 3543 | ||
| 3544 | Unknown | |
| 3545 | ||
| 3546 | Chip Markings removed 44Pin PLCC | |
| 3547 | ||
| 3548 | Roms | |
| 3549 | ||
| 3550 | a2k1-1.2.u28 - F29C51001T | |
| 3551 | a2k-2.u11 - F29C51002T | |
| 3552 | a2k-3.u9 - F29C51004T | |
| 3553 | a2k-4.u8 - F29C51004T | |
| 3554 | a2k-5.u6 - F29C51004T | |
| 3555 | a2k-6.u4 - F29C51004T | |
| 3556 | ||
| 3557 | Dumped by Dang_Spot 08/12/04 | |
| 3558 | */ | |
| 3703 | /* Action 2000 */ | |
| 3559 | 3704 | ROM_START( act2000 ) |
| 3560 | 3705 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ |
| 3561 | 3706 | ROM_LOAD( "a2v35e.bin", 0x00000, 0x40000, CRC(dfe5c8b5) SHA1(09ac6df25395d0a5c632c05ba93bf784b69319a0) ) |
| r7500 | r7501 | |
| 4610 | 4755 | ROM_LOAD_OPTIONAL( "mm17lt.id", 0x00, 0x20, CRC(b6b08ea0) SHA1(a56c7648424ca4dd0d405059f07af6f7cee0111a) ) |
| 4611 | 4756 | ROM_END |
| 4612 | 4757 | |
| 4613 | /* Around The World */ | |
| 4614 | ROM_START( atworld ) | |
| 4615 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 4616 | ROM_LOAD( "awd13e.bin", 0x00000, 0x80000, CRC(ec46b48d) SHA1(bfae55520bb36a6dfb55e12b115e818d9cd060e7) ) | |
| 4617 | ||
| 4618 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 4619 | ROM_LOAD( "aw_rom2.bin", 0x00000, 0x40000, CRC(aff26a52) SHA1(176fb42d735a85cdc3b74d6dde76fea9115bf36d) ) | |
| 4620 | ||
| 4621 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 4622 | ROM_LOAD16_BYTE( "aw_rom3.bin", 0x00000, 0x80000, CRC(36db794a) SHA1(a5cb32fc401faf52e221f0a4d8bbfae819e7d08b) ) | |
| 4623 | ROM_LOAD16_BYTE( "aw_rom4.bin", 0x00001, 0x80000, CRC(3927d187) SHA1(4d6e509ec6cc33e6985142894bbce547e1ee9f4f) ) | |
| 4624 | ||
| 4625 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 4626 | ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) ) | |
| 4627 | ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) ) | |
| 4628 | ||
| 4629 | ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */ | |
| 4630 | ROM_LOAD_OPTIONAL( "aw13ex.id", 0x00, 0x1000, CRC(c26305c9) SHA1(ee3aea8926ee4890d45896cf0be175c2262c7341) ) | |
| 4631 | ROM_END | |
| 4632 | ||
| 4633 | ROM_START( atworldd1 ) | |
| 4634 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 4635 | ROM_LOAD( "awd13r.bin", 0x00000, 0x80000, CRC(786079a8) SHA1(862abc511c5ac0d667c6b9abd914ce6035e9aed9) ) | |
| 4636 | ||
| 4637 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 4638 | ROM_LOAD( "aw_rom2.bin", 0x00000, 0x40000, CRC(aff26a52) SHA1(176fb42d735a85cdc3b74d6dde76fea9115bf36d) ) | |
| 4639 | ||
| 4640 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 4641 | ROM_LOAD16_BYTE( "aw_rom3.bin", 0x00000, 0x80000, CRC(36db794a) SHA1(a5cb32fc401faf52e221f0a4d8bbfae819e7d08b) ) | |
| 4642 | ROM_LOAD16_BYTE( "aw_rom4.bin", 0x00001, 0x80000, CRC(3927d187) SHA1(4d6e509ec6cc33e6985142894bbce547e1ee9f4f) ) | |
| 4643 | ||
| 4644 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 4645 | ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) ) | |
| 4646 | ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) ) | |
| 4647 | ||
| 4648 | ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */ | |
| 4649 | ROM_LOAD_OPTIONAL( "aw13re.id", 0x00, 0x1000, CRC(0f9991fb) SHA1(5ea9e49c6b8b00c2c3638cc39e479d6e5e112b7a) ) | |
| 4650 | ROM_END | |
| 4651 | ||
| 4652 | 4758 | // incomplete / mixed sets etc. sort these first before doing anything else with them |
| 4653 | 4759 | /* Fruit Bonus 2005 */ |
| 4654 | 4760 | ROM_START( fb5 ) |
| r7500 | r7501 | |
| 5001 | 5107 | ROM_LOAD_OPTIONAL( "fb6se14lt.id", 0x00, 0x20, CRC(8d72c5a4) SHA1(51d874c14f4fcb5e0f72cbc0bef053170bdc5ee5) ) |
| 5002 | 5108 | ROM_END |
| 5003 | 5109 | |
| 5004 | /* Not working sets (due to incomplete dumps) */ | |
| 5005 | ROM_START( version4 ) | |
| 5110 | /* Bugs Fever */ | |
| 5111 | ROM_START( bugfever ) | |
| 5006 | 5112 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ |
| 5007 | ROM_LOAD( " | |
| 5113 | ROM_LOAD( "bfd17r.bin", 0x00000, 0x80000, CRC( | |
| 5008 | 5114 | |
| 5009 | 5115 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ |
| 5010 | ROM_LOAD( " | |
| 5116 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, CRC(d0e7ee66) SHA1(3dd08bbe31b8170df5206be454db4993dd186a16) ) | |
| 5011 | 5117 | |
| 5012 | 5118 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 5013 | ROM_LOAD16_BYTE( "96rom3.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5014 | ROM_LOAD16_BYTE( "96rom4.bin", 0x00001, 0x40000, NO_DUMP) | |
| 5119 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, CRC(c571591e) SHA1(3233cc9a0f094911f89a0a0d56a28c24d1502e63) ) | |
| 5120 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, CRC(ed7080a5) SHA1(d198019788f5fd70680296a9c2bab17a27589998) ) | |
| 5015 | 5121 | |
| 5016 | 5122 | ROM_REGION( 0x100000, "gfx2", 0 ) |
| 5017 | ROM_LOAD16_BYTE( "96rom5.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5018 | ROM_LOAD16_BYTE( "96rom6.bin", 0x00001, 0x40000, NO_DUMP ) | |
| 5123 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, CRC(a2697da1) SHA1(2a3b03c7d02225ae8ce98b65face6554c37172d5) ) | |
| 5124 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, CRC(28d6810b) SHA1(f446710b34db5bec97f81af0ca83e6b4f1a5ec46) ) | |
| 5019 | 5125 | |
| 5020 | 5126 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ |
| 5021 | ROM_LOAD_OPTIONAL( "f | |
| 5127 | ROM_LOAD_OPTIONAL( "bf | |
| 5022 | 5128 | ROM_END |
| 5023 | 5129 | |
| 5024 | ROM_START( bugfever ) | |
| 5130 | ROM_START( bugfevero ) | |
| 5025 | 5131 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ |
| 5026 | ROM_LOAD( "bfd1 | |
| 5132 | ROM_LOAD( "bfd16r.bin", 0x00000, 0x80000, CRC(3ef176c | |
| 5027 | 5133 | |
| 5028 | 5134 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ |
| 5029 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, | |
| 5135 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, CRC(d0e7ee66) SHA1(3dd08bbe31b8170df5206be454db4993dd186a16) ) | |
| 5030 | 5136 | |
| 5031 | 5137 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 5032 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5033 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5138 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, CRC(c571591e) SHA1(3233cc9a0f094911f89a0a0d56a28c24d1502e63) ) | |
| 5139 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, CRC(ed7080a5) SHA1(d198019788f5fd70680296a9c2bab17a27589998) ) | |
| 5034 | 5140 | |
| 5035 | 5141 | ROM_REGION( 0x100000, "gfx2", 0 ) |
| 5036 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5037 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5142 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, CRC(a2697da1) SHA1(2a3b03c7d02225ae8ce98b65face6554c37172d5) ) | |
| 5143 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, CRC(28d6810b) SHA1(f446710b34db5bec97f81af0ca83e6b4f1a5ec46) ) | |
| 5038 | 5144 | |
| 5039 | 5145 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ |
| 5040 | ROM_LOAD_OPTIONAL( "bf1 | |
| 5146 | ROM_LOAD_OPTIONAL( "bf16re.id", 0x00, 0x20, CRC(b3f | |
| 5041 | 5147 | ROM_END |
| 5042 | 5148 | |
| 5043 | 5149 | ROM_START( bugfeverd ) |
| r7500 | r7501 | |
| 5045 | 5151 | ROM_LOAD( "bfd17e.bin", 0x00000, 0x80000, CRC(35324195) SHA1(ad290912556f4ddbc33667b3bce5d05f321870d0) ) |
| 5046 | 5152 | |
| 5047 | 5153 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ |
| 5048 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, | |
| 5154 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, CRC(d0e7ee66) SHA1(3dd08bbe31b8170df5206be454db4993dd186a16) ) | |
| 5049 | 5155 | |
| 5050 | 5156 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 5051 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5052 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5157 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, CRC(c571591e) SHA1(3233cc9a0f094911f89a0a0d56a28c24d1502e63) ) | |
| 5158 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, CRC(ed7080a5) SHA1(d198019788f5fd70680296a9c2bab17a27589998) ) | |
| 5053 | 5159 | |
| 5054 | 5160 | ROM_REGION( 0x100000, "gfx2", 0 ) |
| 5055 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5056 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5161 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, CRC(a2697da1) SHA1(2a3b03c7d02225ae8ce98b65face6554c37172d5) ) | |
| 5162 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, CRC(28d6810b) SHA1(f446710b34db5bec97f81af0ca83e6b4f1a5ec46) ) | |
| 5057 | 5163 | |
| 5058 | 5164 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ |
| 5059 | 5165 | ROM_LOAD_OPTIONAL( "bf17ex.id", 0x00, 0x20, CRC(38bd8ec4) SHA1(4e6b85348f2fa821934f7666f77ba0f016e200ec) ) |
| r7500 | r7501 | |
| 5064 | 5170 | ROM_LOAD( "bfv17r.bin", 0x00000, 0x80000, CRC(8b6ee6f5) SHA1(981d60f04ab44ce8fc63019ac3e5b689aa80baf0) ) |
| 5065 | 5171 | |
| 5066 | 5172 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ |
| 5067 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, | |
| 5173 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, CRC(d0e7ee66) SHA1(3dd08bbe31b8170df5206be454db4993dd186a16) ) | |
| 5068 | 5174 | |
| 5069 | 5175 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 5070 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5071 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5176 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, CRC(c571591e) SHA1(3233cc9a0f094911f89a0a0d56a28c24d1502e63) ) | |
| 5177 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, CRC(ed7080a5) SHA1(d198019788f5fd70680296a9c2bab17a27589998) ) | |
| 5072 | 5178 | |
| 5073 | 5179 | ROM_REGION( 0x100000, "gfx2", 0 ) |
| 5074 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5075 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5180 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, CRC(a2697da1) SHA1(2a3b03c7d02225ae8ce98b65face6554c37172d5) ) | |
| 5181 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, CRC(28d6810b) SHA1(f446710b34db5bec97f81af0ca83e6b4f1a5ec46) ) | |
| 5076 | 5182 | |
| 5077 | 5183 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ |
| 5078 | 5184 | ROM_LOAD_OPTIONAL( "bf17re.id", 0x00, 0x20, CRC(a482948d) SHA1(62b802e4906ebb00b2584bb0562a64e9a30aa6ed) ) |
| r7500 | r7501 | |
| 5083 | 5189 | ROM_LOAD( "bfv17e.bin", 0x00000, 0x80000, CRC(b9afd39a) SHA1(d331551f679b8694bf63812e5e1a54361c87c52a) ) |
| 5084 | 5190 | |
| 5085 | 5191 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ |
| 5086 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, | |
| 5192 | ROM_LOAD( "bfrom2.bin", 0x00000, 0x40000, CRC(d0e7ee66) SHA1(3dd08bbe31b8170df5206be454db4993dd186a16) ) | |
| 5087 | 5193 | |
| 5088 | 5194 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 5089 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5090 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5195 | ROM_LOAD16_BYTE( "bfrom3.bin", 0x00000, 0x80000, CRC(c571591e) SHA1(3233cc9a0f094911f89a0a0d56a28c24d1502e63) ) | |
| 5196 | ROM_LOAD16_BYTE( "bfrom4.bin", 0x00001, 0x80000, CRC(ed7080a5) SHA1(d198019788f5fd70680296a9c2bab17a27589998) ) | |
| 5091 | 5197 | |
| 5092 | 5198 | ROM_REGION( 0x100000, "gfx2", 0 ) |
| 5093 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5094 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5199 | ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, CRC(a2697da1) SHA1(2a3b03c7d02225ae8ce98b65face6554c37172d5) ) | |
| 5200 | ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, CRC(28d6810b) SHA1(f446710b34db5bec97f81af0ca83e6b4f1a5ec46) ) | |
| 5095 | 5201 | |
| 5096 | 5202 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ |
| 5097 | 5203 | ROM_LOAD_OPTIONAL( "bf17ex.id", 0x00, 0x20, CRC(38bd8ec4) SHA1(4e6b85348f2fa821934f7666f77ba0f016e200ec) ) |
| 5098 | 5204 | ROM_END |
| 5099 | 5205 | |
| 5206 | /* Around The World */ | |
| 5207 | ROM_START( atworld ) | |
| 5208 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 5209 | ROM_LOAD( "awd13e.bin", 0x00000, 0x80000, CRC(ec46b48d) SHA1(bfae55520bb36a6dfb55e12b115e818d9cd060e7) ) | |
| 5210 | ||
| 5211 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 5212 | ROM_LOAD( "aw_rom2.bin", 0x00000, 0x40000, CRC(aff26a52) SHA1(176fb42d735a85cdc3b74d6dde76fea9115bf36d) ) | |
| 5213 | ||
| 5214 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 5215 | ROM_LOAD16_BYTE( "aw_rom3.bin", 0x00000, 0x80000, CRC(36db794a) SHA1(a5cb32fc401faf52e221f0a4d8bbfae819e7d08b) ) | |
| 5216 | ROM_LOAD16_BYTE( "aw_rom4.bin", 0x00001, 0x80000, CRC(3927d187) SHA1(4d6e509ec6cc33e6985142894bbce547e1ee9f4f) ) | |
| 5217 | ||
| 5218 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 5219 | ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) ) | |
| 5220 | ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) ) | |
| 5221 | ||
| 5222 | ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */ | |
| 5223 | ROM_LOAD_OPTIONAL( "aw13ex.id", 0x00, 0x1000, CRC(c26305c9) SHA1(ee3aea8926ee4890d45896cf0be175c2262c7341) ) | |
| 5224 | ROM_END | |
| 5225 | ||
| 5226 | ROM_START( atworldd1 ) | |
| 5227 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 5228 | ROM_LOAD( "awd13r.bin", 0x00000, 0x80000, CRC(786079a8) SHA1(862abc511c5ac0d667c6b9abd914ce6035e9aed9) ) | |
| 5229 | ||
| 5230 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 5231 | ROM_LOAD( "aw_rom2.bin", 0x00000, 0x40000, CRC(aff26a52) SHA1(176fb42d735a85cdc3b74d6dde76fea9115bf36d) ) | |
| 5232 | ||
| 5233 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 5234 | ROM_LOAD16_BYTE( "aw_rom3.bin", 0x00000, 0x80000, CRC(36db794a) SHA1(a5cb32fc401faf52e221f0a4d8bbfae819e7d08b) ) | |
| 5235 | ROM_LOAD16_BYTE( "aw_rom4.bin", 0x00001, 0x80000, CRC(3927d187) SHA1(4d6e509ec6cc33e6985142894bbce547e1ee9f4f) ) | |
| 5236 | ||
| 5237 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 5238 | ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) ) | |
| 5239 | ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) ) | |
| 5240 | ||
| 5241 | ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */ | |
| 5242 | ROM_LOAD_OPTIONAL( "aw13re.id", 0x00, 0x1000, CRC(0f9991fb) SHA1(5ea9e49c6b8b00c2c3638cc39e479d6e5e112b7a) ) | |
| 5243 | ROM_END | |
| 5244 | ||
| 5245 | /* Not working sets (due to incomplete dumps) */ | |
| 5246 | ROM_START( version4 ) | |
| 5247 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 5248 | ROM_LOAD( "96d42r.bin", 0x00000, 0x40000, CRC(dab5706c) SHA1(9fc37b66942a5e7535b4590f132727d793f9d705) ) | |
| 5249 | ||
| 5250 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 5251 | ROM_LOAD( "96rom2.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5252 | ||
| 5253 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 5254 | ROM_LOAD16_BYTE( "96rom3.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5255 | ROM_LOAD16_BYTE( "96rom4.bin", 0x00001, 0x40000, NO_DUMP) | |
| 5256 | ||
| 5257 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 5258 | ROM_LOAD16_BYTE( "96rom5.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5259 | ROM_LOAD16_BYTE( "96rom6.bin", 0x00001, 0x40000, NO_DUMP ) | |
| 5260 | ||
| 5261 | ROM_REGION( 0x20, "defaults", 0 ) /* default settings */ | |
| 5262 | ROM_LOAD_OPTIONAL( "fcs40r1.id", 0x00, 0x20, CRC(b3638cdb) SHA1(283824c57f3f62f6e2b505f6e13b100a7d7f33af) ) | |
| 5263 | ROM_END | |
| 5264 | ||
| 5100 | 5265 | ROM_START( dvisland ) |
| 5101 | 5266 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ |
| 5102 | 5267 | ROM_LOAD( "did14r.bin", 0x00000, 0x80000, CRC(28c3a7eb) SHA1(5389338ef42e05542e3ff052b2bbc918cf619874) ) |
| r7500 | r7501 | |
| 5154 | 5319 | ROM_LOAD_OPTIONAL( "fr14r.id", 0x00, 0x20, CRC(1542e2bc) SHA1(56e615866d451abd2d6c2d689a85bdca447c2538) ) |
| 5155 | 5320 | ROM_END |
| 5156 | 5321 | |
| 5322 | ROM_START( spooky ) | |
| 5323 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 5324 | ROM_LOAD( "snd204r.bin", 0x00000, 0x80000, CRC(0e737c07) SHA1(50b55390f6ae6ae661d020dabd685651a7f160b2) ) | |
| 5325 | ||
| 5326 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 5327 | ROM_LOAD( "snrom2.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5328 | ||
| 5329 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 5330 | ROM_LOAD16_BYTE( "snrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5331 | ROM_LOAD16_BYTE( "snrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5332 | ||
| 5333 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 5334 | ROM_LOAD16_BYTE( "snrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5335 | ROM_LOAD16_BYTE( "snrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5336 | ROM_END | |
| 5337 | ||
| 5338 | ROM_START( fbdeluxe ) | |
| 5339 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ | |
| 5340 | ROM_LOAD( "fbd107r.bin", 0x00000, 0x80000, CRC(b29be47d) SHA1(bd3098fa6b914b2f9dcbe36e2cf36f90c67c1424) ) | |
| 5341 | ||
| 5342 | ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */ | |
| 5343 | ROM_LOAD( "fbrom2.bin", 0x00000, 0x40000, NO_DUMP ) | |
| 5344 | ||
| 5345 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 5346 | ROM_LOAD16_BYTE( "fbrom3.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5347 | ROM_LOAD16_BYTE( "fbrom4.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5348 | ||
| 5349 | ROM_REGION( 0x100000, "gfx2", 0 ) | |
| 5350 | ROM_LOAD16_BYTE( "fbrom5.bin", 0x00000, 0x80000, NO_DUMP ) | |
| 5351 | ROM_LOAD16_BYTE( "fbrom6.bin", 0x00001, 0x80000, NO_DUMP ) | |
| 5352 | ROM_END | |
| 5353 | ||
| 5157 | 5354 | // diagnostics? |
| 5158 | 5355 | ROM_START( amclink ) |
| 5159 | 5356 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ |
| r7500 | r7501 | |
| 5378 | 5575 | static DRIVER_INIT(tighookd) { sfbonus_bitswap(machine, 0x3d, 0,1,7,6,5,4,3,2, 0xed, 1,7,6,5,4,3,0,2, 0x26, 2,1,0,7,6,5,4,3, 0xa9, 4,3,0,1,2,7,6,5, 0x3c, 1,0,7,6,5,4,3,2, 0xed, 2,7,6,5,4,3,1,0, 0x26, 2,1,0,7,6,5,4,3, 0xae, 4,3,1,2,0,7,6,5); } |
| 5379 | 5576 | static DRIVER_INIT(tighookv) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x26, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xec, 0,7,6,5,4,3,2,1, 0x21, 1,0,2,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } |
| 5380 | 5577 | static DRIVER_INIT(tighookv2) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x23, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xea, 0,7,6,5,4,3,2,1, 0x21, 1,0,2,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } |
| 5381 | ||
| 5382 | static DRIVER_INIT(version4) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x26, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xec, 1,7,6,5,4,3,0,2, 0x22, 2,1,0,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } | |
| 5383 | 5578 | static DRIVER_INIT(bugfever) { sfbonus_bitswap(machine, 0x3c, 1,2,7,6,5,4,3,0, 0xea, 2,7,6,5,4,3,0,1, 0x22, 2,1,0,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xe9, 1,7,6,5,4,3,0,2, 0x23, 1,0,2,7,6,5,4,3, 0xa9, 4,3,0,1,2,7,6,5); } |
| 5384 | 5579 | static DRIVER_INIT(bugfeverd) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x26, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3a, 0,1,7,6,5,4,3,2, 0xe8, 1,7,6,5,4,3,0,2, 0x22, 2,1,0,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } |
| 5385 | 5580 | static DRIVER_INIT(bugfeverv) { sfbonus_bitswap(machine, 0x3c, 1,0,7,6,5,4,3,2, 0xef, 0,7,6,5,4,3,2,1, 0x22, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3a, 0,1,7,6,5,4,3,2, 0xea, 2,7,6,5,4,3,1,0, 0x22, 0,1,2,7,6,5,4,3, 0xa9, 4,3,2,1,0,7,6,5); } |
| 5386 | 5581 | static DRIVER_INIT(bugfeverv2) { sfbonus_bitswap(machine, 0x3c, 1,2,7,6,5,4,3,0, 0xea, 2,7,6,5,4,3,0,1, 0x23, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xed, 2,7,6,5,4,3,1,0, 0x26, 2,1,0,7,6,5,4,3, 0xa9, 4,3,0,1,2,7,6,5); } |
| 5582 | ||
| 5583 | static DRIVER_INIT(version4) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x26, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xec, 1,7,6,5,4,3,0,2, 0x22, 2,1,0,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } | |
| 5387 | 5584 | static DRIVER_INIT(dvisland) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x21, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xe9, 1,7,6,5,4,3,0,2, 0x23, 2,1,0,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } |
| 5388 | 5585 | static DRIVER_INIT(funriver) { sfbonus_bitswap(machine, 0x3c, 1,2,7,6,5,4,3,0, 0xea, 2,7,6,5,4,3,0,1, 0x24, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xec, 0,7,6,5,4,3,2,1, 0x23, 1,0,2,7,6,5,4,3, 0xa9, 4,3,0,1,2,7,6,5); } |
| 5389 | 5586 | static DRIVER_INIT(funriverv) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x26, 0,2,1,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 0,1,7,6,5,4,3,2, 0xea, 2,7,6,5,4,3,1,0, 0x22, 2,1,0,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } |
| 5587 | static DRIVER_INIT(spooky) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x21, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x39, 1,0,7,6,5,4,3,2, 0xe8, 1,7,6,5,4,3,2,0, 0x23, 0,2,1,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } | |
| 5588 | static DRIVER_INIT(fbdeluxe) { sfbonus_bitswap(machine, 0x39, 1,2,7,6,5,4,3,0, 0xef, 2,7,6,5,4,3,0,1, 0x21, 1,0,2,7,6,5,4,3, 0xa8, 4,3,1,2,0,7,6,5, 0x3b, 1,0,7,6,5,4,3,2, 0xec, 1,7,6,5,4,3,2,0, 0x26, 0,2,1,7,6,5,4,3, 0xac, 4,3,0,1,2,7,6,5); } | |
| 5390 | 5589 | |
| 5391 | 5590 | |
| 5392 | 5591 | |
| r7500 | r7501 | |
| 5607 | 5806 | GAME( 2004, classiced2, classice, sfbonus, amcoe1_reels3, classiced, ROT0, "Amcoe", "Classic Edition (Version 1.6LT, set 2)", 0) |
| 5608 | 5807 | GAME( 2004, classicev2, classice, sfbonus, amcoe1_reels3, classicev, ROT0, "Amcoe", "Classic Edition (Version 1.6LT Dual)", 0) |
| 5609 | 5808 | |
| 5610 | GAME( 2007, atworld, 0, sfbonus, amcoe1_reels3, atworld, ROT0, "Amcoe", "Around The World (Version 1.3E CGA)", 0) /* Year according to Amcoe web site - too new */ | |
| 5611 | GAME( 2007, atworldd1, atworld, sfbonus, amcoe1_reels3, atworldd, ROT0, "Amcoe", "Around The World (Version 1.3R CGA)", 0) /* Year according to Amcoe web site - too new */ | |
| 5809 | GAME( 2005, seawld, 0, sfbonus, amcoe1_reels3, seawldv, ROT0, "Amcoe", "Sea World (Version 1.6E Dual)", 0) | |
| 5810 | GAME( 2005, seawldd1, seawld, sfbonus, amcoe1_reels3, seawld, ROT0, "Amcoe", "Sea World (Version 1.6R CGA)", 0) | |
| 5612 | 5811 | |
| 5613 | GAME( 200?, seawld, 0, sfbonus, amcoe1_reels3, seawldv, ROT0, "Amcoe", "Sea World (Version 1.6E Dual)", 0) | |
| 5614 | GAME( 200?, seawldd1, seawld, sfbonus, amcoe1_reels3, seawld, ROT0, "Amcoe", "Sea World (Version 1.6R CGA)", 0) | |
| 5812 | GAME( 2005, moneymac, 0, sfbonus, amcoe1_reels3, moneymacv, ROT0, "Amcoe", "Money Machine (Version 1.7E Dual)", 0) | |
| 5813 | GAME( 2005, moneymacd1, moneymac, sfbonus, amcoe1_reels3, moneymacd, ROT0, "Amcoe", "Money Machine (Version 1.7R)", 0) | |
| 5814 | GAME( 2005, moneymacv1, moneymac, sfbonus, amcoe1_reels3, moneymac, ROT0, "Amcoe", "Money Machine (Version 1.7R Dual)", 0) | |
| 5815 | GAME( 2005, moneymacd2, moneymac, sfbonus, amcoe1_reels3, moneymacd, ROT0, "Amcoe", "Money Machine (Version 1.7LT)", 0) | |
| 5816 | GAME( 2005, moneymacv2, moneymac, sfbonus, amcoe1_reels3, moneymac, ROT0, "Amcoe", "Money Machine (Version 1.7LT Dual)", 0) | |
| 5615 | 5817 | |
| 5616 | GAME( 200?, moneymac, 0, sfbonus, amcoe1_reels3, moneymacv, ROT0, "Amcoe", "Money Machine (Version 1.7E Dual)", 0) | |
| 5617 | GAME( 200?, moneymacd1, moneymac, sfbonus, amcoe1_reels3, moneymacd, ROT0, "Amcoe", "Money Machine (Version 1.7R)", 0) | |
| 5618 | GAME( 200?, moneymacv1, moneymac, sfbonus, amcoe1_reels3, moneymac, ROT0, "Amcoe", "Money Machine (Version 1.7R Dual)", 0) | |
| 5619 | GAME( 200?, moneymacd2, moneymac, sfbonus, amcoe1_reels3, moneymacd, ROT0, "Amcoe", "Money Machine (Version 1.7LT)", 0) | |
| 5620 | GAME( 200?, moneymacv2, moneymac, sfbonus, amcoe1_reels3, moneymac, ROT0, "Amcoe", "Money Machine (Version 1.7LT Dual)", 0) | |
| 5621 | ||
| 5622 | 5818 | GAME( 2005, fb5, 0, sfbonus, amcoe2_reels3, fb5, ROT0, "Amcoe", "Fruit Bonus 2005 (Version 1.5SH, set 1)", 0) |
| 5623 | 5819 | GAME( 2005, fb5c, fb5, sfbonus, amcoe1_reels3, fb5, ROT0, "Amcoe", "Fruit Bonus 2005 (Version 1.5SH, set 2)", 0) |
| 5624 | 5820 | GAME( 2005, fb5d, fb5, sfbonus, amcoe1_reels3, fb5d, ROT0, "Amcoe", "Fruit Bonus 2005 (Version 1.5SH, set 3)", 0) |
| 5625 | 5821 | GAME( 2005, fb5v, fb5, sfbonus, amcoe1_reels3, fb5v, ROT0, "Amcoe", "Fruit Bonus 2005 (Version 1.5SH Dual)", 0) |
| 5626 | 5822 | |
| 5627 | GAME( 200?, fb6, 0, sfbonus, amcoe1_reels3, fb6, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7E CGA)", 0) | |
| 5628 | GAME( 200?, fb6v, fb6, sfbonus, amcoe1_reels3, fb6v3, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7E Dual)", 0) | |
| 5629 | GAME( 200?, fb6d1, fb6, sfbonus, amcoe1_reels3, fb6d, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R CGA, set 1)", 0) | |
| 5630 | GAME( 200?, fb6s1, fb6, sfbonus, amcoe1_reels3, fb6s, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R CGA, set 2)", GAME_NOT_WORKING) // no reel gfx | |
| 5631 | GAME( 200?, fb6v1, fb6, sfbonus, amcoe1_reels3, fb6v, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R Dual)", 0) | |
| 5632 | GAME( 200?, fb6d2, fb6, sfbonus, amcoe1_reels3, fb6d, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 1)", 0) | |
| 5633 | GAME( 200?, fb6s2, fb6, sfbonus, amcoe1_reels3, fb6s, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 2)", GAME_NOT_WORKING) // no reel gfx | |
| 5634 | GAME( 200?, fb6v2, fb6, sfbonus, amcoe1_reels3, fb6v, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT Dual)", 0) | |
| 5823 | GAME( 2006, fb6, 0, sfbonus, amcoe1_reels3, fb6, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7E CGA)", 0) | |
| 5824 | GAME( 2006, fb6v, fb6, sfbonus, amcoe1_reels3, fb6v3, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7E Dual)", 0) | |
| 5825 | GAME( 2006, fb6d1, fb6, sfbonus, amcoe1_reels3, fb6d, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R CGA, set 1)", 0) | |
| 5826 | GAME( 2006, fb6s1, fb6, sfbonus, amcoe1_reels3, fb6s, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R CGA, set 2)", GAME_NOT_WORKING) // no reel gfx | |
| 5827 | GAME( 2006, fb6v1, fb6, sfbonus, amcoe1_reels3, fb6v, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7R Dual)", 0) | |
| 5828 | GAME( 2006, fb6d2, fb6, sfbonus, amcoe1_reels3, fb6d, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 1)", 0) | |
| 5829 | GAME( 2006, fb6s2, fb6, sfbonus, amcoe1_reels3, fb6s, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 2)", GAME_NOT_WORKING) // no reel gfx | |
| 5830 | GAME( 2006, fb6v2, fb6, sfbonus, amcoe1_reels3, fb6v, ROT0, "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT Dual)", 0) | |
| 5635 | 5831 | |
| 5636 | 5832 | GAME( 2006, fb6se, 0, sfbonus, amcoe1_reels3, fb6, ROT0, "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4E CGA)", 0) /* Released August 2006 according to Amcoe web site */ |
| 5637 | 5833 | GAME( 2006, fb6sev, fb6se, sfbonus, amcoe1_reels3, fb6v3, ROT0, "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4E Dual)", 0) |
| r7500 | r7501 | |
| 5640 | 5836 | GAME( 2006, fb6sed2, fb6se, sfbonus, amcoe1_reels3, fb6d, ROT0, "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4LT CGA)", 0) |
| 5641 | 5837 | GAME( 2006, fb6sev2, fb6se, sfbonus, amcoe1_reels3, fb6v, ROT0, "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4LT Dual)", 0) |
| 5642 | 5838 | |
| 5643 | // no gfx / sound roms | |
| 5644 | GAME( 200?, version4, 0, sfbonus, amcoe1_reels3, version4, ROT0, "Amcoe", "Version 4 (Version 4.2R)", GAME_NOT_WORKING) | |
| 5645 | // no gfx / sound roms | |
| 5646 | GAME( 2006, bugfever, 0, sfbonus, amcoe1_reels3, bugfever, ROT0, "Amcoe", "Bug Fever (set 1)", GAME_NOT_WORKING) /* Released August 2006 according to Amcoe web site */ | |
| 5647 | GAME( 2006, bugfeverd, bugfever, sfbonus, amcoe1_reels3, bugfeverd, ROT0, "Amcoe", "Bug Fever (set 2)", GAME_NOT_WORKING) | |
| 5648 | GAME( 2006, bugfeverv, bugfever, sfbonus, amcoe1_reels3, bugfeverv, ROT0, "Amcoe", "Bug Fever (set 3)", GAME_NOT_WORKING) | |
| 5649 | GAME( 2006, bugfeverv2, bugfever, sfbonus, amcoe1_reels3, bugfeverv2, ROT0, "Amcoe", "Bug Fever (set 4)", GAME_NOT_WORKING) | |
| 5650 | // no gfx / sound roms | |
| 5651 | GAME( 200?, dvisland, 0, sfbonus, amcoe1_reels3, dvisland, ROT0, "Amcoe", "Devil Island", GAME_NOT_WORKING) | |
| 5652 | // no gfx / sound roms | |
| 5653 | GAME( 200?, funriver, 0, sfbonus, amcoe1_reels3, funriver, ROT0, "Amcoe", "Fun River (set 1)", GAME_NOT_WORKING) | |
| 5654 | GAME( 200?, funriverv, funriver, sfbonus, amcoe1_reels3, funriverv, ROT0, "Amcoe", "Fun River (set 2)", GAME_NOT_WORKING) | |
| 5839 | GAME( 2006, bugfever, 0, sfbonus, amcoe1_reels3, bugfever, ROT0, "Amcoe", "Bugs Fever (Version 1.7R CGA)", 0) /* Released August 2006 according to Amcoe web site */ | |
| 5840 | GAME( 2006, bugfeverv, bugfever, sfbonus, amcoe1_reels3, bugfeverv, ROT0, "Amcoe", "Bugs Fever (Version 1.7R Dual)", 0) | |
| 5841 | GAME( 2006, bugfeverd, bugfever, sfbonus, amcoe1_reels3, bugfeverd, ROT0, "Amcoe", "Bugs Fever (Version 1.7E CGA)", 0) | |
| 5842 | GAME( 2006, bugfeverv2, bugfever, sfbonus, amcoe1_reels3, bugfeverv2, ROT0, "Amcoe", "Bugs Fever (Version 1.7E Dual)", 0) | |
| 5843 | GAME( 2006, bugfevero, bugfever, sfbonus, amcoe1_reels3, bugfever, ROT0, "Amcoe", "Bugs Fever (Version 1.6R CGA)", 0) | |
| 5844 | ||
| 5845 | GAME( 2007, atworld, 0, sfbonus, amcoe1_reels3, atworld, ROT0, "Amcoe", "Around The World (Version 1.3E CGA)", 0) /* Year according to Amcoe web site - too new */ | |
| 5846 | GAME( 2007, atworldd1, atworld, sfbonus, amcoe1_reels3, atworldd, ROT0, "Amcoe", "Around The World (Version 1.3R CGA)", 0) /* Year according to Amcoe web site - too new */ | |
| 5847 | ||
| 5848 | // no graphic / sound roms dumped for these sets, but functional program roms & descramble are in place | |
| 5849 | GAME( 2005, funriver, 0, sfbonus, amcoe1_reels3, funriver, ROT0, "Amcoe", "Fun River (set 1)", GAME_NOT_WORKING) | |
| 5850 | GAME( 2005, funriverv, funriver, sfbonus, amcoe1_reels3, funriverv, ROT0, "Amcoe", "Fun River (set 2)", GAME_NOT_WORKING) | |
| 5851 | GAME( 2006, version4, 0, sfbonus, amcoe1_reels3, version4, ROT0, "Amcoe", "Version 4 (Version 4.2R)", GAME_NOT_WORKING) | |
| 5852 | GAME( 2006, dvisland, 0, sfbonus, amcoe1_reels3, dvisland, ROT0, "Amcoe", "Devil Island", GAME_NOT_WORKING) | |
| 5853 | GAME( 200?, spooky, 0, sfbonus, amcoe1_reels3, spooky, ROT0, "Amcoe", "Spooky Night (Version 2.0.4)", GAME_NOT_WORKING) /* After Around The World */ | |
| 5854 | GAME( 200?, fbdeluxe, 0, sfbonus, amcoe1_reels3, fbdeluxe, ROT0, "Amcoe", "Fruit Bonus Deluxe (Version 1.0.7)", GAME_NOT_WORKING) /* After Around The World */ | |
| 5855 | ||
| 5856 | // Known sets but no roms dumped at all for these: | |
| 5857 | // Merry Circus | |
| 5858 | // Fruit Bonus 3G | |
| 5859 | ||
| 5655 | 5860 | // ?? what is this |
| 5656 | 5861 | GAME( 200?, amclink, 0, sfbonus, amcoe1_reels3, sfbonus_common, ROT0, "Amcoe", "Amcoe Link Control Box (Version 2.2)", GAME_NOT_WORKING) |
| r7500 | r7501 | |
|---|---|---|
| 18 | 18 | #include "sound/2203intf.h" |
| 19 | 19 | #include "sound/2151intf.h" |
| 20 | 20 | #include "sound/okim6295.h" |
| 21 | #include "includes/madmotor.h" | |
| 21 | 22 | |
| 22 | VIDEO_START( madmotor ); | |
| 23 | VIDEO_UPDATE( madmotor ); | |
| 24 | ||
| 25 | WRITE16_HANDLER( madmotor_pf1_data_w ); | |
| 26 | WRITE16_HANDLER( madmotor_pf2_data_w ); | |
| 27 | WRITE16_HANDLER( madmotor_pf3_data_w ); | |
| 28 | extern UINT16 *madmotor_pf1_rowscroll; | |
| 29 | extern UINT16 *madmotor_pf1_data,*madmotor_pf2_data,*madmotor_pf3_data; | |
| 30 | extern UINT16 *madmotor_pf1_control,*madmotor_pf2_control,*madmotor_pf3_control; | |
| 31 | ||
| 32 | 23 | /******************************************************************************/ |
| 33 | 24 | |
| 34 | 25 | static WRITE16_HANDLER( madmotor_sound_w ) |
| 35 | 26 | { |
| 27 | madmotor_state *state = (madmotor_state *)space->machine->driver_data; | |
| 28 | ||
| 36 | 29 | if (ACCESSING_BITS_0_7) |
| 37 | 30 | { |
| 38 | 31 | soundlatch_w(space, 0, data & 0xff); |
| 39 | cpu | |
| 32 | cpu | |
| 40 | 33 | } |
| 41 | 34 | } |
| 42 | 35 | |
| r7500 | r7501 | |
| 45 | 38 | |
| 46 | 39 | static ADDRESS_MAP_START( madmotor_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 47 | 40 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 48 | AM_RANGE(0x180000, 0x18001f) AM_WRITEONLY AM_BASE(&madmotor_pf1_control) | |
| 49 | AM_RANGE(0x184000, 0x1847ff) AM_RAM AM_BASE(&madmotor_pf1_rowscroll) | |
| 50 | AM_RANGE(0x188000, 0x189fff) AM_RAM_WRITE(madmotor_pf1_data_w) AM_BASE(&madmotor_pf1_data) | |
| 41 | AM_RANGE(0x180000, 0x18001f) AM_WRITEONLY AM_BASE_MEMBER(madmotor_state, pf1_control) | |
| 42 | AM_RANGE(0x184000, 0x1847ff) AM_RAM AM_BASE_MEMBER(madmotor_state, pf1_rowscroll) | |
| 43 | AM_RANGE(0x188000, 0x189fff) AM_RAM_WRITE(madmotor_pf1_data_w) AM_BASE_MEMBER(madmotor_state, pf1_data) | |
| 51 | 44 | AM_RANGE(0x18c000, 0x18c001) AM_NOP |
| 52 | AM_RANGE(0x190000, 0x19001f) AM_WRITEONLY AM_BASE(&madmotor_pf2_control) | |
| 53 | AM_RANGE(0x198000, 0x1987ff) AM_RAM_WRITE(madmotor_pf2_data_w) AM_BASE(&madmotor_pf2_data) | |
| 45 | AM_RANGE(0x190000, 0x19001f) AM_WRITEONLY AM_BASE_MEMBER(madmotor_state, pf2_control) | |
| 46 | AM_RANGE(0x198000, 0x1987ff) AM_RAM_WRITE(madmotor_pf2_data_w) AM_BASE_MEMBER(madmotor_state, pf2_data) | |
| 54 | 47 | AM_RANGE(0x19c000, 0x19c001) AM_READNOP |
| 55 | AM_RANGE(0x1a0000, 0x1a001f) AM_WRITEONLY AM_BASE(&madmotor_pf3_control) | |
| 56 | AM_RANGE(0x1a4000, 0x1a4fff) AM_RAM_WRITE(madmotor_pf3_data_w) AM_BASE(&madmotor_pf3_data) | |
| 48 | AM_RANGE(0x1a0000, 0x1a001f) AM_WRITEONLY AM_BASE_MEMBER(madmotor_state, pf3_control) | |
| 49 | AM_RANGE(0x1a4000, 0x1a4fff) AM_RAM_WRITE(madmotor_pf3_data_w) AM_BASE_MEMBER(madmotor_state, pf3_data) | |
| 57 | 50 | AM_RANGE(0x3e0000, 0x3e3fff) AM_RAM |
| 58 | AM_RANGE(0x3e8000, 0x3e87ff) AM_RAM AM_BASE_SIZE_ | |
| 51 | AM_RANGE(0x3e8000, 0x3e87ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 59 | 52 | AM_RANGE(0x3f0000, 0x3f07ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 60 | 53 | AM_RANGE(0x3f8002, 0x3f8003) AM_READ_PORT("P1_P2") |
| 61 | 54 | AM_RANGE(0x3f8004, 0x3f8005) AM_READ_PORT("DSW") |
| r7500 | r7501 | |
| 221 | 214 | |
| 222 | 215 | static void sound_irq(running_device *device, int state) |
| 223 | 216 | { |
| 224 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 217 | madmotor_state *driver_state = (madmotor_state *)device->machine->driver_data; | |
| 218 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 225 | 219 | } |
| 226 | 220 | |
| 227 | 221 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 229 | 223 | sound_irq |
| 230 | 224 | }; |
| 231 | 225 | |
| 226 | static MACHINE_START( madmotor ) | |
| 227 | { | |
| 228 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 229 | ||
| 230 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 231 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 232 | ||
| 233 | state_save_register_global(machine, state->flipscreen); | |
| 234 | } | |
| 235 | ||
| 236 | static MACHINE_RESET( madmotor ) | |
| 237 | { | |
| 238 | madmotor_state *state = (madmotor_state *)machine->driver_data; | |
| 239 | ||
| 240 | state->flipscreen = 0; | |
| 241 | } | |
| 242 | ||
| 232 | 243 | static MACHINE_DRIVER_START( madmotor ) |
| 233 | 244 | |
| 245 | /* driver data */ | |
| 246 | MDRV_DRIVER_DATA(madmotor_state) | |
| 247 | ||
| 234 | 248 | /* basic machine hardware */ |
| 235 | 249 | MDRV_CPU_ADD("maincpu", M68000, 12000000) /* Custom chip 59, 24 MHz crystal */ |
| 236 | 250 | MDRV_CPU_PROGRAM_MAP(madmotor_map) |
| r7500 | r7501 | |
| 239 | 253 | MDRV_CPU_ADD("audiocpu", H6280, 8053000/2) /* Custom chip 45, Crystal near CPU is 8.053 MHz */ |
| 240 | 254 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 241 | 255 | |
| 256 | MDRV_MACHINE_START(madmotor) | |
| 257 | MDRV_MACHINE_RESET(madmotor) | |
| 258 | ||
| 242 | 259 | /* video hardware */ |
| 243 | 260 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 244 | 261 | |
| r7500 | r7501 | |
| 334 | 351 | |
| 335 | 352 | |
| 336 | 353 | /* The title screen is undated, but it's (c) 1989 Data East at 0xefa0 */ |
| 337 | GAME( 1989, madmotor, 0, madmotor, madmotor, madmotor, ROT0, "Mitchell", "Mad Motor", | |
| 354 | GAME( 1989, madmotor, 0, madmotor, madmotor, madmotor, ROT0, "Mitchell", "Mad Motor", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 47 | 47 | #include "sound/2203intf.h" |
| 48 | 48 | #include "sound/msm5205.h" |
| 49 | 49 | |
| 50 | typedef struct _chinsan_state chinsan_state; | |
| 51 | struct _chinsan_state | |
| 50 | class chinsan_state | |
| 52 | 51 | { |
| 52 | public: | |
| 53 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chinsan_state(machine)); } | |
| 54 | ||
| 55 | chinsan_state(running_machine &machine) { } | |
| 56 | ||
| 53 | 57 | /* memory pointers */ |
| 54 | 58 | UINT8 * video; |
| 55 | 59 |
| r7500 | r7501 | |
|---|---|---|
| 75 | 75 | #include "machine/segacrpt.h" |
| 76 | 76 | #include "includes/senjyo.h" |
| 77 | 77 | |
| 78 | ||
| 78 | extern UINT8 senjyo_sound_cmd; | |
| 79 | 79 | static int int_delay_kludge; |
| 80 | 80 | |
| 81 | 81 | static MACHINE_RESET( senjyo ) |
| r7500 | r7501 | |
| 98 | 98 | flip_screen_set(space->machine, data); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | static WRITE8_DEVICE_HANDLER( sound_cmd_w ) | |
| 102 | { | |
| 103 | senjyo_sound_cmd = data; | |
| 101 | 104 | |
| 105 | z80pio_astb_w(device, 0); | |
| 106 | z80pio_astb_w(device, 1); | |
| 107 | } | |
| 108 | ||
| 102 | 109 | static ADDRESS_MAP_START( senjyo_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 103 | 110 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 104 | 111 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| r7500 | r7501 | |
| 127 | 134 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("P1") AM_WRITE(flip_screen_w) |
| 128 | 135 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("P2") |
| 129 | 136 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("SYSTEM") |
| 130 | AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1") AM_DEVWRITE("z80pio", | |
| 137 | AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1") AM_DEVWRITE("z80pio", s | |
| 131 | 138 | AM_RANGE(0xd005, 0xd005) AM_READ_PORT("DSW2") |
| 132 | 139 | ADDRESS_MAP_END |
| 133 | 140 | |
| 134 | ||
| 135 | static WRITE8_DEVICE_HANDLER( pio_w ) | |
| 136 | { | |
| 137 | if (offset & 1) | |
| 138 | z80pio_c_w(device, (offset >> 1) & 1, data); | |
| 139 | else | |
| 140 | z80pio_d_w(device, (offset >> 1) & 1, data); | |
| 141 | } | |
| 142 | ||
| 143 | static READ8_DEVICE_HANDLER( pio_r ) | |
| 144 | { | |
| 145 | return (offset & 1) ? z80pio_c_r(device, (offset >> 1) & 1) : z80pio_d_r(device, (offset >> 1) & 1); | |
| 146 | } | |
| 147 | ||
| 148 | 141 | static ADDRESS_MAP_START( senjyo_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 149 | 142 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 150 | 143 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| r7500 | r7501 | |
| 160 | 153 | |
| 161 | 154 | static ADDRESS_MAP_START( senjyo_sound_io_map, ADDRESS_SPACE_IO, 8 ) |
| 162 | 155 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 163 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("z80pio", pio_r, pio_w) | |
| 156 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("z80pio", z80pio_ba_cd_r, z80pio_ba_cd_w) | |
| 164 | 157 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("z80ctc", z80ctc_r, z80ctc_w) |
| 165 | 158 | ADDRESS_MAP_END |
| 166 | 159 | |
| r7500 | r7501 | |
| 200 | 193 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("P1") AM_WRITE(flip_screen_w) |
| 201 | 194 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("P2") |
| 202 | 195 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("SYSTEM") |
| 203 | AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1") AM_DEVWRITE("z80pio", | |
| 196 | AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1") AM_DEVWRITE("z80pio", s | |
| 204 | 197 | AM_RANGE(0xd005, 0xd005) AM_READ_PORT("DSW2") |
| 205 | 198 | |
| 206 | 199 | /* these aren't used / written, left here to make sure memory is allocated */ |
| r7500 | r7501 | |
| 558 | 551 | |
| 559 | 552 | MDRV_MACHINE_RESET(senjyo) |
| 560 | 553 | |
| 561 | MDRV_Z80PIO_ADD( "z80pio", senjyo_pio_intf ) | |
| 554 | MDRV_Z80PIO_ADD( "z80pio", 2000000, senjyo_pio_intf ) | |
| 562 | 555 | MDRV_Z80CTC_ADD( "z80ctc", 2000000 /* same as "sub" */, senjyo_ctc_intf ) |
| 563 | 556 | |
| 564 | 557 | /* video hardware */ |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | static UINT8 Lamps[256]; // 256 multiplexed lamps |
| 46 | 46 | static int optic_pattern; |
| 47 | 47 | |
| 48 | typedef struct _i8279_state i8279_state; | |
| 49 | struct _i8279_state | |
| 48 | struct i8279_state | |
| 50 | 49 | { |
| 51 | 50 | UINT8 command; |
| 52 | 51 | UINT8 mode; |
| r7500 | r7501 | |
|---|---|---|
| 92 | 92 | #include "sound/okim6295.h" |
| 93 | 93 | #include "machine/eeprom.h" |
| 94 | 94 | |
| 95 | typedef struct _spool99_state spool99_state; | |
| 96 | struct _spool99_state | |
| 95 | class spool99_state | |
| 97 | 96 | { |
| 97 | public: | |
| 98 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, spool99_state(machine)); } | |
| 99 | ||
| 100 | spool99_state(running_machine &machine) { } | |
| 101 | ||
| 98 | 102 | UINT8 *main; |
| 99 | 103 | tilemap_t *sc0_tilemap; |
| 100 | 104 | UINT8 *cram; |
| r7500 | r7501 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | #include "emu.h" |
| 92 | 92 | #include "includes/decocrpt.h" |
| 93 | #include "includes/deco32.h" | |
| 94 | 93 | #include "cpu/arm/arm.h" |
| 94 | #include "includes/simpl156.h" | |
| 95 | 95 | #include "machine/eeprom.h" |
| 96 | 96 | #include "sound/okim6295.h" |
| 97 | #include "i | |
| 97 | #include "vi | |
| 98 | 98 | |
| 99 | static UINT32 *simpl156_systemram; | |
| 100 | 99 | |
| 101 | extern VIDEO_START( simpl156 ); | |
| 102 | extern VIDEO_UPDATE( simpl156 ); | |
| 103 | ||
| 104 | ||
| 105 | 100 | static INPUT_PORTS_START( simpl156 ) |
| 106 | PORT_START("IN0") | |
| 101 | PORT_START("IN0") | |
| 107 | 102 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 108 | 103 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 109 | 104 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| r7500 | r7501 | |
| 112 | 107 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) // eeprom?.. |
| 113 | 108 | |
| 114 | 109 | |
| 115 | PORT_START("IN1") | |
| 110 | PORT_START("IN1") | |
| 116 | 111 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 117 | 112 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 118 | 113 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 134 | 129 | |
| 135 | 130 | static READ32_HANDLER( simpl156_inputs_read ) |
| 136 | 131 | { |
| 137 | int eep = eeprom_read_bit(devtag_get_device(space->machine, "eeprom")); | |
| 138 | UINT32 returndata; | |
| 132 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 133 | int eep = eeprom_read_bit(state->eeprom); | |
| 134 | UINT32 returndata = input_port_read(space->machine, "IN0") ^ 0xffff0000; | |
| 139 | 135 | |
| 140 | returndata = input_port_read(space->machine, "IN0") ^ 0xffff0000; | |
| 141 | ||
| 142 | returndata^= ( (eep<<8) ); | |
| 136 | returndata ^= ((eep << 8)); | |
| 143 | 137 | return returndata; |
| 144 | 138 | } |
| 145 | 139 | |
| r7500 | r7501 | |
| 153 | 147 | UINT16 dat; |
| 154 | 148 | int color; |
| 155 | 149 | |
| 156 | data &=0x0000ffff; | |
| 157 | mem_mask &=0x0000ffff; | |
| 150 | data &= 0x0000ffff; | |
| 151 | mem_mask &= 0x0000ffff; | |
| 158 | 152 | |
| 159 | 153 | COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]); |
| 160 | 154 | color = offset; |
| 161 | 155 | |
| 162 | dat = space->machine->generic.paletteram.u16[offset]&0xffff; | |
| 156 | dat = space->machine->generic.paletteram.u16[offset] & 0xffff; | |
| 163 | 157 | palette_set_color_rgb(space->machine,color,pal5bit(dat >> 0),pal5bit(dat >> 5),pal5bit(dat >> 10)); |
| 164 | 158 | } |
| 165 | 159 | |
| r7500 | r7501 | |
| 175 | 169 | |
| 176 | 170 | static WRITE32_HANDLER( simpl156_eeprom_w ) |
| 177 | 171 | { |
| 178 | | |
| 172 | s | |
| 179 | 173 | //int okibank; |
| 180 | 174 | |
| 181 | 175 | //okibank = data & 0x07; |
| 182 | 176 | |
| 183 | okim6295_set_bank_base( | |
| 177 | okim6295_set_bank_base(s | |
| 184 | 178 | |
| 185 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 186 | eeprom_write_bit(device, data & 0x10); | |
| 187 | eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 179 | eeprom_set_clock_line(state->eeprom, BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE); | |
| 180 | eeprom_write_bit(state->eeprom, BIT(data, 4)); | |
| 181 | eeprom_set_cs_line(state->eeprom, BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE); | |
| 188 | 182 | } |
| 189 | 183 | |
| 190 | 184 | |
| r7500 | r7501 | |
| 192 | 186 | |
| 193 | 187 | static READ32_HANDLER( simpl156_spriteram_r ) |
| 194 | 188 | { |
| 195 | return space->machine->generic.spriteram.u32[offset]^0xffff0000; | |
| 189 | return space->machine->generic.spriteram.u32[offset] ^ 0xffff0000; | |
| 196 | 190 | } |
| 197 | 191 | |
| 198 | 192 | static WRITE32_HANDLER( simpl156_spriteram_w ) |
| 199 | 193 | { |
| 200 | data &=0x0000ffff; | |
| 201 | mem_mask &=0x0000ffff; | |
| 194 | data &= 0x0000ffff; | |
| 195 | mem_mask &= 0x0000ffff; | |
| 202 | 196 | |
| 203 | 197 | COMBINE_DATA(&space->machine->generic.spriteram.u32[offset]); |
| 204 | 198 | } |
| 205 | 199 | |
| 206 | static UINT32*simpl156_mainram; | |
| 207 | 200 | |
| 208 | ||
| 209 | 201 | static READ32_HANDLER( simpl156_mainram_r ) |
| 210 | 202 | { |
| 211 | return simpl156_mainram[offset]^0xffff0000; | |
| 203 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 204 | return state->mainram[offset]^0xffff0000; | |
| 212 | 205 | } |
| 213 | 206 | |
| 214 | 207 | static WRITE32_HANDLER( simpl156_mainram_w ) |
| 215 | 208 | { |
| 216 | data &=0x0000ffff; | |
| 217 | mem_mask &=0x0000ffff; | |
| 209 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 210 | data &= 0x0000ffff; | |
| 211 | mem_mask &= 0x0000ffff; | |
| 218 | 212 | |
| 219 | COMBINE_DATA(&s | |
| 213 | COMBINE_DATA(&state-> | |
| 220 | 214 | } |
| 221 | 215 | |
| 222 | 216 | static READ32_HANDLER( simpl156_pf1_rowscroll_r ) |
| 223 | 217 | { |
| 224 | return deco16_pf1_rowscroll[offset]^0xffff0000; | |
| 218 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 219 | return state->pf1_rowscroll[offset] ^ 0xffff0000; | |
| 225 | 220 | } |
| 226 | 221 | |
| 227 | 222 | static WRITE32_HANDLER( simpl156_pf1_rowscroll_w ) |
| 228 | 223 | { |
| 229 | data &=0x0000ffff; | |
| 230 | mem_mask &=0x0000ffff; | |
| 224 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 225 | data &= 0x0000ffff; | |
| 226 | mem_mask &= 0x0000ffff; | |
| 231 | 227 | |
| 232 | COMBINE_DATA(& | |
| 228 | COMBINE_DATA(&state-> | |
| 233 | 229 | } |
| 234 | 230 | |
| 235 | 231 | static READ32_HANDLER( simpl156_pf2_rowscroll_r ) |
| 236 | 232 | { |
| 237 | return deco16_pf2_rowscroll[offset]^0xffff0000; | |
| 233 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 234 | return state->pf2_rowscroll[offset] ^ 0xffff0000; | |
| 238 | 235 | } |
| 239 | 236 | |
| 240 | 237 | static WRITE32_HANDLER( simpl156_pf2_rowscroll_w ) |
| 241 | 238 | { |
| 242 | data &=0x0000ffff; | |
| 243 | mem_mask &=0x0000ffff; | |
| 239 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 240 | data &= 0x0000ffff; | |
| 241 | mem_mask &= 0x0000ffff; | |
| 244 | 242 | |
| 245 | COMBINE_DATA(& | |
| 243 | COMBINE_DATA(&state-> | |
| 246 | 244 | } |
| 247 | 245 | |
| 248 | static READ32_HANDLER ( simpl156_pf12_control_r ) | |
| 249 | { | |
| 250 | return deco16_pf12_control[offset]^0xffff0000; | |
| 251 | } | |
| 252 | ||
| 253 | static WRITE32_HANDLER( simpl156_pf12_control_w ) | |
| 254 | { | |
| 255 | data &=0x0000ffff; | |
| 256 | mem_mask &=0x0000ffff; | |
| 257 | ||
| 258 | COMBINE_DATA(&deco16_pf12_control[offset]); | |
| 259 | } | |
| 260 | ||
| 261 | ||
| 262 | static READ32_HANDLER( simpl156_pf1_data_r ) | |
| 263 | { | |
| 264 | return deco16_pf1_data[offset]^0xffff0000; | |
| 265 | } | |
| 266 | ||
| 267 | static WRITE32_HANDLER( simpl156_pf1_data_w ) | |
| 268 | { | |
| 269 | data &=0x0000ffff; | |
| 270 | mem_mask &=0x0000ffff; | |
| 271 | ||
| 272 | deco16_pf1_data_w(space,offset,data,mem_mask); | |
| 273 | } | |
| 274 | ||
| 275 | static READ32_HANDLER( simpl156_pf2_data_r ) | |
| 276 | { | |
| 277 | return deco16_pf2_data[offset]^0xffff0000; | |
| 278 | } | |
| 279 | ||
| 280 | ||
| 281 | static WRITE32_HANDLER( simpl156_pf2_data_w ) | |
| 282 | { | |
| 283 | data &=0x0000ffff; | |
| 284 | mem_mask &=0x0000ffff; | |
| 285 | deco16_pf2_data_w(space,offset,data,mem_mask); | |
| 286 | } | |
| 287 | ||
| 288 | 246 | /* Memory Map controled by PALs */ |
| 289 | 247 | |
| 290 | 248 | /* Joe and Mac Returns */ |
| 291 | 249 | static ADDRESS_MAP_START( joemacr_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 292 | 250 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 293 | AM_RANGE(0x100000, 0x107fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE( | |
| 251 | AM_RANGE(0x100000, 0x107fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE_MEMBER( | |
| 294 | 252 | AM_RANGE(0x110000, 0x111fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram) |
| 295 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) | |
| 296 | AM_RANGE(0x130000, 0x130003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) | |
| 297 | AM_RANGE(0x140000, 0x14001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w) | |
| 298 | AM_RANGE(0x150000, 0x151fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 299 | AM_RANGE(0x152000, 0x153fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 300 | AM_RANGE(0x154000, 0x155fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) | |
| 253 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE(simpl156_palette_r, simpl156_palette_w) | |
| 254 | AM_RANGE(0x130000, 0x130003) AM_READWRITE(simpl156_system_r, simpl156_eeprom_w) | |
| 255 | AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 256 | AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 257 | AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 258 | AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 301 | 259 | AM_RANGE(0x160000, 0x161fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 302 | 260 | AM_RANGE(0x164000, 0x165fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 303 | 261 | AM_RANGE(0x170000, 0x170003) AM_READONLY AM_WRITENOP // ? |
| 304 | 262 | AM_RANGE(0x180000, 0x180003) AM_DEVREADWRITE8("okisfx", okim6295_r, okim6295_w, 0x000000ff) |
| 305 | 263 | AM_RANGE(0x1c0000, 0x1c0003) AM_DEVREADWRITE8("okimusic", okim6295_r, okim6295_w, 0x000000ff) |
| 306 | 264 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 307 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE( | |
| 265 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE_MEMBER( | |
| 308 | 266 | ADDRESS_MAP_END |
| 309 | 267 | |
| 310 | 268 | |
| r7500 | r7501 | |
| 312 | 270 | static ADDRESS_MAP_START( chainrec_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 313 | 271 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // rom (32-bit) |
| 314 | 272 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 315 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE( | |
| 273 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE_MEMBER( | |
| 316 | 274 | AM_RANGE(0x3c0000, 0x3c0003) AM_DEVREADWRITE8("okimusic", okim6295_r, okim6295_w, 0x000000ff) |
| 317 | AM_RANGE(0x400000, 0x407fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE( | |
| 275 | AM_RANGE(0x400000, 0x407fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE_MEMBER( | |
| 318 | 276 | AM_RANGE(0x410000, 0x411fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram) |
| 319 | 277 | AM_RANGE(0x420000, 0x420fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 320 | 278 | AM_RANGE(0x430000, 0x430003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 321 | AM_RANGE(0x440000, 0x44001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w) | |
| 322 | AM_RANGE(0x450000, 0x451fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 323 | AM_RANGE(0x452000, 0x453fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 324 | AM_RANGE(0x454000, 0x455fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) | |
| 279 | AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 280 | AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 281 | AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 282 | AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 325 | 283 | AM_RANGE(0x460000, 0x461fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 326 | 284 | AM_RANGE(0x464000, 0x465fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 327 | 285 | AM_RANGE(0x470000, 0x470003) AM_READONLY AM_WRITENOP // ?? |
| r7500 | r7501 | |
| 333 | 291 | static ADDRESS_MAP_START( magdrop_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 334 | 292 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 335 | 293 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 336 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE( | |
| 294 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE_MEMBER( | |
| 337 | 295 | AM_RANGE(0x340000, 0x340003) AM_DEVREADWRITE8("okimusic", okim6295_r, okim6295_w, 0x000000ff) |
| 338 | AM_RANGE(0x380000, 0x387fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE( | |
| 296 | AM_RANGE(0x380000, 0x387fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE_MEMBER( | |
| 339 | 297 | AM_RANGE(0x390000, 0x391fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram) |
| 340 | 298 | AM_RANGE(0x3a0000, 0x3a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 341 | 299 | AM_RANGE(0x3b0000, 0x3b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 342 | AM_RANGE(0x3c0000, 0x3c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w) | |
| 343 | AM_RANGE(0x3d0000, 0x3d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 344 | AM_RANGE(0x3d2000, 0x3d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 345 | AM_RANGE(0x3d4000, 0x3d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) | |
| 300 | AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 301 | AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 302 | AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 303 | AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 346 | 304 | AM_RANGE(0x3e0000, 0x3e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 347 | 305 | AM_RANGE(0x3e4000, 0x3e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 348 | 306 | AM_RANGE(0x3f0000, 0x3f0003) AM_READONLY AM_WRITENOP //? |
| r7500 | r7501 | |
| 354 | 312 | static ADDRESS_MAP_START( magdropp_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 355 | 313 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 356 | 314 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 357 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE( | |
| 315 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE_MEMBER( | |
| 358 | 316 | AM_RANGE(0x4c0000, 0x4c0003) AM_DEVREADWRITE8("okimusic", okim6295_r, okim6295_w, 0x000000ff) |
| 359 | AM_RANGE(0x680000, 0x687fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE( | |
| 317 | AM_RANGE(0x680000, 0x687fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE_MEMBER( | |
| 360 | 318 | AM_RANGE(0x690000, 0x691fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram) |
| 361 | 319 | AM_RANGE(0x6a0000, 0x6a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 362 | 320 | AM_RANGE(0x6b0000, 0x6b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 363 | AM_RANGE(0x6c0000, 0x6c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w) | |
| 364 | AM_RANGE(0x6d0000, 0x6d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 365 | AM_RANGE(0x6d2000, 0x6d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 366 | AM_RANGE(0x6d4000, 0x6d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) | |
| 321 | AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 322 | AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 323 | AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 324 | AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 367 | 325 | AM_RANGE(0x6e0000, 0x6e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 368 | 326 | AM_RANGE(0x6e4000, 0x6e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 369 | 327 | AM_RANGE(0x6f0000, 0x6f0003) AM_READONLY AM_WRITENOP // ? |
| r7500 | r7501 | |
| 376 | 334 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 377 | 335 | AM_RANGE(0x100000, 0x100003) AM_DEVREADWRITE8("okisfx", okim6295_r, okim6295_w, 0x000000ff) |
| 378 | 336 | AM_RANGE(0x140000, 0x140003) AM_DEVREADWRITE8("okimusic", okim6295_r, okim6295_w, 0x000000ff) |
| 379 | AM_RANGE(0x180000, 0x187fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE( | |
| 337 | AM_RANGE(0x180000, 0x187fff) AM_READWRITE(simpl156_mainram_r, simpl156_mainram_w) AM_BASE_MEMBER( | |
| 380 | 338 | AM_RANGE(0x190000, 0x191fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram) |
| 381 | 339 | AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 382 | 340 | AM_RANGE(0x1b0000, 0x1b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 383 | AM_RANGE(0x1c0000, 0x1c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w) | |
| 384 | AM_RANGE(0x1d0000, 0x1d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 385 | AM_RANGE(0x1d2000, 0x1d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w) | |
| 386 | AM_RANGE(0x1d4000, 0x1d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) | |
| 341 | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w) | |
| 342 | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 343 | AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) | |
| 344 | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) | |
| 387 | 345 | AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 388 | 346 | AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 389 | 347 | AM_RANGE(0x1f0000, 0x1f0003) AM_READONLY AM_WRITENOP // ? |
| 390 | 348 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 391 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE( | |
| 349 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE_MEMBER( | |
| 392 | 350 | ADDRESS_MAP_END |
| 393 | 351 | |
| 394 | 352 | |
| r7500 | r7501 | |
| 439 | 397 | } |
| 440 | 398 | |
| 441 | 399 | |
| 400 | static int simpl156_bank_callback(const int bank) | |
| 401 | { | |
| 402 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 403 | } | |
| 404 | ||
| 405 | static const deco16ic_interface simpl156_deco16ic_intf = | |
| 406 | { | |
| 407 | "screen", | |
| 408 | 1, 0, 1, | |
| 409 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 410 | 0, 16, 0, 16, /* color base (default values) */ | |
| 411 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 412 | simpl156_bank_callback, | |
| 413 | simpl156_bank_callback, | |
| 414 | NULL, | |
| 415 | NULL | |
| 416 | }; | |
| 417 | ||
| 418 | static MACHINE_START( simpl156 ) | |
| 419 | { | |
| 420 | simpl156_state *state = (simpl156_state *)machine->driver_data; | |
| 421 | ||
| 422 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 423 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 424 | state->eeprom = devtag_get_device(machine, "eeprom"); | |
| 425 | state->okimusic = devtag_get_device(machine, "okimusic"); | |
| 426 | } | |
| 427 | ||
| 442 | 428 | static MACHINE_DRIVER_START( chainrec ) |
| 429 | ||
| 430 | /* driver data */ | |
| 431 | MDRV_DRIVER_DATA(simpl156_state) | |
| 432 | ||
| 443 | 433 | /* basic machine hardware */ |
| 444 | ||
| 445 | 434 | MDRV_CPU_ADD("maincpu", ARM, 28000000 /* /4 */) /*DE156*/ /* 7.000 MHz */ /* measured at 7.. seems to need 28? */ |
| 446 | 435 | MDRV_CPU_PROGRAM_MAP(chainrec_map) |
| 447 | 436 | MDRV_CPU_VBLANK_INT("screen", simpl156_vbl_interrupt) |
| 448 | 437 | |
| 449 | 438 | MDRV_EEPROM_93C46_ADD("eeprom") // 93C45 |
| 450 | 439 | |
| 440 | MDRV_MACHINE_START(simpl156) | |
| 441 | ||
| 451 | 442 | /* video hardware */ |
| 452 | 443 | MDRV_SCREEN_ADD("screen", RASTER) |
| 453 | 444 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 461 | 452 | MDRV_VIDEO_START(simpl156) |
| 462 | 453 | MDRV_VIDEO_UPDATE(simpl156) |
| 463 | 454 | |
| 455 | MDRV_DECO16IC_ADD("deco_custom", simpl156_deco16ic_intf) | |
| 456 | ||
| 464 | 457 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 465 | 458 | |
| 466 | ||
| 467 | 459 | MDRV_SOUND_ADD("okisfx", OKIM6295, 32220000/32) |
| 468 | 460 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) |
| 469 | 461 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6) |
| r7500 | r7501 | |
| 509 | 501 | MACHINE_DRIVER_END |
| 510 | 502 | |
| 511 | 503 | |
| 512 | static DRIVER_INIT(simpl156) | |
| 513 | { | |
| 514 | UINT8 *rom = memory_region(machine, "okimusic"); | |
| 515 | int length = memory_region_length(machine, "okimusic"); | |
| 516 | UINT8 *buf1 = auto_alloc_array(machine, UINT8, length); | |
| 517 | ||
| 518 | UINT32 x; | |
| 519 | ||
| 520 | /* hmm low address line goes to banking chip instead? */ | |
| 521 | for (x=0;x<length;x++) | |
| 522 | { | |
| 523 | UINT32 addr; | |
| 524 | ||
| 525 | addr = BITSWAP24 (x,23,22,21,0, 20, | |
| 526 | 19,18,17,16, | |
| 527 | 15,14,13,12, | |
| 528 | 11,10,9, 8, | |
| 529 | 7, 6, 5, 4, | |
| 530 | 3, 2, 1 ); | |
| 531 | ||
| 532 | buf1[addr] = rom[x]; | |
| 533 | } | |
| 534 | ||
| 535 | memcpy(rom,buf1,length); | |
| 536 | ||
| 537 | auto_free (machine, buf1); | |
| 538 | ||
| 539 | deco56_decrypt_gfx(machine, "gfx1"); | |
| 540 | deco156_decrypt(machine); | |
| 541 | } | |
| 542 | ||
| 543 | 504 | /* |
| 544 | 505 | |
| 545 | 506 | Joe and Mac Returns |
| r7500 | r7501 | |
| 1070 | 1031 | */ |
| 1071 | 1032 | |
| 1072 | 1033 | |
| 1034 | static DRIVER_INIT( simpl156 ) | |
| 1035 | { | |
| 1036 | UINT8 *rom = memory_region(machine, "okimusic"); | |
| 1037 | int length = memory_region_length(machine, "okimusic"); | |
| 1038 | UINT8 *buf1 = auto_alloc_array(machine, UINT8, length); | |
| 1039 | ||
| 1040 | UINT32 x; | |
| 1041 | ||
| 1042 | /* hmm low address line goes to banking chip instead? */ | |
| 1043 | for (x = 0; x < length; x++) | |
| 1044 | { | |
| 1045 | UINT32 addr; | |
| 1046 | ||
| 1047 | addr = BITSWAP24 (x,23,22,21,0, 20, | |
| 1048 | 19,18,17,16, | |
| 1049 | 15,14,13,12, | |
| 1050 | 11,10,9, 8, | |
| 1051 | 7, 6, 5, 4, | |
| 1052 | 3, 2, 1 ); | |
| 1053 | ||
| 1054 | buf1[addr] = rom[x]; | |
| 1055 | } | |
| 1056 | ||
| 1057 | memcpy(rom, buf1, length); | |
| 1058 | ||
| 1059 | auto_free(machine, buf1); | |
| 1060 | ||
| 1061 | deco56_decrypt_gfx(machine, "gfx1"); | |
| 1062 | deco156_decrypt(machine); | |
| 1063 | } | |
| 1064 | ||
| 1073 | 1065 | /* Everything seems more stable if we run the CPU speed x4 and use Idle skips.. maybe it has an internal multipler? */ |
| 1074 | 1066 | static READ32_HANDLER( joemacr_speedup_r ) |
| 1075 | 1067 | { |
| 1076 | if (cpu_get_pc(space->cpu)==0x284) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1077 | return simpl156_systemram[0x18/4]; | |
| 1068 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 1069 | if (cpu_get_pc(space->cpu) == 0x284) | |
| 1070 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1071 | return state->systemram[0x18/4]; | |
| 1078 | 1072 | } |
| 1079 | 1073 | |
| 1080 | 1074 | |
| 1081 | static DRIVER_INIT | |
| 1075 | static DRIVER_INIT | |
| 1082 | 1076 | { |
| 1083 | 1077 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r ); |
| 1084 | 1078 | DRIVER_INIT_CALL(simpl156); |
| r7500 | r7501 | |
| 1086 | 1080 | |
| 1087 | 1081 | static READ32_HANDLER( chainrec_speedup_r ) |
| 1088 | 1082 | { |
| 1089 | if (cpu_get_pc(space->cpu)==0x2d4) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1090 | return simpl156_systemram[0x18/4]; | |
| 1083 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 1084 | if (cpu_get_pc(space->cpu) == 0x2d4) | |
| 1085 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1086 | return state->systemram[0x18/4]; | |
| 1091 | 1087 | } |
| 1092 | 1088 | |
| 1093 | static DRIVER_INIT | |
| 1089 | static DRIVER_INIT | |
| 1094 | 1090 | { |
| 1095 | 1091 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r ); |
| 1096 | 1092 | DRIVER_INIT_CALL(simpl156); |
| r7500 | r7501 | |
| 1098 | 1094 | |
| 1099 | 1095 | static READ32_HANDLER( prtytime_speedup_r ) |
| 1100 | 1096 | { |
| 1101 | if (cpu_get_pc(space->cpu)==0x4f0) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1102 | return simpl156_systemram[0xae0/4]; | |
| 1097 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 1098 | if (cpu_get_pc(space->cpu) == 0x4f0) | |
| 1099 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1100 | return state->systemram[0xae0/4]; | |
| 1103 | 1101 | } |
| 1104 | 1102 | |
| 1105 | static DRIVER_INIT | |
| 1103 | static DRIVER_INIT | |
| 1106 | 1104 | { |
| 1107 | 1105 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); |
| 1108 | 1106 | DRIVER_INIT_CALL(simpl156); |
| r7500 | r7501 | |
| 1111 | 1109 | |
| 1112 | 1110 | static READ32_HANDLER( charlien_speedup_r ) |
| 1113 | 1111 | { |
| 1114 | if (cpu_get_pc(space->cpu)==0xc8c8) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1115 | return simpl156_systemram[0x10/4]; | |
| 1112 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 1113 | if (cpu_get_pc(space->cpu) == 0xc8c8) | |
| 1114 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1115 | return state->systemram[0x10/4]; | |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | static DRIVER_INIT | |
| 1118 | static DRIVER_INIT | |
| 1119 | 1119 | { |
| 1120 | 1120 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201010, 0x0201013, 0, 0, charlien_speedup_r ); |
| 1121 | 1121 | DRIVER_INIT_CALL(simpl156); |
| r7500 | r7501 | |
| 1123 | 1123 | |
| 1124 | 1124 | static READ32_HANDLER( osman_speedup_r ) |
| 1125 | 1125 | { |
| 1126 | if (cpu_get_pc(space->cpu)==0x5974) cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1127 | return simpl156_systemram[0x10/4]; | |
| 1126 | simpl156_state *state = (simpl156_state *)space->machine->driver_data; | |
| 1127 | if (cpu_get_pc(space->cpu) == 0x5974) | |
| 1128 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); | |
| 1129 | return state->systemram[0x10/4]; | |
| 1128 | 1130 | } |
| 1129 | 1131 | |
| 1130 | static DRIVER_INIT | |
| 1132 | static DRIVER_INIT | |
| 1131 | 1133 | { |
| 1132 | 1134 | memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); |
| 1133 | 1135 | DRIVER_INIT_CALL(simpl156); |
| r7500 | r7501 | |
| 1135 | 1137 | } |
| 1136 | 1138 | |
| 1137 | 1139 | /* Data East games running on the DE-0409-1 or DE-0491-1 PCB */ |
| 1138 | GAME( 1994, joemacr, 0, joemacr, simpl156, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.1, 1994.05.27)", 0 ) /* bootleg board with genuine DECO parts */ | |
| 1139 | GAME( 1994, joemacra, joemacr, joemacr, simpl156, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.0, 1994.05.19)", 0 ) | |
| 1140 | GAME( 1995, chainrec, 0, chainrec, simpl156, chainrec, ROT0, "Data East", "Chain Reaction (World, Version 2.2, 1995.09.25)", 0 ) | |
| 1141 | GAME( 1995, magdrop, chainrec, magdrop, simpl156, chainrec, ROT0, "Data East", "Magical Drop (Japan, Version 1.1, 1995.06.21)", 0 ) | |
| 1142 | GAME( 1995, magdropp, chainrec, magdropp, simpl156, chainrec, ROT0, "Data East", "Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12)", 0 ) | |
| 1140 | GAME( 1994, joemacr, 0, joemacr, simpl156, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.1, 1994.05.27)", GAME_SUPPORTS_SAVE ) /* bootleg board with genuine DECO parts */ | |
| 1141 | GAME( 1994, joemacra, joemacr, joemacr, simpl156, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.0, 1994.05.19)", GAME_SUPPORTS_SAVE ) | |
| 1142 | GAME( 1995, chainrec, 0, chainrec, simpl156, chainrec, ROT0, "Data East", "Chain Reaction (World, Version 2.2, 1995.09.25)", GAME_SUPPORTS_SAVE ) | |
| 1143 | GAME( 1995, magdrop, chainrec, magdrop, simpl156, chainrec, ROT0, "Data East", "Magical Drop (Japan, Version 1.1, 1995.06.21)", GAME_SUPPORTS_SAVE ) | |
| 1144 | GAME( 1995, magdropp, chainrec, magdropp, simpl156, chainrec, ROT0, "Data East", "Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12)", GAME_SUPPORTS_SAVE ) | |
| 1143 | 1145 | |
| 1144 | 1146 | /* Mitchell games running on the DEC-22VO / MT5601-0 PCB */ |
| 1145 | GAME( 1995, charlien, 0, mitchell156, simpl156, charlien, ROT0, "Mitchell", "Charlie Ninja" , 0) /* language in service mode */ | |
| 1146 | GAME( 1995, prtytime, 0, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Party Time: Gonta the Diver II / Ganbare! Gonta!! 2 (World Release)", 0) /* language in service mode */ | |
| 1147 | GAME( 1995, gangonta, prtytime, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release)", 0) /* language in service mode */ | |
| 1148 | GAME( 1996, osman, 0, mitchell156, simpl156, osman, ROT0, "Mitchell", "Osman (World)", 0 ) | |
| 1149 | GAME( 1996, candance, osman, mitchell156, simpl156, osman, ROT0, "Mitchell (Atlus License)", "Cannon Dancer (Japan)", 0 ) | |
| 1147 | GAME( 1995, charlien, 0, mitchell156, simpl156, charlien, ROT0, "Mitchell", "Charlie Ninja" , GAME_SUPPORTS_SAVE ) /* language in service mode */ | |
| 1148 | GAME( 1995, prtytime, 0, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Party Time: Gonta the Diver II / Ganbare! Gonta!! 2 (World Release)", GAME_SUPPORTS_SAVE ) /* language in service mode */ | |
| 1149 | GAME( 1995, gangonta, prtytime, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release)", GAME_SUPPORTS_SAVE ) /* language in service mode */ | |
| 1150 | GAME( 1996, osman, 0, mitchell156, simpl156, osman, ROT0, "Mitchell", "Osman (World)", GAME_SUPPORTS_SAVE ) | |
| 1151 | GAME( 1996, candance, osman, mitchell156, simpl156, osman, ROT0, "Mitchell (Atlus License)", "Cannon Dancer (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 26 | 26 | Comad game number: ??? |
| 27 | 27 | GulfWar II (Game play very similar to Twin cobra) |
| 28 | 28 | |
| 29 | ||
| 29 | 30 | Difference between Twin Cobra and Kyukyoko Tiger: |
| 30 | 31 | T.C. supports two simultaneous players. |
| 31 | 32 | K.T. supports two players, but only one at a time. |
| r7500 | r7501 | |
| 46 | 47 | K.T. Due to this difference in continue sequence, Kyukyoko Tiger is MUCH |
| 47 | 48 | harder, challenging, and nearly impossible to complete ! |
| 48 | 49 | |
| 50 | ||
| 51 | Stephh's notes (based on the games M68000 and Z80 code and some tests) : | |
| 52 | ||
| 53 | 1) 'twincobr' and "clones" | |
| 54 | ||
| 55 | - There is no real "test mode" : only a grid with colors ("Cross Hatch Pattern") | |
| 56 | is displayed. There is a specific "Show Dip Switches Settings". | |
| 57 | ||
| 58 | 1a) 'twincobr' | |
| 59 | ||
| 60 | - No notice screen. | |
| 61 | - Game uses TOAPLAN_COINAGE_WORLD (code at 0x0bfd in CPU1). | |
| 62 | - Press any players buttons on startup to skip some tests (code at 0x025ed8). | |
| 63 | ||
| 64 | 1b) 'twincobru' | |
| 65 | ||
| 66 | - "FOR USE IN U.S.A. ONLY" notice screen. | |
| 67 | - Game uses TOAPLAN_COINAGE_JAPAN_OLD (code at 0x0bfd in CPU1). | |
| 68 | - Press any players buttons on startup to skip some tests (code at 0x025ed6). | |
| 69 | ||
| 70 | 1c) 'ktiger' | |
| 71 | ||
| 72 | - "FOR USE IN JAPAN ONLY" notice screen. | |
| 73 | - Game uses TOAPLAN_COINAGE_JAPAN_OLD (code at 0x0bfd in CPU1 - same as in 'twincobru'). | |
| 74 | - Press any players buttons on startup to skip some tests (code at 0x0259d0). | |
| 75 | - "Bonus Lives" settings are different than the ones in the other sets. | |
| 76 | - See other differences with 'twincobr' and 'twincobru' above. | |
| 77 | ||
| 78 | 1d) 'gulfwar2' | |
| 79 | ||
| 80 | - No notice screen. | |
| 81 | - Game uses TOAPLAN_COINAGE_JAPAN_OLD (code at 0x0bfd in CPU1 - same as in 'twincobru'). | |
| 82 | Surprisingly, when Dip Switches are displayed, it shows TOAPLAN_COINAGE_WORLD. | |
| 83 | - Press any players buttons on startup to skip some tests (code at 0x025ed8). | |
| 84 | - VBLANK bit is inverted (ACTIVE_LOW instead of ACTIVE_HIGH). | |
| 85 | ||
| 86 | ||
| 87 | 2) 'fshark' and "clones" | |
| 88 | ||
| 89 | - There is no real "test mode" : only a grid with colors ("Cross Hatch Pattern") | |
| 90 | is displayed. There is a specific "Show Dip Switches Settings". | |
| 91 | ||
| 92 | 2a) 'fshark' | |
| 93 | ||
| 94 | - No notice screen. | |
| 95 | - Game uses TOAPLAN_COINAGE_WORLD. | |
| 96 | - When cabinet set to "Upright", you can use joystick and buttons from both players | |
| 97 | (code at 0x002434). | |
| 98 | ||
| 99 | 2b) 'skyshark' | |
| 100 | ||
| 101 | - "FOR USE IN U.S.A. ONLY" notice screen. | |
| 102 | - Game uses a specific coinage. | |
| 103 | - When cabinet set to "Upright", you can use joystick and buttons from both players | |
| 104 | (code at 0x002436). | |
| 105 | ||
| 106 | 2c) 'hishouza' | |
| 107 | ||
| 108 | - "FOR USE IN JAPAN ONLY" notice screen. | |
| 109 | - Game uses TOAPLAN_COINAGE_JAPAN_OLD. | |
| 110 | - When cabinet set to "Upright", you can use joystick and buttons from both players | |
| 111 | (code at 0x002456). | |
| 112 | ||
| 113 | 2d) 'fsharkbt' | |
| 114 | ||
| 115 | - This bootleg is heavily based on 'skyshark', so they share the same infos. | |
| 116 | However, the values written to the DSP (0x030004) are the same as in 'hishouza' | |
| 117 | and the chars ROMS (gfx1) are the same as in 'fshark' ! | |
| 118 | ||
| 49 | 119 | **************************** Memory & I/O Maps ***************************** |
| 50 | 120 | 68000: Main CPU |
| 51 | 121 | |
| r7500 | r7501 | |
| 191 | 261 | #include "cpu/z80/z80.h" |
| 192 | 262 | #include "cpu/m68000/m68000.h" |
| 193 | 263 | #include "cpu/tms32010/tms32010.h" |
| 264 | #include "includes/toaplipt.h" | |
| 194 | 265 | #include "includes/twincobr.h" |
| 195 | 266 | #include "sound/3812intf.h" |
| 196 | 267 | |
| r7500 | r7501 | |
| 268 | 339 | Input Port definitions |
| 269 | 340 | *****************************************************************************/ |
| 270 | 341 | |
| 271 | #define TOAPLAN_PLAYER_INPUT( player ) \ | |
| 272 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(player) PORT_8WAY \ | |
| 273 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(player) PORT_8WAY \ | |
| 274 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(player) PORT_8WAY \ | |
| 275 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(player) PORT_8WAY \ | |
| 276 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(player) \ | |
| 277 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(player) \ | |
| 278 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ | |
| 279 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 280 | ||
| 281 | #define TOAPLAN_JAPAN_DSW_A \ | |
| 282 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) \ | |
| 283 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) \ | |
| 284 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) \ | |
| 285 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) \ | |
| 286 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 287 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) \ | |
| 288 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) \ | |
| 289 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 290 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) \ | |
| 291 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) \ | |
| 292 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) \ | |
| 293 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ | |
| 294 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \ | |
| 295 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ | |
| 296 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 297 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) \ | |
| 298 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) \ | |
| 299 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 300 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) \ | |
| 301 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 302 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) \ | |
| 303 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 304 | ||
| 305 | #define TWINCOBR_VBLANK_INPUT( active_level ) \ | |
| 306 | PORT_BIT( 0x7f, active_level, IPT_UNKNOWN ) \ | |
| 307 | PORT_BIT( 0x80, active_level, IPT_VBLANK ) | |
| 308 | ||
| 309 | #define TWINCOBR_SYSTEM_INPUTS \ | |
| 310 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 ) \ | |
| 311 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) \ | |
| 312 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) \ | |
| 313 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 314 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) \ | |
| 315 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) \ | |
| 316 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) \ | |
| 317 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) \ | |
| 318 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) \ | |
| 319 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 320 | ||
| 321 | #define TWINCOBR_DSW_B /* not KTIGER */ \ | |
| 322 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) \ | |
| 323 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) \ | |
| 324 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) \ | |
| 325 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) \ | |
| 326 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) \ | |
| 327 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) \ | |
| 328 | PORT_DIPSETTING( 0x00, "50K, then every 150K" ) \ | |
| 329 | PORT_DIPSETTING( 0x04, "70K, then every 200K" ) \ | |
| 330 | PORT_DIPSETTING( 0x08, "50000" ) \ | |
| 331 | PORT_DIPSETTING( 0x0c, "100000" ) \ | |
| 332 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) \ | |
| 333 | PORT_DIPSETTING( 0x30, "2" ) \ | |
| 334 | PORT_DIPSETTING( 0x00, "3" ) \ | |
| 335 | PORT_DIPSETTING( 0x20, "4" ) \ | |
| 336 | PORT_DIPSETTING( 0x10, "5" ) \ | |
| 337 | PORT_DIPNAME( 0x40, 0x00, "Show DIP SW Settings" ) \ | |
| 338 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) \ | |
| 339 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) \ | |
| 340 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) \ | |
| 341 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ | |
| 342 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 343 | ||
| 344 | #define FSHARK_SYSTEM_INPUTS /* V-Blank is also here */ \ | |
| 345 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 ) \ | |
| 346 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) /* tilt causes freeze */ \ | |
| 347 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* reset button */ \ | |
| 348 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) \ | |
| 349 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) \ | |
| 350 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) \ | |
| 351 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) \ | |
| 352 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 353 | ||
| 354 | #define FSHARK_DSW_B \ | |
| 355 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) \ | |
| 356 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) \ | |
| 357 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) \ | |
| 358 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) \ | |
| 359 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) \ | |
| 360 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) \ | |
| 361 | PORT_DIPSETTING( 0x00, "50K, then every 150K" ) \ | |
| 362 | PORT_DIPSETTING( 0x04, "70K, then every 200K" ) \ | |
| 363 | PORT_DIPSETTING( 0x08, "50000" ) \ | |
| 364 | PORT_DIPSETTING( 0x0c, "100000" ) \ | |
| 365 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) \ | |
| 366 | PORT_DIPSETTING( 0x20, "1" ) \ | |
| 367 | PORT_DIPSETTING( 0x30, "2" ) \ | |
| 368 | PORT_DIPSETTING( 0x00, "3" ) \ | |
| 369 | PORT_DIPSETTING( 0x10, "5" ) \ | |
| 370 | PORT_DIPNAME( 0x40, 0x00, "Show DIP SW Settings" ) \ | |
| 371 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) \ | |
| 372 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) \ | |
| 373 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) \ | |
| 374 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) \ | |
| 375 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) | |
| 376 | ||
| 377 | ||
| 378 | ||
| 379 | ||
| 342 | /* verified from M68000 and Z80 code */ | |
| 380 | 343 | static INPUT_PORTS_START( twincobr ) |
| 381 | PORT_START("VBLANK") | |
| 382 | TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH ) | |
| 344 | PORT_START("DSWA") | |
| 345 | TOAPLAN_MACHINE_NO_COCKTAIL | |
| 346 | TOAPLAN_COINAGE_WORLD /* tables at 0x0c30 (COIN1) and 0x0c38 (COIN2) in CPU1 */ | |
| 383 | 347 | |
| 348 | PORT_START("DSWB") | |
| 349 | TOAPLAN_DIFFICULTY | |
| 350 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x020988 ('twincobr' and 'twincobru') */ | |
| 351 | PORT_DIPSETTING( 0x00, "50k 200k 150k+" ) | |
| 352 | PORT_DIPSETTING( 0x04, "70k 270k 200k+" ) | |
| 353 | PORT_DIPSETTING( 0x08, "50k Only" ) | |
| 354 | PORT_DIPSETTING( 0x0c, "100k Only" ) | |
| 355 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) | |
| 356 | PORT_DIPSETTING( 0x30, "2" ) | |
| 357 | PORT_DIPSETTING( 0x00, "3" ) | |
| 358 | PORT_DIPSETTING( 0x20, "4" ) | |
| 359 | PORT_DIPSETTING( 0x10, "5" ) | |
| 360 | PORT_DIPNAME( 0x40, 0x00, "Show Dip Switches Settings" ) | |
| 361 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 362 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) | |
| 363 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH ) | |
| 364 | ||
| 384 | 365 | PORT_START("P1") |
| 385 | TOAPLAN_ | |
| 366 | TOAPLAN_JO | |
| 386 | 367 | |
| 387 | 368 | PORT_START("P2") |
| 388 | TOAPLAN_ | |
| 369 | TOAPLAN_JO | |
| 389 | 370 | |
| 390 | PORT_START("DSWA") | |
| 391 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) | |
| 392 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 393 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 394 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 395 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 396 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 397 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 398 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 399 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 400 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 401 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 402 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 403 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 404 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 405 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 406 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 407 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 408 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 409 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 410 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 411 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 412 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 413 | ||
| 414 | PORT_START("DSWB") | |
| 415 | TWINCOBR_DSW_B | |
| 416 | ||
| 417 | 371 | PORT_START("SYSTEM") |
| 418 | TWINCOBR_SYSTEM_INPUTS | |
| 419 | INPUT_PORTS_END | |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses COIN1 coinage */ | |
| 373 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 374 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* same effect as the DSWA bit 2 */ | |
| 375 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 376 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 377 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 378 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 379 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 420 | 380 | |
| 421 | static INPUT_PORTS_START( twincobu ) | |
| 422 | 381 | PORT_START("VBLANK") |
| 423 | TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH ) | |
| 382 | PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 383 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 384 | INPUT_PORTS_END | |
| 424 | 385 | |
| 425 | PORT_START("P1") | |
| 426 | TOAPLAN_PLAYER_INPUT( 1 ) | |
| 386 | /* verified from M68000 and Z80 code */ | |
| 387 | static INPUT_PORTS_START( twincobru ) | |
| 388 | PORT_INCLUDE( twincobr ) | |
| 427 | 389 | |
| 428 | PORT_START("P2") | |
| 429 | TOAPLAN_PLAYER_INPUT( 2 ) | |
| 390 | PORT_MODIFY("DSWA") | |
| 391 | TOAPLAN_COINAGE_JAPAN_OLD /* table at 0x0c20 (COIN1 AND COIN2) in CPU1 */ | |
| 392 | INPUT_PORTS_END | |
| 430 | 393 | |
| 431 | PORT_START("DSWA") | |
| 432 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) | |
| 433 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 434 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 435 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 436 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 437 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 438 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 439 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 440 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 441 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 442 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 443 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 444 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 445 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 446 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 447 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 448 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 449 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 450 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 451 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 452 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 453 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 394 | /* verified from M68000 and Z80 code */ | |
| 395 | static INPUT_PORTS_START( ktiger ) | |
| 396 | PORT_INCLUDE( twincobru ) | |
| 454 | 397 | |
| 455 | PORT_START("DSWB") | |
| 456 | TWINCOBR_DSW_B | |
| 398 | PORT_MODIFY("DSWA") | |
| 399 | TOAPLAN_MACHINE_COCKTAIL | |
| 457 | 400 | |
| 458 | PORT_START("SYSTEM") | |
| 459 | TWINCOBR_SYSTEM_INPUTS | |
| 401 | PORT_MODIFY("DSWB") | |
| 402 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x0208d0 */ | |
| 403 | PORT_DIPSETTING( 0x04, "50k 200k 150k+" ) | |
| 404 | PORT_DIPSETTING( 0x00, "70k 270k 200k+" ) | |
| 405 | PORT_DIPSETTING( 0x08, "100k Only" ) | |
| 406 | PORT_DIPSETTING( 0x0c, DEF_STR( None ) ) | |
| 407 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) /* additional code at 0x020b3c */ | |
| 408 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 409 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) | |
| 460 | 410 | INPUT_PORTS_END |
| 461 | 411 | |
| 462 | static INPUT_PORTS_START( ktiger ) | |
| 463 | PORT_START("VBLANK") | |
| 464 | TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH ) | |
| 412 | /* verified from M68000 and Z80 code */ | |
| 413 | static INPUT_PORTS_START( gulfwar2 ) | |
| 414 | PORT_INCLUDE( twincobru ) | |
| 465 | 415 | |
| 466 | PORT_START("P1") | |
| 467 | TOAPLAN_PLAYER_INPUT( 1 ) | |
| 416 | PORT_MODIFY("VBLANK") | |
| 417 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 418 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 419 | INPUT_PORTS_END | |
| 468 | 420 | |
| 469 | PORT_START("P2") | |
| 470 | TOAPLAN_PLAYER_INPUT( 2 ) | |
| 471 | 421 | |
| 422 | /* verified from M68000 code */ | |
| 423 | static INPUT_PORTS_START( fshark ) | |
| 472 | 424 | PORT_START("DSWA") |
| 473 | TOAPLAN_JAPAN_DSW_A | |
| 425 | TOAPLAN_MACHINE_COCKTAIL | |
| 426 | TOAPLAN_COINAGE_WORLD /* tables at 0x00031c (COIN1) and 0x00032c (COIN2) */ | |
| 474 | 427 | |
| 475 | 428 | PORT_START("DSWB") |
| 476 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) | |
| 477 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 478 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 479 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 480 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 481 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 482 | PORT_DIPSETTING( 0x00, "70K, then every 200K" ) | |
| 483 | PORT_DIPSETTING( 0x04, "50K, then every 150K" ) | |
| 484 | PORT_DIPSETTING( 0x08, "100000" ) | |
| 485 | PORT_DIPSETTING( 0x0c, "No Extend" ) | |
| 429 | TOAPLAN_DIFFICULTY | |
| 430 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x000b96 (fshark), 0x000b80 (skyshark) or 0x000b7e (hishouza) */ | |
| 431 | PORT_DIPSETTING( 0x00, "50k 200k 150k+" ) | |
| 432 | PORT_DIPSETTING( 0x04, "70k 270k 200k+" ) | |
| 433 | PORT_DIPSETTING( 0x08, "50k Only" ) | |
| 434 | PORT_DIPSETTING( 0x0c, "100k Only" ) | |
| 486 | 435 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) |
| 436 | PORT_DIPSETTING( 0x20, "1" ) | |
| 487 | 437 | PORT_DIPSETTING( 0x30, "2" ) |
| 488 | 438 | PORT_DIPSETTING( 0x00, "3" ) |
| 489 | PORT_DIPSETTING( 0x20, "4" ) | |
| 490 | 439 | PORT_DIPSETTING( 0x10, "5" ) |
| 491 | PORT_DIPNAME( 0x40, 0x00, "Show D | |
| 440 | PORT_DIPNAME( 0x40, 0x00, "Show Dip Switches Settings" ) | |
| 492 | 441 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 493 | 442 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) |
| 494 | 443 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) |
| 495 | 444 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 496 | 445 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 497 | 446 | |
| 498 | PORT_START("SYSTEM") | |
| 499 | TWINCOBR_SYSTEM_INPUTS | |
| 500 | INPUT_PORTS_END | |
| 501 | ||
| 502 | static INPUT_PORTS_START( fshark ) | |
| 503 | PORT_START("VBLANK") | |
| 504 | FSHARK_SYSTEM_INPUTS | |
| 505 | ||
| 506 | 447 | PORT_START("P1") |
| 507 | TOAPLAN_ | |
| 448 | TOAPLAN_JO | |
| 508 | 449 | |
| 509 | 450 | PORT_START("P2") |
| 510 | TOAPLAN_ | |
| 451 | TOAPLAN_JO | |
| 511 | 452 | |
| 512 | PORT_START("DSWA") | |
| 513 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 514 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 515 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 516 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 517 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 518 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 519 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 520 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 521 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 522 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 523 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 524 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 525 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 526 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 527 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 528 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 529 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 530 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 531 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 532 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 533 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 534 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 535 | ||
| 536 | PORT_START("DSWB") | |
| 537 | FSHARK_DSW_B | |
| 538 | ||
| 539 | PORT_START("SYSTEM") | |
| 453 | PORT_START("SYSTEM") /* Port name kept to fit other games in the driver - it doesn't even exist */ | |
| 540 | 454 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 455 | ||
| 456 | PORT_START("VBLANK") /* Port name kept to fit other games in the driver - it shall be "SYSTEM" */ | |
| 457 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses COIN1 coinage */ | |
| 458 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 459 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* reset button */ | |
| 460 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 461 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 462 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 463 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 464 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 541 | 465 | INPUT_PORTS_END |
| 542 | 466 | |
| 467 | /* verified from M68000 code */ | |
| 543 | 468 | static INPUT_PORTS_START( skyshark ) |
| 544 | PORT_START("VBLANK") | |
| 545 | FSHARK_SYSTEM_INPUTS | |
| 469 | PORT_INCLUDE( fshark ) | |
| 546 | 470 | |
| 547 | PORT_START("P1") | |
| 548 | TOAPLAN_PLAYER_INPUT( 1 ) | |
| 549 | ||
| 550 | PORT_START("P2") | |
| 551 | TOAPLAN_PLAYER_INPUT( 2 ) | |
| 552 | ||
| 553 | PORT_START("DSWA") | |
| 554 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 555 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 556 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 557 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 558 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 559 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 560 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 561 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 562 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 563 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 564 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 565 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 566 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 471 | PORT_MODIFY("DSWA") | |
| 472 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) /* table at 0x000316 */ | |
| 567 | 473 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) |
| 568 | 474 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 569 | 475 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) |
| 570 | /* PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) ) Same as previous */ | |
| 571 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 476 | // PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) ) /* duplicated setting */ | |
| 477 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) /* table at 0x000316 */ | |
| 572 | 478 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) |
| 573 | 479 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 574 | 480 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) |
| 575 | /* PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) Same as previous */ | |
| 576 | ||
| 577 | PORT_START("DSWB") | |
| 578 | FSHARK_DSW_B | |
| 579 | ||
| 580 | PORT_START("SYSTEM") | |
| 581 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 481 | // PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) /* duplicated setting */ | |
| 582 | 482 | INPUT_PORTS_END |
| 583 | 483 | |
| 484 | /* verified from M68000 code */ | |
| 584 | 485 | static INPUT_PORTS_START( hishouza ) |
| 585 | PORT_START("VBLANK") | |
| 586 | FSHARK_SYSTEM_INPUTS | |
| 486 | PORT_INCLUDE( fshark ) | |
| 587 | 487 | |
| 588 | PORT_START("P1") | |
| 589 | TOAPLAN_PLAYER_INPUT( 1 ) | |
| 590 | ||
| 591 | PORT_START("P2") | |
| 592 | TOAPLAN_PLAYER_INPUT( 2 ) | |
| 593 | ||
| 594 | PORT_START("DSWA") | |
| 595 | TOAPLAN_JAPAN_DSW_A | |
| 596 | ||
| 597 | PORT_START("DSWB") | |
| 598 | FSHARK_DSW_B | |
| 599 | ||
| 600 | PORT_START("SYSTEM") | |
| 601 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 488 | PORT_MODIFY("DSWA") | |
| 489 | TOAPLAN_COINAGE_JAPAN_OLD /* table at 0x000316 (COIN1 AND COIN2) */ | |
| 602 | 490 | INPUT_PORTS_END |
| 603 | 491 | |
| 604 | static INPUT_PORTS_START( gulfwar2 ) | |
| 605 | PORT_START("VBLANK") | |
| 606 | TWINCOBR_VBLANK_INPUT( IP_ACTIVE_LOW ) | |
| 607 | 492 | |
| 608 | PORT_START("P1") | |
| 609 | TOAPLAN_PLAYER_INPUT( 1 ) | |
| 610 | 493 | |
| 611 | PORT_START("P2") | |
| 612 | TOAPLAN_PLAYER_INPUT( 2 ) | |
| 613 | 494 | |
| 614 | PORT_START("DSWA") | |
| 615 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) | |
| 616 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 617 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 618 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 619 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 620 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 621 | PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" ) | |
| 622 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 623 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 624 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 625 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 626 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 627 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 628 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 629 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 630 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 631 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 632 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 633 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 634 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 635 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 636 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 637 | ||
| 638 | PORT_START("DSWB") | |
| 639 | TWINCOBR_DSW_B | |
| 640 | ||
| 641 | PORT_START("SYSTEM") | |
| 642 | TWINCOBR_SYSTEM_INPUTS | |
| 643 | INPUT_PORTS_END | |
| 644 | ||
| 645 | ||
| 646 | ||
| 647 | 495 | static const gfx_layout charlayout = |
| 648 | 496 | { |
| 649 | 497 | 8,8, /* 8*8 characters */ |
| r7500 | r7501 | |
| 893 | 741 | ROM_LOAD( "82s123.b24", 0x240, 0x020, CRC(4fb5df2a) SHA1(506ef2c8e4cf45c256d6831a0a5760732f2de422) ) /* tile to sprite priority ?? */ |
| 894 | 742 | ROM_END |
| 895 | 743 | |
| 744 | ROM_START( gulfwar2 ) | |
| 745 | ROM_REGION( 0x40000, "maincpu", 0 ) /* Main 68K code */ | |
| 746 | ROM_LOAD16_BYTE( "08-u119.bin", 0x00000, 0x20000, CRC(41ebf9c0) SHA1(85207dda76abded727ed95717024a2ea2bd85dac) ) | |
| 747 | ROM_LOAD16_BYTE( "07-u92.bin", 0x00001, 0x20000, CRC(b73e6b25) SHA1(53cde41e5a2e8f721c3f43abf1fff46479f658d8) ) | |
| 748 | ||
| 749 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ | |
| 750 | ROM_LOAD( "06-u51.bin", 0x00000, 0x08000, CRC(75504f95) SHA1(5bd23e700e1bd4f0fac622dfb7c8cc69ba764956) ) | |
| 751 | ||
| 752 | ROM_REGION( 0x2000, "dsp", 0 ) /* Co-Processor TMS320C10 MCU code */ | |
| 753 | /* ROMs are duplicated 4 times */ | |
| 754 | ROM_LOAD16_BYTE( "01-u2.rom", 0x000, 0x800, CRC(01399b65) SHA1(4867ec815e22c9124c7aa00ebb6089c2611fa31f) ) // Same code as Twin Cobra | |
| 755 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 756 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 757 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 758 | ROM_LOAD16_BYTE( "02-u1.rom", 0x001, 0x800, CRC(abefe4ca) SHA1(f05f12a1ff19411f34f4eee98ce9ba450fec38f2) ) // Same code as Twin Cobra | |
| 759 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 760 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 761 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 762 | ||
| 763 | ROM_REGION( 0x0c000, "gfx1", 0 ) /* chars */ | |
| 764 | ROM_LOAD( "03-u9.bin", 0x00000, 0x04000, CRC(1b7934b3) SHA1(c7f5ac364dec4c7843c30e098fd02e0901bdf4b7) ) | |
| 765 | ROM_LOAD( "04-u10.bin", 0x04000, 0x04000, CRC(6f7bfb58) SHA1(4c5602668938a52321b70cd971326fe1a4930889) ) | |
| 766 | ROM_LOAD( "05-u11.bin", 0x08000, 0x04000, CRC(31814724) SHA1(bdcf270e6219555a7f776167f6bf971c6ff18a83) ) | |
| 767 | ||
| 768 | ROM_REGION( 0x40000, "gfx2", 0 ) /* fg tiles */ | |
| 769 | ROM_LOAD( "16-u202.bin", 0x00000, 0x10000, CRC(d815d175) SHA1(917043d0731226d18bcc22dfe27e5a5a18b03c06) ) | |
| 770 | ROM_LOAD( "13-u199.bin", 0x10000, 0x10000, CRC(d949b0d9) SHA1(1974d3b54e082baa9084dd619c8a879d954644cd) ) | |
| 771 | ROM_LOAD( "14-u200.bin", 0x20000, 0x10000, CRC(c109a6ac) SHA1(3a13ec802e5bafcf599c273a0bb0fd078e01e171) ) | |
| 772 | ROM_LOAD( "15-u201.bin", 0x30000, 0x10000, CRC(ad21f2ab) SHA1(0ab6eeb4dc9c2531c6f19479e7f9bc54fc1c1fdf) ) | |
| 773 | ||
| 774 | ROM_REGION( 0x20000, "gfx3", 0 ) /* bg tiles */ | |
| 775 | ROM_LOAD( "09-u195.bin", 0x00000, 0x08000, CRC(b7be3a6d) SHA1(68b9223fd07e81d443a1ae3ff04b2af105b27548) ) | |
| 776 | ROM_LOAD( "12-u198.bin", 0x08000, 0x08000, CRC(fd7032a6) SHA1(8be6315d732b154163a3573e2017fdfc77c92e54) ) | |
| 777 | ROM_LOAD( "11-u197.bin", 0x10000, 0x08000, CRC(7b721ed3) SHA1(afd10229414c65a56e184d56a69460ca3a502a27) ) | |
| 778 | ROM_LOAD( "10-u196.rom", 0x18000, 0x08000, CRC(160f38ab) SHA1(da310ec387d439b26c8b6b881e5dcc07c2b9bb00) ) | |
| 779 | ||
| 780 | ROM_REGION( 0x40000, "gfx4", 0 ) /* sprites */ | |
| 781 | ROM_LOAD( "20-u262.bin", 0x00000, 0x10000, CRC(10665ca0) SHA1(0c552c3807e00a7ef4f9fd28c7988a232628a1f5) ) | |
| 782 | ROM_LOAD( "19-u261.bin", 0x10000, 0x10000, CRC(cfa6d417) SHA1(f6c17d938b58dc5756ecf617f00fbfaf701602a7) ) | |
| 783 | ROM_LOAD( "18-u260.bin", 0x20000, 0x10000, CRC(2e6a0c49) SHA1(0b7ddad8775dcebe240a8246ef7816113f517f87) ) | |
| 784 | ROM_LOAD( "17-u259.bin", 0x30000, 0x10000, CRC(66c1b0e6) SHA1(82f3659245913f835c4434131c179b49ee195961) ) | |
| 785 | ||
| 786 | ROM_REGION( 0x260, "proms", 0 ) | |
| 787 | ROM_LOAD( "82s129.d3", 0x000, 0x100, CRC(24e7d62f) SHA1(1c06a1ef1b6a722794ca1d5ee2c476ecaa5178a3) ) /* sprite priority control ?? */ | |
| 788 | ROM_LOAD( "82s129.d4", 0x100, 0x100, CRC(a50cef09) SHA1(55cafb5b2551b80ae708e9b966cf37c70a16d310) ) /* sprite priority control ?? */ | |
| 789 | ROM_LOAD( "82s123.d2", 0x200, 0x020, CRC(f72482db) SHA1(b0cb911f9c81f6088a5aa8760916ddae1f8534d7) ) /* sprite control ?? */ | |
| 790 | ROM_LOAD( "82s123.e18", 0x220, 0x020, CRC(bc88cced) SHA1(5055362710c0f58823c05fb4c0e0eec638b91e3d) ) /* sprite attribute (flip/position) ?? */ | |
| 791 | ROM_LOAD( "82s123.b24", 0x240, 0x020, CRC(4fb5df2a) SHA1(506ef2c8e4cf45c256d6831a0a5760732f2de422) ) /* tile to sprite priority ?? */ | |
| 792 | ROM_END | |
| 793 | ||
| 896 | 794 | ROM_START( fshark ) |
| 897 | 795 | ROM_REGION( 0x30000, "maincpu", 0 ) /* Main 68K code */ |
| 898 | 796 | ROM_LOAD16_BYTE( "b02_18-1.m8", 0x00000, 0x10000, CRC(04739e02) SHA1(8a14284adb0f0f33adf9affdec081c90de85d594) ) |
| r7500 | r7501 | |
| 1049 | 947 | ROM_LOAD( "b02_16.l5", 0x0000, 0x8000, CRC(cdd1a153) SHA1(de9827a959039cf753ecac6756fb1925c37466d8) ) |
| 1050 | 948 | |
| 1051 | 949 | ROM_REGION( 0x2000, "dsp", 0 ) /* Co-Processor TMS320C10 MCU code */ |
| 1052 | ROMX_LOAD( "82s137-1.mcu", 0x0000, 0x0400, CRC(cc5b3f53) SHA1(33589665ac995cc4645b56bbcd6d1c1cd5368f88), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 1053 | ROMX_LOAD( "82s137-2.mcu", 0x0000, 0x0400, CRC(47351d55) SHA1(826add3ea3987f2c9ba2d3fc69a4ad2d9b033c89), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 1054 | ROMX_LOAD( "82s137-3.mcu", 0x0001, 0x0400, CRC(70b537b9) SHA1(5211ec4605894727747dda66b70c9427652b16b4), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 1055 | ROMX_LOAD( "82s137-4.mcu", 0x0001, 0x0400, CRC(6edb2de8) SHA1(48459037c3b865f0c0d63a416fa71ba1119f7a09), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 1056 | ROMX_LOAD( "82s137-5.mcu", 0x0800, 0x0400, CRC(f35b978a) SHA1(90da4ab12126727cd9510fdfe4f626452116c543), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 1057 | ROMX_LOAD( "82s137-6.mcu", 0x0800, 0x0400, CRC(0459e51b) SHA1(b673f5e1fcf60c0ba668aeb98d545d17b988945d), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 1058 | ROMX_LOAD( "82s137-7.mcu", 0x0801, 0x0400, CRC(cbf3184b) SHA1(a3eafadc319183ed688dc081c4dfcbe8d476abea), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 1059 | ROMX_LOAD( "82s137-8.mcu", 0x0801, 0x0400, CRC(8246a05c) SHA1(2511fa99fbdd6c75281fa85ecca2a617d36eb360), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 950 | /* FIXME : DSP ROMS from 'hishouza' (the only way to play the game) */ | |
| 951 | ROMX_LOAD( "dsp-a1.bpr", 0x0000, 0x0400, CRC(45d4d1b1) SHA1(e776a056f0f72cbeb309c5a23f803330cb8b3763), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 952 | ROMX_LOAD( "dsp-a2.bpr", 0x0000, 0x0400, CRC(edd227fa) SHA1(34aba84b5216ecbe462e7166d0f66785ca049a34), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 953 | ROMX_LOAD( "dsp-a3.bpr", 0x0001, 0x0400, CRC(df88e79b) SHA1(661b057fa2eef37b9d794151381d7d74a7bfa93a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 954 | ROMX_LOAD( "dsp-a4.bpr", 0x0001, 0x0400, CRC(a2094a7f) SHA1(0f1c173643046c76aa89eab66fba6ea51c3f2223), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 955 | ROMX_LOAD( "dsp-b5.bpr", 0x0800, 0x0400, CRC(85ca5d47) SHA1(3c6e21e2897fd35834021ec9f81f57bebfd13ef8), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 956 | ROMX_LOAD( "dsp-b6.bpr", 0x0800, 0x0400, CRC(81816b2c) SHA1(1e58ab7aef2a34f42267debf4cad9558d5e14159), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 957 | ROMX_LOAD( "dsp-b7.bpr", 0x0801, 0x0400, CRC(e87540cd) SHA1(bb6e98c47ed46abbbfa06571806cb2d663880419), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) ) | |
| 958 | ROMX_LOAD( "dsp-b8.bpr", 0x0801, 0x0400, CRC(d3c16c5c) SHA1(a24d9536914734c1875c8a39938a346ff4418dd0), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) ) | |
| 1060 | 959 | |
| 1061 | 960 | ROM_REGION( 0x0c000, "gfx1", 0 ) /* chars */ |
| 1062 | 961 | ROM_LOAD( "b02_07-1.h11", 0x00000, 0x04000, CRC(e669f80e) SHA1(05c1a4ff9adaa6c8035f38a76c5ee333fafba2bf) ) |
| r7500 | r7501 | |
| 1089 | 988 | ROM_LOAD( "b02-23.f28", 0x240, 0x020, CRC(4fb5df2a) SHA1(506ef2c8e4cf45c256d6831a0a5760732f2de422) ) /* bprom type: 82s123AN - tile to sprite priority ?? */ |
| 1090 | 989 | ROM_END |
| 1091 | 990 | |
| 1092 | ROM_START( gulfwar2 ) | |
| 1093 | ROM_REGION( 0x40000, "maincpu", 0 ) /* Main 68K code */ | |
| 1094 | ROM_LOAD16_BYTE( "08-u119.bin", 0x00000, 0x20000, CRC(41ebf9c0) SHA1(85207dda76abded727ed95717024a2ea2bd85dac) ) | |
| 1095 | ROM_LOAD16_BYTE( "07-u92.bin", 0x00001, 0x20000, CRC(b73e6b25) SHA1(53cde41e5a2e8f721c3f43abf1fff46479f658d8) ) | |
| 1096 | 991 | |
| 1097 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ | |
| 1098 | ROM_LOAD( "06-u51.bin", 0x00000, 0x08000, CRC(75504f95) SHA1(5bd23e700e1bd4f0fac622dfb7c8cc69ba764956) ) | |
| 1099 | ||
| 1100 | ROM_REGION( 0x2000, "dsp", 0 ) /* Co-Processor TMS320C10 MCU code */ | |
| 1101 | /* ROMs are duplicated 4 times */ | |
| 1102 | ROM_LOAD16_BYTE( "01-u2.rom", 0x000, 0x800, CRC(01399b65) SHA1(4867ec815e22c9124c7aa00ebb6089c2611fa31f) ) // Same code as Twin Cobra | |
| 1103 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 1104 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 1105 | ROM_CONTINUE( 0x000, 0x800 ) | |
| 1106 | ROM_LOAD16_BYTE( "02-u1.rom", 0x001, 0x800, CRC(abefe4ca) SHA1(f05f12a1ff19411f34f4eee98ce9ba450fec38f2) ) // Same code as Twin Cobra | |
| 1107 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 1108 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 1109 | ROM_CONTINUE( 0x001, 0x800 ) | |
| 1110 | ||
| 1111 | ROM_REGION( 0x0c000, "gfx1", 0 ) /* chars */ | |
| 1112 | ROM_LOAD( "03-u9.bin", 0x00000, 0x04000, CRC(1b7934b3) SHA1(c7f5ac364dec4c7843c30e098fd02e0901bdf4b7) ) | |
| 1113 | ROM_LOAD( "04-u10.bin", 0x04000, 0x04000, CRC(6f7bfb58) SHA1(4c5602668938a52321b70cd971326fe1a4930889) ) | |
| 1114 | ROM_LOAD( "05-u11.bin", 0x08000, 0x04000, CRC(31814724) SHA1(bdcf270e6219555a7f776167f6bf971c6ff18a83) ) | |
| 1115 | ||
| 1116 | ROM_REGION( 0x40000, "gfx2", 0 ) /* fg tiles */ | |
| 1117 | ROM_LOAD( "16-u202.bin", 0x00000, 0x10000, CRC(d815d175) SHA1(917043d0731226d18bcc22dfe27e5a5a18b03c06) ) | |
| 1118 | ROM_LOAD( "13-u199.bin", 0x10000, 0x10000, CRC(d949b0d9) SHA1(1974d3b54e082baa9084dd619c8a879d954644cd) ) | |
| 1119 | ROM_LOAD( "14-u200.bin", 0x20000, 0x10000, CRC(c109a6ac) SHA1(3a13ec802e5bafcf599c273a0bb0fd078e01e171) ) | |
| 1120 | ROM_LOAD( "15-u201.bin", 0x30000, 0x10000, CRC(ad21f2ab) SHA1(0ab6eeb4dc9c2531c6f19479e7f9bc54fc1c1fdf) ) | |
| 1121 | ||
| 1122 | ROM_REGION( 0x20000, "gfx3", 0 ) /* bg tiles */ | |
| 1123 | ROM_LOAD( "09-u195.bin", 0x00000, 0x08000, CRC(b7be3a6d) SHA1(68b9223fd07e81d443a1ae3ff04b2af105b27548) ) | |
| 1124 | ROM_LOAD( "12-u198.bin", 0x08000, 0x08000, CRC(fd7032a6) SHA1(8be6315d732b154163a3573e2017fdfc77c92e54) ) | |
| 1125 | ROM_LOAD( "11-u197.bin", 0x10000, 0x08000, CRC(7b721ed3) SHA1(afd10229414c65a56e184d56a69460ca3a502a27) ) | |
| 1126 | ROM_LOAD( "10-u196.rom", 0x18000, 0x08000, CRC(160f38ab) SHA1(da310ec387d439b26c8b6b881e5dcc07c2b9bb00) ) | |
| 1127 | ||
| 1128 | ROM_REGION( 0x40000, "gfx4", 0 ) /* sprites */ | |
| 1129 | ROM_LOAD( "20-u262.bin", 0x00000, 0x10000, CRC(10665ca0) SHA1(0c552c3807e00a7ef4f9fd28c7988a232628a1f5) ) | |
| 1130 | ROM_LOAD( "19-u261.bin", 0x10000, 0x10000, CRC(cfa6d417) SHA1(f6c17d938b58dc5756ecf617f00fbfaf701602a7) ) | |
| 1131 | ROM_LOAD( "18-u260.bin", 0x20000, 0x10000, CRC(2e6a0c49) SHA1(0b7ddad8775dcebe240a8246ef7816113f517f87) ) | |
| 1132 | ROM_LOAD( "17-u259.bin", 0x30000, 0x10000, CRC(66c1b0e6) SHA1(82f3659245913f835c4434131c179b49ee195961) ) | |
| 1133 | ||
| 1134 | ROM_REGION( 0x260, "proms", 0 ) | |
| 1135 | ROM_LOAD( "82s129.d3", 0x000, 0x100, CRC(24e7d62f) SHA1(1c06a1ef1b6a722794ca1d5ee2c476ecaa5178a3) ) /* sprite priority control ?? */ | |
| 1136 | ROM_LOAD( "82s129.d4", 0x100, 0x100, CRC(a50cef09) SHA1(55cafb5b2551b80ae708e9b966cf37c70a16d310) ) /* sprite priority control ?? */ | |
| 1137 | ROM_LOAD( "82s123.d2", 0x200, 0x020, CRC(f72482db) SHA1(b0cb911f9c81f6088a5aa8760916ddae1f8534d7) ) /* sprite control ?? */ | |
| 1138 | ROM_LOAD( "82s123.e18", 0x220, 0x020, CRC(bc88cced) SHA1(5055362710c0f58823c05fb4c0e0eec638b91e3d) ) /* sprite attribute (flip/position) ?? */ | |
| 1139 | ROM_LOAD( "82s123.b24", 0x240, 0x020, CRC(4fb5df2a) SHA1(506ef2c8e4cf45c256d6831a0a5760732f2de422) ) /* tile to sprite priority ?? */ | |
| 1140 | ROM_END | |
| 1141 | ||
| 1142 | ||
| 1143 | 992 | static DRIVER_INIT( twincobr ) |
| 1144 | 993 | { |
| 1145 | 994 | twincobr_driver_savestate(machine); |
| 1146 | 995 | } |
| 1147 | 996 | |
| 1148 | 997 | |
| 1149 | GAME( 1987, twincobr, 0, twincobr, twincobr, twincobr, ROT270, "[Toaplan] Taito Corporation", "Twin Cobra (World)", 0 ) | |
| 1150 | GAME( 1987, twincobru,twincobr, twincobr, twincobu, twincobr, ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Twin Cobra (US)", 0 ) | |
| 1151 | GAME( 1987, ktiger, twincobr, twincobr, ktiger, twincobr, ROT270, "[Toaplan] Taito Corporation", "Kyukyoku Tiger (Japan)", 0 ) | |
| 1152 | GAME( 1987, fshark, 0, twincobr, fshark, twincobr, ROT270, "[Toaplan] Taito Corporation", "Flying Shark (World)", 0 ) | |
| 1153 | GAME( 1987, skyshark, fshark, twincobr, skyshark, twincobr, ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Sky Shark (US)", 0 ) | |
| 1154 | GAME( 1987, hishouza, fshark, twincobr, hishouza, twincobr, ROT270, "[Toaplan] Taito Corporation", "Hishou Zame (Japan)", 0 ) | |
| 1155 | GAME( 1987, fsharkbt, fshark, twincobr, skyshark, twincobr, ROT270, "bootleg", "Flying Shark (bootleg)", 0 ) | |
| 1156 | GAME( 1991, gulfwar2, 0, twincobr, gulfwar2, twincobr, ROT270, "Comad", "Gulf War II", 0 ) | |
| 998 | GAME( 1987, twincobr, 0, twincobr, twincobr, twincobr, ROT270, "[Toaplan] Taito Corporation", "Twin Cobra (World)", 0 ) | |
| 999 | GAME( 1987, twincobru, twincobr, twincobr, twincobru, twincobr, ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Twin Cobra (US)", 0 ) | |
| 1000 | GAME( 1987, ktiger, twincobr, twincobr, ktiger, twincobr, ROT270, "[Toaplan] Taito Corporation", "Kyukyoku Tiger (Japan)", 0 ) | |
| 1001 | GAME( 1991, gulfwar2, 0, twincobr, gulfwar2, twincobr, ROT270, "Comad", "Gulf War II", 0 ) | |
| 1002 | ||
| 1003 | GAME( 1987, fshark, 0, twincobr, fshark, twincobr, ROT270, "[Toaplan] Taito Corporation", "Flying Shark (World)", 0 ) | |
| 1004 | GAME( 1987, skyshark, fshark, twincobr, skyshark, twincobr, ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Sky Shark (US)", 0 ) | |
| 1005 | GAME( 1987, hishouza, fshark, twincobr, hishouza, twincobr, ROT270, "[Toaplan] Taito Corporation", "Hishou Zame (Japan)", 0 ) | |
| 1006 | GAME( 1987, fsharkbt, fshark, twincobr, skyshark, twincobr, ROT270, "bootleg", "Flying Shark (bootleg)", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 496 | 496 | return soundlatch_r(space, offset); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | /* if we have a Z80 PIO, | |
| 499 | /* if we have a Z80 PIO, ge | |
| 500 | 500 | else if (pio != NULL) |
| 501 | return z80pio_p_r(pio, 0); | |
| 501 | { | |
| 502 | UINT8 data = z80pio_pa_r(pio, 0); | |
| 503 | z80pio_astb_w(pio, 0); | |
| 504 | z80pio_astb_w(pio, 1); | |
| 505 | return data; | |
| 506 | } | |
| 502 | 507 | |
| 503 | 508 | return 0xff; |
| 504 | 509 | } |
| r7500 | r7501 | |
| 519 | 524 | } |
| 520 | 525 | |
| 521 | 526 | |
| 522 | static WRITE_LINE_DEVICE_HANDLER( pio_ready_w ) | |
| 523 | { | |
| 524 | cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); | |
| 525 | } | |
| 526 | 527 | |
| 527 | ||
| 528 | ||
| 529 | 528 | /************************************* |
| 530 | 529 | * |
| 531 | 530 | * MCU I/O |
| r7500 | r7501 | |
| 756 | 755 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x02) AM_READ_PORT("SWA") /* DIP2 */ |
| 757 | 756 | AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x02) AM_READ_PORT("SWB") /* DIP1 some games read it from here... */ |
| 758 | 757 | AM_RANGE(0x10, 0x10) AM_MIRROR(0x03) AM_READ_PORT("SWB") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 759 | AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("pio", z80pio_r, z80pio_w) | |
| 758 | AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("pio", z80pio_cd_ba_r, z80pio_cd_ba_w) | |
| 760 | 759 | ADDRESS_MAP_END |
| 761 | 760 | |
| 762 | 761 | |
| r7500 | r7501 | |
| 2079 | 2078 | DEVCB_HANDLER(sound_control_w) |
| 2080 | 2079 | }; |
| 2081 | 2080 | |
| 2082 | static | |
| 2081 | static Z | |
| 2083 | 2082 | { |
| 2084 | 2083 | DEVCB_NULL, |
| 2085 | 2084 | DEVCB_NULL, |
| 2086 | DEVCB_NULL, | |
| 2087 | 2085 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, soundport_w), |
| 2086 | DEVCB_CPU_INPUT_LINE("soundcpu", INPUT_LINE_NMI), | |
| 2087 | DEVCB_NULL, | |
| 2088 | 2088 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, videomode_w), |
| 2089 | DEVCB_LINE(pio_ready_w), | |
| 2090 | 2089 | DEVCB_NULL |
| 2091 | 2090 | }; |
| 2092 | 2091 | |
| r7500 | r7501 | |
| 2158 | 2157 | MDRV_CPU_IO_MAP(system1_pio_io_map) |
| 2159 | 2158 | |
| 2160 | 2159 | MDRV_DEVICE_REMOVE("ppi") |
| 2161 | MDRV_Z80PIO_ADD("pio", pio_interface) | |
| 2160 | MDRV_Z80PIO_ADD("pio", MASTER_CLOCK, pio_interface) | |
| 2162 | 2161 | MACHINE_DRIVER_END |
| 2163 | 2162 | |
| 2164 | 2163 | /* reduced visible area for scrolling games */ |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | The program rom extracted from the Z180 also refers to this as Lucky 74.. |
| 7 | 7 | |
| 8 | TODO: | |
| 9 | - interrupt generation (nested NMIs? disabled for now) | |
| 10 | - video emulation (uses tilexor) | |
| 8 | 11 | |
| 9 | ||
| 10 | ||
| 11 | ||
| 12 | 12 | Lucky Girl |
| 13 | 13 | Wing 1991 |
| 14 | 14 | |
| r7500 | r7501 | |
| 77 | 77 | #include "cpu/z180/z180.h" |
| 78 | 78 | #include "video/mc6845.h" |
| 79 | 79 | |
| 80 | static UINT8 *luck_vram1,*luck_vram2,*luck_vram3; | |
| 81 | static UINT8 nmi_enable; | |
| 80 | 82 | |
| 83 | static VIDEO_START(luckgrln) | |
| 84 | { | |
| 85 | ||
| 86 | } | |
| 87 | ||
| 88 | static VIDEO_UPDATE(luckgrln) | |
| 89 | { | |
| 90 | int y,x; | |
| 91 | int count = 0; | |
| 92 | ||
| 93 | for (y=0;y<32;y++) | |
| 94 | { | |
| 95 | for (x=0;x<64;x++) | |
| 96 | { | |
| 97 | UINT16 tile = (luck_vram1[count] & 0xff); | |
| 98 | UINT16 enc_tile = (luck_vram2[count] & 0xff) | (luck_vram3[count] << 8); | |
| 99 | UINT16 dec_tile; | |
| 100 | UINT8 col = 0; | |
| 101 | UINT8 region = 0; | |
| 102 | //UINT8 region = (luck_vram2[count] & 0x20) >> 5; | |
| 103 | ||
| 104 | dec_tile = enc_tile & 0x0200 ? 0x10 : 0x00; | |
| 105 | dec_tile |= (enc_tile & 0x00f0)>>4; | |
| 106 | ||
| 107 | tile = tile|(dec_tile<<8); | |
| 108 | ||
| 109 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[region],tile,col,0,0,x*8,y*8); | |
| 110 | ||
| 111 | count++; | |
| 112 | } | |
| 113 | } | |
| 114 | return 0; | |
| 115 | } | |
| 116 | ||
| 81 | 117 | static ADDRESS_MAP_START( mainmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 82 | 118 | AM_RANGE(0x00000, 0x03fff) AM_ROM |
| 83 | AM_RANGE(0x10000, 0x1ffff) AM_ROMBANK("bank1") | |
| 119 | AM_RANGE(0x10000, 0x1ffff) AM_ROM AM_REGION("rom_data",0x10000) | |
| 120 | AM_RANGE(0x20000, 0x2ffff) AM_ROM AM_REGION("rom_data",0x00000) | |
| 121 | ||
| 122 | AM_RANGE(0x0c200, 0x0c5ff) AM_RAM | |
| 123 | AM_RANGE(0x0ca00, 0x0cdff) AM_RAM | |
| 124 | ||
| 125 | AM_RANGE(0x0d000, 0x0d03f) AM_RAM | |
| 126 | AM_RANGE(0x0d200, 0x0d2ff) AM_RAM | |
| 127 | AM_RANGE(0x0d400, 0x0d43f) AM_RAM | |
| 128 | ||
| 84 | 129 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM |
| 85 | AM_RANGE(0x0f000, 0x0ffff) AM_RAM | |
| 130 | ||
| 131 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM AM_BASE(&luck_vram1) | |
| 132 | AM_RANGE(0x0e800, 0x0efff) AM_RAM AM_BASE(&luck_vram2) | |
| 133 | AM_RANGE(0x0f000, 0x0f7ff) AM_RAM AM_BASE(&luck_vram3) | |
| 134 | ||
| 135 | /* patch NMI checks until I understand. */ | |
| 136 | AM_RANGE(0x0faff, 0x0faff) AM_NOP | |
| 137 | AM_RANGE(0x0fb02, 0x0fb02) AM_NOP | |
| 138 | ||
| 139 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM | |
| 86 | 140 | AM_RANGE(0xf0000, 0xfffff) AM_RAM |
| 87 | 141 | ADDRESS_MAP_END |
| 88 | 142 | |
| 143 | static WRITE8_HANDLER( output_w ) | |
| 144 | { | |
| 145 | /* correct? */ | |
| 146 | nmi_enable = data & 1; | |
| 147 | // other values unknown | |
| 148 | // printf("%02x\n",data); | |
| 149 | } | |
| 150 | ||
| 151 | static READ8_HANDLER( test_r ) | |
| 152 | { | |
| 153 | return mame_rand(space->machine); | |
| 154 | } | |
| 155 | ||
| 89 | 156 | static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 ) |
| 90 | 157 | ADDRESS_MAP_GLOBAL_MASK(0xff) // i think |
| 91 | 158 | AM_RANGE(0x0000, 0x003f) AM_RAM // Z180 internal regs |
| 159 | AM_RANGE(0x0060, 0x0060) AM_WRITE(output_w) | |
| 160 | AM_RANGE(0x0090, 0x009d) AM_READ(test_r) | |
| 92 | 161 | AM_RANGE(0x00b0, 0x00b0) AM_DEVWRITE("crtc", mc6845_address_w) |
| 93 | 162 | AM_RANGE(0x00b1, 0x00b1) AM_DEVWRITE("crtc", mc6845_register_w) |
| 94 | 163 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 104 | 173 | RGN_FRAC(1,6), |
| 105 | 174 | 6, |
| 106 | 175 | { RGN_FRAC(0,6),RGN_FRAC(1,6),RGN_FRAC(2,6),RGN_FRAC(3,6),RGN_FRAC(4,6),RGN_FRAC(5,6) }, |
| 107 | { 0,1 | |
| 176 | { STEP8(0,1) | |
| 108 | 177 | { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8}, |
| 109 | 178 | 8*8 |
| 110 | 179 | }; |
| 111 | 180 | static GFXDECODE_START( luckgrln ) |
| 181 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 16 ) | |
| 112 | 182 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) |
| 113 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 16 ) | |
| 114 | 183 | GFXDECODE_END |
| 115 | 184 | |
| 116 | static VIDEO_START(luckgrln) | |
| 117 | { | |
| 118 | ||
| 119 | } | |
| 120 | ||
| 121 | static VIDEO_UPDATE(luckgrln) | |
| 122 | { | |
| 123 | return 0; | |
| 124 | } | |
| 125 | ||
| 126 | 185 | static const mc6845_interface mc6845_intf = |
| 127 | 186 | { |
| 128 | 187 | "screen", /* screen we are acting on */ |
| r7500 | r7501 | |
| 137 | 196 | NULL /* update address callback */ |
| 138 | 197 | }; |
| 139 | 198 | |
| 199 | static INTERRUPT_GEN( luckgrln_irq ) | |
| 200 | { | |
| 201 | #if 0 | |
| 202 | if(nmi_enable) | |
| 203 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 204 | #endif | |
| 205 | } | |
| 206 | ||
| 140 | 207 | static MACHINE_DRIVER_START( luckgrln ) |
| 141 | 208 | MDRV_CPU_ADD("maincpu", Z180,8000000) |
| 142 | 209 | MDRV_CPU_PROGRAM_MAP(mainmap) |
| 143 | 210 | MDRV_CPU_IO_MAP(portmap) |
| 144 | MDRV_CPU_VBLANK_INT("screen", | |
| 211 | MDRV_CPU_VBLANK_INT("screen", luckgr | |
| 145 | 212 | |
| 146 | 213 | MDRV_MC6845_ADD("crtc", H46505, 6000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ |
| 147 | 214 | |
| 148 | ||
| 149 | 215 | MDRV_SCREEN_ADD("screen", RASTER) |
| 150 | 216 | MDRV_SCREEN_REFRESH_RATE(60) |
| 151 | 217 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 152 | 218 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 153 | MDRV_SCREEN_SIZE(256, 256) | |
| 154 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) | |
| 219 | MDRV_SCREEN_SIZE(512, 256) | |
| 220 | MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) | |
| 155 | 221 | |
| 156 | 222 | MDRV_GFXDECODE(luckgrln) |
| 157 | 223 | MDRV_PALETTE_LENGTH(0x100) |
| r7500 | r7501 | |
| 164 | 230 | { |
| 165 | 231 | int i; |
| 166 | 232 | UINT8 x,v; |
| 167 | UINT8* rom = memory_region(machine," | |
| 233 | UINT8* rom = memory_region(machine," | |
| 168 | 234 | |
| 169 | 235 | for (i=0;i<0x20000;i++) |
| 170 | 236 | { |
| r7500 | r7501 | |
| 191 | 257 | #endif |
| 192 | 258 | |
| 193 | 259 | // ?? |
| 194 | ||
| 260 | // memory_set_bankptr(machine, "bank1",&rom[0x010000]); | |
| 195 | 261 | } |
| 196 | 262 | |
| 197 | 263 | ROM_START( luckgrln ) |
| 198 | 264 | ROM_REGION( 0x4000, "maincpu", 0 ) // internal Z180 rom |
| 199 | 265 | ROM_LOAD( "lucky74.bin", 0x00000, 0x4000, CRC(fa128e05) SHA1(97a9534b8414f984159271db48b153b0724d22f9) ) |
| 200 | 266 | |
| 201 | ROM_REGION( 0x20000, " | |
| 267 | ROM_REGION( 0x20000, " | |
| 202 | 268 | ROM_LOAD( "falcon.13", 0x00000, 0x20000, CRC(f7a717fd) SHA1(49a39b84620876ee2faf73aaa405a1e17cab2da2) ) |
| 203 | 269 | |
| 204 | 270 | ROM_REGION( 0x60000, "gfx1", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 5094 | 5094 | ROM_LOAD( "prom1.6b", 0x200, 0x200, CRC(e38eb360) SHA1(739960dd57ec3305edd57aa63816a81ddfbebf3e) ) |
| 5095 | 5095 | ROM_END |
| 5096 | 5096 | |
| 5097 | ROM_START( mayaa ) | |
| 5098 | ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code | |
| 5099 | ROM_LOAD( "512-1.bin", 0x00000, 0x10000, CRC(8ac94f49) SHA1(3c1e86c1aad67fb8cb1eb534a272222b58f1ff0f) ) | |
| 5100 | ROM_LOAD( "512-2.bin", 0x28000, 0x10000, CRC(7ea5b49a) SHA1(aaae848669d9f88c0660f46cc801e4eb0f5e3b89) ) | |
| 5101 | ||
| 5102 | ROM_REGION( 0xc0000, "gfx1", 0 ) | |
| 5103 | ROM_LOAD( "27c020-1.bin", 0x00000, 0x40000, CRC(8d41d7ca) SHA1(7e28845457d00481b313ee52b8c7674f75b8c3c0) ) | |
| 5104 | ROM_LOAD( "27c020-2.bin", 0x40000, 0x40000, CRC(ab85ce5e) SHA1(845b846e0fb8c9fcd1540960cda006fdac364fea) ) | |
| 5105 | ROM_LOAD( "27c020-3.bin", 0x80000, 0x40000, CRC(c4316dec) SHA1(2e727a491a71eb1f4d9f338cc6ec76e03f7b46fd) ) | |
| 5106 | ||
| 5107 | ROM_REGION( 0x400, "proms", 0 ) // Color PROMs | |
| 5108 | ROM_LOAD( "promat01.bin", 0x000, 0x200, CRC(d276bf61) SHA1(987058b37182a54a360a80a2f073b000606a11c9) ) // FIXED BITS (0xxxxxxx) | |
| 5109 | ROM_LOAD( "promat02.bin", 0x200, 0x200, CRC(e38eb360) SHA1(739960dd57ec3305edd57aa63816a81ddfbebf3e) ) | |
| 5110 | ROM_END | |
| 5111 | ||
| 5097 | 5112 | ROM_START( inca ) |
| 5098 | 5113 | ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code |
| 5099 | 5114 | ROM_LOAD( "am27c512.1", 0x00000, 0x10000, CRC(b0d513f7) SHA1(65ef4702302bbfc7c7a77f7353120ee3f5c94b31) ) |
| r7500 | r7501 | |
| 5109 | 5124 | ROM_LOAD( "n82s147n.1", 0x200, 0x200, CRC(618dbeb3) SHA1(10c8a558430fd1c2cabf9133d3e4f0a5f80eab83) ) |
| 5110 | 5125 | ROM_END |
| 5111 | 5126 | |
| 5127 | ||
| 5128 | ||
| 5112 | 5129 | /* |
| 5113 | 5130 | |
| 5114 | 5131 | Black Touch |
| r7500 | r7501 | |
| 6960 | 6977 | GAME( 1989, hnoridur, hjingi, hnoridur, hnoridur, 0, ROT180, "Dynax", "Hana Oriduru (Japan)", 0 ) |
| 6961 | 6978 | GAME( 1989, drgpunch, 0, sprtmtch, sprtmtch, 0, ROT0, "Dynax", "Dragon Punch (Japan)", 0 ) |
| 6962 | 6979 | GAME( 1989, sprtmtch, drgpunch, sprtmtch, sprtmtch, 0, ROT0, "Dynax (Fabtek license)", "Sports Match", 0 ) |
| 6963 | /* these 3 are Korean hacks / bootlegs of Dragon Punch / Sports Match */ | |
| 6964 | GAME( 1994, maya, 0, sprtmtch, sprtmtch, maya, ROT0, "Promat", "Maya", 0 ) | |
| 6980 | /* these 4 are Korean hacks / bootlegs of Dragon Punch / Sports Match */ | |
| 6981 | GAME( 1994, maya, 0, sprtmtch, sprtmtch, maya, ROT0, "Promat", "Maya (set 1)", 0 ) // this set has backgrounds blacked out in attract | |
| 6982 | GAME( 1994, mayaa, maya, sprtmtch, sprtmtch, maya, ROT0, "Promat", "Maya (set 2)", 0 ) | |
| 6965 | 6983 | GAME( 199?, inca, 0, sprtmtch, sprtmtch, maya, ROT0, "<unknown>", "Inca", 0 ) |
| 6966 | 6984 | GAME( 199?, blktouch, 0, sprtmtch, sprtmtch, blktouch, ROT0, "Yang Gi Co Ltd.", "Black Touch (Korea)", 0 ) |
| 6985 | ||
| 6967 | 6986 | GAME( 1989, mjfriday, 0, mjfriday, mjfriday, 0, ROT180, "Dynax", "Mahjong Friday (Japan)", 0 ) |
| 6968 | 6987 | GAME( 1989, gekisha, 0, gekisha, gekisha, 0, ROT180, "Dynax", "Mahjong Gekisha", 0 ) |
| 6969 | 6988 | GAME( 1990, mcnpshnt, 0, mcnpshnt, mcnpshnt, 0, ROT0, "Dynax", "Mahjong Campus Hunting (Japan)", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 1606 | 1606 | // PORT_DIPSETTING( 0x00, "10 (Fastest)" ) |
| 1607 | 1607 | INPUT_PORTS_END |
| 1608 | 1608 | |
| 1609 | INPUT_PORTS_START(mk3ghw) | |
| 1610 | PORT_INCLUDE( md_common ) | |
| 1609 | 1611 | |
| 1612 | PORT_MODIFY("PAD1") | |
| 1613 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 1614 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) | |
| 1615 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 1616 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1617 | ||
| 1618 | PORT_MODIFY("PAD2") | |
| 1619 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 1620 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 1621 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 1622 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1623 | ||
| 1624 | PORT_START("EXTRA1") /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */ | |
| 1625 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) | |
| 1626 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) | |
| 1627 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) | |
| 1628 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1629 | ||
| 1630 | PORT_START("EXTRA2") /* Extra buttons for Joypad 2 (6 button + start + mode) NOT READ DIRECTLY */ | |
| 1631 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) | |
| 1632 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) | |
| 1633 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 1634 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1635 | ||
| 1636 | PORT_START("IN0") | |
| 1637 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 1638 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 1639 | ||
| 1640 | PORT_START("DSWA") | |
| 1641 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 1642 | PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) | |
| 1643 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 1644 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 1645 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 1646 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 1647 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 1648 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 1649 | PORT_BIT( 0xf8, 0x00, IPT_UNUSED ) | |
| 1650 | ||
| 1651 | PORT_START("DSWB") | |
| 1652 | PORT_DIPUNKNOWN( 0x01, 0x00 ) | |
| 1653 | PORT_DIPUNKNOWN( 0x02, 0x00 ) | |
| 1654 | PORT_DIPUNKNOWN( 0x04, 0x00 ) | |
| 1655 | PORT_DIPUNKNOWN( 0x08, 0x00 ) | |
| 1656 | PORT_DIPUNKNOWN( 0x10, 0x00 ) | |
| 1657 | PORT_DIPUNKNOWN( 0x20, 0x00 ) | |
| 1658 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) | |
| 1659 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1660 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1661 | PORT_DIPUNKNOWN( 0x80, 0x00 ) | |
| 1662 | INPUT_PORTS_END | |
| 1663 | ||
| 1664 | ||
| 1610 | 1665 | INPUT_PORTS_START( aladbl ) |
| 1611 | 1666 | PORT_INCLUDE( md_common ) |
| 1612 | 1667 | |
| r7500 | r7501 | |
| 1654 | 1709 | |
| 1655 | 1710 | if (ipt == INPUT_PORTS_NAME(ssf2ghw)) |
| 1656 | 1711 | init_megadri6_io(machine); |
| 1712 | ||
| 1713 | if (ipt == INPUT_PORTS_NAME(mk3ghw)) | |
| 1714 | init_megadri6_io(machine); | |
| 1657 | 1715 | } |
| 1658 | 1716 | |
| 1659 | 1717 | static void megadrive_reset_io(running_machine *machine) |
| r7500 | r7501 | |
| 6302 | 6360 | |
| 6303 | 6361 | m68k_set_tas_callback(devtag_get_device(machine, "maincpu"), megadriv_tas_callback); |
| 6304 | 6362 | |
| 6305 | if ((ipt == INPUT_PORTS_NAME(megadri6)) || (ipt == INPUT_PORTS_NAME(ssf2ghw))) | |
| 6363 | if ((ipt == INPUT_PORTS_NAME(megadri6)) || (ipt == INPUT_PORTS_NAME(ssf2ghw)) || (ipt == INPUT_PORTS_NAME(mk3ghw))) | |
| 6306 | 6364 | { |
| 6307 | 6365 | megadrive_io_read_data_port_ptr = megadrive_io_read_data_port_6button; |
| 6308 | 6366 | megadrive_io_write_data_port_ptr = megadrive_io_write_data_port_6button; |
| r7500 | r7501 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | Note MCU labeling: |
| 43 | 43 | |
| 44 | Bubble Bobble KiKi KaiKai Kick and R | |
| 44 | Bubble Bobble KiKi KaiKai Kick and Run | |
| 45 | 45 | ------------- ------------- ------------- |
| 46 | 46 | TAITO A78-01 TAITO A85-01 TAITO A87-01 |
| 47 | 47 | JPH1011P JPH1020P JPH1021P |
| r7500 | r7501 | |
| 57 | 57 | #include "sound/2203intf.h" |
| 58 | 58 | #include "includes/mexico86.h" |
| 59 | 59 | |
| 60 | //AT | |
| 60 | ||
| 61 | /************************************* | |
| 62 | * | |
| 63 | * Memory handlers | |
| 64 | * | |
| 65 | *************************************/ | |
| 66 | ||
| 61 | 67 | static READ8_DEVICE_HANDLER( kiki_ym2203_r ) |
| 62 | 68 | { |
| 63 | 69 | UINT8 result = ym2203_r(device, offset); |
| 70 | ||
| 64 | 71 | if (offset == 0) |
| 65 | 72 | result &= 0x7f; |
| 73 | ||
| 66 | 74 | return result; |
| 67 | 75 | } |
| 68 | //ZT | |
| 69 | 76 | |
| 77 | ||
| 78 | /************************************* | |
| 79 | * | |
| 80 | * Address maps | |
| 81 | * | |
| 82 | *************************************/ | |
| 83 | ||
| 70 | 84 | static ADDRESS_MAP_START( mexico86_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 71 | 85 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 72 | 86 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") /* banked roms */ |
| 73 | 87 | AM_RANGE(0xc000, 0xe7ff) AM_RAM AM_SHARE("share1") /* shared with sound cpu */ |
| 74 | AM_RANGE(0xd500, 0xd7ff) AM_RAM AM_BASE(&mexico86_objectram) AM_SIZE(&mexico86_objectram_size) | |
| 75 | AM_RANGE(0xe800, 0xe8ff) AM_RAM AM_BASE(&mexico86_protection_ram) /* shared with mcu */ | |
| 88 | AM_RANGE(0xd500, 0xd7ff) AM_RAM AM_BASE_SIZE_MEMBER(mexico86_state, objectram, objectram_size) | |
| 89 | AM_RANGE(0xe800, 0xe8ff) AM_RAM AM_BASE_MEMBER(mexico86_state, protection_ram) /* shared with mcu */ | |
| 76 | 90 | AM_RANGE(0xe900, 0xefff) AM_RAM |
| 77 | AM_RANGE(0xc000, 0xd4ff) AM_RAM AM_BASE( | |
| 91 | AM_RANGE(0xc000, 0xd4ff) AM_RAM AM_BASE_MEMBER( | |
| 78 | 92 | AM_RANGE(0xf000, 0xf000) AM_WRITE(mexico86_bankswitch_w) /* program and gfx ROM banks */ |
| 79 | 93 | AM_RANGE(0xf008, 0xf008) AM_WRITE(mexico86_f008_w) /* cpu reset lines + other unknown stuff */ |
| 80 | 94 | AM_RANGE(0xf010, 0xf010) AM_READ_PORT("IN3") |
| r7500 | r7501 | |
| 91 | 105 | |
| 92 | 106 | static ADDRESS_MAP_START( mexico86_m68705_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 93 | 107 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 94 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(mexico86_68705_portA_r,mexico86_68705_portA_w) | |
| 95 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(mexico86_68705_portB_r,mexico86_68705_portB_w) | |
| 108 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(mexico86_68705_port_a_r,mexico86_68705_port_a_w) | |
| 109 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(mexico86_68705_port_b_r,mexico86_68705_port_b_w) | |
| 96 | 110 | AM_RANGE(0x0002, 0x0002) AM_READ_PORT("IN0") /* COIN */ |
| 97 | AM_RANGE(0x0004, 0x0004) AM_WRITE(mexico86_68705_ddrA_w) | |
| 98 | AM_RANGE(0x0005, 0x0005) AM_WRITE(mexico86_68705_ddrB_w) | |
| 111 | AM_RANGE(0x0004, 0x0004) AM_WRITE(mexico86_68705_ddr_a_w) | |
| 112 | AM_RANGE(0x0005, 0x0005) AM_WRITE(mexico86_68705_ddr_b_w) | |
| 99 | 113 | AM_RANGE(0x000a, 0x000a) AM_WRITENOP /* looks like a bug in the code, writes to */ |
| 100 | 114 | /* 0x0a (=10dec) instead of 0x10 */ |
| 101 | 115 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| r7500 | r7501 | |
| 121 | 135 | AM_RANGE(0xc004, 0xc004) AM_WRITE(mexico86_sub_output_w) |
| 122 | 136 | ADDRESS_MAP_END |
| 123 | 137 | |
| 138 | /************************************* | |
| 139 | * | |
| 140 | * Input ports | |
| 141 | * | |
| 142 | *************************************/ | |
| 143 | ||
| 124 | 144 | static INPUT_PORTS_START( mexico86 ) |
| 125 | PORT_START("IN0") | |
| 145 | PORT_START("IN0") | |
| 126 | 146 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 127 | 147 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 128 | 148 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r7500 | r7501 | |
| 132 | 152 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 133 | 153 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 134 | 154 | |
| 135 | PORT_START("IN1") | |
| 155 | PORT_START("IN1") | |
| 136 | 156 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 137 | 157 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 138 | 158 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 142 | 162 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 143 | 163 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) /* service 2 */ |
| 144 | 164 | |
| 145 | PORT_START("IN2") | |
| 165 | PORT_START("IN2") | |
| 146 | 166 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 147 | 167 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 148 | 168 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| r7500 | r7501 | |
| 247 | 267 | INPUT_PORTS_END |
| 248 | 268 | |
| 249 | 269 | static INPUT_PORTS_START( kikikai ) |
| 250 | PORT_START("IN0") | |
| 270 | PORT_START("IN0") | |
| 251 | 271 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 252 | 272 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 253 | 273 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r7500 | r7501 | |
| 257 | 277 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 258 | 278 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 259 | 279 | |
| 260 | PORT_START("IN1") | |
| 280 | PORT_START("IN1") | |
| 261 | 281 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 262 | 282 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 263 | 283 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| r7500 | r7501 | |
| 267 | 287 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 268 | 288 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 269 | 289 | |
| 270 | PORT_START("IN2") | |
| 290 | PORT_START("IN2") | |
| 271 | 291 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 272 | 292 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 273 | 293 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| r7500 | r7501 | |
| 277 | 297 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 278 | 298 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 279 | 299 | |
| 280 | //AT | |
| 281 | PORT_START("DSW0") /* DSW0 */ | |
| 300 | PORT_START("DSW0") | |
| 282 | 301 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1") |
| 283 | 302 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 284 | 303 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| r7500 | r7501 | |
| 315 | 334 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) |
| 316 | 335 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) |
| 317 | 336 | |
| 318 | PORT_START("DSW1") | |
| 337 | PORT_START("DSW1") | |
| 319 | 338 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") |
| 320 | 339 | PORT_DIPSETTING( 0x02, DEF_STR( Easy ) ) |
| 321 | 340 | PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) |
| r7500 | r7501 | |
| 337 | 356 | PORT_DIPNAME( 0x80, 0x00, "Number Match" ) PORT_DIPLOCATION("SW2:8") |
| 338 | 357 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 339 | 358 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 340 | //ZT | |
| 341 | 359 | |
| 342 | 360 | PORT_START("IN3") |
| 343 | 361 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) |
| r7500 | r7501 | |
| 352 | 370 | |
| 353 | 371 | |
| 354 | 372 | |
| 373 | /************************************* | |
| 374 | * | |
| 375 | * Graphics definitions | |
| 376 | * | |
| 377 | *************************************/ | |
| 378 | ||
| 355 | 379 | static const gfx_layout charlayout = |
| 356 | 380 | { |
| 357 | 381 | 8,8, |
| r7500 | r7501 | |
| 369 | 393 | |
| 370 | 394 | |
| 371 | 395 | |
| 396 | /************************************* | |
| 397 | * | |
| 398 | * Sound interfaces | |
| 399 | * | |
| 400 | *************************************/ | |
| 401 | ||
| 372 | 402 | static const ym2203_interface ym2203_config = |
| 373 | 403 | { |
| 374 | 404 | { |
| r7500 | r7501 | |
| 383 | 413 | }; |
| 384 | 414 | |
| 385 | 415 | |
| 416 | /************************************* | |
| 417 | * | |
| 418 | * Machine driver | |
| 419 | * | |
| 420 | *************************************/ | |
| 421 | ||
| 422 | static MACHINE_START( mexico86 ) | |
| 423 | { | |
| 424 | mexico86_state *state = (mexico86_state *)machine->driver_data; | |
| 425 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 426 | ||
| 427 | memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000); | |
| 428 | ||
| 429 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 430 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 431 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 432 | state->mcu = devtag_get_device(machine, "mcu"); | |
| 433 | ||
| 434 | state_save_register_global(machine, state->port_a_in); | |
| 435 | state_save_register_global(machine, state->port_a_out); | |
| 436 | state_save_register_global(machine, state->ddr_a); | |
| 437 | state_save_register_global(machine, state->port_b_in); | |
| 438 | state_save_register_global(machine, state->port_b_out); | |
| 439 | state_save_register_global(machine, state->ddr_b); | |
| 440 | state_save_register_global(machine, state->address); | |
| 441 | state_save_register_global(machine, state->latch); | |
| 442 | ||
| 443 | state_save_register_global(machine, state->mcu_running); | |
| 444 | state_save_register_global(machine, state->mcu_initialised); | |
| 445 | state_save_register_global(machine, state->coin_last); | |
| 446 | ||
| 447 | state_save_register_global(machine, state->charbank); | |
| 448 | } | |
| 449 | ||
| 386 | 450 | static MACHINE_RESET( mexico86 ) |
| 387 | 451 | { |
| 452 | mexico86_state *state = (mexico86_state *)machine->driver_data; | |
| 453 | ||
| 388 | 454 | /*TODO: check the PCB and see how the halt / reset lines are connected. */ |
| 389 | 455 | if (devtag_get_device(machine, "sub") != NULL) |
| 390 | 456 | cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| 457 | ||
| 458 | state->port_a_in = 0; | |
| 459 | state->port_a_out = 0; | |
| 460 | state->ddr_a = 0; | |
| 461 | state->port_b_in = 0; | |
| 462 | state->port_b_out = 0; | |
| 463 | state->ddr_b = 0; | |
| 464 | state->address = 0; | |
| 465 | state->latch = 0; | |
| 466 | ||
| 467 | state->mcu_running = 0; | |
| 468 | state->mcu_initialised = 0; | |
| 469 | state->coin_last = 0; | |
| 470 | ||
| 471 | state->charbank = 0; | |
| 391 | 472 | } |
| 392 | 473 | |
| 393 | 474 | static MACHINE_DRIVER_START( mexico86 ) |
| 394 | 475 | |
| 476 | /* driver data */ | |
| 477 | MDRV_DRIVER_DATA(mexico86_state) | |
| 478 | ||
| 395 | 479 | /* basic machine hardware */ |
| 396 | 480 | MDRV_CPU_ADD("maincpu",Z80, 24000000/4) /* 6 MHz, Uses clock divided 24MHz OSC */ |
| 397 | 481 | MDRV_CPU_PROGRAM_MAP(mexico86_map) |
| r7500 | r7501 | |
| 408 | 492 | MDRV_CPU_PROGRAM_MAP(mexico86_sub_cpu_map) |
| 409 | 493 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 410 | 494 | |
| 411 | MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame - an high value to ensure proper */ | |
| 412 | /* synchronization of the CPUs */ | |
| 495 | MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame - an high value to ensure proper synchronization of the CPUs */ | |
| 413 | 496 | |
| 497 | MDRV_MACHINE_START(mexico86) | |
| 414 | 498 | MDRV_MACHINE_RESET(mexico86) |
| 415 | 499 | |
| 416 | 500 | /* video hardware */ |
| r7500 | r7501 | |
| 466 | 550 | MACHINE_DRIVER_END |
| 467 | 551 | |
| 468 | 552 | |
| 469 | /*************************************************************************** | |
| 553 | /************************************* | |
| 554 | * | |
| 555 | * ROM definition(s) | |
| 556 | * | |
| 557 | *************************************/ | |
| 470 | 558 | |
| 471 | Game driver(s) | |
| 472 | ||
| 473 | ***************************************************************************/ | |
| 474 | ||
| 475 | 559 | ROM_START( kikikai ) |
| 476 | 560 | ROM_REGION( 0x28000, "maincpu", 0 ) |
| 477 | 561 | ROM_LOAD( "a85-17.h16", 0x00000, 0x08000, CRC(c141d5ab) SHA1(fe3622ba283e514416c43a44f83f922a958b27cd) ) /* 1st half, main code */ |
| r7500 | r7501 | |
| 622 | 706 | ROM_END |
| 623 | 707 | |
| 624 | 708 | |
| 625 | GAME( 1986, kikikai, 0, kikikai, kikikai, 0, ROT90, "Taito Corporation", "KiKi KaiKai", 0 ) | |
| 626 | GAME( 1986, knightb, kikikai, knightb, kikikai, 0, ROT90, "bootleg", "Knight Boy", 0 ) | |
| 627 | GAME( 1986, kicknrun, 0, mexico86, mexico86, 0, ROT0, "Taito Corporation", "Kick and Run (World)", 0 ) | |
| 628 | GAME( 1986, kicknrunu,kicknrun, mexico86, mexico86, 0, ROT0, "Taito America Corp", "Kick and Run (US)", 0 ) | |
| 629 | GAME( 1986, mexico86, kicknrun, mexico86, mexico86, 0, ROT0, "bootleg", "Mexico 86", 0 ) | |
| 709 | /************************************* | |
| 710 | * | |
| 711 | * Game driver(s) | |
| 712 | * | |
| 713 | *************************************/ | |
| 714 | ||
| 715 | GAME( 1986, kikikai, 0, kikikai, kikikai, 0, ROT90, "Taito Corporation", "KiKi KaiKai", GAME_SUPPORTS_SAVE ) | |
| 716 | GAME( 1986, knightb, kikikai, knightb, kikikai, 0, ROT90, "bootleg", "Knight Boy", GAME_SUPPORTS_SAVE ) | |
| 717 | GAME( 1986, kicknrun, 0, mexico86, mexico86, 0, ROT0, "Taito Corporation", "Kick and Run (World)", GAME_SUPPORTS_SAVE ) | |
| 718 | GAME( 1986, kicknrunu,kicknrun, mexico86, mexico86, 0, ROT0, "Taito America Corp", "Kick and Run (US)", GAME_SUPPORTS_SAVE ) | |
| 719 | GAME( 1986, mexico86, kicknrun, mexico86, mexico86, 0, ROT0, "bootleg", "Mexico 86", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #include "cpu/z80/z80.h" |
| 15 | 15 | |
| 16 | 16 | |
| 17 | class minivadr_state | |
| 18 | { | |
| 19 | public: | |
| 20 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, minivadr_state(machine)); } | |
| 17 | 21 | |
| 22 | minivadr_state(running_machine &machine) { } | |
| 23 | ||
| 24 | /* memory pointers */ | |
| 25 | UINT8 * videoram; | |
| 26 | size_t videoram_size; | |
| 27 | }; | |
| 28 | ||
| 18 | 29 | /************************************* |
| 19 | 30 | * |
| 20 | 31 | * Video update |
| r7500 | r7501 | |
| 23 | 34 | |
| 24 | 35 | static VIDEO_UPDATE( minivadr ) |
| 25 | 36 | { |
| 37 | minivadr_state *state = (minivadr_state *)screen->machine->driver_data; | |
| 26 | 38 | offs_t offs; |
| 27 | 39 | |
| 28 | for (offs = 0; offs < s | |
| 40 | for (offs = 0; offs < st | |
| 29 | 41 | { |
| 30 | 42 | int i; |
| 31 | 43 | |
| 32 | 44 | UINT8 x = offs << 3; |
| 33 | 45 | int y = offs >> 5; |
| 34 | UINT8 data = s | |
| 46 | UINT8 data = st | |
| 35 | 47 | |
| 36 | 48 | for (i = 0; i < 8; i++) |
| 37 | 49 | { |
| r7500 | r7501 | |
| 49 | 61 | |
| 50 | 62 | static ADDRESS_MAP_START( minivadr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 51 | 63 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 52 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_ | |
| 64 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 53 | 65 | AM_RANGE(0xe008, 0xe008) AM_READ_PORT("INPUTS") AM_WRITENOP // W - ??? |
| 54 | 66 | ADDRESS_MAP_END |
| 55 | 67 | |
| r7500 | r7501 | |
| 69 | 81 | |
| 70 | 82 | static MACHINE_DRIVER_START( minivadr ) |
| 71 | 83 | |
| 84 | /* driver data */ | |
| 85 | MDRV_DRIVER_DATA(minivadr_state) | |
| 86 | ||
| 72 | 87 | /* basic machine hardware */ |
| 73 | 88 | MDRV_CPU_ADD("maincpu", Z80,24000000 / 6) /* 4 MHz ? */ |
| 74 | 89 | MDRV_CPU_PROGRAM_MAP(minivadr_map) |
| r7500 | r7501 | |
| 100 | 115 | ROM_END |
| 101 | 116 | |
| 102 | 117 | |
| 103 | GAME( 1990, minivadr, 0, minivadr, minivadr, 0, ROT0, "Taito Corporation", "Minivader", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW) | |
| 118 | GAME( 1990, minivadr, 0, minivadr, minivadr, 0, ROT0, "Taito Corporation", "Minivader", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | #include "cpu/z80/z80.h" |
| 17 | 17 | #include "deprecat.h" |
| 18 | 18 | #include "sound/ay8910.h" |
| 19 | #include "includes/mouser.h" | |
| 19 | 20 | |
| 20 | static UINT8 mouser_sound_byte; | |
| 21 | static UINT8 mouser_nmi_enable; | |
| 22 | ||
| 23 | /* From "video/mouser.c" */ | |
| 24 | extern UINT8 *mouser_videoram; | |
| 25 | extern UINT8 *mouser_colorram; | |
| 26 | ||
| 27 | PALETTE_INIT( mouser ); | |
| 28 | WRITE8_HANDLER( mouser_flip_screen_x_w ); | |
| 29 | WRITE8_HANDLER( mouser_flip_screen_y_w ); | |
| 30 | VIDEO_UPDATE( mouser ); | |
| 31 | ||
| 32 | 21 | /* Mouser has external masking circuitry around |
| 33 | 22 | * the NMI input on the main CPU */ |
| 34 | ||
| 35 | 23 | static WRITE8_HANDLER( mouser_nmi_enable_w ) |
| 36 | 24 | { |
| 37 | mouser_nmi_enable = data; | |
| 25 | mouser_state *state = (mouser_state *)space->machine->driver_data; | |
| 26 | state->nmi_enable = data; | |
| 38 | 27 | } |
| 39 | 28 | |
| 40 | 29 | static INTERRUPT_GEN( mouser_nmi_interrupt ) |
| 41 | 30 | { |
| 42 | if ((mouser_nmi_enable & 1) == 1) | |
| 31 | mouser_state *state = (mouser_state *)device->machine->driver_data; | |
| 32 | ||
| 33 | if (BIT(state->nmi_enable, 0)) | |
| 43 | 34 | nmi_line_pulse(device); |
| 44 | 35 | } |
| 45 | 36 | |
| r7500 | r7501 | |
| 47 | 38 | |
| 48 | 39 | static WRITE8_HANDLER( mouser_sound_interrupt_w ) |
| 49 | 40 | { |
| 50 | mouser_sound_byte = data; | |
| 51 | cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); | |
| 41 | mouser_state *state = (mouser_state *)space->machine->driver_data; | |
| 42 | state->sound_byte = data; | |
| 43 | cpu_set_input_line(state->audiocpu, 0, HOLD_LINE); | |
| 52 | 44 | } |
| 53 | 45 | |
| 54 | 46 | static READ8_HANDLER( mouser_sound_byte_r ) |
| 55 | 47 | { |
| 56 | return mouser_sound_byte; | |
| 48 | mouser_state *state = (mouser_state *)space->machine->driver_data; | |
| 49 | return state->sound_byte; | |
| 57 | 50 | } |
| 58 | 51 | |
| 59 | 52 | static ADDRESS_MAP_START( mouser_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 60 | 53 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 61 | 54 | AM_RANGE(0x6000, 0x6bff) AM_RAM |
| 62 | 55 | AM_RANGE(0x8800, 0x88ff) AM_WRITENOP /* unknown */ |
| 63 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(&mouser_videoram) | |
| 64 | AM_RANGE(0x9800, 0x9cff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 65 | AM_RANGE(0x9c00, 0x9fff) AM_RAM AM_BASE(&mouser_colorram) | |
| 56 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE_MEMBER(mouser_state, videoram) | |
| 57 | AM_RANGE(0x9800, 0x9cff) AM_RAM AM_BASE_SIZE_MEMBER(mouser_state, spriteram, spriteram_size) | |
| 58 | AM_RANGE(0x9c00, 0x9fff) AM_RAM AM_BASE_MEMBER(mouser_state, colorram) | |
| 66 | 59 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1") AM_WRITE(mouser_nmi_enable_w) /* bit 0 = NMI Enable */ |
| 67 | 60 | AM_RANGE(0xa001, 0xa001) AM_WRITE(mouser_flip_screen_x_w) |
| 68 | 61 | AM_RANGE(0xa002, 0xa002) AM_WRITE(mouser_flip_screen_y_w) |
| r7500 | r7501 | |
| 178 | 171 | GFXDECODE_END |
| 179 | 172 | |
| 180 | 173 | |
| 174 | static MACHINE_START( mouser ) | |
| 175 | { | |
| 176 | mouser_state *state = (mouser_state *)machine->driver_data; | |
| 177 | ||
| 178 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 179 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 180 | ||
| 181 | state_save_register_global(machine, state->sound_byte); | |
| 182 | state_save_register_global(machine, state->nmi_enable); | |
| 183 | } | |
| 184 | ||
| 185 | static MACHINE_RESET( mouser ) | |
| 186 | { | |
| 187 | mouser_state *state = (mouser_state *)machine->driver_data; | |
| 188 | ||
| 189 | state->sound_byte = 0; | |
| 190 | state->nmi_enable = 0; | |
| 191 | } | |
| 192 | ||
| 181 | 193 | static MACHINE_DRIVER_START( mouser ) |
| 182 | 194 | |
| 195 | /* driver data */ | |
| 196 | MDRV_DRIVER_DATA(mouser_state) | |
| 197 | ||
| 183 | 198 | /* basic machine hardware */ |
| 184 | 199 | MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ? */ |
| 185 | 200 | MDRV_CPU_PROGRAM_MAP(mouser_map) |
| r7500 | r7501 | |
| 190 | 205 | MDRV_CPU_IO_MAP(mouser_sound_io_map) |
| 191 | 206 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) /* ??? This controls the sound tempo */ |
| 192 | 207 | |
| 208 | MDRV_MACHINE_START(mouser) | |
| 209 | MDRV_MACHINE_RESET(mouser) | |
| 210 | ||
| 193 | 211 | /* video hardware */ |
| 194 | 212 | MDRV_SCREEN_ADD("screen", RASTER) |
| 195 | 213 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 275 | 293 | |
| 276 | 294 | memory_set_decrypted_region(space, 0x0000, 0x5fff, decrypted); |
| 277 | 295 | |
| 278 | for (i = 0;i < 0x6000;i++) | |
| 296 | for (i = 0; i < 0x6000; i++) | |
| 279 | 297 | { |
| 280 | 298 | decrypted[i] = table[rom[i]]; |
| 281 | 299 | } |
| 282 | 300 | } |
| 283 | 301 | |
| 284 | 302 | |
| 285 | GAME( 1983, mouser, 0, mouser, mouser, mouser, ROT90, "UPL", "Mouser", 0 ) | |
| 286 | GAME( 1983, mouserc, mouser, mouser, mouser, mouser, ROT90, "[UPL] (Cosmos license)", "Mouser (Cosmos)", 0 ) | |
| 303 | GAME( 1983, mouser, 0, mouser, mouser, mouser, ROT90, "UPL", "Mouser", GAME_SUPPORTS_SAVE ) | |
| 304 | GAME( 1983, mouserc, mouser, mouser, mouser, mouser, ROT90, "[UPL] (Cosmos license)", "Mouser (Cosmos)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 85 | 85 | #include "includes/lkage.h" |
| 86 | 86 | |
| 87 | 87 | |
| 88 | static int sound_nmi_enable,pending_nmi; | |
| 89 | ||
| 90 | 88 | static TIMER_CALLBACK( nmi_callback ) |
| 91 | 89 | { |
| 92 | if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 93 | else pending_nmi = 1; | |
| 90 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 91 | if (state->sound_nmi_enable) | |
| 92 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 93 | else | |
| 94 | state->pending_nmi = 1; | |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | 97 | static WRITE8_HANDLER( lkage_sound_command_w ) |
| 97 | 98 | { |
| 98 | soundlatch_w(space,offset,data); | |
| 99 | timer_call_after_resynch(space->machine, NULL, data,nmi_callback); | |
| 99 | soundlatch_w(space, offset, data); | |
| 100 | timer_call_after_resynch(space->machine, NULL, data, nmi_callback); | |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | 103 | static WRITE8_HANDLER( lkage_sh_nmi_disable_w ) |
| 103 | 104 | { |
| 104 | sound_nmi_enable = 0; | |
| 105 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 106 | state->sound_nmi_enable = 0; | |
| 105 | 107 | } |
| 106 | 108 | |
| 107 | 109 | static WRITE8_HANDLER( lkage_sh_nmi_enable_w ) |
| 108 | 110 | { |
| 109 | sound_nmi_enable = 1; | |
| 110 | if (pending_nmi) | |
| 111 | { /* probably wrong but commands may go lost otherwise */ | |
| 112 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 113 | pending_nmi = 0; | |
| 111 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 112 | ||
| 113 | state->sound_nmi_enable = 1; | |
| 114 | if (state->pending_nmi) | |
| 115 | { | |
| 116 | /* probably wrong but commands may go lost otherwise */ | |
| 117 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 118 | state->pending_nmi = 0; | |
| 114 | 119 | } |
| 115 | 120 | } |
| 116 | 121 | |
| r7500 | r7501 | |
| 118 | 123 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 119 | 124 | AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram */ |
| 120 | 125 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_BASE_GENERIC(paletteram) |
| 121 | AM_RANGE(0xf000, 0xf003) AM_RAM AM_BASE( | |
| 126 | AM_RANGE(0xf000, 0xf003) AM_RAM AM_BASE_MEMBER( | |
| 122 | 127 | AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w) |
| 123 | 128 | AM_RANGE(0xf061, 0xf061) AM_WRITENOP |
| 124 | 129 | AM_RANGE(0xf062, 0xf062) AM_READWRITE(lkage_mcu_r,lkage_mcu_w) |
| r7500 | r7501 | |
| 131 | 136 | AM_RANGE(0xf086, 0xf086) AM_READ_PORT("P2") |
| 132 | 137 | AM_RANGE(0xf087, 0xf087) AM_READ(lkage_mcu_status_r) |
| 133 | 138 | AM_RANGE(0xf0a0, 0xf0a3) AM_RAM /* unknown */ |
| 134 | AM_RANGE(0xf0c0, 0xf0c5) AM_RAM AM_BASE( | |
| 139 | AM_RANGE(0xf0c0, 0xf0c5) AM_RAM AM_BASE_MEMBER( | |
| 135 | 140 | AM_RANGE(0xf0e1, 0xf0e1) AM_WRITENOP /* pulsed */ |
| 136 | AM_RANGE(0xf100, 0xf15f) AM_RAM AM_BASE_GENERIC(spriteram) | |
| 137 | AM_RANGE(0xf400, 0xffff) AM_RAM_WRITE(lkage_videoram_w) AM_BASE_GENERIC(videoram) /* videoram */ | |
| 141 | AM_RANGE(0xf100, 0xf15f) AM_RAM AM_BASE_MEMBER(lkage_state, spriteram) | |
| 142 | AM_RANGE(0xf400, 0xffff) AM_RAM_WRITE(lkage_videoram_w) AM_BASE_MEMBER(lkage_state, videoram) | |
| 138 | 143 | ADDRESS_MAP_END |
| 139 | 144 | |
| 140 | 145 | static READ8_HANDLER( port_fetch_r ) |
| r7500 | r7501 | |
| 148 | 153 | |
| 149 | 154 | static ADDRESS_MAP_START( lkage_m68705_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 150 | 155 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 151 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(lkage_68705_portA_r,lkage_68705_portA_w) | |
| 152 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(lkage_68705_portB_r,lkage_68705_portB_w) | |
| 153 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(lkage_68705_portC_r,lkage_68705_portC_w) | |
| 154 | AM_RANGE(0x0004, 0x0004) AM_WRITE(lkage_68705_ddrA_w) | |
| 155 | AM_RANGE(0x0005, 0x0005) AM_WRITE(lkage_68705_ddrB_w) | |
| 156 | AM_RANGE(0x0006, 0x0006) AM_WRITE(lkage_68705_ddrC_w) | |
| 156 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(lkage_68705_port_a_r,lkage_68705_port_a_w) | |
| 157 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(lkage_68705_port_b_r,lkage_68705_port_b_w) | |
| 158 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(lkage_68705_port_c_r,lkage_68705_port_c_w) | |
| 159 | AM_RANGE(0x0004, 0x0004) AM_WRITE(lkage_68705_ddr_a_w) | |
| 160 | AM_RANGE(0x0005, 0x0005) AM_WRITE(lkage_68705_ddr_b_w) | |
| 161 | AM_RANGE(0x0006, 0x0006) AM_WRITE(lkage_68705_ddr_c_w) | |
| 157 | 162 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| 158 | 163 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 159 | 164 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 337 | 342 | |
| 338 | 343 | static void irqhandler(running_device *device, int irq) |
| 339 | 344 | { |
| 340 | cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 345 | lkage_state *state = (lkage_state *)device->machine->driver_data; | |
| 346 | cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | 347 | } |
| 342 | 348 | |
| 343 | 349 | static const ym2203_interface ym2203_config = |
| r7500 | r7501 | |
| 350 | 356 | irqhandler |
| 351 | 357 | }; |
| 352 | 358 | |
| 359 | static MACHINE_START( lkage ) | |
| 360 | { | |
| 361 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 362 | ||
| 363 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 364 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 365 | state->mcu = devtag_get_device(machine, "mcu"); | |
| 366 | ||
| 367 | state_save_register_global(machine, state->bg_tile_bank); | |
| 368 | state_save_register_global(machine, state->fg_tile_bank); | |
| 369 | ||
| 370 | state_save_register_global(machine, state->mcu_ready); | |
| 371 | state_save_register_global(machine, state->mcu_val); | |
| 372 | state_save_register_global(machine, state->sound_nmi_enable); | |
| 373 | state_save_register_global(machine, state->pending_nmi); | |
| 374 | ||
| 375 | state_save_register_global(machine, state->port_a_in); | |
| 376 | state_save_register_global(machine, state->port_a_out); | |
| 377 | state_save_register_global(machine, state->ddr_a); | |
| 378 | state_save_register_global(machine, state->port_b_in); | |
| 379 | state_save_register_global(machine, state->port_b_out); | |
| 380 | state_save_register_global(machine, state->ddr_b); | |
| 381 | state_save_register_global(machine, state->port_c_in); | |
| 382 | state_save_register_global(machine, state->port_c_out); | |
| 383 | state_save_register_global(machine, state->ddr_c); | |
| 384 | state_save_register_global(machine, state->mcu_sent); | |
| 385 | state_save_register_global(machine, state->main_sent); | |
| 386 | state_save_register_global(machine, state->from_main); | |
| 387 | state_save_register_global(machine, state->from_mcu); | |
| 388 | } | |
| 389 | ||
| 390 | static MACHINE_RESET( lkage ) | |
| 391 | { | |
| 392 | lkage_state *state = (lkage_state *)machine->driver_data; | |
| 393 | ||
| 394 | state->bg_tile_bank = state->fg_tile_bank = 0; | |
| 395 | ||
| 396 | state->mcu_ready = 3; | |
| 397 | state->mcu_val = 0; | |
| 398 | state->sound_nmi_enable = 0; | |
| 399 | state->pending_nmi = 0; | |
| 400 | ||
| 401 | state->port_a_in = 0; | |
| 402 | state->port_a_out = 0; | |
| 403 | state->ddr_a = 0; | |
| 404 | state->port_b_in = 0; | |
| 405 | state->port_b_out = 0; | |
| 406 | state->ddr_b = 0; | |
| 407 | state->port_c_in = 0; | |
| 408 | state->port_c_out = 0; | |
| 409 | state->ddr_c = 0; | |
| 410 | state->mcu_sent = 0; | |
| 411 | state->main_sent = 0; | |
| 412 | state->from_main = 0; | |
| 413 | state->from_mcu = 0; | |
| 414 | } | |
| 415 | ||
| 416 | ||
| 353 | 417 | static MACHINE_DRIVER_START( lkage ) |
| 418 | ||
| 419 | /* driver data */ | |
| 420 | MDRV_DRIVER_DATA(lkage_state) | |
| 421 | ||
| 354 | 422 | /* basic machine hardware */ |
| 355 | 423 | MDRV_CPU_ADD("maincpu", Z80,6000000) |
| 356 | 424 | MDRV_CPU_PROGRAM_MAP(lkage_map) |
| r7500 | r7501 | |
| 364 | 432 | MDRV_CPU_ADD("mcu", M68705,4000000) /* ??? */ |
| 365 | 433 | MDRV_CPU_PROGRAM_MAP(lkage_m68705_map) |
| 366 | 434 | |
| 435 | MDRV_MACHINE_START(lkage) | |
| 436 | MDRV_MACHINE_RESET(lkage) | |
| 437 | ||
| 367 | 438 | /* video hardware */ |
| 368 | 439 | MDRV_SCREEN_ADD("screen", RASTER) |
| 369 | 440 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 397 | 468 | |
| 398 | 469 | |
| 399 | 470 | static MACHINE_DRIVER_START( lkageb ) |
| 471 | ||
| 472 | /* driver data */ | |
| 473 | MDRV_DRIVER_DATA(lkage_state) | |
| 474 | ||
| 400 | 475 | /* basic machine hardware */ |
| 401 | 476 | MDRV_CPU_ADD("maincpu", Z80,6000000) |
| 402 | 477 | MDRV_CPU_PROGRAM_MAP(lkage_map) |
| r7500 | r7501 | |
| 407 | 482 | MDRV_CPU_PROGRAM_MAP(lkage_sound_map) |
| 408 | 483 | /* IRQs are triggered by the YM2203 */ |
| 409 | 484 | |
| 485 | MDRV_MACHINE_START(lkage) | |
| 486 | MDRV_MACHINE_RESET(lkage) | |
| 487 | ||
| 410 | 488 | /* video hardware */ |
| 411 | 489 | MDRV_SCREEN_ADD("screen", RASTER) |
| 412 | 490 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 592 | 670 | ROM_LOAD( "a54-10.2", 0x0000, 0x0200, CRC(17dfbd14) SHA1(f8f0b6dfedd4ba108dad43ccc7697ef4ab9cbf86) ) /* unknown */ |
| 593 | 671 | ROM_END |
| 594 | 672 | |
| 595 | static UINT8 mcu_val; | |
| 596 | ||
| 597 | 673 | /*Note: This probably uses another MCU dump,which is undumped.*/ |
| 598 | 674 | |
| 599 | 675 | static READ8_HANDLER( fake_mcu_r ) |
| 600 | 676 | { |
| 677 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 601 | 678 | int result = 0; |
| 602 | 679 | |
| 603 | switch(mcu_val) | |
| 680 | switch (state->mcu_val) | |
| 604 | 681 | { |
| 605 | 682 | /*These are for the attract mode*/ |
| 606 | 683 | case 0x01: |
| 607 | result = mcu_val-1; | |
| 684 | result = state->mcu_val - 1; | |
| 608 | 685 | break; |
| 609 | 686 | |
| 610 | 687 | case 0x90: |
| 611 | result = mcu_val+0x43; | |
| 688 | result = state->mcu_val + 0x43; | |
| 612 | 689 | break; |
| 613 | 690 | |
| 614 | 691 | /*Gameplay Protection,checked in this order at a start of a play*/ |
| 615 | 692 | case 0xa6: |
| 616 | result = mcu_val+0x27; | |
| 693 | result = state->mcu_val + 0x27; | |
| 617 | 694 | break; |
| 618 | 695 | |
| 619 | 696 | case 0x34: |
| 620 | result = mcu_val+0x7f; | |
| 697 | result = state->mcu_val + 0x7f; | |
| 621 | 698 | break; |
| 622 | 699 | |
| 623 | 700 | case 0x48: |
| 624 | result = mcu_val+0xb7; | |
| 701 | result = state->mcu_val + 0xb7; | |
| 625 | 702 | break; |
| 626 | 703 | |
| 627 | 704 | default: |
| 628 | result = mcu_val; | |
| 705 | result = state->mcu_val; | |
| 629 | 706 | break; |
| 630 | 707 | } |
| 631 | 708 | return result; |
| r7500 | r7501 | |
| 633 | 710 | |
| 634 | 711 | static WRITE8_HANDLER( fake_mcu_w ) |
| 635 | 712 | { |
| 636 | mcu_val = data; | |
| 713 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 714 | state->mcu_val = data; | |
| 637 | 715 | } |
| 638 | 716 | |
| 639 | 717 | static READ8_HANDLER( fake_status_r ) |
| 640 | 718 | { |
| 641 | static int res = 3; /* cpu data/mcu ready status */ | |
| 642 | return res; | |
| 719 | lkage_state *state = (lkage_state *)space->machine->driver_data; | |
| 720 | return state->mcu_ready; | |
| 643 | 721 | } |
| 644 | 722 | |
| 645 | 723 | static DRIVER_INIT( lkageb ) |
| r7500 | r7501 | |
| 649 | 727 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf062, 0xf062, 0, 0, fake_mcu_w ); |
| 650 | 728 | } |
| 651 | 729 | |
| 652 | GAME( 1984, lkage, 0, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage", GAME_NO_COCKTAIL ) | |
| 653 | GAME( 1984, lkageo, lkage, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage (older)", GAME_NO_COCKTAIL ) | |
| 654 | GAME( 1984, lkageoo, lkage, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage (oldest)", GAME_NO_COCKTAIL ) | |
| 655 | GAME( 1984, lkageb, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 1)", GAME_NO_COCKTAIL ) | |
| 656 | GAME( 1984, lkageb2, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 2)", GAME_NO_COCKTAIL ) | |
| 657 | GAME( 1984, lkageb3, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 3)", GAME_NO_COCKTAIL ) | |
| 730 | GAME( 1984, lkage, 0, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 731 | GAME( 1984, lkageo, lkage, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage (older)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 732 | GAME( 1984, lkageoo, lkage, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage (oldest)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 733 | GAME( 1984, lkageb, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 734 | GAME( 1984, lkageb2, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 735 | GAME( 1984, lkageb3, lkage, lkageb, lkageb, lkageb, ROT0, "bootleg", "The Legend of Kage (bootleg set 3)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 54 | 54 | #define NUM_PENS (8) |
| 55 | 55 | |
| 56 | 56 | |
| 57 | typedef struct _enigma2_state enigma2_state; | |
| 58 | struct _enigma2_state | |
| 57 | class enigma2_state | |
| 59 | 58 | { |
| 59 | public: | |
| 60 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, enigma2_state(machine)); } | |
| 61 | ||
| 62 | enigma2_state(running_machine &machine) { } | |
| 63 | ||
| 60 | 64 | /* memory pointers */ |
| 61 | 65 | UINT8 * videoram; |
| 62 | 66 |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | static const int input_tab[]= { 0x22, 0x64, 0x44, 0x68, 0x30, 0x50, 0x70, 0x48, 0x28, 0x21, 0x41, 0x82, 0x81, 0x42 }; |
| 47 | 47 | |
| 48 | typedef struct _koikoi_state koikoi_state; | |
| 49 | struct _koikoi_state | |
| 48 | class koikoi_state | |
| 50 | 49 | { |
| 50 | public: | |
| 51 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, koikoi_state(machine)); } | |
| 52 | ||
| 53 | koikoi_state(running_machine &machine) { } | |
| 54 | ||
| 51 | 55 | /* memory pointers */ |
| 52 | 56 | UINT8 * videoram; |
| 53 | 57 |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | #define MAZERBLA 0x01 |
| 45 | 45 | #define GREATGUN 0x02 |
| 46 | static UINT8 game_id = 0; /* hacks per game */ | |
| 47 | 46 | |
| 48 | 47 | #define MASTER_CLOCK XTAL_4MHz |
| 49 | 48 | #define SOUND_CLOCK XTAL_14_31818MHz |
| 50 | 49 | |
| 51 | static UINT8 *cfb_ram; | |
| 52 | 50 | |
| 53 | static UINT8 ls670_0[4]; | |
| 54 | static UINT8 ls670_1[4]; | |
| 51 | class mazerbla_state | |
| 52 | { | |
| 53 | public: | |
| 54 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mazerbla_state(machine)); } | |
| 55 | 55 | |
| 56 | stat | |
| 56 | mazerbla_state(r | |
| 57 | 57 | |
| 58 | static UINT8 bcd_7445 = 0; | |
| 58 | /* memory pointers */ | |
| 59 | UINT8 * cfb_ram; | |
| 60 | UINT8 * videoram; | |
| 61 | size_t videoram_size; | |
| 59 | 62 | |
| 60 | static UINT8 vsb_ls273; | |
| 61 | static UINT8 soundlatch; | |
| 63 | /* video-related */ | |
| 64 | bitmap_t * tmpbitmaps[4]; | |
| 62 | 65 | |
| 66 | UINT8 vcu_video_reg[4]; | |
| 67 | UINT32 vcu_gfx_addr; | |
| 68 | UINT32 vcu_gfx_param_addr; | |
| 63 | 69 | |
| 64 | /************************************* | |
| 65 | * | |
| 66 | * Video Hardware | |
| 67 | * | |
| 68 | *************************************/ | |
| 70 | UINT8 bknd_col; | |
| 71 | UINT8 port02_status; | |
| 72 | UINT8 vbank; /* video page select signal, likely for double buffering ?*/ | |
| 73 | UINT32 xpos, ypos, pix_xsize, pix_ysize; | |
| 74 | UINT8 color1, color2, mode, plane; | |
| 75 | UINT8 lookup_ram[0x100*4]; | |
| 76 | UINT32 gfx_rom_bank; /* graphics ROMs are banked */ | |
| 69 | 77 | |
| 70 | static UINT8 bknd_col; | |
| 71 | static UINT8 port02_status = 0; | |
| 72 | static UINT8 VCU_video_reg[4]; | |
| 73 | static UINT8 vbank = 0; /* video page select signal, likely for double buffering ?*/ | |
| 74 | static UINT32 VCU_gfx_addr = 0; | |
| 75 | static UINT32 VCU_gfx_param_addr = 0; | |
| 76 | static UINT32 xpos=0, ypos=0, pix_xsize=0, pix_ysize=0; | |
| 77 | static UINT8 color=0, color2=0, mode=0, plane=0; | |
| 78 | static UINT8 lookup_RAM[0x100*4]; | |
| 79 | static UINT32 gfx_rom_bank; /* graphics ROMs are banked */ | |
| 78 | double weights_r[2], weights_g[3], weights_b[3]; | |
| 80 | 79 | |
| 80 | /* misc */ | |
| 81 | UINT8 game_id; /* hacks per game */ | |
| 82 | UINT8 ls670_0[4]; | |
| 83 | UINT8 ls670_1[4]; | |
| 81 | 84 | |
| 85 | UINT8 zpu_int_vector; | |
| 86 | ||
| 87 | UINT8 bcd_7445; | |
| 88 | ||
| 89 | UINT8 vsb_ls273; | |
| 90 | UINT8 soundlatch; | |
| 91 | ||
| 92 | /* devices */ | |
| 93 | running_device *maincpu; | |
| 94 | running_device *subcpu; | |
| 95 | }; | |
| 96 | ||
| 97 | ||
| 98 | ||
| 82 | 99 | /*************************************************************************** |
| 83 | 100 | |
| 84 | 101 | Convert the color PROMs into a more useable format. |
| r7500 | r7501 | |
| 97 | 114 | |
| 98 | 115 | ***************************************************************************/ |
| 99 | 116 | |
| 100 | static double weights_r[2], weights_g[3], weights_b[3]; | |
| 101 | ||
| 102 | 117 | static PALETTE_INIT( mazerbla ) |
| 103 | 118 | { |
| 119 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 104 | 120 | static const int resistances_r[2] = { 4700, 2200 }; |
| 105 | 121 | static const int resistances_gb[3] = { 10000, 4700, 2200 }; |
| 106 | 122 | |
| 107 | 123 | /* just to calculate coefficients for later use */ |
| 108 | 124 | compute_resistor_weights(0, 255, -1.0, |
| 109 | 3, resistances_gb, weights_g, 3600, 0, | |
| 110 | 3, resistances_gb, weights_b, 3600, 0, | |
| 111 | 2, resistances_r, weights_r, 3600, 0); | |
| 125 | 3, resistances_gb, state->weights_g, 3600, 0, | |
| 126 | 3, resistances_gb, state->weights_b, 3600, 0, | |
| 127 | 2, resistances_r, state->weights_r, 3600, 0); | |
| 112 | 128 | |
| 113 | 129 | } |
| 114 | 130 | |
| 115 | ||
| 116 | static bitmap_t * tmpbitmaps[4]; | |
| 117 | ||
| 118 | 131 | static VIDEO_START( mazerbla ) |
| 119 | 132 | { |
| 120 | tmpbitmaps[0] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 121 | tmpbitmaps[1] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 122 | tmpbitmaps[2] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 123 | tmpbitmaps[3] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 133 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 134 | state->tmpbitmaps[0] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 135 | state->tmpbitmaps[1] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 136 | state->tmpbitmaps[2] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 137 | state->tmpbitmaps[3] = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 138 | ||
| 139 | state_save_register_global_bitmap(machine, state->tmpbitmaps[0]); | |
| 140 | state_save_register_global_bitmap(machine, state->tmpbitmaps[1]); | |
| 141 | state_save_register_global_bitmap(machine, state->tmpbitmaps[2]); | |
| 142 | state_save_register_global_bitmap(machine, state->tmpbitmaps[3]); | |
| 124 | 143 | } |
| 125 | 144 | |
| 126 | 145 | #ifdef UNUSED_DEFINITION |
| r7500 | r7501 | |
| 134 | 153 | |
| 135 | 154 | VIDEO_UPDATE( test_vcu ) |
| 136 | 155 | { |
| 156 | mazerbla_state *state = (mazerbla_state *)screen->machine->driver_data; | |
| 137 | 157 | int j; |
| 138 | 158 | char buf[128]; |
| 139 | 159 | |
| 140 | UINT32 color_base=0; | |
| 160 | UINT32 color_base = 0; | |
| 141 | 161 | |
| 142 | if (game_id==MAZERBLA) | |
| 162 | if (state->game_id == MAZERBLA) | |
| 143 | 163 | color_base = 0x80; /* 0x80 constant: matches Mazer Blazer movie */ |
| 144 | 164 | |
| 145 | if (game_id==GREATGUN) | |
| 146 | color_base = 0x0; | |
| 165 | if (state->game_id == GREATGUN) | |
| 166 | color_base = 0x00; | |
| 147 | 167 | |
| 148 | bitmap_fill(bitmap,NULL,0); | |
| 168 | bitmap_fill(bitmap, NULL, 0); | |
| 149 | 169 | // logerror("-->frame\n"); |
| 150 | 170 | |
| 151 | 171 | if (planes_enabled[3]) |
| 152 | copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,cliprect); | |
| 172 | copybitmap(bitmap, state->tmpbitmaps[3], 0, 0, 0, 0, cliprect); | |
| 153 | 173 | |
| 154 | 174 | if (planes_enabled[2]) |
| 155 | copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,color_base); | |
| 175 | copybitmap_trans(bitmap, state->tmpbitmaps[2], 0, 0, 0, 0,cliprect, color_base); | |
| 156 | 176 | |
| 157 | bitmap_fill(tmpbitmaps[2],NULL,color_base); | |
| 177 | bitmap_fill(state->tmpbitmaps[2], NULL, color_base); | |
| 158 | 178 | |
| 159 | 179 | if (planes_enabled[1]) |
| 160 | copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,color_base); | |
| 180 | copybitmap_trans(bitmap, state->tmpbitmaps[1], 0, 0, 0, 0,cliprect, color_base); | |
| 161 | 181 | |
| 162 | bitmap_fill(tmpbitmaps[1],NULL,color_base); | |
| 182 | bitmap_fill(state->tmpbitmaps[1], NULL, color_base); | |
| 163 | 183 | |
| 164 | 184 | if (planes_enabled[0]) |
| 165 | copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,color_base); | |
| 185 | copybitmap_trans(bitmap, state->tmpbitmaps[0], 0, 0, 0, 0,cliprect, color_base); | |
| 166 | 186 | |
| 167 | bitmap_fill(tmpbitmaps[0],NULL,color_base); | |
| 187 | bitmap_fill(state->tmpbitmaps[0], NULL, color_base); | |
| 168 | 188 | |
| 169 | 189 | if (input_code_pressed_once(screen->machine, KEYCODE_1)) /* plane 1 */ |
| 170 | 190 | planes_enabled[0] ^= 1; |
| r7500 | r7501 | |
| 191 | 211 | dbg_vbank ^= 1; |
| 192 | 212 | |
| 193 | 213 | if (input_code_pressed_once(screen->machine, KEYCODE_L)) /* showlookup ram */ |
| 194 | dbg_lookup = (dbg_lookup+1)%5;//0,1,2,3, 4-off | |
| 214 | dbg_lookup = (dbg_lookup + 1) % 5; //0,1,2,3, 4-off | |
| 195 | 215 | |
| 196 | 216 | |
| 197 | 217 | if (dbg_info) |
| r7500 | r7501 | |
| 210 | 230 | if (dbg_lookup!=4) |
| 211 | 231 | { |
| 212 | 232 | int lookup_offs = (dbg_lookup)*256; //=0,1,2,3*256 |
| 213 | int y,x; | |
| 233 | int y, x; | |
| 214 | 234 | |
| 215 | for (y=0; y<16; y++) | |
| 235 | for (y = 0; y < 16; y++) | |
| 216 | 236 | { |
| 217 | memset(buf,0,128); | |
| 218 | sprintf( buf+strlen(buf), "%04x ", lookup_offs+y*16 ); | |
| 219 | for (x=0; x<16; x++) | |
| 237 | memset(buf, 0, 128); | |
| 238 | sprintf(buf + strlen(buf), "%04x ", lookup_offs + y * 16); | |
| 239 | for (x = 0; x < 16; x++) | |
| 220 | 240 | { |
| 221 | sprintf( | |
| 241 | sprintf( | |
| 222 | 242 | } |
| 223 | 243 | ui_draw_text(buf, 0, (2 + y) * ui_get_line_height()); |
| 224 | 244 | } |
| r7500 | r7501 | |
| 230 | 250 | #endif |
| 231 | 251 | |
| 232 | 252 | |
| 233 | /* these two VIDEO_UPDATE()s will be joined one day */ | |
| 234 | static VIDEO_UPDATE( greatgun ) | |
| 235 | { | |
| 236 | UINT32 color_base=0; | |
| 237 | ||
| 238 | if (game_id==MAZERBLA) | |
| 239 | color_base = 0x80; /* 0x80 constant: matches Mazer Blazer movie */ | |
| 240 | ||
| 241 | if (game_id==GREATGUN) | |
| 242 | color_base = 0x0; | |
| 243 | ||
| 244 | // bitmap_fill(bitmap,NULL,0); | |
| 245 | ||
| 246 | copybitmap (bitmap,tmpbitmaps[3],0,0,0,0,cliprect); | |
| 247 | copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,color_base); | |
| 248 | copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,color_base); | |
| 249 | copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,color_base); | |
| 250 | return 0; | |
| 251 | } | |
| 252 | ||
| 253 | 253 | static VIDEO_UPDATE( mazerbla ) |
| 254 | 254 | { |
| 255 | UINT32 color_base=0; | |
| 255 | mazerbla_state *state = (mazerbla_state *)screen->machine->driver_data; | |
| 256 | UINT32 color_base = 0; | |
| 256 | 257 | |
| 257 | if (game_id==MAZERBLA) | |
| 258 | if (state->game_id == MAZERBLA) | |
| 258 | 259 | color_base = 0x80; /* 0x80 constant: matches Mazer Blazer movie */ |
| 259 | 260 | |
| 260 | if (game_id==GREATGUN) | |
| 261 | color_base = 0x0; | |
| 261 | if (state->game_id == GREATGUN) | |
| 262 | color_base = 0x00; | |
| 262 | 263 | |
| 263 | // bitmap_fill(bitmap,NULL,0); | |
| 264 | // bitmap_fill(bitmap, NULL, 0); | |
| 264 | 265 | |
| 265 | copybitmap (bitmap,tmpbitmaps[3],0,0,0,0,cliprect); //text | |
| 266 | copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,0); | |
| 267 | copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,0); //haircross | |
| 268 | copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,0); //sprites | |
| 266 | copybitmap(bitmap, state->tmpbitmaps[3], 0, 0, 0, 0, cliprect); | |
| 267 | copybitmap_trans(bitmap, state->tmpbitmaps[2], 0, 0, 0, 0, cliprect, 0); | |
| 268 | copybitmap_trans(bitmap, state->tmpbitmaps[1], 0, 0, 0, 0, cliprect, 0); | |
| 269 | copybitmap_trans(bitmap, state->tmpbitmaps[0], 0, 0, 0, 0, cliprect, 0); | |
| 269 | 270 | return 0; |
| 270 | 271 | } |
| 271 | 272 | |
| 272 | 273 | |
| 273 | 274 | static WRITE8_HANDLER( cfb_backgnd_color_w ) |
| 274 | 275 | { |
| 275 | if (bknd_col != data) | |
| 276 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 277 | ||
| 278 | if (state->bknd_col != data) | |
| 276 | 279 | { |
| 277 | int r,g,b, bit0, bit1, bit2; | |
| 280 | int r, g, b, bit0, bit1, bit2; | |
| 278 | 281 | |
| 279 | bknd_col = data; | |
| 282 | state->bknd_col = data; | |
| 280 | 283 | |
| 281 | 284 | /* red component */ |
| 282 | bit1 = (data >> 7) & 0x01; | |
| 283 | bit0 = (data >> 6) & 0x01; | |
| 284 | r = combine_2_weights(weights_r, bit0, bit1); | |
| 285 | bit1 = BIT(data, 7); | |
| 286 | bit0 = BIT(data, 6); | |
| 287 | r = combine_2_weights(state->weights_r, bit0, bit1); | |
| 285 | 288 | |
| 286 | 289 | /* green component */ |
| 287 | bit2 = (data >> 5) & 0x01; | |
| 288 | bit1 = (data >> 4) & 0x01; | |
| 289 | bit0 = (data >> 3) & 0x01; | |
| 290 | g = combine_3_weights(weights_g, bit0, bit1, bit2); | |
| 290 | bit2 = BIT(data, 5); | |
| 291 | bit1 = BIT(data, 4); | |
| 292 | bit0 = BIT(data, 3); | |
| 293 | g = combine_3_weights(state->weights_g, bit0, bit1, bit2); | |
| 291 | 294 | |
| 292 | 295 | /* blue component */ |
| 293 | bit2 = (data >> 2) & 0x01; | |
| 294 | bit1 = (data >> 1) & 0x01; | |
| 295 | bit0 = (data >> 0) & 0x01; | |
| 296 | b = combine_3_weights(weights_b, bit0, bit1, bit2); | |
| 296 | bit2 = BIT(data, 2); | |
| 297 | bit1 = BIT(data, 1); | |
| 298 | bit0 = BIT(data, 0); | |
| 299 | b = combine_3_weights(state->weights_b, bit0, bit1, bit2); | |
| 297 | 300 | |
| 298 | 301 | palette_set_color(space->machine, 255, MAKE_RGB(r, g, b)); |
| 299 | 302 | //logerror("background color (port 01) write=%02x\n",data); |
| r7500 | r7501 | |
| 301 | 304 | } |
| 302 | 305 | |
| 303 | 306 | |
| 304 | static WRITE8_HANDLER(cfb_vbank_w) | |
| 307 | static WRITE8_HANDLER( cfb_vbank_w ) | |
| 305 | 308 | { |
| 309 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 310 | ||
| 306 | 311 | /* only bit 6 connected */ |
| 307 | vbank = (data | |
| 312 | state->vbank = BIT(data, | |
| 308 | 313 | } |
| 309 | 314 | |
| 310 | 315 | |
| 311 | static WRITE8_HANDLER(cfb_rom_bank_sel_w) /* mazer blazer */ | |
| 316 | static WRITE8_HANDLER( cfb_rom_bank_sel_w ) /* mazer blazer */ | |
| 312 | 317 | { |
| 313 | gfx_rom_bank = data; | |
| 318 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 319 | state->gfx_rom_bank = data; | |
| 314 | 320 | |
| 315 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000 | |
| 321 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "sub2") + (state->gfx_rom_bank * 0x2000) + 0x10000 | |
| 316 | 322 | } |
| 317 | 323 | |
| 318 | static WRITE8_HANDLER(cfb_rom_bank_sel_w_gg) /* great guns */ | |
| 324 | static WRITE8_HANDLER( cfb_rom_bank_sel_w_gg ) /* great guns */ | |
| 319 | 325 | { |
| 320 | gfx_rom_bank = data>>1; | |
| 326 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 327 | state->gfx_rom_bank = data >> 1; | |
| 321 | 328 | |
| 322 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000 | |
| 329 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "sub2") + (state->gfx_rom_bank * 0x2000) + 0x10000 | |
| 323 | 330 | } |
| 324 | 331 | |
| 325 | 332 | |
| 326 | 333 | /* VCU status? */ |
| 327 | 334 | static READ8_HANDLER( cfb_port_02_r ) |
| 328 | 335 | { |
| 329 | port02_status ^= 0xff; | |
| 330 | return (port02_status); | |
| 336 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 337 | state->port02_status ^= 0xff; | |
| 338 | return state->port02_status; | |
| 331 | 339 | } |
| 332 | 340 | |
| 333 | 341 | |
| 334 | static WRITE8_HANDLER( | |
| 342 | static WRITE8_HANDLER( vcu_video_reg_w ) | |
| 335 | 343 | { |
| 336 | if (VCU_video_reg[offset] != data) | |
| 344 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 345 | if (state->vcu_video_reg[offset] != data) | |
| 337 | 346 | { |
| 338 | VCU_video_reg[offset] = data; | |
| 339 | //popmessage("video_reg= %02x %02x %02x %02x", VCU_video_reg[0], VCU_video_reg[1], VCU_video_reg[2], VCU_video_reg[3] ); | |
| 340 | //logerror("video_reg= %02x %02x %02x %02x\n", VCU_video_reg[0], VCU_video_reg[1], VCU_video_reg[2], VCU_video_reg[3] ); | |
| 347 | state->vcu_video_reg[offset] = data; | |
| 348 | //popmessage("video_reg= %02x %02x %02x %02x", state->vcu_video_reg[0], state->vcu_video_reg[1], state->vcu_video_reg[2], state->vcu_video_reg[3]); | |
| 349 | //logerror("video_reg= %02x %02x %02x %02x\n", state->vcu_video_reg[0], state->vcu_video_reg[1], state->vcu_video_reg[2], state->vcu_video_reg[3]); | |
| 341 | 350 | } |
| 342 | 351 | } |
| 343 | 352 | |
| 344 | static READ8_HANDLER( | |
| 353 | static READ8_HANDLER( vcu_set_cmd_param_r ) | |
| 345 | 354 | { |
| 346 | VCU_gfx_param_addr = offset; | |
| 355 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 356 | state->vcu_gfx_param_addr = offset; | |
| 347 | 357 | |
| 348 | 358 | /* offset = 0 is not known */ |
| 349 | xpos = cfb_ram[VCU_gfx_param_addr + 1] | (cfb_ram[VCU_gfx_param_addr + 2]<<8); | |
| 350 | ypos = cfb_ram[VCU_gfx_param_addr + 3] | (cfb_ram[VCU_gfx_param_addr + 4]<<8); | |
| 351 | color = cfb_ram[VCU_gfx_param_addr + 5]; | |
| 352 | color2 = cfb_ram[VCU_gfx_param_addr + 6]; | |
| 353 | mode = cfb_ram[VCU_gfx_param_addr + 7]; | |
| 354 | pix_xsize = cfb_ram[VCU_gfx_param_addr + 8]; | |
| 355 | pix_ysize = cfb_ram[VCU_gfx_param_addr + 9]; | |
| 359 | state->xpos = state->cfb_ram[state->vcu_gfx_param_addr + 1] | (state->cfb_ram[state->vcu_gfx_param_addr + 2]<<8); | |
| 360 | state->ypos = state->cfb_ram[state->vcu_gfx_param_addr + 3] | (state->cfb_ram[state->vcu_gfx_param_addr + 4]<<8); | |
| 361 | state->color1 = state->cfb_ram[state->vcu_gfx_param_addr + 5]; | |
| 362 | state->color2 = state->cfb_ram[state->vcu_gfx_param_addr + 6]; | |
| 363 | state->mode = state->cfb_ram[state->vcu_gfx_param_addr + 7]; | |
| 364 | state->pix_xsize = state->cfb_ram[state->vcu_gfx_param_addr + 8]; | |
| 365 | state->pix_ysize = state->cfb_ram[state->vcu_gfx_param_addr + 9]; | |
| 356 | 366 | |
| 357 | plane = mode & 3; | |
| 367 | state->plane = state->mode & 3; | |
| 358 | 368 | |
| 359 | 369 | return 0; |
| 360 | 370 | } |
| 361 | 371 | |
| 362 | 372 | |
| 363 | static READ8_HANDLER( | |
| 373 | static READ8_HANDLER( vcu_set_gfx_addr_r ) | |
| 364 | 374 | { |
| 375 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 376 | UINT8 * rom = memory_region(space->machine, "sub2") + (state->gfx_rom_bank * 0x2000) + 0x10000; | |
| 365 | 377 | int offs; |
| 366 | int x,y; | |
| 378 | int x, y; | |
| 367 | 379 | int bits = 0; |
| 380 | UINT8 color_base = 0; | |
| 368 | 381 | |
| 369 | UINT8 color_base=0; | |
| 382 | if (state->game_id == MAZERBLA) | |
| 383 | color_base = 0x80; /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */ | |
| 370 | 384 | |
| 371 | UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000; | |
| 372 | ||
| 385 | if (state->game_id == GREATGUN) | |
| 386 | color_base = 0x00; /* 0x00 - good for Great Guns: (both in game and CRT test mode) */ | |
| 373 | 387 | /* |
| 374 | if ((mode<=0x07) || (mode>=0x10)) | |
| 388 | if ((mode <= 0x07) || (mode >= 0x10)) | |
| 375 | 389 | { |
| 376 | 390 | logerror("paradr="); |
| 377 | logerror("%3x ", | |
| 391 | logerror("%3x ", state->vcu_gfx_param_addr ); | |
| 378 | 392 | |
| 379 | logerror("%02x ", cfb_ram[VCU_gfx_param_addr + 0] ); | |
| 380 | logerror("x=%04x ", xpos ); //1,2 | |
| 381 | logerror("y=%04x ", ypos ); //3,4 | |
| 382 | logerror("color=%02x ", color); //5 | |
| 383 | logerror("color2=%02x ", color2); //6 | |
| 384 | logerror("mode=%02x ", mode ); //7 | |
| 385 | logerror("xpix=%02x ", pix_xsize ); //8 | |
| 386 | logerror("ypix=%02x ", pix_ysize ); //9 | |
| 393 | logerror("%02x ", state->cfb_ram[vcu_gfx_param_addr + 0] ); | |
| 394 | logerror("x=%04x ", state->xpos ); //1,2 | |
| 395 | logerror("y=%04x ", state->ypos ); //3,4 | |
| 396 | logerror("color1=%02x ", state->color1); //5 | |
| 397 | logerror("color2=%02x ", state->color2); //6 | |
| 398 | logerror("mode=%02x ", state->mode ); //7 | |
| 399 | logerror("xpix=%02x ", state->pix_xsize ); //8 | |
| 400 | logerror("ypix=%02x ", state->pix_ysize ); //9 | |
| 387 | 401 | |
| 388 | logerror("addr=%4i bank=%1i\n", offset, gfx_rom_bank); | |
| 402 | logerror("addr=%4i bank=%1i\n", offset, state->gfx_rom_bank); | |
| 389 | 403 | } |
| 390 | 404 | */ |
| 391 | 405 | |
| 392 | | |
| 406 | state->vcu_gfx_addr = offset; | |
| 393 | 407 | |
| 394 | 408 | /* draw */ |
| 395 | offs = | |
| 409 | offs = state->vcu_gfx_addr; | |
| 396 | 410 | |
| 397 | switch(mode) | |
| 411 | switch(state->mode) | |
| 398 | 412 | { |
| 399 | 413 | /* 2 bits per pixel */ |
| 400 | 414 | case 0x0f: |
| r7500 | r7501 | |
| 403 | 417 | case 0x0c: |
| 404 | 418 | // if (dbg_gfx_e) |
| 405 | 419 | // { |
| 406 | // if (vbank==dbg_vbank) | |
| 420 | // if (state->vbank == dbg_vbank) | |
| 407 | 421 | { |
| 408 | if (game_id==MAZERBLA) | |
| 409 | color_base = 0x80; /* 0x80 constant: matches Mazer Blazer movie */ | |
| 410 | ||
| 411 | if (game_id==GREATGUN) | |
| 412 | color_base = 0x00; | |
| 413 | ||
| 414 | for (y = 0; y <= pix_ysize; y++) | |
| 422 | for (y = 0; y <= state->pix_ysize; y++) | |
| 415 | 423 | { |
| 416 | for (x = 0; x <= pix_xsize; x++) | |
| 424 | for (x = 0; x <= state->pix_xsize; x++) | |
| 417 | 425 | { |
| 418 | UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000]; | |
| 419 | UINT8 data = (pixeldata>>(6-(bits&7))) & 3; | |
| 426 | UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; | |
| 427 | UINT8 data = (pixeldata >> (6 - (bits & 7))) & 3; | |
| 420 | 428 | UINT8 col = 0; |
| 421 | 429 | |
| 422 | 430 | switch(data) |
| 423 | 431 | { |
| 424 | 432 | case 0: |
| 425 | col = color_base | ((color &0x0f)); //background PEN | |
| 433 | col = color_base | ((state->color1 & 0x0f)); //background PEN | |
| 426 | 434 | break; |
| 427 | 435 | case 1: |
| 428 | col = color_base | ((color &0xf0)>>4); //foreground PEN | |
| 436 | col = color_base | ((state->color1 & 0xf0) >> 4); //foreground PEN | |
| 429 | 437 | break; |
| 430 | 438 | case 2: |
| 431 | col = color_base | ((color2 &0x0f)); //background PEN2 | |
| 439 | col = color_base | ((state->color2 & 0x0f)); //background PEN2 | |
| 432 | 440 | break; |
| 433 | 441 | case 3: |
| 434 | col = color_base | ((color2 &0xf0)>>4); //foreground PEN2 | |
| 442 | col = color_base | ((state->color2 & 0xf0) >> 4); //foreground PEN2 | |
| 435 | 443 | break; |
| 436 | 444 | } |
| 437 | 445 | |
| 438 | if ( ((xpos+x)<256) && ((ypos+y)<256) ) | |
| 439 | *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col; | |
| 446 | if (((state->xpos + x) < 256) && ((state->ypos + y) < 256) ) | |
| 447 | *BITMAP_ADDR16(state->tmpbitmaps[state->plane], state->ypos + y, state->xpos + x) = col; | |
| 440 | 448 | |
| 441 | bits+=2; | |
| 449 | bits += 2; | |
| 442 | 450 | } |
| 443 | 451 | } |
| 444 | 452 | } |
| r7500 | r7501 | |
| 452 | 460 | case 0x08:/* */ |
| 453 | 461 | // if (dbg_gfx_e) |
| 454 | 462 | // { |
| 455 | // if (vbank==dbg_vbank) | |
| 463 | // if (state->vbank == dbg_vbank) | |
| 456 | 464 | { |
| 457 | if (game_id==MAZERBLA) | |
| 458 | color_base = 0x80; /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */ | |
| 459 | 465 | |
| 460 | if (game_id==GREATGUN) | |
| 461 | color_base = 0x00; /* 0x00 - good for Great Guns: (both in game and CRT test mode) */ | |
| 462 | ||
| 463 | for (y = 0; y <= pix_ysize; y++) | |
| 466 | for (y = 0; y <= state->pix_ysize; y++) | |
| 464 | 467 | { |
| 465 | for (x = 0; x <= pix_xsize; x++) | |
| 468 | for (x = 0; x <= state->pix_xsize; x++) | |
| 466 | 469 | { |
| 467 | UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000]; | |
| 468 | UINT8 data = (pixeldata>>(7-(bits&7))) & 1; | |
| 470 | UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; | |
| 471 | UINT8 data = (pixeldata >> (7 - (bits & 7))) & 1; | |
| 469 | 472 | |
| 470 | 473 | /* color = 4 MSB = front PEN, 4 LSB = background PEN */ |
| 471 | 474 | |
| 472 | if ( ((xpos+x)<256) && ((ypos+y)<256) ) | |
| 473 | *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = data? color_base | ((color&0xf0)>>4): color_base | ((color&0x0f)); | |
| 475 | if (((state->xpos + x) < 256) && ((state->ypos + y) < 256)) | |
| 476 | *BITMAP_ADDR16(state->tmpbitmaps[state->plane], state->ypos + y, state->xpos + x) = data ? color_base | ((state->color1 & 0xf0) >> 4): color_base | ((state->color1 & 0x0f)); | |
| 474 | 477 | |
| 475 | bits+=1; | |
| 478 | bits += 1; | |
| 476 | 479 | } |
| 477 | 480 | } |
| 478 | 481 | } |
| r7500 | r7501 | |
| 485 | 488 | case 0x00: |
| 486 | 489 | // if (dbg_gfx_e) |
| 487 | 490 | // { |
| 488 | // if (vbank==dbg_vbank) | |
| 491 | // if (state->vbank == dbg_vbank) | |
| 489 | 492 | { |
| 490 | if (game_id==MAZERBLA) | |
| 491 | color_base = 0x80; /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */ | |
| 492 | ||
| 493 | if (game_id==GREATGUN) | |
| 494 | color_base = 0x00; /* 0x00 - good for Great Guns: (both in game and CRT test mode) */ | |
| 495 | ||
| 496 | for (y = 0; y <= pix_ysize; y++) | |
| 493 | for (y = 0; y <= state->pix_ysize; y++) | |
| 497 | 494 | { |
| 498 | for (x = 0; x <= pix_xsize; x++) | |
| 495 | for (x = 0; x <= state->pix_xsize; x++) | |
| 499 | 496 | { |
| 500 | UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000]; | |
| 501 | UINT8 data = (pixeldata>>(4-(bits&7))) & 15; | |
| 497 | UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; | |
| 498 | UINT8 data = (pixeldata >> (4 - (bits & 7))) & 15; | |
| 502 | 499 | UINT8 col = 0; |
| 503 | 500 | |
| 504 | 501 | col = color_base | data; |
| 505 | 502 | |
| 506 | if ( ((xpos+x)<256) && ((ypos+y)<256) ) | |
| 507 | *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col; | |
| 503 | if (((state->xpos + x) < 256) && ((state->ypos + y) < 256)) | |
| 504 | *BITMAP_ADDR16(state->tmpbitmaps[state->plane], state->ypos + y, state->xpos + x) = col; | |
| 508 | 505 | |
| 509 | bits+=4; | |
| 506 | bits += 4; | |
| 510 | 507 | } |
| 511 | 508 | } |
| 512 | 509 | } |
| 513 | 510 | // } |
| 514 | 511 | break; |
| 515 | 512 | default: |
| 516 | popmessage("not supported VCU drawing mode=%2x", mode); | |
| 513 | popmessage("not supported VCU drawing mode=%2x", state->mode); | |
| 517 | 514 | break; |
| 518 | 515 | } |
| 519 | 516 | |
| 520 | 517 | return 0; |
| 521 | 518 | } |
| 522 | 519 | |
| 523 | static READ8_HANDLER( | |
| 520 | static READ8_HANDLER( vcu_set_clr_addr_r ) | |
| 524 | 521 | { |
| 522 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 523 | UINT8 * rom = memory_region(space->machine, "sub2") + (state->gfx_rom_bank * 0x2000) + 0x10000; | |
| 525 | 524 | int offs; |
| 526 | int x,y; | |
| 525 | int x, y; | |
| 527 | 526 | int bits = 0; |
| 528 | 527 | |
| 529 | UINT8 color_base=0; | |
| 528 | UINT8 color_base = 0; | |
| 530 | 529 | |
| 531 | UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000; | |
| 532 | 530 | |
| 533 | 531 | /* |
| 534 | 532 | //if (0) //(mode != 0x07) |
| 535 | 533 | { |
| 536 | 534 | logerror("paladr="); |
| 537 | logerror("%3x ", | |
| 535 | logerror("%3x ", state->vcu_gfx_param_addr ); | |
| 538 | 536 | |
| 539 | logerror("%02x ", cfb_ram[VCU_gfx_param_addr + 0] ); | |
| 540 | logerror("x=%04x ", xpos ); //1,2 | |
| 541 | logerror("y=%04x ", ypos ); //3,4 | |
| 542 | logerror("color=%02x ", color); //5 | |
| 543 | logerror("color2=%02x ", color2 ); //6 | |
| 544 | logerror("mode=%02x ", mode ); //7 | |
| 545 | logerror("xpix=%02x ", pix_xsize ); //8 | |
| 546 | logerror("ypix=%02x ", pix_ysize ); //9 | |
| 537 | logerror("%02x ", state->cfb_ram[state->vcu_gfx_param_addr + 0] ); | |
| 538 | logerror("x=%04x ", state->xpos ); //1,2 | |
| 539 | logerror("y=%04x ", state->ypos ); //3,4 | |
| 540 | logerror("color1=%02x ", state->color1); //5 | |
| 541 | logerror("color2=%02x ", state->color2 ); //6 | |
| 542 | logerror("mode=%02x ", state->mode ); //7 | |
| 543 | logerror("xpix=%02x ", state->pix_xsize ); //8 | |
| 544 | logerror("ypix=%02x ", state->pix_ysize ); //9 | |
| 547 | 545 | |
| 548 | logerror("addr=%4i bank=%1i\n", offset, gfx_rom_bank); | |
| 546 | logerror("addr=%4i bank=%1i\n", offset, state->gfx_rom_bank); | |
| 549 | 547 | |
| 550 | for (y=0; y<16; y++) | |
| 548 | for (y = 0; y < 16; y++) | |
| 551 | 549 | { |
| 552 | logerror("%04x: ",offset+y*16); | |
| 553 | for (x=0; x<16; x++) | |
| 550 | logerror("%04x: ", offset + y * 16); | |
| 551 | for (x = 0; x < 16; x++) | |
| 554 | 552 | { |
| 555 | logerror("%02x ",cfb_ram[offset+x+y*16]); | |
| 553 | logerror("%02x ", state->cfb_ram[offset + x + y * 16]); | |
| 556 | 554 | } |
| 557 | 555 | logerror("\n"); |
| 558 | 556 | } |
| r7500 | r7501 | |
| 563 | 561 | /* copy palette / CLUT(???) */ |
| 564 | 562 | |
| 565 | 563 | |
| 566 | switch(mode) | |
| 564 | switch (state->mode) | |
| 567 | 565 | { |
| 568 | 566 | case 0x13: /* draws sprites?? in mazer blazer and ... wrong sprite in place of targeting-cross and UFO laser */ |
| 569 | 567 | case 0x03: |
| r7500 | r7501 | |
| 571 | 569 | the draw command/palette selector is done via the 'mode' only ... */ |
| 572 | 570 | //if (dbg_clr_e) |
| 573 | 571 | { |
| 574 | offs = | |
| 572 | offs = state->vcu_gfx_addr; | |
| 575 | 573 | |
| 576 | if (game_id==MAZERBLA) | |
| 574 | if (state->game_id == MAZERBLA) | |
| 577 | 575 | color_base = 0x80; /* 0x80 constant: matches Mazer Blazer movie */ |
| 578 | 576 | |
| 579 | if (game_id==GREATGUN) | |
| 577 | if (state->game_id == GREATGUN) | |
| 580 | 578 | color_base = 0x00; |
| 581 | 579 | |
| 582 | for (y = 0; y <= pix_ysize; y++) | |
| 580 | for (y = 0; y <= state->pix_ysize; y++) | |
| 583 | 581 | { |
| 584 | for (x = 0; x <= pix_xsize; x++) | |
| 582 | for (x = 0; x <= state->pix_xsize; x++) | |
| 585 | 583 | { |
| 586 | UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000]; | |
| 587 | UINT8 data = (pixeldata>>(6-(bits&7))) & 3; | |
| 584 | UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; | |
| 585 | UINT8 data = (pixeldata >> (6 - (bits & 7))) & 3; | |
| 588 | 586 | UINT8 col = 0; |
| 589 | 587 | |
| 590 | 588 | switch(data) |
| 591 | 589 | { |
| 592 | 590 | case 0: |
| 593 | col = color_base | ((color &0x0f)); //background PEN | |
| 591 | col = color_base | ((state->color1 & 0x0f)); //background PEN | |
| 594 | 592 | break; |
| 595 | 593 | case 1: |
| 596 | col = color_base | ((color &0xf0)>>4); //foreground PEN | |
| 594 | col = color_base | ((state->color1 & 0xf0) >> 4); //foreground PEN | |
| 597 | 595 | break; |
| 598 | 596 | case 2: |
| 599 | col = color_base | ((color2 &0x0f)); //background PEN2 | |
| 597 | col = color_base | ((state->color2 & 0x0f)); //background PEN2 | |
| 600 | 598 | break; |
| 601 | 599 | case 3: |
| 602 | col = color_base | ((color2 &0xf0)>>4); //foreground PEN2 | |
| 600 | col = color_base | ((state->color2 & 0xf0) >> 4); //foreground PEN2 | |
| 603 | 601 | break; |
| 604 | 602 | } |
| 605 | 603 | |
| 606 | if ( ((xpos+x)<256) && ((ypos+y)<256) ) | |
| 607 | *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col; | |
| 604 | if (((state->xpos + x) < 256) && ((state->ypos + y) < 256)) | |
| 605 | *BITMAP_ADDR16(state->tmpbitmaps[state->plane], state->ypos + y, state->xpos + x) = col; | |
| 608 | 606 | |
| 609 | bits+=2; | |
| 607 | bits += 2; | |
| 610 | 608 | } |
| 611 | 609 | } |
| 612 | 610 | } |
| r7500 | r7501 | |
| 616 | 614 | case 0x07: |
| 617 | 615 | offs = offset; |
| 618 | 616 | |
| 619 | switch(ypos) | |
| 617 | switch(state->ypos) | |
| 620 | 618 | { |
| 621 | 619 | case 6: //seems to encode palette write |
| 622 | 620 | { |
| 623 | int r,g,b, bit0, bit1, bit2; | |
| 621 | int r, g, b, bit0, bit1, bit2; | |
| 624 | 622 | |
| 625 | 623 | //pix_xsize and pix_ysize seem to be related to palette length ? (divide by 2) |
| 626 | int lookup_offs = (ypos>>1)*256; //=3*256 | |
| 624 | int lookup_offs = (state->ypos >> 1) * 256; //=3*256 | |
| 627 | 625 | |
| 628 | for (y=0; y<16; y++) | |
| 626 | for (y = 0; y < 16; y++) | |
| 629 | 627 | { |
| 630 | for (x=0; x<16; x++) | |
| 628 | for (x = 0; x < 16; x++) | |
| 631 | 629 | { |
| 632 | UINT8 colour = cfb_ram[ | |
| 630 | UINT8 colour = state->cfb_ram[ | |
| 633 | 631 | |
| 634 | 632 | /* red component */ |
| 635 | 633 | bit1 = (colour >> 7) & 0x01; |
| 636 | 634 | bit0 = (colour >> 6) & 0x01; |
| 637 | r = combine_2_weights(weights_r, bit0, bit1); | |
| 635 | r = combine_2_weights(state->weights_r, bit0, bit1); | |
| 638 | 636 | |
| 639 | 637 | /* green component */ |
| 640 | 638 | bit2 = (colour >> 5) & 0x01; |
| 641 | 639 | bit1 = (colour >> 4) & 0x01; |
| 642 | 640 | bit0 = (colour >> 3) & 0x01; |
| 643 | g = combine_3_weights(weights_g, bit0, bit1, bit2); | |
| 641 | g = combine_3_weights(state->weights_g, bit0, bit1, bit2); | |
| 644 | 642 | |
| 645 | 643 | /* blue component */ |
| 646 | 644 | bit2 = (colour >> 2) & 0x01; |
| 647 | 645 | bit1 = (colour >> 1) & 0x01; |
| 648 | 646 | bit0 = (colour >> 0) & 0x01; |
| 649 | b = combine_3_weights(weights_b, bit0, bit1, bit2); | |
| 647 | b = combine_3_weights(state->weights_b, bit0, bit1, bit2); | |
| 650 | 648 | |
| 651 | if ((x+y*16)<255)//keep color 255 free for use as background color | |
| 652 | palette_set_color(space->machine, x+y*16, MAKE_RGB(r, g, b)); | |
| 649 | if ((x + y * 16) < 255)//keep color 255 free for use as background color | |
| 650 | palette_set_color(space->machine, x + y * 16, MAKE_RGB(r, g, b)); | |
| 653 | 651 | |
| 654 | lookup_ | |
| 652 | state->lookup_ram[ | |
| 655 | 653 | } |
| 656 | 654 | } |
| 657 | 655 | } |
| 658 | 656 | break; |
| 659 | 657 | case 4: //seems to encode lookup???? table write |
| 660 | 658 | { |
| 661 | int lookup_offs = (ypos>>1)*256; //=2*256 | |
| 659 | int lookup_offs = (state->ypos >> 1) * 256; //=2*256 | |
| 662 | 660 | |
| 663 | for (y=0; y<16; y++) | |
| 661 | for (y = 0; y < 16; y++) | |
| 664 | 662 | { |
| 665 | for (x=0; x<16; x++) | |
| 663 | for (x = 0; x < 16; x++) | |
| 666 | 664 | { |
| 667 | UINT8 dat = cfb_ram[ offs + x + y*16 ]; | |
| 668 | lookup_RAM[ lookup_offs + x + y*16 ] = dat; | |
| 665 | UINT8 dat = state->cfb_ram[offs + x + y * 16]; | |
| 666 | state->lookup_ram[lookup_offs + x + y * 16] = dat; | |
| 669 | 667 | } |
| 670 | 668 | } |
| 671 | 669 | } |
| 672 | 670 | break; |
| 673 | 671 | case 2: //seems to encode lookup???? table write |
| 674 | 672 | { |
| 675 | int lookup_offs = (ypos>>1)*256; //=1*256 | |
| 673 | int lookup_offs = (state->ypos >> 1) * 256; //=1*256 | |
| 676 | 674 | |
| 677 | for (y=0; y<16; y++) | |
| 675 | for (y = 0; y < 16; y++) | |
| 678 | 676 | { |
| 679 | for (x=0; x<16; x++) | |
| 677 | for (x = 0; x < 16; x++) | |
| 680 | 678 | { |
| 681 | UINT8 dat = cfb_ram[ offs + x + y*16 ]; | |
| 682 | lookup_RAM[ lookup_offs + x + y*16 ] = dat; | |
| 679 | UINT8 dat = state->cfb_ram[offs + x + y * 16]; | |
| 680 | state->lookup_ram[lookup_offs + x + y * 16] = dat; | |
| 683 | 681 | } |
| 684 | 682 | } |
| 685 | 683 | } |
| 686 | 684 | break; |
| 687 | 685 | case 0: //seems to encode lookup???? table write |
| 688 | 686 | { |
| 689 | int lookup_offs = (ypos>>1)*256; //=0*256 | |
| 687 | int lookup_offs = (state->ypos >> 1) * 256; //=0*256 | |
| 690 | 688 | |
| 691 | for (y=0; y<16; y++) | |
| 689 | for (y = 0; y < 16; y++) | |
| 692 | 690 | { |
| 693 | for (x=0; x<16; x++) | |
| 691 | for (x = 0; x < 16; x++) | |
| 694 | 692 | { |
| 695 | UINT8 dat = cfb_ram[ offs + x + y*16 ]; | |
| 696 | lookup_RAM[ lookup_offs + x + y*16 ] = dat; | |
| 693 | UINT8 dat = state->cfb_ram[offs + x + y * 16]; | |
| 694 | state->lookup_ram[lookup_offs + x + y * 16] = dat; | |
| 697 | 695 | } |
| 698 | 696 | } |
| 699 | 697 | } |
| 700 | 698 | break; |
| 701 | 699 | |
| 702 | 700 | default: |
| 703 | popmessage("not supported lookup/color write mode=%2x", ypos); | |
| 701 | popmessage("not supported lookup/color write mode=%2x", state->ypos); | |
| 704 | 702 | break; |
| 705 | 703 | } |
| 706 | 704 | break; |
| 707 | 705 | |
| 708 | 706 | default: |
| 709 | popmessage("not supported VCU color mode=%2x", mode); | |
| 707 | popmessage("not supported VCU color mode=%2x", state->mode); | |
| 710 | 708 | break; |
| 711 | 709 | } |
| 712 | 710 | |
| r7500 | r7501 | |
| 721 | 719 | |
| 722 | 720 | static WRITE8_HANDLER( cfb_zpu_int_req_set_w ) |
| 723 | 721 | { |
| 724 | z | |
| 722 | mazerbla_s | |
| 725 | 723 | |
| 726 | cputag_set_input_line(space->machine, "maincpu", 0, ASSERT_LINE); /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */ | |
| 724 | state->zpu_int_vector &= ~2; /* clear D1 on INTA (interrupt acknowledge) */ | |
| 725 | ||
| 726 | cpu_set_input_line(state->maincpu, 0, ASSERT_LINE); /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */ | |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | static READ8_HANDLER( cfb_zpu_int_req_clr ) |
| 730 | 730 | { |
| 731 | z | |
| 731 | mazerbla_s | |
| 732 | 732 | |
| 733 | state->zpu_int_vector |= 2; | |
| 734 | ||
| 733 | 735 | /* clear the INT line when there are no more interrupt requests */ |
| 734 | if (zpu_int_vector == 0xff) | |
| 735 | cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); | |
| 736 | if (state->zpu_int_vector == 0xff) | |
| 737 | cpu_set_input_line(state->maincpu, 0, CLEAR_LINE); | |
| 736 | 738 | |
| 737 | 739 | return 0; |
| 738 | 740 | } |
| 739 | 741 | |
| 740 | 742 | static READ8_HANDLER( ls670_0_r ) |
| 741 | 743 | { |
| 744 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 745 | ||
| 742 | 746 | /* set a timer to force synchronization after the read */ |
| 743 | 747 | timer_call_after_resynch(space->machine, NULL, 0, NULL); |
| 744 | 748 | |
| 745 | return ls670_0[offset]; | |
| 749 | return state->ls670_0[offset]; | |
| 746 | 750 | } |
| 747 | 751 | |
| 748 | 752 | static TIMER_CALLBACK( deferred_ls670_0_w ) |
| 749 | 753 | { |
| 750 | int offset = (param>>8) & 255; | |
| 754 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 755 | int offset = (param >> 8) & 255; | |
| 751 | 756 | int data = param & 255; |
| 752 | 757 | |
| 753 | ls670_0[offset] = data; | |
| 758 | state->ls670_0[offset] = data; | |
| 754 | 759 | } |
| 755 | 760 | |
| 756 | 761 | static WRITE8_HANDLER( ls670_0_w ) |
| 757 | 762 | { |
| 758 | 763 | /* do this on a timer to let the CPUs synchronize */ |
| 759 | timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_0_w); | |
| 764 | timer_call_after_resynch(space->machine, NULL, (offset << 8) | data, deferred_ls670_0_w); | |
| 760 | 765 | } |
| 761 | 766 | |
| 762 | 767 | static READ8_HANDLER( ls670_1_r ) |
| 763 | 768 | { |
| 769 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 770 | ||
| 764 | 771 | /* set a timer to force synchronization after the read */ |
| 765 | 772 | timer_call_after_resynch(space->machine, NULL, 0, NULL); |
| 766 | 773 | |
| 767 | return ls670_1[offset]; | |
| 774 | return state->ls670_1[offset]; | |
| 768 | 775 | } |
| 769 | 776 | |
| 770 | 777 | static TIMER_CALLBACK( deferred_ls670_1_w ) |
| 771 | 778 | { |
| 772 | int offset = (param>>8) & 255; | |
| 779 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 780 | int offset = (param >> 8) & 255; | |
| 773 | 781 | int data = param & 255; |
| 774 | 782 | |
| 775 | ls670_1[offset] = data; | |
| 783 | state->ls670_1[offset] = data; | |
| 776 | 784 | } |
| 777 | 785 | |
| 778 | 786 | static WRITE8_HANDLER( ls670_1_w ) |
| 779 | 787 | { |
| 780 | 788 | /* do this on a timer to let the CPUs synchronize */ |
| 781 | timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_1_w); | |
| 789 | timer_call_after_resynch(space->machine, NULL, (offset << 8) | data, deferred_ls670_1_w); | |
| 782 | 790 | } |
| 783 | 791 | |
| 784 | 792 | |
| r7500 | r7501 | |
| 836 | 844 | |
| 837 | 845 | static WRITE8_HANDLER( zpu_bcd_decoder_w ) |
| 838 | 846 | { |
| 847 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 848 | ||
| 839 | 849 | /* bcd decoder used a input select (a mux) for reads from port 0x62 */ |
| 840 | bcd_7445 = data & 0xf; | |
| 850 | state->bcd_7445 = data & 0xf; | |
| 841 | 851 | } |
| 842 | 852 | |
| 843 | 853 | static READ8_HANDLER( zpu_inputs_r ) |
| 844 | 854 | { |
| 855 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 845 | 856 | static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y", |
| 846 | 857 | "STICK1_X", "STICK1_Y", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED" }; |
| 847 | 858 | |
| 848 | 859 | UINT8 ret = 0; |
| 849 | 860 | |
| 850 | ret = input_port_read(space->machine, strobenames[bcd_7445]); | |
| 861 | ret = input_port_read(space->machine, strobenames[state->bcd_7445]); | |
| 851 | 862 | |
| 852 | 863 | return ret; |
| 853 | 864 | } |
| r7500 | r7501 | |
| 856 | 867 | { |
| 857 | 868 | /* 0x6e - reset (offset = 0)*/ |
| 858 | 869 | /* 0x6f - set */ |
| 859 | set_led_status(space->machine, 0, offset& | |
| 870 | set_led_status(space->machine, 0, offset & | |
| 860 | 871 | } |
| 861 | 872 | |
| 862 | 873 | static WRITE8_HANDLER( zpu_lamps_w) |
| r7500 | r7501 | |
| 864 | 875 | /* bit 4 = /LAMP0 */ |
| 865 | 876 | /* bit 5 = /LAMP1 */ |
| 866 | 877 | |
| 867 | /*set_led_status(space->machine, 0, (data&0x10)>>4 );*/ | |
| 868 | /*set_led_status(space->machine, 1, (data&0x20)>>4 );*/ | |
| 878 | /*set_led_status(space->machine, 0, (data & 0x10) >> 4);*/ | |
| 879 | /*set_led_status(space->machine, 1, (data & 0x20) >> 4);*/ | |
| 869 | 880 | } |
| 870 | 881 | |
| 871 | 882 | static WRITE8_HANDLER( zpu_coin_counter_w ) |
| 872 | 883 | { |
| 873 | 884 | /* bit 6 = coin counter */ |
| 874 | coin_counter_w(space->machine, offset, (data | |
| 885 | coin_counter_w(space->machine, offset, BIT(data, | |
| 875 | 886 | } |
| 876 | 887 | |
| 877 | 888 | static WRITE8_HANDLER(cfb_led_w) |
| 878 | 889 | { |
| 879 | 890 | /* bit 7 - led on */ |
| 880 | set_led_status(space->machine, 2,(data | |
| 891 | set_led_status(space->machine, 2, BIT(data, | |
| 881 | 892 | } |
| 882 | 893 | |
| 883 | 894 | static WRITE8_DEVICE_HANDLER( gg_led_ctrl_w ) |
| 884 | 895 | { |
| 885 | 896 | /* bit 0, bit 1 - led on */ |
| 886 | set_led_status(device->machine,1,data | |
| 897 | set_led_status(device->machine, 1, BIT(data, 0) | |
| 887 | 898 | } |
| 888 | 899 | |
| 889 | 900 | |
| r7500 | r7501 | |
| 895 | 906 | |
| 896 | 907 | static WRITE8_HANDLER( vsb_ls273_audio_control_w ) |
| 897 | 908 | { |
| 898 | vsb_ls273 = data; | |
| 909 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 910 | state->vsb_ls273 = data; | |
| 899 | 911 | |
| 900 | 912 | /* bit 5 - led on */ |
| 901 | set_led_status(space->machine, 1,(data | |
| 913 | set_led_status(space->machine, 1, BIT(data, | |
| 902 | 914 | } |
| 903 | 915 | |
| 904 | 916 | static READ8_DEVICE_HANDLER( soundcommand_r ) |
| 905 | 917 | { |
| 906 | return soundlatch; | |
| 918 | mazerbla_state *state = (mazerbla_state *)device->machine->driver_data; | |
| 919 | return state->soundlatch; | |
| 907 | 920 | } |
| 908 | 921 | |
| 909 | 922 | static TIMER_CALLBACK( delayed_sound_w ) |
| 910 | 923 | { |
| 911 | soundlatch = param; | |
| 924 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 925 | state->soundlatch = param; | |
| 912 | 926 | |
| 913 | 927 | /* cause NMI on sound CPU */ |
| 914 | cpu | |
| 928 | cpu | |
| 915 | 929 | } |
| 916 | 930 | |
| 917 | 931 | static WRITE8_HANDLER( main_sound_w ) |
| r7500 | r7501 | |
| 921 | 935 | |
| 922 | 936 | static WRITE8_HANDLER( sound_int_clear_w ) |
| 923 | 937 | { |
| 924 | cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); | |
| 938 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 939 | cpu_set_input_line(state->subcpu, 0, CLEAR_LINE); | |
| 925 | 940 | } |
| 926 | 941 | |
| 927 | 942 | static WRITE8_HANDLER( sound_nmi_clear_w ) |
| 928 | 943 | { |
| 929 | cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE); | |
| 944 | mazerbla_state *state = (mazerbla_state *)space->machine->driver_data; | |
| 945 | cpu_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE); | |
| 930 | 946 | } |
| 931 | 947 | |
| 932 | 948 | |
| r7500 | r7501 | |
| 940 | 956 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 941 | 957 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("share1") |
| 942 | 958 | AM_RANGE(0xd800, 0xd800) AM_READ(cfb_zpu_int_req_clr) |
| 943 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE_ | |
| 959 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 944 | 960 | AM_RANGE(0xe800, 0xefff) AM_RAM |
| 945 | 961 | ADDRESS_MAP_END |
| 946 | 962 | |
| r7500 | r7501 | |
| 970 | 986 | AM_RANGE(0x0000, 0x37ff) AM_ROM |
| 971 | 987 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("share1") |
| 972 | 988 | AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1") /* GFX roms */ |
| 973 | AM_RANGE(0x4000, 0x4003) AM_WRITE(VCU_video_reg_w) | |
| 974 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&cfb_ram) /* Color Frame Buffer PCB, a.k.a. RAM for VCU commands and parameters */ | |
| 975 | AM_RANGE(0xa000, 0xa7ff) AM_READ(VCU_set_cmd_param_r) /* VCU command and parameters LOAD */ | |
| 976 | AM_RANGE(0xc000, 0xdfff) AM_READ(VCU_set_gfx_addr_r) /* gfx LOAD (blit) */ | |
| 977 | AM_RANGE(0xe000, 0xffff) AM_READ(VCU_set_clr_addr_r) /* palette? LOAD */ | |
| 989 | AM_RANGE(0x4000, 0x4003) AM_WRITE(vcu_video_reg_w) | |
| 990 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE_MEMBER(mazerbla_state, cfb_ram) /* Color Frame Buffer PCB, a.k.a. RAM for VCU commands and parameters */ | |
| 991 | AM_RANGE(0xa000, 0xa7ff) AM_READ(vcu_set_cmd_param_r) /* VCU command and parameters LOAD */ | |
| 992 | AM_RANGE(0xc000, 0xdfff) AM_READ(vcu_set_gfx_addr_r) /* gfx LOAD (blit) */ | |
| 993 | AM_RANGE(0xe000, 0xffff) AM_READ(vcu_set_clr_addr_r) /* palette? LOAD */ | |
| 978 | 994 | ADDRESS_MAP_END |
| 979 | 995 | |
| 980 | 996 | static ADDRESS_MAP_START( mazerbla_cpu3_io_map, ADDRESS_SPACE_IO, 8 ) |
| r7500 | r7501 | |
| 1367 | 1383 | note: |
| 1368 | 1384 | 1111 11110 (0xfe) - cannot happen and is not handled by game */ |
| 1369 | 1385 | |
| 1370 | return (zpu_int_vector & ~1); /* D0->GND is performed on CFB board */ | |
| 1386 | mazerbla_state *state = (mazerbla_state *)device->machine->driver_data; | |
| 1387 | return (state->zpu_int_vector & ~1); /* D0->GND is performed on CFB board */ | |
| 1371 | 1388 | } |
| 1372 | 1389 | |
| 1373 | 1390 | /* frequency is 14.318 MHz/16/16/16/16 */ |
| r7500 | r7501 | |
| 1383 | 1400 | * |
| 1384 | 1401 | *************************************/ |
| 1385 | 1402 | |
| 1386 | static MACHINE_ | |
| 1403 | static MACHINE_ | |
| 1387 | 1404 | { |
| 1388 | game_id = MAZERBLA; | |
| 1389 | zpu_int_vector = 0xff; | |
| 1390 | cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); | |
| 1405 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 1406 | ||
| 1407 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 1408 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 1409 | ||
| 1410 | state_save_register_global_array(machine, state->vcu_video_reg); | |
| 1411 | state_save_register_global(machine, state->vcu_gfx_addr); | |
| 1412 | state_save_register_global(machine, state->vcu_gfx_param_addr); | |
| 1413 | ||
| 1414 | state_save_register_global(machine, state->bknd_col); | |
| 1415 | state_save_register_global(machine, state->port02_status); | |
| 1416 | state_save_register_global(machine, state->vbank); | |
| 1417 | state_save_register_global(machine, state->xpos); | |
| 1418 | state_save_register_global(machine, state->ypos); | |
| 1419 | state_save_register_global(machine, state->pix_xsize); | |
| 1420 | state_save_register_global(machine, state->pix_ysize); | |
| 1421 | state_save_register_global(machine, state->color1); | |
| 1422 | state_save_register_global(machine, state->color2); | |
| 1423 | state_save_register_global(machine, state->mode); | |
| 1424 | state_save_register_global(machine, state->plane); | |
| 1425 | state_save_register_global_array(machine, state->lookup_ram); | |
| 1426 | state_save_register_global(machine, state->gfx_rom_bank); | |
| 1427 | ||
| 1428 | state_save_register_global_array(machine, state->ls670_0); | |
| 1429 | state_save_register_global_array(machine, state->ls670_1); | |
| 1430 | ||
| 1431 | state_save_register_global(machine, state->zpu_int_vector); | |
| 1432 | ||
| 1433 | state_save_register_global(machine, state->bcd_7445); | |
| 1434 | ||
| 1435 | state_save_register_global(machine, state->vsb_ls273); | |
| 1436 | state_save_register_global(machine, state->soundlatch); | |
| 1391 | 1437 | } |
| 1392 | 1438 | |
| 1393 | ||
| 1394 | static MACHINE_RESET( greatgun ) | |
| 1439 | static MACHINE_RESET( mazerbla ) | |
| 1395 | 1440 | { |
| 1396 | UINT8 *rom = memory_region(machine, "sub2"); | |
| 1397 | game_id = GREATGUN; | |
| 1398 | zpu_int_vector = 0xff; | |
| 1399 | cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); | |
| 1441 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 1442 | int i; | |
| 1400 | 1443 | |
| 1444 | state->zpu_int_vector = 0xff; | |
| 1401 | 1445 | |
| 1402 | // patch VCU test | |
| 1403 | // VCU test starts at PC=0x56f | |
| 1404 | rom[0x05b6] = 0; | |
| 1405 | rom[0x05b7] = 0; | |
| 1406 | // so we also need to patch ROM checksum test | |
| 1407 | rom[0x037f] = 0; | |
| 1408 | rom[0x0380] = 0; | |
| 1446 | state->bknd_col = 0xaa; | |
| 1447 | state->gfx_rom_bank = 0xff; | |
| 1448 | ||
| 1449 | state->vcu_gfx_addr = 0; | |
| 1450 | state->vcu_gfx_param_addr = 0; | |
| 1451 | state->port02_status = 0; | |
| 1452 | state->vbank = 0; | |
| 1453 | state->xpos = 0; | |
| 1454 | state->ypos = 0; | |
| 1455 | state->pix_xsize = 0; | |
| 1456 | state->pix_ysize = 0; | |
| 1457 | state->color1 = 0; | |
| 1458 | state->color2 = 0; | |
| 1459 | state->mode = 0; | |
| 1460 | state->plane = 0; | |
| 1461 | state->bcd_7445 = 0; | |
| 1462 | state->vsb_ls273 = 0; | |
| 1463 | state->soundlatch = 0; | |
| 1464 | ||
| 1465 | for (i = 0; i < 4; i++) | |
| 1466 | { | |
| 1467 | state->vcu_video_reg[i] = 0; | |
| 1468 | state->ls670_0[i] = 0; | |
| 1469 | state->ls670_1[i] = 0; | |
| 1470 | } | |
| 1471 | ||
| 1472 | memset(state->lookup_ram, 0, ARRAY_LENGTH(state->lookup_ram)); | |
| 1473 | ||
| 1474 | cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback); | |
| 1409 | 1475 | } |
| 1410 | 1476 | |
| 1477 | ||
| 1411 | 1478 | static MACHINE_DRIVER_START( mazerbla ) |
| 1479 | ||
| 1480 | /* driver data */ | |
| 1481 | MDRV_DRIVER_DATA(mazerbla_state) | |
| 1482 | ||
| 1412 | 1483 | /* basic machine hardware */ |
| 1413 | 1484 | MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK) /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */ |
| 1414 | 1485 | MDRV_CPU_PROGRAM_MAP(mazerbla_map) |
| r7500 | r7501 | |
| 1429 | 1500 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 1430 | 1501 | |
| 1431 | 1502 | /* synchronization forced on the fly */ |
| 1503 | MDRV_MACHINE_START(mazerbla) | |
| 1432 | 1504 | MDRV_MACHINE_RESET(mazerbla) |
| 1433 | 1505 | |
| 1434 | 1506 | /* video hardware */ |
| r7500 | r7501 | |
| 1451 | 1523 | |
| 1452 | 1524 | static MACHINE_DRIVER_START( greatgun ) |
| 1453 | 1525 | |
| 1526 | /* driver data */ | |
| 1527 | MDRV_DRIVER_DATA(mazerbla_state) | |
| 1528 | ||
| 1454 | 1529 | /* basic machine hardware */ |
| 1455 | 1530 | MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK) /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */ |
| 1456 | 1531 | MDRV_CPU_PROGRAM_MAP(mazerbla_map) |
| r7500 | r7501 | |
| 1469 | 1544 | */ |
| 1470 | 1545 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 1471 | 1546 | |
| 1472 | MDRV_MACHINE_RESET(greatgun) | |
| 1547 | MDRV_MACHINE_START(mazerbla) | |
| 1548 | MDRV_MACHINE_RESET(mazerbla) | |
| 1473 | 1549 | |
| 1474 | 1550 | /* video hardware */ |
| 1475 | 1551 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 1483 | 1559 | |
| 1484 | 1560 | MDRV_PALETTE_INIT(mazerbla) |
| 1485 | 1561 | MDRV_VIDEO_START(mazerbla) |
| 1486 | MDRV_VIDEO_UPDATE( | |
| 1562 | MDRV_VIDEO_UPDATE(mazerbla | |
| 1487 | 1563 | |
| 1488 | 1564 | /* sound hardware */ |
| 1489 | 1565 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r7500 | r7501 | |
| 1610 | 1686 | |
| 1611 | 1687 | static DRIVER_INIT( mazerbla ) |
| 1612 | 1688 | { |
| 1613 | bknd_col = 0xaa; | |
| 1614 | gfx_rom_bank = 0xff; | |
| 1689 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 1690 | state->game_id = MAZERBLA; | |
| 1615 | 1691 | } |
| 1616 | 1692 | |
| 1617 | GAME( 1983, mazerbla, 0, mazerbla, mazerbla, mazerbla, ROT0, "Stern", "Mazer Blazer (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1618 | GAME( 1983, mazerblaa,mazerbla, mazerbla, mazerbla, mazerbla, ROT0, "Stern", "Mazer Blazer (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1619 | GAME( 1983, greatgun, 0, greatgun, greatgun, mazerbla, ROT0, "Stern", "Great Guns", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) | |
| 1693 | static DRIVER_INIT( greatgun ) | |
| 1694 | { | |
| 1695 | mazerbla_state *state = (mazerbla_state *)machine->driver_data; | |
| 1696 | UINT8 *rom = memory_region(machine, "sub2"); | |
| 1697 | ||
| 1698 | state->game_id = GREATGUN; | |
| 1699 | ||
| 1700 | // patch VCU test | |
| 1701 | // VCU test starts at PC=0x56f | |
| 1702 | rom[0x05b6] = 0; | |
| 1703 | rom[0x05b7] = 0; | |
| 1704 | // so we also need to patch ROM checksum test | |
| 1705 | rom[0x037f] = 0; | |
| 1706 | rom[0x0380] = 0; | |
| 1707 | } | |
| 1708 | ||
| 1709 | GAME( 1983, mazerbla, 0, mazerbla, mazerbla, mazerbla, ROT0, "Stern", "Mazer Blazer (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 1710 | GAME( 1983, mazerblaa, mazerbla, mazerbla, mazerbla, mazerbla, ROT0, "Stern", "Mazer Blazer (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 1711 | GAME( 1983, greatgun, 0, greatgun, greatgun, greatgun, ROT0, "Stern", "Great Guns", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 36 | 36 | #include "cpu/m6809/m6809.h" |
| 37 | 37 | #include "sound/2203intf.h" |
| 38 | 38 | #include "sound/3526intf.h" |
| 39 | #include "includes/metlclsh.h" | |
| 39 | 40 | |
| 40 | /* Variables defined in video: */ | |
| 41 | 41 | |
| 42 | extern UINT8 *metlclsh_bgram, *metlclsh_fgram, *metlclsh_scrollx; | |
| 43 | ||
| 44 | /* Functions defined in video: */ | |
| 45 | ||
| 46 | WRITE8_HANDLER( metlclsh_bgram_w ); | |
| 47 | WRITE8_HANDLER( metlclsh_fgram_w ); | |
| 48 | WRITE8_HANDLER( metlclsh_gfxbank_w ); | |
| 49 | WRITE8_HANDLER( metlclsh_rambank_w ); | |
| 50 | ||
| 51 | VIDEO_START( metlclsh ); | |
| 52 | VIDEO_UPDATE( metlclsh ); | |
| 53 | ||
| 54 | 42 | /*************************************************************************** |
| 55 | 43 | |
| 56 | 44 | Memory Maps - CPU #1 |
| r7500 | r7501 | |
| 59 | 47 | |
| 60 | 48 | static WRITE8_HANDLER( metlclsh_cause_irq ) |
| 61 | 49 | { |
| 62 | cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, ASSERT_LINE); | |
| 50 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 51 | cpu_set_input_line(state->subcpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 63 | 52 | } |
| 64 | 53 | |
| 65 | 54 | static WRITE8_HANDLER( metlclsh_ack_nmi ) |
| 66 | 55 | { |
| 67 | cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); | |
| 56 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 57 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE); | |
| 68 | 58 | } |
| 69 | 59 | |
| 70 | 60 | static ADDRESS_MAP_START( metlclsh_master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r7500 | r7501 | |
| 81 | 71 | /**/AM_RANGE(0xc800, 0xc82f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE_GENERIC(paletteram) |
| 82 | 72 | /**/AM_RANGE(0xcc00, 0xcc2f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE_GENERIC(paletteram2) |
| 83 | 73 | AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE("ym1", ym2203_r,ym2203_w) |
| 84 | /**/AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(metlclsh_fgram_w) AM_BASE( | |
| 74 | /**/AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(metlclsh_fgram_w) AM_BASE_MEMBER( | |
| 85 | 75 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ym2", ym3526_w ) |
| 86 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_BASE_SIZE_ | |
| 76 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 87 | 77 | AM_RANGE(0xfff0, 0xffff) AM_ROM // Reset/IRQ vectors |
| 88 | 78 | ADDRESS_MAP_END |
| 89 | 79 | |
| r7500 | r7501 | |
| 96 | 86 | |
| 97 | 87 | static WRITE8_HANDLER( metlclsh_cause_nmi2 ) |
| 98 | 88 | { |
| 99 | cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); | |
| 89 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 90 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, ASSERT_LINE); | |
| 100 | 91 | } |
| 101 | 92 | |
| 102 | 93 | static WRITE8_HANDLER( metlclsh_ack_irq2 ) |
| 103 | 94 | { |
| 104 | cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, CLEAR_LINE); | |
| 95 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 96 | cpu_set_input_line(state->subcpu, M6809_IRQ_LINE, CLEAR_LINE); | |
| 105 | 97 | } |
| 106 | 98 | |
| 107 | 99 | static WRITE8_HANDLER( metlclsh_ack_nmi2 ) |
| 108 | 100 | { |
| 109 | cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE); | |
| 101 | metlclsh_state *state = (metlclsh_state *)space->machine->driver_data; | |
| 102 | cpu_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE); | |
| 110 | 103 | } |
| 111 | 104 | |
| 112 | 105 | static WRITE8_HANDLER( metlclsh_flipscreen_w ) |
| r7500 | r7501 | |
| 123 | 116 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW") |
| 124 | 117 | AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(metlclsh_cause_nmi2) // cause nmi on cpu #1 |
| 125 | 118 | AM_RANGE(0xc0c1, 0xc0c1) AM_WRITE(metlclsh_ack_irq2) // irq ack |
| 126 | AM_RANGE(0xd000, 0xd7ff) AM_ROMBANK("bank1") AM_WRITE(metlclsh_bgram_w) AM_BASE( | |
| 119 | AM_RANGE(0xd000, 0xd7ff) AM_ROMBANK("bank1") AM_WRITE(metlclsh_bgram_w) AM_BASE_MEMBER( | |
| 127 | 120 | AM_RANGE(0xe301, 0xe301) AM_WRITE(metlclsh_flipscreen_w) // 0/1 |
| 128 | 121 | AM_RANGE(0xe401, 0xe401) AM_WRITE(metlclsh_rambank_w) |
| 129 | AM_RANGE(0xe402, 0xe403) AM_WRITEONLY AM_BASE( | |
| 122 | AM_RANGE(0xe402, 0xe403) AM_WRITEONLY AM_BASE_MEMBER( | |
| 130 | 123 | // AM_RANGE(0xe404, 0xe404) AM_WRITENOP // ? 0 |
| 131 | 124 | // AM_RANGE(0xe410, 0xe410) AM_WRITENOP // ? 0 on startup only |
| 132 | 125 | AM_RANGE(0xe417, 0xe417) AM_WRITE(metlclsh_ack_nmi2) // nmi ack |
| r7500 | r7501 | |
| 167 | 160 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 168 | 161 | |
| 169 | 162 | PORT_START("IN1") /* c001 */ |
| 170 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) | |
| 171 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) | |
| 172 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 173 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 174 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 175 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 176 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) | |
| 177 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) | |
| 163 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) | |
| 164 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) | |
| 165 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 166 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 167 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 168 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 169 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) | |
| 170 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) | |
| 178 | 171 | |
| 179 | 172 | PORT_START("IN2") /* c002 */ |
| 180 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 181 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 182 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL | |
| 183 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL | |
| 184 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 185 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 173 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 174 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 175 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL | |
| 176 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL | |
| 177 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 178 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 186 | 179 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) |
| 187 | 180 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) |
| 188 | 181 | |
| r7500 | r7501 | |
| 262 | 255 | |
| 263 | 256 | static void metlclsh_irqhandler(running_device *device, int linestate) |
| 264 | 257 | { |
| 265 | cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, linestate); | |
| 258 | metlclsh_state *state = (metlclsh_state *)device->machine->driver_data; | |
| 259 | cpu_set_input_line(state->maincpu, M6809_IRQ_LINE, linestate); | |
| 266 | 260 | } |
| 267 | 261 | |
| 268 | 262 | static const ym3526_interface ym3526_config = |
| r7500 | r7501 | |
| 279 | 273 | cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE); |
| 280 | 274 | } |
| 281 | 275 | |
| 276 | static MACHINE_START( metlclsh ) | |
| 277 | { | |
| 278 | metlclsh_state *state = (metlclsh_state *)machine->driver_data; | |
| 279 | ||
| 280 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 281 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 282 | ||
| 283 | state_save_register_global(machine, state->write_mask); | |
| 284 | state_save_register_global(machine, state->gfxbank); | |
| 285 | } | |
| 286 | ||
| 282 | 287 | static MACHINE_RESET( metlclsh ) |
| 283 | 288 | { |
| 289 | metlclsh_state *state = (metlclsh_state *)machine->driver_data; | |
| 290 | ||
| 284 | 291 | flip_screen_set(machine, 0); |
| 292 | ||
| 293 | state->write_mask = 0; | |
| 294 | state->gfxbank = 0; | |
| 285 | 295 | } |
| 286 | 296 | |
| 287 | 297 | static MACHINE_DRIVER_START( metlclsh ) |
| 288 | 298 | |
| 299 | /* driver data */ | |
| 300 | MDRV_DRIVER_DATA(metlclsh_state) | |
| 301 | ||
| 289 | 302 | /* basic machine hardware */ |
| 290 | 303 | MDRV_CPU_ADD("maincpu", M6809, 1500000) // ? |
| 291 | 304 | MDRV_CPU_PROGRAM_MAP(metlclsh_master_map) |
| r7500 | r7501 | |
| 296 | 309 | MDRV_CPU_VBLANK_INT_HACK(metlclsh_interrupt2,2) |
| 297 | 310 | // IRQ by cpu #1, NMI by coins insertion |
| 298 | 311 | |
| 312 | MDRV_MACHINE_START(metlclsh) | |
| 299 | 313 | MDRV_MACHINE_RESET(metlclsh) |
| 300 | 314 | |
| 301 | 315 | /* video hardware */ |
| r7500 | r7501 | |
| 430 | 444 | ROM_LOAD( "82s123.prm", 0x0000, 0x20, CRC(6844cc88) SHA1(89d23367aa6ff541205416e82781fe938dfeeb52) ) |
| 431 | 445 | ROM_END |
| 432 | 446 | |
| 433 | GAME( 1985, metlclsh, 0, metlclsh, metlclsh, 0, ROT0, "Data East", "Metal Clash (Japan)", | |
| 447 | GAME( 1985, metlclsh, 0, metlclsh, metlclsh, 0, ROT0, "Data East", "Metal Clash (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 5837 | 5837 | ROM_END |
| 5838 | 5838 | |
| 5839 | 5839 | |
| 5840 | ROM_START( cmwm ) | |
| 5841 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5842 | ROM_LOAD( "waterm.rom", 0x0000, 0x1000, CRC(93b6cb9b) SHA1(294e1e5909b304252c79a7d3f50fc175558e713b) ) | |
| 5843 | ROM_CONTINUE(0x4000,0x1000) | |
| 5844 | ROM_CONTINUE(0x3000,0x1000) | |
| 5845 | ROM_CONTINUE(0x7000,0x1000) | |
| 5846 | ROM_CONTINUE(0x1000,0x1000) | |
| 5847 | ROM_CONTINUE(0x6000,0x1000) | |
| 5848 | ROM_CONTINUE(0x2000,0x1000) | |
| 5849 | ROM_CONTINUE(0x5000,0x1000) | |
| 5850 | ||
| 5851 | ROM_REGION( 0x18000, "gfx1", 0 ) | |
| 5852 | ROM_LOAD( "27256.u16", 0x00000, 0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) ) | |
| 5853 | ROM_LOAD( "27256.u11", 0x08000, 0x8000, CRC(63b3df4e) SHA1(9bacd23da598805ec18ec5ad15cab95d71eb9262) ) | |
| 5854 | ROM_LOAD( "27256.u4", 0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) ) | |
| 5855 | ||
| 5856 | ROM_REGION( 0x8000, "gfx2", 0 ) | |
| 5857 | ROM_LOAD( "2764.u15", 0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) | |
| 5858 | ROM_LOAD( "2764.u10", 0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) | |
| 5859 | ROM_LOAD( "2764.u14", 0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) | |
| 5860 | ROM_LOAD( "2764.u9", 0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) | |
| 5861 | ||
| 5862 | ROM_REGION( 0x10000, "user1", 0 ) // girl bitmaps | |
| 5863 | ROM_LOAD( "27512.u53", 0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) ) | |
| 5864 | ||
| 5865 | ROM_REGION( 0x200, "proms", 0 ) | |
| 5866 | ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) | |
| 5867 | ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) | |
| 5868 | ||
| 5869 | ROM_REGION( 0x100, "proms2", 0 ) | |
| 5870 | ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) ) | |
| 5871 | ROM_END | |
| 5872 | ||
| 5873 | ROM_START( cmfun ) | |
| 5874 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5875 | ROM_LOAD( "cmvfun.rom", 0x0000, 0x1000, CRC(128f373e) SHA1(24d51ab669d568c004e2c94cac22eb8476ce2718) ) | |
| 5876 | ROM_CONTINUE(0x4000,0x1000) | |
| 5877 | ROM_CONTINUE(0x3000,0x1000) | |
| 5878 | ROM_CONTINUE(0x7000,0x1000) | |
| 5879 | ROM_CONTINUE(0x1000,0x1000) | |
| 5880 | ROM_CONTINUE(0x6000,0x1000) | |
| 5881 | ROM_CONTINUE(0x2000,0x1000) | |
| 5882 | ROM_CONTINUE(0x5000,0x1000) | |
| 5883 | ||
| 5884 | ROM_REGION( 0x18000, "gfx1", 0 ) | |
| 5885 | ROM_LOAD( "27256.u16", 0x00000, 0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) ) | |
| 5886 | ROM_LOAD( "27256.u11", 0x08000, 0x8000, CRC(63b3df4e) SHA1(9bacd23da598805ec18ec5ad15cab95d71eb9262) ) | |
| 5887 | ROM_LOAD( "27256.u4", 0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) ) | |
| 5888 | ||
| 5889 | ROM_REGION( 0x8000, "gfx2", 0 ) | |
| 5890 | ROM_LOAD( "2764.u15", 0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) | |
| 5891 | ROM_LOAD( "2764.u10", 0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) | |
| 5892 | ROM_LOAD( "2764.u14", 0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) | |
| 5893 | ROM_LOAD( "2764.u9", 0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) | |
| 5894 | ||
| 5895 | ROM_REGION( 0x10000, "user1", 0 ) // girl bitmaps | |
| 5896 | ROM_LOAD( "27512.u53", 0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) ) | |
| 5897 | ||
| 5898 | ROM_REGION( 0x200, "proms", 0 ) | |
| 5899 | ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) | |
| 5900 | ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) | |
| 5901 | ||
| 5902 | ROM_REGION( 0x100, "proms2", 0 ) | |
| 5903 | ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) ) | |
| 5904 | ROM_END | |
| 5905 | ||
| 5840 | 5906 | /* looks like a bootleg of cmv4 */ |
| 5841 | 5907 | ROM_START( cmaster ) |
| 5842 | 5908 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| r7500 | r7501 | |
| 8665 | 8731 | // even original boards almost always run modified sets |
| 8666 | 8732 | GAME( 1992, cmv4, 0, cm, cmv4, cmv4, ROT0, "Dyna", "Cherry Master (ver.4, set 1)", 0 ) |
| 8667 | 8733 | GAME( 1992, cmv4a, cmv4, cm, cmv4, cmv4, ROT0, "Dyna", "Cherry Master (ver.4, set 2)", GAME_NOT_WORKING ) /* stealth game? */ |
| 8734 | GAME( 199?, cmwm, cmv4, cm, cmv4, cmv4, ROT0, "Dyna", "Cherry Master (Watermelon bootleg / hack)", 0 ) | |
| 8735 | GAME( 1995, cmfun, cmv4, cm, cmv4, cmv4, ROT0, "Dyna", "Cherry Master (Fun USA v2.5 bootleg / hack)", 0 ) | |
| 8668 | 8736 | GAME( 1991, cmaster, 0, cm, cmaster, 0, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 1)", 0 ) |
| 8669 | 8737 | GAME( 1991, cmasterb, cmaster, cm, cmasterb, cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 2)", 0 ) |
| 8670 | 8738 | GAME( 1991, cmasterc, cmaster, cmasterc, cmasterc, cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 3)", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 72 | 72 | #include "sound/dac.h" |
| 73 | 73 | |
| 74 | 74 | |
| 75 | #define MAIN_CPU_MASTER_CLOCK XTAL_11_2MHz | |
| 76 | #define PIXEL_CLOCK (MAIN_CPU_MASTER_CLOCK / 2) | |
| 77 | #define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16) | |
| 78 | #define AUDIO_1_MASTER_CLOCK XTAL_4MHz | |
| 79 | #define AUDIO_CPU_1_CLOCK AUDIO_1_MASTER_CLOCK | |
| 80 | #define AUDIO_2_MASTER_CLOCK XTAL_4MHz | |
| 81 | #define AUDIO_CPU_2_CLOCK AUDIO_2_MASTER_CLOCK | |
| 75 | 82 | |
| 76 | #define MAIN_CPU_MASTER_CLOCK (XTAL_11_2MHz) | |
| 77 | #define PIXEL_CLOCK (MAIN_CPU_MASTER_CLOCK / 2) | |
| 78 | #define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16) | |
| 79 | #define AUDIO_1_MASTER_CLOCK (XTAL_4MHz) | |
| 80 | #define AUDIO_CPU_1_CLOCK (AUDIO_1_MASTER_CLOCK) | |
| 81 | #define AUDIO_2_MASTER_CLOCK (XTAL_4MHz) | |
| 82 | #define AUDIO_CPU_2_CLOCK (AUDIO_2_MASTER_CLOCK) | |
| 83 | 83 | |
| 84 | class nyny_state | |
| 85 | { | |
| 86 | public: | |
| 87 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nyny_state(machine)); } | |
| 84 | 88 | |
| 85 | static UINT8 *nyny_videoram_1; | |
| 86 | static UINT8 *nyny_videoram_2; | |
| 87 | static UINT8 *nyny_colorram_1; | |
| 88 | static UINT8 *nyny_colorram_2; | |
| 89 | static UINT8 flipscreen; | |
| 89 | nyny_state(running_machine &machine) { } | |
| 90 | 90 | |
| 91 | static UINT8 star_enable; | |
| 92 | static UINT16 star_delay_counter; | |
| 93 | static UINT16 star_shift_reg; | |
| 91 | /* memory pointers */ | |
| 92 | UINT8 * videoram1; | |
| 93 | UINT8 * videoram2; | |
| 94 | UINT8 * colorram1; | |
| 95 | UINT8 * colorram2; | |
| 94 | 96 | |
| 97 | /* video-related */ | |
| 98 | int flipscreen; | |
| 99 | UINT8 star_enable; | |
| 100 | UINT16 star_delay_counter; | |
| 101 | UINT16 star_shift_reg; | |
| 95 | 102 | |
| 103 | /* devices */ | |
| 104 | running_device *maincpu; | |
| 105 | running_device *audiocpu; | |
| 106 | running_device *audiocpu2; | |
| 107 | running_device *ic48_1; | |
| 108 | running_device *mc6845; | |
| 109 | running_device *pia1; | |
| 110 | running_device *pia2; | |
| 111 | }; | |
| 96 | 112 | |
| 113 | ||
| 97 | 114 | /************************************* |
| 98 | 115 | * |
| 99 | 116 | * Prototypes |
| r7500 | r7501 | |
| 104 | 121 | static WRITE8_HANDLER( audio_2_command_w ); |
| 105 | 122 | |
| 106 | 123 | |
| 107 | ||
| 108 | 124 | /************************************* |
| 109 | 125 | * |
| 110 | 126 | * Interrupt generation |
| r7500 | r7501 | |
| 113 | 129 | |
| 114 | 130 | static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) |
| 115 | 131 | { |
| 116 | running_device *pia1 = devtag_get_device(device->machine, "pia1"); | |
| 117 | running_device *pia2 = devtag_get_device(device->machine, "pia2"); | |
| 118 | int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) | pia6821_get_irq_b(pia2); | |
| 132 | nyny_state *driver_state = (nyny_state *)device->machine->driver_data; | |
| 133 | int combined_state = pia6821_get_irq_a(driver_state->pia1) | pia6821_get_irq_b(driver_state->pia1) | pia6821_get_irq_b(driver_state->pia2); | |
| 119 | 134 | |
| 120 | cpu | |
| 135 | cpu | |
| 121 | 136 | } |
| 122 | 137 | |
| 123 | 138 | |
| 124 | 139 | static WRITE_LINE_DEVICE_HANDLER( main_cpu_firq ) |
| 125 | 140 | { |
| 126 | cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 141 | nyny_state *driver_state = (nyny_state *)device->machine->driver_data; | |
| 142 | cpu_set_input_line(driver_state->maincpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 127 | 143 | } |
| 128 | 144 | |
| 129 | 145 | |
| r7500 | r7501 | |
| 136 | 152 | |
| 137 | 153 | static INTERRUPT_GEN( update_pia_1 ) |
| 138 | 154 | { |
| 139 | running_device *pia1 = devtag_get_device(device->machine, "pia1"); | |
| 155 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 156 | ||
| 140 | 157 | /* update the different PIA pins from the input ports */ |
| 141 | 158 | |
| 142 | 159 | /* CA1 - copy of PA0 (COIN1) */ |
| 143 | pia6821_ca1_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x01); | |
| 160 | pia6821_ca1_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x01); | |
| 144 | 161 | |
| 145 | 162 | /* CA2 - copy of PA1 (SERVICE1) */ |
| 146 | pia6821_ca2_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x02); | |
| 163 | pia6821_ca2_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x02); | |
| 147 | 164 | |
| 148 | 165 | /* CB1 - (crosshatch) */ |
| 149 | pia6821_cb1_w(pia1, 0, input_port_read(device->machine, "CROSS")); | |
| 166 | pia6821_cb1_w(state->pia1, 0, input_port_read(device->machine, "CROSS")); | |
| 150 | 167 | |
| 151 | 168 | /* CB2 - NOT CONNECTED */ |
| 152 | 169 | } |
| r7500 | r7501 | |
| 178 | 195 | |
| 179 | 196 | static WRITE8_DEVICE_HANDLER( pia_2_port_a_w ) |
| 180 | 197 | { |
| 181 | star_delay_counter = (star_delay_counter & 0x0f00) | data; | |
| 198 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 199 | state->star_delay_counter = (state->star_delay_counter & 0x0f00) | data; | |
| 182 | 200 | } |
| 183 | 201 | |
| 184 | 202 | |
| 185 | 203 | static WRITE8_DEVICE_HANDLER( pia_2_port_b_w ) |
| 186 | 204 | { |
| 205 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 206 | ||
| 187 | 207 | /* bits 0-3 go to bits 8-11 of the star delay counter */ |
| 188 | star_delay_counter = (star_delay_counter & 0x00ff) | ((data & 0x0f) << 8); | |
| 208 | state->star_delay_counter = (state->star_delay_counter & 0x00ff) | ((data & 0x0f) << 8); | |
| 189 | 209 | |
| 190 | 210 | /* bit 4 is star field enable */ |
| 191 | star_enable = data & 0x10; | |
| 211 | state->star_enable = data & 0x10; | |
| 192 | 212 | |
| 193 | 213 | /* bits 5-7 go to the music board connector */ |
| 194 | audio_2_command_w(cpu | |
| 214 | audio_2_command_w(cpu | |
| 195 | 215 | } |
| 196 | 216 | |
| 197 | 217 | |
| r7500 | r7501 | |
| 225 | 245 | * |
| 226 | 246 | *************************************/ |
| 227 | 247 | |
| 228 | static WRITE8_DEVICE_HANDLER(ic48_1_74123_output_changed) | |
| 248 | static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed ) | |
| 229 | 249 | { |
| 230 | running_device *pia2 = devtag_get_device(device->machine, "pia2"); | |
| 231 | pia6821_ca1_w(pia2, 0, data); | |
| 250 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 251 | pia6821_ca1_w(state->pia2, 0, data); | |
| 232 | 252 | } |
| 233 | 253 | |
| 234 | 254 | |
| r7500 | r7501 | |
| 247 | 267 | |
| 248 | 268 | /************************************* |
| 249 | 269 | * |
| 250 | * Machine start | |
| 251 | * | |
| 252 | *************************************/ | |
| 253 | ||
| 254 | static MACHINE_START( nyny ) | |
| 255 | { | |
| 256 | /* setup for save states */ | |
| 257 | state_save_register_global(machine, flipscreen); | |
| 258 | state_save_register_global(machine, star_enable); | |
| 259 | state_save_register_global(machine, star_delay_counter); | |
| 260 | state_save_register_global(machine, star_shift_reg); | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 264 | ||
| 265 | /************************************* | |
| 266 | * | |
| 267 | 270 | * Video system |
| 268 | 271 | * |
| 269 | 272 | *************************************/ |
| 270 | 273 | |
| 271 | #define NUM_PENS | |
| 274 | #define NUM_PENS 8 | |
| 272 | 275 | |
| 273 | 276 | |
| 274 | 277 | static WRITE_LINE_DEVICE_HANDLER( flipscreen_w ) |
| 275 | 278 | { |
| 276 | flipscreen = state ? 0 : 1; | |
| 279 | nyny_state *driver_state = (nyny_state *)device->machine->driver_data; | |
| 280 | driver_state->flipscreen = state ? 0 : 1; | |
| 277 | 281 | } |
| 278 | 282 | |
| 279 | 283 | |
| r7500 | r7501 | |
| 294 | 298 | |
| 295 | 299 | static MC6845_UPDATE_ROW( update_row ) |
| 296 | 300 | { |
| 301 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 297 | 302 | UINT8 cx; |
| 298 | ||
| 299 | 303 | pen_t *pens = (pen_t *)param; |
| 300 | 304 | UINT8 x = 0; |
| 301 | 305 | |
| r7500 | r7501 | |
| 310 | 314 | ((ra << 5) & 0x00e0) | |
| 311 | 315 | ((ma << 0) & 0x001f); |
| 312 | 316 | |
| 313 | if (flipscreen) | |
| 317 | if (state->flipscreen) | |
| 314 | 318 | offs = offs ^ 0x9fff; |
| 315 | 319 | |
| 316 | data1 = nyny_videoram_1[offs]; | |
| 317 | data2 = nyny_videoram_2[offs]; | |
| 318 | color1 = nyny_colorram_1[offs] & 0x07; | |
| 319 | color2 = nyny_colorram_2[offs] & 0x07; | |
| 320 | data1 = state->videoram1[offs]; | |
| 321 | data2 = state->videoram2[offs]; | |
| 322 | color1 = state->colorram1[offs] & 0x07; | |
| 323 | color2 = state->colorram2[offs] & 0x07; | |
| 320 | 324 | |
| 321 | 325 | for (i = 0; i < 8; i++) |
| 322 | 326 | { |
| 323 | 327 | UINT8 bit1, bit2, color; |
| 324 | 328 | |
| 325 | if (flipscreen) | |
| 329 | if (state->flipscreen) | |
| 326 | 330 | { |
| 327 | bit1 = data1 & 0x80; | |
| 328 | bit2 = data2 & 0x80; | |
| 331 | bit1 = BIT(data1, 7); | |
| 332 | bit2 = BIT(data2, 7); | |
| 329 | 333 | |
| 330 | 334 | data1 = data1 << 1; |
| 331 | 335 | data2 = data2 << 1; |
| 332 | 336 | } |
| 333 | 337 | else |
| 334 | 338 | { |
| 335 | bit1 = data1 & 0x01; | |
| 336 | bit2 = data2 & 0x01; | |
| 339 | bit1 = BIT(data1, 0); | |
| 340 | bit2 = BIT(data2, 0); | |
| 337 | 341 | |
| 338 | 342 | data1 = data1 >> 1; |
| 339 | 343 | data2 = data2 >> 1; |
| r7500 | r7501 | |
| 347 | 351 | |
| 348 | 352 | *BITMAP_ADDR32(bitmap, y, x) = pens[color]; |
| 349 | 353 | |
| 350 | x | |
| 354 | x | |
| 351 | 355 | } |
| 352 | 356 | |
| 353 | ma | |
| 357 | ma | |
| 354 | 358 | } |
| 355 | 359 | } |
| 356 | 360 | |
| 357 | 361 | |
| 358 | INLINE void shift_star_generator( | |
| 362 | INLINE void shift_star_generator( running_machine *machine ) | |
| 359 | 363 | { |
| 360 | star_shift_reg = (star_shift_reg << 1) | (((~star_shift_reg >> 15) & 0x01) ^ ((star_shift_reg >> 2) & 0x01)); | |
| 364 | nyny_state *state = (nyny_state *)machine->driver_data; | |
| 365 | state->star_shift_reg = (state->star_shift_reg << 1) | (((~state->star_shift_reg >> 15) & 0x01) ^ ((state->star_shift_reg >> 2) & 0x01)); | |
| 361 | 366 | } |
| 362 | 367 | |
| 363 | 368 | |
| 364 | 369 | static MC6845_END_UPDATE( end_update ) |
| 365 | 370 | { |
| 371 | nyny_state *state = (nyny_state *)device->machine->driver_data; | |
| 372 | ||
| 366 | 373 | /* draw the star field into the bitmap */ |
| 367 | 374 | int y; |
| 368 | 375 | |
| 369 | 376 | pen_t *pens = (pen_t *)param; |
| 370 | UINT16 delay_counter = star_delay_counter; | |
| 377 | UINT16 delay_counter = state->star_delay_counter; | |
| 371 | 378 | |
| 372 | 379 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 373 | 380 | { |
| r7500 | r7501 | |
| 376 | 383 | for (x = cliprect->min_x; x <= cliprect->max_x; x++) |
| 377 | 384 | { |
| 378 | 385 | /* check if the star status */ |
| 379 | if (star_enable && | |
| 386 | if (state->star_enable && | |
| 380 | 387 | (*BITMAP_ADDR32(bitmap, y, x) == 0) && |
| 381 | ((star_shift_reg & 0x80ff) == 0x00ff) && | |
| 382 | (((y & 0x01) ^ flipscreen) ^ (((x & 0x08) >> 3) ^ flipscreen))) | |
| 388 | ((state->star_shift_reg & 0x80ff) == 0x00ff) && | |
| 389 | (((y & 0x01) ^ state->flipscreen) ^ (((x & 0x08) >> 3) ^ state->flipscreen))) | |
| 383 | 390 | { |
| 384 | UINT8 color = ((star_shift_reg & 0x0100) >> 8) | /* R */ | |
| 385 | ((star_shift_reg & 0x0400) >> 9) | /* G */ | |
| 386 | ((star_shift_reg & 0x1000) >> 10); /* B */ | |
| 391 | UINT8 color = ((state->star_shift_reg & 0x0100) >> 8) | /* R */ | |
| 392 | ((state->star_shift_reg & 0x0400) >> 9) | /* G */ | |
| 393 | ((state->star_shift_reg & 0x1000) >> 10); /* B */ | |
| 387 | 394 | |
| 388 | 395 | *BITMAP_ADDR32(bitmap, y, x) = pens[color]; |
| 389 | 396 | } |
| 390 | 397 | |
| 391 | 398 | if (delay_counter == 0) |
| 392 | shift_star_generator(); | |
| 399 | shift_star_generator(device->machine); | |
| 393 | 400 | else |
| 394 | 401 | delay_counter = delay_counter - 1; |
| 395 | 402 | } |
| r7500 | r7501 | |
| 399 | 406 | |
| 400 | 407 | static WRITE_LINE_DEVICE_HANDLER( display_enable_changed ) |
| 401 | 408 | { |
| 402 | ttl74123_a_w(devtag_get_device(device->machine, "ic48_1"), 0, state); | |
| 409 | nyny_state *driver_state = (nyny_state *)device->machine->driver_data; | |
| 410 | ttl74123_a_w(driver_state->ic48_1, 0, state); | |
| 403 | 411 | } |
| 404 | 412 | |
| 405 | 413 | |
| r7500 | r7501 | |
| 420 | 428 | |
| 421 | 429 | static VIDEO_UPDATE( nyny ) |
| 422 | 430 | { |
| 423 | running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); | |
| 424 | mc6845_update(mc6845, bitmap, cliprect); | |
| 431 | nyny_state *state = (nyny_state *)screen->machine->driver_data; | |
| 425 | 432 | |
| 433 | mc6845_update(state->mc6845, bitmap, cliprect); | |
| 434 | ||
| 426 | 435 | return 0; |
| 427 | 436 | } |
| 428 | 437 | |
| r7500 | r7501 | |
| 436 | 445 | |
| 437 | 446 | static WRITE8_HANDLER( audio_1_command_w ) |
| 438 | 447 | { |
| 448 | nyny_state *state = (nyny_state *)space->machine->driver_data; | |
| 449 | ||
| 439 | 450 | soundlatch_w(space, 0, data); |
| 440 | cpu | |
| 451 | cpu | |
| 441 | 452 | } |
| 442 | 453 | |
| 443 | 454 | |
| 444 | 455 | static WRITE8_HANDLER( audio_1_answer_w ) |
| 445 | 456 | { |
| 457 | nyny_state *state = (nyny_state *)space->machine->driver_data; | |
| 458 | ||
| 446 | 459 | soundlatch3_w(space, 0, data); |
| 447 | cpu | |
| 460 | cpu | |
| 448 | 461 | } |
| 449 | 462 | |
| 450 | 463 | |
| r7500 | r7501 | |
| 487 | 500 | |
| 488 | 501 | static WRITE8_HANDLER( audio_2_command_w ) |
| 489 | 502 | { |
| 503 | nyny_state *state = (nyny_state *)space->machine->driver_data; | |
| 504 | ||
| 490 | 505 | soundlatch2_w(space, 0, (data & 0x60) >> 5); |
| 491 | cpu | |
| 506 | cpu | |
| 492 | 507 | } |
| 493 | 508 | |
| 494 | 509 | |
| r7500 | r7501 | |
| 501 | 516 | |
| 502 | 517 | static READ8_HANDLER( nyny_pia_1_2_r ) |
| 503 | 518 | { |
| 504 | running_device *pia1 = devtag_get_device(space->machine, "pia1"); | |
| 505 | running_device *pia2 = devtag_get_device(space->machine, "pia2"); | |
| 519 | nyny_state *state = (nyny_state *)space->machine->driver_data; | |
| 506 | 520 | UINT8 ret = 0; |
| 507 | 521 | |
| 508 | 522 | /* the address bits are directly connected to the chip selects */ |
| 509 | if (offset & 0x04) ret = pia6821_r(pia1, offset & 0x03); | |
| 510 | if (offset & 0x08) ret = pia6821_alt_r(pia2, offset & 0x03); | |
| 523 | if (BIT(offset, 2)) ret = pia6821_r(state->pia1, offset & 0x03); | |
| 524 | if (BIT(offset, 3)) ret = pia6821_alt_r(state->pia2, offset & 0x03); | |
| 511 | 525 | |
| 512 | 526 | return ret; |
| 513 | 527 | } |
| r7500 | r7501 | |
| 515 | 529 | |
| 516 | 530 | static WRITE8_HANDLER( nyny_pia_1_2_w ) |
| 517 | 531 | { |
| 518 | running_device *pia1 = devtag_get_device(space->machine, "pia1"); | |
| 519 | running_device *pia2 = devtag_get_device(space->machine, "pia2"); | |
| 532 | nyny_state *state = (nyny_state *)space->machine->driver_data; | |
| 520 | 533 | |
| 521 | 534 | /* the address bits are directly connected to the chip selects */ |
| 522 | if (offset & 0x04) pia6821_w(pia1, offset & 0x03, data); | |
| 523 | if (offset & 0x08) pia6821_alt_w(pia2, offset & 0x03, data); | |
| 535 | if (BIT(offset, 2)) pia6821_w(state->pia1, offset & 0x03, data); | |
| 536 | if (BIT(offset, 3)) pia6821_alt_w(state->pia2, offset & 0x03, data); | |
| 524 | 537 | } |
| 525 | 538 | |
| 526 | 539 | |
| 527 | 540 | static ADDRESS_MAP_START( nyny_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 528 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&nyny_videoram_1) | |
| 529 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE(&nyny_colorram_1) | |
| 530 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&nyny_videoram_2) | |
| 531 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(&nyny_colorram_2) | |
| 541 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE_MEMBER(nyny_state, videoram1) | |
| 542 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE_MEMBER(nyny_state, colorram1) | |
| 543 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE_MEMBER(nyny_state, videoram2) | |
| 544 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE_MEMBER(nyny_state, colorram2) | |
| 532 | 545 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 533 | 546 | AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) /* SRAM (coin counter, shown when holding F2) */ |
| 534 | 547 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_DEVWRITE("crtc", mc6845_address_w) |
| r7500 | r7501 | |
| 587 | 600 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* PIA0 PA4 */ |
| 588 | 601 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) /* PIA0 PA5 */ |
| 589 | 602 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) /* PIA0 PA6 */ |
| 590 | ||
| 603 | | |
| 591 | 604 | |
| 592 | 605 | PORT_START("IN1") |
| 593 | 606 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL /* PIA0 PB0 */ |
| 594 | 607 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL /* PIA0 PB1 */ |
| 595 | 608 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY /* PIA0 PB2 */ |
| 596 | 609 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY /* PIA0 PB3 */ |
| 597 | ||
| 610 | | |
| 598 | 611 | |
| 599 | PORT_START("SW1") | |
| 612 | PORT_START("SW1") | |
| 600 | 613 | PORT_DIPNAME( 0x03, 0x03, "Bombs from UFO (Screens 3+)" ) PORT_DIPLOCATION("SW1:1,2") |
| 601 | 614 | PORT_DIPSETTING( 0x01, "3" ) |
| 602 | 615 | PORT_DIPSETTING( 0x00, "6" ) |
| r7500 | r7501 | |
| 609 | 622 | PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) |
| 610 | 623 | PORT_DIPSETTING( 0x80, DEF_STR( High ) ) |
| 611 | 624 | |
| 612 | PORT_START("SW2") | |
| 625 | PORT_START("SW2") | |
| 613 | 626 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2") |
| 614 | 627 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 615 | 628 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| r7500 | r7501 | |
| 627 | 640 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 628 | 641 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 629 | 642 | |
| 630 | PORT_START("SW3") | |
| 643 | PORT_START("SW3") | |
| 631 | 644 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:1") |
| 632 | 645 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 633 | 646 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| r7500 | r7501 | |
| 651 | 664 | PORT_DIPSETTING( 0x40, "+2" ) |
| 652 | 665 | PORT_DIPSETTING( 0x20, "+3" ) |
| 653 | 666 | |
| 654 | PORT_START("CROSS") /* connected to PIA1 CB1 input */ | |
| 655 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("PS1 (Crosshatch)") PORT_CODE(KEYCODE_F1) | |
| 667 | PORT_START("CROSS") /* connected to PIA1 CB1 input */ | |
| 668 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("PS1 (Crosshatch)") PORT_CODE(KEYCODE_F1) | |
| 656 | 669 | |
| 657 | 670 | INPUT_PORTS_END |
| 658 | 671 | |
| r7500 | r7501 | |
| 660 | 673 | |
| 661 | 674 | /************************************* |
| 662 | 675 | * |
| 676 | * Machine start & reset | |
| 677 | * | |
| 678 | *************************************/ | |
| 679 | ||
| 680 | static MACHINE_START( nyny ) | |
| 681 | { | |
| 682 | nyny_state *state = (nyny_state *)machine->driver_data; | |
| 683 | ||
| 684 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 685 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 686 | state->audiocpu2 = devtag_get_device(machine, "audio2"); | |
| 687 | state->ic48_1 = devtag_get_device(machine, "ic48_1"); | |
| 688 | state->mc6845 = devtag_get_device(machine, "crtc"); | |
| 689 | state->pia1 = devtag_get_device(machine, "pia1"); | |
| 690 | state->pia2 = devtag_get_device(machine, "pia2"); | |
| 691 | ||
| 692 | /* setup for save states */ | |
| 693 | state_save_register_global(machine, state->flipscreen); | |
| 694 | state_save_register_global(machine, state->star_enable); | |
| 695 | state_save_register_global(machine, state->star_delay_counter); | |
| 696 | state_save_register_global(machine, state->star_shift_reg); | |
| 697 | } | |
| 698 | ||
| 699 | static MACHINE_RESET( nyny ) | |
| 700 | { | |
| 701 | nyny_state *state = (nyny_state *)machine->driver_data; | |
| 702 | ||
| 703 | state->flipscreen = 0; | |
| 704 | state->star_enable = 0; | |
| 705 | state->star_delay_counter = 0; | |
| 706 | state->star_shift_reg = 0; | |
| 707 | } | |
| 708 | ||
| 709 | /************************************* | |
| 710 | * | |
| 663 | 711 | * Machine driver |
| 664 | 712 | * |
| 665 | 713 | *************************************/ |
| 666 | 714 | |
| 667 | 715 | static MACHINE_DRIVER_START( nyny ) |
| 668 | 716 | |
| 717 | /* driver data */ | |
| 718 | MDRV_DRIVER_DATA(nyny_state) | |
| 719 | ||
| 669 | 720 | /* basic machine hardware */ |
| 670 | 721 | MDRV_CPU_ADD("maincpu", M6809, 1400000) /* 1.40 MHz? The clock signal is generated by analog chips */ |
| 671 | 722 | MDRV_CPU_PROGRAM_MAP(nyny_main_map) |
| r7500 | r7501 | |
| 678 | 729 | MDRV_CPU_PROGRAM_MAP(nyny_audio_2_map) |
| 679 | 730 | |
| 680 | 731 | MDRV_MACHINE_START(nyny) |
| 732 | MDRV_MACHINE_RESET(nyny) | |
| 681 | 733 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 682 | 734 | |
| 683 | 735 | /* video hardware */ |
| r0 | r7501 | |
|---|---|---|
| 1 | /******************************************************************************************* | |
| 2 | ||
| 3 | Uncle Poo (c) 1983 Diatec | |
| 4 | ||
| 5 | actually an hack of Joinem? Or there's something even more similar? | |
| 6 | ||
| 7 | driver by David Haywood and Angelo Salese | |
| 8 | ||
| 9 | TODO: | |
| 10 | -merge with jack.c driver, this is a modification of that HW (with colscroll) | |
| 11 | -accurate game speed (controlled by an irq) | |
| 12 | -title screen colors are wrong? But I can't see how I could fix it without breaking anything | |
| 13 | else | |
| 14 | -a bunch of unmapped read / writes | |
| 15 | -writes to ROM regions | |
| 16 | ||
| 17 | *******************************************************************************************/ | |
| 18 | ||
| 19 | /* Stephh's Notes: | |
| 20 | ||
| 21 | 'unclepoo' | |
| 22 | ||
| 23 | SYSTEM bit 7 is sort of "freeze", but it doesn't seem to have any effect when playing | |
| 24 | (only during boot up sequence - unsure about attract mode) | |
| 25 | ||
| 26 | DSW1 bit 5 is "Bonus Lives" : | |
| 27 | - when Off (0x00), you get an extra life EVERY 30000 points | |
| 28 | - When On (0x20), you get an extra life at 30000 points ONLY | |
| 29 | ||
| 30 | DSW1 bits 6 and 7 might be used for difficulty (to be confirmed) | |
| 31 | ||
| 32 | DSW2 bit 0 is the "Cabinet" Dip Switch : | |
| 33 | - when Off (0x00), cabinet is cocktail | |
| 34 | - When On (0x01), cabinet is upright | |
| 35 | This affects write to 0xb700 (bit 7) and reads from 0xb506 and 0xb507 ... | |
| 36 | BTW, remove PORT_PLAYER(1) and change PORT_PLAYER(2) to PORT_COCKTAIL ... | |
| 37 | ||
| 38 | DSW2 bit 7 overwrites the number of lives : | |
| 39 | - When Off (0x00), lives are based on DSW1 bit 4 | |
| 40 | - When On (0x80), lives are set to 255 (0xff) but they are NOT infinite | |
| 41 | ||
| 42 | Other bits from DSW2 (but bit 5) don't seem to be read / tested at all ... | |
| 43 | */ | |
| 44 | ||
| 45 | ||
| 46 | #include "emu.h" | |
| 47 | #include "cpu/z80/z80.h" | |
| 48 | #include "sound/ay8910.h" | |
| 49 | ||
| 50 | static UINT8 *poo_vram, *poo_scrolly, *poo_sprites; | |
| 51 | ||
| 52 | VIDEO_START(unclepoo) | |
| 53 | { | |
| 54 | ||
| 55 | } | |
| 56 | ||
| 57 | VIDEO_UPDATE(unclepoo) | |
| 58 | { | |
| 59 | int y,x; | |
| 60 | int count; | |
| 61 | const gfx_element *gfx = screen->machine->gfx[0]; | |
| 62 | ||
| 63 | count = 0; | |
| 64 | ||
| 65 | for (x=0;x<32;x++) | |
| 66 | { | |
| 67 | for (y=0;y<32;y++) | |
| 68 | { | |
| 69 | int tile = poo_vram[count+0x000] | ((poo_vram[count+0x400] & 3) <<8); | |
| 70 | int color = (poo_vram[count+0x400] & 0xf8) >> 3; | |
| 71 | int scrolly = (poo_scrolly[x*4]); | |
| 72 | ||
| 73 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*8,256-(y*8)+scrolly); | |
| 74 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*8,0-(y*8)+scrolly); | |
| 75 | ||
| 76 | count++; | |
| 77 | } | |
| 78 | } | |
| 79 | ||
| 80 | { | |
| 81 | int spr_offs,x,y,col,fx,fy,i; | |
| 82 | ||
| 83 | for(i=0;i<0x80;i+=4) | |
| 84 | { | |
| 85 | spr_offs = poo_sprites[i+2] | (poo_sprites[i+3] & 3) << 8; | |
| 86 | y = poo_sprites[i+0]+8; | |
| 87 | x = poo_sprites[i+1]; | |
| 88 | col = (poo_sprites[i+3] & 0xf8) >> 3; | |
| 89 | fx = 0; | |
| 90 | fy = 0; | |
| 91 | ||
| 92 | drawgfx_transpen(bitmap,cliprect,gfx,spr_offs,col,fx,fy,x,y,0); | |
| 93 | } | |
| 94 | } | |
| 95 | ||
| 96 | return 0; | |
| 97 | } | |
| 98 | ||
| 99 | static READ8_HANDLER( unk_inp_r ) | |
| 100 | { | |
| 101 | return 0x00;//mame_rand(space->machine); | |
| 102 | } | |
| 103 | ||
| 104 | #if 0 | |
| 105 | ||
| 106 | static READ8_HANDLER( unk_inp2_r ) | |
| 107 | { | |
| 108 | return 0xff; | |
| 109 | } | |
| 110 | ||
| 111 | static READ8_HANDLER( unk_inp3_r ) | |
| 112 | { | |
| 113 | return mame_rand(space->machine); | |
| 114 | } | |
| 115 | #endif | |
| 116 | ||
| 117 | ||
| 118 | static WRITE8_HANDLER( unk_w ) | |
| 119 | { | |
| 120 | ||
| 121 | } | |
| 122 | ||
| 123 | /* soundlatch write */ | |
| 124 | static WRITE8_HANDLER( test_w ) | |
| 125 | { | |
| 126 | soundlatch_w(space, 0, (data & 0xff)); | |
| 127 | cputag_set_input_line(space->machine, "subcpu", 0, HOLD_LINE); | |
| 128 | } | |
| 129 | ||
| 130 | static WRITE8_HANDLER( test2_w ) | |
| 131 | { | |
| 132 | //x[1] = data; | |
| 133 | //soundlatch2_w(space, 0, (data & 0xff)); | |
| 134 | //cputag_set_input_line(space->machine, "subcpu", 0, HOLD_LINE); | |
| 135 | } | |
| 136 | ||
| 137 | static ADDRESS_MAP_START( unclepoo_main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 138 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 139 | AM_RANGE(0x8000, 0x8fff) AM_RAM | |
| 140 | AM_RANGE(0x9000, 0x97ff) AM_RAM | |
| 141 | AM_RANGE(0xb000, 0xb07f) AM_RAM AM_BASE(&poo_sprites) | |
| 142 | AM_RANGE(0xb080, 0xb0ff) AM_RAM AM_BASE(&poo_scrolly) | |
| 143 | ||
| 144 | AM_RANGE(0x9800, 0x9801) AM_READ(unk_inp_r) AM_WRITE( unk_w ) | |
| 145 | ||
| 146 | AM_RANGE(0xb400, 0xb400) AM_WRITE(test_w) | |
| 147 | ||
| 148 | AM_RANGE(0xb500, 0xb500) AM_READ_PORT("DSW1") | |
| 149 | AM_RANGE(0xb501, 0xb501) AM_READ_PORT("DSW2") | |
| 150 | AM_RANGE(0xb502, 0xb502) AM_READ_PORT("P1") | |
| 151 | AM_RANGE(0xb503, 0xb503) AM_READ_PORT("P2") | |
| 152 | AM_RANGE(0xb504, 0xb504) AM_READ_PORT("SYSTEM") | |
| 153 | ||
| 154 | AM_RANGE(0xb700, 0xb700) AM_WRITE(test2_w) | |
| 155 | ||
| 156 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&poo_vram) | |
| 157 | ||
| 158 | ADDRESS_MAP_END | |
| 159 | ||
| 160 | static ADDRESS_MAP_START( unclepoo_main_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 161 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 162 | ||
| 163 | ADDRESS_MAP_END | |
| 164 | ||
| 165 | #if 0 | |
| 166 | static WRITE8_HANDLER( mem_w ) | |
| 167 | { | |
| 168 | ||
| 169 | } | |
| 170 | #endif | |
| 171 | ||
| 172 | static ADDRESS_MAP_START( unclepoo_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 173 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 174 | ||
| 175 | AM_RANGE(0x4000, 0x43ff) AM_RAM | |
| 176 | ||
| 177 | AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* R/C filter ??? */ | |
| 178 | ADDRESS_MAP_END | |
| 179 | ||
| 180 | ||
| 181 | ||
| 182 | static ADDRESS_MAP_START( unclepoo_sub_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 183 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 184 | ||
| 185 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w) | |
| 186 | AM_RANGE(0x80, 0x80) AM_DEVWRITE("ay", ay8910_address_w) | |
| 187 | ADDRESS_MAP_END | |
| 188 | ||
| 189 | ||
| 190 | static INPUT_PORTS_START( unclepoo ) | |
| 191 | PORT_START("P1") | |
| 192 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 193 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 194 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 195 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 196 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 197 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 198 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 199 | ||
| 200 | PORT_START("P2") | |
| 201 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) | |
| 202 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) | |
| 203 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) | |
| 204 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) | |
| 205 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 206 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 207 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 208 | ||
| 209 | PORT_START("SYSTEM") | |
| 210 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 211 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 212 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 213 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 214 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) | |
| 215 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 216 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 217 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) | |
| 218 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 219 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 220 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 221 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 222 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 223 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 224 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 225 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 226 | ||
| 227 | PORT_START("DSW1") | |
| 228 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 229 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 230 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_3C ) ) | |
| 231 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 232 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) | |
| 233 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4") | |
| 234 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) | |
| 235 | PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) | |
| 236 | PORT_DIPSETTING( 0x0c, DEF_STR( 4C_3C ) ) | |
| 237 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 238 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5") | |
| 239 | PORT_DIPSETTING( 0x00, "3" ) | |
| 240 | PORT_DIPSETTING( 0x10, "5" ) | |
| 241 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") | |
| 242 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 243 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 244 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") | |
| 245 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 246 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 247 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") | |
| 248 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 249 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 250 | ||
| 251 | PORT_START("DSW2") | |
| 252 | PORT_DIPNAME( 0x01, 0x00, "IN2" ) PORT_DIPLOCATION("SW2:1") | |
| 253 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 254 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 255 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") | |
| 256 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 257 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 258 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") | |
| 259 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 260 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 261 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") | |
| 262 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 263 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 264 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") | |
| 265 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 266 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 267 | PORT_DIPNAME( 0x20, 0x00, "Test Mode" ) PORT_DIPLOCATION("SW2:6") | |
| 268 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 269 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 270 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") | |
| 271 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 272 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 273 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") | |
| 274 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 275 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 276 | ||
| 277 | ||
| 278 | INPUT_PORTS_END | |
| 279 | ||
| 280 | static const gfx_layout tiles8x8_layout = | |
| 281 | { | |
| 282 | 8,8, | |
| 283 | RGN_FRAC(1,3), | |
| 284 | 3, | |
| 285 | { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, | |
| 286 | { 0, 1,2,3,4,5,6,7 }, | |
| 287 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 288 | 8*8 | |
| 289 | }; | |
| 290 | ||
| 291 | static GFXDECODE_START( unclepoo ) | |
| 292 | GFXDECODE_ENTRY( "gfx", 0, tiles8x8_layout, 0, 0x20 ) | |
| 293 | GFXDECODE_END | |
| 294 | ||
| 295 | static PALETTE_INIT( unclepoo ) | |
| 296 | { | |
| 297 | int i,r,g,b,val; | |
| 298 | int bit0,bit1,bit2; | |
| 299 | ||
| 300 | for (i = 0; i < 0x200; i++) | |
| 301 | { | |
| 302 | val = (color_prom[i+0x100]) | (color_prom[i+0x000]<<4); | |
| 303 | ||
| 304 | bit0 = 0; | |
| 305 | bit1 = (val >> 6) & 0x01; | |
| 306 | bit2 = (val >> 7) & 0x01; | |
| 307 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 308 | bit0 = (val >> 3) & 0x01; | |
| 309 | bit1 = (val >> 4) & 0x01; | |
| 310 | bit2 = (val >> 5) & 0x01; | |
| 311 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 312 | bit0 = (val >> 0) & 0x01; | |
| 313 | bit1 = (val >> 1) & 0x01; | |
| 314 | bit2 = (val >> 2) & 0x01; | |
| 315 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 316 | ||
| 317 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 318 | } | |
| 319 | } | |
| 320 | ||
| 321 | /* ??? */ | |
| 322 | #if 0 | |
| 323 | ||
| 324 | static READ8_HANDLER( test_r ) | |
| 325 | { | |
| 326 | return 0xf6; | |
| 327 | } | |
| 328 | ||
| 329 | /* soundlatch */ | |
| 330 | static READ8_HANDLER( test2_r ) | |
| 331 | { | |
| 332 | return 0x00; | |
| 333 | } | |
| 334 | #endif | |
| 335 | ||
| 336 | static READ8_HANDLER( timer_r ) | |
| 337 | { | |
| 338 | return cpu_get_total_cycles(space->cpu) / 16; | |
| 339 | } | |
| 340 | ||
| 341 | ||
| 342 | static const ay8910_interface ay8910_config = | |
| 343 | { | |
| 344 | AY8910_LEGACY_OUTPUT, | |
| 345 | AY8910_DEFAULT_LOADS, | |
| 346 | DEVCB_MEMORY_HANDLER("subcpu", PROGRAM, soundlatch_r), | |
| 347 | DEVCB_MEMORY_HANDLER("subcpu", PROGRAM, timer_r), | |
| 348 | DEVCB_NULL, | |
| 349 | DEVCB_NULL | |
| 350 | }; | |
| 351 | ||
| 352 | static MACHINE_DRIVER_START( unclepoo ) | |
| 353 | /* basic machine hardware */ | |
| 354 | MDRV_CPU_ADD("maincpu", Z80,18000000/6) /* ? MHz */ | |
| 355 | MDRV_CPU_PROGRAM_MAP(unclepoo_main_map) | |
| 356 | MDRV_CPU_IO_MAP(unclepoo_main_portmap) | |
| 357 | MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse) | |
| 358 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,256) // ??? controls game speed | |
| 359 | ||
| 360 | MDRV_CPU_ADD("subcpu", Z80,18000000/12) /* ? MHz */ | |
| 361 | MDRV_CPU_PROGRAM_MAP(unclepoo_sub_map) | |
| 362 | MDRV_CPU_IO_MAP(unclepoo_sub_portmap) | |
| 363 | // MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) | |
| 364 | ||
| 365 | /* video hardware */ | |
| 366 | MDRV_SCREEN_ADD("screen", RASTER) | |
| 367 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 368 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 369 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 370 | MDRV_SCREEN_SIZE(256, 256) | |
| 371 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-1) | |
| 372 | ||
| 373 | MDRV_GFXDECODE(unclepoo) | |
| 374 | MDRV_PALETTE_LENGTH(0x100) | |
| 375 | MDRV_PALETTE_INIT(unclepoo) | |
| 376 | ||
| 377 | MDRV_VIDEO_START(unclepoo) | |
| 378 | MDRV_VIDEO_UPDATE(unclepoo) | |
| 379 | ||
| 380 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 381 | MDRV_SOUND_ADD("ay", AY8910, 18000000/12) /* ? Mhz */ | |
| 382 | MDRV_SOUND_CONFIG(ay8910_config) | |
| 383 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 384 | MACHINE_DRIVER_END | |
| 385 | ||
| 386 | ||
| 387 | ||
| 388 | ROM_START( unclepoo ) | |
| 389 | ROM_REGION( 0x8000, "maincpu", 0 ) | |
| 390 | ROM_LOAD( "01.f17", 0x00000, 0x2000, CRC(92fb238c) SHA1(e9476c5c1a0bf9e8c6c364ac022ed1d97ae66d2e) ) | |
| 391 | ROM_LOAD( "02.f14", 0x02000, 0x2000, CRC(b99214ef) SHA1(c8e4af0efbc5ea543277b2764dc6f119aae477ca) ) | |
| 392 | ROM_LOAD( "03.f11", 0x04000, 0x2000, CRC(a136af97) SHA1(cfa610bf357870053617fed8aef6bb30bd996422) ) | |
| 393 | ROM_LOAD( "04.f09", 0x06000, 0x2000, CRC(c4bcd414) SHA1(df3125358530f5fb8d202bddcb0ef5e322fabb7b) ) | |
| 394 | ||
| 395 | ROM_REGION( 0x1000, "subcpu", 0 ) | |
| 396 | ROM_LOAD( "08.c15", 0x00000, 0x1000, CRC(fd84106b) SHA1(891853d2b39850a981016108b74ca20337d2cdd8) ) | |
| 397 | ||
| 398 | ROM_REGION( 0x6000, "gfx", 0 ) | |
| 399 | ROM_LOAD( "05.k04", 0x0000, 0x2000, CRC(64026934) SHA1(a5342335d02d34fa6ba2b29484ed71ecc96292f2) ) | |
| 400 | ROM_LOAD( "06.j04", 0x2000, 0x2000, CRC(94b5f676) SHA1(32c27854726636c4ce03bb6a83b32d04ed6c42af) ) | |
| 401 | ROM_LOAD( "07.h04", 0x4000, 0x2000, CRC(e2f73e99) SHA1(61cb09ff424ba63b892b4822e7ed916af73412f1) ) | |
| 402 | ||
| 403 | ROM_REGION( 0x200, "proms", 0 ) | |
| 404 | ROM_LOAD( "diatec_h.bin", 0x000, 0x100, CRC(938601b1) SHA1(8213284989bebb5f7375878181840de8079dc1f3) ) | |
| 405 | ROM_LOAD( "diatec_l.bin", 0x100, 0x100, CRC(b04d466a) SHA1(1438abeae76ef807ba34bd6d3e4c44f707dbde6e) ) | |
| 406 | ROM_END | |
| 407 | ||
| 408 | GAME( 1983, unclepoo, 0, unclepoo, unclepoo, 0, ROT90, "Diatec", "Uncle Poo", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 83 | 83 | #include "sound/ay8910.h" |
| 84 | 84 | |
| 85 | 85 | |
| 86 | typedef struct _calorie_state calorie_state; | |
| 87 | struct _calorie_state | |
| 86 | class calorie_state | |
| 88 | 87 | { |
| 88 | public: | |
| 89 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, calorie_state(machine)); } | |
| 90 | ||
| 91 | calorie_state(running_machine &machine) { } | |
| 92 | ||
| 89 | 93 | /* memory pointers */ |
| 90 | 94 | UINT8 * fg_ram; |
| 91 | 95 | UINT8 * sprites; |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #include "cpu/m68000/m68000.h" |
| 12 | 12 | #include "sound/okim6295.h" |
| 13 | 13 | |
| 14 | typedef struct _drtomy_state drtomy_state; | |
| 15 | struct _drtomy_state | |
| 14 | class drtomy_state | |
| 16 | 15 | { |
| 16 | public: | |
| 17 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, drtomy_state(machine)); } | |
| 18 | ||
| 19 | drtomy_state(running_machine &machine) { } | |
| 20 | ||
| 17 | 21 | /* memory pointers */ |
| 18 | 22 | UINT16 * spriteram; |
| 19 | 23 | UINT16 * videoram_bg; |
| r7500 | r7501 | |
|---|---|---|
| 2876 | 2876 | memory_unmap_readwrite(space, 0x8000, 0x87ff, 0, 0); |
| 2877 | 2877 | } |
| 2878 | 2878 | |
| 2879 | static DRIVER_INIT( thepitm ) | |
| 2880 | { | |
| 2881 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); | |
| 2879 | 2882 | |
| 2883 | /* video extensions */ | |
| 2884 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); | |
| 2880 | 2885 | |
| 2886 | /* move the interrupt enable from $b000 to $b001 */ | |
| 2887 | memory_unmap_write(space, 0xb000, 0xb000, 0, 0x7f8); | |
| 2888 | memory_install_write8_handler(space, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2889 | ||
| 2890 | /* disable the stars */ | |
| 2891 | memory_unmap_write(space, 0xb004, 0xb004, 0, 0x07f8); | |
| 2892 | ||
| 2893 | /* extend ROM */ | |
| 2894 | memory_install_rom(space, 0x0000, 0x47ff, 0, 0, memory_region(machine, "maincpu")); | |
| 2895 | } | |
| 2896 | ||
| 2881 | 2897 | /************************************* |
| 2882 | 2898 | * |
| 2883 | 2899 | * Konami games |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #include "emu.h" |
| 18 | 18 | #include "cpu/m68000/m68000.h" |
| 19 | 19 | #include "sound/okim6295.h" |
| 20 | #include "includes/othldrby.h" | |
| 20 | 21 | |
| 21 | 22 | |
| 22 | WRITE16_HANDLER( othldrby_videoram_addr_w ); | |
| 23 | READ16_HANDLER( othldrby_videoram_r ); | |
| 24 | WRITE16_HANDLER( othldrby_videoram_w ); | |
| 25 | WRITE16_HANDLER( othldrby_vreg_addr_w ); | |
| 26 | WRITE16_HANDLER( othldrby_vreg_w ); | |
| 27 | ||
| 28 | VIDEO_START( othldrby ); | |
| 29 | VIDEO_EOF( othldrby ); | |
| 30 | VIDEO_UPDATE( othldrby ); | |
| 31 | ||
| 32 | static int toggle; | |
| 33 | ||
| 34 | ||
| 35 | 23 | static READ16_HANDLER( pip ) |
| 36 | 24 | { |
| 37 | return toggle ^= 1; | |
| 25 | othldrby_state *state = (othldrby_state *)space->machine->driver_data; | |
| 26 | return state->toggle ^= 1; | |
| 38 | 27 | } |
| 39 | 28 | |
| 40 | 29 | static READ16_HANDLER( pap ) |
| r7500 | r7501 | |
| 53 | 42 | { |
| 54 | 43 | if (ACCESSING_BITS_0_7) |
| 55 | 44 | { |
| 56 | coin_counter_w(space->machine, 0,data & 1); | |
| 57 | coin_counter_w(space->machine, 1,data & 2); | |
| 58 | coin_lockout_w(space->machine, 0,~data & 4); | |
| 59 | coin_lockout_w(space->machine, 1,~data & 8); | |
| 45 | coin_counter_w(space->machine, 0, data & 1); | |
| 46 | coin_counter_w(space->machine, 1, data & 2); | |
| 47 | coin_lockout_w(space->machine, 0, ~data & 4); | |
| 48 | coin_lockout_w(space->machine, 1, ~data & 8); | |
| 60 | 49 | } |
| 61 | 50 | } |
| 62 | 51 | |
| r7500 | r7501 | |
| 93 | 82 | } |
| 94 | 83 | |
| 95 | 84 | |
| 96 | ||
| 97 | 85 | static ADDRESS_MAP_START( othldrby_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 98 | 86 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 99 | 87 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 100 | AM_RANGE(0x200000, 0x20000f) AM_READWRITE(calendar_r,calendar_w) | |
| 88 | AM_RANGE(0x200000, 0x20000f) AM_READWRITE(calendar_r, calendar_w) | |
| 101 | 89 | AM_RANGE(0x300000, 0x300001) AM_WRITE(othldrby_videoram_addr_w) |
| 102 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(othldrby_videoram_r,othldrby_videoram_w) | |
| 90 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(othldrby_videoram_r, othldrby_videoram_w) | |
| 103 | 91 | AM_RANGE(0x300008, 0x300009) AM_WRITE(othldrby_vreg_addr_w) |
| 104 | 92 | AM_RANGE(0x30000c, 0x30000d) AM_READ(pip) // vblank? |
| 105 | 93 | AM_RANGE(0x30000c, 0x30000f) AM_WRITE(othldrby_vreg_w) |
| 106 | 94 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 107 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_r,okim6295_w, 0x00ff) | |
| 95 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff) | |
| 108 | 96 | AM_RANGE(0x700000, 0x700001) AM_READ(pap) // scanline??? |
| 109 | 97 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSW1") |
| 110 | 98 | AM_RANGE(0x700008, 0x700009) AM_READ_PORT("DSW2") |
| r7500 | r7501 | |
| 228 | 216 | |
| 229 | 217 | |
| 230 | 218 | |
| 219 | static MACHINE_START( othldrby ) | |
| 220 | { | |
| 221 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 222 | ||
| 223 | state_save_register_global(machine, state->toggle); | |
| 224 | state_save_register_global(machine, state->vram_addr); | |
| 225 | state_save_register_global(machine, state->vreg_addr); | |
| 226 | state_save_register_global_array(machine, state->vreg); | |
| 227 | } | |
| 228 | ||
| 229 | static MACHINE_RESET( othldrby ) | |
| 230 | { | |
| 231 | othldrby_state *state = (othldrby_state *)machine->driver_data; | |
| 232 | ||
| 233 | state->toggle = 0xff; | |
| 234 | state->vram_addr = 0; | |
| 235 | state->vreg_addr = 0; | |
| 236 | ||
| 237 | memset(state->vreg, 0, ARRAY_LENGTH(state->vreg)); | |
| 238 | } | |
| 239 | ||
| 231 | 240 | static MACHINE_DRIVER_START( othldrby ) |
| 232 | 241 | |
| 242 | /* driver data */ | |
| 243 | MDRV_DRIVER_DATA(othldrby_state) | |
| 244 | ||
| 233 | 245 | /* basic machine hardware */ |
| 234 | 246 | MDRV_CPU_ADD("maincpu", M68000, 16000000) |
| 235 | 247 | MDRV_CPU_PROGRAM_MAP(othldrby_map) |
| 236 | 248 | MDRV_CPU_VBLANK_INT("screen", irq4_line_hold) |
| 237 | 249 | |
| 250 | MDRV_MACHINE_START(othldrby) | |
| 251 | MDRV_MACHINE_RESET(othldrby) | |
| 252 | ||
| 238 | 253 | /* video hardware */ |
| 239 | 254 | MDRV_SCREEN_ADD("screen", RASTER) |
| 240 | 255 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 278 | 293 | ROM_LOAD( "db0.4", 0x00000, 0x80000, CRC(a9701868) SHA1(9ee89556666d358e8d3915622573b3ba660048b8) ) |
| 279 | 294 | ROM_END |
| 280 | 295 | |
| 281 | static DRIVER_INIT( othldrby ) | |
| 282 | { | |
| 283 | toggle = 0xff; | |
| 284 | } | |
| 285 | ||
| 286 | GAME( 1995, othldrby, 0, othldrby, othldrby, othldrby, ROT0, "Sunwise", "Othello Derby (Japan)", 0 ) | |
| 296 | GAME( 1995, othldrby, 0, othldrby, othldrby, 0, ROT0, "Sunwise", "Othello Derby (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 59 | 59 | #define USE_MSM 0 |
| 60 | 60 | #define NUM_PLUNGER_REPEATS 50 |
| 61 | 61 | |
| 62 | typedef struct _pachifev_state pachifev_state; | |
| 62 | class pachifev_state | |
| 63 | { | |
| 64 | public: | |
| 65 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pachifev_state(machine)); } | |
| 63 | 66 | |
| 64 | struct _pachifev_state | |
| 65 | { | |
| 67 | pachifev_state(running_machine &machine) { } | |
| 68 | ||
| 66 | 69 | /* controls related */ |
| 67 | 70 | |
| 68 | 71 | int power; |
| r7500 | r7501 | |
|---|---|---|
| 53 | 53 | level sequence compared to the Taito licensed version. |
| 54 | 54 | |
| 55 | 55 | |
| 56 | Stephh's notes (based on the games M68000 and Z80 code and some tests) : | |
| 57 | ||
| 58 | 1) 'rallybik' | |
| 59 | ||
| 60 | - Region read from DSWB (port 0x50 in CPU1) then stored at 0x8004 (CPU1 shared RAM) = | |
| 61 | 0x180008.w (CPU0 shared RAM) then stored at 0x0804f4.w . | |
| 62 | - Coinage relies on bits 4 and 5 of the region (code at 0x0ccc in CPU1) : | |
| 63 | * ..10.... : TOAPLAN_COINAGE_WORLD (tables at 0x0c35 (COIN1) and 0x0c3d (COIN2) in CPU1) | |
| 64 | * else : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0c25 (COIN1 AND COIN2) in CPU1) | |
| 65 | - Title screen relies on bits 4 and 5 of the region (code at 0x00220e) : | |
| 66 | * ..00.... : "Dash Yarou" | |
| 67 | * else : "Rally Bike" | |
| 68 | - Notice screen relies on bits 4 and 5 of the region (code at 0x001ac0) : | |
| 69 | * ..00.... : "FOR USE IN JAPAN ONLY" | |
| 70 | * else : no notice screen | |
| 71 | - Copyright relies on bits 4 and 5 of the region (code at 0x001e68) : | |
| 72 | * ..00.... : "TAITO CORPORATION" / "ALL RIGHTS RESERVED" | |
| 73 | * ..01.... : "TAITO AMERICA CORP." / "ALL RIGHTS RESERVED" | |
| 74 | * ..10.... : "TAITO CORP. JAPAN" / "ALL RIGHTS RESERVED" | |
| 75 | * ..11.... : "TAITO AMERICA CORP." / "LICENCED TO ROMSTAR" | |
| 76 | - Number of letters for initials relies on bits 4 and 5 of the region | |
| 77 | (code at 0x0008fe = init - code at 0x0022e8 = enter) : | |
| 78 | * ..00.... : 6 letters | |
| 79 | * else : 3 letters | |
| 80 | - To enter the "test mode", press START1 when the grid is displayed. | |
| 81 | - When "TEST" Switch is ON, you can do the following with the STARTn buttons : | |
| 82 | * press START2 to pause game | |
| 83 | * press START1 to unpause game | |
| 84 | * when START1 and START2 are pressed, the game enters in "slow motion" mode | |
| 85 | - When "TEST" Switch is ON, collision and fuel consuption routines are not called. | |
| 86 | Don't forget to turn the Debug Switch OFF when time is over on bonus stage, | |
| 87 | or the level will never end ! | |
| 88 | - When cabinet is set to "Upright", you can use joystick and buttons from both players | |
| 89 | (code at 0x001c44). | |
| 90 | ||
| 91 | 2) 'truxton' | |
| 92 | ||
| 93 | - Region read from Territory Jumper (port 0x70 in CPU1) then stored at 0x8005 (CPU1 shared RAM) = | |
| 94 | 0x18000a.w (CPU0 shared RAM) then stored at 0x081b7c.w . | |
| 95 | - Coinage relies on bits 0 and 1 of the region (code at 0x0ccc in CPU1) : | |
| 96 | * ......00 : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0d21 (COIN1 AND COIN2) in CPU1) | |
| 97 | * ......01 : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0d29 (COIN1 AND COIN2) in CPU1) | |
| 98 | * ......10 : TOAPLAN_COINAGE_WORLD (tables at 0x0d31 (COIN1) and 0x0d39 (COIN2) in CPU1) | |
| 99 | * ......11 : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0d21 (COIN1 AND COIN2) in CPU1) | |
| 100 | - Title screen relies on bits 0 to 2 of the region (code at 0x002c58) : | |
| 101 | * .....000 : "Tatsujin" | |
| 102 | * else : "Truxton" | |
| 103 | - Notice screen relies on bits 0 to 2 of the region (code at 0x004eb0) : | |
| 104 | * .....000 : "FOR USE IN JAPAN ONLY" | |
| 105 | * ......01 : "FOR USE IN U.S.A. ONLY" | |
| 106 | * ......1. : no notice screen | |
| 107 | - Copyright relies on bits 0 to 2 of the region (code at 0x003050) : | |
| 108 | * .....000 : "TAITO CORPORATION" / "ALL RIGHTS RESERVED" | |
| 109 | * .....001 : "TAITO AMERICA CORP." / "LICENCED TO ROMSTAR FOR U.S.A." | |
| 110 | * .....01. : "TAITO CORPORATION" / "ALL RIGHTS RESERVED" | |
| 111 | * .....1.. : "TAITO AMERICA CORP." | |
| 112 | - Number of letters for initials relies on bits 0 to 2 of the region | |
| 113 | (code at 0x000976 = init - code at 0x0004a6 = enter) : | |
| 114 | * .....000 : 6 letters | |
| 115 | * else : 3 letters | |
| 116 | - Jumper displayed in the Dip Switches screen relies on bits 0 and 1 of the region | |
| 117 | (code at 0x004546) : | |
| 118 | * ......00 : "FOR JAPAN" | |
| 119 | * ......01 : "FOR U.S.A." | |
| 120 | * ......1. : "FOR EUROPE" | |
| 121 | So when territory is set to "USA/Taito America" (0x04), it will display "FOR JAPAN" ! | |
| 122 | Jumpers 3 and 4 status is updated but they are always listed as unused. | |
| 123 | - To enter the "test mode", press START1 when the grid is displayed. | |
| 124 | - The "TEST" switch has the same effect as the "Service Mode" Dip Switch (DSWA bit 2). | |
| 125 | - When cabinet is set to "Upright", you can use joystick and buttons from both players | |
| 126 | (code at 0x002856). | |
| 127 | ||
| 128 | ||
| 129 | 3) 'hellfire' and "clones" | |
| 130 | ||
| 131 | TO DO ! | |
| 132 | ||
| 133 | ||
| 134 | 4) 'zerowing' and "clones" | |
| 135 | ||
| 136 | 4a) 'zerowing' | |
| 137 | ||
| 138 | - Region read from Territory Jumper (port 0x70 in CPU1) then stored at 0x8005 (CPU1 shared RAM) = | |
| 139 | 0x44000a.w (CPU0 shared RAM) then stored at 0x081810.w . | |
| 140 | - Coinage relies on bits 0 and 1 of the region (code at 0x0c59 in CPU1) : | |
| 141 | * ......00 : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0cae (COIN1 AND COIN2) in CPU1) | |
| 142 | * ......01 : TOAPLAN_COINAGE_JAPAN_OLD (table at 0x0cb6 (COIN1 AND COIN2) in CPU1) | |
| 143 | * ......1. : TOAPLAN_COINAGE_WORLD (tables at 0x0cbe (COIN1) and 0x0cb6 (COIN2) in CPU1) | |
| 144 | - Notice screen relies on bit 0 of the region (code at 0x000564) : | |
| 145 | * .......0 : "FOR USE IN JAPAN ONLY" | |
| 146 | * .......1 : "FOR USE IN U.S.A. ONLY" | |
| 147 | But this routine is only called if both bits 0 and 1 of the region are set to 0 | |
| 148 | (code at 0x000530), so there is a notice screen only when "Territory" is set to "Japan". | |
| 149 | - Copyright does NOT rely on the region, it is hard-coded in the M68000 ROMS. | |
| 150 | - Number of letters for initials relies on bits 0 and 1 of the region, but it is buggy : | |
| 151 | in the init routine (code at 0x000de0), bit 1 is tested (0 = 6 letters - 1 = 3 letters), | |
| 152 | but in the enter routine (code at 0x001bf4), bit 0 is tested ! So you get the following : | |
| 153 | * ......00 : 6 letters with default high-scores initials filled with "......" | |
| 154 | * ......01 : 3 letters with default high-scores initials filled with " ..." | |
| 155 | * ......10 : 6 letters with default high-scores initials filled with "...000" | |
| 156 | * ......11 : 3 letters with default high-scores initials filled with " ..." | |
| 157 | - Jumper displayed in the Dip Switches screen relies on bits 0 and 1 of the region | |
| 158 | (code at 0x000922) : | |
| 159 | * ......00 : "FOR JAPAN." | |
| 160 | * ......01 : "FOR U.S.A." | |
| 161 | * ......1. : "FOR EUROPE" | |
| 162 | - When "Invulnerability" Dip Switch is ON, you can do the following with the STARTn buttons : | |
| 163 | * press START2 to pause game | |
| 164 | * press START1 to unpause game | |
| 165 | * when START1 and START2 are pressed, the game enters in "slow motion" mode | |
| 166 | - When "Invulnerability" Dip Switch is ON, you can't die (of course), but you also can't move | |
| 167 | nor shoot while "captured" by an enemy or the background ! So you have to wait until enemy | |
| 168 | gives up or background scrolls enough to "free" you. | |
| 169 | - When cabinet is set to "Upright", you can use joystick and buttons from both players | |
| 170 | (code at 0x00541a). | |
| 171 | ||
| 172 | 4b) 'zerowing2' | |
| 173 | ||
| 174 | - Region read from Territory Jumper (port 0x70 in CPU1) then stored at 0x8005 (CPU1 shared RAM) = | |
| 175 | 0x44000a.w (CPU0 shared RAM) then stored at 0x081ae2.w . | |
| 176 | - Same sound CPU as in 'zerowing', so same coinage infos. | |
| 177 | - Notice screen relies on bit 0 of the region (code at 0x0005f4) : | |
| 178 | * .......0 : "FOR USE IN JAPAN ONLY" | |
| 179 | * .......1 : "FOR USE IN U.S.A. ONLY" | |
| 180 | But this routine is only called if bit 1 of the region is set to 0 (code at 0x0005c2), | |
| 181 | so there shall be a notice screen only when "Territory" is not set to "Europe". | |
| 182 | Furthermore, because of the 'bra' instruction at 0x00059e, there is never a notice screen ! | |
| 183 | - Copyright does NOT rely on the region, it is hard-coded in the M68000 ROMS. | |
| 184 | It is different from the one in 'zerowing' though. | |
| 185 | - Number of letters for initials relies on bit 1 of the region in the init routine (code at 0x000e64) : | |
| 186 | * ......0. : 6 letters | |
| 187 | * ......1. : 3 letters | |
| 188 | But there are then no more tests on the region and only 3 letters can be entered (display ". . .") . | |
| 189 | - Jumper displayed in the Dip Switches screen relies on bits 0 and 1 of the region | |
| 190 | (code at 0x0009b2), but some data has been altered not to display "FOR JAPAN." ! | |
| 191 | So you get the following : | |
| 192 | * ......0. : "FOR U.S.A." | |
| 193 | * ......1. : "FOR EUROPE" | |
| 194 | - When "Invulnerability" Dip Switch is ON, you can do the following with the STARTn buttons : | |
| 195 | * press START2 to pause game | |
| 196 | * press START1 to unpause game | |
| 197 | * when START1 and START2 are pressed, the game enters in "slow motion" mode | |
| 198 | - When "Invulnerability" Dip Switch is ON, you can't die (of course), but you also can't move | |
| 199 | nor shoot while "captured" by an enemy or the background ! So you have to wait until enemy | |
| 200 | gives up or background scrolls enough to "free" you. | |
| 201 | - As you can play with 2 players at the same time, there is no need of a "Cabinet" setting, | |
| 202 | so DSWA bit 0 is unused (it is even no more tested). | |
| 203 | - As other player can join in at any time, there is no need of a "Continue" setting, | |
| 204 | so DSWB bit 7 is unused (it is even no more tested). | |
| 205 | - Here are some differences I noticed with 'zerowing' : | |
| 206 | * you get the twin ships when starting a new life | |
| 207 | * speed range is 0x14-0x2c instead of 0x10-0x30 (but still +0x08) | |
| 208 | There might be some other differences, but as the M68000 code is heavily modified and as | |
| 209 | many addresses in RAM are different, it isn't very easy to spot which ones :( Any help is welcome ! | |
| 210 | ||
| 211 | ||
| 56 | 212 | To Do: |
| 57 | Add support for HD647180 (Z180) sound CPUs (once their internal | |
| 58 | ROMS are dumped). These are: | |
| 59 | Fire Shark/Same! Same! Same! | |
| 213 | Add support for HD647180 (Z180) sound CPUs (once their internal ROMS are dumped). | |
| 214 | These are: | |
| 215 | Fire Shark / Same! Same! Same! | |
| 60 | 216 | Vimana |
| 217 | In the meantime, it can be interesting to simulate the basic communications (coinage and credits) | |
| 218 | between the M68000 and the Z180 based on what is done for games with a Z80 sound CPU. [stephh] | |
| 61 | 219 | |
| 62 | 220 | ***************************************************************************/ |
| 63 | 221 | |
| r7500 | r7501 | |
| 65 | 223 | #include "cpu/z80/z80.h" |
| 66 | 224 | #include "cpu/m68000/m68000.h" |
| 67 | 225 | #include "cpu/tms32010/tms32010.h" |
| 226 | #include "includes/toaplipt.h" | |
| 68 | 227 | #include "includes/toaplan1.h" |
| 69 | 228 | #include "sound/3812intf.h" |
| 70 | 229 | |
| r7500 | r7501 | |
| 365 | 524 | |
| 366 | 525 | |
| 367 | 526 | /***************************************************************************** |
| 368 | Input Port definitions | |
| 527 | Generic Input Port definitions | |
| 369 | 528 | *****************************************************************************/ |
| 529 | static INPUT_PORTS_START( toaplan1_2b ) | |
| 530 | PORT_START("P1") | |
| 531 | TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) | |
| 370 | 532 | |
| 533 | PORT_START("P2") | |
| 534 | TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) | |
| 535 | ||
| 536 | PORT_START("SYSTEM") | |
| 537 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) | |
| 538 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 539 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* "TEST" switch - see notes */ | |
| 540 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 541 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 542 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 543 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 544 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 545 | ||
| 546 | PORT_START("VBLANK") | |
| 547 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 548 | PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 549 | INPUT_PORTS_END | |
| 550 | ||
| 551 | static INPUT_PORTS_START( toaplan1_3b ) | |
| 552 | PORT_INCLUDE( toaplan1_2b ) | |
| 553 | ||
| 554 | PORT_MODIFY("P1") | |
| 555 | TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) | |
| 556 | ||
| 557 | PORT_MODIFY("P2") | |
| 558 | TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) | |
| 559 | INPUT_PORTS_END | |
| 560 | ||
| 561 | ||
| 371 | 562 | #define TOAPLAN1_PLAYER_INPUT( player, button3, options ) \ |
| 372 | 563 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(player) options PORT_8WAY \ |
| 373 | 564 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(player) options PORT_8WAY \ |
| r7500 | r7501 | |
| 395 | 586 | PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 396 | 587 | |
| 397 | 588 | |
| 589 | /***************************************************************************** | |
| 590 | Game-specific Input Port definitions | |
| 591 | *****************************************************************************/ | |
| 592 | ||
| 593 | /* verified from M68000 and Z80 code */ | |
| 398 | 594 | static INPUT_PORTS_START( rallybik ) |
| 399 | | |
| 595 | | |
| 400 | 596 | |
| 401 | PORT_START("P1") | |
| 402 | TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, ) | |
| 597 | /* in 0x40 (CPU1) -> 0x8003 (CPU1 shared RAM) = 0x180006.w (CPU0 shared RAM) -> 0x0804f2.w */ | |
| 598 | PORT_START("DSWA") | |
| 599 | TOAPLAN_MACHINE_COCKTAIL | |
| 600 | TOAPLAN_COINAGE_DUAL(DSWB, 0x30, 0x20) /* see notes */ | |
| 403 | 601 | |
| 404 | PORT_START("P2") | |
| 405 | TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL ) | |
| 406 | ||
| 407 | PORT_START("DSWA") /* DSW A */ | |
| 408 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 409 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 410 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 411 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 412 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 413 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 414 | PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) | |
| 415 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 416 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 417 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 418 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 419 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 420 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 421 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 422 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 423 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 424 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 425 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 426 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 427 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 428 | ||
| 429 | PORT_START("DSWB") /* DSW B */ | |
| 430 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) | |
| 431 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 432 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) | |
| 433 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 434 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 435 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) | |
| 436 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 437 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 438 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) | |
| 439 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 440 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 441 | PORT_DIPNAME( 0x30, 0x20, "Territory/Copyright" ) | |
| 442 | PORT_DIPSETTING( 0x20, "World/Taito Corp Japan" ) | |
| 602 | /* in 0x50 (CPU1) -> 0x8004 (CPU1 shared RAM) = 0x180008.w (CPU0 shared RAM) -> 0x0804f4.w */ | |
| 603 | PORT_START("DSWB") | |
| 604 | TOAPLAN_DIFFICULTY | |
| 605 | PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH ) | |
| 606 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) | |
| 607 | PORT_DIPNAME( 0x30, 0x20, "Territory/Copyright" ) /* bits 4 and 5 listed as unused in the Dip Switches screen */ | |
| 608 | PORT_DIPSETTING( 0x20, "Europe/Taito Corp Japan" ) | |
| 443 | 609 | PORT_DIPSETTING( 0x10, "USA/Taito America" ) |
| 610 | PORT_DIPSETTING( 0x30, "USA/Taito America (Romstar)" ) | |
| 444 | 611 | PORT_DIPSETTING( 0x00, "Japan/Taito Corp" ) |
| 445 | PORT_DIPSETTING( 0x30, "USA/Taito America (Romstar)" ) | |
| 446 | PORT_DIPNAME( 0x40, 0x00, "Dip Switch Display" ) | |
| 447 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 448 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 449 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) | |
| 612 | PORT_DIPNAME( 0x40, 0x00, "Show Dip Switches Settings" ) | |
| 613 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 614 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) | |
| 615 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) /* not on race 1 */ | |
| 450 | 616 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) |
| 451 | 617 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 452 | 618 | |
| 453 | TOAPLAN1_SYSTEM_INPUTS | |
| 619 | PORT_START("TJUMP") /* Territory Jumper Block (not present ? this port isn't even read) */ | |
| 620 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 454 | 621 | |
| 455 | PORT_START("TJUMP") /* Territory Jumper Block (not present?) */ | |
| 456 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 622 | /* P1 : in 0x00 (CPU1) -> 0x8006 (CPU1 shared RAM) = 0x18000c.w (CPU0 shared RAM) */ | |
| 623 | /* P2 : in 0x10 (CPU1) -> 0x8007 (CPU1 shared RAM) = 0x18000e.w (CPU0 shared RAM) */ | |
| 624 | ||
| 625 | /* in 0x20 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x18000a.w (CPU0 shared RAM) -> 0x0804f4.w */ | |
| 626 | PORT_MODIFY("SYSTEM") | |
| 627 | TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) /* see notes */ | |
| 628 | ||
| 629 | /* VBLANK : 0x140000.w */ | |
| 457 | 630 | INPUT_PORTS_END |
| 458 | 631 | |
| 632 | ||
| 633 | /* verified from M68000 and Z80 code */ | |
| 459 | 634 | static INPUT_PORTS_START( truxton ) |
| 460 | | |
| 635 | | |
| 461 | 636 | |
| 462 | PORT_START("P1") | |
| 463 | TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, ) | |
| 637 | /* in 0x40 (CPU1) -> 0x8003 (CPU1 shared RAM) = 0x180006.w (CPU0 shared RAM) -> 0x081b78.w */ | |
| 638 | PORT_START("DSWA") | |
| 639 | TOAPLAN_MACHINE_COCKTAIL | |
| 640 | TOAPLAN_COINAGE_DUAL(TJUMP, 0x03, 0x02) /* see notes */ | |
| 464 | 641 | |
| 465 | PORT_START("P2") | |
| 466 | TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL ) | |
| 467 | ||
| 468 | PORT_START("DSWA") /* DSW A */ | |
| 469 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 470 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 471 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 472 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 473 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 474 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 475 | PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) | |
| 476 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 477 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 478 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 479 | /* credits per coin options change, depending on the territory setting */ | |
| 480 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 481 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 482 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 483 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 484 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 485 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 486 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 487 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 488 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 489 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 490 | /* The following are coin settings for Japan | |
| 491 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 492 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 493 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 494 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 495 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 496 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 497 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 498 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 499 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 500 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 501 | */ | |
| 502 | ||
| 503 | PORT_START("DSWB") /* DSW B */ | |
| 504 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) | |
| 505 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 506 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) | |
| 507 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 508 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 509 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 510 | PORT_DIPSETTING( 0x04, "50K, every 150K" ) | |
| 511 | PORT_DIPSETTING( 0x00, "70K, every 200K" ) | |
| 512 | PORT_DIPSETTING( 0x08, "100K only" ) | |
| 642 | /* in 0x50 (CPU1) -> 0x8004 (CPU1 shared RAM) = 0x180008.w (CPU0 shared RAM) -> 0x081b7a.w */ | |
| 643 | PORT_START("DSWB") | |
| 644 | TOAPLAN_DIFFICULTY | |
| 645 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x000930 */ | |
| 646 | PORT_DIPSETTING( 0x04, "50k 200k 150k+" ) | |
| 647 | PORT_DIPSETTING( 0x00, "70k 270k 200k+" ) | |
| 648 | PORT_DIPSETTING( 0x08, "100k Only" ) | |
| 513 | 649 | PORT_DIPSETTING( 0x0c, DEF_STR( None ) ) |
| 514 | 650 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) |
| 515 | 651 | PORT_DIPSETTING( 0x30, "2" ) |
| 516 | 652 | PORT_DIPSETTING( 0x00, "3" ) |
| 517 | 653 | PORT_DIPSETTING( 0x20, "4" ) |
| 518 | 654 | PORT_DIPSETTING( 0x10, "5" ) |
| 519 | PORT_DIPNAME( 0x40, 0x00, "Dip Switch Display" ) | |
| 520 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 521 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 655 | PORT_DIPNAME( 0x40, 0x00, "Show Dip Switches Settings" ) | |
| 656 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 657 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) | |
| 522 | 658 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) |
| 523 | 659 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) |
| 524 | 660 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 525 | 661 | |
| 526 | TOAPLAN1_SYSTEM_INPUTS | |
| 662 | /* in 0x70 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x18000a.w (CPU0 shared RAM) -> 0x081b7c.w */ | |
| 663 | PORT_START("TJUMP") /* Territory Jumper Block - see notes */ | |
| 664 | PORT_DIPNAME( 0x07, 0x02, "Territory/Copyright" ) | |
| 665 | PORT_DIPSETTING( 0x02, "Europe/Taito Corp" ) /* TOAPLAN_COINAGE_WORLD */ | |
| 666 | // PORT_DIPSETTING( 0x03, "Europe/Taito Corp" ) /* TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 667 | // PORT_DIPSETTING( 0x06, "Europe/Taito America" ) /* TOAPLAN_COINAGE_WORLD */ | |
| 668 | // PORT_DIPSETTING( 0x07, "Europe/Taito America" ) /* TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 669 | PORT_DIPSETTING( 0x04, "USA/Taito America" ) /* TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 670 | // PORT_DIPSETTING( 0x05, "USA/Taito America" ) /* TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 671 | PORT_DIPSETTING( 0x01, "USA/Taito America (Romstar)" )/*TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 672 | PORT_DIPSETTING( 0x00, "Japan/Taito Corp" ) /* TOAPLAN_COINAGE_JAPAN_OLD */ | |
| 673 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) | |
| 674 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 527 | 675 | |
| 528 | PORT_START("TJUMP") /* Territory Jumper Block */ | |
| 529 | PORT_DIPNAME( 0x07, 0x02, "Territory/Copyright" ) | |
| 530 | PORT_DIPSETTING( 0x02, "World/Taito Corp" ) | |
| 531 | PORT_DIPSETTING( 0x06, "World/Taito America" ) | |
| 532 | PORT_DIPSETTING( 0x04, "US/Taito America" ) | |
| 533 | PORT_DIPSETTING( 0x01, "US/Romstar" ) | |
| 534 | PORT_DIPSETTING( 0x00, "Japan/Taito Corp" ) | |
| 535 | // PORT_DIPSETTING( 0x05, "Same as 0x04" ) | |
| 536 | // PORT_DIPSETTING( 0x03, "Same as 0x02" ) | |
| 537 | // PORT_DIPSETTING( 0x07, "Same as 0x06" ) | |
| 538 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) | |
| 539 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 540 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 541 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 676 | /* P1 : in 0x00 (CPU1) -> 0x8007 (CPU1 shared RAM) = 0x18000e.w (CPU0 shared RAM) -> 0x081b82.w */ | |
| 677 | /* P2 : in 0x10 (CPU1) -> 0x8008 (CPU1 shared RAM) = 0x180010.w (CPU0 shared RAM) -> 0x081b84.w */ | |
| 678 | ||
| 679 | /* SYSTEM : in 0x20 (CPU1) -> 0x8006 (CPU1 shared RAM) = 0x18000c.w (CPU0 shared RAM) -> 0x081b7e.w */ | |
| 680 | ||
| 681 | /* VBLANK : 0x140000.w */ | |
| 542 | 682 | INPUT_PORTS_END |
| 543 | 683 | |
| 684 | ||
| 544 | 685 | static INPUT_PORTS_START( hellfire ) |
| 545 | 686 | TOAPLAN1_VBLANK_INPUT |
| 546 | 687 | |
| r7500 | r7501 | |
| 612 | 753 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 613 | 754 | INPUT_PORTS_END |
| 614 | 755 | |
| 615 | static INPUT_PORTS_START( hellfir1 ) | |
| 756 | static INPUT_PORTS_START( hellfire1 ) | |
| 616 | 757 | PORT_INCLUDE( hellfire ) |
| 617 | 758 | |
| 618 | 759 | PORT_MODIFY("DSWA") |
| r7500 | r7501 | |
| 621 | 762 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 622 | 763 | INPUT_PORTS_END |
| 623 | 764 | |
| 765 | ||
| 766 | /* verified from M68000 and Z80 code */ | |
| 624 | 767 | static INPUT_PORTS_START( zerowing ) |
| 625 | | |
| 768 | | |
| 626 | 769 | |
| 627 | PORT_START("P1") | |
| 628 | TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, ) | |
| 770 | /* in 0x20 (CPU1) -> 0x8003 (CPU1 shared RAM) = 0x440006.w (CPU0 shared RAM) -> 0x08180c.w */ | |
| 771 | PORT_START("DSWA") | |
| 772 | TOAPLAN_MACHINE_COCKTAIL | |
| 773 | TOAPLAN_COINAGE_DUAL(TJUMP, 0x02, 0x02) /* see notes */ | |
| 629 | 774 | |
| 630 | PORT_START("P2") | |
| 631 | TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL ) | |
| 632 | ||
| 633 | PORT_START("DSWA") /* DSW A */ | |
| 634 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 635 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 636 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 637 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) | |
| 638 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 639 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 640 | PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) | |
| 641 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 642 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 643 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 644 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 645 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 646 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 647 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 648 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 649 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 650 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 651 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 652 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 653 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 654 | ||
| 655 | PORT_START("DSWB") /* DSW B */ | |
| 656 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) | |
| 657 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 658 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) | |
| 659 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 660 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) | |
| 661 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 662 | PORT_DIPSETTING( 0x00, "200K, every 500K" ) | |
| 663 | PORT_DIPSETTING( 0x04, "500K, every 1M" ) | |
| 664 | PORT_DIPSETTING( 0x08, "500K" ) | |
| 775 | /* in 0x28 (CPU1) -> 0x8004 (CPU1 shared RAM) = 0x440008.w (CPU0 shared RAM) -> 0x08180e.w */ | |
| 776 | PORT_START("DSWB") | |
| 777 | TOAPLAN_DIFFICULTY | |
| 778 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0x00216c ('zerowing') or 0x002606 ('zerowing2') */ | |
| 779 | PORT_DIPSETTING( 0x00, "200k 700k 500k+" ) | |
| 780 | PORT_DIPSETTING( 0x04, "500k 1500k 1000k+" ) | |
| 781 | PORT_DIPSETTING( 0x08, "500k Only" ) | |
| 665 | 782 | PORT_DIPSETTING( 0x0c, DEF_STR( None ) ) |
| 666 | 783 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) |
| 667 | 784 | PORT_DIPSETTING( 0x30, "2" ) |
| r7500 | r7501 | |
| 675 | 792 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) |
| 676 | 793 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 677 | 794 | |
| 678 | TOAPLAN1_SYSTEM_INPUTS | |
| 795 | /* in 0x88 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x44000a.w (CPU0 shared RAM) -> 0x081810.w */ | |
| 796 | PORT_START("TJUMP") /* Territory Jumper Block - see notes */ | |
| 797 | PORT_DIPNAME( 0x03, 0x03, "Territory" ) | |
| 798 | PORT_DIPSETTING( 0x03, DEF_STR( Europe ) ) /* 3 letters initials - right */ | |
| 799 | // PORT_DIPSETTING( 0x02, DEF_STR( Europe ) ) /* 6 letters initials - wrong */ | |
| 800 | PORT_DIPSETTING( 0x01, DEF_STR( USA ) ) | |
| 801 | PORT_DIPSETTING( 0x00, DEF_STR( Japan ) ) | |
| 802 | PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH ) | |
| 803 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) | |
| 804 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 679 | 805 | |
| 680 | PORT_START("TJUMP") /* Territory Jumper block */ | |
| 681 | PORT_DIPNAME( 0x03, 0x02, "Territory" ) | |
| 682 | PORT_DIPSETTING( 0x02, DEF_STR( Europe ) ) | |
| 683 | // PORT_DIPSETTING( 0x03, DEF_STR( Europe ) ) | |
| 684 | PORT_DIPSETTING( 0x01, "US" ) | |
| 685 | PORT_DIPSETTING( 0x00, DEF_STR( Japan ) ) | |
| 686 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) | |
| 687 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 688 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 689 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) | |
| 690 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 691 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 692 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 806 | /* P1 : in 0x00 (CPU1) -> 0x8007 (CPU1 shared RAM) = 0x44000e.w (CPU0 shared RAM) -> 0x081818.w */ | |
| 807 | /* P2 : in 0x08 (CPU1) -> 0x8008 (CPU1 shared RAM) = 0x440010.w (CPU0 shared RAM) -> 0x08181a.w */ | |
| 808 | ||
| 809 | /* SYSTEM : in 0x80 (CPU1) -> 0x8006 (CPU1 shared RAM) = 0x44000c.w (CPU0 shared RAM) -> 0x081812.w */ | |
| 810 | ||
| 811 | /* VBLANK : 0x400000.w */ | |
| 693 | 812 | INPUT_PORTS_END |
| 694 | 813 | |
| 695 | ||
| 696 | static INPUT_PORTS_START( zerowng2 ) /* Always shows "Williams Electronics Games, Inc" */ | |
| 814 | /* verified from M68000 and Z80 code */ | |
| 815 | static INPUT_PORTS_START( zerowing2 ) | |
| 697 | 816 | PORT_INCLUDE( zerowing ) |
| 698 | 817 | |
| 818 | /* in 0x20 (CPU1) -> 0x8003 (CPU1 shared RAM) = 0x440006.w (CPU0 shared RAM) -> 0x081ade.w */ | |
| 819 | PORT_MODIFY("DSWA") | |
| 820 | TOAPLAN_MACHINE_NO_COCKTAIL | |
| 821 | ||
| 822 | /* in 0x28 (CPU1) -> 0x8004 (CPU1 shared RAM) = 0x440008.w (CPU0 shared RAM) -> 0x081ae0.w */ | |
| 823 | PORT_MODIFY("DSWB") | |
| 824 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH ) | |
| 825 | ||
| 826 | /* in 0x88 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x44000a.w (CPU0 shared RAM) -> 0x081ae2.w */ | |
| 699 | 827 | PORT_MODIFY("TJUMP") /* Territory Jumper block */ |
| 700 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) | |
| 701 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 702 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 828 | PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH ) | |
| 703 | 829 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Region ) ) |
| 704 | 830 | PORT_DIPSETTING( 0x00, DEF_STR( USA ) ) |
| 705 | 831 | PORT_DIPSETTING( 0x02, DEF_STR( Europe ) ) |
| 832 | PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH ) | |
| 833 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) | |
| 834 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 835 | ||
| 836 | /* P1 : in 0x00 (CPU1) -> 0x8007 (CPU1 shared RAM) = 0x44000e.w (CPU0 shared RAM) -> 0x081aea.w */ | |
| 837 | /* P2 : in 0x08 (CPU1) -> 0x8008 (CPU1 shared RAM) = 0x440010.w (CPU0 shared RAM) -> 0x081aec.w */ | |
| 838 | ||
| 839 | /* SYSTEM : in 0x80 (CPU1) -> 0x8006 (CPU1 shared RAM) = 0x44000c.w (CPU0 shared RAM) -> 0x081ae4.w */ | |
| 840 | ||
| 841 | /* VBLANK : 0x400000.w */ | |
| 706 | 842 | INPUT_PORTS_END |
| 707 | 843 | |
| 844 | ||
| 708 | 845 | static INPUT_PORTS_START( demonwld ) |
| 709 | 846 | TOAPLAN1_VBLANK_INPUT |
| 710 | 847 | |
| r7500 | r7501 | |
| 777 | 914 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 778 | 915 | INPUT_PORTS_END |
| 779 | 916 | |
| 780 | static INPUT_PORTS_START( demonwl1 ) | |
| 917 | static INPUT_PORTS_START( demonwld1 ) | |
| 781 | 918 | PORT_INCLUDE( demonwld ) |
| 782 | 919 | |
| 783 | 920 | PORT_MODIFY("TJUMP") /* Territory Jumper Block */ |
| r7500 | r7501 | |
| 788 | 925 | PORT_DIPSETTING( 0x00, "Japan/Taito Corp" ) |
| 789 | 926 | INPUT_PORTS_END |
| 790 | 927 | |
| 791 | static INPUT_PORTS_START( samesame ) | |
| 928 | ||
| 929 | static INPUT_PORTS_START( fireshrk ) | |
| 792 | 930 | TOAPLAN1_VBLANK_INPUT |
| 793 | 931 | |
| 794 | 932 | PORT_START("P1") |
| r7500 | r7501 | |
| 808 | 946 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) |
| 809 | 947 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 810 | 948 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 811 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) | |
| 812 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 813 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 814 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) | |
| 815 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 816 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 817 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 818 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 819 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 820 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 821 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 822 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 823 | /* settings listed in service mode, but not actually used ??? | |
| 824 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 825 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 826 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 827 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 828 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 829 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 830 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 831 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 832 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 833 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 834 | */ | |
| 949 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 950 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 951 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 952 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 953 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 954 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 955 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 956 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 957 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 958 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 835 | 959 | |
| 836 | 960 | PORT_START("DSWB") /* DSW B */ |
| 837 | 961 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) |
| r7500 | r7501 | |
| 859 | 983 | TOAPLAN1_SYSTEM_INPUTS |
| 860 | 984 | |
| 861 | 985 | PORT_START("TJUMP") /* Territory Jumper Block */ |
| 986 | PORT_DIPNAME( 0x06, 0x02, "Territory" ) | |
| 987 | PORT_DIPSETTING( 0x02, DEF_STR( Europe ) ) | |
| 988 | PORT_DIPSETTING( 0x04, DEF_STR( USA ) ) | |
| 989 | PORT_DIPSETTING( 0x00, "USA (Romstar)" ) | |
| 990 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 991 | INPUT_PORTS_END | |
| 992 | ||
| 993 | static INPUT_PORTS_START( samesame ) | |
| 994 | PORT_INCLUDE( fireshrk ) | |
| 995 | ||
| 996 | PORT_MODIFY("DSWA") /* DSW A */ | |
| 997 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) | |
| 998 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 999 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 1000 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) | |
| 1001 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1002 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 1003 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 1004 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1005 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1006 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 1007 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1008 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 1009 | /* settings listed in service mode, but not actually used ??? | |
| 1010 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 1011 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 1012 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1013 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) | |
| 1014 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 1015 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 1016 | PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) | |
| 1017 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1018 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) | |
| 1019 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 1020 | */ | |
| 1021 | ||
| 1022 | PORT_MODIFY("TJUMP") /* Territory Jumper Block */ | |
| 862 | 1023 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 863 | 1024 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 864 | 1025 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| r7500 | r7501 | |
| 874 | 1035 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 875 | 1036 | INPUT_PORTS_END |
| 876 | 1037 | |
| 877 | static INPUT_PORTS_START( samesam2 ) | |
| 1038 | static INPUT_PORTS_START( samesame2 ) | |
| 878 | 1039 | PORT_INCLUDE( samesame ) |
| 879 | 1040 | |
| 880 | 1041 | PORT_MODIFY("TJUMP") /* Territory Jumper Block */ |
| r7500 | r7501 | |
| 894 | 1055 | PORT_BIT( 0xf2, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Mask bit 2 aswell */ |
| 895 | 1056 | INPUT_PORTS_END |
| 896 | 1057 | |
| 897 | static INPUT_PORTS_START( fireshrk ) | |
| 898 | PORT_INCLUDE( samesame ) | |
| 899 | 1058 | |
| 900 | PORT_MODIFY("DSWA") /* DSW A */ | |
| 901 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) | |
| 902 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 903 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 904 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 905 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 906 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) | |
| 907 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 908 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) | |
| 909 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 910 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) | |
| 911 | ||
| 912 | PORT_MODIFY("TJUMP") /* Territory Jumper Block */ | |
| 913 | PORT_DIPNAME( 0x06, 0x02, "Territory" ) | |
| 914 | PORT_DIPSETTING( 0x02, DEF_STR( Europe ) ) | |
| 915 | PORT_DIPSETTING( 0x04, DEF_STR( USA ) ) | |
| 916 | PORT_DIPSETTING( 0x00, "USA (Romstar)" ) | |
| 917 | INPUT_PORTS_END | |
| 918 | ||
| 919 | ||
| 920 | 1059 | static INPUT_PORTS_START( outzone ) |
| 921 | 1060 | TOAPLAN1_VBLANK_INPUT |
| 922 | 1061 | |
| r7500 | r7501 | |
| 2284 | 2423 | |
| 2285 | 2424 | |
| 2286 | 2425 | |
| 2287 | GAME( 1988, rallybik, 0, rallybik, rallybik, toaplan1, ROT270, "[Toaplan] Taito Corporation", "Rally Bike / Dash Yarou", 0 ) | |
| 2288 | GAME( 1988, truxton, 0, truxton, truxton, toaplan1, ROT270, "[Toaplan] Taito Corporation", "Truxton / Tatsujin", 0 ) | |
| 2289 | GAME( 1989, hellfire, 0, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P Ver.)", 0 ) | |
| 2290 | GAME( 1989, hellfire1,hellfire, hellfire, hellfir1, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P Ver.)", 0 ) | |
| 2291 | GAME( 1989, hellfire2,hellfire, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P Ver., first edition)", 0 ) | |
| 2292 | GAME( 1989, hellfire3,hellfire, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P Ver., alt)", 0 ) | |
| 2293 | GAME( 1989, zerowing, 0, zerowing, zerowing, toaplan1, ROT0, "Toaplan", "Zero Wing", 0 ) | |
| 2294 | GAME( 1989, zerowing2,zerowing, zerowing, zerowng2, toaplan1, ROT0, "[Toaplan] Williams Electronics Games, Inc", "Zero Wing (2 player simultaneous ver.)", 0 ) | |
| 2295 | GAME( 1990, demonwld, 0, demonwld, demonwld, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 1)", 0 ) | |
| 2296 | GAME( 1989, demonwld1,demonwld, demonwld, demonwl1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (Taito license, set 2)", 0 ) | |
| 2297 | GAME( 1989, demonwld2,demonwld, demonwld, demonwl1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 3)", 0 ) | |
| 2298 | GAME( 1989, demonwld3,demonwld, demonwld, demonwl1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 4)", 0 ) | |
| 2299 | GAME( 1989, demonwld4,demonwld, demonwld, demonwl1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 5)", 0 ) | |
| 2300 | GAME( 1990, fireshrk, 0, samesame, fireshrk, toaplan1, ROT270, "Toaplan", "Fire Shark", GAME_NO_SOUND ) | |
| 2301 | GAME( 1990, fireshrkd, fireshrk, samesame, samesam2, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 1, easier)", GAME_NO_SOUND ) | |
| 2302 | GAME( 1990, fireshrkdh, fireshrk, samesame, samesam2, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 2, harder)", GAME_NO_SOUND ) | |
| 2303 | GAME( 1989, samesame, fireshrk, samesame, samesame, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (2 player alternating ver.)", GAME_NO_SOUND ) | |
| 2304 | GAME( 1989, samesame2,fireshrk, samesame, samesam2, toaplan1, ROT270, "Toaplan", "Same! Same! Same!", GAME_NO_SOUND ) | |
| 2305 | GAME( 1990, outzone, 0, outzone, outzone, toaplan1, ROT270, "Toaplan", "Out Zone (set 1)", 0 ) // later fixed version | |
| 2306 | GAME( 1990, outzonea, outzone, outzone, outzone, toaplan1, ROT270, "Toaplan", "Out Zone (set 2)", 0 ) | |
| 2307 | GAME( 1990, outzoneb, outzone, outzone, outzoneb, toaplan1, ROT270, "Toaplan", "Out Zone (set 3, prototype?)", 0 ) // early revision at least | |
| 2308 | GAME( 1990, outzonec, outzone, outzone, outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 4)", 0 ) | |
| 2309 | GAME( 1990, outzoned, outzone, outzone, outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 5)", 0 ) | |
| 2310 | GAME( 1991, vimana, 0, vimana, vimana, vimana, ROT270, "Toaplan", "Vimana", GAME_NO_SOUND ) | |
| 2311 | GAME( 1991, vimana1, vimana, vimana, vimana, vimana, ROT270, "Toaplan", "Vimana (old set)", GAME_NO_SOUND ) | |
| 2312 | GAME( 1991, vimanan, vimana, vimana, vimanan, vimana, ROT270, "Toaplan (Nova Apparate GMBH & Co license)", "Vimana (Nova Apparate GMBH & Co)", GAME_NO_SOUND ) | |
| 2426 | GAME( 1988, rallybik, 0, rallybik, rallybik, toaplan1, ROT270, "[Toaplan] Taito Corporation", "Rally Bike / Dash Yarou", GAME_NO_COCKTAIL ) | |
| 2427 | GAME( 1988, truxton, 0, truxton, truxton, toaplan1, ROT270, "[Toaplan] Taito Corporation", "Truxton / Tatsujin", GAME_NO_COCKTAIL ) | |
| 2428 | GAME( 1989, hellfire, 0, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P Ver.)", 0 ) | |
| 2429 | GAME( 1989, hellfire1, hellfire, hellfire, hellfire1, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P Ver.)", 0 ) | |
| 2430 | GAME( 1989, hellfire2, hellfire, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P Ver., first edition)", 0 ) | |
| 2431 | GAME( 1989, hellfire3, hellfire, hellfire, hellfire, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P Ver., alt)", 0 ) | |
| 2432 | GAME( 1989, zerowing, 0, zerowing, zerowing, toaplan1, ROT0, "Toaplan", "Zero Wing (single players)", GAME_NO_COCKTAIL ) | |
| 2433 | GAME( 1989, zerowing2, zerowing, zerowing, zerowing2, toaplan1, ROT0, "[Toaplan] Williams Electronics Games, Inc", "Zero Wing (dual players)", GAME_NO_COCKTAIL ) | |
| 2434 | GAME( 1990, demonwld, 0, demonwld, demonwld, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 1)", 0 ) | |
| 2435 | GAME( 1989, demonwld1, demonwld, demonwld, demonwld1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (Taito license, set 2)", 0 ) | |
| 2436 | GAME( 1989, demonwld2, demonwld, demonwld, demonwld1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 3)", 0 ) | |
| 2437 | GAME( 1989, demonwld3, demonwld, demonwld, demonwld1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 4)", 0 ) | |
| 2438 | GAME( 1989, demonwld4, demonwld, demonwld, demonwld1, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 5)", 0 ) | |
| 2439 | GAME( 1990, fireshrk, 0, samesame, fireshrk, toaplan1, ROT270, "Toaplan", "Fire Shark", GAME_NO_SOUND ) | |
| 2440 | GAME( 1990, fireshrkd, fireshrk, samesame, samesame2, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 1, easier)", GAME_NO_SOUND ) | |
| 2441 | GAME( 1990, fireshrkdh, fireshrk, samesame, samesame2, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 2, harder)", GAME_NO_SOUND ) | |
| 2442 | GAME( 1989, samesame, fireshrk, samesame, samesame, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (2 player alternating ver.)", GAME_NO_SOUND ) | |
| 2443 | GAME( 1989, samesame2, fireshrk, samesame, samesame2, toaplan1, ROT270, "Toaplan", "Same! Same! Same!", GAME_NO_SOUND ) | |
| 2444 | GAME( 1990, outzone, 0, outzone, outzone, toaplan1, ROT270, "Toaplan", "Out Zone (set 1)", 0 ) // later fixed version | |
| 2445 | GAME( 1990, outzonea, outzone, outzone, outzone, toaplan1, ROT270, "Toaplan", "Out Zone (set 2)", 0 ) | |
| 2446 | GAME( 1990, outzoneb, outzone, outzone, outzoneb, toaplan1, ROT270, "Toaplan", "Out Zone (set 3, prototype?)", 0 ) // early revision at least | |
| 2447 | GAME( 1990, outzonec, outzone, outzone, outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 4)", 0 ) | |
| 2448 | GAME( 1990, outzoned, outzone, outzone, outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 5)", 0 ) | |
| 2449 | GAME( 1991, vimana, 0, vimana, vimana, vimana, ROT270, "Toaplan", "Vimana", GAME_NO_SOUND ) | |
| 2450 | GAME( 1991, vimana1, vimana, vimana, vimana, vimana, ROT270, "Toaplan", "Vimana (old set)", GAME_NO_SOUND ) | |
| 2451 | GAME( 1991, vimanan, vimana, vimana, vimanan, vimana, ROT270, "Toaplan (Nova Apparate GMBH & Co license)", "Vimana (Nova Apparate GMBH & Co)", GAME_NO_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 5 | 5 | #include "sound/dac.h" |
| 6 | 6 | #include "includes/konamipt.h" |
| 7 | 7 | |
| 8 | static UINT8 *mogura_tileram; | |
| 9 | static UINT8* mogura_gfxram; | |
| 10 | static tilemap_t *mogura_tilemap; | |
| 8 | class mogura_state | |
| 9 | { | |
| 10 | public: | |
| 11 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mogura_state(machine)); } | |
| 11 | 12 | |
| 13 | mogura_state(running_machine &machine) { } | |
| 14 | ||
| 15 | /* memory pointers */ | |
| 16 | UINT8 * tileram; | |
| 17 | UINT8 * gfxram; | |
| 18 | ||
| 19 | /* video-related */ | |
| 20 | tilemap_t *tilemap; | |
| 21 | ||
| 22 | /* devices */ | |
| 23 | running_device *maincpu; | |
| 24 | running_device *dac1; | |
| 25 | running_device *dac2; | |
| 26 | }; | |
| 27 | ||
| 28 | ||
| 12 | 29 | static PALETTE_INIT( mogura ) |
| 13 | 30 | { |
| 14 | int i,j; | |
| 31 | int i, j; | |
| 15 | 32 | |
| 16 | 33 | j = 0; |
| 17 | for (i = 0;i < 0x20;i++) | |
| 34 | for (i = 0; i < 0x20; i++) | |
| 18 | 35 | { |
| 19 | int bit0,bit1,bit2,r,g,b; | |
| 36 | int bit0, bit1, bit2, r, g, b; | |
| 20 | 37 | |
| 21 | 38 | /* red component */ |
| 22 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 23 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 24 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 39 | bit0 = BIT(color_prom[i], 0); | |
| 40 | bit1 = BIT(color_prom[i], 1); | |
| 41 | bit2 = BIT(color_prom[i], 2); | |
| 25 | 42 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 26 | 43 | /* green component */ |
| 27 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 28 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 29 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 44 | bit0 = BIT(color_prom[i], 3); | |
| 45 | bit1 = BIT(color_prom[i], 4); | |
| 46 | bit2 = BIT(color_prom[i], 5); | |
| 30 | 47 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 31 | 48 | /* blue component */ |
| 32 | 49 | bit0 = 0; |
| 33 | bit1 = (color_prom[i] >> 6) & 0x01; | |
| 34 | bit2 = (color_prom[i] >> 7) & 0x01; | |
| 50 | bit1 = BIT(color_prom[i], 6); | |
| 51 | bit2 = BIT(color_prom[i], 7); | |
| 35 | 52 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 36 | 53 | |
| 37 | palette_set_color(machine,j,MAKE_RGB(r,g,b)); | |
| 38 | j+=4; | |
| 39 | if (j>31) j-=31; | |
| 54 | palette_set_color(machine, j, MAKE_RGB(r, g, b)); | |
| 55 | j += 4; | |
| 56 | if (j > 31) j -= 31; | |
| 40 | 57 | } |
| 41 | 58 | } |
| 42 | 59 | |
| 43 | 60 | |
| 44 | 61 | static TILE_GET_INFO( get_mogura_tile_info ) |
| 45 | 62 | { |
| 46 | int code = mogura_tileram[tile_index]; | |
| 47 | int attr = mogura_tileram[tile_index+0x800]; | |
| 63 | mogura_state *state = (mogura_state *)machine->driver_data; | |
| 64 | int code = state->tileram[tile_index]; | |
| 65 | int attr = state->tileram[tile_index + 0x800]; | |
| 48 | 66 | |
| 49 | 67 | SET_TILE_INFO( |
| 50 | 68 | 0, |
| 51 | 69 | code, |
| 52 | (attr>>1)&7, | |
| 70 | (attr >> 1) & 7, | |
| 53 | 71 | 0); |
| 54 | 72 | } |
| 55 | 73 | |
| 56 | 74 | |
| 57 | 75 | static VIDEO_START( mogura ) |
| 58 | 76 | { |
| 59 | gfx_element_set_source(machine->gfx[0], mogura_gfxram); | |
| 60 | mogura_tilemap = tilemap_create(machine, get_mogura_tile_info,tilemap_scan_rows,8,8,64, 32); | |
| 77 | mogura_state *state = (mogura_state *)machine->driver_data; | |
| 78 | gfx_element_set_source(machine->gfx[0], state->gfxram); | |
| 79 | state->tilemap = tilemap_create(machine, get_mogura_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 61 | 80 | } |
| 62 | 81 | |
| 63 | 82 | static VIDEO_UPDATE( mogura ) |
| 64 | 83 | { |
| 84 | mogura_state *state = (mogura_state *)screen->machine->driver_data; | |
| 65 | 85 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 66 | 86 | |
| 67 | 87 | /* tilemap layout is a bit strange ... */ |
| 68 | 88 | rectangle clip; |
| 69 | 89 | clip.min_x = visarea->min_x; |
| 70 | clip.max_x = 256-1; | |
| 90 | clip.max_x = 256 - 1; | |
| 71 | 91 | clip.min_y = visarea->min_y; |
| 72 | 92 | clip.max_y = visarea->max_y; |
| 73 | tilemap_set_scrollx(mogura_tilemap,0, 256); | |
| 74 | tilemap_draw(bitmap,&clip,mogura_tilemap,0,0); | |
| 93 | tilemap_set_scrollx(state->tilemap, 0, 256); | |
| 94 | tilemap_draw(bitmap, &clip, state->tilemap, 0, 0); | |
| 75 | 95 | |
| 76 | 96 | clip.min_x = 256; |
| 77 | clip.max_x = 512-1; | |
| 97 | clip.max_x = 512 - 1; | |
| 78 | 98 | clip.min_y = visarea->min_y; |
| 79 | 99 | clip.max_y = visarea->max_y; |
| 80 | tilemap_set_scrollx(mogura_tilemap,0, -128); | |
| 81 | tilemap_draw(bitmap,&clip,mogura_tilemap,0,0); | |
| 100 | tilemap_set_scrollx(state->tilemap, 0, -128); | |
| 101 | tilemap_draw(bitmap, &clip, state->tilemap, 0, 0); | |
| 82 | 102 | |
| 83 | 103 | return 0; |
| 84 | 104 | } |
| 85 | 105 | |
| 86 | 106 | static WRITE8_HANDLER( mogura_tileram_w ) |
| 87 | 107 | { |
| 88 | mogura_tileram[offset] = data; | |
| 89 | tilemap_mark_tile_dirty(mogura_tilemap,offset&0x7ff); | |
| 108 | mogura_state *state = (mogura_state *)space->machine->driver_data; | |
| 109 | state->tileram[offset] = data; | |
| 110 | tilemap_mark_tile_dirty(state->tilemap, offset & 0x7ff); | |
| 90 | 111 | } |
| 91 | 112 | |
| 92 | 113 | static WRITE8_HANDLER(mogura_dac_w) |
| 93 | 114 | { |
| 94 | dac_data_w(devtag_get_device(space->machine, "dac1"), data & 0xf0 ); /* left */ | |
| 95 | dac_data_w(devtag_get_device(space->machine, "dac2"), (data & 0x0f)<<4 ); /* right */ | |
| 115 | mogura_state *state = (mogura_state *)space->machine->driver_data; | |
| 116 | dac_data_w(state->dac1, data & 0xf0); /* left */ | |
| 117 | dac_data_w(state->dac2, (data & 0x0f) << 4); /* right */ | |
| 96 | 118 | } |
| 97 | 119 | |
| 98 | 120 | |
| 99 | ||
| 100 | ||
| 101 | 121 | static WRITE8_HANDLER ( mogura_gfxram_w ) |
| 102 | 122 | { |
| 103 | mogura_gfxram[offset] = data ; | |
| 123 | mogura_state *state = (mogura_state *)space->machine->driver_data; | |
| 124 | state->gfxram[offset] = data ; | |
| 104 | 125 | |
| 105 | gfx_element_mark_dirty(space->machine->gfx[0], offset/16); | |
| 126 | gfx_element_mark_dirty(space->machine->gfx[0], offset / 16); | |
| 106 | 127 | } |
| 107 | 128 | |
| 108 | 129 | |
| 109 | 130 | static ADDRESS_MAP_START( mogura_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 110 | 131 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 111 | 132 | AM_RANGE(0xc000, 0xdfff) AM_RAM // main ram |
| 112 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(mogura_gfxram_w) AM_BASE(&mogura_gfxram) // ram based characters | |
| 113 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(mogura_tileram_w) AM_BASE(&mogura_tileram) // tilemap | |
| 133 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(mogura_gfxram_w) AM_BASE_MEMBER(mogura_state, gfxram) // ram based characters | |
| 134 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(mogura_tileram_w) AM_BASE_MEMBER(mogura_state, tileram) // tilemap | |
| 114 | 135 | ADDRESS_MAP_END |
| 115 | 136 | |
| 116 | 137 | static ADDRESS_MAP_START( mogura_io_map, ADDRESS_SPACE_IO, 8 ) |
| r7500 | r7501 | |
| 170 | 191 | GFXDECODE_ENTRY( NULL, 0, tiles8x8_layout, 0, 8 ) |
| 171 | 192 | GFXDECODE_END |
| 172 | 193 | |
| 194 | static MACHINE_START( mogura ) | |
| 195 | { | |
| 196 | mogura_state *state = (mogura_state *)machine->driver_data; | |
| 197 | ||
| 198 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 199 | state->dac1 = devtag_get_device(machine, "dac1"); | |
| 200 | state->dac2 = devtag_get_device(machine, "dac2"); | |
| 201 | } | |
| 202 | ||
| 173 | 203 | static MACHINE_DRIVER_START( mogura ) |
| 204 | ||
| 205 | /* driver data */ | |
| 206 | MDRV_DRIVER_DATA(mogura_state) | |
| 207 | ||
| 174 | 208 | /* basic machine hardware */ |
| 175 | 209 | MDRV_CPU_ADD("maincpu", Z80,3000000) /* 3 MHz */ |
| 176 | 210 | MDRV_CPU_PROGRAM_MAP(mogura_map) |
| 177 | 211 | MDRV_CPU_IO_MAP(mogura_io_map) |
| 178 | 212 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 179 | 213 | |
| 214 | MDRV_MACHINE_START(mogura) | |
| 215 | ||
| 180 | 216 | MDRV_GFXDECODE(mogura) |
| 181 | 217 | |
| 182 | 218 | /* video hardware */ |
| r7500 | r7501 | |
| 211 | 247 | ROM_LOAD( "gx141.7j", 0x00, 0x20, CRC(b21c5d5f) SHA1(6913c840dd69a7d4687f4c4cbe3ff12300f62bc2) ) |
| 212 | 248 | ROM_END |
| 213 | 249 | |
| 214 | GAME( 1991, mogura, 0, mogura, mogura, 0, ROT0, "Konami", "Mogura Desse (Japan)", | |
| 250 | GAME( 1991, mogura, 0, mogura, mogura, 0, ROT0, "Konami", "Mogura Desse (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 113 | 113 | #include "cpu/m68000/m68000.h" |
| 114 | 114 | #include "sound/2203intf.h" |
| 115 | 115 | |
| 116 | typedef struct _ddealer_state ddealer_state; | |
| 117 | struct _ddealer_state | |
| 116 | class ddealer_state | |
| 118 | 117 | { |
| 118 | public: | |
| 119 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ddealer_state(machine)); } | |
| 120 | ||
| 121 | ddealer_state(running_machine &machine) { } | |
| 122 | ||
| 119 | 123 | /* memory pointers */ |
| 120 | 124 | UINT16 * mcu_shared_ram; |
| 121 | 125 | UINT16 * work_ram; |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include "sound/ay8910.h" |
| 25 | 25 | |
| 26 | 26 | |
| 27 | typedef struct _dacholer_state dacholer_state; | |
| 28 | struct _dacholer_state | |
| 27 | class dacholer_state | |
| 29 | 28 | { |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dacholer_state(machine)); } | |
| 31 | ||
| 32 | dacholer_state(running_machine &machine) { } | |
| 33 | ||
| 30 | 34 | /* memory pointers */ |
| 31 | 35 | UINT8 * bgvideoram; |
| 32 | 36 | UINT8 * fgvideoram; |
| r7500 | r7501 | |
|---|---|---|
| 4606 | 4606 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4607 | 4607 | ROM_END |
| 4608 | 4608 | |
| 4609 | ROM_START( oceanhun ) /* Step 2.0 317-0244-COM security chip (837-13666-com security board) */ | |
| 4610 | ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */ | |
| 4611 | // CROM | |
| 4612 | ROM_LOAD64_WORD_SWAP( "epr21114.17", 0x000006, 0x200000, CRC(3adfcb9d) SHA1(22307e36a48e59ab881d6df2fbf2864f6a8b239c) ) | |
| 4613 | ROM_LOAD64_WORD_SWAP( "epr21115.18", 0x000004, 0x200000, CRC(0bb9c107) SHA1(9778b9d020669a5f5736c80e77f0fb1c7d0e1f1b) ) | |
| 4614 | ROM_LOAD64_WORD_SWAP( "epr21116.19", 0x000002, 0x200000, CRC(69e31e85) SHA1(0dbba531fd9a7e0ca7ca9d25d8be41050e809cf7) ) | |
| 4615 | ROM_LOAD64_WORD_SWAP( "epr21117.20", 0x000000, 0x200000, CRC(58d985f1) SHA1(1a3376906212a8a3bfb196ea29b5e4455a30e8f2) ) | |
| 4609 | 4616 | |
| 4617 | // CROM1 | |
| 4618 | ROM_LOAD64_WORD_SWAP( "mpr21082.5", 0x1800006, 0x400000, CRC(5bfeaa64) SHA1(3aa9f0b10c17e999dc917e3ff888887f42c54d31) ) | |
| 4619 | ROM_LOAD64_WORD_SWAP( "mpr21083.6", 0x1800004, 0x400000, CRC(667e236f) SHA1(a3354a72ba3f535cbe54af592eafda1a9816a6e6) ) | |
| 4620 | ROM_LOAD64_WORD_SWAP( "mpr21084.7", 0x1800002, 0x400000, CRC(36d5c4c1) SHA1(827590934023313e006330c66fe69763559effae) ) | |
| 4621 | ROM_LOAD64_WORD_SWAP( "mpr21085.8", 0x1800000, 0x400000, CRC(8d62406a) SHA1(d8be8a7bf6f8c48c07a5532f772101888e65f9d4) ) | |
| 4622 | ||
| 4623 | // CROM2 | |
| 4624 | ROM_LOAD64_WORD_SWAP( "mpr21086.9", 0x2800006, 0x400000, CRC(1e704e51) SHA1(970f19521aea6802276f46a20b39d23f23e09b84) ) | |
| 4625 | ROM_LOAD64_WORD_SWAP( "mpr21087.10", 0x2800004, 0x400000, CRC(5db59035) SHA1(6e511e1819a48ca4d437587f3c9a14dc530352fe) ) | |
| 4626 | ROM_LOAD64_WORD_SWAP( "mpr21088.11", 0x2800002, 0x400000, CRC(7730742b) SHA1(267444812a07ff4cf69da8545d4a7a2de1a3ba29) ) | |
| 4627 | ROM_LOAD64_WORD_SWAP( "mpr21089.12", 0x2800000, 0x400000, CRC(a74d2dcb) SHA1(449a188a7e5a21e2b51748cf7ceae84e2e3beab4) ) | |
| 4628 | ||
| 4629 | // CROM3 | |
| 4630 | ROM_LOAD64_WORD_SWAP( "mpr21090.13", 0x3800006, 0x400000, CRC(7a95c388) SHA1(9a0f8b4e3bf0670d4f838a6fb18f29f5e1b3721b) ) | |
| 4631 | ROM_LOAD64_WORD_SWAP( "mpr21091.14", 0x3800004, 0x400000, CRC(4031b961) SHA1(0c663171f15dea67709e7ffc3f45b7571e745232) ) | |
| 4632 | ROM_LOAD64_WORD_SWAP( "mpr21092.15", 0x3800002, 0x400000, CRC(0ce200d9) SHA1(dd27ee6754df1330544a61ca6ec1ec2e79d11284) ) | |
| 4633 | ROM_LOAD64_WORD_SWAP( "mpr21093.16", 0x3800000, 0x400000, CRC(6eae1fc4) SHA1(e83671d1ba7bcc8c8a577c725b54b7caa2e3666e) ) | |
| 4634 | ||
| 4635 | ROM_REGION( 0x2000000, "user3", 0 ) /* Video ROMs Part 1 */ | |
| 4636 | ROM_LOAD_VROM( "mpr21098.26", 0x000002, 0x400000, CRC(91e71855) SHA1(d3dcea5e983b3a9139e0091a13e3f4b2764417b8) ) | |
| 4637 | ROM_LOAD_VROM( "mpr21099.27", 0x000000, 0x400000, CRC(308a2768) SHA1(c6f2eefc7195541049c6c3b05495884be4876b48) ) | |
| 4638 | ROM_LOAD_VROM( "mpr21100.28", 0x000006, 0x400000, CRC(5149b286) SHA1(3a30f2a356fd7625b0d41976b9ef945e25e270b9) ) | |
| 4639 | ROM_LOAD_VROM( "mpr21101.29", 0x000004, 0x400000, CRC(e9ed4250) SHA1(decd47ab5ac251faa4a6bfd3f83dcaa24631ad2b) ) | |
| 4640 | ROM_LOAD_VROM( "mpr21102.30", 0x00000a, 0x400000, CRC(06c6d4fc) SHA1(e3a369f26a7a477752ca8459c5bd5b2c44ba5a6e) ) | |
| 4641 | ROM_LOAD_VROM( "mpr21103.31", 0x000008, 0x400000, CRC(17c4b27a) SHA1(aec6436bf74af251b0c84d4f54b5fbad47b44f4c) ) | |
| 4642 | ROM_LOAD_VROM( "mpr21104.32", 0x00000e, 0x400000, CRC(f6f80ffb) SHA1(cd7c61cb660ebe7a686fad7a176807da12381f70) ) | |
| 4643 | ROM_LOAD_VROM( "mpr21105.33", 0x00000c, 0x400000, CRC(99bdb52b) SHA1(8719a9871756d94ce21891082d97e897dcab43b0) ) | |
| 4644 | ||
| 4645 | ROM_REGION( 0x2000000, "user4", 0 ) /* Video ROMs Part 2 */ | |
| 4646 | ROM_LOAD_VROM( "mpr21106.34", 0x000002, 0x400000, CRC(ad2b7981) SHA1(958a6af5266fa9f4361c3b93f51ada2bb018e29b) ) | |
| 4647 | ROM_LOAD_VROM( "mpr21107.35", 0x000000, 0x400000, CRC(e108ff62) SHA1(8679049ef2c60f614e7a7fe9712815c1d4a89235) ) | |
| 4648 | ROM_LOAD_VROM( "mpr21108.36", 0x000006, 0x400000, CRC(cddc7a6e) SHA1(e20461d9f13da062c2ad1463a4b22716486a0fa3) ) | |
| 4649 | ROM_LOAD_VROM( "mpr21109.37", 0x000004, 0x400000, CRC(92d6141d) SHA1(ad26e8451568f1215d7bdc16511d645ddbefc74a) ) | |
| 4650 | ROM_LOAD_VROM( "mpr21110.38", 0x00000a, 0x400000, CRC(4d6e3148) SHA1(52faf77ab85a6cb794d7ccdc751af444f32f913d) ) | |
| 4651 | ROM_LOAD_VROM( "mpr21111.39", 0x000008, 0x400000, CRC(0a046d7a) SHA1(b3134c60486baec82b899439cd90b5aa9d7e9a79) ) | |
| 4652 | ROM_LOAD_VROM( "mpr21112.40", 0x00000e, 0x400000, CRC(9afd9feb) SHA1(068600364d7e8218c02c04c5eef041e0a1e14968) ) | |
| 4653 | ROM_LOAD_VROM( "mpr21113.41", 0x00000c, 0x400000, CRC(864bf325) SHA1(e78aa9aa03425d473c8337b8546e590687e06226) ) | |
| 4654 | ||
| 4655 | ROM_REGION( 0x100000, "audiocpu", 0 ) /* 68000 code */ | |
| 4656 | ROM_LOAD16_WORD_SWAP( "epr21118.21", 0x080000, 0x080000, CRC(598c00f0) SHA1(75e97abd6fff06547b628003c9d6498e3374208c) ) | |
| 4657 | ||
| 4658 | ROM_REGION( 0x1000000, "samples", 0 ) /* SCSP samples */ | |
| 4659 | ROM_LOAD( "mpr21094.22", 0x000000, 0x400000, CRC(c262b80a) SHA1(b9566474612c8359c40c416c909003b462aff3a3) ) | |
| 4660 | ROM_LOAD( "mpr21096.24", 0x400000, 0x400000, CRC(0a0021a0) SHA1(6409a88c895ba33a884d7e6f3f5bdded23ea65ac) ) | |
| 4661 | ROM_LOAD( "mpr21095.23", 0x800000, 0x400000, CRC(16d27a0a) SHA1(e21582d261ba9a7ee59fe3caf4549d4fe105a76c) ) | |
| 4662 | ROM_LOAD( "mpr21097.25", 0xc00000, 0x400000, CRC(0d8033fc) SHA1(d849a99d5f906d3a8f07b8f14183af14fd0d96e9) ) | |
| 4663 | ||
| 4664 | ROM_REGION( 0x20000, "cpu2", 0 ) /* Z80 code */ | |
| 4665 | ROM_FILL( 0x000000, 0x20000, 0 ) | |
| 4666 | ||
| 4667 | ROM_REGION( 0x1000000, "dsb", 0 ) /* DSB samples */ | |
| 4668 | ROM_FILL( 0x000000, 0x1000000, 0 ) | |
| 4669 | ||
| 4670 | ROM_REGION( 0x80000, "scsp1", 0 ) /* first SCSP's RAM */ | |
| 4671 | ROM_FILL( 0x000000, 0x80000, 0 ) | |
| 4672 | ||
| 4673 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ | |
| 4674 | ROM_FILL( 0x000000, 0x80000, 0 ) | |
| 4675 | ROM_END | |
| 4676 | ||
| 4677 | ROM_START( lamachin ) /* Step 2.0 317-0242-COM security chip (837-13576-com security board) */ | |
| 4678 | ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */ | |
| 4679 | // CROM | |
| 4680 | ROM_LOAD64_WORD_SWAP( "epr21483.17", 0x000006, 0x200000, CRC(940637c2) SHA1(89894b603c17d27f57500ec8030eaa7e0e991479) ) | |
| 4681 | ROM_LOAD64_WORD_SWAP( "epr21484.18", 0x000004, 0x200000, CRC(58102168) SHA1(38dd9a41f653c0a84ac927b476f014c949454ffa) ) | |
| 4682 | ROM_LOAD64_WORD_SWAP( "epr21485.19", 0x000002, 0x200000, CRC(f68f7703) SHA1(96d67aa80d6121ccebf1d50f80d509d25bab6386) ) | |
| 4683 | ROM_LOAD64_WORD_SWAP( "epr21486.20", 0x000000, 0x200000, CRC(64de433f) SHA1(866ae858c5c38397878836460c7418045572aff0) ) | |
| 4684 | ||
| 4685 | // CROM0 | |
| 4686 | ROM_LOAD64_WORD_SWAP( "mpr21451.1", 0x800006, 0x400000, CRC(42bdc56c) SHA1(e6fd07a7e9c1c5b090aacb3c68c0db0b0b95b274) ) | |
| 4687 | ROM_LOAD64_WORD_SWAP( "mpr21452.2", 0x800004, 0x400000, CRC(01ac050c) SHA1(40a144c30db7be30e99ec1164f05ecbc1a7c116f) ) | |
| 4688 | ROM_LOAD64_WORD_SWAP( "mpr21453.3", 0x800002, 0x400000, CRC(082d98ab) SHA1(48d8efc6dbba9952e69be711a90fbe749ddc60ac) ) | |
| 4689 | ROM_LOAD64_WORD_SWAP( "mpr21454.4", 0x800000, 0x400000, CRC(97ff94a7) SHA1(f22dc44bc7ed4ad691565973e1aa1f1497c7a184) ) | |
| 4690 | ||
| 4691 | // CROM1 | |
| 4692 | ROM_LOAD64_WORD_SWAP( "mpr21455.5", 0x1800006, 0x400000, CRC(0b4a3cc5) SHA1(380e441405da244459b11e2ed7fd1eb9ee9e6d50) ) | |
| 4693 | ROM_LOAD64_WORD_SWAP( "mpr21456.6", 0x1800004, 0x400000, CRC(73a50547) SHA1(ac441e4b389e5572fdb1eb2378666ba85755cb5c) ) | |
| 4694 | ROM_LOAD64_WORD_SWAP( "mpr21457.7", 0x1800002, 0x400000, CRC(2034dbd4) SHA1(357729015782fdcd1332c6ad510b2e4c0575979f) ) | |
| 4695 | ROM_LOAD64_WORD_SWAP( "mpr21458.8", 0x1800000, 0x400000, CRC(b748f5a1) SHA1(c4e2ee16c58f6a8147b1d33626bb6d59abe27164) ) | |
| 4696 | ||
| 4697 | // CROM2 | |
| 4698 | ROM_LOAD64_WORD_SWAP( "mpr21459.9", 0x2800006, 0x400000, CRC(71a7b6b3) SHA1(ecfa0b6144a6b1cef2580b1ff8719bef9df13745) ) | |
| 4699 | ROM_LOAD64_WORD_SWAP( "mpr21460.10", 0x2800004, 0x400000, CRC(02268361) SHA1(c6be05d1df9871585c2c56d6be71ccbb0234ded8) ) | |
| 4700 | ROM_LOAD64_WORD_SWAP( "mpr21461.11", 0x2800002, 0x400000, CRC(33d8f0da) SHA1(f77fd50b06a05c0809d3e90d70525ff67136908b) ) | |
| 4701 | ROM_LOAD64_WORD_SWAP( "mpr21462.12", 0x2800000, 0x400000, CRC(03d22ee8) SHA1(cb0c80aefc2aa7127a5f882ecb61c29f2cd3eb4e) ) | |
| 4702 | ||
| 4703 | ||
| 4704 | ROM_REGION( 0x2000000, "user3", 0 ) /* Video ROMs Part 1 */ | |
| 4705 | ROM_LOAD_VROM( "mpr21467.26", 0x000002, 0x400000, CRC(73635100) SHA1(70850cbd39ac5ddc443c9c24ac24c554d1565b1a) ) | |
| 4706 | ROM_LOAD_VROM( "mpr21468.27", 0x000000, 0x400000, CRC(462e5c81) SHA1(05eb1f580a9dcd1f59ccb2791e974325494e5910) ) | |
| 4707 | ROM_LOAD_VROM( "mpr21469.28", 0x000006, 0x400000, CRC(4ba3f192) SHA1(c9afc434165b4dfcaa856f8d5c954bc1484f38f0) ) | |
| 4708 | ROM_LOAD_VROM( "mpr21470.29", 0x000004, 0x400000, CRC(670f0df5) SHA1(fcb181231003e6a4225dfaedb36d2814d8137a46) ) | |
| 4709 | ROM_LOAD_VROM( "mpr21471.30", 0x00000a, 0x400000, CRC(1f07e6e3) SHA1(b4948d5b3763d95a0f8e5364bd41f1a87d1ab468) ) | |
| 4710 | ROM_LOAD_VROM( "mpr21472.31", 0x000008, 0x400000, CRC(e6dc64a3) SHA1(047681ea60e2714aad9117114cbcf40a70884d1c) ) | |
| 4711 | ROM_LOAD_VROM( "mpr21473.32", 0x00000e, 0x400000, CRC(d1c9b54a) SHA1(e670431da482a6a58a83ac6b47ab2649033db9c8) ) | |
| 4712 | ROM_LOAD_VROM( "mpr21474.33", 0x00000c, 0x400000, CRC(aa2f19ae) SHA1(9abae5a2f7719bbc61ae08cf0dc88133234fe202) ) | |
| 4713 | ||
| 4714 | ROM_REGION( 0x2000000, "user4", 0 ) /* Video ROMs Part 2 */ | |
| 4715 | ROM_LOAD_VROM( "mpr21475.34", 0x000002, 0x400000, CRC(bae9b381) SHA1(0be17607b27f2733a14183b371fe04b52a6cb416) ) | |
| 4716 | ROM_LOAD_VROM( "mpr21476.35", 0x000000, 0x400000, CRC(3833df51) SHA1(1ff02356d8af427f5d0e12b513a6fe010db0a9de) ) | |
| 4717 | ROM_LOAD_VROM( "mpr21477.36", 0x000006, 0x400000, CRC(46032c35) SHA1(4445529a55bfdde5890f13d36716ad2c6be9513e) ) | |
| 4718 | ROM_LOAD_VROM( "mpr21478.37", 0x000004, 0x400000, CRC(35ef75b8) SHA1(a115d94f87a29aec87434bd9fcbbeeece5f558cd) ) | |
| 4719 | ROM_LOAD_VROM( "mpr21479.38", 0x00000a, 0x400000, CRC(783e8ece) SHA1(6ad89c5f8c8583859830b9f1c54a144630e13203) ) | |
| 4720 | ROM_LOAD_VROM( "mpr21480.39", 0x000008, 0x400000, CRC(c947bcb8) SHA1(15efe0541c068263a8902ae2bbe0f4614f68914c) ) | |
| 4721 | ROM_LOAD_VROM( "mpr21481.40", 0x00000e, 0x400000, CRC(6ce566ac) SHA1(cfacc090cce3cfcfde73d5ed9439ff96c1a35f48) ) | |
| 4722 | ROM_LOAD_VROM( "mpr21482.41", 0x00000c, 0x400000, CRC(e995f554) SHA1(274aed8361884137a4b52153720ae4dc4b75747b) ) | |
| 4723 | ||
| 4724 | ROM_REGION( 0x100000, "audiocpu", 0 ) /* 68000 code */ | |
| 4725 | ROM_LOAD16_WORD_SWAP( "epr21487.21", 0x080000, 0x080000, CRC(c2942448) SHA1(71836a4106b6f5a63f34db09503ae538dd3320db) ) | |
| 4726 | ||
| 4727 | ROM_REGION( 0x1000000, "samples", 0 ) /* SCSP samples */ | |
| 4728 | ROM_LOAD( "mpr21463.22", 0x000000, 0x400000, CRC(0e6d6c0e) SHA1(d703c1021cf9169aec9b054d34f2ef0284fcfcb3) ) | |
| 4729 | ROM_LOAD( "mpr21465.24", 0x400000, 0x400000, CRC(1a62d925) SHA1(a3a8047f1898dfd76fe1747df18bfc1e87bf35bd) ) | |
| 4730 | ROM_LOAD( "mpr21464.23", 0x800000, 0x400000, CRC(8230c1de) SHA1(6ba3bc72a55d5ce79f37804348064c50431fd490) ) | |
| 4731 | ROM_LOAD( "mpr21466.25", 0xc00000, 0x400000, CRC(ca20359e) SHA1(1948f71f7eea27f757f0d508ee1390aeb576a8fa) ) | |
| 4732 | ||
| 4733 | ROM_REGION( 0x20000, "cpu2", 0 ) /* Z80 code */ | |
| 4734 | ROM_FILL( 0x000000, 0x20000, 0 ) | |
| 4735 | ||
| 4736 | ROM_REGION( 0x1000000, "dsb", 0 ) /* DSB samples */ | |
| 4737 | ROM_FILL( 0x000000, 0x1000000, 0 ) | |
| 4738 | ||
| 4739 | ROM_REGION( 0x80000, "scsp1", 0 ) /* first SCSP's RAM */ | |
| 4740 | ROM_FILL( 0x000000, 0x80000, 0 ) | |
| 4741 | ||
| 4742 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ | |
| 4743 | ROM_FILL( 0x000000, 0x80000, 0 ) | |
| 4744 | ROM_END | |
| 4745 | ||
| 4610 | 4746 | /* Model 3 sound board emulation */ |
| 4611 | 4747 | |
| 4612 | 4748 | static WRITE16_HANDLER( model3snd_ctrl ) |
| r7500 | r7501 | |
| 5271 | 5407 | /* Model 3 Step 2.0 */ |
| 5272 | 5408 | GAME( 1997, vs2, 0, model3_20, model3, vs2, ROT0, "Sega", "Virtua Striker 2 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| 5273 | 5409 | GAME( 1997, harley, 0, model3_20, harley, harley, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| 5410 | GAME( 1998, lamachin, 0, model3_20, model3, model3_20, ROT0, "Sega", "L.A. Machineguns", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) | |
| 5411 | GAME( 1998, oceanhun, 0, model3_20, model3, model3_20, ROT0, "Sega", "The Ocean Hunter", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) | |
| 5274 | 5412 | GAME( 1998, skichamp, 0, model3_20, skichamp, skichamp, ROT0, "Sega", "Ski Champ", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| 5275 | 5413 | GAME( 1998, srally2, 0, model3_20, scud, srally2, ROT0, "Sega", "Sega Rally 2", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| 5276 | 5414 | GAME( 1998, srally2x, 0, model3_20, scud, srally2, ROT0, "Sega", "Sega Rally 2 DX", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 90 | 90 | #include "emu.h" |
| 91 | 91 | #include "cpu/m68000/m68000.h" |
| 92 | 92 | #include "cpu/h6280/h6280.h" |
| 93 | #include "includes/decocrpt.h" | |
| 94 | #include "includes/decoprot.h" | |
| 95 | #include "includes/funkyjet.h" | |
| 93 | 96 | #include "sound/2151intf.h" |
| 94 | 97 | #include "sound/okim6295.h" |
| 98 | #include "video/deco16ic.h" | |
| 95 | 99 | |
| 96 | #include "includes/decocrpt.h" | |
| 97 | #include "includes/decoprot.h" | |
| 98 | #include "includes/deco16ic.h" | |
| 99 | 100 | |
| 100 | VIDEO_START( funkyjet ); | |
| 101 | VIDEO_UPDATE( funkyjet ); | |
| 102 | ||
| 103 | 101 | /******************************************************************************/ |
| 104 | 102 | |
| 105 | 103 | static ADDRESS_MAP_START( funkyjet_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 106 | 104 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 107 | 105 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 108 | 106 | AM_RANGE(0x140000, 0x143fff) AM_RAM |
| 109 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_ | |
| 107 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 110 | 108 | AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(deco16_146_funkyjet_prot_r, deco16_146_funkyjet_prot_w) AM_BASE(&deco16_prot_ram) |
| 111 | 109 | AM_RANGE(0x184000, 0x184001) AM_WRITENOP |
| 112 | 110 | AM_RANGE(0x188000, 0x188001) AM_WRITENOP |
| 113 | AM_RANGE(0x300000, 0x30000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 114 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 115 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 116 | AM_RANGE(0x340000, 0x340bff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 117 | AM_RANGE(0x342000, 0x342bff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 111 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 112 | AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 113 | AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 114 | AM_RANGE(0x340000, 0x340bff) AM_RAM AM_BASE_MEMBER(funkyjet_state, pf1_rowscroll) | |
| 115 | AM_RANGE(0x342000, 0x342bff) AM_RAM AM_BASE_MEMBER(funkyjet_state, pf2_rowscroll) | |
| 118 | 116 | ADDRESS_MAP_END |
| 119 | 117 | |
| 120 | 118 | /******************************************************************************/ |
| r7500 | r7501 | |
| 277 | 275 | |
| 278 | 276 | /******************************************************************************/ |
| 279 | 277 | |
| 280 | static void sound_irq(running_device *device, int state) | |
| 278 | static void sound_irq( running_device *device, int state ) | |
| 281 | 279 | { |
| 282 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 280 | funkyjet_state *driver_state = (funkyjet_state *)device->machine->driver_data; | |
| 281 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 283 | 282 | } |
| 284 | 283 | |
| 285 | 284 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 287 | 286 | sound_irq |
| 288 | 287 | }; |
| 289 | 288 | |
| 289 | static const deco16ic_interface funkyjet_deco16ic_intf = | |
| 290 | { | |
| 291 | "screen", | |
| 292 | 1, 0, 1, | |
| 293 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 294 | 0, 16, 0, 16, /* color base (default values) */ | |
| 295 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 296 | NULL, NULL, NULL, NULL | |
| 297 | }; | |
| 298 | ||
| 299 | static MACHINE_START( funkyjet ) | |
| 300 | { | |
| 301 | funkyjet_state *state = (funkyjet_state *)machine->driver_data; | |
| 302 | ||
| 303 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 304 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 305 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 306 | } | |
| 307 | ||
| 290 | 308 | static MACHINE_DRIVER_START( funkyjet ) |
| 291 | 309 | |
| 310 | /* driver data */ | |
| 311 | MDRV_DRIVER_DATA(funkyjet_state) | |
| 312 | ||
| 292 | 313 | /* basic machine hardware */ |
| 293 | 314 | MDRV_CPU_ADD("maincpu", M68000, 14000000) /* 28 MHz crystal */ |
| 294 | 315 | MDRV_CPU_PROGRAM_MAP(funkyjet_map) |
| r7500 | r7501 | |
| 297 | 318 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ |
| 298 | 319 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 299 | 320 | |
| 321 | MDRV_MACHINE_START(funkyjet) | |
| 322 | ||
| 300 | 323 | /* video hardware */ |
| 301 | 324 | MDRV_SCREEN_ADD("screen", RASTER) |
| 302 | 325 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 308 | 331 | MDRV_GFXDECODE(funkyjet) |
| 309 | 332 | MDRV_PALETTE_LENGTH(1024) |
| 310 | 333 | |
| 311 | MDRV_VIDEO_START(funkyjet) | |
| 312 | 334 | MDRV_VIDEO_UPDATE(funkyjet) |
| 313 | 335 | |
| 336 | MDRV_DECO16IC_ADD("deco_custom", funkyjet_deco16ic_intf) | |
| 337 | ||
| 314 | 338 | /* sound hardware */ |
| 315 | 339 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 316 | 340 |
| r7500 | r7501 | |
|---|---|---|
| 97 | 97 | #include "emu.h" |
| 98 | 98 | #include "cpu/z80/z80.h" |
| 99 | 99 | |
| 100 | static bitmap_t *tile, *obj1, *obj2; | |
| 101 | static tilemap_t *tx_tilemap; | |
| 100 | class marinedt_state | |
| 101 | { | |
| 102 | public: | |
| 103 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, marinedt_state(machine)); } | |
| 102 | 104 | |
| 103 | ||
| 105 | marined | |
| 104 | 106 | |
| 105 | static UINT8 marinedt_obj1_a, marinedt_obj1_x, marinedt_obj1_y; | |
| 106 | static UINT8 marinedt_obj2_a, marinedt_obj2_x, marinedt_obj2_y; | |
| 107 | static UINT8 marinedt_pd, marinedt_pf; | |
| 108 | static UINT8 marinedt_music, marinedt_sound; | |
| 109 | static UINT8 coll, cx, cyr, cyq; | |
| 110 | static UINT8 collh, cxh, cyrh, cyqh; | |
| 107 | /* memory pointers */ | |
| 108 | UINT8 * tx_tileram; | |
| 111 | 109 | |
| 110 | /* video-related */ | |
| 111 | bitmap_t *tile, *obj1, *obj2; | |
| 112 | tilemap_t *tx_tilemap; | |
| 113 | ||
| 114 | UINT8 obj1_a, obj1_x, obj1_y; | |
| 115 | UINT8 obj2_a, obj2_x, obj2_y; | |
| 116 | UINT8 pd, pf; | |
| 117 | UINT8 music, sound; | |
| 118 | UINT8 coll, cx, cyr, cyq; | |
| 119 | UINT8 collh, cxh, cyrh, cyqh; | |
| 120 | }; | |
| 121 | ||
| 122 | ||
| 112 | 123 | static WRITE8_HANDLER( tx_tileram_w ) |
| 113 | 124 | { |
| 114 | tx_tileram[offset] = data; | |
| 115 | tilemap_mark_tile_dirty(tx_tilemap, offset); | |
| 125 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 126 | ||
| 127 | state->tx_tileram[offset] = data; | |
| 128 | tilemap_mark_tile_dirty(state->tx_tilemap, offset); | |
| 116 | 129 | } |
| 117 | 130 | |
| 118 | 131 | static READ8_HANDLER( marinedt_port1_r ) |
| 119 | 132 | { |
| 120 | ||
| 133 | | |
| 121 | 134 | |
| 135 | //might need to be reversed for cocktail stuff | |
| 136 | ||
| 122 | 137 | /* x/y multiplexed */ |
| 123 | return input_port_read(space->machine, (( | |
| 138 | return input_port_read(space->machine, ((sta | |
| 124 | 139 | } |
| 125 | 140 | |
| 126 | 141 | static READ8_HANDLER( marinedt_coll_r ) |
| r7500 | r7501 | |
| 131 | 146 | //----x--- obj1 to playfield collision |
| 132 | 147 | //-----xxx unused |
| 133 | 148 | |
| 134 | return coll | collh; | |
| 149 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 150 | return state->coll | state->collh; | |
| 135 | 151 | } |
| 136 | 152 | |
| 137 | 153 | //are these returning only during a collision? |
| r7500 | r7501 | |
| 144 | 160 | //xxxx---- unknown |
| 145 | 161 | //----xxxx x pos in tile ram |
| 146 | 162 | |
| 163 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 147 | 164 | UINT8 *RAM = memory_region(space->machine, "maincpu"); |
| 148 | if(RAM[0x430e]) --cx; else ++cx; | |
| 149 | //figure out why inc/dec based on 430e? | |
| 150 | return cx | (cxh<<4); | |
| 165 | ||
| 166 | if (RAM[0x430e]) | |
| 167 | --state->cx; | |
| 168 | else | |
| 169 | ++state->cx; | |
| 170 | ||
| 171 | //figure out why inc/dec based on 430e? | |
| 172 | return state->cx | (state->cxh << 4); | |
| 151 | 173 | } |
| 152 | 174 | |
| 153 | 175 | static READ8_HANDLER( marinedt_obj1_yr_r ) |
| r7500 | r7501 | |
| 155 | 177 | //76543210 |
| 156 | 178 | //xxxx---- unknown |
| 157 | 179 | //----xxxx row in current screen quarter |
| 158 | //has to be +1 if cx went over? | |
| 159 | if (cx==0x10) cyr++; | |
| 160 | 180 | |
| 161 | return cyr | (cyrh<<4); | |
| 181 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 182 | ||
| 183 | //has to be +1 if cx went over? | |
| 184 | if (state->cx == 0x10) | |
| 185 | state->cyr++; | |
| 186 | ||
| 187 | return state->cyr | (state->cyrh << 4); | |
| 162 | 188 | } |
| 163 | 189 | |
| 164 | 190 | static READ8_HANDLER( marinedt_obj1_yq_r ) |
| r7500 | r7501 | |
| 169 | 195 | //----xx-- unknown |
| 170 | 196 | //------xx screen quarter |
| 171 | 197 | |
| 172 | return cyq | (cyqh<<4); | |
| 198 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 199 | return state->cyq | (state->cyqh << 4); | |
| 173 | 200 | } |
| 174 | 201 | |
| 175 | static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_obj1_a = data; } | |
| 176 | static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_obj1_x = data; } | |
| 177 | static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_obj1_y = data; } | |
| 178 | static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_obj2_a = data; } | |
| 179 | static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_obj2_x = data; } | |
| 180 | static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_obj2_y = data; } | |
| 202 | static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj1_a = data; } | |
| 203 | static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj1_x = data; } | |
| 204 | static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj1_y = data; } | |
| 205 | static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj2_a = data; } | |
| 206 | static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj2_x = data; } | |
| 207 | static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->obj2_y = data; } | |
| 181 | 208 | |
| 182 | static WRITE8_HANDLER( marinedt_music_w ){ marinedt_music = data; } | |
| 209 | static WRITE8_HANDLER( marinedt_music_w ){ marinedt_state *state = (marinedt_state *)space->machine->driver_data; state->music = data; } | |
| 183 | 210 | |
| 184 | 211 | static WRITE8_HANDLER( marinedt_sound_w ) |
| 185 | 212 | { |
| r7500 | r7501 | |
| 192 | 219 | //------x- dots hit |
| 193 | 220 | //-------x ?? |
| 194 | 221 | |
| 195 | marinedt_sound = data; | |
| 222 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 223 | state->sound = data; | |
| 196 | 224 | } |
| 197 | 225 | |
| 198 | 226 | static WRITE8_HANDLER( marinedt_pd_w ) |
| r7500 | r7501 | |
| 205 | 233 | //------x- obj2 enable |
| 206 | 234 | //-------x obj1 enable |
| 207 | 235 | |
| 208 | marinedt_pd = data; | |
| 236 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 237 | state->pd = data; | |
| 209 | 238 | } |
| 210 | 239 | |
| 211 | 240 | /* |
| r7500 | r7501 | |
| 232 | 261 | //------x- ?? upright/cocktail |
| 233 | 262 | //-------x ?? service mode (coin lockout??) |
| 234 | 263 | |
| 235 | //if ((marinedt_pf & 0x07) != (data & 0x07)) | |
| 264 | marinedt_state *state = (marinedt_state *)space->machine->driver_data; | |
| 265 | ||
| 266 | //if ((state->pf & 0x07) != (data & 0x07)) | |
| 236 | 267 | // mame_printf_debug("marinedt_pf_w: %02x\n", data & 0x07); |
| 237 | 268 | |
| 238 | if (( | |
| 269 | if ((sta | |
| 239 | 270 | { |
| 240 | 271 | if (data & 0x02) |
| 241 | 272 | mame_printf_debug("tile flip\n"); |
| r7500 | r7501 | |
| 243 | 274 | mame_printf_debug("tile non-flip\n"); |
| 244 | 275 | |
| 245 | 276 | if (data & 0x02) |
| 246 | tilemap_set_flip(tx_tilemap, TILEMAP_FLIPX | TILEMAP_FLIPY); | |
| 277 | tilemap_set_flip(state->tx_tilemap, TILEMAP_FLIPX | TILEMAP_FLIPY); | |
| 247 | 278 | else |
| 248 | tilemap_set_flip(tx_tilemap, 0); | |
| 279 | tilemap_set_flip(state->tx_tilemap, 0); | |
| 249 | 280 | } |
| 250 | 281 | |
| 251 | | |
| 282 | sta | |
| 252 | 283 | |
| 253 | //if(data&0xf0) | |
| 254 | // logerror("pf:%02x %d\n",marinedt_pf); | |
| 255 | //logerror("pd:%02x %d\n",marinedt_pd, video_screen_get_frame_number(space->machine->primary_screen)); | |
| 284 | //if (data & 0xf0) | |
| 285 | // logerror("pf:%02x %d\n", state->pf); | |
| 286 | //logerror("pd:%02x %d\n", state->pd, video_screen_get_frame_number(space->machine->primary_screen)); | |
| 256 | 287 | |
| 257 | 288 | } |
| 258 | 289 | |
| r7500 | r7501 | |
| 260 | 291 | AM_RANGE(0x0000, 0x37ff) AM_ROM |
| 261 | 292 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 262 | 293 | AM_RANGE(0x4400, 0x47ff) AM_RAM //unused, vram mirror? |
| 263 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(tx_tileram_w) AM_BASE( | |
| 294 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(tx_tileram_w) AM_BASE_MEMBER(marinedt_state, tx_tileram) | |
| 264 | 295 | AM_RANGE(0x4c00, 0x4c00) AM_WRITENOP //?? maybe off by one error |
| 265 | 296 | ADDRESS_MAP_END |
| 266 | 297 | |
| r7500 | r7501 | |
| 283 | 314 | |
| 284 | 315 | |
| 285 | 316 | static INPUT_PORTS_START( marinedt ) |
| 286 | PORT_START("DSW0") | |
| 317 | PORT_START("DSW0") | |
| 287 | 318 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) |
| 288 | 319 | PORT_DIPSETTING( 0x0f, DEF_STR( 9C_1C ) ) |
| 289 | 320 | PORT_DIPSETTING( 0x0e, DEF_STR( 8C_1C ) ) |
| r7500 | r7501 | |
| 319 | 350 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_7C ) ) |
| 320 | 351 | PORT_DIPSETTING( 0x70, DEF_STR( 1C_8C ) ) |
| 321 | 352 | |
| 322 | PORT_START("IN0") | |
| 353 | PORT_START("IN0") | |
| 323 | 354 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 324 | 355 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 325 | 356 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| r7500 | r7501 | |
| 329 | 360 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) |
| 330 | 361 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 331 | 362 | |
| 332 | PORT_START("DSW1") | |
| 363 | PORT_START("DSW1") | |
| 333 | 364 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) ) |
| 334 | 365 | PORT_DIPSETTING( 0x01, "5000" ) |
| 335 | 366 | PORT_DIPSETTING( 0x00, "10000" ) |
| r7500 | r7501 | |
| 355 | 386 | PORT_DIPSETTING( 0x80, "5" ) |
| 356 | 387 | PORT_DIPSETTING( 0xc0, "6" ) |
| 357 | 388 | |
| 358 | PORT_START("TRACKX") /* | |
| 389 | PORT_START("TRACKX") /* | |
| 359 | 390 | //check all bits are used |
| 360 | 391 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE |
| 361 | 392 | |
| 362 | PORT_START("TRACKY") /* | |
| 393 | PORT_START("TRACKY") /* | |
| 363 | 394 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) |
| 364 | 395 | INPUT_PORTS_END |
| 365 | 396 | |
| r7500 | r7501 | |
| 395 | 426 | { |
| 396 | 427 | int i,r,b,g; |
| 397 | 428 | |
| 398 | for (i = 0;i < machine->config->total_colors; i++) | |
| 429 | for (i = 0; i < machine->config->total_colors; i++) | |
| 399 | 430 | { |
| 400 | int bit0,bit1,bit2; | |
| 431 | int bit0, bit1, bit2; | |
| 401 | 432 | |
| 402 | 433 | /* red component */ |
| 403 | 434 | bit0 = (~color_prom[i] >> 0) & 0x01; |
| r7500 | r7501 | |
| 415 | 446 | bit0 = (~color_prom[i] >> 5) & 0x01; |
| 416 | 447 | bit1 = (~color_prom[i] >> 6) & 0x01; |
| 417 | 448 | bit2 = (~color_prom[i] >> 7) & 0x01; |
| 418 | bit0=0; | |
| 449 | bit0 = 0; | |
| 419 | 450 | // *(palette++) = 0x92 * bit0 + 0x46 * bit1 + 0x27 * bit2; |
| 420 | 451 | b = 0x27 * bit0 + 0x46 * bit1 + 0x92 * bit2; |
| 421 | 452 | |
| r7500 | r7501 | |
| 426 | 457 | |
| 427 | 458 | static TILE_GET_INFO( get_tile_info ) |
| 428 | 459 | { |
| 429 | int code = tx_tileram[tile_index]; | |
| 460 | marinedt_state *state = (marinedt_state *)machine->driver_data; | |
| 461 | int code = state->tx_tileram[tile_index]; | |
| 430 | 462 | int color = 0; |
| 431 | 463 | int flags = TILE_FLIPX; |
| 432 | 464 | |
| r7500 | r7501 | |
| 435 | 467 | |
| 436 | 468 | static VIDEO_START( marinedt ) |
| 437 | 469 | { |
| 438 | tx_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8,32,32); | |
| 470 | marinedt_state *state = (marinedt_state *)machine->driver_data; | |
| 471 | state->tx_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 439 | 472 | |
| 440 | tilemap_set_transparent_pen(tx_tilemap, 0); | |
| 441 | tilemap_set_scrolldx(tx_tilemap, 0, 4*8); | |
| 442 | tilemap_set_scrolldy(tx_tilemap, 0, -4*8); | |
| 473 | tilemap_set_transparent_pen(state->tx_tilemap, 0); | |
| 474 | tilemap_set_scrolldx(state->tx_tilemap, 0, 4*8); | |
| 475 | tilemap_set_scrolldy(state->tx_tilemap, 0, -4*8); | |
| 443 | 476 | |
| 444 | tile = auto_bitmap_alloc(machine,32 * 8, 32 * 8, video_screen_get_format(machine->primary_screen)); | |
| 445 | obj1 = auto_bitmap_alloc(machine,32,32,video_screen_get_format(machine->primary_screen)); | |
| 446 | obj2 = auto_bitmap_alloc(machine,32,32,video_screen_get_format(machine->primary_screen)); | |
| 477 | state->tile = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, video_screen_get_format(machine->primary_screen)); | |
| 478 | state->obj1 = auto_bitmap_alloc(machine, 32, 32, video_screen_get_format(machine->primary_screen)); | |
| 479 | state->obj2 = auto_bitmap_alloc(machine, 32, 32, video_screen_get_format(machine->primary_screen)); | |
| 447 | 480 | } |
| 448 | 481 | |
| 449 | 482 | |
| r7500 | r7501 | |
| 457 | 490 | #define OBJ_COLOR(a) ((a) & 0x03) |
| 458 | 491 | #define OBJ_X(x) (256 - 32 - (x)) |
| 459 | 492 | #define OBJ_Y(y) (256 - 1 - (y)) |
| 460 | #define OBJ_FLIPX(a) (( | |
| 493 | #define OBJ_FLIPX(a) ((sta | |
| 461 | 494 | #define OBJ_FLIPY(a) ((a) & 0x80) |
| 462 | 495 | |
| 463 | 496 | static VIDEO_UPDATE( marinedt ) |
| 464 | 497 | { |
| 498 | marinedt_state *state = (marinedt_state *)screen->machine->driver_data; | |
| 465 | 499 | int sx, sy; |
| 466 | 500 | |
| 467 | bitmap_fill(tile, NULL, 0); | |
| 468 | tilemap_draw(tile, cliprect, tx_tilemap, 0, 0); | |
| 501 | bitmap_fill(state->tile, NULL, 0); | |
| 502 | tilemap_draw(state->tile, cliprect, state->tx_tilemap, 0, 0); | |
| 469 | 503 | |
| 470 | bitmap_fill(obj1, NULL, 0); | |
| 471 | drawgfx_transpen(obj1, NULL, screen->machine->gfx[1], | |
| 472 | OBJ_CODE(marinedt_obj1_a), | |
| 473 | OBJ_COLOR(marinedt_obj1_a), | |
| 474 | OBJ_FLIPX(marinedt_obj1_a), OBJ_FLIPY(marinedt_obj1_a), | |
| 504 | bitmap_fill(state->obj1, NULL, 0); | |
| 505 | drawgfx_transpen(state->obj1, NULL, screen->machine->gfx[1], | |
| 506 | OBJ_CODE(state->obj1_a), | |
| 507 | OBJ_COLOR(state->obj1_a), | |
| 508 | OBJ_FLIPX(state->obj1_a), OBJ_FLIPY(state->obj1_a), | |
| 475 | 509 | 0, 0, 0); |
| 476 | 510 | |
| 477 | bitmap_fill(obj2, NULL, 0); | |
| 478 | drawgfx_transpen(obj2, NULL, screen->machine->gfx[2], | |
| 479 | OBJ_CODE(marinedt_obj2_a), | |
| 480 | OBJ_COLOR(marinedt_obj2_a), | |
| 481 | OBJ_FLIPX(marinedt_obj2_a), OBJ_FLIPY(marinedt_obj2_a), | |
| 511 | bitmap_fill(state->obj2, NULL, 0); | |
| 512 | drawgfx_transpen(state->obj2, NULL, screen->machine->gfx[2], | |
| 513 | OBJ_CODE(state->obj2_a), | |
| 514 | OBJ_COLOR(state->obj2_a), | |
| 515 | OBJ_FLIPX(state->obj2_a), OBJ_FLIPY(state->obj2_a), | |
| 482 | 516 | 0, 0, 0); |
| 483 | 517 | |
| 484 | 518 | bitmap_fill(bitmap, NULL, 0); |
| 485 | 519 | |
| 486 | if (marinedt_pd & 0x02) | |
| 487 | copybitmap_trans(bitmap, obj2, 0, 0, OBJ_X(marinedt_obj2_x), OBJ_Y(marinedt_obj2_y), cliprect, 0); | |
| 520 | if (state->pd & 0x02) | |
| 521 | copybitmap_trans(bitmap, state->obj2, 0, 0, OBJ_X(state->obj2_x), OBJ_Y(state->obj2_y), cliprect, 0); | |
| 488 | 522 | |
| 489 | if (marinedt_pd & 0x01) | |
| 490 | copybitmap_trans(bitmap, obj1, 0, 0, OBJ_X(marinedt_obj1_x), OBJ_Y(marinedt_obj1_y), cliprect, 0); | |
| 523 | if (state->pd & 0x01) | |
| 524 | copybitmap_trans(bitmap, state->obj1, 0, 0, OBJ_X(state->obj1_x), OBJ_Y(state->obj1_y), cliprect, 0); | |
| 491 | 525 | |
| 492 | copybitmap_trans(bitmap, tile, 0, 0, 0, 0, cliprect, 0); | |
| 526 | copybitmap_trans(bitmap, state->tile, 0, 0, 0, 0, cliprect, 0); | |
| 493 | 527 | |
| 494 | coll = cx = cyr = cyq = 0; | |
| 495 | if (marinedt_pd & 0x01) | |
| 528 | state->coll = state->cx = state->cyr = state->cyq = 0; | |
| 529 | if (state->pd & 0x01) | |
| 496 | 530 | { |
| 497 | 531 | for (sx = 0; sx < 32; sx++) |
| 498 | 532 | for (sy = 0; sy < 32; sy++) |
| 499 | 533 | { |
| 500 | int x = OBJ_X(marinedt_obj1_x) + sx; | |
| 501 | int y = OBJ_Y(marinedt_obj1_y) + sy; | |
| 534 | int x = OBJ_X(state->obj1_x) + sx; | |
| 535 | int y = OBJ_Y(state->obj1_y) + sy; | |
| 502 | 536 | |
| 503 | if (x < cliprect->min_x || x > cliprect->max_x | |
| 504 | || y < cliprect->min_y || y > cliprect->max_y) | |
| 537 | if (x < cliprect->min_x || x > cliprect->max_x || y < cliprect->min_y || y > cliprect->max_y) | |
| 505 | 538 | continue; |
| 506 | 539 | |
| 507 | if (*BITMAP_ADDR16(obj1, sy, sx) == 0) | |
| 540 | if (*BITMAP_ADDR16(state->obj1, sy, sx) == 0) | |
| 508 | 541 | continue; |
| 509 | 542 | |
| 510 | if (*BITMAP_ADDR16(tile, y, x) != 0) | |
| 543 | if (*BITMAP_ADDR16(state->tile, y, x) != 0) | |
| 511 | 544 | { |
| 512 | coll = 0x08; | |
| 545 | state->coll = 0x08; | |
| 513 | 546 | |
| 514 | cx = (x % 128) / 8; | |
| 515 | cx &= 0x0f; | |
| 547 | state->cx = (x % 128) / 8; | |
| 548 | state->cx &= 0x0f; | |
| 516 | 549 | |
| 517 | cyr = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0); | |
| 518 | cyr &= 0x0f; | |
| 550 | state->cyr = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0); | |
| 551 | state->cyr &= 0x0f; | |
| 519 | 552 | |
| 520 | cyq = y / 64; | |
| 521 | cyq &= 0x0f; | |
| 553 | state->cyq = y / 64; | |
| 554 | state->cyq &= 0x0f; | |
| 522 | 555 | |
| 523 | 556 | break; |
| 524 | 557 | } |
| 525 | 558 | } |
| 526 | 559 | } |
| 527 | 560 | |
| 528 | collh = cxh = cyrh = cyqh = 0; | |
| 529 | if ((marinedt_pd & 0x03) == 0x03) | |
| 561 | state->collh = state->cxh = state->cyrh = state->cyqh = 0; | |
| 562 | if ((state->pd & 0x03) == 0x03) | |
| 530 | 563 | { |
| 531 | 564 | for (sx = 0; sx < 32; sx++) |
| 532 | 565 | for (sy = 0; sy < 32; sy++) |
| 533 | 566 | { |
| 534 | int x = OBJ_X(marinedt_obj1_x + sx); | |
| 535 | int y = OBJ_Y(marinedt_obj1_y + sy); | |
| 567 | int x = OBJ_X(state->obj1_x + sx); | |
| 568 | int y = OBJ_Y(state->obj1_y + sy); | |
| 536 | 569 | |
| 537 | int xx = OBJ_X(marinedt_obj2_x) - x; | |
| 538 | int yy = OBJ_Y(marinedt_obj2_y) - y; | |
| 570 | int xx = OBJ_X(state->obj2_x) - x; | |
| 571 | int yy = OBJ_Y(state->obj2_y) - y; | |
| 539 | 572 | |
| 540 | if (xx < 0 || xx >= 32 | |
| 541 | || yy < 0 || yy >= 32) | |
| 573 | if (xx < 0 || xx >= 32 || yy < 0 || yy >= 32) | |
| 542 | 574 | continue; |
| 543 | 575 | |
| 544 | if (*BITMAP_ADDR16(obj1, sy, sx) == 0) | |
| 576 | if (*BITMAP_ADDR16(state->obj1, sy, sx) == 0) | |
| 545 | 577 | continue; |
| 546 | 578 | |
| 547 | if (*BITMAP_ADDR16(obj2, yy, xx) != 0) | |
| 579 | if (*BITMAP_ADDR16(state->obj2, yy, xx) != 0) | |
| 548 | 580 | { |
| 549 | collh = 0x80; | |
| 581 | state->collh = 0x80; | |
| 550 | 582 | |
| 551 | cxh = (x % 128) / 8; | |
| 552 | cxh &= 0x0f; | |
| 583 | state->cxh = (x % 128) / 8; | |
| 584 | state->cxh &= 0x0f; | |
| 553 | 585 | |
| 554 | cyrh = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0); | |
| 555 | cyrh &= 0x0f; | |
| 586 | state->cyrh = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0); | |
| 587 | state->cyrh &= 0x0f; | |
| 556 | 588 | |
| 557 | cyqh= y / 64; | |
| 558 | cyqh &= 0x0f; | |
| 589 | state->cyqh= y / 64; | |
| 590 | state->cyqh &= 0x0f; | |
| 559 | 591 | |
| 560 | 592 | break; |
| 561 | 593 | } |
| r7500 | r7501 | |
| 564 | 596 | return 0; |
| 565 | 597 | } |
| 566 | 598 | |
| 599 | static MACHINE_START( marinedt ) | |
| 600 | { | |
| 601 | marinedt_state *state = (marinedt_state *)machine->driver_data; | |
| 602 | ||
| 603 | state_save_register_global(machine, state->obj1_a); | |
| 604 | state_save_register_global(machine, state->obj1_x); | |
| 605 | state_save_register_global(machine, state->obj1_y); | |
| 606 | state_save_register_global(machine, state->obj2_a); | |
| 607 | state_save_register_global(machine, state->obj2_x); | |
| 608 | state_save_register_global(machine, state->obj2_y); | |
| 609 | state_save_register_global(machine, state->pd); | |
| 610 | state_save_register_global(machine, state->pf); | |
| 611 | state_save_register_global(machine, state->music); | |
| 612 | state_save_register_global(machine, state->sound); | |
| 613 | state_save_register_global(machine, state->coll); | |
| 614 | state_save_register_global(machine, state->cx); | |
| 615 | state_save_register_global(machine, state->cyr); | |
| 616 | state_save_register_global(machine, state->cyq); | |
| 617 | state_save_register_global(machine, state->collh); | |
| 618 | state_save_register_global(machine, state->cxh); | |
| 619 | state_save_register_global(machine, state->cyrh); | |
| 620 | state_save_register_global(machine, state->cyqh); | |
| 621 | } | |
| 622 | ||
| 623 | static MACHINE_RESET( marinedt ) | |
| 624 | { | |
| 625 | marinedt_state *state = (marinedt_state *)machine->driver_data; | |
| 626 | ||
| 627 | state->obj1_a = 0; | |
| 628 | state->obj1_x = 0; | |
| 629 | state->obj1_y = 0; | |
| 630 | state->obj2_a = 0; | |
| 631 | state->obj2_x = 0; | |
| 632 | state->obj2_y = 0; | |
| 633 | state->pd = 0; | |
| 634 | state->pf = 0; | |
| 635 | state->music = 0; | |
| 636 | state->sound = 0; | |
| 637 | state->coll = 0; | |
| 638 | state->cx = 0; | |
| 639 | state->cyr = 0; | |
| 640 | state->cyq = 0; | |
| 641 | state->collh = 0; | |
| 642 | state->cxh = 0; | |
| 643 | state->cyrh = 0; | |
| 644 | state->cyqh = 0; | |
| 645 | } | |
| 646 | ||
| 567 | 647 | static MACHINE_DRIVER_START( marinedt ) |
| 568 | 648 | |
| 649 | /* driver data */ | |
| 650 | MDRV_DRIVER_DATA(marinedt_state) | |
| 651 | ||
| 569 | 652 | /* basic machine hardware */ |
| 570 | 653 | MDRV_CPU_ADD("maincpu", Z80,10000000/4) |
| 571 | 654 | MDRV_CPU_PROGRAM_MAP(marinedt_map) |
| 572 | 655 | MDRV_CPU_IO_MAP(marinedt_io_map) |
| 573 | 656 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 574 | 657 | |
| 658 | MDRV_MACHINE_START(marinedt) | |
| 659 | MDRV_MACHINE_RESET(marinedt) | |
| 660 | ||
| 575 | 661 | /* video hardware */ |
| 576 | 662 | MDRV_SCREEN_ADD("screen", RASTER) |
| 577 | 663 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 626 | 712 | ROM_LOAD( "mg17.bpr", 0x0060, 0x0020, CRC(13261a02) SHA1(050edd18e4f79d19d5206f55f329340432fd4099) ) //?? table of increasing values |
| 627 | 713 | ROM_END |
| 628 | 714 | |
| 629 | GAME( 1981, marinedt, 0, marinedt, marinedt, 0, ROT270, "Taito", "Marine Date", GAME_NO_SOUND ) | |
| 630 | ||
| 715 | GAME( 1981, marinedt, 0, marinedt, marinedt, 0, ROT270, "Taito", "Marine Date", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 76 | 76 | #define x_offset 0x45 |
| 77 | 77 | #define y_offset 0x0d |
| 78 | 78 | |
| 79 | typedef struct _sliver_state sliver_state; | |
| 80 | struct _sliver_state | |
| 79 | class sliver_state | |
| 81 | 80 | { |
| 81 | public: | |
| 82 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sliver_state(machine)); } | |
| 83 | ||
| 84 | sliver_state(running_machine &machine) { } | |
| 85 | ||
| 82 | 86 | UINT16 io_offset; |
| 83 | 87 | UINT16 io_reg[IO_SIZE]; |
| 84 | 88 | UINT16 fifo[FIFO_SIZE]; |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | #include "deprecat.h" |
| 44 | 44 | #include "cpu/z80/z80.h" |
| 45 | 45 | #include "sound/ay8910.h" |
| 46 | #include "includes/mrflea.h" | |
| 46 | 47 | |
| 47 | static int mrflea_io; | |
| 48 | static int mrflea_main; | |
| 49 | 48 | |
| 50 | static int mrflea_status; | |
| 49 | /************************************* | |
| 50 | * | |
| 51 | * Memory handlers | |
| 52 | * | |
| 53 | *************************************/ | |
| 51 | 54 | |
| 52 | static int mrflea_select1; | |
| 53 | ||
| 54 | extern WRITE8_HANDLER( mrflea_gfx_bank_w ); | |
| 55 | extern WRITE8_HANDLER( mrflea_videoram_w ); | |
| 56 | extern WRITE8_HANDLER( mrflea_spriteram_w ); | |
| 57 | extern VIDEO_START( mrflea ); | |
| 58 | extern VIDEO_UPDATE( mrflea ); | |
| 59 | ||
| 60 | static const gfx_layout tile_layout = { | |
| 61 | 8,8, | |
| 62 | 0x800, /* number of tiles */ | |
| 63 | 4, | |
| 64 | { 0,1,2,3 }, | |
| 65 | { 0*4,1*4,2*4,3*4, 4*4,5*4,6*4,7*4 }, | |
| 66 | { 0*32,1*32,2*32,3*32, 4*32,5*32,6*32,7*32 }, | |
| 67 | 8*32 | |
| 68 | }; | |
| 69 | ||
| 70 | static const gfx_layout sprite_layout = { | |
| 71 | 16,16, | |
| 72 | 0x200, /* number of sprites */ | |
| 73 | 4, | |
| 74 | { 0*0x4000*8,1*0x4000*8,2*0x4000*8,3*0x4000*8 }, | |
| 75 | { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, | |
| 76 | { | |
| 77 | 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70, | |
| 78 | 0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0 | |
| 79 | }, | |
| 80 | 16*16 | |
| 81 | }; | |
| 82 | ||
| 83 | static GFXDECODE_START( mrflea ) | |
| 84 | GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 0x10, 1 ) | |
| 85 | GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 0x00, 1 ) | |
| 86 | GFXDECODE_END | |
| 87 | ||
| 88 | /*******************************************************/ | |
| 89 | ||
| 90 | 55 | static WRITE8_HANDLER( mrflea_main_w ) |
| 91 | 56 | { |
| 92 | mrflea_status |= 0x01; // pending command to main CPU | |
| 93 | mrflea_main = data; | |
| 57 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 58 | state->status |= 0x01; // pending command to main CPU | |
| 59 | state->main = data; | |
| 94 | 60 | } |
| 95 | 61 | |
| 96 | 62 | static WRITE8_HANDLER( mrflea_io_w ) |
| 97 | 63 | { |
| 98 | mrflea_status |= 0x08; // pending command to IO CPU | |
| 99 | mrflea_io = data; | |
| 100 | cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE ); | |
| 64 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 65 | state->status |= 0x08; // pending command to IO CPU | |
| 66 | state->io = data; | |
| 67 | cpu_set_input_line(state->subcpu, 0, HOLD_LINE ); | |
| 101 | 68 | } |
| 102 | 69 | |
| 103 | 70 | static READ8_HANDLER( mrflea_main_r ) |
| 104 | 71 | { |
| 105 | mrflea_status &= ~0x01; // main CPU command read | |
| 106 | return mrflea_main; | |
| 72 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 73 | state->status &= ~0x01; // main CPU command read | |
| 74 | return state->main; | |
| 107 | 75 | } |
| 108 | 76 | |
| 109 | 77 | static READ8_HANDLER( mrflea_io_r ) |
| 110 | 78 | { |
| 111 | mrflea_status &= ~0x08; // IO CPU command read | |
| 112 | return mrflea_io; | |
| 79 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 80 | state->status &= ~0x08; // IO CPU command read | |
| 81 | return state->io; | |
| 113 | 82 | } |
| 114 | 83 | |
| 115 | /*******************************************************/ | |
| 116 | ||
| 117 | 84 | static READ8_HANDLER( mrflea_main_status_r ) |
| 118 | 85 | { |
| 86 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 87 | ||
| 119 | 88 | /* 0x01: main CPU command pending |
| 120 | 89 | 0x08: io cpu ready */ |
| 121 | return | |
| 90 | return st | |
| 122 | 91 | } |
| 123 | 92 | |
| 124 | 93 | static READ8_HANDLER( mrflea_io_status_r ) |
| 125 | 94 | { |
| 95 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 96 | ||
| 126 | 97 | /* 0x08: IO CPU command pending |
| 127 | 98 | 0x01: main cpu ready */ |
| 128 | return | |
| 99 | return st | |
| 129 | 100 | } |
| 130 | 101 | |
| 131 | 102 | static INTERRUPT_GEN( mrflea_slave_interrupt ) |
| 132 | 103 | { |
| 133 | if( cpu_getiloops(device)==0 || (mrflea_status&0x08) ) | |
| 104 | mrflea_state *state = (mrflea_state *)device->machine->driver_data; | |
| 105 | if (cpu_getiloops(device) == 0 || (state->status & 0x08)) | |
| 134 | 106 | cpu_set_input_line(device, 0, HOLD_LINE); |
| 135 | 107 | } |
| 136 | 108 | |
| r7500 | r7501 | |
| 140 | 112 | 1. triggered (in response to sound command) |
| 141 | 113 | 2. heartbeat (for music timing) |
| 142 | 114 | */ |
| 143 | if( mrflea_status&0x08 ) return 0x00; /* process command */ | |
| 115 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 116 | ||
| 117 | if (state->status & 0x08 ) | |
| 118 | return 0x00; /* process command */ | |
| 119 | ||
| 144 | 120 | return 0x01; /* music/sound update? */ |
| 145 | 121 | } |
| 146 | 122 | |
| 147 | /*******************************************************/ | |
| 123 | static WRITE8_HANDLER( mrflea_select1_w ) | |
| 124 | { | |
| 125 | mrflea_state *state = (mrflea_state *)space->machine->driver_data; | |
| 126 | state->select1 = data; | |
| 127 | } | |
| 148 | 128 | |
| 129 | static READ8_HANDLER( mrflea_input1_r ) | |
| 130 | { | |
| 131 | return 0x00; | |
| 132 | } | |
| 133 | ||
| 134 | static WRITE8_HANDLER( mrflea_data1_w ) | |
| 135 | { | |
| 136 | } | |
| 137 | ||
| 138 | /************************************* | |
| 139 | * | |
| 140 | * Address maps | |
| 141 | * | |
| 142 | *************************************/ | |
| 143 | ||
| 149 | 144 | static ADDRESS_MAP_START( mrflea_master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 150 | 145 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 151 | 146 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 152 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(mrflea_videoram_w) AM_BASE_ | |
| 147 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(mrflea_videoram_w) AM_BASE_MEMBER | |
| 153 | 148 | AM_RANGE(0xe800, 0xe83f) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_BASE_GENERIC(paletteram) |
| 154 | AM_RANGE(0xec00, 0xecff) AM_RAM_WRITE(mrflea_spriteram_w) AM_BASE_ | |
| 149 | AM_RANGE(0xec00, 0xecff) AM_RAM_WRITE(mrflea_spriteram_w) AM_BASE_MEMBER | |
| 155 | 150 | ADDRESS_MAP_END |
| 156 | 151 | |
| 157 | 152 | static ADDRESS_MAP_START( mrflea_master_io_map, ADDRESS_SPACE_IO, 8 ) |
| r7500 | r7501 | |
| 164 | 159 | AM_RANGE(0x60, 0x60) AM_WRITE(mrflea_gfx_bank_w) |
| 165 | 160 | ADDRESS_MAP_END |
| 166 | 161 | |
| 167 | /*******************************************************/ | |
| 168 | 162 | |
| 169 | static WRITE8_HANDLER( mrflea_select1_w ) | |
| 170 | { | |
| 171 | mrflea_select1 = data; | |
| 172 | } | |
| 173 | ||
| 174 | static READ8_HANDLER( mrflea_input1_r ) | |
| 175 | { | |
| 176 | return 0x00; | |
| 177 | } | |
| 178 | ||
| 179 | static WRITE8_HANDLER( mrflea_data1_w ) | |
| 180 | { | |
| 181 | } | |
| 182 | ||
| 183 | 163 | static ADDRESS_MAP_START( mrflea_slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 184 | 164 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 185 | 165 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| r7500 | r7501 | |
| 206 | 186 | AM_RANGE(0x46, 0x47) AM_DEVWRITE("ay3", ay8910_data_address_w) |
| 207 | 187 | ADDRESS_MAP_END |
| 208 | 188 | |
| 209 | /*******************************************************/ | |
| 189 | /************************************* | |
| 190 | * | |
| 191 | * Input ports | |
| 192 | * | |
| 193 | *************************************/ | |
| 210 | 194 | |
| 195 | static INPUT_PORTS_START( mrflea ) | |
| 196 | PORT_START("IN0") | |
| 197 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 198 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 199 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 200 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 201 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) | |
| 202 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 203 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 204 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 205 | ||
| 206 | PORT_START("IN1") | |
| 207 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 208 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 209 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 210 | ||
| 211 | PORT_START("DSW1") | |
| 212 | /* | |
| 213 | ------xx | |
| 214 | -----x-- | |
| 215 | ----x--- | |
| 216 | */ | |
| 217 | PORT_DIPNAME( 0x03, 0x03, "Bonus?" ) | |
| 218 | PORT_DIPSETTING( 0x03, "A" ) | |
| 219 | PORT_DIPSETTING( 0x02, "B" ) | |
| 220 | PORT_DIPSETTING( 0x01, "C" ) | |
| 221 | PORT_DIPSETTING( 0x00, "D" ) | |
| 222 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 223 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 224 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 225 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 226 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 227 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 228 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) | |
| 229 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 230 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 231 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) | |
| 232 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 233 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 234 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) | |
| 235 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 236 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 237 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) | |
| 238 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 239 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 240 | ||
| 241 | PORT_START("DSW2") | |
| 242 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 243 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 244 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 245 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) | |
| 246 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 247 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 248 | PORT_DIPSETTING( 0x0c, "3" ) | |
| 249 | PORT_DIPSETTING( 0x08, "4" ) | |
| 250 | PORT_DIPSETTING( 0x04, "5" ) | |
| 251 | PORT_DIPSETTING( 0x00, "7" ) | |
| 252 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 253 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 254 | PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) | |
| 255 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 256 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 257 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) | |
| 258 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 259 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 260 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) | |
| 261 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 262 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 263 | INPUT_PORTS_END | |
| 264 | ||
| 265 | ||
| 266 | /************************************* | |
| 267 | * | |
| 268 | * Graphics definitions | |
| 269 | * | |
| 270 | *************************************/ | |
| 271 | ||
| 272 | static const gfx_layout tile_layout = { | |
| 273 | 8,8, | |
| 274 | 0x800, /* number of tiles */ | |
| 275 | 4, | |
| 276 | { 0,1,2,3 }, | |
| 277 | { 0*4,1*4,2*4,3*4, 4*4,5*4,6*4,7*4 }, | |
| 278 | { 0*32,1*32,2*32,3*32, 4*32,5*32,6*32,7*32 }, | |
| 279 | 8*32 | |
| 280 | }; | |
| 281 | ||
| 282 | static const gfx_layout sprite_layout = { | |
| 283 | 16,16, | |
| 284 | 0x200, /* number of sprites */ | |
| 285 | 4, | |
| 286 | { 0*0x4000*8,1*0x4000*8,2*0x4000*8,3*0x4000*8 }, | |
| 287 | { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, | |
| 288 | { | |
| 289 | 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70, | |
| 290 | 0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0 | |
| 291 | }, | |
| 292 | 16*16 | |
| 293 | }; | |
| 294 | ||
| 295 | static GFXDECODE_START( mrflea ) | |
| 296 | GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 0x10, 1 ) | |
| 297 | GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 0x00, 1 ) | |
| 298 | GFXDECODE_END | |
| 299 | ||
| 300 | /************************************* | |
| 301 | * | |
| 302 | * Sound interfaces | |
| 303 | * | |
| 304 | *************************************/ | |
| 305 | ||
| 211 | 306 | static const ay8910_interface mrflea_ay8910_interface_0 = |
| 212 | 307 | { |
| 213 | 308 | AY8910_LEGACY_OUTPUT, |
| r7500 | r7501 | |
| 224 | 319 | DEVCB_INPUT_PORT("DSW1") |
| 225 | 320 | }; |
| 226 | 321 | |
| 322 | /************************************* | |
| 323 | * | |
| 324 | * Machine driver | |
| 325 | * | |
| 326 | *************************************/ | |
| 327 | ||
| 328 | static MACHINE_START( mrflea ) | |
| 329 | { | |
| 330 | mrflea_state *state = (mrflea_state *)machine->driver_data; | |
| 331 | ||
| 332 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 333 | state->subcpu = devtag_get_device(machine, "sub"); | |
| 334 | ||
| 335 | state_save_register_global(machine, state->gfx_bank); | |
| 336 | state_save_register_global(machine, state->io); | |
| 337 | state_save_register_global(machine, state->main); | |
| 338 | state_save_register_global(machine, state->status); | |
| 339 | state_save_register_global(machine, state->select1); | |
| 340 | } | |
| 341 | ||
| 342 | static MACHINE_RESET( mrflea ) | |
| 343 | { | |
| 344 | mrflea_state *state = (mrflea_state *)machine->driver_data; | |
| 345 | ||
| 346 | state->gfx_bank = 0; | |
| 347 | state->io = 0; | |
| 348 | state->main = 0; | |
| 349 | state->status = 0; | |
| 350 | state->select1 = 0; | |
| 351 | } | |
| 352 | ||
| 227 | 353 | static MACHINE_DRIVER_START( mrflea ) |
| 228 | 354 | |
| 355 | /* driver data */ | |
| 356 | MDRV_DRIVER_DATA(mrflea_state) | |
| 357 | ||
| 229 | 358 | /* basic machine hardware */ |
| 230 | 359 | MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz? */ |
| 231 | 360 | MDRV_CPU_PROGRAM_MAP(mrflea_master_map) |
| r7500 | r7501 | |
| 239 | 368 | |
| 240 | 369 | MDRV_QUANTUM_TIME(HZ(6000)) |
| 241 | 370 | |
| 371 | MDRV_MACHINE_START(mrflea) | |
| 372 | MDRV_MACHINE_RESET(mrflea) | |
| 373 | ||
| 242 | 374 | /* video hardware */ |
| 243 | 375 | MDRV_SCREEN_ADD("screen", RASTER) |
| 244 | 376 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 250 | 382 | MDRV_GFXDECODE(mrflea) |
| 251 | 383 | MDRV_PALETTE_LENGTH(32) |
| 252 | 384 | |
| 253 | MDRV_VIDEO_START(mrflea) | |
| 254 | 385 | MDRV_VIDEO_UPDATE(mrflea) |
| 255 | 386 | |
| 256 | 387 | /* sound hardware */ |
| r7500 | r7501 | |
| 268 | 399 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 269 | 400 | MACHINE_DRIVER_END |
| 270 | 401 | |
| 402 | /************************************* | |
| 403 | * | |
| 404 | * ROM definition(s) | |
| 405 | * | |
| 406 | *************************************/ | |
| 407 | ||
| 271 | 408 | ROM_START( mrflea ) |
| 272 | 409 | ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 code; main CPU */ |
| 273 | 410 | ROM_LOAD( "cpu_d1", 0x0000, 0x2000, CRC(d286217c) SHA1(d750d64bb70f735a38b737881abb9a5fbde1c98c) ) |
| r7500 | r7501 | |
| 303 | 440 | ROM_LOAD( "vd_l4", 0xe000, 0x2000, CRC(423735a5) SHA1(4ee93f93cd2b08560e148525e08880d64c64fcd2) ) |
| 304 | 441 | ROM_END |
| 305 | 442 | |
| 306 | static INPUT_PORTS_START( mrflea ) | |
| 307 | PORT_START("IN0") | |
| 308 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 309 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 310 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 311 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 312 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) | |
| 313 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 314 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 315 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 443 | /************************************* | |
| 444 | * | |
| 445 | * Game driver(s) | |
| 446 | * | |
| 447 | *************************************/ | |
| 316 | 448 | |
| 317 | PORT_START("IN1") | |
| 318 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 319 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 320 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 321 | ||
| 322 | PORT_START("DSW1") /* DSW1 */ | |
| 323 | /* | |
| 324 | ------xx | |
| 325 | -----x-- | |
| 326 | ----x--- | |
| 327 | */ | |
| 328 | PORT_DIPNAME( 0x03, 0x03, "Bonus?" ) | |
| 329 | PORT_DIPSETTING( 0x03, "A" ) | |
| 330 | PORT_DIPSETTING( 0x02, "B" ) | |
| 331 | PORT_DIPSETTING( 0x01, "C" ) | |
| 332 | PORT_DIPSETTING( 0x00, "D" ) | |
| 333 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 334 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 335 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 336 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 337 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 338 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 339 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) | |
| 340 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 341 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 342 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) | |
| 343 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 344 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 345 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) | |
| 346 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 347 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 348 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) | |
| 349 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 350 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 351 | ||
| 352 | PORT_START("DSW2") /* DSW2 */ | |
| 353 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 354 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 355 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 356 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) | |
| 357 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 358 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 359 | PORT_DIPSETTING( 0x0c, "3" ) | |
| 360 | PORT_DIPSETTING( 0x08, "4" ) | |
| 361 | PORT_DIPSETTING( 0x04, "5" ) | |
| 362 | PORT_DIPSETTING( 0x00, "7" ) | |
| 363 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 364 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 365 | PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) | |
| 366 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 367 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 368 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) | |
| 369 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 370 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 371 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) | |
| 372 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 373 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 374 | INPUT_PORTS_END | |
| 375 | ||
| 376 | ||
| 377 | GAME( 1982, mrflea, 0, mrflea, mrflea, 0, ROT270, "Pacific Novelty", "The Amazing Adventures of Mr. F. Lea" , 0 ) | |
| 378 | ||
| 449 | GAME( 1982, mrflea, 0, mrflea, mrflea, 0, ROT270, "Pacific Novelty", "The Amazing Adventures of Mr. F. Lea" , GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 1010 | 1010 | |
| 1011 | 1011 | ROM_START( tm ) |
| 1012 | 1012 | ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code |
| 1013 | ROM_LOAD16_BYTE( "tmaster.u51", 0x000000, 0x080000, CRC(edaa5874) SHA1(48b99bc7f5a6453def265967ca7d8eefdf9dc97b) ) /* Ver: 3.00 Euro 11-25-96 */ | |
| 1014 | ROM_LOAD16_BYTE( "tmaster.u52", 0x000001, 0x080000, CRC(e9fd30fc) SHA1(d91ea05d5f574603883336729fb9df705688945d) ) /* Ver: 3.00 Euro 11-25-96 */ | |
| 1013 | ROM_LOAD16_BYTE( "tmaster_v300_euro.u51", 0x000000, 0x080000, CRC(edaa5874) SHA1(48b99bc7f5a6453def265967ca7d8eefdf9dc97b) ) /* Ver: 3.00 Euro 11-25-96 */ | |
| 1014 | ROM_LOAD16_BYTE( "tmaster_v300_euro.u52", 0x000001, 0x080000, CRC(e9fd30fc) SHA1(d91ea05d5f574603883336729fb9df705688945d) ) /* Ver: 3.00 Euro 11-25-96 */ | |
| 1015 | 1015 | |
| 1016 | 1016 | ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE ) // Blitter gfx |
| 1017 | ROM_LOAD16_BYTE( "tmaster.u38", 0x100000, 0x080000, CRC(68885ef6) SHA1(010602b59c33c3e490491a296ddaf8952e315b83) ) | |
| 1018 | ROM_LOAD16_BYTE( "tmaster.u36", 0x100001, 0x080000, CRC(204096ec) SHA1(9239923b7eedb6003c63ef2e8ff224edee657bbc) ) | |
| 1017 | ROM_LOAD16_BYTE( "tmaster.u38", 0x100000, 0x080000, CRC(68885ef6) SHA1(010602b59c33c3e490491a296ddaf8952e315b83) ) /* Same as U38 below */ | |
| 1018 | ROM_LOAD16_BYTE( "tmaster.u36", 0x100001, 0x080000, CRC(204096ec) SHA1(9239923b7eedb6003c63ef2e8ff224edee657bbc) ) /* Same as U36 below */ | |
| 1019 | 1019 | // unused gap |
| 1020 | ROM_LOAD16_BYTE( "tmaster.u39", 0x300000, 0x080000, CRC(cbb716cb) SHA1(4e8d8f6cbfb25a8161ff8fe7505d6b209650dd2b) ) | |
| 1021 | ROM_LOAD16_BYTE( "tmaster.u37", 0x300001, 0x080000, CRC(e0b6a9f7) SHA1(7e057ca87833c682e5be03668469259bbdefbf20) ) | |
| 1020 | ROM_LOAD16_BYTE( "tmaster.u39", 0x300000, 0x080000, CRC(cbb716cb) SHA1(4e8d8f6cbfb25a8161ff8fe7505d6b209650dd2b) ) /* Different then U39 below, newer or region specific? */ | |
| 1021 | ROM_LOAD16_BYTE( "tmaster.u37", 0x300001, 0x080000, CRC(e0b6a9f7) SHA1(7e057ca87833c682e5be03668469259bbdefbf20) ) /* Different then U37 below, newer or region specific? */ | |
| 1022 | 1022 | |
| 1023 | 1023 | ROM_REGION( 0x100000, "oki", 0 ) // Samples |
| 1024 | ROM_LOAD( "tmaster.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) ) | |
| 1024 | ROM_LOAD( "tmaster.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) ) /* Same as U8 below */ | |
| 1025 | 1025 | ROM_CONTINUE( 0xc0000, 0x040000 ) |
| 1026 | 1026 | ROM_END |
| 1027 | 1027 | |
| 1028 | ROM_START( tmdo ) | |
| 1029 | ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code | |
| 1030 | ROM_LOAD16_BYTE( "tmaster_v22-01.u51", 0x000000, 0x080000, CRC(12e1b085) SHA1(b01325e0067204991a707db24e3e2036708ebccf) ) /* Ver: 2.2-01 Standard 10-17-96 */ | |
| 1031 | ROM_LOAD16_BYTE( "tmaster_v22-01.u52", 0x000001, 0x080000, CRC(6c2c643f) SHA1(8dd7930f4c499483ca46b0b97bde94cb8d6e06aa) ) /* Ver: 2.2-01 Standard 10-17-96 */ | |
| 1032 | ||
| 1033 | ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE ) // Blitter gfx | |
| 1034 | ROM_LOAD16_BYTE( "tmaster.u38", 0x100000, 0x080000, CRC(68885ef6) SHA1(010602b59c33c3e490491a296ddaf8952e315b83) ) /* Marked as Rev 2.1 */ | |
| 1035 | ROM_LOAD16_BYTE( "tmaster.u36", 0x100001, 0x080000, CRC(204096ec) SHA1(9239923b7eedb6003c63ef2e8ff224edee657bbc) ) /* Marked as Rev 2.1 */ | |
| 1036 | // unused gap | |
| 1037 | ROM_LOAD16_BYTE( "tmaster_v21.u39", 0x300000, 0x080000, CRC(a4445260) SHA1(915347f69d7ea45f8f299a67d77ff437983495d2) ) /* Marked as Rev 2.1 */ | |
| 1038 | ROM_LOAD16_BYTE( "tmaster_v21.u37", 0x300001, 0x080000, CRC(0e140a3e) SHA1(10a34e3b95c0d36fe687fe8c1124ef244a93d720) ) /* Marked as Rev 2.1 */ | |
| 1039 | ||
| 1040 | ROM_REGION( 0x100000, "oki", 0 ) // Samples | |
| 1041 | ROM_LOAD( "tmaster.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) ) /* Marked as Rev 1.0 */ | |
| 1042 | ROM_CONTINUE( 0xc0000, 0x040000 ) | |
| 1043 | ROM_END | |
| 1044 | ||
| 1028 | 1045 | /*************************************************************************** |
| 1029 | 1046 | |
| 1030 | 1047 | Touchmaster 2000 |
| r7500 | r7501 | |
| 1148 | 1165 | |
| 1149 | 1166 | Name_Board Location Version Use Checksum |
| 1150 | 1167 | ----------------------------------------------------------------------------------- |
| 1168 | TM4K_v603.u51 6.03 Game Program & Cpu instructions 96B0 | |
| 1169 | TM4K_v603.u52 6.03 Game Program & Cpu instructions 2842 | |
| 1170 | ||
| 1151 | 1171 | TM4K_v602.u51 6.02 Game Program & Cpu instructions FEA0 |
| 1152 | 1172 | TM4K_v602.u52 6.02 Game Program & Cpu instructions 9A71 |
| 1173 | ||
| 1153 | 1174 | TM4K_graphic.u36 6.0 Video Images & Graphics 54f1 (same as TM3K) |
| 1154 | 1175 | TM4K_graphic.u37 6.0 Video Images & Graphics 609E |
| 1155 | 1176 | TM4K_graphic.u38 6.0 Video Images & Graphics 5493 (same as TM3K) |
| r7500 | r7501 | |
| 1168 | 1189 | |
| 1169 | 1190 | ROM_START( tm4k ) |
| 1170 | 1191 | ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code |
| 1192 | ROM_LOAD16_BYTE( "tm4k_v603.u51", 0x000000, 0x100000, CRC(0c88c856) SHA1(4c60c09812ab05f9dccef3038a5ddbd4632dbf4e) ) /* TOUCHMASTER 4000 U51 DOMESTIC 6.03 (Standard 6-23-98) */ | |
| 1193 | ROM_LOAD16_BYTE( "tm4k_v603.u52", 0x000001, 0x100000, CRC(9320bfe9) SHA1(cc3a51f439c139ca30efe28a817cf4f68679180e) ) /* TOUCHMASTER 4000 U52 DOMESTIC 6.03 (Standard 6-23-98) */ | |
| 1194 | ||
| 1195 | ROM_REGION( 0x600000, "blitter", 0 ) // Blitter gfx | |
| 1196 | ROM_LOAD16_BYTE( "tm4k_graphic.u38", 0x000000, 0x100000, CRC(a6683899) SHA1(d05024390917cdb1871d030996da8e1eb6460918) ) /* Mask rom labeled 5341-15746-03 U38 VIDEO IMAGE */ | |
| 1197 | ROM_LOAD16_BYTE( "tm4k_graphic.u36", 0x000001, 0x100000, CRC(7bde520d) SHA1(77750b689e2f0d47804042456e54bbd9c28deeac) ) /* Mask rom labeled 5341-15746-01 U36 VIDEO IMAGE */ | |
| 1198 | ROM_LOAD16_BYTE( "tm4k_graphic.u39", 0x200000, 0x100000, CRC(bac88cfb) SHA1(26ed169296b890c5f5b50c418c15299355a6592f) ) /* Mask rom labeled 5341-15746-04 U39 VIDEO IMAGE */ | |
| 1199 | ROM_LOAD16_BYTE( "tm4k_graphic.u37", 0x200001, 0x100000, CRC(bf49fafa) SHA1(b400667bf654dc9cd01a85c8b99670459400fd60) ) /* Mask rom labeled 5341-15746-02 U37 VIDEO IMAGE */ | |
| 1200 | ROM_LOAD16_BYTE( "tm4k_graphic.u41", 0x400000, 0x100000, CRC(e97edb1e) SHA1(75510676cf1692ad03efd4ccd57d25af1cc8ef2a) ) /* Mask rom labeled 5341-15746-06 U41 VIDEO IMAGE */ | |
| 1201 | ROM_LOAD16_BYTE( "tm4k_graphic.u40", 0x400001, 0x100000, CRC(f6771a09) SHA1(74f71d5e910006c83a38170f24aa811c38a3e020) ) /* Mask rom labeled 5341-15746-05 U40 VIDEO IMAGE */ | |
| 1202 | ||
| 1203 | ROM_REGION( 0x100000, "oki", 0 ) // Samples | |
| 1204 | ROM_LOAD( "tm4k_sound.u8", 0x00000, 0x100000, CRC(48c3782b) SHA1(bfe105ddbde8bbbd84665dfdd565d6d41926834a) ) /* Mask rom labeled 5341-15746-07 U8 SOUND IMAGE */ | |
| 1205 | ROM_END | |
| 1206 | ||
| 1207 | ROM_START( tm4ka ) | |
| 1208 | ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code | |
| 1171 | 1209 | ROM_LOAD16_BYTE( "tm4k_v602.u51", 0x000000, 0x100000, CRC(3d8d7848) SHA1(31638f23cdd5e6cfbb2270e953f84fe1bd437950) ) /* TOUCHMASTER 4000 U51 DOMESTIC 6.02 (Standard 4-14-98) */ |
| 1172 | 1210 | ROM_LOAD16_BYTE( "tm4k_v602.u52", 0x000001, 0x100000, CRC(6d412871) SHA1(ae27c7723b292daf6682c53bafac22e4a3cd1ece) ) /* TOUCHMASTER 4000 U52 DOMESTIC 6.02 (Standard 4-14-98) */ |
| 1173 | 1211 | |
| r7500 | r7501 | |
| 1492 | 1530 | UINT16 *ROM = (UINT16 *)memory_region( machine, "maincpu" ); |
| 1493 | 1531 | |
| 1494 | 1532 | // protection |
| 1533 | ROM[0x834ce/2] = 0x4e75; | |
| 1534 | ||
| 1535 | ROM[0x8349c/2] = 0x6002; | |
| 1536 | ROM[0x834c4/2] = 0x6002; | |
| 1537 | /* | |
| 1538 | ||
| 1539 | Protection resembles that of tm5k rather than tm4ka: | |
| 1540 | ||
| 1541 | 83470: addi.w #$384, D0 0640 0384 | |
| 1542 | 83474: move.w D0, $207a86.l 33C0 0020 7A86 | |
| 1543 | ||
| 1544 | */ | |
| 1545 | ||
| 1546 | } | |
| 1547 | ||
| 1548 | ||
| 1549 | static DRIVER_INIT( tm4ka ) | |
| 1550 | { | |
| 1551 | UINT16 *ROM = (UINT16 *)memory_region( machine, "maincpu" ); | |
| 1552 | ||
| 1553 | // protection | |
| 1495 | 1554 | ROM[0x83476/2] = 0x4e75; |
| 1496 | 1555 | |
| 1497 | 1556 | ROM[0x8342C/2] = 0x601a; |
| r7500 | r7501 | |
| 1711 | 1770 | } |
| 1712 | 1771 | |
| 1713 | 1772 | |
| 1714 | GAME( 1996, tm, 0, tm, tm, 0, ROT0, "Midway", "Touchmaster (v3.00 Euro)", 0 ) | |
| 1715 | GAME( 1996, tm2k, 0, tm3k, tmaster, 0, ROT0, "Midway", "Touchmaster 2000 (v4.02 Standard)", 0 ) | |
| 1716 | GAME( 1997, tm3k, 0, tm3k, tmaster, 0, ROT0, "Midway", "Touchmaster 3000 (v5.02 Standard)", 0 ) | |
| 1717 | GAME( 1997, tm3ka, tm3k, tm3k, tmaster, 0, ROT0, "Midway", "Touchmaster 3000 (v5.01 Standard)", 0 ) | |
| 1718 | GAME( 1998, tm4k, 0, tm3k, tmaster, tm4k, ROT0, "Midway", "Touchmaster 4000 (v6.02 Standard)", 0 ) | |
| 1719 | GAME( 1998, tm5k, 0, tm3k, tmaster, tm5k, ROT0, "Midway", "Touchmaster 5000 (v7.10 Standard)", 0 ) | |
| 1720 | GAME( 1998, tm5kca, tm5k, tm3k, tmaster, tm5kca, ROT0, "Midway", "Touchmaster 5000 (v7.10 California)", 0 ) | |
| 1721 | GAME( 1998, tm5ka, tm5k, tm3k, tmaster, tm5ka, ROT0, "Midway", "Touchmaster 5000 (v7.01 Standard)", 0 ) | |
| 1722 | GAME( 1999, tm7k, 0, tm3k, tmaster, tm7k, ROT0, "Midway", "Touchmaster 7000 (v8.04 Standard)", 0 ) | |
| 1723 | GAME( 1999, tm7ka, tm7k, tm3k, tmaster, tm7ka, ROT0, "Midway", "Touchmaster 7000 (v8.00 Standard)", 0 ) | |
| 1724 | GAME( 1999, tm7keval, tm7k, tm3k, tmaster, tm7keval, ROT0, "Midway", "Touchmaster 7000 (v8.1X Evaluation)", 0 ) | |
| 1725 | GAME( 2000, tm8k, 0, tm3k, tmaster, tm8k, ROT0, "Midway", "Touchmaster 8000 (v9.04 Standard)", 0 ) | |
| 1773 | GAME( 1996, tm, 0, tm, tm, 0, ROT0, "CES Inc., Midway Games Inc.", "Touchmaster (v3.00 Euro)", 0 ) | |
| 1774 | GAME( 1996, tmdo, tm, tm, tm, 0, ROT0, "CES Inc., Midway Games Inc.", "Touchmaster (v2.2-01 Standard)", 0 ) | |
| 1775 | GAME( 1996, tm2k, 0, tm3k, tmaster, 0, ROT0, "Midway Games Inc.", "Touchmaster 2000 (v4.02 Standard)", 0 ) | |
| 1776 | GAME( 1997, tm3k, 0, tm3k, tmaster, 0, ROT0, "Midway Games Inc.", "Touchmaster 3000 (v5.02 Standard)", 0 ) | |
| 1777 | GAME( 1997, tm3ka, tm3k, tm3k, tmaster, 0, ROT0, "Midway Games Inc.", "Touchmaster 3000 (v5.01 Standard)", 0 ) | |
| 1778 | GAME( 1998, tm4k, 0, tm3k, tmaster, tm4k, ROT0, "Midway Games Inc.", "Touchmaster 4000 (v6.03 Standard)", 0 ) | |
| 1779 | GAME( 1998, tm4ka, tm4k, tm3k, tmaster, tm4ka, ROT0, "Midway Games Inc.", "Touchmaster 4000 (v6.02 Standard)", 0 ) | |
| 1780 | GAME( 1998, tm5k, 0, tm3k, tmaster, tm5k, ROT0, "Midway Games Inc.", "Touchmaster 5000 (v7.10 Standard)", 0 ) | |
| 1781 | GAME( 1998, tm5kca, tm5k, tm3k, tmaster, tm5kca, ROT0, "Midway Games Inc.", "Touchmaster 5000 (v7.10 California)", 0 ) | |
| 1782 | GAME( 1998, tm5ka, tm5k, tm3k, tmaster, tm5ka, ROT0, "Midway Games Inc.", "Touchmaster 5000 (v7.01 Standard)", 0 ) | |
| 1783 | GAME( 1999, tm7k, 0, tm3k, tmaster, tm7k, ROT0, "Midway Games Inc.", "Touchmaster 7000 (v8.04 Standard)", 0 ) | |
| 1784 | GAME( 1999, tm7ka, tm7k, tm3k, tmaster, tm7ka, ROT0, "Midway Games Inc.", "Touchmaster 7000 (v8.00 Standard)", 0 ) | |
| 1785 | GAME( 1999, tm7keval, tm7k, tm3k, tmaster, tm7keval, ROT0, "Midway Games Inc.", "Touchmaster 7000 (v8.1X Evaluation)", 0 ) | |
| 1786 | GAME( 2000, tm8k, 0, tm3k, tmaster, tm8k, ROT0, "Midway Games Inc.", "Touchmaster 8000 (v9.04 Standard)", 0 ) | |
| 1726 | 1787 | GAME( 1998, galgbios, 0, galgames, galgames, galgames, ROT0, "Creative Electronics & Software", "Galaxy Games (BIOS v1.90)", GAME_IS_BIOS_ROOT ) |
| 1727 | 1788 | GAME( 1998, galgame2, galgbios, galgame2, galgames, galgame2, ROT0, "Creative Electronics & Software / Namco", "Galaxy Games StarPak 2", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | typedef struct _flyball_state flyball_state; | |
| 15 | struct _flyball_state | |
| 14 | class flyball_state | |
| 16 | 15 | { |
| 16 | public: | |
| 17 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, flyball_state(machine)); } | |
| 18 | ||
| 19 | flyball_state(running_machine &machine) { } | |
| 20 | ||
| 17 | 21 | /* memory pointers */ |
| 18 | 22 | UINT8 * rombase; |
| 19 | 23 | UINT8 * playfield_ram; |
| r7500 | r7501 | |
|---|---|---|
| 20 | 20 | #include "cpu/z80/z80.h" |
| 21 | 21 | #include "deprecat.h" |
| 22 | 22 | |
| 23 | typedef struct _laserbas_state laserbas_state; | |
| 24 | struct _laserbas_state | |
| 23 | class laserbas_state | |
| 25 | 24 | { |
| 25 | public: | |
| 26 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, laserbas_state(machine)); } | |
| 27 | ||
| 28 | laserbas_state(running_machine &machine) { } | |
| 29 | ||
| 26 | 30 | /* video-related */ |
| 27 | 31 | UINT8 *vram1; |
| 28 | 32 | UINT8 *vram2; |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Mikie memory map (preliminary) | |
| 3 | Mikie memory map (preliminary) | |
| 4 | 4 | |
| 5 | driver by Allard Van Der Bas | |
| 5 | driver by Allard Van Der Bas | |
| 6 | 6 | |
| 7 | 7 | |
| 8 | MAIN BOARD: | |
| 9 | 2800-288f Sprite RAM (288f, not 287f - quite unusual) | |
| 10 | 3800-3bff Color RAM | |
| 11 | 3c00-3fff Video RAM | |
| 12 | 4000-5fff ROM (?) | |
| 13 | 5ff0 Watchdog (?) | |
| 14 | 6000-ffff ROM | |
| 8 | MAIN BOARD: | |
| 9 | 2800-288f Sprite RAM (288f, not 287f - quite unusual) | |
| 10 | 3800-3bff Color RAM | |
| 11 | 3c00-3fff Video RAM | |
| 12 | 4000-5fff ROM (?) | |
| 13 | 5ff0 Watchdog (?) | |
| 14 | 6000-ffff ROM | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | ***************************************************************************/ |
| r7500 | r7501 | |
| 21 | 21 | #include "cpu/m6809/m6809.h" |
| 22 | 22 | #include "sound/sn76496.h" |
| 23 | 23 | #include "includes/konamipt.h" |
| 24 | #include "includes/mikie.h" | |
| 24 | 25 | |
| 25 | extern UINT8 *mikie_videoram; | |
| 26 | extern UINT8 *mikie_colorram; | |
| 27 | 26 | |
| 28 | extern WRITE8_HANDLER( mikie_videoram_w ); | |
| 29 | extern WRITE8_HANDLER( mikie_colorram_w ); | |
| 30 | extern WRITE8_HANDLER( mikie_palettebank_w ); | |
| 31 | extern WRITE8_HANDLER( mikie_flipscreen_w ); | |
| 27 | #define MIKIE_TIMER_RATE 512 | |
| 32 | 28 | |
| 33 | extern PALETTE_INIT( mikie ); | |
| 34 | extern VIDEO_START( mikie ); | |
| 35 | extern VIDEO_UPDATE( mikie ); | |
| 29 | #define XTAL 14318180 | |
| 30 | #define OSC 18432000 | |
| 31 | #define CLK XTAL/4 | |
| 36 | 32 | |
| 37 | /* Read/Write Handlers */ | |
| 38 | 33 | |
| 34 | /************************************* | |
| 35 | * | |
| 36 | * Memory handlers | |
| 37 | * | |
| 38 | *************************************/ | |
| 39 | ||
| 39 | 40 | static READ8_HANDLER( mikie_sh_timer_r ) |
| 40 | 41 | { |
| 41 | int clock; | |
| 42 | int clock = cpu_get_total_cycles(space->cpu) / MIKIE_TIMER_RATE; | |
| 42 | 43 | |
| 43 | #define TIMER_RATE 512 | |
| 44 | ||
| 45 | clock = cpu_get_total_cycles(space->cpu) / TIMER_RATE; | |
| 46 | ||
| 47 | 44 | return clock; |
| 48 | 45 | } |
| 49 | 46 | |
| 50 | 47 | static WRITE8_HANDLER( mikie_sh_irqtrigger_w ) |
| 51 | 48 | { |
| 52 | stat | |
| 49 | mikie_state | |
| 53 | 50 | |
| 54 | if (last == 0 && data == 1) | |
| 51 | if (state->last_irq == 0 && data == 1) | |
| 55 | 52 | { |
| 56 | 53 | // setting bit 0 low then high triggers IRQ on the sound CPU |
| 57 | cpu | |
| 54 | cpu | |
| 58 | 55 | } |
| 59 | 56 | |
| 60 | last = data; | |
| 57 | state->last_irq = data; | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | 60 | static WRITE8_HANDLER( mikie_coin_counter_w ) |
| r7500 | r7501 | |
| 65 | 62 | coin_counter_w(space->machine, offset, data); |
| 66 | 63 | } |
| 67 | 64 | |
| 68 | /* Memory Maps */ | |
| 65 | /************************************* | |
| 66 | * | |
| 67 | * Address maps | |
| 68 | * | |
| 69 | *************************************/ | |
| 69 | 70 | |
| 70 | 71 | static ADDRESS_MAP_START( mikie_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 71 | 72 | AM_RANGE(0x0000, 0x00ff) AM_RAM |
| r7500 | r7501 | |
| 82 | 83 | AM_RANGE(0x2403, 0x2403) AM_READ_PORT("DSW2") |
| 83 | 84 | AM_RANGE(0x2500, 0x2500) AM_READ_PORT("DSW0") |
| 84 | 85 | AM_RANGE(0x2501, 0x2501) AM_READ_PORT("DSW1") |
| 85 | AM_RANGE(0x2800, 0x288f) AM_RAM AM_BASE_SIZE_ | |
| 86 | AM_RANGE(0x2800, 0x288f) AM_RAM AM_BASE_SIZE_MEMBER | |
| 86 | 87 | AM_RANGE(0x2890, 0x37ff) AM_RAM |
| 87 | AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(mikie_colorram_w) AM_BASE(&mikie_colorram) | |
| 88 | AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(mikie_videoram_w) AM_BASE(&mikie_videoram) | |
| 88 | AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(mikie_colorram_w) AM_BASE_MEMBER(mikie_state, colorram) | |
| 89 | AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(mikie_videoram_w) AM_BASE_MEMBER(mikie_state, videoram) | |
| 89 | 90 | AM_RANGE(0x4000, 0x5fff) AM_ROM // Machine checks for extra rom |
| 90 | 91 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| 91 | 92 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 103 | 104 | AM_RANGE(0xa003, 0xa003) AM_WRITENOP // ??? |
| 104 | 105 | ADDRESS_MAP_END |
| 105 | 106 | |
| 106 | /* Input Ports */ | |
| 107 | /************************************* | |
| 108 | * | |
| 109 | * Input ports | |
| 110 | * | |
| 111 | *************************************/ | |
| 107 | 112 | |
| 108 | 113 | static INPUT_PORTS_START( mikie ) |
| 109 | 114 | PORT_START("SYSTEM") |
| r7500 | r7501 | |
| 152 | 157 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 153 | 158 | INPUT_PORTS_END |
| 154 | 159 | |
| 155 | /* Graphics Layouts */ | |
| 156 | 160 | |
| 161 | /************************************* | |
| 162 | * | |
| 163 | * Graphics definitions | |
| 164 | * | |
| 165 | *************************************/ | |
| 166 | ||
| 157 | 167 | static const gfx_layout charlayout = |
| 158 | 168 | { |
| 159 | 169 | 8,8, /* 8*8 characters */ |
| r7500 | r7501 | |
| 178 | 188 | 128*8 /* every sprite takes 64 bytes */ |
| 179 | 189 | }; |
| 180 | 190 | |
| 181 | /* Graphics Decode Information */ | |
| 182 | ||
| 183 | 191 | static GFXDECODE_START( mikie ) |
| 184 | 192 | GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 16*8 ) |
| 185 | 193 | GFXDECODE_ENTRY( "gfx2", 0x0000, spritelayout, 16*8*16, 16*8 ) |
| 186 | 194 | GFXDECODE_ENTRY( "gfx2", 0x0001, spritelayout, 16*8*16, 16*8 ) |
| 187 | 195 | GFXDECODE_END |
| 188 | 196 | |
| 189 | /* Sound Interface */ | |
| 190 | 197 | |
| 191 | #define XTAL 14318180 | |
| 192 | #define OSC 18432000 | |
| 193 | #define CLK XTAL/4 | |
| 198 | /************************************* | |
| 199 | * | |
| 200 | * Machine driver | |
| 201 | * | |
| 202 | *************************************/ | |
| 194 | 203 | |
| 195 | /* Machine Driver */ | |
| 204 | static MACHINE_START( mikie ) | |
| 205 | { | |
| 206 | mikie_state *state = (mikie_state *)machine->driver_data; | |
| 196 | 207 | |
| 208 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 209 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 210 | ||
| 211 | state_save_register_global(machine, state->palettebank); | |
| 212 | state_save_register_global(machine, state->last_irq); | |
| 213 | } | |
| 214 | ||
| 215 | static MACHINE_RESET( mikie ) | |
| 216 | { | |
| 217 | mikie_state *state = (mikie_state *)machine->driver_data; | |
| 218 | ||
| 219 | state->palettebank = 0; | |
| 220 | state->last_irq = 0; | |
| 221 | } | |
| 222 | ||
| 197 | 223 | static MACHINE_DRIVER_START( mikie ) |
| 198 | // basic machine hardware | |
| 224 | ||
| 225 | /* driver data */ | |
| 226 | MDRV_DRIVER_DATA(mikie_state) | |
| 227 | ||
| 228 | /* basic machine hardware */ | |
| 199 | 229 | MDRV_CPU_ADD("maincpu", M6809, OSC/12) |
| 200 | 230 | MDRV_CPU_PROGRAM_MAP(mikie_map) |
| 201 | 231 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r7500 | r7501 | |
| 203 | 233 | MDRV_CPU_ADD("audiocpu", Z80, CLK) |
| 204 | 234 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 205 | 235 | |
| 206 | // video hardware | |
| 236 | MDRV_MACHINE_START(mikie) | |
| 237 | MDRV_MACHINE_RESET(mikie) | |
| 207 | 238 | |
| 239 | /* video hardware */ | |
| 208 | 240 | MDRV_SCREEN_ADD("screen", RASTER) |
| 209 | 241 | MDRV_SCREEN_REFRESH_RATE(60.59) |
| 210 | 242 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r7500 | r7501 | |
| 219 | 251 | MDRV_VIDEO_START(mikie) |
| 220 | 252 | MDRV_VIDEO_UPDATE(mikie) |
| 221 | 253 | |
| 222 | / | |
| 254 | /* sound hardware */ | |
| 223 | 255 | // on the pcb there are 2x76489AN but SN76489 sounds correct in the locker room level (sound test 24) |
| 224 | 256 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 225 | 257 | |
| r7500 | r7501 | |
| 230 | 262 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 231 | 263 | MACHINE_DRIVER_END |
| 232 | 264 | |
| 233 | /* ROMs */ | |
| 265 | /************************************* | |
| 266 | * | |
| 267 | * ROM definition(s) | |
| 268 | * | |
| 269 | *************************************/ | |
| 234 | 270 | |
| 235 | 271 | ROM_START( mikie ) |
| 236 | 272 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| r7500 | r7501 | |
| 310 | 346 | ROM_LOAD( "d18.f9", 0x0400, 0x0100, CRC(7396b374) SHA1(fedcc421a61d6623dc9c41b0a3e164efeb50ec7c) ) // sprite lookup table |
| 311 | 347 | ROM_END |
| 312 | 348 | |
| 313 | /* Game Drivers */ | |
| 349 | /************************************* | |
| 350 | * | |
| 351 | * Game driver(s) | |
| 352 | * | |
| 353 | *************************************/ | |
| 314 | 354 | |
| 315 | GAME( 1984, mikie, 0, mikie, mikie, 0, ROT270, "Konami", "Mikie", 0 ) | |
| 316 | GAME( 1984, mikiej, mikie, mikie, mikie, 0, ROT270, "Konami", "Shinnyuushain Tooru-kun", 0 ) | |
| 317 | GAME( 1984, mikiehs, mikie, mikie, mikie, 0, ROT270, "Konami", "Mikie (High School Graffiti)", 0 ) | |
| 355 | GAME( 1984, mikie, 0, mikie, mikie, 0, ROT270, "Konami", "Mikie", GAME_SUPPORTS_SAVE ) | |
| 356 | GAME( 1984, mikiej, mikie, mikie, mikie, 0, ROT270, "Konami", "Shinnyuushain Tooru-kun", GAME_SUPPORTS_SAVE ) | |
| 357 | GAME( 1984, mikiehs, mikie, mikie, mikie, 0, ROT270, "Konami", "Mikie (High School Graffiti)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | #include "machine/8255ppi.h" |
| 18 | 18 | |
| 19 | 19 | |
| 20 | typedef struct _clayshoo_state clayshoo_state; | |
| 21 | struct _clayshoo_state | |
| 20 | class clayshoo_state | |
| 22 | 21 | { |
| 22 | public: | |
| 23 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, clayshoo_state(machine)); } | |
| 24 | ||
| 25 | clayshoo_state(running_machine &machine) { } | |
| 26 | ||
| 23 | 27 | /* memory pointers */ |
| 24 | 28 | UINT8 * videoram; |
| 25 | 29 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 19 | 19 | #include "emu.h" |
| 20 | 20 | #include "cpu/m68000/m68000.h" |
| 21 | 21 | #include "cpu/h6280/h6280.h" |
| 22 | #include "includes/cbuster.h" | |
| 22 | 23 | #include "sound/2203intf.h" |
| 23 | 24 | #include "sound/2151intf.h" |
| 24 | 25 | #include "sound/okim6295.h" |
| 25 | #include "i | |
| 26 | #include "vi | |
| 26 | 27 | |
| 27 | VIDEO_START( twocrude ); | |
| 28 | VIDEO_UPDATE( twocrude ); | |
| 29 | 28 | |
| 30 | WRITE16_HANDLER( twocrude_palette_24bit_rg_w ); | |
| 31 | WRITE16_HANDLER( twocrude_palette_24bit_b_w ); | |
| 32 | ||
| 33 | static UINT16 *twocrude_ram; | |
| 34 | extern void twocrude_pri_w(int pri); | |
| 35 | static UINT16 prot; | |
| 36 | ||
| 37 | /******************************************************************************/ | |
| 38 | ||
| 39 | 29 | static WRITE16_HANDLER( twocrude_control_w ) |
| 40 | 30 | { |
| 31 | cbuster_state *state = (cbuster_state *)space->machine->driver_data; | |
| 32 | ||
| 41 | 33 | switch (offset << 1) |
| 42 | 34 | { |
| 43 | 35 | case 0: /* DMA flag */ |
| r7500 | r7501 | |
| 49 | 41 | |
| 50 | 42 | case 2: /* Sound CPU write */ |
| 51 | 43 | soundlatch_w(space, 0, data & 0xff); |
| 52 | cpu | |
| 44 | cpu | |
| 53 | 45 | return; |
| 54 | 46 | |
| 55 | 47 | case 4: /* Protection, maybe this is a PAL on the board? |
| r7500 | r7501 | |
| 69 | 61 | protection?! |
| 70 | 62 | |
| 71 | 63 | */ |
| 72 | if ((data & 0xffff) == 0x9a00) prot = 0; | |
| 73 | if ((data & 0xffff) == 0xaa) prot = 0x74; | |
| 74 | if ((data & 0xffff) == 0x0200) prot = 0x63 << 8; | |
| 75 | if ((data & 0xffff) == 0x9a) prot = 0xe; | |
| 76 | if ((data & 0xffff) == 0x55) prot = 0x1e; | |
| 77 | if ((data & 0xffff) == 0x0e) {prot = 0x0e; twocrude_pri_w(0);} /* start */ | |
| 78 | if ((data & 0xffff) == 0x00) {prot = 0x0e; twocrude_pri_w(0);} /* level 0 */ | |
| 79 | if ((data & 0xffff) == 0xf1) {prot = 0x36; twocrude_pri_w(1);} /* level 1 */ | |
| 80 | if ((data & 0xffff) == 0x80) {prot = 0x2e; twocrude_pri_w(1);} /* level 2 */ | |
| 81 | if ((data & 0xffff) == 0x40) {prot = 0x1e; twocrude_pri_w(1);} /* level 3 */ | |
| 82 | if ((data & 0xffff) == 0xc0) {prot = 0x3e; twocrude_pri_w(0);} /* level 4 */ | |
| 83 | if ((data & 0xffff) == 0xff) {prot = 0x76; twocrude_pri_w(1);} /* level 5 */ | |
| 64 | if ((data & 0xffff) == 0x9a00) state->prot = 0; | |
| 65 | if ((data & 0xffff) == 0xaa) state->prot = 0x74; | |
| 66 | if ((data & 0xffff) == 0x0200) state->prot = 0x63 << 8; | |
| 67 | if ((data & 0xffff) == 0x9a) state->prot = 0xe; | |
| 68 | if ((data & 0xffff) == 0x55) state->prot = 0x1e; | |
| 69 | if ((data & 0xffff) == 0x0e) {state->prot = 0x0e; state->pri = 0;} /* start */ | |
| 70 | if ((data & 0xffff) == 0x00) {state->prot = 0x0e; state->pri = 0;} /* level 0 */ | |
| 71 | if ((data & 0xffff) == 0xf1) {state->prot = 0x36; state->pri = 1;} /* level 1 */ | |
| 72 | if ((data & 0xffff) == 0x80) {state->prot = 0x2e; state->pri = 1;} /* level 2 */ | |
| 73 | if ((data & 0xffff) == 0x40) {state->prot = 0x1e; state->pri = 1;} /* level 3 */ | |
| 74 | if ((data & 0xffff) == 0xc0) {state->prot = 0x3e; state->pri = 0;} /* level 4 */ | |
| 75 | if ((data & 0xffff) == 0xff) {state->prot = 0x76; state->pri = 1;} /* level 5 */ | |
| 84 | 76 | |
| 85 | 77 | break; |
| 86 | 78 | } |
| r7500 | r7501 | |
| 89 | 81 | |
| 90 | 82 | static READ16_HANDLER( twocrude_control_r ) |
| 91 | 83 | { |
| 92 | switch (offset<<1) | |
| 84 | cbuster_state *state = (cbuster_state *)space->machine->driver_data; | |
| 85 | ||
| 86 | switch (offset << 1) | |
| 93 | 87 | { |
| 94 | 88 | case 0: /* Player 1 & Player 2 joysticks & fire buttons */ |
| 95 | 89 | return input_port_read(space->machine, "P1_P2"); |
| r7500 | r7501 | |
| 98 | 92 | return input_port_read(space->machine, "DSW"); |
| 99 | 93 | |
| 100 | 94 | case 4: /* Protection */ |
| 101 | logerror("%04x : protection control read at 30c000 %d\n",cpu_get_pc(space->cpu),offset); | |
| 102 | return prot; | |
| 95 | logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(space->cpu), offset); | |
| 96 | return state->prot; | |
| 103 | 97 | |
| 104 | 98 | case 6: /* Credits, VBL in byte 7 */ |
| 105 | 99 | return input_port_read(space->machine, "COINS"); |
| r7500 | r7501 | |
| 112 | 106 | |
| 113 | 107 | static ADDRESS_MAP_START( twocrude_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 114 | 108 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 115 | AM_RANGE(0x080000, 0x083fff) AM_RAM AM_BASE( | |
| 109 | AM_RANGE(0x080000, 0x083fff) AM_RAM AM_BASE_MEMBER( | |
| 116 | 110 | |
| 117 | AM_RANGE(0x0a0000, 0x0a1fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 118 | AM_RANGE(0x0a2000, 0x0a2fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 119 | AM_RANGE(0x0a4000, 0x0a47ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 120 | AM_RANGE(0x0a6000, 0x0a67ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 111 | AM_RANGE(0x0a0000, 0x0a1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 112 | AM_RANGE(0x0a2000, 0x0a2fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 113 | AM_RANGE(0x0a4000, 0x0a47ff) AM_RAM AM_BASE_MEMBER(cbuster_state, pf1_rowscroll) | |
| 114 | AM_RANGE(0x0a6000, 0x0a67ff) AM_RAM AM_BASE_MEMBER(cbuster_state, pf2_rowscroll) | |
| 121 | 115 | |
| 122 | AM_RANGE(0x0a8000, 0x0a8fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 123 | AM_RANGE(0x0aa000, 0x0aafff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 124 | AM_RANGE(0x0ac000, 0x0ac7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 125 | AM_RANGE(0x0ae000, 0x0ae7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 116 | AM_RANGE(0x0a8000, 0x0a8fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 117 | AM_RANGE(0x0aa000, 0x0aafff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 118 | AM_RANGE(0x0ac000, 0x0ac7ff) AM_RAM AM_BASE_MEMBER(cbuster_state, pf3_rowscroll) | |
| 119 | AM_RANGE(0x0ae000, 0x0ae7ff) AM_RAM AM_BASE_MEMBER(cbuster_state, pf4_rowscroll) | |
| 126 | 120 | |
| 127 | 121 | AM_RANGE(0x0b0000, 0x0b07ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 128 | 122 | AM_RANGE(0x0b4000, 0x0b4001) AM_WRITENOP |
| 129 | AM_RANGE(0x0b5000, 0x0b500f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 130 | AM_RANGE(0x0b6000, 0x0b600f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 123 | AM_RANGE(0x0b5000, 0x0b500f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 124 | AM_RANGE(0x0b6000, 0x0b600f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 131 | 125 | AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_WRITE(twocrude_palette_24bit_rg_w) AM_BASE_GENERIC(paletteram) |
| 132 | 126 | AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_WRITE(twocrude_palette_24bit_b_w) AM_BASE_GENERIC(paletteram2) |
| 133 | 127 | AM_RANGE(0x0bc000, 0x0bc00f) AM_READWRITE(twocrude_control_r, twocrude_control_w) |
| r7500 | r7501 | |
| 168 | 162 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 169 | 163 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) |
| 170 | 164 | |
| 171 | PORT_START("COINS") | |
| 165 | PORT_START("COINS") | |
| 172 | 166 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 173 | 167 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 174 | 168 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) |
| r7500 | r7501 | |
| 272 | 266 | |
| 273 | 267 | static void sound_irq(running_device *device, int state) |
| 274 | 268 | { |
| 275 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 269 | cbuster_state *driver_state = (cbuster_state *)device->machine->driver_data; | |
| 270 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 276 | 271 | } |
| 277 | 272 | |
| 278 | 273 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 280 | 275 | sound_irq |
| 281 | 276 | }; |
| 282 | 277 | |
| 278 | static int twocrude_bank_callback( const int bank ) | |
| 279 | { | |
| 280 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 281 | } | |
| 282 | ||
| 283 | static const deco16ic_interface twocrude_deco16ic_intf = | |
| 284 | { | |
| 285 | "screen", | |
| 286 | 0, 0, 1, | |
| 287 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 288 | 0x00, 0x20, 0x30, 0x40, /* color base (default values) */ | |
| 289 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 290 | twocrude_bank_callback, | |
| 291 | twocrude_bank_callback, | |
| 292 | twocrude_bank_callback, | |
| 293 | twocrude_bank_callback | |
| 294 | }; | |
| 295 | ||
| 296 | static MACHINE_START( cbuster ) | |
| 297 | { | |
| 298 | cbuster_state *state = (cbuster_state *)machine->driver_data; | |
| 299 | ||
| 300 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 301 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 302 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 303 | ||
| 304 | state_save_register_global(machine, state->prot); | |
| 305 | state_save_register_global(machine, state->pri); | |
| 306 | } | |
| 307 | ||
| 308 | static MACHINE_RESET( cbuster ) | |
| 309 | { | |
| 310 | cbuster_state *state = (cbuster_state *)machine->driver_data; | |
| 311 | ||
| 312 | state->prot = 0; | |
| 313 | state->pri = 0; | |
| 314 | } | |
| 315 | ||
| 283 | 316 | static MACHINE_DRIVER_START( twocrude ) |
| 284 | 317 | |
| 318 | /* driver data */ | |
| 319 | MDRV_DRIVER_DATA(cbuster_state) | |
| 320 | ||
| 285 | 321 | /* basic machine hardware */ |
| 286 | 322 | MDRV_CPU_ADD("maincpu", M68000, 12000000) /* Custom chip 59 */ |
| 287 | 323 | MDRV_CPU_PROGRAM_MAP(twocrude_map) |
| r7500 | r7501 | |
| 290 | 326 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ |
| 291 | 327 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 292 | 328 | |
| 329 | MDRV_MACHINE_START(cbuster) | |
| 330 | MDRV_MACHINE_RESET(cbuster) | |
| 331 | ||
| 293 | 332 | /* video hardware */ |
| 294 | 333 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 295 | 334 | |
| r7500 | r7501 | |
| 303 | 342 | MDRV_GFXDECODE(cbuster) |
| 304 | 343 | MDRV_PALETTE_LENGTH(2048) |
| 305 | 344 | |
| 306 | MDRV_VIDEO_START(twocrude) | |
| 307 | 345 | MDRV_VIDEO_UPDATE(twocrude) |
| 308 | 346 | |
| 347 | MDRV_DECO16IC_ADD("deco_custom", twocrude_deco16ic_intf) | |
| 348 | ||
| 309 | 349 | /* sound hardware */ |
| 310 | 350 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 311 | 351 | |
| r7500 | r7501 | |
| 486 | 526 | { |
| 487 | 527 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 488 | 528 | UINT8 *PTR; |
| 489 | int i,j; | |
| 529 | int i, j; | |
| 490 | 530 | |
| 491 | 531 | /* Main cpu decrypt */ |
| 492 | for (i=0x00000; i<0x80000; i+=2) { | |
| 493 | int h = i+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = i+NATIVE_ENDIAN_VALUE_LE_BE(0,1); | |
| 532 | for (i = 0x00000; i < 0x80000; i += 2) | |
| 533 | { | |
| 534 | int h = i + NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = i + NATIVE_ENDIAN_VALUE_LE_BE(0,1); | |
| 494 | 535 | |
| 495 | RAM[h]=(RAM[h] & 0xcf) | ((RAM[h] & 0x10) << 1) | ((RAM[h] & 0x20) >> 1); | |
| 496 | RAM[h]=(RAM[h] & 0x5f) | ((RAM[h] & 0x20) << 2) | ((RAM[h] & 0x80) >> 2); | |
| 536 | RAM[h] = (RAM[h] & 0xcf) | ((RAM[h] & 0x10) << 1) | ((RAM[h] & 0x20) >> 1); | |
| 537 | RAM[h] = (RAM[h] & 0x5f) | ((RAM[h] & 0x20) << 2) | ((RAM[h] & 0x80) >> 2); | |
| 497 | 538 | |
| 498 | RAM[l]=(RAM[l] & 0xbd) | ((RAM[l] & 0x2) << 5) | ((RAM[l] & 0x40) >> 5); | |
| 499 | RAM[l]=(RAM[l] & 0xf5) | ((RAM[l] & 0x2) << 2) | ((RAM[l] & 0x8) >> 2); | |
| 539 | RAM[l] = (RAM[l] & 0xbd) | ((RAM[l] & 0x2) << 5) | ((RAM[l] & 0x40) >> 5); | |
| 540 | RAM[l] = (RAM[l] & 0xf5) | ((RAM[l] & 0x2) << 2) | ((RAM[l] & 0x8) >> 2); | |
| 500 | 541 | } |
| 501 | 542 | |
| 502 | 543 | /* Rearrange the 'extra' sprite bank to be in the same format as main sprites */ |
| 503 | 544 | RAM = memory_region(machine, "gfx3") + 0x080000; |
| 504 | 545 | PTR = memory_region(machine, "gfx3") + 0x140000; |
| 505 | for (i=0; i<0x20000; i+=64) { | |
| 506 | for (j=0; j<16; j+=1) { /* Copy 16 lines down */ | |
| 507 | RAM[i+ 0+j*2]=PTR[i/2+ 0+j]; /* Pixels 0-7 for each plane */ | |
| 508 | RAM[i+ 1+j*2]=PTR[i/2+0x10000+j]; | |
| 509 | RAM[i+0xa0000+j*2]=PTR[i/2+0x20000+j]; | |
| 510 | RAM[i+0xa0001+j*2]=PTR[i/2+0x30000+j]; | |
| 546 | for (i = 0; i < 0x20000; i += 64) | |
| 547 | { | |
| 548 | for (j = 0; j < 16; j += 1) | |
| 549 | { /* Copy 16 lines down */ | |
| 550 | RAM[i + 0 + j * 2] = PTR[i / 2 + 0 + j]; /* Pixels 0-7 for each plane */ | |
| 551 | RAM[i + 1 + j * 2] = PTR[i / 2 + 0x10000 + j]; | |
| 552 | RAM[i + 0xa0000 + j * 2] = PTR[i / 2 + 0x20000 + j]; | |
| 553 | RAM[i + 0xa0001 + j * 2] = PTR[i / 2 + 0x30000 + j]; | |
| 511 | 554 | } |
| 512 | 555 | |
| 513 | for (j=0; j<16; j+=1) { /* Copy 16 lines down */ | |
| 514 | RAM[i+ 0x20+j*2]=PTR[i/2+ 0x10+j]; /* Pixels 8-15 for each plane */ | |
| 515 | RAM[i+ 0x21+j*2]=PTR[i/2+0x10010+j]; | |
| 516 | RAM[i+0xa0020+j*2]=PTR[i/2+0x20010+j]; | |
| 517 | RAM[i+0xa0021+j*2]=PTR[i/2+0x30010+j]; | |
| 556 | for (j = 0; j < 16; j += 1) | |
| 557 | { /* Copy 16 lines down */ | |
| 558 | RAM[i + 0x20 + j * 2] = PTR[i / 2 + 0x10 + j]; /* Pixels 8-15 for each plane */ | |
| 559 | RAM[i + 0x21 + j * 2] = PTR[i / 2 + 0x10010 + j]; | |
| 560 | RAM[i + 0xa0020 + j * 2] = PTR[i / 2 + 0x20010 + j]; | |
| 561 | RAM[i + 0xa0021 + j * 2] = PTR[i / 2 + 0x30010 + j]; | |
| 518 | 562 | } |
| 519 | 563 | } |
| 520 | 564 | } |
| 521 | 565 | |
| 522 | 566 | /******************************************************************************/ |
| 523 | 567 | |
| 524 | GAME( 1990, cbuster, 0, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (World FX version)", 0 ) | |
| 525 | GAME( 1990, cbusterw, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (World FU version)", 0 ) | |
| 526 | GAME( 1990, cbusterj, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (Japan)", 0 ) | |
| 527 | GAME( 1990, twocrude, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East USA", "Two Crude (US)", 0 ) | |
| 568 | GAME( 1990, cbuster, 0, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (World FX version)", GAME_SUPPORTS_SAVE ) | |
| 569 | GAME( 1990, cbusterw, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (World FU version)", GAME_SUPPORTS_SAVE ) | |
| 570 | GAME( 1990, cbusterj, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East Corporation", "Crude Buster (Japan)", GAME_SUPPORTS_SAVE ) | |
| 571 | GAME( 1990, twocrude, cbuster, twocrude, twocrude, twocrude, ROT0, "Data East USA", "Two Crude (US)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 58 | 58 | #define DUNHUANG_DEBUG 0 |
| 59 | 59 | |
| 60 | 60 | |
| 61 | typedef struct _dunhuang_state dunhuang_state; | |
| 62 | struct _dunhuang_state | |
| 61 | class dunhuang_state | |
| 63 | 62 | { |
| 63 | public: | |
| 64 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dunhuang_state(machine)); } | |
| 65 | ||
| 66 | dunhuang_state(running_machine &machine) { } | |
| 67 | ||
| 64 | 68 | /* memory pointers */ |
| 65 | 69 | UINT16 * videoram; |
| 66 | 70 | UINT16 * videoram2; |
| r7500 | r7501 | |
|---|---|---|
| 20 | 20 | Driver by Takahiro Nogi <nogi@kt.rim.or.jp> 2000/06/10 - |
| 21 | 21 | Driver by Uki 2001/12/10 - |
| 22 | 22 | |
| 23 | ******************************************************************************/ | |
| 24 | /****************************************************************************** | |
| 23 | ****************************************************************************** | |
| 24 | ||
| 25 | 25 | Memo: |
| 26 | 26 | |
| 27 | 27 | - Sometimes RAM check in testmode fails (reason unknown). |
| r7500 | r7501 | |
| 33 | 33 | |
| 34 | 34 | #include "emu.h" |
| 35 | 35 | #include "cpu/z80/z80.h" |
| 36 | #include "includes/ojankohs.h" | |
| 36 | 37 | #include "sound/ay8910.h" |
| 37 | 38 | #include "sound/msm5205.h" |
| 38 | 39 | |
| 39 | 40 | |
| 40 | VIDEO_UPDATE( ojankohs ); | |
| 41 | PALETTE_INIT( ojankoy ); | |
| 42 | VIDEO_START( ojankohs ); | |
| 43 | VIDEO_START( ojankoy ); | |
| 44 | WRITE8_HANDLER( ojankohs_palette_w ); | |
| 45 | WRITE8_HANDLER( ccasino_palette_w ); | |
| 46 | WRITE8_HANDLER( ojankohs_videoram_w ); | |
| 47 | WRITE8_HANDLER( ojankohs_colorram_w ); | |
| 48 | WRITE8_HANDLER( ojankohs_gfxreg_w ); | |
| 49 | WRITE8_HANDLER( ojankohs_flipscreen_w ); | |
| 50 | VIDEO_UPDATE( ojankoc ); | |
| 51 | VIDEO_START( ojankoc ); | |
| 52 | WRITE8_HANDLER( ojankoc_palette_w ); | |
| 53 | WRITE8_HANDLER( ojankoc_videoram_w ); | |
| 54 | void ojankoc_flipscreen(const address_space *space, int data); | |
| 55 | ||
| 56 | ||
| 57 | static int ojankohs_portselect; | |
| 58 | static int ojankohs_adpcm_reset; | |
| 59 | static int ojankohs_adpcm_data; | |
| 60 | static int ojankohs_vclk_left; | |
| 61 | ||
| 62 | ||
| 63 | static MACHINE_RESET( ojankohs ) | |
| 64 | { | |
| 65 | ojankohs_portselect = 0; | |
| 66 | ||
| 67 | ojankohs_adpcm_reset = 0; | |
| 68 | ojankohs_adpcm_data = 0; | |
| 69 | ojankohs_vclk_left = 0; | |
| 70 | } | |
| 71 | ||
| 72 | 41 | static WRITE8_HANDLER( ojankohs_rombank_w ) |
| 73 | 42 | { |
| 74 | UINT8 *ROM = memory_region(space->machine, "maincpu"); | |
| 75 | ||
| 76 | memory_set_bankptr(space->machine, "bank1", &ROM[0x10000 + (0x4000 * (data & 0x3f))]); | |
| 43 | memory_set_bank(space->machine, "bank1", data & 0x3f); | |
| 77 | 44 | } |
| 78 | 45 | |
| 79 | 46 | static WRITE8_HANDLER( ojankoy_rombank_w ) |
| 80 | 47 | { |
| 81 | | |
| 48 | ojankohs_state *state = ( | |
| 82 | 49 | |
| 83 | memory_set_bank | |
| 50 | memory_set_bank | |
| 84 | 51 | |
| 85 | ojankohs_adpcm_reset = ((data & 0x20) >> 5); | |
| 86 | if (!ojankohs_adpcm_reset) ojankohs_vclk_left = 0; | |
| 52 | state->adpcm_reset = BIT(data, 5); | |
| 53 | if (!state->adpcm_reset) | |
| 54 | state->vclk_left = 0; | |
| 87 | 55 | |
| 88 | msm5205_reset_w( | |
| 56 | msm5205_reset_w(s | |
| 89 | 57 | } |
| 90 | 58 | |
| 91 | 59 | static WRITE8_DEVICE_HANDLER( ojankohs_adpcm_reset_w ) |
| 92 | 60 | { |
| 93 | ojankohs_adpcm_reset = (data & 0x01); | |
| 94 | ojankohs_vclk_left = 0; | |
| 61 | ojankohs_state *state = (ojankohs_state *)device->machine->driver_data; | |
| 62 | state->adpcm_reset = BIT(data, 0); | |
| 63 | state->vclk_left = 0; | |
| 95 | 64 | |
| 96 | msm5205_reset_w(device, ! | |
| 65 | msm5205_reset_w(device, ! | |
| 97 | 66 | } |
| 98 | 67 | |
| 99 | 68 | static WRITE8_HANDLER( ojankohs_msm5205_w ) |
| 100 | 69 | { |
| 101 | ojankohs_adpcm_data = data; | |
| 102 | ojankohs_vclk_left = 2; | |
| 70 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 71 | state->adpcm_data = data; | |
| 72 | state->vclk_left = 2; | |
| 103 | 73 | } |
| 104 | 74 | |
| 105 | static void ojankohs_adpcm_int(running_device *device) | |
| 75 | static void ojankohs_adpcm_int( running_device *device ) | |
| 106 | 76 | { |
| 77 | ojankohs_state *state = (ojankohs_state *)device->machine->driver_data; | |
| 78 | ||
| 107 | 79 | /* skip if we're reset */ |
| 108 | if (! | |
| 80 | if (! | |
| 109 | 81 | return; |
| 110 | 82 | |
| 111 | 83 | /* clock the data through */ |
| 112 | if (ojankohs_vclk_left) { | |
| 113 | msm5205_data_w(device, (ojankohs_adpcm_data >> 4)); | |
| 114 | ojankohs_adpcm_data <<= 4; | |
| 115 | ojankohs_vclk_left--; | |
| 84 | if (state->vclk_left) | |
| 85 | { | |
| 86 | msm5205_data_w(device, (state->adpcm_data >> 4)); | |
| 87 | state->adpcm_data <<= 4; | |
| 88 | state->vclk_left--; | |
| 116 | 89 | } |
| 117 | 90 | |
| 118 | 91 | /* generate an NMI if we're out of data */ |
| 119 | if (!ojankohs_vclk_left) | |
| 120 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 92 | if (!state->vclk_left) | |
| 93 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 121 | 94 | } |
| 122 | 95 | |
| 123 | 96 | static WRITE8_HANDLER( ojankoc_ctrl_w ) |
| 124 | 97 | { |
| 125 | UINT8 *BANKROM = memory_region(space->machine, "user1"); | |
| 126 | UINT32 bank_address = (data & 0x0f) * 0x8000; | |
| 98 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 127 | 99 | |
| 128 | memory_set_bank | |
| 100 | memory_set_bank | |
| 129 | 101 | |
| 130 | ojankohs_adpcm_reset = ((data & 0x10) >> 4); | |
| 131 | msm5205_reset_w(devtag_get_device(space->machine, "msm"), (!(data & 0x10) >> 4)); | |
| 102 | state->adpcm_reset = BIT(data, 4); | |
| 103 | msm5205_reset_w(state->msm, !BIT(data, 4)); | |
| 132 | 104 | ojankoc_flipscreen(space, data); |
| 133 | 105 | } |
| 134 | 106 | |
| 135 | 107 | static WRITE8_HANDLER( ojankohs_portselect_w ) |
| 136 | 108 | { |
| 137 | ojankohs_portselect = data; | |
| 109 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 110 | state->portselect = data; | |
| 138 | 111 | } |
| 139 | 112 | |
| 140 | 113 | static READ8_HANDLER( ojankohs_keymatrix_r ) |
| 141 | 114 | { |
| 115 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 142 | 116 | int ret; |
| 143 | 117 | |
| 144 | switch (ojankohs_portselect) { | |
| 118 | switch (state->portselect) | |
| 119 | { | |
| 145 | 120 | case 0x01: ret = input_port_read(space->machine, "KEY0"); break; |
| 146 | 121 | case 0x02: ret = input_port_read(space->machine, "KEY1"); break; |
| 147 | 122 | case 0x04: ret = input_port_read(space->machine, "KEY2"); break; |
| r7500 | r7501 | |
| 156 | 131 | ret &= input_port_read(space->machine, "KEY4"); |
| 157 | 132 | break; |
| 158 | 133 | default: ret = 0xff; |
| 159 | logerror("PC:%04X unknown %02X\n", cpu_get_pc(space->cpu), | |
| 134 | logerror("PC:%04X unknown %02X\n", cpu_get_pc(space->cpu), | |
| 160 | 135 | break; |
| 161 | 136 | } |
| 162 | 137 | |
| r7500 | r7501 | |
| 165 | 140 | |
| 166 | 141 | static READ8_HANDLER( ojankoc_keymatrix_r ) |
| 167 | 142 | { |
| 143 | ojankohs_state *state = (ojankohs_state *)space->machine->driver_data; | |
| 168 | 144 | int i; |
| 169 | 145 | int ret = 0; |
| 170 | 146 | static const char *const keynames[2][5] = |
| r7500 | r7501 | |
| 173 | 149 | { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" } |
| 174 | 150 | }; |
| 175 | 151 | |
| 176 | for (i = 0; i < 5; i++) { | |
| 177 | if (~ojankohs_portselect & (1 << i)) | |
| 152 | for (i = 0; i < 5; i++) | |
| 153 | { | |
| 154 | if (!BIT(state->portselect, i)) | |
| 178 | 155 | ret |= input_port_read(space->machine, keynames[offset][i]); |
| 179 | 156 | } |
| 180 | 157 | |
| r7500 | r7501 | |
| 211 | 188 | |
| 212 | 189 | static WRITE8_HANDLER( ojankoy_coinctr_w ) |
| 213 | 190 | { |
| 214 | coin_counter_w( | |
| 191 | coin_counter_w( | |
| 215 | 192 | } |
| 216 | 193 | |
| 217 | 194 | static WRITE8_HANDLER( ccasino_coinctr_w ) |
| 218 | 195 | { |
| 219 | coin_counter_w(space->machine, 0, (data | |
| 196 | coin_counter_w(space->machine, 0, BIT(data, 1 | |
| 220 | 197 | } |
| 221 | 198 | |
| 222 | 199 | |
| r7500 | r7501 | |
| 299 | 276 | |
| 300 | 277 | |
| 301 | 278 | static INPUT_PORTS_START( mahjong_p1 ) |
| 302 | PORT_START("KEY0") | |
| 279 | PORT_START("KEY0") | |
| 303 | 280 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) |
| 304 | 281 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) |
| 305 | 282 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) |
| r7500 | r7501 | |
| 309 | 286 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 310 | 287 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 311 | 288 | |
| 312 | PORT_START("KEY1") | |
| 289 | PORT_START("KEY1") | |
| 313 | 290 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) |
| 314 | 291 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) |
| 315 | 292 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) |
| r7500 | r7501 | |
| 319 | 296 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 320 | 297 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 321 | 298 | |
| 322 | PORT_START("KEY2") | |
| 299 | PORT_START("KEY2") | |
| 323 | 300 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) |
| 324 | 301 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) |
| 325 | 302 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) |
| r7500 | r7501 | |
| 329 | 306 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 330 | 307 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 331 | 308 | |
| 332 | PORT_START("KEY3") | |
| 309 | PORT_START("KEY3") | |
| 333 | 310 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) |
| 334 | 311 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) |
| 335 | 312 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) |
| r7500 | r7501 | |
| 339 | 316 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 340 | 317 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 341 | 318 | |
| 342 | PORT_START("KEY4") | |
| 319 | PORT_START("KEY4") | |
| 343 | 320 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) |
| 344 | 321 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) |
| 345 | 322 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) |
| r7500 | r7501 | |
| 351 | 328 | INPUT_PORTS_END |
| 352 | 329 | |
| 353 | 330 | static INPUT_PORTS_START( ojankohs ) |
| 354 | PORT_START("IN0") | |
| 331 | PORT_START("IN0") | |
| 355 | 332 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 356 | 333 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET |
| 357 | 334 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER |
| r7500 | r7501 | |
| 361 | 338 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 362 | 339 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 363 | 340 | |
| 364 | PORT_START("IN1") | |
| 341 | PORT_START("IN1") | |
| 365 | 342 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 366 | 343 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 367 | 344 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r7500 | r7501 | |
| 412 | 389 | INPUT_PORTS_END |
| 413 | 390 | |
| 414 | 391 | static INPUT_PORTS_START( ojankoy ) |
| 415 | PORT_START("IN0") | |
| 392 | PORT_START("IN0") | |
| 416 | 393 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 417 | 394 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET |
| 418 | 395 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER |
| r7500 | r7501 | |
| 422 | 399 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 423 | 400 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 424 | 401 | |
| 425 | PORT_START("IN1") | |
| 402 | PORT_START("IN1") | |
| 426 | 403 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 427 | 404 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 428 | 405 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r7500 | r7501 | |
| 483 | 460 | INPUT_PORTS_END |
| 484 | 461 | |
| 485 | 462 | static INPUT_PORTS_START( ccasino ) |
| 486 | PORT_START("IN0") | |
| 463 | PORT_START("IN0") | |
| 487 | 464 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 488 | 465 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET |
| 489 | 466 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER |
| r7500 | r7501 | |
| 493 | 470 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 494 | 471 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 495 | 472 | |
| 496 | PORT_START("IN1") | |
| 473 | PORT_START("IN1") | |
| 497 | 474 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 498 | 475 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 499 | 476 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r7500 | r7501 | |
| 661 | 638 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 662 | 639 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 663 | 640 | |
| 664 | PORT_START("KEY0") | |
| 641 | PORT_START("KEY0") | |
| 665 | 642 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) |
| 666 | 643 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) |
| 667 | 644 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) |
| r7500 | r7501 | |
| 671 | 648 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 672 | 649 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 673 | 650 | |
| 674 | PORT_START("KEY1") | |
| 651 | PORT_START("KEY1") | |
| 675 | 652 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) |
| 676 | 653 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) |
| 677 | 654 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) |
| r7500 | r7501 | |
| 681 | 658 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 682 | 659 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 683 | 660 | |
| 684 | PORT_START("KEY2") | |
| 661 | PORT_START("KEY2") | |
| 685 | 662 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) |
| 686 | 663 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) |
| 687 | 664 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) |
| r7500 | r7501 | |
| 691 | 668 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 692 | 669 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 693 | 670 | |
| 694 | PORT_START("KEY3") | |
| 671 | PORT_START("KEY3") | |
| 695 | 672 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) |
| 696 | 673 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) |
| 697 | 674 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) |
| r7500 | r7501 | |
| 701 | 678 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 702 | 679 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 703 | 680 | |
| 704 | PORT_START("KEY4") | |
| 681 | PORT_START("KEY4") | |
| 705 | 682 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) |
| 706 | 683 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) |
| 707 | 684 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) |
| r7500 | r7501 | |
| 711 | 688 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 712 | 689 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 713 | 690 | |
| 714 | PORT_START("KEY5") | |
| 691 | PORT_START("KEY5") | |
| 715 | 692 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(2) |
| 716 | 693 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(2) |
| 717 | 694 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 720 | 697 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 ) |
| 721 | 698 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 722 | 699 | |
| 723 | PORT_START("KEY6") | |
| 700 | PORT_START("KEY6") | |
| 724 | 701 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(2) |
| 725 | 702 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(2) |
| 726 | 703 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 729 | 706 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) PORT_PLAYER(2) |
| 730 | 707 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 731 | 708 | |
| 732 | PORT_START("KEY7") | |
| 709 | PORT_START("KEY7") | |
| 733 | 710 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(2) |
| 734 | 711 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(2) |
| 735 | 712 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 738 | 715 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 739 | 716 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 740 | 717 | |
| 741 | PORT_START("KEY8") | |
| 718 | PORT_START("KEY8") | |
| 742 | 719 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(2) |
| 743 | 720 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(2) |
| 744 | 721 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 747 | 724 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 748 | 725 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 749 | 726 | |
| 750 | PORT_START("KEY9") | |
| 727 | PORT_START("KEY9") | |
| 751 | 728 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) |
| 752 | 729 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) |
| 753 | 730 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) |
| r7500 | r7501 | |
| 815 | 792 | }; |
| 816 | 793 | |
| 817 | 794 | |
| 795 | static MACHINE_START( common ) | |
| 796 | { | |
| 797 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 798 | ||
| 799 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 800 | state->msm = devtag_get_device(machine, "msm"); | |
| 801 | ||
| 802 | state_save_register_global(machine, state->gfxreg); | |
| 803 | state_save_register_global(machine, state->flipscreen); | |
| 804 | state_save_register_global(machine, state->flipscreen_old); | |
| 805 | state_save_register_global(machine, state->scrollx); | |
| 806 | state_save_register_global(machine, state->scrolly); | |
| 807 | state_save_register_global(machine, state->screen_refresh); | |
| 808 | state_save_register_global(machine, state->portselect); | |
| 809 | state_save_register_global(machine, state->adpcm_reset); | |
| 810 | state_save_register_global(machine, state->adpcm_data); | |
| 811 | state_save_register_global(machine, state->vclk_left); | |
| 812 | } | |
| 813 | ||
| 814 | static MACHINE_START( ojankohs ) | |
| 815 | { | |
| 816 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 817 | ||
| 818 | memory_configure_bank(machine, "bank1", 0, 0x40, &ROM[0x10000], 0x4000); | |
| 819 | ||
| 820 | MACHINE_START_CALL(common); | |
| 821 | } | |
| 822 | ||
| 823 | static MACHINE_START( ojankoy ) | |
| 824 | { | |
| 825 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 826 | ||
| 827 | memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x10000], 0x4000); | |
| 828 | ||
| 829 | MACHINE_START_CALL(common); | |
| 830 | } | |
| 831 | ||
| 832 | static MACHINE_START( ojankoc ) | |
| 833 | { | |
| 834 | UINT8 *ROM = memory_region(machine, "user1"); | |
| 835 | ||
| 836 | memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x0000], 0x8000); | |
| 837 | ||
| 838 | MACHINE_START_CALL(common); | |
| 839 | } | |
| 840 | ||
| 841 | static MACHINE_RESET( ojankohs ) | |
| 842 | { | |
| 843 | ojankohs_state *state = (ojankohs_state *)machine->driver_data; | |
| 844 | ||
| 845 | state->portselect = 0; | |
| 846 | ||
| 847 | state->adpcm_reset = 0; | |
| 848 | state->adpcm_data = 0; | |
| 849 | state->vclk_left = 0; | |
| 850 | ||
| 851 | state->gfxreg = 0; | |
| 852 | state->flipscreen = 0; | |
| 853 | state->flipscreen_old = 0; | |
| 854 | state->scrollx = 0; | |
| 855 | state->scrolly = 0; | |
| 856 | state->screen_refresh = 0; | |
| 857 | } | |
| 858 | ||
| 818 | 859 | static MACHINE_DRIVER_START( ojankohs ) |
| 819 | 860 | |
| 861 | /* driver data */ | |
| 862 | MDRV_DRIVER_DATA(ojankohs_state) | |
| 863 | ||
| 820 | 864 | /* basic machine hardware */ |
| 821 | 865 | MDRV_CPU_ADD("maincpu", Z80,12000000/2) /* 6.00 MHz ? */ |
| 822 | 866 | MDRV_CPU_PROGRAM_MAP(ojankohs_map) |
| 823 | 867 | MDRV_CPU_IO_MAP(ojankohs_io_map) |
| 824 | 868 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 825 | 869 | |
| 870 | MDRV_MACHINE_START(ojankohs) | |
| 826 | 871 | MDRV_MACHINE_RESET(ojankohs) |
| 827 | 872 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 828 | 873 | |
| r7500 | r7501 | |
| 854 | 899 | |
| 855 | 900 | static MACHINE_DRIVER_START( ojankoy ) |
| 856 | 901 | |
| 902 | /* driver data */ | |
| 903 | MDRV_DRIVER_DATA(ojankohs_state) | |
| 904 | ||
| 857 | 905 | /* basic machine hardware */ |
| 858 | 906 | MDRV_CPU_ADD("maincpu", Z80,12000000/2) /* 6.00 MHz ? */ |
| 859 | 907 | MDRV_CPU_PROGRAM_MAP(ojankoy_map) |
| 860 | 908 | MDRV_CPU_IO_MAP(ojankoy_io_map) |
| 861 | 909 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 862 | 910 | |
| 911 | MDRV_MACHINE_START(ojankoy) | |
| 863 | 912 | MDRV_MACHINE_RESET(ojankohs) |
| 864 | 913 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 865 | 914 | |
| r7500 | r7501 | |
| 892 | 941 | |
| 893 | 942 | static MACHINE_DRIVER_START( ccasino ) |
| 894 | 943 | |
| 944 | /* driver data */ | |
| 945 | MDRV_DRIVER_DATA(ojankohs_state) | |
| 946 | ||
| 895 | 947 | /* basic machine hardware */ |
| 896 | 948 | MDRV_CPU_ADD("maincpu", Z80,12000000/2) /* 6.00 MHz ? */ |
| 897 | 949 | MDRV_CPU_PROGRAM_MAP(ojankoy_map) |
| 898 | 950 | MDRV_CPU_IO_MAP(ccasino_io_map) |
| 899 | 951 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 900 | 952 | |
| 953 | MDRV_MACHINE_START(ojankohs) | |
| 901 | 954 | MDRV_MACHINE_RESET(ojankohs) |
| 902 | 955 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 903 | 956 | |
| r7500 | r7501 | |
| 929 | 982 | |
| 930 | 983 | static MACHINE_DRIVER_START( ojankoc ) |
| 931 | 984 | |
| 985 | /* driver data */ | |
| 986 | MDRV_DRIVER_DATA(ojankohs_state) | |
| 987 | ||
| 932 | 988 | /* basic machine hardware */ |
| 933 | 989 | MDRV_CPU_ADD("maincpu", Z80,8000000/2) /* 4.00 MHz */ |
| 934 | 990 | MDRV_CPU_PROGRAM_MAP(ojankoc_map) |
| 935 | 991 | MDRV_CPU_IO_MAP(ojankoc_io_map) |
| 936 | 992 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 937 | 993 | |
| 994 | MDRV_MACHINE_START(ojankoc) | |
| 938 | 995 | MDRV_MACHINE_RESET(ojankohs) |
| 939 | 996 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 940 | 997 | |
| r7500 | r7501 | |
| 1056 | 1113 | ROM_END |
| 1057 | 1114 | |
| 1058 | 1115 | |
| 1059 | GAME( 1986, ojankoc, 0, ojankoc, ojankoc, 0, ROT0, "V-System Co.", "Ojanko Club (Japan)", 0 ) | |
| 1060 | GAME( 1986, ojankoy, 0, ojankoy, ojankoy, 0, ROT0, "V-System Co.", "Ojanko Yakata (Japan)", 0 ) | |
| 1061 | GAME( 1987, ojanko2, 0, ojankoy, ojankoy, 0, ROT0, "V-System Co.", "Ojanko Yakata 2bankan (Japan)", 0 ) | |
| 1062 | GAME( 1987, ccasino, 0, ccasino, ccasino, 0, ROT0, "V-System Co.", "Chinese Casino [BET] (Japan)", 0 ) | |
| 1063 | GAME( 1988, ojankohs, 0, ojankohs, ojankohs, 0, ROT0, "V-System Co.", "Ojanko High School (Japan)", 0 ) | |
| 1116 | GAME( 1986, ojankoc, 0, ojankoc, ojankoc, 0, ROT0, "V-System Co.", "Ojanko Club (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1117 | GAME( 1986, ojankoy, 0, ojankoy, ojankoy, 0, ROT0, "V-System Co.", "Ojanko Yakata (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1118 | GAME( 1987, ojanko2, 0, ojankoy, ojankoy, 0, ROT0, "V-System Co.", "Ojanko Yakata 2bankan (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1119 | GAME( 1987, ccasino, 0, ccasino, ccasino, 0, ROT0, "V-System Co.", "Chinese Casino [BET] (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1120 | GAME( 1988, ojankohs, 0, ojankohs, ojankohs, 0, ROT0, "V-System Co.", "Ojanko High School (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 109 | 109 | #include "cpu/h6280/h6280.h" |
| 110 | 110 | #include "includes/decocrpt.h" |
| 111 | 111 | #include "includes/decoprot.h" |
| 112 | #include "includes/ | |
| 112 | #include "includes/r | |
| 113 | 113 | #include "sound/2151intf.h" |
| 114 | 114 | #include "sound/okim6295.h" |
| 115 | #include "video/deco16ic.h" | |
| 115 | 116 | |
| 116 | VIDEO_START( rohga ); | |
| 117 | VIDEO_START( wizdfire ); | |
| 118 | VIDEO_START( nitrobal ); | |
| 119 | VIDEO_UPDATE( rohga ); | |
| 120 | VIDEO_UPDATE( schmeisr ); | |
| 121 | VIDEO_UPDATE( wizdfire ); | |
| 122 | VIDEO_UPDATE( nitrobal ); | |
| 123 | WRITE16_HANDLER( rohga_buffer_spriteram16_w ); | |
| 124 | 117 | |
| 125 | 118 | static READ16_HANDLER( rohga_irq_ack_r ) |
| 126 | 119 | { |
| 127 | cputag_set_input_line(space->machine, "maincpu", 6, CLEAR_LINE); | |
| 120 | rohga_state *state = (rohga_state *)space->machine->driver_data; | |
| 121 | ||
| 122 | cpu_set_input_line(state->maincpu, 6, CLEAR_LINE); | |
| 128 | 123 | return 0; |
| 129 | 124 | } |
| 130 | 125 | |
| r7500 | r7501 | |
| 133 | 128 | /* This might actually do more, nitrobal for example sets 0xca->0xffff->0x80 at startup then writes 7 all the time |
| 134 | 129 | except when a credit is inserted (writes 6 twice). |
| 135 | 130 | Wizard Fire / Dark Seal 2 just writes 1 all the time, so I just don't trust it much for now... -AS */ |
| 136 | cputag_set_input_line(space->machine, "maincpu", 6, CLEAR_LINE); | |
| 131 | rohga_state *state = (rohga_state *)space->machine->driver_data; | |
| 132 | cpu_set_input_line(state->maincpu, 6, CLEAR_LINE); | |
| 137 | 133 | } |
| 138 | 134 | |
| 139 | 135 | /**********************************************************************************/ |
| r7500 | r7501 | |
| 141 | 137 | static ADDRESS_MAP_START( rohga_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 142 | 138 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 143 | 139 | |
| 144 | AM_RANGE(0x200000, 0x20000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 145 | AM_RANGE(0x240000, 0x24000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 140 | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 141 | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 146 | 142 | |
| 147 | 143 | AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| 148 | 144 | |
| r7500 | r7501 | |
| 150 | 146 | |
| 151 | 147 | AM_RANGE(0x300000, 0x300001) AM_WRITE(rohga_buffer_spriteram16_w) /* write 1 for sprite dma */ |
| 152 | 148 | AM_RANGE(0x310000, 0x310009) AM_WRITENOP /* Palette control? */ |
| 153 | AM_RANGE(0x31000a, 0x31000b) AM_WRITE(deco16_palette_dma_w) /* Write 1111 for dma? (Or any value?) */ | |
| 149 | AM_RANGE(0x31000a, 0x31000b) AM_DEVWRITE("deco_custom", deco16ic_palette_dma_w) /* Write 1111 for dma? (Or any value?) */ | |
| 154 | 150 | AM_RANGE(0x320000, 0x320001) AM_WRITENOP /* ? */ |
| 155 | AM_RANGE(0x322000, 0x322001) AM_WRITE(deco16_priority_w) | |
| 151 | AM_RANGE(0x322000, 0x322001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 156 | 152 | AM_RANGE(0x321100, 0x321101) AM_READ(rohga_irq_ack_r) /* Irq ack? Value not used */ |
| 157 | 153 | |
| 158 | AM_RANGE(0x3c0000, 0x3c1fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 159 | AM_RANGE(0x3c2000, 0x3c2fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 160 | AM_RANGE(0x3c4000, 0x3c4fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 161 | AM_RANGE(0x3c6000, 0x3c6fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 154 | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 155 | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 156 | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 157 | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 162 | 158 | |
| 163 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 164 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 165 | AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 166 | AM_RANGE(0x3ce000, 0x3cefff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 159 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf1_rowscroll) | |
| 160 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf2_rowscroll) | |
| 161 | AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf3_rowscroll) | |
| 162 | AM_RANGE(0x3ce000, 0x3cefff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf4_rowscroll) | |
| 167 | 163 | |
| 168 | 164 | AM_RANGE(0x3d0000, 0x3d07ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 169 | AM_RANGE(0x3e0000, 0x3e1fff) AM_RAM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 165 | AM_RANGE(0x3e0000, 0x3e1fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 170 | 166 | AM_RANGE(0x3f0000, 0x3f3fff) AM_RAM /* Main ram */ |
| 171 | 167 | ADDRESS_MAP_END |
| 172 | 168 | |
| 173 | 169 | static ADDRESS_MAP_START( wizdfire_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 174 | 170 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 175 | 171 | |
| 176 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 177 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 178 | AM_RANGE(0x208000, 0x208fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 179 | AM_RANGE(0x20a000, 0x20afff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 172 | AM_RANGE(0x200000, 0x200fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 173 | AM_RANGE(0x202000, 0x202fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 174 | AM_RANGE(0x208000, 0x208fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 175 | AM_RANGE(0x20a000, 0x20afff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 180 | 176 | |
| 181 | 177 | AM_RANGE(0x20b000, 0x20b3ff) AM_WRITEONLY /* ? Always 0 written */ |
| 182 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 183 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 178 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf3_rowscroll) | |
| 179 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf4_rowscroll) | |
| 184 | 180 | |
| 185 | AM_RANGE(0x300000, 0x30000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 186 | AM_RANGE(0x310000, 0x31000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 181 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 182 | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 187 | 183 | |
| 188 | AM_RANGE(0x320000, 0x320001) AM_WRITE(deco16_priority_w) /* Priority */ | |
| 184 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) /* Priority */ | |
| 189 | 185 | AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */ |
| 190 | 186 | AM_RANGE(0x320004, 0x320005) AM_WRITE(wizdfire_irq_ack_w) /* VBL IRQ ack */ |
| 191 | 187 | |
| r7500 | r7501 | |
| 194 | 190 | AM_RANGE(0x360000, 0x3607ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram2) |
| 195 | 191 | AM_RANGE(0x370000, 0x370001) AM_WRITE(buffer_spriteram16_2_w) /* Triggers DMA for spriteram */ |
| 196 | 192 | |
| 197 | AM_RANGE(0x380000, 0x381fff) AM_RAM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 198 | AM_RANGE(0x390008, 0x390009) AM_WRITE(deco16_palette_dma_w) | |
| 193 | AM_RANGE(0x380000, 0x381fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 194 | AM_RANGE(0x390008, 0x390009) AM_DEVWRITE("deco_custom", deco16ic_palette_dma_w) | |
| 199 | 195 | |
| 200 | 196 | AM_RANGE(0xfe4000, 0xfe47ff) AM_READWRITE(deco16_104_prot_r,deco16_104_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| 201 | 197 | AM_RANGE(0xfdc000, 0xffffff) AM_RAM |
| r7500 | r7501 | |
| 204 | 200 | static ADDRESS_MAP_START( nitrobal_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 205 | 201 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 206 | 202 | |
| 207 | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 208 | AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 209 | AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 210 | AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 203 | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 204 | AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 205 | AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 206 | AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 211 | 207 | |
| 212 | AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 213 | AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 214 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 215 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 208 | AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf1_rowscroll) | |
| 209 | AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf2_rowscroll) | |
| 210 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf3_rowscroll) | |
| 211 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_BASE_MEMBER(rohga_state, pf4_rowscroll) | |
| 216 | 212 | |
| 217 | AM_RANGE(0x300000, 0x30000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 218 | AM_RANGE(0x310000, 0x31000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 213 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 214 | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 219 | 215 | |
| 220 | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("DSW3") AM_WRITE(deco16_priority_w) /* Priority */ | |
| 216 | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("DSW3") AM_DEVWRITE("deco_custom", deco16ic_priority_w) /* Priority */ | |
| 221 | 217 | AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */ |
| 222 | 218 | AM_RANGE(0x320004, 0x320005) AM_WRITE(wizdfire_irq_ack_w) /* VBL IRQ ack */ |
| 223 | 219 | |
| r7500 | r7501 | |
| 226 | 222 | AM_RANGE(0x360000, 0x3607ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram2) |
| 227 | 223 | AM_RANGE(0x370000, 0x370001) AM_WRITE(buffer_spriteram16_2_w) /* Triggers DMA for spriteram */ |
| 228 | 224 | |
| 229 | AM_RANGE(0x380000, 0x381fff) AM_RAM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 230 | AM_RANGE(0x390008, 0x390009) AM_WRITE(deco16_palette_dma_w) | |
| 225 | AM_RANGE(0x380000, 0x381fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 226 | AM_RANGE(0x390008, 0x390009) AM_DEVWRITE("deco_custom", deco16ic_palette_dma_w) | |
| 231 | 227 | |
| 232 | 228 | AM_RANGE(0xfec000, 0xff3fff) AM_RAM |
| 233 | 229 | AM_RANGE(0xff4000, 0xff47ff) AM_MIRROR(0x800) AM_READWRITE(deco16_146_nitroball_prot_r,deco16_146_nitroball_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| r7500 | r7501 | |
| 236 | 232 | |
| 237 | 233 | static ADDRESS_MAP_START( schmeisr_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 238 | 234 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 239 | AM_RANGE(0x200000, 0x20000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 240 | AM_RANGE(0x240000, 0x24000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control) | |
| 235 | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 236 | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("deco_custom", deco16ic_pf34_control_w) | |
| 241 | 237 | AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w) AM_BASE(&deco16_prot_ram) /* Protection device */ |
| 242 | 238 | |
| 243 | 239 | AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("DSW3") |
| 244 | 240 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSW3") AM_WRITE(rohga_buffer_spriteram16_w) /* write 1 for sprite dma */ |
| 245 | 241 | AM_RANGE(0x310002, 0x310003) AM_READ_PORT("IN1") |
| 246 | 242 | AM_RANGE(0x310000, 0x310009) AM_WRITENOP /* Palette control? */ |
| 247 | AM_RANGE(0x31000a, 0x31000b) AM_WRITE(deco16_palette_dma_w) /* Write 1111 for dma? (Or any value?) */ | |
| 243 | AM_RANGE(0x31000a, 0x31000b) AM_DEVWRITE("deco_custom", deco16ic_palette_dma_w) /* Write 1111 for dma? (Or any value?) */ | |
| 248 | 244 | AM_RANGE(0x320000, 0x320001) AM_WRITENOP /* ? */ |
| 249 | AM_RANGE(0x322000, 0x322001) AM_WRITE(deco16_priority_w) | |
| 245 | AM_RANGE(0x322000, 0x322001) AM_DEVWRITE("deco_custom", deco16ic_priority_w) | |
| 250 | 246 | AM_RANGE(0x321100, 0x321101) AM_WRITE(wizdfire_irq_ack_w) /* Irq ack? Value not used */ |
| 251 | 247 | |
| 252 | AM_RANGE(0x3c0000, 0x3c1fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 253 | AM_RANGE(0x3c2000, 0x3c2fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 254 | AM_RANGE(0x3c4000, 0x3c4fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 255 | AM_RANGE(0x3c6000, 0x3c6fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 256 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 257 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 258 | AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf3_rowscroll) | |
| 259 | AM_RANGE(0x3ce000, 0x3cefff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&deco16_pf4_rowscroll) | |
| 248 | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 249 | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 250 | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_r, deco16ic_pf3_data_w) | |
| 251 | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_r, deco16ic_pf4_data_w) | |
| 252 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf1_rowscroll) | |
| 253 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf2_rowscroll) | |
| 254 | AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf3_rowscroll) | |
| 255 | AM_RANGE(0x3ce000, 0x3cefff) AM_MIRROR(0x1000) AM_RAM AM_BASE_MEMBER(rohga_state, pf4_rowscroll) | |
| 260 | 256 | |
| 261 | 257 | AM_RANGE(0x3d0000, 0x3d07ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 262 | AM_RANGE(0x3e0000, 0x3e1fff) AM_MIRROR(0x2000) AM_RAM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 258 | AM_RANGE(0x3e0000, 0x3e1fff) AM_MIRROR(0x2000) AM_RAM_DEVWRITE("deco_custom", deco16ic_buffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 263 | 259 | AM_RANGE(0xff0000, 0xff7fff) AM_RAM /* Main ram */ |
| 264 | 260 | ADDRESS_MAP_END |
| 265 | 261 | |
| r7500 | r7501 | |
| 727 | 723 | |
| 728 | 724 | static void sound_irq(running_device *device, int state) |
| 729 | 725 | { |
| 730 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 726 | rohga_state *driver_state = (rohga_state *)device->machine->driver_data; | |
| 727 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 731 | 728 | } |
| 732 | 729 | |
| 733 | 730 | static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) |
| 734 | 731 | { |
| 735 | okim6295_set_bank_base(devtag_get_device(device->machine, "oki1"), ((data & 1)>>0) * 0x40000); | |
| 736 | okim6295_set_bank_base(devtag_get_device(device->machine, "oki2"), ((data & 2)>>1) * 0x40000); | |
| 732 | rohga_state *state = (rohga_state *)device->machine->driver_data; | |
| 733 | okim6295_set_bank_base(state->oki1, BIT(data, 0) * 0x40000); | |
| 734 | okim6295_set_bank_base(state->oki2, BIT(data, 1) * 0x40000); | |
| 737 | 735 | } |
| 738 | 736 | |
| 739 | 737 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 744 | 742 | |
| 745 | 743 | /**********************************************************************************/ |
| 746 | 744 | |
| 745 | static int rohga_bank_callback( const int bank ) | |
| 746 | { | |
| 747 | return ((bank >> 4) & 0x3) << 12; | |
| 748 | } | |
| 749 | ||
| 750 | static const deco16ic_interface rohga_deco16ic_intf = | |
| 751 | { | |
| 752 | "screen", | |
| 753 | 0, 0, 1, | |
| 754 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 755 | 0, 16, 0, 16, /* color base (default values) */ | |
| 756 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 757 | rohga_bank_callback, | |
| 758 | rohga_bank_callback, | |
| 759 | rohga_bank_callback, | |
| 760 | rohga_bank_callback | |
| 761 | }; | |
| 762 | ||
| 763 | static const deco16ic_interface nitrobal_deco16ic_intf = | |
| 764 | { | |
| 765 | "screen", | |
| 766 | 0, 0, 0, | |
| 767 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 768 | 0, 16, 0, 0, /* color base (pf4 is not default) */ | |
| 769 | 0x0f, 0x0f, 0, 0, /* color masks */ | |
| 770 | rohga_bank_callback, | |
| 771 | rohga_bank_callback, | |
| 772 | rohga_bank_callback, | |
| 773 | rohga_bank_callback | |
| 774 | }; | |
| 775 | ||
| 776 | static MACHINE_START( rohga ) | |
| 777 | { | |
| 778 | rohga_state *state = (rohga_state *)machine->driver_data; | |
| 779 | ||
| 780 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 781 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 782 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 783 | state->oki1 = devtag_get_device(machine, "oki1"); | |
| 784 | state->oki2 = devtag_get_device(machine, "oki2"); | |
| 785 | } | |
| 786 | ||
| 747 | 787 | static MACHINE_DRIVER_START( rohga ) |
| 748 | 788 | |
| 789 | /* driver data */ | |
| 790 | MDRV_DRIVER_DATA(rohga_state) | |
| 791 | ||
| 749 | 792 | /* basic machine hardware */ |
| 750 | 793 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 751 | 794 | MDRV_CPU_PROGRAM_MAP(rohga_map) |
| r7500 | r7501 | |
| 754 | 797 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 755 | 798 | MDRV_CPU_PROGRAM_MAP(rohga_sound_map) |
| 756 | 799 | |
| 800 | MDRV_MACHINE_START(rohga) | |
| 801 | ||
| 757 | 802 | /* video hardware */ |
| 758 | 803 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 759 | 804 | |
| r7500 | r7501 | |
| 770 | 815 | MDRV_VIDEO_START(rohga) |
| 771 | 816 | MDRV_VIDEO_UPDATE(rohga) |
| 772 | 817 | |
| 818 | MDRV_DECO16IC_ADD("deco_custom", rohga_deco16ic_intf) | |
| 819 | ||
| 773 | 820 | /* sound hardware */ |
| 774 | 821 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 775 | 822 | |
| r7500 | r7501 | |
| 791 | 838 | |
| 792 | 839 | static MACHINE_DRIVER_START( wizdfire ) |
| 793 | 840 | |
| 841 | /* driver data */ | |
| 842 | MDRV_DRIVER_DATA(rohga_state) | |
| 843 | ||
| 794 | 844 | /* basic machine hardware */ |
| 795 | 845 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 796 | 846 | MDRV_CPU_PROGRAM_MAP(wizdfire_map) |
| r7500 | r7501 | |
| 799 | 849 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 800 | 850 | MDRV_CPU_PROGRAM_MAP(rohga_sound_map) |
| 801 | 851 | |
| 852 | MDRV_MACHINE_START(rohga) | |
| 853 | ||
| 802 | 854 | /* video hardware */ |
| 803 | 855 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 804 | 856 | |
| r7500 | r7501 | |
| 812 | 864 | MDRV_GFXDECODE(wizdfire) |
| 813 | 865 | MDRV_PALETTE_LENGTH(2048) |
| 814 | 866 | |
| 815 | MDRV_VIDEO_START(wizdfire) | |
| 816 | 867 | MDRV_VIDEO_UPDATE(wizdfire) |
| 817 | 868 | |
| 869 | MDRV_DECO16IC_ADD("deco_custom", rohga_deco16ic_intf) | |
| 870 | ||
| 818 | 871 | /* sound hardware */ |
| 819 | 872 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 820 | 873 | |
| r7500 | r7501 | |
| 836 | 889 | |
| 837 | 890 | static MACHINE_DRIVER_START( nitrobal ) |
| 838 | 891 | |
| 892 | /* driver data */ | |
| 893 | MDRV_DRIVER_DATA(rohga_state) | |
| 894 | ||
| 839 | 895 | /* basic machine hardware */ |
| 840 | 896 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 841 | 897 | MDRV_CPU_PROGRAM_MAP(nitrobal_map) |
| r7500 | r7501 | |
| 844 | 900 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 845 | 901 | MDRV_CPU_PROGRAM_MAP(rohga_sound_map) |
| 846 | 902 | |
| 903 | MDRV_MACHINE_START(rohga) | |
| 904 | ||
| 847 | 905 | /* video hardware */ |
| 848 | 906 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM ) |
| 849 | 907 | |
| r7500 | r7501 | |
| 857 | 915 | MDRV_GFXDECODE(wizdfire) |
| 858 | 916 | MDRV_PALETTE_LENGTH(2048) |
| 859 | 917 | |
| 860 | MDRV_VIDEO_START(nitrobal) | |
| 861 | 918 | MDRV_VIDEO_UPDATE(nitrobal) |
| 862 | 919 | |
| 920 | MDRV_DECO16IC_ADD("deco_custom", nitrobal_deco16ic_intf) | |
| 921 | ||
| 863 | 922 | /* sound hardware */ |
| 864 | 923 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 865 | 924 | |
| r7500 | r7501 | |
| 881 | 940 | |
| 882 | 941 | static MACHINE_DRIVER_START( schmeisr ) |
| 883 | 942 | |
| 943 | /* driver data */ | |
| 944 | MDRV_DRIVER_DATA(rohga_state) | |
| 945 | ||
| 884 | 946 | /* basic machine hardware */ |
| 885 | 947 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 886 | 948 | MDRV_CPU_PROGRAM_MAP(schmeisr_map) |
| r7500 | r7501 | |
| 889 | 951 | MDRV_CPU_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 890 | 952 | MDRV_CPU_PROGRAM_MAP(rohga_sound_map) |
| 891 | 953 | |
| 954 | MDRV_MACHINE_START(rohga) | |
| 955 | ||
| 892 | 956 | /* video hardware */ |
| 893 | 957 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 894 | 958 | |
| r7500 | r7501 | |
| 905 | 969 | MDRV_VIDEO_START(rohga) |
| 906 | 970 | MDRV_VIDEO_UPDATE(schmeisr) |
| 907 | 971 | |
| 972 | MDRV_DECO16IC_ADD("deco_custom", rohga_deco16ic_intf) | |
| 973 | ||
| 908 | 974 | /* sound hardware */ |
| 909 | 975 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 910 | 976 | |
| r7500 | r7501 | |
| 1480 | 1546 | const UINT8 *src = memory_region(machine, "gfx2"); |
| 1481 | 1547 | UINT8 *dst = memory_region(machine, "gfx1"); |
| 1482 | 1548 | |
| 1483 | memcpy(dst,src,0x20000); | |
| 1484 | memcpy(dst+0x20000,src+0x80000,0x20000); | |
| 1549 | memcpy(dst, src, 0x20000); | |
| 1550 | memcpy(dst + 0x20000, src + 0x80000, 0x20000); | |
| 1485 | 1551 | |
| 1486 | 1552 | deco74_decrypt_gfx(machine, "gfx1"); |
| 1487 | 1553 | deco74_decrypt_gfx(machine, "gfx2"); |
| r7500 | r7501 | |
| 1489 | 1555 | decoprot_reset(machine); |
| 1490 | 1556 | } |
| 1491 | 1557 | |
| 1492 | GAME( 1991, rohga, 0, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v5.0)" , 0 ) | |
| 1493 | GAME( 1991, rohga1, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 Set 1)", 0 ) | |
| 1494 | GAME( 1991, rohga2, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 Set 2)", 0 ) | |
| 1495 | GAME( 1991, rohgah, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", 0 ) | |
| 1496 | GAME( 1991, rohgau, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (US v1.0)", 0 ) | |
| 1497 | GAME( 1991, wolffang, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", 0 ) | |
| 1498 | GAME( 1992, wizdfire, 0, wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Wizard Fire (Over Sea v2.1)", 0 ) | |
| 1499 | GAME( 1992, wizdfireu,wizdfire,wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Wizard Fire (US v1.1)", 0 ) | |
| 1500 | GAME( 1992, darkseal2,wizdfire,wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Dark Seal 2 (Japan v2.1)", 0 ) | |
| 1501 | GAME( 1992, nitrobal, 0, nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Nitro Ball (US)", 0 ) | |
| 1502 | GAME( 1992, gunball, nitrobal,nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Gun Ball (Japan)", 0 ) | |
| 1503 | GAME( 1993, schmeisr, 0, schmeisr, schmeisr, schmeisr, ROT0, "Hot B", "Schmeiser Robo (Japan)", 0 ) | |
| 1558 | GAME( 1991, rohga, 0, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v5.0)", GAME_SUPPORTS_SAVE ) | |
| 1559 | GAME( 1991, rohga1, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 Set 1)", GAME_SUPPORTS_SAVE ) | |
| 1560 | GAME( 1991, rohga2, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 Set 2)", GAME_SUPPORTS_SAVE ) | |
| 1561 | GAME( 1991, rohgah, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", GAME_SUPPORTS_SAVE ) | |
| 1562 | GAME( 1991, rohgau, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Rohga Armor Force (US v1.0)", GAME_SUPPORTS_SAVE ) | |
| 1563 | GAME( 1991, wolffang, rohga, rohga, rohga, rohga, ROT0, "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1564 | GAME( 1992, wizdfire, 0, wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Wizard Fire (Over Sea v2.1)", GAME_SUPPORTS_SAVE ) | |
| 1565 | GAME( 1992, wizdfireu, wizdfire, wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Wizard Fire (US v1.1)", GAME_SUPPORTS_SAVE ) | |
| 1566 | GAME( 1992, darkseal2, wizdfire, wizdfire, wizdfire, wizdfire, ROT0, "Data East Corporation", "Dark Seal 2 (Japan v2.1)", GAME_SUPPORTS_SAVE ) | |
| 1567 | GAME( 1992, nitrobal, 0, nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Nitro Ball (US)", GAME_SUPPORTS_SAVE ) | |
| 1568 | GAME( 1992, gunball, nitrobal, nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Gun Ball (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1569 | GAME( 1993, schmeisr, 0, schmeisr, schmeisr, schmeisr, ROT0, "Hot B", "Schmeiser Robo (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 52 | 52 | #include "includes/nemesis.h" |
| 53 | 53 | #include "includes/konamipt.h" |
| 54 | 54 | |
| 55 | int nemesis_irq_on = 0; | |
| 56 | int nemesis_irq2_on = 0; | |
| 57 | static int nemesis_irq1_on = 0; | |
| 58 | static int nemesis_irq4_on = 0; | |
| 59 | static int gx400_irq1_cnt; | |
| 60 | static UINT8 frame_counter; | |
| 61 | 55 | |
| 62 | ||
| 63 | static MACHINE_RESET( nemesis ) | |
| 56 | static INTERRUPT_GEN( nemesis_interrupt ) | |
| 64 | 57 | { |
| 65 | nemesis_irq_on = 0; | |
| 66 | nemesis_irq1_on = 0; | |
| 67 | nemesis_irq2_on = 0; | |
| 68 | nemesis_irq4_on = 0; | |
| 69 | gx400_irq1_cnt = 0; | |
| 70 | frame_counter = 1; | |
| 71 | } | |
| 58 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 72 | 59 | |
| 73 | ||
| 74 | static INTERRUPT_GEN( nemesis_interrupt ) | |
| 75 | { | |
| 76 | if (nemesis_irq_on) | |
| 60 | if (state->irq_on) | |
| 77 | 61 | cpu_set_input_line(device, 1, HOLD_LINE); |
| 78 | 62 | } |
| 79 | 63 | |
| 80 | 64 | static INTERRUPT_GEN( konamigt_interrupt ) |
| 81 | 65 | { |
| 66 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 67 | ||
| 82 | 68 | if (cpu_getiloops(device) == 0) |
| 83 | 69 | { |
| 84 | if ( (nemesis_irq_on) && (gx400_irq1_cnt++ & 1) ) cpu_set_input_line(device, 1, HOLD_LINE); | |
| 70 | if ((state->irq_on) && (state->gx400_irq1_cnt++ & 1)) | |
| 71 | cpu_set_input_line(device, 1, HOLD_LINE); | |
| 85 | 72 | } |
| 86 | 73 | else |
| 87 | 74 | { |
| 88 | if (nemesis_irq2_on) cpu_set_input_line(device, 2, HOLD_LINE); | |
| 75 | if (state->irq2_on) | |
| 76 | cpu_set_input_line(device, 2, HOLD_LINE); | |
| 89 | 77 | } |
| 90 | 78 | } |
| 91 | 79 | |
| 92 | 80 | static INTERRUPT_GEN( gx400_interrupt ) |
| 93 | 81 | { |
| 82 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 83 | ||
| 94 | 84 | switch (cpu_getiloops(device)) |
| 95 | 85 | { |
| 96 | 86 | case 0: |
| 97 | if (nemesis_irq2_on) cpu_set_input_line(device, 2, HOLD_LINE); | |
| 87 | if (state->irq2_on) | |
| 88 | cpu_set_input_line(device, 2, HOLD_LINE); | |
| 98 | 89 | break; |
| 99 | 90 | |
| 100 | 91 | case 1: |
| 101 | if ( (nemesis_irq1_on) && (gx400_irq1_cnt++ & 1) ) cpu_set_input_line(device, 1, HOLD_LINE); | |
| 92 | if ((state->irq1_on) && (state->gx400_irq1_cnt++ & 1)) | |
| 93 | cpu_set_input_line(device, 1, HOLD_LINE); | |
| 102 | 94 | break; |
| 103 | 95 | |
| 104 | 96 | case 2: |
| 105 | if (nemesis_irq4_on) cpu_set_input_line(device, 4, HOLD_LINE); | |
| 97 | if (state->irq4_on) | |
| 98 | cpu_set_input_line(device, 4, HOLD_LINE); | |
| 106 | 99 | break; |
| 107 | 100 | } |
| 108 | 101 | } |
| 109 | 102 | |
| 110 | 103 | static INTERRUPT_GEN( salamand_interrupt ) |
| 111 | 104 | { |
| 112 | if (nemesis_irq_on) | |
| 105 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 106 | ||
| 107 | if (state->irq_on) | |
| 113 | 108 | cpu_set_input_line(device, 1, HOLD_LINE); |
| 114 | 109 | } |
| 115 | 110 | |
| 116 | 111 | static INTERRUPT_GEN( blkpnthr_interrupt ) |
| 117 | 112 | { |
| 118 | if (nemesis_irq_on) | |
| 113 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 114 | ||
| 115 | if (state->irq_on) | |
| 119 | 116 | cpu_set_input_line(device, 2, HOLD_LINE); |
| 120 | 117 | } |
| 121 | 118 | |
| 122 | 119 | |
| 123 | 120 | static WRITE16_HANDLER( gx400_irq1_enable_word_w ) |
| 124 | 121 | { |
| 122 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 123 | ||
| 125 | 124 | if (ACCESSING_BITS_0_7) |
| 126 | | |
| 125 | | |
| 127 | 126 | |
| 128 | 127 | if (ACCESSING_BITS_8_15) |
| 129 | 128 | coin_lockout_w(space->machine, 1, data & 0x0100); |
| r7500 | r7501 | |
| 131 | 130 | |
| 132 | 131 | static WRITE16_HANDLER( gx400_irq2_enable_word_w ) |
| 133 | 132 | { |
| 133 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 134 | ||
| 134 | 135 | if (ACCESSING_BITS_0_7) |
| 135 | | |
| 136 | | |
| 136 | 137 | |
| 137 | 138 | if (ACCESSING_BITS_8_15) |
| 138 | 139 | coin_lockout_w(space->machine, 0, data & 0x0100); |
| r7500 | r7501 | |
| 140 | 141 | |
| 141 | 142 | static WRITE16_HANDLER( gx400_irq4_enable_word_w ) |
| 142 | 143 | { |
| 144 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 145 | ||
| 143 | 146 | if (ACCESSING_BITS_8_15) |
| 144 | | |
| 147 | | |
| 145 | 148 | } |
| 146 | 149 | |
| 147 | 150 | static WRITE16_HANDLER( nemesis_irq_enable_word_w ) |
| 148 | 151 | { |
| 152 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 153 | ||
| 149 | 154 | if (ACCESSING_BITS_0_7) |
| 150 | | |
| 155 | | |
| 151 | 156 | |
| 152 | 157 | if (ACCESSING_BITS_8_15) |
| 153 | 158 | coin_lockout_global_w(space->machine, data & 0x0100); |
| r7500 | r7501 | |
| 155 | 160 | |
| 156 | 161 | static WRITE16_HANDLER( konamigt_irq_enable_word_w ) |
| 157 | 162 | { |
| 163 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 164 | ||
| 158 | 165 | if (ACCESSING_BITS_0_7) |
| 159 | | |
| 166 | | |
| 160 | 167 | |
| 161 | 168 | if (ACCESSING_BITS_8_15) |
| 162 | 169 | coin_lockout_w(space->machine, 1, data & 0x0100); |
| r7500 | r7501 | |
| 164 | 171 | |
| 165 | 172 | static WRITE16_HANDLER( konamigt_irq2_enable_word_w ) |
| 166 | 173 | { |
| 174 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 175 | ||
| 167 | 176 | if (ACCESSING_BITS_0_7) |
| 168 | | |
| 177 | | |
| 169 | 178 | |
| 170 | 179 | if (ACCESSING_BITS_8_15) |
| 171 | 180 | coin_lockout_w(space->machine, 0, data & 0x0100); |
| 172 | 181 | } |
| 173 | 182 | |
| 174 | 183 | |
| 175 | static UINT8 *gx400_shared_ram; | |
| 176 | ||
| 177 | 184 | static READ16_HANDLER( gx400_sharedram_word_r ) |
| 178 | 185 | { |
| 179 | return gx400_shared_ram[offset]; | |
| 186 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 187 | return state->gx400_shared_ram[offset]; | |
| 180 | 188 | } |
| 181 | 189 | |
| 182 | 190 | static WRITE16_HANDLER( gx400_sharedram_word_w ) |
| 183 | 191 | { |
| 192 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 193 | ||
| 184 | 194 | if (ACCESSING_BITS_0_7) |
| 185 | gx400_shared_ram[offset] = data; | |
| 195 | state->gx400_shared_ram[offset] = data; | |
| 186 | 196 | } |
| 187 | 197 | |
| 188 | 198 | |
| r7500 | r7501 | |
| 195 | 205 | bit 12-15: accel |
| 196 | 206 | */ |
| 197 | 207 | |
| 198 | int data=input_port_read(space->machine, "IN3"); | |
| 199 | int data2=input_port_read(space->machine, "PADDLE"); | |
| 208 | int data = input_port_read(space->machine, "IN3"); | |
| 209 | int data2 = input_port_read(space->machine, "PADDLE"); | |
| 200 | 210 | |
| 201 | 211 | int ret=0x0000; |
| 202 | 212 | |
| 203 | // if(data&0x10) ret|=0x0800; // turbo/gear? | |
| 204 | // if(data&0x80) ret|=0x0400; // turbo? | |
| 205 | if(data&0x20) ret|=0x0300; // brake (0-3) | |
| 213 | // if (BIT(data, 4)) ret |= 0x0800; // turbo/gear? | |
| 214 | // if (BIT(data, 7)) ret |= 0x0400; // turbo? | |
| 215 | if (BIT(data, 5)) | |
| 216 | ret |= 0x0300; // brake (0-3) | |
| 206 | 217 | |
| 207 | if(data&0x40) ret|=0xf000; // accel (0-f) | |
| 218 | if (BIT(data, 6)) | |
| 219 | ret |= 0xf000; // accel (0-f) | |
| 208 | 220 | |
| 209 | ret|=data2&0x7f; // steering wheel, not exactly sure if DIAL works ok. | |
| 221 | ret |= data2 & 0x7f; // steering wheel, not exactly sure if DIAL works ok. | |
| 210 | 222 | |
| 211 | 223 | return ret; |
| 212 | 224 | } |
| 213 | 225 | |
| 214 | /* Copied from WEC Le Mans 24 driver, explicity needed for Hyper Crash */ | |
| 215 | UINT16 hcrash_selected_ip; | |
| 216 | ||
| 217 | 226 | static WRITE16_HANDLER( selected_ip_word_w ) |
| 218 | 227 | { |
| 219 | if (ACCESSING_BITS_0_7) hcrash_selected_ip = data & 0xff; // latch the value | |
| 228 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 229 | ||
| 230 | if (ACCESSING_BITS_0_7) | |
| 231 | state->selected_ip = data & 0xff; // latch the value | |
| 220 | 232 | } |
| 221 | 233 | |
| 222 | 234 | static READ16_HANDLER( selected_ip_word_r ) |
| 223 | 235 | { |
| 224 | switch (hcrash_selected_ip & 0xf) | |
| 236 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 237 | ||
| 238 | switch (state->selected_ip & 0xf) | |
| 225 | 239 | { // From WEC Le Mans Schems: |
| 226 | 240 | case 0xc: return input_port_read(space->machine, "ACCEL"); // Accel - Schems: Accelevr |
| 227 | 241 | case 0: return input_port_read(space->machine, "ACCEL"); |
| r7500 | r7501 | |
| 236 | 250 | static WRITE16_HANDLER( nemesis_soundlatch_word_w ) |
| 237 | 251 | { |
| 238 | 252 | if (ACCESSING_BITS_0_7) |
| 239 | soundlatch_w(space,offset,data & 0xff); | |
| 253 | soundlatch_w(space, offset, data & 0xff); | |
| 240 | 254 | } |
| 241 | 255 | |
| 242 | 256 | static WRITE8_DEVICE_HANDLER( gx400_speech_start_w ) |
| 243 | 257 | { |
| 258 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 259 | ||
| 244 | 260 | /* the voice data is not in a rom but in sound RAM at $8000 */ |
| 245 | vlm5030_set_rom(device, gx400_shared_ram + 0x4000); | |
| 261 | vlm5030_set_rom(device, state->gx400_shared_ram + 0x4000); | |
| 246 | 262 | vlm5030_st(device, 1); |
| 247 | 263 | vlm5030_st(device, 0); |
| 248 | 264 | } |
| r7500 | r7501 | |
| 261 | 277 | bit 5: vlm5030 busy |
| 262 | 278 | bit 7: unused by this software version. Bubble Memory version uses this bit. |
| 263 | 279 | */ |
| 280 | nemesis_state *state = (nemesis_state *)device->machine->driver_data; | |
| 281 | int res = (cpu_get_total_cycles(state->audiocpu) / 1024) & 0x2f; // this should be 0x0f, but it doesn't work | |
| 264 | 282 | |
| 265 | running_device *vlm = devtag_get_device(device->machine, "vlm"); | |
| 266 | int res = (cputag_get_total_cycles(device->machine, "audiocpu") / 1024) & 0x2f; // this should be 0x0f, but it doesn't work | |
| 267 | ||
| 268 | 283 | res |= 0xd0; |
| 269 | 284 | |
| 270 | if (vlm != NULL && vlm5030_bsy(vlm)) | |
| 285 | if (state->vlm != NULL && vlm5030_bsy(state->vlm)) | |
| 271 | 286 | res |= 0x20; |
| 272 | 287 | |
| 273 | 288 | return res; |
| r7500 | r7501 | |
| 275 | 290 | |
| 276 | 291 | static WRITE8_DEVICE_HANDLER( city_sound_bank_w ) |
| 277 | 292 | { |
| 278 | int bank_A=(data&0x3); | |
| 279 | int bank_B=((data>>2)&0x3); | |
| 280 | k007232_set_bank( device, bank_A, bank_B ); | |
| 293 | int bank_A = (data & 0x03); | |
| 294 | int bank_B = ((data >> 2) & 0x03); | |
| 295 | k007232_set_bank(device, bank_A, bank_B); | |
| 281 | 296 | } |
| 282 | 297 | |
| 283 | 298 | |
| 284 | 299 | static ADDRESS_MAP_START( nemesis_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 285 | 300 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 286 | AM_RANGE(0x040000, 0x04ffff) AM_RAM_WRITE(nemesis_char | |
| 301 | AM_RANGE(0x040000, 0x04ffff) AM_RAM_WRITE(nemesis_char | |
| 287 | 302 | AM_RANGE(0x050000, 0x051fff) AM_RAM |
| 288 | AM_RANGE(0x050000, 0x0503ff) AM_BASE(&nemesis_xscroll1) | |
| 289 | AM_RANGE(0x050400, 0x0507ff) AM_BASE(&nemesis_xscroll2) | |
| 290 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE(&nemesis_yscroll2) | |
| 291 | AM_RANGE(0x050f80, 0x050fff) AM_BASE(&nemesis_yscroll1) | |
| 292 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 293 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 294 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 295 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 296 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 297 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_GENERIC(paletteram) | |
| 303 | AM_RANGE(0x050000, 0x0503ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 304 | AM_RANGE(0x050400, 0x0507ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 305 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 306 | AM_RANGE(0x050f80, 0x050fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 307 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 308 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 309 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 310 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 311 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) | |
| 312 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_MEMBER(nemesis_state, paletteram) | |
| 298 | 313 | AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) |
| 299 | 314 | AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0") |
| 300 | 315 | AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 316 | 331 | AM_RANGE(0x000000, 0x00ffff) AM_ROM /* ROM BIOS */ |
| 317 | 332 | AM_RANGE(0x010000, 0x01ffff) AM_RAM |
| 318 | 333 | AM_RANGE(0x020000, 0x0287ff) AM_READWRITE(gx400_sharedram_word_r, gx400_sharedram_word_w) |
| 319 | AM_RANGE(0x030000, 0x03ffff) AM_RAM_WRITE(nemesis_char | |
| 334 | AM_RANGE(0x030000, 0x03ffff) AM_RAM_WRITE(nemesis_char | |
| 320 | 335 | AM_RANGE(0x050000, 0x051fff) AM_RAM |
| 321 | AM_RANGE(0x050000, 0x0503ff) AM_BASE(&nemesis_xscroll1) | |
| 322 | AM_RANGE(0x050400, 0x0507ff) AM_BASE(&nemesis_xscroll2) | |
| 323 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE(&nemesis_yscroll2) | |
| 324 | AM_RANGE(0x050f80, 0x050fff) AM_BASE(&nemesis_yscroll1) | |
| 325 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 326 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 327 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 328 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 329 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 336 | AM_RANGE(0x050000, 0x0503ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 337 | AM_RANGE(0x050400, 0x0507ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 338 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 339 | AM_RANGE(0x050f80, 0x050fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 340 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 341 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 342 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 343 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 344 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) | |
| 330 | 345 | AM_RANGE(0x057000, 0x057fff) AM_RAM /* needed for twinbee */ |
| 331 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_ | |
| 346 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_MEMBER | |
| 332 | 347 | AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) |
| 333 | 348 | AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0") |
| 334 | 349 | AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 349 | 364 | |
| 350 | 365 | static ADDRESS_MAP_START( konamigt_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 351 | 366 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 352 | AM_RANGE(0x040000, 0x04ffff) AM_RAM_WRITE(nemesis_char | |
| 367 | AM_RANGE(0x040000, 0x04ffff) AM_RAM_WRITE(nemesis_char | |
| 353 | 368 | AM_RANGE(0x050000, 0x051fff) AM_RAM |
| 354 | AM_RANGE(0x050000, 0x0503ff) AM_BASE(&nemesis_xscroll1) | |
| 355 | AM_RANGE(0x050400, 0x0507ff) AM_BASE(&nemesis_xscroll2) | |
| 356 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE(&nemesis_yscroll2) | |
| 357 | AM_RANGE(0x050f80, 0x050fff) AM_BASE(&nemesis_yscroll1) | |
| 358 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 359 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 360 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 361 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 362 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 363 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_GENERIC(paletteram) | |
| 369 | AM_RANGE(0x050000, 0x0503ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 370 | AM_RANGE(0x050400, 0x0507ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 371 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 372 | AM_RANGE(0x050f80, 0x050fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 373 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 374 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 375 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 376 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 377 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) | |
| 378 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_MEMBER(nemesis_state, paletteram) | |
| 364 | 379 | AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) |
| 365 | 380 | AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0") |
| 366 | 381 | AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 383 | 398 | AM_RANGE(0x000000, 0x00ffff) AM_ROM /* ROM BIOS */ |
| 384 | 399 | AM_RANGE(0x010000, 0x01ffff) AM_RAM |
| 385 | 400 | AM_RANGE(0x020000, 0x0287ff) AM_READWRITE(gx400_sharedram_word_r, gx400_sharedram_word_w) |
| 386 | AM_RANGE(0x030000, 0x03ffff) AM_RAM_WRITE(nemesis_char | |
| 401 | AM_RANGE(0x030000, 0x03ffff) AM_RAM_WRITE(nemesis_char | |
| 387 | 402 | AM_RANGE(0x050000, 0x051fff) AM_RAM |
| 388 | AM_RANGE(0x050000, 0x0503ff) AM_BASE(&nemesis_xscroll1) | |
| 389 | AM_RANGE(0x050400, 0x0507ff) AM_BASE(&nemesis_xscroll2) | |
| 390 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE(&nemesis_yscroll2) | |
| 391 | AM_RANGE(0x050f80, 0x050fff) AM_BASE(&nemesis_yscroll1) | |
| 392 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 393 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 394 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 395 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 396 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 397 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_GENERIC(paletteram) | |
| 403 | AM_RANGE(0x050000, 0x0503ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 404 | AM_RANGE(0x050400, 0x0507ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 405 | AM_RANGE(0x050f00, 0x050f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 406 | AM_RANGE(0x050f80, 0x050fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 407 | AM_RANGE(0x052000, 0x052fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 408 | AM_RANGE(0x053000, 0x053fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 409 | AM_RANGE(0x054000, 0x054fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 410 | AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 411 | AM_RANGE(0x056000, 0x056fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) | |
| 412 | AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_BASE_MEMBER(nemesis_state, paletteram) | |
| 398 | 413 | AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) |
| 399 | 414 | AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0") |
| 400 | 415 | AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1") |
| r7500 | r7501 | |
| 418 | 433 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 419 | 434 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 420 | 435 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 421 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("konami", k005289_pitch_A_w) | |
| 422 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE("konami", k005289_pitch_B_w) | |
| 436 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("k007232", k005289_pitch_A_w) | |
| 437 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE("k007232", k005289_pitch_B_w) | |
| 423 | 438 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_r) |
| 424 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("konami", k005289_keylatch_A_w) | |
| 425 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("konami", k005289_keylatch_B_w) | |
| 439 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("k007232", k005289_keylatch_A_w) | |
| 440 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("k007232", k005289_keylatch_B_w) | |
| 426 | 441 | AM_RANGE(0xe005, 0xe005) AM_DEVWRITE("ay2", ay8910_address_w) |
| 427 | 442 | AM_RANGE(0xe006, 0xe006) AM_DEVWRITE("ay1", ay8910_address_w) |
| 428 | 443 | AM_RANGE(0xe086, 0xe086) AM_DEVREAD("ay1", ay8910_r) |
| r7500 | r7501 | |
| 433 | 448 | |
| 434 | 449 | static ADDRESS_MAP_START( gx400_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 435 | 450 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 436 | AM_RANGE(0x4000, 0x87ff) AM_RAM AM_BASE(&gx400_shared_ram) | |
| 437 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("konami", k005289_pitch_A_w) | |
| 438 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE("konami", k005289_pitch_B_w) | |
| 451 | AM_RANGE(0x4000, 0x87ff) AM_RAM AM_BASE_MEMBER(nemesis_state, gx400_shared_ram) | |
| 452 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("k007232", k005289_pitch_A_w) | |
| 453 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE("k007232", k005289_pitch_B_w) | |
| 439 | 454 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("vlm", vlm5030_data_w) |
| 440 | 455 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_r) |
| 441 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("konami", k005289_keylatch_A_w) | |
| 442 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("konami", k005289_keylatch_B_w) | |
| 456 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("k007232", k005289_keylatch_A_w) | |
| 457 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("k007232", k005289_keylatch_B_w) | |
| 443 | 458 | AM_RANGE(0xe005, 0xe005) AM_DEVWRITE("ay2", ay8910_address_w) |
| 444 | 459 | AM_RANGE(0xe006, 0xe006) AM_DEVWRITE("ay1", ay8910_address_w) |
| 445 | 460 | AM_RANGE(0xe030, 0xe030) AM_DEVWRITE("vlm", gx400_speech_start_w) |
| r7500 | r7501 | |
| 454 | 469 | static ADDRESS_MAP_START( salamand_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 455 | 470 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 456 | 471 | AM_RANGE(0x080000, 0x087fff) AM_RAM |
| 457 | AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_ | |
| 472 | AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_MEMBER | |
| 458 | 473 | AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ |
| 459 | 474 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) |
| 460 | 475 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0") |
| r7500 | r7501 | |
| 463 | 478 | AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1") |
| 464 | 479 | AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2") |
| 465 | 480 | AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1") |
| 466 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) /* VRAM */ | |
| 467 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) | |
| 468 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 469 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 470 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_characterram_word_w) AM_BASE(&nemesis_characterram) AM_SIZE(&nemesis_characterram_size) | |
| 471 | AM_RANGE(0x180000, 0x180fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* more sprite ram ??? */ | |
| 481 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) /* VRAM */ | |
| 482 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) | |
| 483 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 484 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 485 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_charram_word_w) AM_BASE_SIZE_MEMBER(nemesis_state, charram, charram_size) | |
| 486 | AM_RANGE(0x180000, 0x180fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) /* more sprite ram ??? */ | |
| 472 | 487 | AM_RANGE(0x190000, 0x191fff) AM_RAM |
| 473 | AM_RANGE(0x190000, 0x1903ff) AM_BASE(&nemesis_xscroll2) | |
| 474 | AM_RANGE(0x190400, 0x1907ff) AM_BASE(&nemesis_xscroll1) | |
| 475 | AM_RANGE(0x190f00, 0x190f7f) AM_BASE(&nemesis_yscroll1) | |
| 476 | AM_RANGE(0x190f80, 0x190fff) AM_BASE(&nemesis_yscroll2) | |
| 488 | AM_RANGE(0x190000, 0x1903ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 489 | AM_RANGE(0x190400, 0x1907ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 490 | AM_RANGE(0x190f00, 0x190f7f) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 491 | AM_RANGE(0x190f80, 0x190fff) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 477 | 492 | ADDRESS_MAP_END |
| 478 | 493 | |
| 479 | 494 | static ADDRESS_MAP_START( blkpnthr_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 480 | 495 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 481 | AM_RANGE(0x080000, 0x081fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_ | |
| 496 | AM_RANGE(0x080000, 0x081fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_MEMBER | |
| 482 | 497 | AM_RANGE(0x090000, 0x097fff) AM_RAM |
| 483 | 498 | AM_RANGE(0x0a0000, 0x0a0001) AM_RAM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ |
| 484 | 499 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) |
| r7500 | r7501 | |
| 488 | 503 | AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1") |
| 489 | 504 | AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2") |
| 490 | 505 | AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1") |
| 491 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) AM_MIRROR(0x4000) /* VRAM */ | |
| 492 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) AM_MIRROR(0x4000) | |
| 493 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) | |
| 494 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 495 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_characterram_word_w) AM_BASE(&nemesis_characterram) AM_SIZE(&nemesis_characterram_size) | |
| 506 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) AM_MIRROR(0x4000) /* VRAM */ | |
| 507 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) AM_MIRROR(0x4000) | |
| 508 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) | |
| 509 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 510 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_charram_word_w) AM_BASE_SIZE_MEMBER(nemesis_state, charram, charram_size) | |
| 496 | 511 | AM_RANGE(0x180000, 0x181fff) AM_RAM |
| 497 | AM_RANGE(0x180000, 0x1803ff) AM_BASE(&nemesis_xscroll1) | |
| 498 | AM_RANGE(0x180400, 0x1807ff) AM_BASE(&nemesis_xscroll2) | |
| 499 | AM_RANGE(0x180f00, 0x180f7f) AM_BASE(&nemesis_yscroll2) | |
| 500 | AM_RANGE(0x180f80, 0x180fff) AM_BASE(&nemesis_yscroll1) | |
| 501 | AM_RANGE(0x190000, 0x190fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* more sprite ram ??? */ | |
| 512 | AM_RANGE(0x180000, 0x1803ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 513 | AM_RANGE(0x180400, 0x1807ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 514 | AM_RANGE(0x180f00, 0x180f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 515 | AM_RANGE(0x180f80, 0x180fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 516 | AM_RANGE(0x190000, 0x190fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) /* more sprite ram ??? */ | |
| 502 | 517 | ADDRESS_MAP_END |
| 503 | 518 | |
| 504 | 519 | static ADDRESS_MAP_START( citybomb_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 505 | 520 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 506 | 521 | AM_RANGE(0x080000, 0x087fff) AM_RAM |
| 507 | AM_RANGE(0x0e0000, 0x0e1fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_ | |
| 522 | AM_RANGE(0x0e0000, 0x0e1fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_MEMBER | |
| 508 | 523 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1") |
| 509 | 524 | AM_RANGE(0x0f0002, 0x0f0003) AM_READ_PORT("IN2") |
| 510 | 525 | AM_RANGE(0x0f0004, 0x0f0005) AM_READ_PORT("IN1") |
| r7500 | r7501 | |
| 515 | 530 | AM_RANGE(0x0f0020, 0x0f0021) AM_READ(selected_ip_word_r) AM_WRITENOP /* WEC Le Mans 24 control? */ |
| 516 | 531 | AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ |
| 517 | 532 | AM_RANGE(0x100000, 0x1bffff) AM_ROM |
| 518 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(nemesis_characterram_word_w) AM_BASE(&nemesis_characterram) AM_SIZE(&nemesis_characterram_size) | |
| 519 | AM_RANGE(0x210000, 0x210fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 520 | AM_RANGE(0x211000, 0x211fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 521 | AM_RANGE(0x212000, 0x212fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 522 | AM_RANGE(0x213000, 0x213fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 533 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(nemesis_charram_word_w) AM_BASE_SIZE_MEMBER(nemesis_state, charram, charram_size) | |
| 534 | AM_RANGE(0x210000, 0x210fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 535 | AM_RANGE(0x211000, 0x211fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 536 | AM_RANGE(0x212000, 0x212fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 537 | AM_RANGE(0x213000, 0x213fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 523 | 538 | AM_RANGE(0x300000, 0x301fff) AM_RAM |
| 524 | AM_RANGE(0x300000, 0x3003ff) AM_BASE(&nemesis_xscroll1) | |
| 525 | AM_RANGE(0x300400, 0x3007ff) AM_BASE(&nemesis_xscroll2) | |
| 526 | AM_RANGE(0x300f00, 0x300f7f) AM_BASE(&nemesis_yscroll2) | |
| 527 | AM_RANGE(0x300f80, 0x300fff) AM_BASE(&nemesis_yscroll1) | |
| 528 | AM_RANGE(0x310000, 0x310fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* more sprite ram ??? */ | |
| 539 | AM_RANGE(0x300000, 0x3003ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 540 | AM_RANGE(0x300400, 0x3007ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 541 | AM_RANGE(0x300f00, 0x300f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 542 | AM_RANGE(0x300f80, 0x300fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 543 | AM_RANGE(0x310000, 0x310fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) /* more sprite ram ??? */ | |
| 529 | 544 | ADDRESS_MAP_END |
| 530 | 545 | |
| 531 | 546 | static ADDRESS_MAP_START( nyanpani_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 532 | 547 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 533 | 548 | AM_RANGE(0x040000, 0x047fff) AM_RAM |
| 534 | AM_RANGE(0x060000, 0x061fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_ | |
| 549 | AM_RANGE(0x060000, 0x061fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_MEMBER | |
| 535 | 550 | AM_RANGE(0x100000, 0x13ffff) AM_ROM |
| 536 | 551 | AM_RANGE(0x070000, 0x070001) AM_READ_PORT("DSW1") |
| 537 | 552 | AM_RANGE(0x070002, 0x070003) AM_READ_PORT("IN2") |
| r7500 | r7501 | |
| 541 | 556 | AM_RANGE(0x070010, 0x070011) AM_WRITE(nemesis_soundlatch_word_w) |
| 542 | 557 | AM_RANGE(0x070018, 0x070019) AM_WRITE(watchdog_reset16_w) /* probably */ |
| 543 | 558 | AM_RANGE(0x078000, 0x078001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ |
| 544 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) /* VRAM */ | |
| 545 | AM_RANGE(0x201000, 0x201fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) | |
| 546 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 547 | AM_RANGE(0x203000, 0x203fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 548 | AM_RANGE(0x210000, 0x21ffff) AM_RAM_WRITE(nemesis_characterram_word_w) AM_BASE(&nemesis_characterram) AM_SIZE(&nemesis_characterram_size) | |
| 549 | AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* more sprite ram ??? */ | |
| 559 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) /* VRAM */ | |
| 560 | AM_RANGE(0x201000, 0x201fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) | |
| 561 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 562 | AM_RANGE(0x203000, 0x203fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 563 | AM_RANGE(0x210000, 0x21ffff) AM_RAM_WRITE(nemesis_charram_word_w) AM_BASE_SIZE_MEMBER(nemesis_state, charram, charram_size) | |
| 564 | AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) /* more sprite ram ??? */ | |
| 550 | 565 | AM_RANGE(0x310000, 0x311fff) AM_RAM |
| 551 | AM_RANGE(0x310000, 0x3103ff) AM_BASE(&nemesis_xscroll1) | |
| 552 | AM_RANGE(0x310400, 0x3107ff) AM_BASE(&nemesis_xscroll2) | |
| 553 | AM_RANGE(0x310f00, 0x310f7f) AM_BASE(&nemesis_yscroll2) | |
| 554 | AM_RANGE(0x310f80, 0x310fff) AM_BASE(&nemesis_yscroll1) | |
| 566 | AM_RANGE(0x310000, 0x3103ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 567 | AM_RANGE(0x310400, 0x3107ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 568 | AM_RANGE(0x310f00, 0x310f7f) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 569 | AM_RANGE(0x310f80, 0x310fff) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 555 | 570 | ADDRESS_MAP_END |
| 556 | 571 | |
| 557 | 572 | static READ8_HANDLER( wd_r ) |
| 558 | 573 | { |
| 559 | frame_counter^= 1; | |
| 560 | return frame_counter; | |
| 574 | nemesis_state *state = (nemesis_state *)space->machine->driver_data; | |
| 575 | state->frame_counter ^= 1; | |
| 576 | return state->frame_counter; | |
| 561 | 577 | } |
| 562 | 578 | |
| 563 | 579 | static ADDRESS_MAP_START( sal_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 564 | 580 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 565 | 581 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 566 | 582 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) |
| 567 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k | |
| 583 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_r, k007232_w) | |
| 568 | 584 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w) |
| 569 | 585 | AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("vlm", vlm5030_data_w) |
| 570 | 586 | AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */ |
| r7500 | r7501 | |
| 575 | 591 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 576 | 592 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 577 | 593 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) |
| 578 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k | |
| 594 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_r, k007232_w) | |
| 579 | 595 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w) |
| 580 | 596 | AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */ |
| 581 | 597 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 583 | 599 | static ADDRESS_MAP_START( city_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 584 | 600 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 585 | 601 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 586 | AM_RANGE(0x9800, 0x987f) AM_DEVWRITE("konami2", k051649_waveform_w) | |
| 587 | AM_RANGE(0x9880, 0x9889) AM_DEVWRITE("konami2", k051649_frequency_w) | |
| 588 | AM_RANGE(0x988a, 0x988e) AM_DEVWRITE("konami2", k051649_volume_w) | |
| 589 | AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("konami2", k051649_keyonoff_w) | |
| 602 | AM_RANGE(0x9800, 0x987f) AM_DEVWRITE("k051649", k051649_waveform_w) | |
| 603 | AM_RANGE(0x9880, 0x9889) AM_DEVWRITE("k051649", k051649_frequency_w) | |
| 604 | AM_RANGE(0x988a, 0x988e) AM_DEVWRITE("k051649", k051649_volume_w) | |
| 605 | AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("k051649", k051649_keyonoff_w) | |
| 590 | 606 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3812_r, ym3812_w) |
| 591 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("konami", k007232_r, k007232_w) | |
| 592 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE("konami", city_sound_bank_w) /* 7232 bankswitch */ | |
| 607 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_r, k007232_w) | |
| 608 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE("k007232", city_sound_bank_w) /* 7232 bankswitch */ | |
| 593 | 609 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) |
| 594 | 610 | ADDRESS_MAP_END |
| 595 | 611 | |
| r7500 | r7501 | |
| 599 | 615 | AM_RANGE(0x000000, 0x00ffff) AM_ROM |
| 600 | 616 | AM_RANGE(0x040000, 0x05ffff) AM_ROM |
| 601 | 617 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 602 | AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_ | |
| 618 | AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_BASE_MEMBER | |
| 603 | 619 | AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ |
| 604 | 620 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) |
| 605 | 621 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0") |
| r7500 | r7501 | |
| 613 | 629 | AM_RANGE(0x0c2804, 0x0c2805) AM_WRITENOP |
| 614 | 630 | AM_RANGE(0x0c4000, 0x0c4001) AM_READ_PORT("IN1") AM_WRITE(selected_ip_word_w) |
| 615 | 631 | AM_RANGE(0x0c4002, 0x0c4003) AM_READ(selected_ip_word_r) AM_WRITENOP /* WEC Le Mans 24 control. latches the value read previously */ |
| 616 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE(&nemesis_videoram2) /* VRAM */ | |
| 617 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE(&nemesis_videoram1) | |
| 618 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE(&nemesis_colorram2) | |
| 619 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE(&nemesis_colorram1) | |
| 620 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_characterram_word_w) AM_BASE(&nemesis_characterram) AM_SIZE(&nemesis_characterram_size) | |
| 621 | AM_RANGE(0x180000, 0x180fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 632 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(nemesis_videoram2_word_w) AM_BASE_MEMBER(nemesis_state, videoram2) /* VRAM */ | |
| 633 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_BASE_MEMBER(nemesis_state, videoram1) | |
| 634 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_BASE_MEMBER(nemesis_state, colorram2) | |
| 635 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(nemesis_colorram1_word_w) AM_BASE_MEMBER(nemesis_state, colorram1) | |
| 636 | AM_RANGE(0x120000, 0x12ffff) AM_RAM_WRITE(nemesis_charram_word_w) AM_BASE_SIZE_MEMBER(nemesis_state, charram, charram_size) | |
| 637 | AM_RANGE(0x180000, 0x180fff) AM_RAM AM_BASE_SIZE_MEMBER(nemesis_state, spriteram, spriteram_size) | |
| 622 | 638 | AM_RANGE(0x190000, 0x191fff) AM_RAM |
| 623 | AM_RANGE(0x190000, 0x1903ff) AM_BASE(&nemesis_xscroll2) | |
| 624 | AM_RANGE(0x190400, 0x1907ff) AM_BASE(&nemesis_xscroll1) | |
| 625 | AM_RANGE(0x190f00, 0x190f7f) AM_BASE(&nemesis_yscroll1) | |
| 626 | AM_RANGE(0x190f80, 0x190fff) AM_BASE(&nemesis_yscroll2) | |
| 639 | AM_RANGE(0x190000, 0x1903ff) AM_BASE_MEMBER(nemesis_state, xscroll2) | |
| 640 | AM_RANGE(0x190400, 0x1907ff) AM_BASE_MEMBER(nemesis_state, xscroll1) | |
| 641 | AM_RANGE(0x190f00, 0x190f7f) AM_BASE_MEMBER(nemesis_state, yscroll1) | |
| 642 | AM_RANGE(0x190f80, 0x190fff) AM_BASE_MEMBER(nemesis_state, yscroll2) | |
| 627 | 643 | ADDRESS_MAP_END |
| 628 | 644 | |
| 629 | 645 | /******************************************************************************/ |
| r7500 | r7501 | |
| 1594 | 1610 | AY8910_DEFAULT_LOADS, |
| 1595 | 1611 | DEVCB_NULL, |
| 1596 | 1612 | DEVCB_NULL, |
| 1597 | DEVCB_DEVICE_HANDLER("konami", k005289_control_A_w), | |
| 1598 | DEVCB_DEVICE_HANDLER("konami", k005289_control_B_w) | |
| 1613 | DEVCB_DEVICE_HANDLER("k007232", k005289_control_A_w), | |
| 1614 | DEVCB_DEVICE_HANDLER("k007232", k005289_control_B_w) | |
| 1599 | 1615 | }; |
| 1600 | 1616 | |
| 1601 | 1617 | static void sound_irq(running_device *device, int state) |
| 1602 | 1618 | { |
| 1603 | 1619 | /* Interrupts _are_ generated, I wonder where they go.. */ |
| 1604 | /*cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);*/ | |
| 1620 | // nemesis_state *driver_state = (nemesis_state *)device->machine->driver_data; | |
| 1621 | // cpu_set_input_line(driver_state->audiocpu, 0, HOLD_LINE); | |
| 1605 | 1622 | } |
| 1606 | 1623 | |
| 1607 | 1624 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 1616 | 1633 | |
| 1617 | 1634 | static void volume_callback(running_device *device, int v) |
| 1618 | 1635 | { |
| 1619 | k007232_set_volume(device,0,(v >> 4) * 0x11,0); | |
| 1620 | k007232_set_volume(device,1,0,(v & 0x0f) * 0x11); | |
| 1636 | k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); | |
| 1637 | k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); | |
| 1621 | 1638 | } |
| 1622 | 1639 | |
| 1623 | 1640 | static const k007232_interface k007232_config = |
| r7500 | r7501 | |
| 1627 | 1644 | |
| 1628 | 1645 | /******************************************************************************/ |
| 1629 | 1646 | |
| 1647 | static MACHINE_START( nemesis ) | |
| 1648 | { | |
| 1649 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 1650 | ||
| 1651 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 1652 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 1653 | state->vlm = devtag_get_device(machine, "vlm"); | |
| 1654 | ||
| 1655 | state_save_register_global(machine, state->irq_on); | |
| 1656 | state_save_register_global(machine, state->irq1_on); | |
| 1657 | state_save_register_global(machine, state->irq2_on); | |
| 1658 | state_save_register_global(machine, state->irq4_on); | |
| 1659 | state_save_register_global(machine, state->frame_counter); | |
| 1660 | state_save_register_global(machine, state->gx400_irq1_cnt); | |
| 1661 | state_save_register_global(machine, state->selected_ip); | |
| 1662 | ||
| 1663 | state_save_register_global(machine, state->tilemap_flip); | |
| 1664 | state_save_register_global(machine, state->flipscreen); | |
| 1665 | state_save_register_global(machine, state->irq_port_last); | |
| 1666 | } | |
| 1667 | ||
| 1668 | static MACHINE_RESET( nemesis ) | |
| 1669 | { | |
| 1670 | nemesis_state *state = (nemesis_state *)machine->driver_data; | |
| 1671 | ||
| 1672 | state->irq_on = 0; | |
| 1673 | state->irq1_on = 0; | |
| 1674 | state->irq2_on = 0; | |
| 1675 | state->irq4_on = 0; | |
| 1676 | state->gx400_irq1_cnt = 0; | |
| 1677 | state->frame_counter = 1; | |
| 1678 | state->selected_ip = 0; | |
| 1679 | ||
| 1680 | state->flipscreen = 0; | |
| 1681 | state->tilemap_flip = 0; | |
| 1682 | state->irq_port_last = 0; | |
| 1683 | } | |
| 1684 | ||
| 1630 | 1685 | static MACHINE_DRIVER_START( nemesis ) |
| 1631 | 1686 | |
| 1687 | /* driver data */ | |
| 1688 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1689 | ||
| 1632 | 1690 | /* basic machine hardware */ |
| 1633 | 1691 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */ |
| 1634 | 1692 | // 14318180/2, /* From schematics, should be accurate */ |
| r7500 | r7501 | |
| 1638 | 1696 | MDRV_CPU_ADD("audiocpu", Z80,14318180/4) /* From schematics, should be accurate */ |
| 1639 | 1697 | MDRV_CPU_PROGRAM_MAP(sound_map) /* fixed */ |
| 1640 | 1698 | |
| 1699 | MDRV_MACHINE_START(nemesis) | |
| 1641 | 1700 | MDRV_MACHINE_RESET(nemesis) |
| 1642 | 1701 | |
| 1643 | 1702 | /* video hardware */ |
| r7500 | r7501 | |
| 1665 | 1724 | MDRV_SOUND_CONFIG(ay8910_interface_2) /* fixed */ |
| 1666 | 1725 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */ |
| 1667 | 1726 | |
| 1668 | MDRV_SOUND_ADD("k | |
| 1727 | MDRV_SOUND_ADD("k007232", K005289, 3579545/2) | |
| 1669 | 1728 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */ |
| 1670 | 1729 | |
| 1671 | 1730 | MDRV_SOUND_ADD("vlm", VLM5030, 3579545) |
| r7500 | r7501 | |
| 1675 | 1734 | |
| 1676 | 1735 | static MACHINE_DRIVER_START( gx400 ) |
| 1677 | 1736 | |
| 1737 | /* driver data */ | |
| 1738 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1739 | ||
| 1678 | 1740 | /* basic machine hardware */ |
| 1679 | 1741 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */ |
| 1680 | 1742 | MDRV_CPU_PROGRAM_MAP(gx400_map) |
| r7500 | r7501 | |
| 1684 | 1746 | MDRV_CPU_PROGRAM_MAP(gx400_sound_map) |
| 1685 | 1747 | MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse) /* interrupts are triggered by the main CPU */ |
| 1686 | 1748 | |
| 1749 | MDRV_MACHINE_START(nemesis) | |
| 1687 | 1750 | MDRV_MACHINE_RESET(nemesis) |
| 1688 | 1751 | |
| 1689 | 1752 | /* video hardware */ |
| r7500 | r7501 | |
| 1711 | 1774 | MDRV_SOUND_CONFIG(ay8910_interface_2) |
| 1712 | 1775 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */ |
| 1713 | 1776 | |
| 1714 | MDRV_SOUND_ADD("k | |
| 1777 | MDRV_SOUND_ADD("k007232", K005289, 3579545/2) | |
| 1715 | 1778 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */ |
| 1716 | 1779 | |
| 1717 | 1780 | MDRV_SOUND_ADD("vlm", VLM5030, 3579545) |
| r7500 | r7501 | |
| 1721 | 1784 | |
| 1722 | 1785 | static MACHINE_DRIVER_START( konamigt ) |
| 1723 | 1786 | |
| 1787 | /* driver data */ | |
| 1788 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1789 | ||
| 1724 | 1790 | /* basic machine hardware */ |
| 1725 | 1791 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */ |
| 1726 | 1792 | MDRV_CPU_PROGRAM_MAP(konamigt_map) |
| r7500 | r7501 | |
| 1729 | 1795 | MDRV_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ |
| 1730 | 1796 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 1731 | 1797 | |
| 1798 | MDRV_MACHINE_START(nemesis) | |
| 1732 | 1799 | MDRV_MACHINE_RESET(nemesis) |
| 1733 | 1800 | |
| 1734 | 1801 | /* video hardware */ |
| r7500 | r7501 | |
| 1756 | 1823 | MDRV_SOUND_CONFIG(ay8910_interface_2) |
| 1757 | 1824 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 1758 | 1825 | |
| 1759 | MDRV_SOUND_ADD("k | |
| 1826 | MDRV_SOUND_ADD("k007232", K005289, 3579545/2) | |
| 1760 | 1827 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 1761 | 1828 | MACHINE_DRIVER_END |
| 1762 | 1829 | |
| 1763 | 1830 | |
| 1764 | 1831 | static MACHINE_DRIVER_START( rf2_gx400 ) |
| 1765 | 1832 | |
| 1833 | /* driver data */ | |
| 1834 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1835 | ||
| 1766 | 1836 | /* basic machine hardware */ |
| 1767 | 1837 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */ |
| 1768 | 1838 | MDRV_CPU_PROGRAM_MAP(rf2_gx400_map) |
| r7500 | r7501 | |
| 1772 | 1842 | MDRV_CPU_PROGRAM_MAP(gx400_sound_map) |
| 1773 | 1843 | MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse) /* interrupts are triggered by the main CPU */ |
| 1774 | 1844 | |
| 1845 | MDRV_MACHINE_START(nemesis) | |
| 1775 | 1846 | MDRV_MACHINE_RESET(nemesis) |
| 1776 | 1847 | |
| 1777 | 1848 | /* video hardware */ |
| r7500 | r7501 | |
| 1799 | 1870 | MDRV_SOUND_CONFIG(ay8910_interface_2) |
| 1800 | 1871 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 1801 | 1872 | |
| 1802 | MDRV_SOUND_ADD("k | |
| 1873 | MDRV_SOUND_ADD("k007232", K005289, 3579545/2) | |
| 1803 | 1874 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 1804 | 1875 | |
| 1805 | 1876 | MDRV_SOUND_ADD("vlm", VLM5030, 3579545) |
| r7500 | r7501 | |
| 1809 | 1880 | |
| 1810 | 1881 | static MACHINE_DRIVER_START( salamand ) |
| 1811 | 1882 | |
| 1883 | /* driver data */ | |
| 1884 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1885 | ||
| 1812 | 1886 | /* basic machine hardware */ |
| 1813 | 1887 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216MHz */ |
| 1814 | 1888 | MDRV_CPU_PROGRAM_MAP(salamand_map) |
| r7500 | r7501 | |
| 1817 | 1891 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */ |
| 1818 | 1892 | MDRV_CPU_PROGRAM_MAP(sal_sound_map) |
| 1819 | 1893 | |
| 1894 | MDRV_MACHINE_START(nemesis) | |
| 1820 | 1895 | MDRV_MACHINE_RESET(nemesis) |
| 1821 | 1896 | |
| 1822 | 1897 | /* video hardware */ |
| r7500 | r7501 | |
| 1842 | 1917 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60) |
| 1843 | 1918 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60) |
| 1844 | 1919 | |
| 1845 | MDRV_SOUND_ADD("k | |
| 1920 | MDRV_SOUND_ADD("k007232", K007232, 3579545) | |
| 1846 | 1921 | MDRV_SOUND_CONFIG(k007232_config) |
| 1847 | 1922 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.10) |
| 1848 | 1923 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.10) |
| r7500 | r7501 | |
| 1858 | 1933 | |
| 1859 | 1934 | static MACHINE_DRIVER_START( blkpnthr ) |
| 1860 | 1935 | |
| 1936 | /* driver data */ | |
| 1937 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1938 | ||
| 1861 | 1939 | /* basic machine hardware */ |
| 1862 | 1940 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */ |
| 1863 | 1941 | MDRV_CPU_PROGRAM_MAP(blkpnthr_map) |
| r7500 | r7501 | |
| 1866 | 1944 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */ |
| 1867 | 1945 | MDRV_CPU_PROGRAM_MAP(blkpnthr_sound_map) |
| 1868 | 1946 | |
| 1947 | MDRV_MACHINE_START(nemesis) | |
| 1869 | 1948 | MDRV_MACHINE_RESET(nemesis) |
| 1870 | 1949 | |
| 1871 | 1950 | /* video hardware */ |
| r7500 | r7501 | |
| 1887 | 1966 | /* sound hardware */ |
| 1888 | 1967 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1889 | 1968 | |
| 1890 | MDRV_SOUND_ADD("k | |
| 1969 | MDRV_SOUND_ADD("k007232", K007232, 3579545) | |
| 1891 | 1970 | MDRV_SOUND_CONFIG(k007232_config) |
| 1892 | 1971 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.10) |
| 1893 | 1972 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.10) |
| r7500 | r7501 | |
| 1903 | 1982 | |
| 1904 | 1983 | static MACHINE_DRIVER_START( citybomb ) |
| 1905 | 1984 | |
| 1985 | /* driver data */ | |
| 1986 | MDRV_DRIVER_DATA(nemesis_state) | |
| 1987 | ||
| 1906 | 1988 | /* basic machine hardware */ |
| 1907 | 1989 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */ |
| 1908 | 1990 | MDRV_CPU_PROGRAM_MAP(citybomb_map) |
| r7500 | r7501 | |
| 1911 | 1993 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */ |
| 1912 | 1994 | MDRV_CPU_PROGRAM_MAP(city_sound_map) |
| 1913 | 1995 | |
| 1996 | MDRV_MACHINE_START(nemesis) | |
| 1914 | 1997 | MDRV_MACHINE_RESET(nemesis) |
| 1915 | 1998 | |
| 1916 | 1999 | /* video hardware */ |
| r7500 | r7501 | |
| 1932 | 2015 | /* sound hardware */ |
| 1933 | 2016 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1934 | 2017 | |
| 1935 | MDRV_SOUND_ADD("k | |
| 2018 | MDRV_SOUND_ADD("k007232", K007232, 3579545) | |
| 1936 | 2019 | MDRV_SOUND_CONFIG(k007232_config) |
| 1937 | 2020 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.30) |
| 1938 | 2021 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.30) |
| r7500 | r7501 | |
| 1944 | 2027 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1945 | 2028 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1946 | 2029 | |
| 1947 | MDRV_SOUND_ADD("k | |
| 2030 | MDRV_SOUND_ADD("k051649", K051649, 3579545/2) | |
| 1948 | 2031 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.38) |
| 1949 | 2032 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.38) |
| 1950 | 2033 | MACHINE_DRIVER_END |
| r7500 | r7501 | |
| 1952 | 2035 | |
| 1953 | 2036 | static MACHINE_DRIVER_START( nyanpani ) |
| 1954 | 2037 | |
| 2038 | /* driver data */ | |
| 2039 | MDRV_DRIVER_DATA(nemesis_state) | |
| 2040 | ||
| 1955 | 2041 | /* basic machine hardware */ |
| 1956 | 2042 | MDRV_CPU_ADD("maincpu", M68000,18432000/2) /* 9.216 MHz? */ |
| 1957 | 2043 | MDRV_CPU_PROGRAM_MAP(nyanpani_map) |
| r7500 | r7501 | |
| 1960 | 2046 | MDRV_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */ |
| 1961 | 2047 | MDRV_CPU_PROGRAM_MAP(city_sound_map) |
| 1962 | 2048 | |
| 2049 | MDRV_MACHINE_START(nemesis) | |
| 1963 | 2050 | MDRV_MACHINE_RESET(nemesis) |
| 1964 | 2051 | |
| 1965 | 2052 | /* video hardware */ |
| r7500 | r7501 | |
| 1981 | 2068 | /* sound hardware */ |
| 1982 | 2069 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1983 | 2070 | |
| 1984 | MDRV_SOUND_ADD("k | |
| 2071 | MDRV_SOUND_ADD("k007232", K007232, 3579545) | |
| 1985 | 2072 | MDRV_SOUND_CONFIG(k007232_config) |
| 1986 | 2073 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.30) |
| 1987 | 2074 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.30) |
| r7500 | r7501 | |
| 1993 | 2080 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1994 | 2081 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1995 | 2082 | |
| 1996 | MDRV_SOUND_ADD("k | |
| 2083 | MDRV_SOUND_ADD("k051649", K051649, 3579545/2) | |
| 1997 | 2084 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.38) |
| 1998 | 2085 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.38) |
| 1999 | 2086 | MACHINE_DRIVER_END |
| r7500 | r7501 | |
| 2001 | 2088 | |
| 2002 | 2089 | static MACHINE_DRIVER_START( hcrash ) |
| 2003 | 2090 | |
| 2091 | /* driver data */ | |
| 2092 | MDRV_DRIVER_DATA(nemesis_state) | |
| 2093 | ||
| 2004 | 2094 | /* basic machine hardware */ |
| 2005 | 2095 | MDRV_CPU_ADD("maincpu", M68000,18432000/3) /* 6.144MHz */ |
| 2006 | 2096 | MDRV_CPU_PROGRAM_MAP(hcrash_map) |
| r7500 | r7501 | |
| 2009 | 2099 | MDRV_CPU_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ |
| 2010 | 2100 | MDRV_CPU_PROGRAM_MAP(sal_sound_map) |
| 2011 | 2101 | |
| 2102 | MDRV_MACHINE_START(nemesis) | |
| 2012 | 2103 | MDRV_MACHINE_RESET(nemesis) |
| 2013 | 2104 | |
| 2014 | 2105 | /* video hardware */ |
| r7500 | r7501 | |
| 2032 | 2123 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60) |
| 2033 | 2124 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60) |
| 2034 | 2125 | |
| 2035 | MDRV_SOUND_ADD("k | |
| 2126 | MDRV_SOUND_ADD("k007232", K007232, 3579545) | |
| 2036 | 2127 | MDRV_SOUND_CONFIG(k007232_config) |
| 2037 | 2128 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.10) |
| 2038 | 2129 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.10) |
| r7500 | r7501 | |
| 2065 | 2156 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2066 | 2157 | ROM_LOAD( "456-d09.9c", 0x00000, 0x4000, CRC(26bf9636) SHA1(009dcbf18ea6230fc75a72232bd4fc29ad28dbf0) ) |
| 2067 | 2158 | |
| 2068 | ROM_REGION( 0x0200, "k | |
| 2159 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2069 | 2160 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2070 | 2161 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2071 | 2162 | ROM_END |
| r7500 | r7501 | |
| 2084 | 2175 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2085 | 2176 | ROM_LOAD( "456-d09.9c", 0x00000, 0x4000, CRC(26bf9636) SHA1(009dcbf18ea6230fc75a72232bd4fc29ad28dbf0) ) |
| 2086 | 2177 | |
| 2087 | ROM_REGION( 0x0200, "k | |
| 2178 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2088 | 2179 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2089 | 2180 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2090 | 2181 | ROM_END |
| r7500 | r7501 | |
| 2103 | 2194 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2104 | 2195 | ROM_LOAD( "561-b09.9c", 0x00000, 0x4000, CRC(539d0c49) SHA1(4c16b07fbd876b6445fc0ec49c3ad5ab1a92cbf6) ) |
| 2105 | 2196 | |
| 2106 | ROM_REGION( 0x0200, "k | |
| 2197 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2107 | 2198 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2108 | 2199 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2109 | 2200 | ROM_END |
| r7500 | r7501 | |
| 2118 | 2209 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2119 | 2210 | ROM_LOAD( "400-e03.5l", 0x00000, 0x02000, CRC(a5a8e57d) SHA1(f4236770093392dec3f76835a5766e9b3ed64e2e) ) |
| 2120 | 2211 | |
| 2121 | ROM_REGION( 0x0200, "k | |
| 2212 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2122 | 2213 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2123 | 2214 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2124 | 2215 | ROM_END |
| r7500 | r7501 | |
| 2133 | 2224 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2134 | 2225 | ROM_LOAD( "400-e03.5l", 0x00000, 0x02000, CRC(a5a8e57d) SHA1(f4236770093392dec3f76835a5766e9b3ed64e2e) ) |
| 2135 | 2226 | |
| 2136 | ROM_REGION( 0x0200, "k | |
| 2227 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2137 | 2228 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2138 | 2229 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2139 | 2230 | ROM_END |
| r7500 | r7501 | |
| 2148 | 2239 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2149 | 2240 | ROM_LOAD( "400-e03.5l", 0x00000, 0x2000, CRC(a5a8e57d) SHA1(f4236770093392dec3f76835a5766e9b3ed64e2e) ) |
| 2150 | 2241 | |
| 2151 | ROM_REGION( 0x0200, "k | |
| 2242 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2152 | 2243 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2153 | 2244 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2154 | 2245 | ROM_END |
| r7500 | r7501 | |
| 2163 | 2254 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2164 | 2255 | ROM_LOAD( "400-e03.5l", 0x00000, 0x02000, CRC(a5a8e57d) SHA1(f4236770093392dec3f76835a5766e9b3ed64e2e) ) |
| 2165 | 2256 | |
| 2166 | ROM_REGION( 0x0200, "k | |
| 2257 | ROM_REGION( 0x0200, "k007232", 0 ) /* 2x 256 byte for 0005289 wavetable data */ | |
| 2167 | 2258 | ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) |
| 2168 | 2259 | ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) |
| 2169 | 2260 | ROM_END |
| r7500 | r7501 | |
| 2181 | 2272 | ROM_REGION( 0x04000, "vlm", 0 ) /* VLM5030 data? */ |
| 2182 | 2273 | ROM_LOAD( "587-d08.8g", 0x00000, 0x04000, CRC(f9ac6b82) SHA1(3370fc3a7f82e922e19d54afb3bca7b07fa4aa9a) ) |
| 2183 | 2274 | |
| 2184 | ROM_REGION( 0x20000, "k | |
| 2275 | ROM_REGION( 0x20000, "k007232", 0 ) /* 007232 data */ | |
| 2185 | 2276 | ROM_LOAD( "587-c01.10a", 0x00000, 0x20000, CRC(09fe0632) SHA1(4c3b29c623d70bbe8a938a0beb4638912c46fb6a) ) /* Mask rom */ |
| 2186 | 2277 | ROM_END |
| 2187 | 2278 | |
| r7500 | r7501 | |
| 2198 | 2289 | ROM_REGION( 0x04000, "vlm", 0 ) /* VLM5030 data? */ |
| 2199 | 2290 | ROM_LOAD( "587-d08.8g", 0x00000, 0x04000, CRC(f9ac6b82) SHA1(3370fc3a7f82e922e19d54afb3bca7b07fa4aa9a) ) |
| 2200 | 2291 | |
| 2201 | ROM_REGION( 0x20000, "k | |
| 2292 | ROM_REGION( 0x20000, "k007232", 0 ) /* 007232 data */ | |
| 2202 | 2293 | ROM_LOAD( "587-c01.10a", 0x00000, 0x20000, CRC(09fe0632) SHA1(4c3b29c623d70bbe8a938a0beb4638912c46fb6a) ) /* Mask rom */ |
| 2203 | 2294 | ROM_END |
| 2204 | 2295 | |
| r7500 | r7501 | |
| 2215 | 2306 | ROM_REGION( 0x04000, "vlm", 0 ) /* VLM5030 data? */ |
| 2216 | 2307 | ROM_LOAD( "587-k08.8g", 0x00000, 0x04000, CRC(7f0e9b41) SHA1(c9fc2723fac55691dfbb4cf9b3c472a42efa97c9) ) |
| 2217 | 2308 | |
| 2218 | ROM_REGION( 0x20000, "k | |
| 2309 | ROM_REGION( 0x20000, "k007232", 0 ) /* 007232 data */ | |
| 2219 | 2310 | ROM_LOAD( "587-c01.10a", 0x00000, 0x20000, CRC(09fe0632) SHA1(4c3b29c623d70bbe8a938a0beb4638912c46fb6a) ) /* Mask rom */ |
| 2220 | 2311 | ROM_END |
| 2221 | 2312 | |
| r7500 | r7501 | |
| 2232 | 2323 | ROM_REGION( 0x04000, "vlm", 0 ) /* VLM5030 data? */ |
| 2233 | 2324 | ROM_LOAD( "587-k08.8g", 0x00000, 0x04000, CRC(7f0e9b41) SHA1(c9fc2723fac55691dfbb4cf9b3c472a42efa97c9) ) |
| 2234 | 2325 | |
| 2235 | ROM_REGION( 0x20000, "k | |
| 2326 | ROM_REGION( 0x20000, "k007232", 0 ) /* 007232 data */ | |
| 2236 | 2327 | ROM_LOAD( "587-c01.10a", 0x00000, 0x20000, CRC(09fe0632) SHA1(4c3b29c623d70bbe8a938a0beb4638912c46fb6a) ) /* Mask rom */ |
| 2237 | 2328 | ROM_END |
| 2238 | 2329 | |
| r7500 | r7501 | |
| 2246 | 2337 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2247 | 2338 | ROM_LOAD( "604-a08.11j", 0x00000, 0x08000, CRC(aff88a2b) SHA1(7080add63deab5755606759a218dea9105df4819) ) |
| 2248 | 2339 | |
| 2249 | ROM_REGION( 0x20000, "k | |
| 2340 | ROM_REGION( 0x20000, "k007232", 0 ) /* 007232 data */ | |
| 2250 | 2341 | ROM_LOAD( "604-a01.10a", 0x00000, 0x20000, CRC(eceb64a6) SHA1(028157d336770fe4ca17c24476d62a790255898a) ) |
| 2251 | 2342 | ROM_END |
| 2252 | 2343 | |
| r7500 | r7501 | |
| 2264 | 2355 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2265 | 2356 | ROM_LOAD( "787-e02.4h", 0x00000, 0x08000, CRC(f4591e46) SHA1(c17c1a24bf1866fbba388521a4b7ea0975bda587) ) |
| 2266 | 2357 | |
| 2267 | ROM_REGION( 0x80000, "k | |
| 2358 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2268 | 2359 | ROM_LOAD( "787-e01.1k", 0x00000, 0x80000, CRC(edc34d01) SHA1(b1465d1a7364a7cebc14b96cd01dc78e57975972) ) |
| 2269 | 2360 | ROM_END |
| 2270 | 2361 | |
| r7500 | r7501 | |
| 2282 | 2373 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2283 | 2374 | ROM_LOAD( "787-e02.4h", 0x00000, 0x08000, CRC(f4591e46) SHA1(c17c1a24bf1866fbba388521a4b7ea0975bda587) ) |
| 2284 | 2375 | |
| 2285 | ROM_REGION( 0x80000, "k | |
| 2376 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2286 | 2377 | ROM_LOAD( "787-e01.1k", 0x00000, 0x80000, CRC(edc34d01) SHA1(b1465d1a7364a7cebc14b96cd01dc78e57975972) ) |
| 2287 | 2378 | ROM_END |
| 2288 | 2379 | |
| r7500 | r7501 | |
| 2296 | 2387 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2297 | 2388 | ROM_LOAD( "712-e02.4h", 0x00000, 0x08000, CRC(ba76f310) SHA1(cc2164a9617493d1b3b8ac67430f9eb26fd987d2) ) |
| 2298 | 2389 | |
| 2299 | ROM_REGION( 0x80000, "k | |
| 2390 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2300 | 2391 | ROM_LOAD( "712-b01.1k", 0x00000, 0x80000, CRC(f65b5d95) SHA1(12701be68629844720cd16af857ce38ef06af61c) ) |
| 2301 | 2392 | ROM_END |
| 2302 | 2393 | |
| r7500 | r7501 | |
| 2310 | 2401 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound */ |
| 2311 | 2402 | ROM_LOAD( "712-e02.4h", 0x00000, 0x08000, CRC(ba76f310) SHA1(cc2164a9617493d1b3b8ac67430f9eb26fd987d2) ) |
| 2312 | 2403 | |
| 2313 | ROM_REGION( 0x80000, "k | |
| 2404 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2314 | 2405 | ROM_LOAD( "712-b01.1k", 0x00000, 0x80000, CRC(f65b5d95) SHA1(12701be68629844720cd16af857ce38ef06af61c) ) |
| 2315 | 2406 | ROM_END |
| 2316 | 2407 | |
| r7500 | r7501 | |
| 2434 | 2525 | ROM_LOAD( "790-c08.j4", 0x04000, 0x04000, CRC(cfb844bc) SHA1(43b7adb6093e707212204118087ef4f79b0dbc1f) ) |
| 2435 | 2526 | ROM_CONTINUE( 0x00000, 0x04000 ) /* Board is wired for 27C128, top half of EPROM is blank */ |
| 2436 | 2527 | |
| 2437 | ROM_REGION( 0x80000, "k | |
| 2528 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2438 | 2529 | ROM_LOAD( "790-c01.m10", 0x00000, 0x20000, CRC(07976bc3) SHA1(9341ac6084fbbe17c4e7bbefade9a3f1dec3f132) ) |
| 2439 | 2530 | ROM_END |
| 2440 | 2531 | |
| r7500 | r7501 | |
| 2452 | 2543 | ROM_LOAD( "790-c08.j4", 0x04000, 0x04000, CRC(cfb844bc) SHA1(43b7adb6093e707212204118087ef4f79b0dbc1f) ) |
| 2453 | 2544 | ROM_CONTINUE( 0x00000, 0x04000 ) /* Board is wired for 27C128, top half of EPROM is blank */ |
| 2454 | 2545 | |
| 2455 | ROM_REGION( 0x80000, "k | |
| 2546 | ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 data */ | |
| 2456 | 2547 | ROM_LOAD( "790-c01.m10", 0x00000, 0x20000, CRC(07976bc3) SHA1(9341ac6084fbbe17c4e7bbefade9a3f1dec3f132) ) |
| 2457 | 2548 | ROM_END |
| 2458 | 2549 | |
| 2459 | 2550 | |
| 2460 | static DRIVER_INIT( nemesis ) | |
| 2461 | { | |
| 2462 | /* Set up save state */ | |
| 2463 | state_save_register_global(machine, nemesis_irq_on); | |
| 2464 | state_save_register_global(machine, nemesis_irq1_on); | |
| 2465 | state_save_register_global(machine, nemesis_irq2_on); | |
| 2466 | state_save_register_global(machine, nemesis_irq4_on); | |
| 2467 | state_save_register_global(machine, frame_counter); | |
| 2468 | state_save_register_global(machine, gx400_irq1_cnt); | |
| 2469 | state_save_register_global(machine, hcrash_selected_ip); | |
| 2470 | } | |
| 2471 | 2551 | |
| 2472 | ||
| 2473 | GAME( 1985, nemesis, 0, nemesis, nemesis, nemesis, ROT0, "Konami", "Nemesis", GAME_SUPPORTS_SAVE ) | |
| 2474 | GAME( 1985, nemesisuk, nemesis, nemesis, nemesuk, nemesis, ROT0, "Konami", "Nemesis (World?)", GAME_SUPPORTS_SAVE ) | |
| 2475 | GAME( 1985, konamigt, 0, konamigt, konamigt, nemesis, ROT0, "Konami", "Konami GT", GAME_SUPPORTS_SAVE ) | |
| 2476 | GAME( 1985, rf2, konamigt, rf2_gx400, rf2, nemesis, ROT0, "Konami", "Konami RF2 - Red Fighter", GAME_SUPPORTS_SAVE ) | |
| 2477 | GAME( 1985, twinbee, 0, gx400, twinbee, nemesis, ROT90, "Konami", "TwinBee", GAME_SUPPORTS_SAVE ) | |
| 2478 | GAME( 1985, gradius, nemesis, gx400, gradius, nemesis, ROT0, "Konami", "Gradius", GAME_SUPPORTS_SAVE ) | |
| 2479 | GAME( 1985, gwarrior, 0, gx400, gwarrior, nemesis, ROT0, "Konami", "Galactic Warriors", GAME_SUPPORTS_SAVE ) | |
| 2480 | GAME( 1986, salamand, 0, salamand, salamand, nemesis, ROT0, "Konami", "Salamander (version D)", GAME_SUPPORTS_SAVE ) | |
| 2481 | GAME( 1986, salamandj, salamand, salamand, salamand, nemesis, ROT0, "Konami", "Salamander (version J)", GAME_SUPPORTS_SAVE ) | |
| 2482 | GAME( 1986, lifefrce, salamand, salamand, salamand, nemesis, ROT0, "Konami", "Lifeforce (US)", GAME_SUPPORTS_SAVE ) | |
| 2483 | GAME( 1987, lifefrcej, salamand, salamand, lifefrcj, nemesis, ROT0, "Konami", "Lifeforce (Japan)", GAME_SUPPORTS_SAVE ) | |
| 2484 | GAME( 1987, blkpnthr, 0, blkpnthr, blkpnthr, nemesis, ROT0, "Konami", "Black Panther", GAME_SUPPORTS_SAVE ) | |
| 2485 | GAME( 1987, citybomb, 0, citybomb, citybomb, nemesis, ROT270, "Konami", "City Bomber (World)", GAME_SUPPORTS_SAVE ) | |
| 2486 | GAME( 1987, citybombj, citybomb, citybomb, citybomb, nemesis, ROT270, "Konami", "City Bomber (Japan)", GAME_SUPPORTS_SAVE ) | |
| 2487 | GAME( 1987, hcrash, 0, hcrash, hcrash, nemesis, ROT0, "Konami", "Hyper Crash (version D)", GAME_SUPPORTS_SAVE ) | |
| 2488 | GAME( 1987, hcrashc, hcrash, hcrash, hcrash, nemesis, ROT0, "Konami", "Hyper Crash (version C)", GAME_SUPPORTS_SAVE ) | |
| 2489 | GAME( 1988, kittenk, 0, nyanpani, nyanpani, nemesis, ROT0, "Konami", "Kitten Kaboodle", GAME_SUPPORTS_SAVE ) | |
| 2490 | GAME( 1988, nyanpani, kittenk, nyanpani, nyanpani, nemesis, ROT0, "Konami", "Nyan Nyan Panic (Japan)", GAME_SUPPORTS_SAVE ) | |
| 2552 | GAME( 1985, nemesis, 0, nemesis, nemesis, 0, ROT0, "Konami", "Nemesis", GAME_SUPPORTS_SAVE ) | |
| 2553 | GAME( 1985, nemesisuk, nemesis, nemesis, nemesuk, 0, ROT0, "Konami", "Nemesis (World?)", GAME_SUPPORTS_SAVE ) | |
| 2554 | GAME( 1985, konamigt, 0, konamigt, konamigt, 0, ROT0, "Konami", "Konami GT", GAME_SUPPORTS_SAVE ) | |
| 2555 | GAME( 1985, rf2, konamigt, rf2_gx400, rf2, 0, ROT0, "Konami", "Konami RF2 - Red Fighter", GAME_SUPPORTS_SAVE ) | |
| 2556 | GAME( 1985, twinbee, 0, gx400, twinbee, 0, ROT90, "Konami", "TwinBee", GAME_SUPPORTS_SAVE ) | |
| 2557 | GAME( 1985, gradius, nemesis, gx400, gradius, 0, ROT0, "Konami", "Gradius", GAME_SUPPORTS_SAVE ) | |
| 2558 | GAME( 1985, gwarrior, 0, gx400, gwarrior, 0, ROT0, "Konami", "Galactic Warriors", GAME_SUPPORTS_SAVE ) | |
| 2559 | GAME( 1986, salamand, 0, salamand, salamand, 0, ROT0, "Konami", "Salamander (version D)", GAME_SUPPORTS_SAVE ) | |
| 2560 | GAME( 1986, salamandj, salamand, salamand, salamand, 0, ROT0, "Konami", "Salamander (version J)", GAME_SUPPORTS_SAVE ) | |
| 2561 | GAME( 1986, lifefrce, salamand, salamand, salamand, 0, ROT0, "Konami", "Lifeforce (US)", GAME_SUPPORTS_SAVE ) | |
| 2562 | GAME( 1987, lifefrcej, salamand, salamand, lifefrcj, 0, ROT0, "Konami", "Lifeforce (Japan)", GAME_SUPPORTS_SAVE ) | |
| 2563 | GAME( 1987, blkpnthr, 0, blkpnthr, blkpnthr, 0, ROT0, "Konami", "Black Panther", GAME_SUPPORTS_SAVE ) | |
| 2564 | GAME( 1987, citybomb, 0, citybomb, citybomb, 0, ROT270, "Konami", "City Bomber (World)", GAME_SUPPORTS_SAVE ) | |
| 2565 | GAME( 1987, citybombj, citybomb, citybomb, citybomb, 0, ROT270, "Konami", "City Bomber (Japan)", GAME_SUPPORTS_SAVE ) | |
| 2566 | GAME( 1987, hcrash, 0, hcrash, hcrash, 0, ROT0, "Konami", "Hyper Crash (version D)", GAME_SUPPORTS_SAVE ) | |
| 2567 | GAME( 1987, hcrashc, hcrash, hcrash, hcrash, 0, ROT0, "Konami", "Hyper Crash (version C)", GAME_SUPPORTS_SAVE ) | |
| 2568 | GAME( 1988, kittenk, 0, nyanpani, nyanpani, 0, ROT0, "Konami", "Kitten Kaboodle", GAME_SUPPORTS_SAVE ) | |
| 2569 | GAME( 1988, nyanpani, kittenk, nyanpani, nyanpani, 0, ROT0, "Konami", "Nyan Nyan Panic (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 43 | 43 | #define MASTER_CLOCK XTAL_18MHz |
| 44 | 44 | |
| 45 | 45 | |
| 46 | typedef struct _ace_state ace_state; | |
| 47 | struct _ace_state | |
| 46 | class ace_state | |
| 48 | 47 | { |
| 48 | public: | |
| 49 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ace_state(machine)); } | |
| 50 | ||
| 51 | ace_state(running_machine &machine) { } | |
| 52 | ||
| 49 | 53 | /* video-related */ |
| 50 | 54 | UINT8 * ram2; |
| 51 | 55 | UINT8 * scoreram; |
| r7500 | r7501 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | #define MASTER_CLOCK 32000000 |
| 92 | 92 | |
| 93 | typedef struct _dreamwld_state dreamwld_state; | |
| 94 | struct _dreamwld_state | |
| 93 | class dreamwld_state | |
| 95 | 94 | { |
| 95 | public: | |
| 96 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dreamwld_state(machine)); } | |
| 97 | ||
| 98 | dreamwld_state(running_machine &machine) { } | |
| 99 | ||
| 96 | 100 | /* memory pointers */ |
| 97 | 101 | UINT32 * bg_videoram; |
| 98 | 102 | UINT32 * bg2_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 15 | 15 | #include "sound/dac.h" |
| 16 | 16 | #include "sound/flt_rc.h" |
| 17 | 17 | #include "includes/konamipt.h" |
| 18 | #include "includes/megazone.h" | |
| 18 | 19 | |
| 19 | extern UINT8 *megazone_scrollx; | |
| 20 | extern UINT8 *megazone_scrolly; | |
| 21 | 20 | |
| 22 | extern UINT8 *megazone_videoram; | |
| 23 | extern UINT8 *megazone_videoram2; | |
| 24 | extern UINT8 *megazone_colorram; | |
| 25 | extern UINT8 *megazone_colorram2; | |
| 26 | extern size_t megazone_videoram_size; | |
| 27 | extern size_t megazone_videoram2_size; | |
| 28 | ||
| 29 | static int i8039_status; | |
| 30 | ||
| 31 | VIDEO_START( megazone ); | |
| 32 | ||
| 33 | WRITE8_HANDLER( megazone_flipscreen_w ); | |
| 34 | PALETTE_INIT( megazone ); | |
| 35 | VIDEO_UPDATE( megazone ); | |
| 36 | ||
| 37 | ||
| 38 | ||
| 39 | static READ8_DEVICE_HANDLER( megazone_portA_r ) | |
| 21 | static READ8_DEVICE_HANDLER( megazone_port_a_r ) | |
| 40 | 22 | { |
| 41 | int clock,timer; | |
| 23 | megazone_state *state = (megazone_state *)device->machine->driver_data; | |
| 24 | int clock, timer; | |
| 42 | 25 | |
| 43 | 26 | |
| 44 | 27 | /* main xtal 14.318MHz, divided by 8 to get the AY-3-8910 clock, further */ |
| r7500 | r7501 | |
| 48 | 31 | /* (divide by (1024/2), and not 1024, because the CPU cycle counter is */ |
| 49 | 32 | /* incremented every other state change of the clock) */ |
| 50 | 33 | |
| 51 | clock = cpu | |
| 34 | clock = cpu | |
| 52 | 35 | timer = (clock / (1024/2)) & 0x0f; |
| 53 | 36 | |
| 54 | 37 | /* low three bits come from the 8039 */ |
| 55 | ||
| 56 | return (timer << 4) | i8039_status; | |
| 38 | return (timer << 4) | state->i8039_status; | |
| 57 | 39 | } |
| 58 | 40 | |
| 59 | static WRITE8_DEVICE_HANDLER( megazone_port | |
| 41 | static WRITE8_DEVICE_HANDLER( megazone_port_b_w ) | |
| 60 | 42 | { |
| 61 | 43 | static const char *const fltname[] = { "filter.0.0", "filter.0.1", "filter.0.2" }; |
| 62 | 44 | int i; |
| 63 | 45 | |
| 64 | ||
| 65 | for (i = 0;i < 3;i++) | |
| 46 | for (i = 0; i < 3; i++) | |
| 66 | 47 | { |
| 67 | int C; | |
| 48 | int C = 0; | |
| 49 | if (data & 1) | |
| 50 | C += 10000; /* 10000pF = 0.01uF */ | |
| 51 | if (data & 2) | |
| 52 | C += 220000; /* 220000pF = 0.22uF */ | |
| 68 | 53 | |
| 69 | ||
| 70 | C = 0; | |
| 71 | if (data & 1) C += 10000; /* 10000pF = 0.01uF */ | |
| 72 | if (data & 2) C += 220000; /* 220000pF = 0.22uF */ | |
| 73 | 54 | data >>= 2; |
| 74 | 55 | filter_rc_set_RC(devtag_get_device(device->machine, fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C)); |
| 75 | 56 | } |
| r7500 | r7501 | |
| 77 | 58 | |
| 78 | 59 | static WRITE8_HANDLER( megazone_i8039_irq_w ) |
| 79 | 60 | { |
| 80 | cputag_set_input_line(space->machine, "daccpu", 0, ASSERT_LINE); | |
| 61 | megazone_state *state = (megazone_state *)space->machine->driver_data; | |
| 62 | cpu_set_input_line(state->daccpu, 0, ASSERT_LINE); | |
| 81 | 63 | } |
| 82 | 64 | |
| 83 | 65 | static WRITE8_HANDLER( i8039_irqen_and_status_w ) |
| 84 | 66 | { |
| 67 | megazone_state *state = (megazone_state *)space->machine->driver_data; | |
| 68 | ||
| 85 | 69 | if ((data & 0x80) == 0) |
| 86 | cputag_set_input_line(space->machine, "daccpu", 0, CLEAR_LINE); | |
| 87 | i8039_status = (data & 0x70) >> 4; | |
| 70 | cpu_set_input_line(state->daccpu, 0, CLEAR_LINE); | |
| 71 | state->i8039_status = (data & 0x70) >> 4; | |
| 88 | 72 | } |
| 89 | 73 | |
| 90 | 74 | static WRITE8_HANDLER( megazone_coin_counter_w ) |
| 91 | 75 | { |
| 92 | coin_counter_w(space->machine, 1-offset,data); /* 1-offset, because coin counters are in reversed order */ | |
| 76 | coin_counter_w(space->machine, 1 - offset, data); /* 1-offset, because coin counters are in reversed order */ | |
| 93 | 77 | } |
| 94 | 78 | |
| 95 | 79 | |
| r7500 | r7501 | |
| 99 | 83 | AM_RANGE(0x0005, 0x0005) AM_WRITE(megazone_flipscreen_w) |
| 100 | 84 | AM_RANGE(0x0007, 0x0007) AM_WRITE(interrupt_enable_w) |
| 101 | 85 | AM_RANGE(0x0800, 0x0800) AM_WRITE(watchdog_reset_w) |
| 102 | AM_RANGE(0x1000, 0x1000) AM_WRITEONLY AM_BASE(&megazone_scrolly) | |
| 103 | AM_RANGE(0x1800, 0x1800) AM_WRITEONLY AM_BASE(&megazone_scrollx) | |
| 104 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(&megazone_videoram) AM_SIZE(&megazone_videoram_size) | |
| 105 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_BASE(&megazone_videoram2) AM_SIZE(&megazone_videoram2_size) | |
| 106 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE(&megazone_colorram) | |
| 107 | AM_RANGE(0x2c00, 0x2fff) AM_RAM AM_BASE(&megazone_colorram2) | |
| 108 | AM_RANGE(0x3000, 0x33ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 86 | AM_RANGE(0x1000, 0x1000) AM_WRITEONLY AM_BASE_MEMBER(megazone_state, scrolly) | |
| 87 | AM_RANGE(0x1800, 0x1800) AM_WRITEONLY AM_BASE_MEMBER(megazone_state, scrollx) | |
| 88 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE_SIZE_MEMBER(megazone_state, videoram, videoram_size) | |
| 89 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_BASE_SIZE_MEMBER(megazone_state, videoram2, videoram2_size) | |
| 90 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE_MEMBER(megazone_state, colorram) | |
| 91 | AM_RANGE(0x2c00, 0x2fff) AM_RAM AM_BASE_MEMBER(megazone_state, colorram2) | |
| 92 | AM_RANGE(0x3000, 0x33ff) AM_RAM AM_BASE_SIZE_MEMBER(megazone_state, spriteram, spriteram_size) | |
| 109 | 93 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("share1") |
| 110 | 94 | AM_RANGE(0x4000, 0xffff) AM_ROM /* 4000->5FFF is a debug rom */ |
| 111 | 95 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 232 | 216 | { |
| 233 | 217 | AY8910_LEGACY_OUTPUT, |
| 234 | 218 | AY8910_DEFAULT_LOADS, |
| 235 | DEVCB_HANDLER(megazone_port | |
| 219 | DEVCB_HANDLER(megazone_port_a_r), | |
| 236 | 220 | DEVCB_NULL, |
| 237 | 221 | DEVCB_NULL, |
| 238 | DEVCB_HANDLER(megazone_port | |
| 222 | DEVCB_HANDLER(megazone_port_b_w) | |
| 239 | 223 | }; |
| 240 | 224 | |
| 241 | 225 | |
| 242 | 226 | |
| 227 | static MACHINE_START( megazone ) | |
| 228 | { | |
| 229 | megazone_state *state = (megazone_state *)machine->driver_data; | |
| 230 | ||
| 231 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 232 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 233 | state->daccpu = devtag_get_device(machine, "daccpu"); | |
| 234 | ||
| 235 | state_save_register_global(machine, state->flipscreen); | |
| 236 | state_save_register_global(machine, state->i8039_status); | |
| 237 | } | |
| 238 | ||
| 239 | static MACHINE_RESET( megazone ) | |
| 240 | { | |
| 241 | megazone_state *state = (megazone_state *)machine->driver_data; | |
| 242 | ||
| 243 | state->flipscreen = 0; | |
| 244 | state->i8039_status = 0; | |
| 245 | } | |
| 246 | ||
| 243 | 247 | static MACHINE_DRIVER_START( megazone ) |
| 244 | 248 | |
| 249 | /* driver data */ | |
| 250 | MDRV_DRIVER_DATA(megazone_state) | |
| 251 | ||
| 245 | 252 | /* basic machine hardware */ |
| 246 | 253 | MDRV_CPU_ADD("maincpu", M6809, 18432000/9) /* 2 MHz */ |
| 247 | 254 | MDRV_CPU_PROGRAM_MAP(megazone_map) |
| r7500 | r7501 | |
| 257 | 264 | MDRV_CPU_IO_MAP(megazone_i8039_io_map) |
| 258 | 265 | |
| 259 | 266 | MDRV_QUANTUM_TIME(HZ(900)) |
| 267 | MDRV_MACHINE_START(megazone) | |
| 268 | MDRV_MACHINE_RESET(megazone) | |
| 260 | 269 | |
| 261 | 270 | /* video hardware */ |
| 262 | 271 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 519 | 528 | } |
| 520 | 529 | |
| 521 | 530 | /* these just display a Konami copyright, no logo */ |
| 522 | GAME( 1983, megazone, 0, megazone, megazone, megazone, ROT90, "Konami", "Mega Zone (Konami set 1)", 0 ) | |
| 523 | GAME( 1983, megazonea, megazone, megazone, megazona, megazone, ROT90, "Konami", "Mega Zone (Konami set 2)", 0 ) | |
| 531 | GAME( 1983, megazone, 0, megazone, megazone, megazone, ROT90, "Konami", "Mega Zone (Konami set 1)", GAME_SUPPORTS_SAVE ) | |
| 532 | GAME( 1983, megazonea, megazone, megazone, megazona, megazone, ROT90, "Konami", "Mega Zone (Konami set 2)", GAME_SUPPORTS_SAVE ) | |
| 524 | 533 | |
| 525 | 534 | /* these display Konami and Kosuka copyright, no logo */ |
| 526 | GAME( 1983, megazoneb, megazone, megazone, megazone, megazone, ROT90, "Konami / Kosuka", "Mega Zone (Kosuka set 1)", 0 ) | |
| 527 | GAME( 1983, megazonec, megazone, megazone, megazone, megazone, ROT90, "Konami / Kosuka", "Mega Zone (Kosuka set 2)", 0 ) | |
| 535 | GAME( 1983, megazoneb, megazone, megazone, megazone, megazone, ROT90, "Konami / Kosuka", "Mega Zone (Kosuka set 1)", GAME_SUPPORTS_SAVE ) | |
| 536 | GAME( 1983, megazonec, megazone, megazone, megazone, megazone, ROT90, "Konami / Kosuka", "Mega Zone (Kosuka set 2)", GAME_SUPPORTS_SAVE ) | |
| 528 | 537 | |
| 529 | 538 | /* this displays Konami and Kosuka copyright with a Konami / Interlogic logo */ |
| 530 | GAME( 1983, megazonei, megazone, megazone, megazone, megazone, ROT90, "Konami / Interlogic + Kosuka", "Mega Zone (Interlogic + Kosuka)", | |
| 539 | GAME( 1983, megazonei, megazone, megazone, megazone, megazone, ROT90, "Konami / Interlogic + Kosuka", "Mega Zone (Interlogic + Kosuka)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 881 | 881 | { |
| 882 | 882 | /* create the interrupt timer */ |
| 883 | 883 | cpu3_interrupt_timer = timer_alloc(machine, cpu3_interrupt_callback, NULL); |
| 884 | custom_mod = 0; | |
| 885 | state_save_register_global(machine, custom_mod); | |
| 884 | 886 | } |
| 885 | 887 | |
| 886 | 888 | static void bosco_latch_reset(running_machine *machine) |
| r7500 | r7501 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | static UINT8 macs_mux_data; |
| 66 | static UINT8 macs_rev; | |
| 67 | UINT8 macs_cart_slot; | |
| 66 | 68 | |
| 67 | 69 | static MACHINE_RESET(macs); |
| 68 | 70 | |
| 69 | 71 | |
| 70 | 72 | static ADDRESS_MAP_START( macs_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 71 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 73 | AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank4") | |
| 72 | 74 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 73 | 75 | AM_RANGE(0xc000, 0xcfff) AM_READ(st0016_sprite_ram_r) AM_WRITE(st0016_sprite_ram_w) |
| 74 | 76 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| r7500 | r7501 | |
| 118 | 120 | return 0xff; |
| 119 | 121 | } |
| 120 | 122 | |
| 123 | ||
| 124 | static WRITE8_HANDLER( macs_rom_bank_w ) | |
| 125 | { | |
| 126 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "maincpu") + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 ); | |
| 127 | ||
| 128 | st0016_rom_bank=data; | |
| 129 | } | |
| 130 | ||
| 121 | 131 | static WRITE8_HANDLER( macs_output_w ) |
| 122 | 132 | { |
| 133 | UINT8 *ROM = memory_region(space->machine, "maincpu"); | |
| 134 | ||
| 123 | 135 | switch(offset) |
| 124 | 136 | { |
| 125 | case 0: memory_set_bankptr(space->machine, "bank2", &macs_ram1[((data&0x20)>>5)*0x1000+0x800] );break; | |
| 137 | case 0: | |
| 138 | /* | |
| 139 | --x- ---- sets RAM bank? | |
| 140 | ---- -x-- Cassette B slot | |
| 141 | ---- --x- Cassette A slot | |
| 142 | */ | |
| 143 | ||
| 144 | if(macs_rev == 1) | |
| 145 | { | |
| 146 | /* FIXME: dunno if this RAM bank is right, DASM tracking made on the POST screens indicates that there's just one RAM bank, | |
| 147 | but then MACS2 games locks up. */ | |
| 148 | memory_set_bankptr(space->machine, "bank3", &macs_ram1[((data&0x20)>>5)*0x1000+0x000] ); | |
| 149 | ||
| 150 | macs_cart_slot = (data & 0xc) >> 2; | |
| 151 | ||
| 152 | memory_set_bankptr(space->machine, "bank4", &ROM[macs_cart_slot*0x400000+0x10000] ); | |
| 153 | } | |
| 154 | ||
| 155 | memory_set_bankptr(space->machine, "bank2", &macs_ram1[((data&0x20)>>5)*0x1000+0x800] ); | |
| 156 | break; | |
| 126 | 157 | case 2: macs_mux_data = data; break; |
| 127 | 158 | |
| 128 | 159 | } |
| r7500 | r7501 | |
| 133 | 164 | AM_RANGE(0x00, 0xbf) AM_READ(st0016_vregs_r) AM_WRITE(st0016_vregs_w) /* video/crt regs ? */ |
| 134 | 165 | AM_RANGE(0xc0, 0xc7) AM_READWRITE(macs_input_r,macs_output_w) |
| 135 | 166 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP /* renju = $40, neratte = 0 */ |
| 136 | AM_RANGE(0xe1, 0xe1) AM_WRITE(s | |
| 167 | AM_RANGE(0xe1, 0xe1) AM_WRITE(macs | |
| 137 | 168 | AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w) |
| 138 | 169 | AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w) |
| 139 | 170 | AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w) |
| r7500 | r7501 | |
| 297 | 328 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 298 | 329 | INPUT_PORTS_END |
| 299 | 330 | |
| 300 | static INPUT_PORTS_START( macs_m) | |
| 331 | static INPUT_PORTS_START( macs_m ) | |
| 301 | 332 | PORT_INCLUDE( macs_base ) |
| 302 | 333 | |
| 303 | 334 | /*MAHJONG PANEL*/ |
| r7500 | r7501 | |
| 344 | 375 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 345 | 376 | INPUT_PORTS_END |
| 346 | 377 | |
| 347 | static INPUT_PORTS_START( macs_h) | |
| 378 | static INPUT_PORTS_START( kisekaem ) | |
| 379 | PORT_INCLUDE( macs_m ) | |
| 380 | ||
| 381 | PORT_MODIFY("SYS1") | |
| 382 | PORT_DIPNAME( 0x01, 0x01, "SYS1 - BIT 1" ) | |
| 383 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 384 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 385 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 386 | PORT_DIPNAME( 0x04, 0x04, "BIT 4" ) | |
| 387 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 388 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 389 | PORT_DIPNAME( 0x08, 0x08, "BIT 8" ) | |
| 390 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 391 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 392 | PORT_DIPNAME( 0x10, 0x10, "BIT 10" ) | |
| 393 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 394 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 395 | PORT_DIPNAME( 0x20, 0x20, "BIT 20" ) | |
| 396 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 397 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 398 | PORT_DIPNAME( 0x40, 0x40, "BIT 40" ) | |
| 399 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 400 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 401 | PORT_DIPNAME( 0x80, 0x00, "BIT 80" ) | |
| 402 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 403 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 404 | INPUT_PORTS_END | |
| 405 | ||
| 406 | static INPUT_PORTS_START( macs_h ) | |
| 348 | 407 | PORT_INCLUDE( macs_base ) |
| 349 | 408 | |
| 350 | 409 | /*HANAFUDA PANEL*/ |
| r7500 | r7501 | |
| 475 | 534 | ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B |
| 476 | 535 | |
| 477 | 536 | ROM_REGION( 0x1000000, "maincpu", 0 ) |
| 478 | ROM_COPY( "user2", 0x00000, 0x010000, 0x400000 ) | |
| 479 | ROM_COPY( "user2", 0x00000, 0x000000, 0x0008000 ) | |
| 537 | ROM_COPY( "user1", 0x00000, 0x010000, 0x400000 ) | |
| 538 | ROM_COPY( "user1", 0x00000, 0x000000, 0x008000 ) | |
| 539 | ROM_COPY( "user2", 0x00000, 0x410000, 0x400000 ) | |
| 480 | 540 | ROM_END |
| 481 | 541 | |
| 482 | 542 | ROM_START( kisekaeh ) |
| r7500 | r7501 | |
| 492 | 552 | ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B |
| 493 | 553 | |
| 494 | 554 | ROM_REGION( 0x1000000, "maincpu", 0 ) |
| 495 | ROM_COPY( "user2", 0x00000, 0x010000, 0x400000 ) | |
| 496 | ROM_COPY( "user2", 0x00000, 0x000000, 0x0008000 ) | |
| 555 | ROM_COPY( "user1", 0x00000, 0x010000, 0x400000 ) | |
| 556 | ROM_COPY( "user1", 0x00000, 0x000000, 0x008000 ) | |
| 557 | ROM_COPY( "user2", 0x00000, 0x410000, 0x400000 ) | |
| 497 | 558 | ROM_END |
| 498 | 559 | |
| 499 | 560 | ROM_START( cultname ) // uses printer - two different games ? (slot a - checks for printer, slot b - not) |
| 500 | 561 | MACS_BIOS |
| 501 | 562 | |
| 502 | ROM_REGION( 0x400000, "user | |
| 563 | ROM_REGION( 0x400000, "user2", 0 ) // Slot A | |
| 503 | 564 | ROM_LOAD16_BYTE( "cult-d0.u8", 0x000000, 0x100000, CRC(394bc1a6) SHA1(98df5406862234815b46c7b0ac0b19e4b597d1b6) ) |
| 504 | 565 | ROM_LOAD16_BYTE( "cult-d1.u7", 0x000001, 0x100000, CRC(f628133b) SHA1(f06e20212074e5d95cc7d419ac8ce98fb9be3b62) ) |
| 505 | 566 | ROM_LOAD16_BYTE( "cult-d2.u6", 0x200000, 0x100000, CRC(c5521bc6) SHA1(7554b56b0201b7d81754defa2244fb7ff7452bf6) ) |
| 506 | 567 | ROM_LOAD16_BYTE( "cult-d3.u5", 0x200001, 0x100000, CRC(4325b09b) SHA1(45699a0444a221f893724754c917d33041cabcb9) ) |
| 507 | 568 | |
| 508 | 569 | |
| 509 | ROM_REGION( 0x400000, "user | |
| 570 | ROM_REGION( 0x400000, "user3", 0 ) // Slot B | |
| 510 | 571 | ROM_LOAD16_BYTE( "cult-g0.u8", 0x000000, 0x100000, CRC(f5ab977b) SHA1(e7ee758cc2864500b339e236b944f98df9a1c10e) ) |
| 511 | 572 | ROM_LOAD16_BYTE( "cult-g1.u7", 0x000001, 0x100000, CRC(32ae15a4) SHA1(061992efec1ed5527f200bf4c111344b156e759d) ) |
| 512 | 573 | ROM_LOAD16_BYTE( "cult-g2.u6", 0x200000, 0x100000, CRC(30ed056d) SHA1(71735339bb501b94402ef403b5a2a60effa39c36) ) |
| r7500 | r7501 | |
| 514 | 575 | |
| 515 | 576 | |
| 516 | 577 | ROM_REGION( 0x1000000, "maincpu", 0 ) |
| 517 | ROM_COPY( "user2", 0x00000, 0x010000, 0x400000 ) | |
| 518 | ROM_COPY( "user2", 0x00000, 0x000000, 0x0008000 ) | |
| 578 | ROM_COPY( "user1", 0x00000, 0x010000, 0x400000 ) | |
| 579 | ROM_COPY( "user1", 0x00000, 0x000000, 0x008000 ) | |
| 580 | ROM_COPY( "user2", 0x00000, 0x410000, 0x400000 ) | |
| 581 | ROM_COPY( "user3", 0x00000, 0x810000, 0x400000 ) | |
| 519 | 582 | ROM_END |
| 520 | 583 | |
| 521 | 584 | /* these are listed as MACS2 sub-boards, is it the same? - it's not ;) */ |
| r7500 | r7501 | |
| 569 | 632 | |
| 570 | 633 | static MACHINE_RESET(macs) |
| 571 | 634 | { |
| 635 | #if 0 | |
| 572 | 636 | /* |
| 573 | 637 | BIOS ram init: |
| 574 | 638 | |
| r7500 | r7501 | |
| 635 | 699 | |
| 636 | 700 | macs_ram1[0x0ff9]=0x07; |
| 637 | 701 | macs_ram1[0x1ff9]=0x07; |
| 702 | #endif | |
| 638 | 703 | |
| 639 | 704 | memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + 0x10000 ); |
| 640 | 705 | memory_set_bankptr(machine, "bank2", macs_ram1+0x800); |
| 641 | 706 | memory_set_bankptr(machine, "bank3", macs_ram1+0x10000); |
| 707 | memory_set_bankptr(machine, "bank4", memory_region(machine, "maincpu") ); | |
| 642 | 708 | } |
| 643 | 709 | |
| 644 | 710 | static DRIVER_INIT(macs) |
| 645 | 711 | { |
| 646 | 712 | macs_ram1=auto_alloc_array(machine, UINT8, 0x20000); |
| 647 | 713 | st0016_game=10|0x80; |
| 714 | macs_rev = 1; | |
| 648 | 715 | } |
| 649 | 716 | |
| 717 | static DRIVER_INIT(macs2) | |
| 718 | { | |
| 719 | macs_ram1=auto_alloc_array(machine, UINT8, 0x20000); | |
| 720 | st0016_game=10|0x80; | |
| 721 | macs_rev = 2; | |
| 722 | } | |
| 723 | ||
| 650 | 724 | static DRIVER_INIT(kisekaeh) |
| 651 | 725 | { |
| 652 | 726 | macs_ram1=auto_alloc_array(machine, UINT8, 0x20000); |
| 653 | 727 | st0016_game=11|0x180; |
| 728 | macs_rev = 1; | |
| 654 | 729 | } |
| 655 | 730 | |
| 656 | 731 | static DRIVER_INIT(kisekaem) |
| 657 | 732 | { |
| 658 | 733 | macs_ram1=auto_alloc_array(machine, UINT8, 0x20000); |
| 659 | 734 | st0016_game=10|0x180; |
| 735 | macs_rev = 1; | |
| 660 | 736 | } |
| 661 | 737 | |
| 662 | 738 | |
| 663 | 739 | GAME( 1995, macsbios, 0, macs, macs_m, macs, ROT0, "I'Max", "Multi Amenity Cassette System BIOS", GAME_IS_BIOS_ROOT | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) |
| 664 | GAME( 1995, mac2bios, 0, macs, macs_m, macs, ROT0, "I'Max", "Multi Amenity Cassette System 2 BIOS", GAME_IS_BIOS_ROOT | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 740 | GAME( 1995, mac2bios, 0, macs, macs_m, macs2, ROT0, "I'Max", "Multi Amenity Cassette System 2 BIOS", GAME_IS_BIOS_ROOT | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 665 | 741 | |
| 666 | GAME( 1995, kisekaem, macsbios, macs, macs_m, kisekaem, ROT0, "I'Max", "Kisekae Mahjong", GAME_NOT_WORKING|GAME_IMPERFECT_SOUND ) | |
| 667 | GAME( 1995, kisekaeh, macsbios, macs, macs_h, kisekaeh, ROT0, "I'Max", "Kisekae Hanafuda", GAME_NOT_WORKING |GAME_IMPERFECT_SOUND) | |
| 668 | GAME( 1996, cultname, macsbios, macs, macs_m, macs, ROT0, "I'Max", "Seimei-Kantei-Meimei-Ki Cult Name", GAME_NOT_WORKING |GAME_IMPERFECT_SOUND) | |
| 669 | GAME( 1999, yuka, macsbios, macs, macs_h, macs, ROT0, "Yubis / T.System", "Yu-Ka", 0 ) | |
| 670 | GAME( 1999, yujan, macsbios, macs, macs_m, macs, ROT0, "Yubis / T.System", "Yu-Jan", 0 ) | |
| 742 | GAME( 1995, kisekaem, macsbios, macs, kisekaem, kisekaem, ROT0, "I'Max", "Kisekae Mahjong", GAME_NOT_WORKING|GAME_IMPERFECT_SOUND ) | |
| 743 | GAME( 1995, kisekaeh, macsbios, macs, macs_h, kisekaeh, ROT0, "I'Max", "Kisekae Hanafuda", GAME_NOT_WORKING |GAME_IMPERFECT_SOUND) | |
| 744 | GAME( 1996, cultname, macsbios, macs, macs_m, macs, ROT0, "I'Max", "Seimei-Kantei-Meimei-Ki Cult Name", GAME_NOT_WORKING |GAME_IMPERFECT_SOUND) | |
| 745 | GAME( 1999, yuka, macsbios, macs, macs_h, macs2, ROT0, "Yubis / T.System", "Yu-Ka", 0 ) | |
| 746 | GAME( 1999, yujan, macsbios, macs, macs_m, macs2, ROT0, "Yubis / T.System", "Yu-Jan", 0 ) |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #include "sound/ay8910.h" |
| 46 | 46 | |
| 47 | 47 | |
| 48 | typedef struct _sbowling_state sbowling_state; | |
| 49 | struct _sbowling_state | |
| 48 | class sbowling_state | |
| 50 | 49 | { |
| 50 | public: | |
| 51 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, sbowling_state(machine)); } | |
| 52 | ||
| 53 | sbowling_state(running_machine &machine) { } | |
| 54 | ||
| 51 | 55 | int bgmap; |
| 52 | 56 | UINT8 *videoram; |
| 53 | 57 |
| r7500 | r7501 | |
|---|---|---|
| 35 | 35 | #include "sound/okim6295.h" |
| 36 | 36 | |
| 37 | 37 | |
| 38 | typedef struct _good_state good_state; | |
| 39 | struct _good_state | |
| 38 | class good_state | |
| 40 | 39 | { |
| 40 | public: | |
| 41 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, good_state(machine)); } | |
| 42 | ||
| 43 | good_state(running_machine &machine) { } | |
| 44 | ||
| 41 | 45 | /* memory pointers */ |
| 42 | 46 | UINT16 * bg_tilemapram; |
| 43 | 47 | UINT16 * fg_tilemapram; |
| r7500 | r7501 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | /*******************************************************/ |
| 185 | 185 | /* */ |
| 186 | /* Alien Invasion */ | |
| 187 | /* */ | |
| 188 | /*******************************************************/ | |
| 189 | ||
| 190 | static INPUT_PORTS_START( alieninv ) | |
| 191 | PORT_START("IN0") | |
| 192 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 193 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 194 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 195 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 196 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 197 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 198 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 199 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 200 | ||
| 201 | PORT_START("IN1") | |
| 202 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 203 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 204 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 205 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 206 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 207 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 208 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 209 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 210 | ||
| 211 | PORT_START("IN2") | |
| 212 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1") | |
| 213 | PORT_DIPSETTING( 0x00, "2" ) | |
| 214 | PORT_DIPSETTING( 0x01, "3" ) | |
| 215 | PORT_DIPNAME( 0x02, 0x02, "Pence Coinage" ) PORT_DIPLOCATION("SW1:2") | |
| 216 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 217 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 218 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_DIPLOCATION("SW1:3") /* Pence Coin */ | |
| 219 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) /* Not bonus */ | |
| 220 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_DIPLOCATION("SW1:5") | |
| 221 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) PORT_DIPLOCATION("SW1:6") | |
| 222 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) PORT_DIPLOCATION("SW1:7") | |
| 223 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8") | |
| 224 | PORT_DIPSETTING( 0x00, "2C/1C 50p/3C (+ Bonus Life)" ) | |
| 225 | PORT_DIPSETTING( 0x80, "1C/1C 50p/5C" ) | |
| 226 | ||
| 227 | /* Dummy port for cocktail mode */ | |
| 228 | INVADERS_CAB_TYPE_PORT | |
| 229 | INPUT_PORTS_END | |
| 230 | ||
| 231 | /*******************************************************/ | |
| 232 | /* */ | |
| 186 | 233 | /* Space Invaders Model Racing */ |
| 187 | 234 | /* */ |
| 188 | 235 | /*******************************************************/ |
| r7500 | r7501 | |
| 2038 | 2085 | |
| 2039 | 2086 | ROM_START( tst_invd ) |
| 2040 | 2087 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2041 | ROM_LOAD( "test.h", 0x0000, 0x0800, CRC(f86a2eea) SHA1(4a72ff01f3e6d16bbe9bf7f123cd98895bfbed9a) ) /* The Test ROM */ | |
| 2088 | ROM_LOAD( "test.h", 0x0000, 0x0800, CRC(f86a2eea) SHA1(4a72ff01f3e6d16bbe9bf7f123cd98895bfbed9a) ) /* The Test ROM */ | |
| 2042 | 2089 | ROM_LOAD( "invaders.g", 0x0800, 0x0800, CRC(6bfaca4a) SHA1(16f48649b531bdef8c2d1446c429b5f414524350) ) |
| 2043 | 2090 | ROM_LOAD( "invaders.f", 0x1000, 0x0800, CRC(0ccead96) SHA1(537aef03468f63c5b9e11dd61e253f7ae17d9743) ) |
| 2044 | 2091 | ROM_LOAD( "invaders.e", 0x1800, 0x0800, CRC(14e538b0) SHA1(1d6ca0c99f9df71e2990b610deb9d7da0125e2d8) ) |
| r7500 | r7501 | |
| 2046 | 2093 | |
| 2047 | 2094 | ROM_START( alieninv ) |
| 2048 | 2095 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2096 | ROM_LOAD( "alieninv.h", 0x0000, 0x0800, CRC(6ad601c3) SHA1(9fc88698f98ce43992a5044d28d3e19751f82772) ) | |
| 2097 | ROM_LOAD( "alieninv.g", 0x0800, 0x0800, CRC(c6bb6fb3) SHA1(01a12163309f967dcffce19890b1e0d079021fc2) ) | |
| 2098 | ROM_LOAD( "alieninv.f", 0x1000, 0x0800, CRC(1d2ff324) SHA1(209766a981fdd3a68e36da3d8122a244c883cae7) ) | |
| 2099 | ROM_LOAD( "alieninv.e", 0x1800, 0x0800, CRC(2f2e6791) SHA1(08a1f17bcfec598182386f1c43e4fc7b476212de) ) | |
| 2100 | ROM_END | |
| 2101 | ||
| 2102 | ROM_START( alieninvp2 ) | |
| 2103 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2049 | 2104 | ROM_LOAD( "1h.bin", 0x0000, 0x0800, CRC(c46df7f4) SHA1(eec34b3d5585bae03c7b80585daaa05ddfcc2164) ) |
| 2050 | 2105 | ROM_LOAD( "1g.bin", 0x0800, 0x0800, CRC(4b1112d6) SHA1(b693667656e5d8f44eeb2ea730f4d4db436da579) ) |
| 2051 | 2106 | ROM_LOAD( "1f.bin", 0x1000, 0x0800, CRC(adca18a5) SHA1(7e02651692113db31fd469868ae5ffdb0f941ecf) ) |
| r7500 | r7501 | |
| 2882 | 2937 | GAMEL(19??, sinvzen, invaders, invaders, spaceatt, 0, ROT270, "Zenitone-Microsec Ltd", "Super Invaders (Zenitone-Microsec)", GAME_SUPPORTS_SAVE, layout_invaders ) |
| 2883 | 2938 | GAMEL(19??, sinvemag, invaders, invaders, sinvemag, 0, ROT270, "bootleg", "Super Invaders (EMAG)", GAME_SUPPORTS_SAVE, layout_invaders ) |
| 2884 | 2939 | GAMEL(19??, tst_invd, invaders, invaders, sicv, 0, ROT0, "Test ROM", "Space Invaders Test ROM", GAME_SUPPORTS_SAVE, layout_invaders ) |
| 2885 | GAMEL(19??, alieninv, invaders, invaders, searthin, 0, ROT270, "bootleg", "Alien Invasion Part II", GAME_SUPPORTS_SAVE, layout_invaders ) | |
| 2940 | GAMEL(19??, alieninv, invaders, invaders, alieninv, 0, ROT270, "Margamatics", "Alien Invasion", GAME_SUPPORTS_SAVE, layout_invaders ) | |
| 2941 | GAMEL(19??, alieninvp2,invaders, invaders, searthin, 0, ROT270, "bootleg", "Alien Invasion Part II", GAME_SUPPORTS_SAVE, layout_invaders ) | |
| 2886 | 2942 | GAMEL(1978, spceking, invaders, invaders, sicv, 0, ROT270, "Leijac Corporation (Konami)","Space King", GAME_SUPPORTS_SAVE, layout_invaders ) |
| 2887 | 2943 | GAMEL(1978, spcewars, invaders, spcewars, spcewars, 0, ROT270, "Sanritsu", "Space War (Sanritsu)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_invaders ) |
| 2888 | 2944 | GAME (19??, astropal, 0, astropal, astropal, 0, ROT0, "Sidam?", "Astropal", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 586 | 586 | PORT_INCLUDE( othundrj ) |
| 587 | 587 | |
| 588 | 588 | PORT_MODIFY( "DSWB" ) |
| 589 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Continue_Price ) ) /* see notes */ | |
| 590 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 591 | PORT_DIPSETTING( 0x40, "Same as Start" ) | |
| 589 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Continue_Price ) ) /* see notes */ | |
| 590 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 591 | PORT_DIPSETTING( 0x40, "Same as Start" ) | |
| 592 | 592 | INPUT_PORTS_END |
| 593 | 593 | |
| 594 | 594 | |
| r7500 | r7501 | |
| 945 | 945 | |
| 946 | 946 | |
| 947 | 947 | |
| 948 | GAME( 1988, othunder, 0, othunder, othunder, 0, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Operation Thunderbolt (World)", 0 ) | |
| 949 | GAME( 1988, othunderu, othunder, othunder, othundu, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US)", 0 ) | |
| 950 | GAME( 1988, othunderuo, othunder, othunder, othundu, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US, older)", 0 ) | |
| 951 | GAME( 1988, othunderj, othunder, othunder, othundrj, 0, ORIENTATION_FLIP_X, "Taito Corporation", "Operation Thunderbolt (Japan)", 0 ) | |
| 948 | GAME( 1988, othunder, 0, othunder, othunder, 0, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Operation Thunderbolt (World)", GAME_SUPPORTS_SAVE ) | |
| 949 | GAME( 1988, othunderu, othunder, othunder, othundu, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US)", GAME_SUPPORTS_SAVE ) | |
| 950 | GAME( 1988, othunderuo, othunder, othunder, othundu, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US, older)", GAME_SUPPORTS_SAVE ) | |
| 951 | GAME( 1988, othunderj, othunder, othunder, othundrj, 0, ORIENTATION_FLIP_X, "Taito Corporation", "Operation Thunderbolt (Japan)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 36 | 36 | #include "cpu/m68000/m68000.h" |
| 37 | 37 | #include "includes/decocrpt.h" |
| 38 | 38 | #include "includes/decoprot.h" |
| 39 | #include "i | |
| 39 | #include "vi | |
| 40 | 40 | #include "sound/okim6295.h" |
| 41 | 41 | |
| 42 | ||
| 42 | ||
| 43 | 43 | { |
| 44 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 44 | public: | |
| 45 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mirage_state(machine)); } | |
| 46 | ||
| 47 | mirage_state(running_machine &machine) { } | |
| 48 | ||
| 49 | /* memory pointers */ | |
| 50 | UINT16 * pf1_rowscroll; | |
| 51 | UINT16 * pf2_rowscroll; | |
| 52 | UINT16 * spriteram; | |
| 53 | // UINT16 * paletteram; // currently this uses generic palette handling (in deco16ic.c) | |
| 54 | size_t spriteram_size; | |
| 55 | ||
| 56 | /* misc */ | |
| 57 | UINT32 mux_data; | |
| 58 | ||
| 59 | /* devices */ | |
| 60 | running_device *maincpu; | |
| 61 | running_device *audiocpu; | |
| 62 | running_device *deco16ic; | |
| 63 | running_device *oki_sfx; | |
| 64 | running_device *oki_bgm; | |
| 65 | }; | |
| 66 | ||
| 67 | ||
| 68 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri ) | |
| 69 | { | |
| 70 | mirage_state *state = (mirage_state *)machine->driver_data; | |
| 71 | UINT16 *spriteram = state->spriteram; | |
| 45 | 72 | int offs; |
| 46 | 73 | |
| 47 | for (offs = 0;offs < 0x400;offs += 4) | |
| 74 | for (offs = 0; offs < 0x400; offs += 4) | |
| 48 | 75 | { |
| 49 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; | |
| 76 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 50 | 77 | |
| 51 | sprite = spriteram16[offs+1]; | |
| 52 | if (!sprite) continue; | |
| 78 | sprite = spriteram[offs + 1]; | |
| 79 | if (!sprite) | |
| 80 | continue; | |
| 53 | 81 | |
| 54 | y = spriteram16[offs]; | |
| 55 | flash=y&0x1000; | |
| 82 | y = spriteram[offs]; | |
| 83 | flash = y & 0x1000; | |
| 56 | 84 | |
| 57 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue; | |
| 85 | if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) | |
| 86 | continue; | |
| 58 | 87 | |
| 59 | if (pri != ((y & 0x8000)>>15)) continue; | |
| 88 | if (pri != ((y & 0x8000) >> 15)) | |
| 89 | continue; | |
| 60 | 90 | |
| 61 | x = spriteram16[offs+2]; | |
| 62 | colour = (x >>9) & 0x1f; | |
| 91 | x = spriteram[offs + 2]; | |
| 92 | colour = (x >> 9) & 0x1f; | |
| 63 | 93 | |
| 64 | 94 | fx = y & 0x2000; |
| 65 | 95 | fy = y & 0x4000; |
| r7500 | r7501 | |
| 71 | 101 | if (x >= 320) x -= 512; |
| 72 | 102 | if (y >= 256) y -= 512; |
| 73 | 103 | y = 240 - y; |
| 74 | ||
| 104 | | |
| 75 | 105 | |
| 76 | if (x>320) continue; | |
| 106 | if (x > 320) | |
| 107 | continue; | |
| 77 | 108 | |
| 78 | 109 | sprite &= ~multi; |
| 79 | 110 | if (fy) |
| r7500 | r7501 | |
| 86 | 117 | |
| 87 | 118 | if (flip_screen_get(machine)) |
| 88 | 119 | { |
| 89 | y=240-y; | |
| 90 | x=304-x; | |
| 91 | if (fx) fx=0; else fx=1; | |
| 92 | if (fy) fy=0; else fy=1; | |
| 93 | mult=16; | |
| 120 | y =240 - y; | |
| 121 | x =304 - x; | |
| 122 | if (fx) fx = 0; else fx = 1; | |
| 123 | if (fy) fy = 0; else fy = 1; | |
| 124 | mult = 16; | |
| 94 | 125 | } |
| 95 | else mult=-16; | |
| 126 | else mult = -16; | |
| 96 | 127 | |
| 97 | 128 | while (multi >= 0) |
| 98 | 129 | { |
| r7500 | r7501 | |
| 107 | 138 | } |
| 108 | 139 | } |
| 109 | 140 | |
| 110 | static | |
| 141 | static VIDEO_UPDATE( mirage | |
| 111 | 142 | { |
| 112 | return ((bank>>4)&0x7) * 0x1000; | |
| 113 | } | |
| 143 | mirage_state *state = (mirage_state *)screen->machine->driver_data; | |
| 144 | UINT16 flip = deco16ic_pf12_control_r(state->deco16ic, 0, 0xffff); | |
| 114 | 145 | |
| 115 | static VIDEO_START(mirage) | |
| 116 | { | |
| 117 | deco16_1_video_init(machine); | |
| 146 | flip_screen_set(screen->machine, BIT(flip, 7)); | |
| 147 | deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll); | |
| 118 | 148 | |
| 119 | deco16_set_tilemap_bank_callback(0, mirage_bank_callback); | |
| 120 | deco16_set_tilemap_bank_callback(1, mirage_bank_callback); | |
| 121 | } | |
| 149 | bitmap_fill(bitmap, cliprect, 256); /* not verified */ | |
| 122 | 150 | |
| 123 | static VIDEO_UPDATE(mirage) | |
| 124 | { | |
| 125 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 126 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); | |
| 151 | deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); | |
| 152 | draw_sprites(screen->machine, bitmap, cliprect, 1); | |
| 153 | deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); | |
| 154 | draw_sprites(screen->machine, bitmap, cliprect, 0); | |
| 127 | 155 | |
| 128 | bitmap_fill(bitmap,cliprect,256); /* not verified */ | |
| 129 | ||
| 130 | deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); | |
| 131 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 132 | deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0); | |
| 133 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 134 | ||
| 135 | 156 | return 0; |
| 136 | 157 | } |
| 137 | 158 | |
| 138 | static UINT32 mux_data; | |
| 139 | 159 | |
| 140 | 160 | static WRITE16_HANDLER( mirage_mux_w ) |
| 141 | 161 | { |
| 142 | mux_data = data & 0x1f; | |
| 162 | mirage_state *state = (mirage_state *)space->machine->driver_data; | |
| 163 | state->mux_data = data & 0x1f; | |
| 143 | 164 | } |
| 144 | 165 | |
| 145 | 166 | static READ16_HANDLER( mirage_input_r ) |
| 146 | 167 | { |
| 147 | switch(mux_data & 0x1f) | |
| 168 | mirage_state *state = (mirage_state *)space->machine->driver_data; | |
| 169 | switch (state->mux_data & 0x1f) | |
| 148 | 170 | { |
| 149 | 171 | case 0x01: return input_port_read(space->machine, "KEY0"); |
| 150 | 172 | case 0x02: return input_port_read(space->machine, "KEY1"); |
| r7500 | r7501 | |
| 158 | 180 | |
| 159 | 181 | static WRITE16_HANDLER( okim1_rombank_w ) |
| 160 | 182 | { |
| 161 | okim6295_set_bank_base(devtag_get_device(space->machine, "oki_sfx"), 0x40000 * (data & 0x3)); | |
| 183 | mirage_state *state = (mirage_state *)space->machine->driver_data; | |
| 184 | okim6295_set_bank_base(state->oki_sfx, 0x40000 * (data & 0x3)); | |
| 162 | 185 | } |
| 163 | 186 | |
| 164 | 187 | static WRITE16_HANDLER( okim0_rombank_w ) |
| 165 | 188 | { |
| 189 | mirage_state *state = (mirage_state *)space->machine->driver_data; | |
| 190 | ||
| 166 | 191 | /*bits 4-6 used on POST? */ |
| 167 | ||
| 168 | okim6295_set_bank_base(devtag_get_device(space->machine, "oki_bgm"), 0x40000 * (data & 0x7)); | |
| 192 | okim6295_set_bank_base(state->oki_bgm, 0x40000 * (data & 0x7)); | |
| 169 | 193 | } |
| 170 | 194 | |
| 171 | 195 | static ADDRESS_MAP_START( mirage_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 172 | 196 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 173 | 197 | /* tilemaps */ |
| 174 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) // 0x100000 - 0x101fff tested | |
| 175 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) // 0x102000 - 0x102fff tested | |
| 198 | AM_RANGE(0x100000, 0x101fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) // 0x100000 - 0x101fff tested | |
| 199 | AM_RANGE(0x102000, 0x103fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) // 0x102000 - 0x102fff tested | |
| 176 | 200 | /* linescroll */ |
| 177 | AM_RANGE(0x110000, 0x110bff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 178 | AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 179 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_GENERIC(spriteram) | |
| 201 | AM_RANGE(0x110000, 0x110bff) AM_RAM AM_BASE_MEMBER(mirage_state, pf1_rowscroll) | |
| 202 | AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE_MEMBER(mirage_state, pf2_rowscroll) | |
| 203 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(mirage_state, spriteram, spriteram_size) | |
| 180 | 204 | AM_RANGE(0x130000, 0x1307ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 181 | 205 | AM_RANGE(0x140000, 0x14000f) AM_DEVREADWRITE8("oki_sfx", okim6295_r, okim6295_w, 0x00ff) |
| 182 | 206 | AM_RANGE(0x150000, 0x15000f) AM_DEVREADWRITE8("oki_bgm", okim6295_r, okim6295_w, 0x00ff) |
| 183 | 207 | // AM_RANGE(0x140006, 0x140007) AM_READ(random_readers) |
| 184 | 208 | // AM_RANGE(0x150006, 0x150007) AM_READNOP |
| 185 | 209 | AM_RANGE(0x160000, 0x160001) AM_WRITENOP |
| 186 | AM_RANGE(0x168000, 0x16800f) AM_WRITE | |
| 210 | AM_RANGE(0x168000, 0x16800f) AM_DEVWRITE | |
| 187 | 211 | AM_RANGE(0x16a000, 0x16a001) AM_WRITENOP |
| 188 | 212 | AM_RANGE(0x16c000, 0x16c001) AM_WRITE(okim1_rombank_w) |
| 189 | 213 | AM_RANGE(0x16c002, 0x16c003) AM_WRITE(okim0_rombank_w) |
| r7500 | r7501 | |
| 203 | 227 | PORT_SERVICE( 0x0008, IP_ACTIVE_LOW ) |
| 204 | 228 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 205 | 229 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) ) |
| 206 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 207 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 208 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) | |
| 209 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 210 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) | |
| 211 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 212 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 213 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 214 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) | |
| 215 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 216 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 217 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) | |
| 218 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 219 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 220 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) | |
| 221 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 222 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 223 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) | |
| 224 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 225 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 226 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) | |
| 227 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 228 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 229 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) | |
| 230 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 231 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 232 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) | |
| 233 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 234 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 235 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) | |
| 236 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 237 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 230 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 231 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 232 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) | |
| 233 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 234 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) | |
| 235 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 236 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 237 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 238 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) | |
| 239 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 240 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 241 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) | |
| 242 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 243 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 244 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) | |
| 245 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 246 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 247 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) | |
| 248 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 249 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 250 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) | |
| 251 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 252 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 253 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) | |
| 254 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 255 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 256 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) | |
| 257 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 258 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 259 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) | |
| 260 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 261 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 238 | 262 | |
| 239 | 263 | PORT_START("KEY0") |
| 240 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 241 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 242 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 243 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 244 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 245 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) | |
| 246 | PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 264 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 265 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 266 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 267 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 268 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 269 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) | |
| 270 | PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 247 | 271 | |
| 248 | 272 | PORT_START("KEY1") |
| 249 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 250 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 251 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 252 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 253 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 254 | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 273 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 274 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 275 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 276 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 277 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 278 | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 255 | 279 | |
| 256 | 280 | PORT_START("KEY2") |
| 257 | 281 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) |
| 258 | ||
| 282 | | |
| 259 | 283 | |
| 260 | 284 | PORT_START("KEY3") |
| 261 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 262 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 263 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 264 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 285 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 286 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 287 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 288 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 265 | 289 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) |
| 266 | ||
| 290 | | |
| 267 | 291 | |
| 268 | 292 | PORT_START("KEY4") |
| 269 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 270 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 271 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 272 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 273 | PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 293 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 294 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 295 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 296 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 297 | PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 274 | 298 | INPUT_PORTS_END |
| 275 | 299 | |
| 276 | 300 | |
| r7500 | r7501 | |
| 315 | 339 | GFXDECODE_END |
| 316 | 340 | |
| 317 | 341 | |
| 342 | static int mirage_bank_callback( const int bank ) | |
| 343 | { | |
| 344 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 345 | } | |
| 318 | 346 | |
| 347 | static const deco16ic_interface mirage_deco16ic_intf = | |
| 348 | { | |
| 349 | "screen", | |
| 350 | 1, 0, 1, | |
| 351 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 352 | 0, 16, 0, 16, /* color base (default values) */ | |
| 353 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 354 | mirage_bank_callback, | |
| 355 | mirage_bank_callback, | |
| 356 | NULL, | |
| 357 | NULL | |
| 358 | }; | |
| 359 | ||
| 360 | ||
| 361 | static MACHINE_START( mirage ) | |
| 362 | { | |
| 363 | mirage_state *state = (mirage_state *)machine->driver_data; | |
| 364 | ||
| 365 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 366 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 367 | state->oki_sfx = devtag_get_device(machine, "oki_sfx"); | |
| 368 | state->oki_bgm = devtag_get_device(machine, "oki_bgm"); | |
| 369 | ||
| 370 | state_save_register_global(machine, state->mux_data); | |
| 371 | } | |
| 372 | ||
| 373 | static MACHINE_RESET( mirage ) | |
| 374 | { | |
| 375 | mirage_state *state = (mirage_state *)machine->driver_data; | |
| 376 | ||
| 377 | state->mux_data = 0; | |
| 378 | } | |
| 379 | ||
| 319 | 380 | static MACHINE_DRIVER_START( mirage ) |
| 320 | 381 | |
| 382 | /* driver data */ | |
| 383 | MDRV_DRIVER_DATA(mirage_state) | |
| 384 | ||
| 321 | 385 | /* basic machine hardware */ |
| 322 | 386 | MDRV_CPU_ADD("maincpu", M68000, 28000000/2) |
| 323 | 387 | MDRV_CPU_PROGRAM_MAP(mirage_map) |
| 324 | 388 | MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 325 | 389 | |
| 390 | MDRV_MACHINE_START(mirage) | |
| 391 | MDRV_MACHINE_RESET(mirage) | |
| 392 | ||
| 326 | 393 | /* video hardware */ |
| 327 | 394 | MDRV_SCREEN_ADD("screen", RASTER) |
| 328 | 395 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 334 | 401 | MDRV_GFXDECODE(mirage) |
| 335 | 402 | MDRV_PALETTE_LENGTH(1024) |
| 336 | 403 | |
| 337 | MDRV_VIDEO_START(mirage) | |
| 338 | 404 | MDRV_VIDEO_UPDATE(mirage) |
| 339 | 405 | |
| 406 | MDRV_DECO16IC_ADD("deco_custom", mirage_deco16ic_intf) | |
| 407 | ||
| 340 | 408 | /* sound hardware */ |
| 341 | 409 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 342 | 410 | |
| r7500 | r7501 | |
| 380 | 448 | deco56_decrypt_gfx(machine, "gfx1"); |
| 381 | 449 | } |
| 382 | 450 | |
| 383 | GAME( 1994, mirage, 0, | |
| 451 | GAME( 1994, mirage, 0, |
| r7500 | r7501 | |
|---|---|---|
| 46 | 46 | #include "sound/2151intf.h" |
| 47 | 47 | #include "sound/3812intf.h" |
| 48 | 48 | #include "sound/okim6295.h" |
| 49 | #include "includes/deco16ic.h" | |
| 49 | #include "includes/tumblep.h" | |
| 50 | #include "video/deco16ic.h" | |
| 50 | 51 | |
| 51 | 52 | #define TUMBLEP_HACK 0 |
| 52 | 53 | |
| 53 | VIDEO_START( tumblep ); | |
| 54 | VIDEO_UPDATE( tumblep ); | |
| 55 | ||
| 56 | 54 | /******************************************************************************/ |
| 57 | 55 | |
| 58 | 56 | #ifdef UNUSED_FUNCTION |
| 59 | 57 | static WRITE16_DEVICE_HANDLER( tumblep_oki_w ) |
| 60 | 58 | { |
| 61 | okim6295_w(0,data&0xff); | |
| 59 | okim6295_w(0, data & 0xff); | |
| 62 | 60 | /* STUFF IN OTHER BYTE TOO..*/ |
| 63 | 61 | } |
| 64 | 62 | |
| r7500 | r7501 | |
| 70 | 68 | |
| 71 | 69 | static WRITE16_HANDLER( tumblep_sound_w ) |
| 72 | 70 | { |
| 71 | tumblep_state *state = (tumblep_state *)space->machine->driver_data; | |
| 73 | 72 | soundlatch_w(space, 0, data & 0xff); |
| 74 | cpu | |
| 73 | cpu | |
| 75 | 74 | } |
| 76 | 75 | |
| 77 | 76 | #ifdef UNUSED_FUNCTION |
| 78 | 77 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 79 | 78 | { |
| 79 | tumblep_state *state = (tumblep_state *)space->machine->driver_data; | |
| 80 | 80 | soundlatch_w(space, 0, data & 0xff); |
| 81 | cputag_set_input_line(s | |
| 81 | cputag_set_input_line(state-> | |
| 82 | 82 | } |
| 83 | 83 | #endif |
| 84 | 84 | |
| r7500 | r7501 | |
| 86 | 86 | |
| 87 | 87 | static READ16_HANDLER( tumblepop_controls_r ) |
| 88 | 88 | { |
| 89 | switch (offset<<1) | |
| 89 | switch (offset << 1) | |
| 90 | 90 | { |
| 91 | 91 | case 0: |
| 92 | 92 | return input_port_read(space->machine, "PLAYERS"); |
| r7500 | r7501 | |
| 116 | 116 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 117 | 117 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepop_controls_r) |
| 118 | 118 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 119 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 120 | AM_RANGE(0x300000, 0x30000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 121 | AM_RANGE(0x320000, 0x320fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 122 | AM_RANGE(0x322000, 0x322fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 123 | AM_RANGE(0x340000, 0x3407ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll) // unused | |
| 124 | AM_RANGE(0x342000, 0x3427ff) AM_WRITEONLY AM_BASE(&deco16_pf2_rowscroll) // unused | |
| 119 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_BASE_SIZE_MEMBER(tumblep_state, spriteram, spriteram_size) | |
| 120 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 121 | AM_RANGE(0x320000, 0x320fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 122 | AM_RANGE(0x322000, 0x322fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 123 | AM_RANGE(0x340000, 0x3407ff) AM_WRITEONLY AM_BASE_MEMBER(tumblep_state, pf1_rowscroll) // unused | |
| 124 | AM_RANGE(0x342000, 0x3427ff) AM_WRITEONLY AM_BASE_MEMBER(tumblep_state, pf2_rowscroll) // unused | |
| 125 | 125 | ADDRESS_MAP_END |
| 126 | 126 | |
| 127 | 127 | /******************************************************************************/ |
| r7500 | r7501 | |
| 274 | 274 | |
| 275 | 275 | static void sound_irq(running_device *device, int state) |
| 276 | 276 | { |
| 277 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 277 | tumblep_state *driver_state = (tumblep_state *)device->machine->driver_data; | |
| 278 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 278 | 279 | } |
| 279 | 280 | |
| 280 | 281 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 282 | 283 | sound_irq |
| 283 | 284 | }; |
| 284 | 285 | |
| 286 | static const deco16ic_interface tumblep_deco16ic_intf = | |
| 287 | { | |
| 288 | "screen", | |
| 289 | 1, 0, 1, | |
| 290 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 291 | 0, 16, 0, 16, /* color base (default values) */ | |
| 292 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 293 | NULL, NULL, NULL, NULL | |
| 294 | }; | |
| 295 | ||
| 296 | static MACHINE_START( tumblep ) | |
| 297 | { | |
| 298 | tumblep_state *state = (tumblep_state *)machine->driver_data; | |
| 299 | ||
| 300 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 301 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 302 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 303 | } | |
| 304 | ||
| 285 | 305 | static MACHINE_DRIVER_START( tumblep ) |
| 286 | 306 | |
| 307 | /* driver data */ | |
| 308 | MDRV_DRIVER_DATA(tumblep_state) | |
| 309 | ||
| 287 | 310 | /* basic machine hardware */ |
| 288 | 311 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 289 | 312 | MDRV_CPU_PROGRAM_MAP(main_map) |
| r7500 | r7501 | |
| 292 | 315 | MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45; Audio section crystal is 32.220 MHz */ |
| 293 | 316 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 294 | 317 | |
| 318 | MDRV_MACHINE_START(tumblep) | |
| 319 | ||
| 295 | 320 | /* video hardware */ |
| 296 | 321 | MDRV_SCREEN_ADD("screen", RASTER) |
| 297 | 322 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 303 | 328 | MDRV_GFXDECODE(tumblep) |
| 304 | 329 | MDRV_PALETTE_LENGTH(1024) |
| 305 | 330 | |
| 306 | MDRV_VIDEO_START(tumblep) | |
| 307 | 331 | MDRV_VIDEO_UPDATE(tumblep) |
| 308 | 332 | |
| 333 | MDRV_DECO16IC_ADD("deco_custom", tumblep_deco16ic_intf) | |
| 334 | ||
| 309 | 335 | /* sound hardware */ |
| 310 | 336 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 311 | 337 | |
| r7500 | r7501 | |
| 383 | 409 | |
| 384 | 410 | /******************************************************************************/ |
| 385 | 411 | |
| 386 | GAME( 1991, tumblep, 0, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (World)", 0 ) | |
| 387 | GAME( 1991, tumblepj, tumblep, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (Japan)", 0 ) | |
| 412 | GAME( 1991, tumblep, 0, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (World)", GAME_SUPPORTS_SAVE ) | |
| 413 | GAME( 1991, tumblepj, tumblep, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (Japan)", GAME_SUPPORTS_SAVE ) | |
| 388 | 414 | /* for bootlegs and games on similar hardware see tumbleb.c */ |
| r7500 | r7501 | |
|---|---|---|
| 11 | 11 | #include "sound/okim6295.h" |
| 12 | 12 | #include "includes/decocrpt.h" |
| 13 | 13 | #include "includes/decoprot.h" |
| 14 | #include "includes/deco16ic.h" | |
| 14 | #include "includes/dietgo.h" | |
| 15 | #include "video/deco16ic.h" | |
| 15 | 16 | |
| 16 | VIDEO_UPDATE( dietgo ); | |
| 17 | VIDEO_START( dietgo ); | |
| 18 | 17 | |
| 19 | ||
| 20 | 18 | static ADDRESS_MAP_START( dietgo_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 21 | 19 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 22 | AM_RANGE(0x200000, 0x20000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control) | |
| 23 | AM_RANGE(0x210000, 0x211fff) AM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 24 | AM_RANGE(0x212000, 0x213fff) AM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 25 | AM_RANGE(0x220000, 0x2207ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll) | |
| 26 | AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_BASE(&deco16_pf2_rowscroll) | |
| 27 | AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 28 | AM_RANGE(0x300000, 0x300bff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 20 | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("deco_custom", deco16ic_pf12_control_w) | |
| 21 | AM_RANGE(0x210000, 0x211fff) AM_DEVWRITE("deco_custom", deco16ic_pf1_data_w) | |
| 22 | AM_RANGE(0x212000, 0x213fff) AM_DEVWRITE("deco_custom", deco16ic_pf2_data_w) | |
| 23 | AM_RANGE(0x220000, 0x2207ff) AM_WRITEONLY AM_BASE_MEMBER(dietgo_state, pf1_rowscroll) | |
| 24 | AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_BASE_MEMBER(dietgo_state, pf2_rowscroll) | |
| 25 | AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_BASE_SIZE_MEMBER(dietgo_state, spriteram, spriteram_size) | |
| 26 | AM_RANGE(0x300000, 0x300bff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 29 | 27 | AM_RANGE(0x340000, 0x3407ff) AM_READWRITE(dietgo_104_prot_r, dietgo_104_prot_w) |
| 30 | 28 | AM_RANGE(0x380000, 0x38ffff) AM_RAM // mainram |
| 31 | 29 | ADDRESS_MAP_END |
| r7500 | r7501 | |
| 53 | 51 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 54 | 52 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 55 | 53 | |
| 56 | PORT_START("IN1") | |
| 54 | PORT_START("IN1") | |
| 57 | 55 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 58 | 56 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 59 | 57 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 71 | 69 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 72 | 70 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) |
| 73 | 71 | |
| 74 | PORT_START("DSW") | |
| 72 | PORT_START("DSW") | |
| 75 | 73 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) |
| 76 | 74 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) |
| 77 | 75 | PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) |
| r7500 | r7501 | |
| 97 | 95 | PORT_DIPSETTING( 0x0080, "1 Start/1 Continue" ) |
| 98 | 96 | PORT_DIPSETTING( 0x0000, "2 Start/1 Continue" ) |
| 99 | 97 | |
| 100 | /* Dip switch bank 2 */ | |
| 101 | 98 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) |
| 102 | 99 | PORT_DIPSETTING( 0x0100, "1" ) |
| 103 | 100 | PORT_DIPSETTING( 0x0000, "2" ) |
| r7500 | r7501 | |
| 164 | 161 | |
| 165 | 162 | static void sound_irq(running_device *device, int state) |
| 166 | 163 | { |
| 167 | cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ | |
| 164 | dietgo_state *driver_state = (dietgo_state *)device->machine->driver_data; | |
| 165 | cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */ | |
| 168 | 166 | } |
| 169 | 167 | |
| 170 | 168 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 172 | 170 | sound_irq |
| 173 | 171 | }; |
| 174 | 172 | |
| 173 | ||
| 174 | static int dietgo_bank_callback(const int bank) | |
| 175 | { | |
| 176 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 177 | } | |
| 178 | ||
| 179 | static const deco16ic_interface dietgo_deco16ic_intf = | |
| 180 | { | |
| 181 | "screen", | |
| 182 | 1, 0, 1, | |
| 183 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 184 | 0, 16, 0, 16, /* color base (default values) */ | |
| 185 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 186 | dietgo_bank_callback, | |
| 187 | dietgo_bank_callback, | |
| 188 | NULL, | |
| 189 | NULL | |
| 190 | }; | |
| 191 | ||
| 192 | ||
| 193 | static MACHINE_START( dietgo ) | |
| 194 | { | |
| 195 | dietgo_state *state = (dietgo_state *)machine->driver_data; | |
| 196 | ||
| 197 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 198 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 199 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 200 | } | |
| 201 | ||
| 175 | 202 | static MACHINE_DRIVER_START( dietgo ) |
| 203 | ||
| 204 | /* driver data */ | |
| 205 | MDRV_DRIVER_DATA(dietgo_state) | |
| 206 | ||
| 176 | 207 | /* basic machine hardware */ |
| 177 | 208 | MDRV_CPU_ADD("maincpu", M68000, XTAL_28MHz/2) /* DE102 (verified on pcb) */ |
| 178 | 209 | MDRV_CPU_PROGRAM_MAP(dietgo_map) |
| r7500 | r7501 | |
| 181 | 212 | MDRV_CPU_ADD("audiocpu", H6280, XTAL_32_22MHz/4/3) /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */ |
| 182 | 213 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 183 | 214 | |
| 215 | MDRV_MACHINE_START(dietgo) | |
| 216 | ||
| 184 | 217 | /* video hardware */ |
| 185 | 218 | MDRV_SCREEN_ADD("screen", RASTER) |
| 186 | 219 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 192 | 225 | MDRV_PALETTE_LENGTH(1024) |
| 193 | 226 | MDRV_GFXDECODE(dietgo) |
| 194 | 227 | |
| 195 | MDRV_VIDEO_START(dietgo) | |
| 196 | 228 | MDRV_VIDEO_UPDATE(dietgo) |
| 197 | 229 | |
| 230 | MDRV_DECO16IC_ADD("deco_custom", dietgo_deco16ic_intf) | |
| 231 | ||
| 198 | 232 | /* sound hardware */ |
| 199 | 233 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 200 | 234 | |
| r7500 | r7501 | |
| 334 | 368 | deco102_decrypt_cpu(machine, "maincpu", 0xe9ba, 0x01, 0x19); |
| 335 | 369 | } |
| 336 | 370 | |
| 337 | GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", 0 ) | |
| 338 | GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.08.04)" , 0) // weird, still version 1.1 but different date | |
| 339 | GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", 0 ) | |
| 340 | GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", 0 ) | |
| 371 | GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", GAME_SUPPORTS_SAVE ) | |
| 372 | GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.08.04)" , GAME_SUPPORTS_SAVE ) // weird, still version 1.1 but different date | |
| 373 | GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", GAME_SUPPORTS_SAVE ) | |
| 374 | GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 228 | 228 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 229 | 229 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY |
| 230 | 230 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY |
| 231 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 232 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 231 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 232 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 233 | 233 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 234 | 234 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 235 | 235 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r7500 | r7501 | |
|---|---|---|
| 33 | 33 | #include "sound/ay8910.h" |
| 34 | 34 | |
| 35 | 35 | |
| 36 | typedef struct _supdrapo_state supdrapo_state; | |
| 37 | struct _supdrapo_state | |
| 36 | class supdrapo_state | |
| 38 | 37 | { |
| 38 | public: | |
| 39 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, supdrapo_state(machine)); } | |
| 40 | ||
| 41 | supdrapo_state(running_machine &machine) { } | |
| 42 | ||
| 39 | 43 | UINT8 *char_bank; |
| 40 | 44 | UINT8 *col_line; |
| 41 | 45 | UINT8 *videoram; |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include "cpu/z80/z80.h" |
| 25 | 25 | |
| 26 | 26 | |
| 27 | typedef struct _dotrikun_state dotrikun_state; | |
| 28 | struct _dotrikun_state | |
| 27 | class dotrikun_state | |
| 29 | 28 | { |
| 29 | public: | |
| 30 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dotrikun_state(machine)); } | |
| 31 | ||
| 32 | dotrikun_state(running_machine &machine) { } | |
| 33 | ||
| 30 | 34 | /* memory pointers */ |
| 31 | 35 | UINT8 * videoram; |
| 32 | 36 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 18 | 18 | Video Hardware |
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | typedef struct _spoker_state spoker_state; | |
| 22 | struct _spoker_state | |
| 21 | class spoker_state | |
| 23 | 22 | { |
| 23 | public: | |
| 24 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, spoker_state(machine)); } | |
| 25 | ||
| 26 | spoker_state(running_machine &machine) { } | |
| 27 | ||
| 24 | 28 | UINT8 *bg_tile_ram; |
| 25 | 29 | tilemap_t *bg_tilemap; |
| 26 | 30 |
| r7500 | r7501 | |
|---|---|---|
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "cpu/m68000/m68000.h" |
| 16 | 16 | #include "sound/okim6295.h" |
| 17 | #include "includes/ohmygod.h" | |
| 17 | 18 | |
| 18 | 19 | |
| 19 | extern UINT16 *ohmygod_videoram; | |
| 20 | ||
| 21 | WRITE16_HANDLER( ohmygod_videoram_w ); | |
| 22 | WRITE16_HANDLER( ohmygod_spritebank_w ); | |
| 23 | WRITE16_HANDLER( ohmygod_scrollx_w ); | |
| 24 | WRITE16_HANDLER( ohmygod_scrolly_w ); | |
| 25 | VIDEO_START( ohmygod ); | |
| 26 | VIDEO_UPDATE( ohmygod ); | |
| 27 | ||
| 28 | ||
| 29 | static int adpcm_bank_shift; | |
| 30 | static int sndbank; | |
| 31 | ||
| 32 | static MACHINE_RESET( ohmygod ) | |
| 20 | static WRITE16_HANDLER( ohmygod_ctrl_w ) | |
| 33 | 21 | { |
| 34 | | |
| 22 | | |
| 35 | 23 | |
| 36 | sndbank = 0; | |
| 37 | memcpy(rom + 0x20000,rom + 0x40000 + 0x20000 * sndbank,0x20000); | |
| 38 | } | |
| 39 | ||
| 40 | static WRITE16_HANDLER( ohmygod_ctrl_w ) | |
| 41 | { | |
| 42 | 24 | if (ACCESSING_BITS_0_7) |
| 43 | 25 | { |
| 44 | 26 | UINT8 *rom = memory_region(space->machine, "oki"); |
| 45 | 27 | |
| 46 | 28 | /* ADPCM bank switch */ |
| 47 | if (sndbank != ((data >> adpcm_bank_shift) & 0x0f)) | |
| 29 | if (state->sndbank != ((data >> state->adpcm_bank_shift) & 0x0f)) | |
| 48 | 30 | { |
| 49 | sndbank = (data >> adpcm_bank_shift) & 0x0f; | |
| 50 | memcpy(rom + 0x20000,rom + 0x40000 + 0x20000 * sndbank,0x20000); | |
| 31 | state->sndbank = (data >> state->adpcm_bank_shift) & 0x0f; | |
| 32 | memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * state->sndbank, 0x20000); | |
| 51 | 33 | } |
| 52 | 34 | } |
| 53 | 35 | if (ACCESSING_BITS_8_15) |
| 54 | 36 | { |
| 55 | coin_counter_w(space->machine, 0,data & 0x1000); | |
| 56 | coin_counter_w(space->machine, 1,data & 0x2000); | |
| 37 | coin_counter_w(space->machine, 0, data & 0x1000); | |
| 38 | coin_counter_w(space->machine, 1, data & 0x2000); | |
| 57 | 39 | } |
| 58 | 40 | } |
| 59 | 41 | |
| 60 | 42 | static ADDRESS_MAP_START( ohmygod_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 61 | 43 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 62 | 44 | AM_RANGE(0x300000, 0x303fff) AM_RAM |
| 63 | AM_RANGE(0x304000, 0x307fff) AM_RAM_WRITE(ohmygod_videoram_w) AM_BASE( | |
| 45 | AM_RANGE(0x304000, 0x307fff) AM_RAM_WRITE(ohmygod_videoram_w) AM_BASE_MEMBER( | |
| 64 | 46 | AM_RANGE(0x308000, 0x30ffff) AM_RAM |
| 65 | 47 | AM_RANGE(0x400000, 0x400001) AM_WRITE(ohmygod_scrollx_w) |
| 66 | 48 | AM_RANGE(0x400002, 0x400003) AM_WRITE(ohmygod_scrolly_w) |
| 67 | 49 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 68 | AM_RANGE(0x700000, 0x703fff) AM_RAM AM_BASE_SIZE_ | |
| 50 | AM_RANGE(0x700000, 0x703fff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 69 | 51 | AM_RANGE(0x704000, 0x707fff) AM_RAM |
| 70 | 52 | AM_RANGE(0x708000, 0x70ffff) AM_RAM /* Work RAM */ |
| 71 | 53 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("P1") |
| r7500 | r7501 | |
| 312 | 294 | |
| 313 | 295 | |
| 314 | 296 | |
| 297 | static MACHINE_START( ohmygod ) | |
| 298 | { | |
| 299 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 300 | ||
| 301 | state_save_register_global(machine, state->spritebank); | |
| 302 | state_save_register_global(machine, state->scrollx); | |
| 303 | state_save_register_global(machine, state->scrolly); | |
| 304 | state_save_register_global(machine, state->sndbank); | |
| 305 | } | |
| 306 | ||
| 307 | static MACHINE_RESET( ohmygod ) | |
| 308 | { | |
| 309 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 310 | UINT8 *rom = memory_region(machine, "oki"); | |
| 311 | ||
| 312 | state->sndbank = 0; | |
| 313 | memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * state->sndbank, 0x20000); | |
| 314 | ||
| 315 | state->spritebank = 0; | |
| 316 | state->scrollx = 0; | |
| 317 | state->scrolly = 0; | |
| 318 | } | |
| 319 | ||
| 315 | 320 | static MACHINE_DRIVER_START( ohmygod ) |
| 316 | 321 | |
| 322 | /* driver data */ | |
| 323 | MDRV_DRIVER_DATA(ohmygod_state) | |
| 324 | ||
| 317 | 325 | /* basic machine hardware */ |
| 318 | 326 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 319 | 327 | MDRV_CPU_PROGRAM_MAP(ohmygod_map) |
| 320 | 328 | MDRV_CPU_VBLANK_INT("screen", irq1_line_hold) |
| 321 | 329 | |
| 322 | MDRV_MACHINE_RESET(ohmygod) | |
| 323 | 330 | MDRV_WATCHDOG_TIME_INIT(SEC(3)) /* a guess, and certainly wrong */ |
| 324 | 331 | |
| 332 | MDRV_MACHINE_START(ohmygod) | |
| 333 | MDRV_MACHINE_RESET(ohmygod) | |
| 334 | ||
| 325 | 335 | /* video hardware */ |
| 326 | 336 | MDRV_SCREEN_ADD("screen", RASTER) |
| 327 | 337 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 387 | 397 | |
| 388 | 398 | static DRIVER_INIT( ohmygod ) |
| 389 | 399 | { |
| 390 | adpcm_bank_shift = 4; | |
| 400 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 401 | state->adpcm_bank_shift = 4; | |
| 391 | 402 | } |
| 392 | 403 | |
| 393 | 404 | static DRIVER_INIT( naname ) |
| 394 | 405 | { |
| 395 | adpcm_bank_shift = 0; | |
| 406 | ohmygod_state *state = (ohmygod_state *)machine->driver_data; | |
| 407 | state->adpcm_bank_shift = 0; | |
| 396 | 408 | } |
| 397 | 409 | |
| 398 | 410 | |
| 399 | GAME( 1993, ohmygod, 0, ohmygod, ohmygod, ohmygod, ROT0, "Atlus", "Oh My God! (Japan)", GAME_NO_COCKTAIL ) | |
| 400 | GAME( 1994, naname, 0, ohmygod, naname, naname, ROT0, "Atlus", "Naname de Magic! (Japan)", GAME_NO_COCKTAIL ) | |
| 411 | GAME( 1993, ohmygod, 0, ohmygod, ohmygod, ohmygod, ROT0, "Atlus", "Oh My God! (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) | |
| 412 | GAME( 1994, naname, 0, ohmygod, naname, naname, ROT0, "Atlus", "Naname de Magic! (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | aeroboto_state *state = (aeroboto_state *)device->machine->driver_data; |
| 46 | 46 | |
| 47 | 47 | if (!state->disable_irq) |
| 48 | cpu_set_input_line(device, 0, | |
| 48 | cpu_set_input_line(device, 0, ASSERT_LINE); | |
| 49 | 49 | else |
| 50 | 50 | state->disable_irq--; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | static READ8_HANDLER( aeroboto_irq_ack_r ) | |
| 54 | { | |
| 55 | cputag_set_input_line(space->machine,"maincpu", 0, CLEAR_LINE); | |
| 56 | return 0xff; | |
| 57 | } | |
| 58 | ||
| 53 | 59 | static READ8_HANDLER( aeroboto_2973_r ) |
| 54 | 60 | { |
| 55 | 61 | aeroboto_state *state = (aeroboto_state *)space->machine->driver_data; |
| r7500 | r7501 | |
| 86 | 92 | AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_BASE_MEMBER(aeroboto_state, starx) |
| 87 | 93 | AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE_MEMBER(aeroboto_state, stary) // usable but probably wrong |
| 88 | 94 | AM_RANGE(0x3006, 0x3006) AM_WRITEONLY AM_BASE_MEMBER(aeroboto_state, bgcolor) |
| 89 | AM_RANGE(0x3800, 0x3800) AM_READ | |
| 95 | AM_RANGE(0x3800, 0x3800) AM_READ(aeroboto_irq_ack_r) // watchdog or IRQ ack | |
| 90 | 96 | AM_RANGE(0x4000, 0xffff) AM_ROM // main ROM |
| 91 | 97 | ADDRESS_MAP_END |
| 92 | 98 |
| r7500 | r7501 | |
|---|---|---|
| 32 | 32 | #include "emu.h" |
| 33 | 33 | #include "cpu/z80/z80.h" |
| 34 | 34 | #include "cpu/m68000/m68000.h" |
| 35 | #include "includes/oneshot.h" | |
| 35 | 36 | #include "sound/okim6295.h" |
| 36 | 37 | #include "sound/3812intf.h" |
| 37 | #include "includes/oneshot.h" | |
| 38 | 38 | |
| 39 | ||
| 40 | UINT16 *oneshot_sprites; | |
| 41 | UINT16 *oneshot_bg_videoram; | |
| 42 | UINT16 *oneshot_mid_videoram; | |
| 43 | UINT16 *oneshot_fg_videoram; | |
| 44 | UINT16 *oneshot_scroll; | |
| 45 | ||
| 46 | int gun_x_p1,gun_y_p1,gun_x_p2,gun_y_p2; | |
| 47 | int gun_x_shift; | |
| 48 | ||
| 49 | 39 | static READ16_HANDLER( oneshot_in0_word_r ) |
| 50 | 40 | { |
| 41 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 51 | 42 | int data = input_port_read(space->machine, "DSW1"); |
| 52 | 43 | |
| 53 | 44 | switch (data & 0x0c) |
| 54 | 45 | { |
| 55 | 46 | case 0x00 : |
| 56 | gun_x_shift = 35; | |
| 47 | state->gun_x_shift = 35; | |
| 57 | 48 | break; |
| 58 | 49 | case 0x04 : |
| 59 | gun_x_shift = 30; | |
| 50 | state->gun_x_shift = 30; | |
| 60 | 51 | break; |
| 61 | 52 | case 0x08 : |
| 62 | gun_x_shift = 40; | |
| 53 | state->gun_x_shift = 40; | |
| 63 | 54 | break; |
| 64 | 55 | case 0x0c : |
| 65 | gun_x_shift = 50; | |
| 56 | state->gun_x_shift = 50; | |
| 66 | 57 | break; |
| 67 | 58 | } |
| 68 | 59 | |
| r7500 | r7501 | |
| 71 | 62 | |
| 72 | 63 | static READ16_HANDLER( oneshot_gun_x_p1_r ) |
| 73 | 64 | { |
| 65 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 66 | ||
| 74 | 67 | /* shots must be in a different location to register */ |
| 75 | static int wobble = 0; | |
| 76 | wobble ^= 1; | |
| 68 | state->p1_wobble ^= 1; | |
| 77 | 69 | |
| 78 | return gun_x_p1 ^ wobble; | |
| 70 | return state->gun_x_p1 ^ state->p1_wobble; | |
| 79 | 71 | } |
| 80 | 72 | |
| 81 | 73 | static READ16_HANDLER( oneshot_gun_y_p1_r ) |
| 82 | 74 | { |
| 83 | return gun_y_p1; | |
| 75 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 76 | return state->gun_y_p1; | |
| 84 | 77 | } |
| 85 | 78 | |
| 86 | 79 | static READ16_HANDLER( oneshot_gun_x_p2_r ) |
| 87 | 80 | { |
| 81 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 82 | ||
| 88 | 83 | /* shots must be in a different location to register */ |
| 89 | static int wobble = 0; | |
| 90 | wobble ^= 1; | |
| 84 | state->p2_wobble ^= 1; | |
| 91 | 85 | |
| 92 | return gun_x_p2 ^ wobble; | |
| 86 | return state->gun_x_p2 ^ state->p2_wobble; | |
| 93 | 87 | } |
| 94 | 88 | |
| 95 | 89 | static READ16_HANDLER( oneshot_gun_y_p2_r ) |
| 96 | 90 | { |
| 97 | return gun_y_p2; | |
| 91 | oneshot_state *state = (oneshot_state *)space->machine->driver_data; | |
| 92 | return state->gun_y_p2; | |
| 98 | 93 | } |
| 99 | 94 | |
| 100 | 95 | static WRITE16_DEVICE_HANDLER( soundbank_w ) |
| r7500 | r7501 | |
| 111 | 106 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 112 | 107 | AM_RANGE(0x080000, 0x087fff) AM_RAM |
| 113 | 108 | AM_RANGE(0x0c0000, 0x0c07ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 114 | AM_RANGE(0x120000, 0x120fff) AM_RAM AM_BASE(&oneshot_sprites) | |
| 115 | AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(oneshot_mid_videoram_w) AM_BASE(&oneshot_mid_videoram) // some people , girl etc. | |
| 116 | AM_RANGE(0x181000, 0x181fff) AM_RAM_WRITE(oneshot_fg_videoram_w) AM_BASE(&oneshot_fg_videoram) // credits etc. | |
| 117 | AM_RANGE(0x182000, 0x182fff) AM_RAM_WRITE(oneshot_bg_videoram_w) AM_BASE(&oneshot_bg_videoram) // credits etc. | |
| 118 | AM_RANGE(0x188000, 0x18800f) AM_WRITEONLY AM_BASE(&oneshot_scroll) // scroll registers | |
| 109 | AM_RANGE(0x120000, 0x120fff) AM_RAM AM_BASE_MEMBER(oneshot_state, sprites) | |
| 110 | AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(oneshot_mid_videoram_w) AM_BASE_MEMBER(oneshot_state, mid_videoram) // some people , girl etc. | |
| 111 | AM_RANGE(0x181000, 0x181fff) AM_RAM_WRITE(oneshot_fg_videoram_w) AM_BASE_MEMBER(oneshot_state, fg_videoram) // credits etc. | |
| 112 | AM_RANGE(0x182000, 0x182fff) AM_RAM_WRITE(oneshot_bg_videoram_w) AM_BASE_MEMBER(oneshot_state, bg_videoram) // credits etc. | |
| 113 | AM_RANGE(0x188000, 0x18800f) AM_WRITEONLY AM_BASE_MEMBER(oneshot_state, scroll) // scroll registers | |
| 119 | 114 | AM_RANGE(0x190002, 0x190003) AM_READ(soundlatch_word_r) |
| 120 | 115 | AM_RANGE(0x190010, 0x190011) AM_WRITE(soundlatch_word_w) |
| 121 | 116 | AM_RANGE(0x190018, 0x190019) AM_DEVWRITE("oki", soundbank_w) |
| r7500 | r7501 | |
| 140 | 135 | |
| 141 | 136 | |
| 142 | 137 | static INPUT_PORTS_START( oneshot ) |
| 143 | PORT_START("DSW1") /* | |
| 138 | PORT_START("DSW1") /* | |
| 144 | 139 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) // 0x080084.l : credits (00-09) |
| 145 | 140 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 146 | 141 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| r7500 | r7501 | |
| 162 | 157 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 163 | 158 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 164 | 159 | |
| 165 | PORT_START("DSW2") /* | |
| 160 | PORT_START("DSW2") /* | |
| 166 | 161 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) // 0x082500.l |
| 167 | 162 | PORT_DIPSETTING( 0x01, "1" ) |
| 168 | 163 | PORT_DIPSETTING( 0x02, "2" ) |
| r7500 | r7501 | |
| 182 | 177 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 183 | 178 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 184 | 179 | |
| 185 | PORT_START("CREDITS") /* | |
| 180 | PORT_START("CREDITS") /* | |
| 186 | 181 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 187 | 182 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 188 | 183 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r7500 | r7501 | |
| 227 | 222 | INPUT_PORTS_END |
| 228 | 223 | |
| 229 | 224 | static INPUT_PORTS_START( maddonna ) |
| 230 | PORT_START("DSW1") | |
| 225 | PORT_START("DSW1") | |
| 231 | 226 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) |
| 232 | 227 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 233 | 228 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| r7500 | r7501 | |
| 250 | 245 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 251 | 246 | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) |
| 252 | 247 | |
| 253 | PORT_START("DSW2") | |
| 248 | PORT_START("DSW2") | |
| 254 | 249 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) |
| 255 | 250 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) // 2 Monsters at start, but "dumber"?? |
| 256 | 251 | PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) // 2 Monsters at start |
| r7500 | r7501 | |
| 273 | 268 | PORT_DIPSETTING( 0x80, "On - 01" ) |
| 274 | 269 | PORT_DIPSETTING( 0xc0, "On - 11" ) |
| 275 | 270 | |
| 276 | PORT_START("CREDITS") | |
| 271 | PORT_START("CREDITS") | |
| 277 | 272 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 278 | 273 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 279 | 274 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r7500 | r7501 | |
| 283 | 278 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) |
| 284 | 279 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 285 | 280 | |
| 286 | PORT_START("P1") | |
| 281 | PORT_START("P1") | |
| 287 | 282 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 288 | 283 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 289 | 284 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r7500 | r7501 | |
| 293 | 288 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 294 | 289 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 295 | 290 | |
| 296 | PORT_START("P2") | |
| 291 | PORT_START("P2") | |
| 297 | 292 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 298 | 293 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 299 | 294 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| r7500 | r7501 | |
| 337 | 332 | |
| 338 | 333 | static void irq_handler(running_device *device, int irq) |
| 339 | 334 | { |
| 340 | cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 335 | oneshot_state *state = (oneshot_state *)device->machine->driver_data; | |
| 336 | cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | 337 | } |
| 342 | 338 | |
| 343 | 339 | static const ym3812_interface ym3812_config = |
| r7500 | r7501 | |
| 345 | 341 | irq_handler |
| 346 | 342 | }; |
| 347 | 343 | |
| 344 | static MACHINE_START( oneshot ) | |
| 345 | { | |
| 346 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 347 | ||
| 348 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 349 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 350 | ||
| 351 | state_save_register_global(machine, state->gun_x_p1); | |
| 352 | state_save_register_global(machine, state->gun_y_p1); | |
| 353 | state_save_register_global(machine, state->gun_x_p2); | |
| 354 | state_save_register_global(machine, state->gun_y_p2); | |
| 355 | state_save_register_global(machine, state->gun_x_shift); | |
| 356 | state_save_register_global(machine, state->p1_wobble); | |
| 357 | state_save_register_global(machine, state->p2_wobble); | |
| 358 | } | |
| 359 | ||
| 360 | static MACHINE_RESET( oneshot ) | |
| 361 | { | |
| 362 | oneshot_state *state = (oneshot_state *)machine->driver_data; | |
| 363 | ||
| 364 | state->gun_x_p1 = 0; | |
| 365 | state->gun_y_p1 = 0; | |
| 366 | state->gun_x_p2 = 0; | |
| 367 | state->gun_y_p2 = 0; | |
| 368 | state->gun_x_shift = 0; | |
| 369 | state->p1_wobble = 0; | |
| 370 | state->p2_wobble = 0; | |
| 371 | } | |
| 372 | ||
| 348 | 373 | static MACHINE_DRIVER_START( oneshot ) |
| 349 | 374 | |
| 375 | /* driver data */ | |
| 376 | MDRV_DRIVER_DATA(oneshot_state) | |
| 377 | ||
| 350 | 378 | /* basic machine hardware */ |
| 351 | 379 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 352 | 380 | MDRV_CPU_PROGRAM_MAP(oneshot_map) |
| r7500 | r7501 | |
| 355 | 383 | MDRV_CPU_ADD("audiocpu", Z80, 5000000) |
| 356 | 384 | MDRV_CPU_PROGRAM_MAP(oneshot_sound_map) |
| 357 | 385 | |
| 358 | MDRV_GFXDECODE(oneshot) | |
| 386 | MDRV_MACHINE_START(oneshot) | |
| 387 | MDRV_MACHINE_RESET(oneshot) | |
| 359 | 388 | |
| 360 | 389 | /* video hardware */ |
| 361 | 390 | MDRV_SCREEN_ADD("screen", RASTER) |
| r7500 | r7501 | |
| 365 | 394 | MDRV_SCREEN_SIZE(32*16, 32*16) |
| 366 | 395 | MDRV_SCREEN_VISIBLE_AREA(0*16, 20*16-1, 0*16, 15*16-1) |
| 367 | 396 | |
| 397 | MDRV_GFXDECODE(oneshot) | |
| 368 | 398 | MDRV_PALETTE_LENGTH(0x400) |
| 369 | 399 | |
| 370 | 400 | MDRV_VIDEO_START(oneshot) |
| r7500 | r7501 | |
| 470 | 500 | |
| 471 | 501 | |
| 472 | 502 | |
| 473 | ||
| 474 | ||
| 475 | GAME( 199?, oneshot, 0, oneshot, oneshot , 0, ROT0, "<unknown>", "One Shot One Kill", GAME_IMPERFECT_GRAPHICS ) | |
| 476 | GAME( 1995, maddonna, 0, maddonna, maddonna, 0, ROT0, "Tuning", "Mad Donna (set 1)", 0 ) | |
| 477 | GAME( 1995, maddonnb, maddonna, maddonna, maddonna, 0, ROT0, "Tuning", "Mad Donna (set 2)", GAME_NOT_WORKING ) | |
| 503 | GAME( 199?, oneshot, 0, oneshot, oneshot , 0, ROT0, "<unknown>", "One Shot One Kill", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 504 | GAME( 1995, maddonna, 0, maddonna, maddonna, 0, ROT0, "Tuning", "Mad Donna (set 1)", GAME_SUPPORTS_SAVE ) | |
| 505 | GAME( 1995, maddonnb, maddonna, maddonna, maddonna, 0, ROT0, "Tuning", "Mad Donna (set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 64 | 64 | #include "cpu/z80/z80.h" |
| 65 | 65 | #include "sound/ay8910.h" |
| 66 | 66 | |
| 67 | typedef struct _dominob_state dominob_state; | |
| 68 | struct _dominob_state | |
| 67 | class dominob_state | |
| 69 | 68 | { |
| 69 | public: | |
| 70 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dominob_state(machine)); } | |
| 71 | ||
| 72 | dominob_state(running_machine &machine) { } | |
| 73 | ||
| 70 | 74 | /* memory pointers */ |
| 71 | 75 | UINT8 * spriteram; |
| 72 | 76 | UINT8 * videoram; |
| r7500 | r7501 | |
|---|---|---|
| 391 | 391 | |
| 392 | 392 | ROM_START( bladestl ) |
| 393 | 393 | ROM_REGION( 0x18000, "maincpu", 0 ) /* code + banked roms */ |
| 394 | ROM_LOAD( "797t01.bin", 0x10000, 0x08000, CRC(89d7185d) SHA1(0d2f346d9515cab0389106c0e227fb0bd84a2c9c) ) /* fixed ROM */ | |
| 395 | ROM_CONTINUE( 0x08000, 0x08000 ) /* banked ROM */ | |
| 394 | ROM_LOAD( "797-t01.19c", 0x10000, 0x08000, CRC(89d7185d) SHA1(0d2f346d9515cab0389106c0e227fb0bd84a2c9c) ) /* fixed ROM */ | |
| 395 | ROM_CONTINUE( 0x08000, 0x08000 ) /* banked ROM */ | |
| 396 | 396 | |
| 397 | 397 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ |
| 398 | ROM_LOAD( "797c02", 0x08000, 0x08000, CRC(65a331ea) SHA1(f206f6c5f0474542a5b7686b2f4d2cc7077dd5b9) ) | |
| 398 | ROM_LOAD( "797-c02.12d", 0x08000, 0x08000, CRC(65a331ea) SHA1(f206f6c5f0474542a5b7686b2f4d2cc7077dd5b9) ) | |
| 399 | 399 | |
| 400 | 400 | ROM_REGION( 0x080000, "gfx1", 0 ) |
| 401 | ROM_LOAD( "797a05", 0x000000, 0x40000, CRC(5491ba28) SHA1(c807774827c55c211ab68f548e1e835289cc5744) ) /* tiles */ | |
| 402 | ROM_LOAD( "797a06", 0x040000, 0x40000, CRC(d055f5cc) SHA1(3723b39b2a3e6dd8e7fc66bbfe1eef9f80818774) ) /* sprites */ | |
| 401 | ROM_LOAD( "797a05.19h", 0x000000, 0x40000, CRC(5491ba28) SHA1(c807774827c55c211ab68f548e1e835289cc5744) ) /* tiles */ | |
| 402 | ROM_LOAD( "797a06.13h", 0x040000, 0x40000, CRC(d055f5cc) SHA1(3723b39b2a3e6dd8e7fc66bbfe1eef9f80818774) ) /* sprites */ | |
| 403 | 403 | |
| 404 | 404 | ROM_REGION( 0x0100, "proms", 0 ) |
| 405 | ROM_LOAD( "797a07", 0x0000, 0x0100, CRC(7aecad4e) SHA1(05150a8dd25bdd6ab0c5b350e6ffd272f040e46a) ) /* sprites lookup table */ | |
| 405 | ROM_LOAD( "797a07.16i", 0x0000, 0x0100, CRC(7aecad4e) SHA1(05150a8dd25bdd6ab0c5b350e6ffd272f040e46a) ) /* sprites lookup table, 63S141N BPROM */ | |
| 406 | 406 | |
| 407 | 407 | ROM_REGION( 0xc0000, "upd", 0 ) /* uPD7759 data (chip 1) */ |
| 408 | ROM_LOAD( "797a03", 0x00000, 0x80000, CRC(9ee1a542) SHA1(c9a142a326875a50f03e49e83a84af8bb423a467) ) | |
| 409 | ROM_LOAD( "797a04", 0x80000, 0x40000, CRC(9ac8ea4e) SHA1(9f81eff970c9e8aea6f67d8a7d89805fae044ae1) ) | |
| 408 | ROM_LOAD( "797a03.11a", 0x00000, 0x80000, CRC(9ee1a542) SHA1(c9a142a326875a50f03e49e83a84af8bb423a467) ) | |
| 409 | ROM_LOAD( "797a04.9a", 0x80000, 0x40000, CRC(9ac8ea4e) SHA1(9f81eff970c9e8aea6f67d8a7d89805fae044ae1) ) | |
| 410 | 410 | ROM_END |
| 411 | 411 | |
| 412 | ROM_START( bladestll ) | |
| 413 | ROM_REGION( 0x18000, "maincpu", 0 ) /* code + banked roms */ | |
| 414 | ROM_LOAD( "797-l01.19c", 0x10000, 0x08000, CRC(1ab14c40) SHA1(c566e31a666b467d75f5fc9fa427986c3ebc705c) ) /* fixed ROM */ | |
| 415 | ROM_CONTINUE( 0x08000, 0x08000 ) /* banked ROM */ | |
| 416 | ||
| 417 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ | |
| 418 | ROM_LOAD( "797-c02.12d", 0x08000, 0x08000, CRC(65a331ea) SHA1(f206f6c5f0474542a5b7686b2f4d2cc7077dd5b9) ) | |
| 419 | ||
| 420 | ROM_REGION( 0x080000, "gfx1", 0 ) | |
| 421 | ROM_LOAD( "797a05.19h", 0x000000, 0x40000, CRC(5491ba28) SHA1(c807774827c55c211ab68f548e1e835289cc5744) ) /* tiles */ | |
| 422 | ROM_LOAD( "797a06.13h", 0x040000, 0x40000, CRC(d055f5cc) SHA1(3723b39b2a3e6dd8e7fc66bbfe1eef9f80818774) ) /* sprites */ | |
| 423 | ||
| 424 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 425 | ROM_LOAD( "797a07.16i", 0x0000, 0x0100, CRC(7aecad4e) SHA1(05150a8dd25bdd6ab0c5b350e6ffd272f040e46a) ) /* sprites lookup table, 63S141N BPROM */ | |
| 426 | ||
| 427 | ROM_REGION( 0xc0000, "upd", 0 ) /* uPD7759 data (chip 1) */ | |
| 428 | ROM_LOAD( "797a03.11a", 0x00000, 0x80000, CRC(9ee1a542) SHA1(c9a142a326875a50f03e49e83a84af8bb423a467) ) | |
| 429 | ROM_LOAD( "797a04.9a", 0x80000, 0x40000, CRC(9ac8ea4e) SHA1(9f81eff970c9e8aea6f67d8a7d89805fae044ae1) ) | |
| 430 | ROM_END | |
| 431 | ||
| 412 | 432 | ROM_START( bladestle ) |
| 413 | 433 | ROM_REGION( 0x18000, "maincpu", 0 ) /* code + banked roms */ |
| 414 | ROM_LOAD( "797e01", 0x10000, 0x08000, CRC(f8472e95) SHA1(8b6caa905fb1642300dd9da508871b00429872c3) ) /* fixed ROM */ | |
| 415 | ROM_CONTINUE( 0x08000, 0x08000 ) /* banked ROM */ | |
| 434 | ROM_LOAD( "797-e01.19c", 0x10000, 0x08000, CRC(f8472e95) SHA1(8b6caa905fb1642300dd9da508871b00429872c3) ) /* fixed ROM */ | |
| 435 | ROM_CONTINUE( 0x08000, 0x08000 ) /* banked ROM */ | |
| 416 | 436 | |
| 417 | 437 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ |
| 418 | ROM_LOAD( "797c02", 0x08000, 0x08000, CRC(65a331ea) SHA1(f206f6c5f0474542a5b7686b2f4d2cc7077dd5b9) ) | |
| 438 | ROM_LOAD( "797-c02.12d", 0x08000, 0x08000, CRC(65a331ea) SHA1(f206f6c5f0474542a5b7686b2f4d2cc7077dd5b9) ) | |
| 419 | 439 | |
| 420 | 440 | ROM_REGION( 0x080000, "gfx1", 0 ) |
| 421 | ROM_LOAD( "797a05", 0x000000, 0x40000, CRC(5491ba28) SHA1(c807774827c55c211ab68f548e1e835289cc5744) ) /* tiles */ | |
| 422 | ROM_LOAD( "797a06", 0x040000, 0x40000, CRC(d055f5cc) SHA1(3723b39b2a3e6dd8e7fc66bbfe1eef9f80818774) ) /* sprites */ | |
| 441 | ROM_LOAD( "797a05.19h", 0x000000, 0x40000, CRC(5491ba28) SHA1(c807774827c55c211ab68f548e1e835289cc5744) ) /* tiles */ | |
| 442 | ROM_LOAD( "797a06.13h", 0x040000, 0x40000, CRC(d055f5cc) SHA1(3723b39b2a3e6dd8e7fc66bbfe1eef9f80818774) ) /* sprites */ | |
| 423 | 443 | |
| 424 | 444 | ROM_REGION( 0x0100, "proms", 0 ) |
| 425 | ROM_LOAD( "797a07", 0x0000, 0x0100, CRC(7aecad4e) SHA1(05150a8dd25bdd6ab0c5b350e6ffd272f040e46a) ) /* sprites lookup table */ | |
| 445 | ROM_LOAD( "797a07.16i", 0x0000, 0x0100, CRC(7aecad4e) SHA1(05150a8dd25bdd6ab0c5b350e6ffd272f040e46a) ) /* sprites lookup table, 63S141N BPROM */ | |
| 426 | 446 | |
| 427 | ROM_REGION( 0xc0000, "upd", 0 ) /* uPD7759 data */ | |
| 428 | ROM_LOAD( "797a03", 0x00000, 0x80000, CRC(9ee1a542) SHA1(c9a142a326875a50f03e49e83a84af8bb423a467) ) | |
| 429 | ROM_LOAD( "797a04", 0x80000, 0x40000, CRC(9ac8ea4e) SHA1(9f81eff970c9e8aea6f67d8a7d89805fae044ae1) ) | |
| 447 | ROM_REGION( 0xc0000, "upd", 0 ) /* uPD7759 data (chip 1) */ | |
| 448 | ROM_LOAD( "797a03.11a", 0x00000, 0x80000, CRC(9ee1a542) SHA1(c9a142a326875a50f03e49e83a84af8bb423a467) ) | |
| 449 | ROM_LOAD( "797a04.9a", 0x80000, 0x40000, CRC(9ac8ea4e) SHA1(9f81eff970c9e8aea6f67d8a7d89805fae044ae1) ) | |
| 430 | 450 | ROM_END |
| 431 | 451 | |
| 432 | 452 | |
| r7500 | r7501 | |
| 437 | 457 | *************************************/ |
| 438 | 458 | |
| 439 | 459 | GAME( 1987, bladestl, 0, bladestl, bladestl, 0, ROT90, "Konami", "Blades of Steel (version T)", GAME_SUPPORTS_SAVE ) |
| 460 | GAME( 1987, bladestll, bladestl, bladestl, bladestle,0, ROT90, "Konami", "Blades of Steel (version L)", GAME_SUPPORTS_SAVE ) | |
| 440 | 461 | GAME( 1987, bladestle, bladestl, bladestl, bladestle,0, ROT90, "Konami", "Blades of Steel (version E)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | /********************************************************************************** |
| 2 | 2 | |
| 3 | 3 | |
| 4 | | |
| 4 | | |
| 5 | 5 | |
| 6 | Original preliminary driver: Curt Coder, Peter Trauner. | |
| 7 | Rewrite and aditional work: Roberto Fresca. | |
| 6 | Original preliminary driver: Curt Coder, Peter Trauner. | |
| 7 | Rewrite and aditional work: Roberto Fresca. | |
| 8 | 8 | |
| 9 | 9 | |
| 10 | | |
| 10 | | |
| 11 | 11 | |
| 12 | * Jolly Card (austrian), TAB-Austria, 1985. | |
| 13 | * Jolly Card (3x3 deal), TAB-Austria, 1985. | |
| 14 | * Jolly Card Professional 2.0, Spale-Soft, 2000. | |
| 15 | * Jolly Card (Evona Electronic), Evona Electronic 1998. | |
| 16 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. | |
| 17 | * Jolly Card (croatian, set 2), Soft Design, 1993. | |
| 18 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. | |
| 19 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 20 | * Super Joly 2000 - 3x, M.P. 1985. | |
| 21 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. | |
| 22 | * Big Deal (hungarian, set 1), Funworld, 1986. | |
| 23 | * Big Deal (hungarian, set 2), Funworld, 1986. | |
| 24 | * Jolly Card (austrian, Funworld), Funworld, 1986. | |
| 25 | * Cuore 1 (italian), C.M.C., 1996. | |
| 26 | * Elephant Family (italian, new), C.M.C., 1997. | |
| 27 | * Elephant Family (italian, old), C.M.C., 1996. | |
| 28 | * Pool 10 (italian, set 1), C.M.C., 1996. | |
| 29 | * Pool 10 (italian, set 2), C.M.C., 1996. | |
| 30 | * Pool 10 (italian, set 3), C.M.C., 1996. | |
| 31 | * Pool 10 (italian, set 4), C.M.C., 1997. | |
| 32 | * Tortuga Family (italian), C.M.C., 1997. | |
| 33 | * Pot Game (italian), C.M.C., 1996. | |
| 34 | * Bottle 10 (italian, set 1), C.M.C., 1996. | |
| 35 | * Bottle 10 (italian, set 2), C.M.C., 1996. | |
| 36 | * Royal Card (austrian, set 1), TAB-Austria, 1991. | |
| 37 | * Royal Card (austrian, set 2), TAB-Austria, 1991. | |
| 38 | * Royal Card (slovak, encrypted), Evona Electronic, 1991. | |
| 39 | * Royal Card Professional 2.0, Digital Dreams, 1993. | |
| 40 | * Lucky Lady (3x3 deal), TAB-Austria, 1991. | |
| 41 | * Lucky Lady (4x1 aces), TAB-Austria, 1991. | |
| 42 | * Magic Card II (bulgarian), Impera, 1996. | |
| 43 | * Magic Card II (green TAB or Impera board), Impera, 1996. | |
| 44 | * Magic Card II (blue TAB board, encrypted), Impera, 1996. | |
| 45 | * Royal Vegas Joker Card (slow deal), Funworld, 1993. | |
| 46 | * Royal Vegas Joker Card (fast deal), Soft Design, 1993. | |
| 47 | * Royal Vegas Joker Card (fast deal, english gfx), Soft Design, 1993. | |
| 48 | * Jolly Joker, Impera, 198?. | |
| 49 | * Jolly Joker (50bet), Impera, 198?. | |
| 50 | * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993. | |
| 51 | * Mongolfier New (italian), bootleg, 199?. | |
| 52 | * Soccer New (italian), bootleg, 199?. | |
| 53 | * Saloon (french, encrypted), unknown, 199?. | |
| 12 | * Jolly Card (austrian), TAB-Austria, 1985. | |
| 13 | * Jolly Card (3x3 deal), TAB-Austria, 1985. | |
| 14 | * Jolly Card Professional 2.0, Spale-Soft, 2000. | |
| 15 | * Jolly Card (Evona Electronic), Evona Electronic 1998. | |
| 16 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. | |
| 17 | * Jolly Card (croatian, set 2), Soft Design, 1993. | |
| 18 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. | |
| 19 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 20 | * Super Joly 2000 - 3x, M.P. 1985. | |
| 21 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. | |
| 22 | * Big Deal (hungarian, set 1), Funworld, 1986. | |
| 23 | * Big Deal (hungarian, set 2), Funworld, 1986. | |
| 24 | * Jolly Card (austrian, Funworld), Funworld, 1986. | |
| 25 | * Cuore 1 (italian), C.M.C., 1996. | |
| 26 | * Elephant Family (italian, new), C.M.C., 1997. | |
| 27 | * Elephant Family (italian, old), C.M.C., 1996. | |
| 28 | * Pool 10 (italian, set 1), C.M.C., 1996. | |
| 29 | * Pool 10 (italian, set 2), C.M.C., 1996. | |
| 30 | * Pool 10 (italian, set 3), C.M.C., 1996. | |
| 31 | * Pool 10 (italian, set 4), C.M.C., 1997. | |
| 32 | * Tortuga Family (italian), C.M.C., 1997. | |
| 33 | * Pot Game (italian), C.M.C., 1996. | |
| 34 | * Bottle 10 (italian, set 1), C.M.C., 1996. | |
| 35 | * Bottle 10 (italian, set 2), C.M.C., 1996. | |
| 36 | * Royal Card (austrian, set 1), TAB-Austria, 1991. | |
| 37 | * Royal Card (austrian, set 2), TAB-Austria, 1991. | |
| 38 | * Royal Card (slovak, encrypted), Evona Electronic, 1991. | |
| 39 | * Royal Card Professional 2.0, Digital Dreams, 1993. | |
| 40 | * Lucky Lady (3x3 deal), TAB-Austria, 1991. | |
| 41 | * Lucky Lady (4x1 aces), TAB-Austria, 1991. | |
| 42 | * Magic Card II (bulgarian), Impera, 1996. | |
| 43 | * Magic Card II (green TAB or Impera board), Impera, 1996. | |
| 44 | * Magic Card II (blue TAB board, encrypted), Impera, 1996. | |
| 45 | * Royal Vegas Joker Card (slow deal), Funworld, 1993. | |
| 46 | * Royal Vegas Joker Card (fast deal), Soft Design, 1993. | |
| 47 | * Royal Vegas Joker Card (fast deal, english gfx), Soft Design, 1993. | |
| 48 | * Jolly Joker (98bet, set 1). Impera, 198?. | |
| 49 | * Jolly Joker (98bet, set 2). Impera, 198?. | |
| 50 | * Jolly Joker (40bet, croatian hack), Impera, 198?. | |
| 51 | * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993. | |
| 52 | * Mongolfier New (italian), bootleg, 199?. | |
| 53 | * Soccer New (italian), bootleg, 199?. | |
| 54 | * Saloon (french, encrypted), unknown, 199?. | |
| 54 | 55 | |
| 55 | 56 | |
| 56 | 57 | *********************************************************************************** |
| 57 | 58 | |
| 58 | 59 | |
| 59 | | |
| 60 | | |
| 60 | 61 | |
| 61 | CPU: 1x 65SC02 or 65C02 at 2MHz. | |
| 62 | Sound: 1x AY3-8910 or YM2149F (AY8910 compatible) at 2MHz. | |
| 63 | I/O: 2x 6821 (PIA) | |
| 64 | Video: 1x 6845 (CRTC) | |
| 65 | RAM: 1x 6116 | |
| 66 | NVRAM: 1x 6264 | |
| 67 | ROMs: 3x 27256 (or 27512 in some cases) | |
| 68 | PROMs: 1x 82S147 (or similar. 512 bytes) | |
| 69 | PLDs: 1 to 4 PALs, GALs or PEELs | |
| 70 | Clock: 1x Crystal: 16MHz. | |
| 62 | CPU: 1x 65SC02 or 65C02 at 2MHz. | |
| 63 | Sound: 1x AY3-8910 or YM2149F (AY8910 compatible) at 2MHz. | |
| 64 | I/O: 2x 6821 (PIA) | |
| 65 | Video: 1x 6845 (CRTC) | |
| 66 | RAM: 1x 6116 | |
| 67 | NVRAM: 1x 6264 | |
| 68 | ROMs: 3x 27256 (or 27512 in some cases) | |
| 69 | PROMs: 1x 82S147 (or similar. 512 bytes) | |
| 70 | PLDs: 1 to 4 PALs, GALs or PEELs | |
| 71 | Clock: 1x Crystal: 16MHz. | |
| 71 | 72 | |
| 72 | 73 | |
| 73 | All current games are running from a slightly modified to heavily hacked hardware. | |
| 74 | Color palettes are normally stored in format GGBBBRRR inside a bipolar color PROM. | |
| 74 | All current games are running from a slightly modified to heavily hacked hardware. | |
| 75 | Color palettes are normally stored in format GGBBBRRR inside a bipolar color PROM. | |
| 75 | 76 | |
| 76 | - bits - | |
| 77 | 7654 3210 | |
| 78 | ---- -xxx Red component. | |
| 79 | --xx x--- Blue component. | |
| 80 | xx-- ---- Green component. | |
| 77 | - bits - | |
| 78 | 7654 3210 | |
| 79 | ---- -xxx Red component. | |
| 80 | --xx x--- Blue component. | |
| 81 | xx-- ---- Green component. | |
| 81 | 82 | |
| 82 | 83 | |
| 83 | The hardware was designed to manage 4096 tiles with a size of 8x4 pixels each. | |
| 84 | Also support 4bpp graphics and the palette limitation is 8 bits for color codes (256 x 16colors). | |
| 85 | It means the hardware was designed for more elaborated graphics than Jolly Card games... | |
| 86 | Color PROMs from current games are 512 bytes lenght, but they only use the first 256 bytes. | |
| 84 | The hardware was designed to manage 4096 tiles with a size of 8x4 pixels each. | |
| 85 | Also support 4bpp graphics and the palette limitation is 8 bits for color codes (256 x 16colors). | |
| 86 | It means the hardware was designed for more elaborated graphics than Jolly Card games... | |
| 87 | Color PROMs from current games are 512 bytes lenght, but they only use the first 256 bytes. | |
| 87 | 88 | |
| 88 | | |
| 89 | | |
| 89 | 90 | |
| 90 | - bits - | |
| 91 | 7654 3210 | |
| 92 | xxxx xx-- tiles color (game tiles) ;codes 0x00-0xdc | |
| 93 | xxx- x-xx tiles color (title). :codes 0xe9-0xeb | |
| 94 | xxxx -xxx tiles color (background). ;codes 0xf1-0xf7 | |
| 91 | - bits - | |
| 92 | 7654 3210 | |
| 93 | xxxx xx-- tiles color (game tiles) ;codes 0x00-0xdc | |
| 94 | xxx- x-xx tiles color (title). :codes 0xe9-0xeb | |
| 95 | xxxx -xxx tiles color (background). ;codes 0xf1-0xf7 | |
| 95 | 96 | |
| 96 | 97 | |
| 97 | | |
| 98 | | |
| 98 | 99 | |
| 99 | - There are writes to unknown offsets (out of the normal memory range), and some | |
| 100 | checks later to see if the data is still there. | |
| 100 | - There are writes to unknown offsets (out of the normal memory range), and some | |
| 101 | checks later to see if the data is still there. | |
| 101 | 102 | |
| 102 | - There are checks for code in unused RAM and therefore jumps to offsets where there | |
| 103 | are not pieces of code in RAM or just RAM is inexistent. | |
| 104 | I think this is to avoid a "ROM swap" that allow the software to run in other game boards. | |
| 103 | - There are checks for code in unused RAM and therefore jumps to offsets where there | |
| 104 | are not pieces of code in RAM or just RAM is inexistent. | |
| 105 | I think this is to avoid a "ROM swap" that allow the software to run in other game boards. | |
| 105 | 106 | |
| 106 | - There are "masked" unused inputs. | |
| 107 | The software is polling the unused input status and expect a special value to boot the game. | |
| 107 | - There are "masked" unused inputs. | |
| 108 | The software is polling the unused input status and expect a special value to boot the game. | |
| 108 | 109 | |
| 109 | - There are parts of code that are very complex and twisted with fake jumps to inexistent code, | |
| 110 | or pretending to initialize fake devices. | |
| 110 | - There are parts of code that are very complex and twisted with fake jumps to inexistent code, | |
| 111 | or pretending to initialize fake devices. | |
| 111 | 112 | |
| 112 | | |
| 113 | | |
| 113 | 114 | |
| 114 | | |
| 115 | | |
| 115 | 116 | |
| 116 | - Joker Card from Vesely Svet use a custom unknown CPU and use encrypted prg roms. | |
| 117 | - Royal Card (slovak, encrypted) from Evona Electronic seems to use a block | |
| 118 | with CPU + extras (ICs, TTL, etc) to manage the encryption. | |
| 117 | - Joker Card from Vesely Svet use a custom unknown CPU and use encrypted prg roms. | |
| 118 | - Royal Card (slovak, encrypted) from Evona Electronic seems to use a block | |
| 119 | with CPU + extras (ICs, TTL, etc) to manage the encryption. | |
| 119 | 120 | |
| 120 | | |
| 121 | | |
| 121 | 122 | |
| 122 | - All games using the blue TAB PCB with 2x HY18CV85 (electrically-erasable PLDs), use | |
| 123 | complex operations for each byte nibble. See DRIVER_INIT for the final algorithm. | |
| 124 | - Saloon (french) use bitswaps to address & data in program, graphics and color PROM. | |
| 123 | - All games using the blue TAB PCB with 2x HY18CV85 (electrically-erasable PLDs), use | |
| 124 | complex operations for each byte nibble. See DRIVER_INIT for the final algorithm. | |
| 125 | - Saloon (french) use bitswaps to address & data in program, graphics and color PROM. | |
| 125 | 126 | |
| 126 | | |
| 127 | | |
| 127 | 128 | |
| 128 | 129 | |
| 129 | 130 | |
| 130 | | |
| 131 | | |
| 131 | 132 | |
| 132 | - It takes 46 seconds for the bigdeal/jolycdat games to boot up | |
| 133 | after the initial screen is displayed!!! | |
| 133 | - It takes 46 seconds for the bigdeal/jolycdat games to boot up | |
| 134 | after the initial screen is displayed!!! | |
| 134 | 135 | |
| 135 | - The default DIP switch settings must be used when first booting up | |
| 136 | the games to allow them to complete the NVRAM initialization. | |
| 136 | - The default DIP switch settings must be used when first booting up | |
| 137 | the games to allow them to complete the NVRAM initialization. | |
| 137 | 138 | |
| 138 | - Almost all games: Start game, press and hold Service1 & Service2, press | |
| 139 | reset (F3), release Service1/2 and press reset (F3) again. | |
| 140 | Now the NVRAM has been initialized. | |
| 139 | - Almost all games: Start game, press and hold Service1 & Service2, press | |
| 140 | reset (F3), release Service1/2 and press reset (F3) again. | |
| 141 | Now the NVRAM has been initialized. | |
| 141 | 142 | |
| 142 | | |
| 143 | | |
| 143 | 144 | |
| 144 | - For games that allow remote credits, after NVRAM init change the payout | |
| 145 | DIP switch from "Hopper" to "Manual Payout". | |
| 145 | - For games that allow remote credits, after NVRAM init change the payout | |
| 146 | DIP switch from "Hopper" to "Manual Payout". | |
| 146 | 147 | |
| 147 | 148 | |
| 148 | 149 | |
| 149 | | |
| 150 | | |
| 150 | 151 | |
| 151 | * Pool 10 | |
| 152 | * Cuore 1 | |
| 153 | * Elephant Family | |
| 154 | * Tortuga Family | |
| 155 | * Pot Game | |
| 156 | * Bottle 10 | |
| 152 | * Pool 10 | |
| 153 | * Cuore 1 | |
| 154 | * Elephant Family | |
| 155 | * Tortuga Family | |
| 156 | * Pot Game | |
| 157 | * Bottle 10 | |
| 157 | 158 | |
| 158 | In Italy many people became addicted to videopokers. They put so much money on them, | |
| 159 | and they had to sell the house. Also some engineers modified videopokers to do less | |
| 160 | wins and so on... Because of this the government did some laws in order to regulate | |
| 161 | videopokers wins. Starting from around 1996/1997 there were subsequent laws because | |
| 162 | engineers always found a way to elude them. | |
| 159 | In Italy many people became addicted to videopokers. They put so much money on them, | |
| 160 | and they had to sell the house. Also some engineers modified videopokers to do less | |
| 161 | wins and so on... Because of this the government did some laws in order to regulate | |
| 162 | videopokers wins. Starting from around 1996/1997 there were subsequent laws because | |
| 163 | engineers always found a way to elude them. | |
| 163 | 164 | |
| 164 | Today all the videopokers need to be connected via AAMS net (a government society de- | |
| 165 | dicated to games) which check if the videopoker is regular. Nowadays it's difficult | |
| 166 | to trick and the videopoker has to give 75% of wins. This has made videopoker market | |
| 167 | to collapse and infact there aren't many videopokers left. | |
| 165 | Today all the videopokers need to be connected via AAMS net (a government society de- | |
| 166 | dicated to games) which check if the videopoker is regular. Nowadays it's difficult | |
| 167 | to trick and the videopoker has to give 75% of wins. This has made videopoker market | |
| 168 | to collapse and infact there aren't many videopokers left. | |
| 168 | 169 | |
| 169 | Also because the laws changed very often and old videopokers became illegal was a | |
| 170 | very bad thing for bar owners because they couldn't earn enough money. | |
| 170 | Also because the laws changed very often and old videopokers became illegal was a | |
| 171 | very bad thing for bar owners because they couldn't earn enough money. | |
| 171 | 172 | |
| 172 | Pool 10 (now found!), apparently was the "father" of other italian gambling games. | |
| 173 | As soon as it became illegal, was converted to Cuore 1, Elephant Family, Tortuga Family | |
| 174 | and maybe other games. So you can see that engineers always found a simple way to elude | |
| 175 | the law. | |
| 173 | Pool 10 (now found!), apparently was the "father" of other italian gambling games. | |
| 174 | As soon as it became illegal, was converted to Cuore 1, Elephant Family, Tortuga Family | |
| 175 | and maybe other games. So you can see that engineers always found a simple way to elude | |
| 176 | the law. | |
| 176 | 177 | |
| 177 | There is another set of Cuore 1. I didn't include it because the only difference with | |
| 178 | the supported set is the program rom that is double sized, having identical halves. | |
| 178 | There is another set of Cuore 1. I didn't include it because the only difference with | |
| 179 | the supported set is the program rom that is double sized, having identical halves. | |
| 179 | 180 | |
| 180 | There is at least one missing game in the family... 'Hippo Family', also from C.M.C. | |
| 181 | This game should be located and dumped. | |
| 181 | There is at least one missing game in the family... 'Hippo Family', also from C.M.C. | |
| 182 | This game should be located and dumped. | |
| 182 | 183 | |
| 183 | 184 | |
| 184 | | |
| 185 | | |
| 185 | 186 | |
| 186 | If you have some points accumulated and need to grab the tokens/tickets, you must to play | |
| 187 | a bonus game called SUPER GAME to get the points out. To enter the bonus game, you must | |
| 188 | press STOP5 in the attract mode. The payout system is through this game. | |
| 187 | If you have some points accumulated and need to grab the tokens/tickets, you must to play | |
| 188 | a bonus game called SUPER GAME to get the points out. To enter the bonus game, you must | |
| 189 | press STOP5 in the attract mode. The payout system is through this game. | |
| 189 | 190 | |
| 190 | 5 themed items will be shown (cuores, balls, elephants, etc... depending of the game). | |
| 191 | The joker will start to move from item to item quickly, but decreasing the speed gradually. | |
| 192 | To beat the game, you need to push the start button in the exact moment when the joker is | |
| 193 | located exactly in the center of the screen (item 3). | |
| 191 | 5 themed items will be shown (cuores, balls, elephants, etc... depending of the game). | |
| 192 | The joker will start to move from item to item quickly, but decreasing the speed gradually. | |
| 193 | To beat the game, you need to push the start button in the exact moment when the joker is | |
| 194 | located exactly in the center of the screen (item 3). | |
| 194 | 195 | |
| 195 | Depending of the DIP switches settings, you can grab the prize manually pressing the SCARICA | |
| 196 | (payout) button, and then TICKET or HOPPER buttons. Press TICKET button to print a 100 points | |
| 197 | ticket. Press HOPPER button to get tokens x10 points. | |
| 196 | Depending of the DIP switches settings, you can grab the prize manually pressing the SCARICA | |
| 197 | (payout) button, and then TICKET or HOPPER buttons. Press TICKET button to print a 100 points | |
| 198 | ticket. Press HOPPER button to get tokens x10 points. | |
| 198 | 199 | |
| 199 | | |
| 200 | | |
| 200 | 201 | |
| 201 | 202 | |
| 202 | | |
| 203 | | |
| 203 | 204 | |
| 204 | This one seems to have normal RAM instead of NVRAM. | |
| 205 | Going through the code, there's not any NVRAM initialization routine through service 1 & 2. | |
| 205 | This one seems to have normal RAM instead of NVRAM. | |
| 206 | Going through the code, there's not any NVRAM initialization routine through service 1 & 2. | |
| 206 | 207 | |
| 207 | 208 | |
| 208 | | |
| 209 | | |
| 209 | 210 | |
| 210 | Each 1st boot, this game show a generated code. You must enter this code in a DOS program to | |
| 211 | get the input codes necessary to allow boot the game. | |
| 211 | Each 1st boot, this game show a generated code. You must enter this code in a DOS program to | |
| 212 | get the input codes necessary to allow boot the game. | |
| 212 | 213 | |
| 213 | This set is one of the most wanted for customers because is a real SCAM. | |
| 214 | The program has 2 hidden menues that allow change parameters without knowledge of the players. | |
| 214 | This set is one of the most wanted for customers because is a real SCAM. | |
| 215 | The program has 2 hidden menues that allow change parameters without knowledge of the players. | |
| 215 | 216 | |
| 216 | 217 | |
| 217 | | |
| 218 | | |
| 218 | 219 | |
| 219 | This set has some hidden features. | |
| 220 | In the service 2 screen, press service 1 to enter to a message edit mode. | |
| 220 | This set has some hidden features. | |
| 221 | In the service 2 screen, press service 1 to enter to a message edit mode. | |
| 221 | 222 | |
| 222 | 223 | |
| 223 | | |
| 224 | | |
| 224 | 225 | |
| 225 | | |
| 226 | | |
| 226 | 227 | |
| 227 | 228 | |
| 228 | | |
| 229 | | |
| 229 | 230 | |
| 230 | | |
| 231 | | |
| 231 | 232 | |
| 232 | 233 | |
| 233 | | |
| 234 | | |
| 234 | 235 | |
| 235 | Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board. | |
| 236 | This board has two HY18CV85 (electrically-erasable PLD) that handle the encryption. | |
| 237 | In another hand, the sound has some weird things, but is confirmed that happen in the real thing. | |
| 236 | Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board. | |
| 237 | This board has two HY18CV85 (electrically-erasable PLD) that handle the encryption. | |
| 238 | In another hand, the sound has some weird things, but is confirmed that happen in the real thing. | |
| 238 | 239 | |
| 239 | The game resolution seems to change 'on the fly' when entering the input test mode. | |
| 240 | There aren't any writes to the m6845 registers to manage these changes. | |
| 240 | The game resolution seems to change 'on the fly' when entering the input test mode. | |
| 241 | There aren't any writes to the m6845 registers to manage these changes. | |
| 241 | 242 | |
| 242 | Regarding the CPU, it seems to be a custom one, or a daughterboard with a 65c02 + PLDs/TTLs. | |
| 243 | Some CPU instructions seems to be changed. The following piece of code at $C1A8 is very clear: | |
| 243 | Regarding the CPU, it seems to be a custom one, or a daughterboard with a 65c02 + PLDs/TTLs. | |
| 244 | Some CPU instructions seems to be changed. The following piece of code at $C1A8 is very clear: | |
| 244 | 245 | |
| 245 | | |
| 246 | | |
| 246 | 247 | |
| 247 | C1AA: B9 9D C1 lda $C19D,y ; load PIA port address | |
| 248 | C1AD: 85 06 sta $06 ; into $06-$07 ZP vector. | |
| 249 | C1AF: B9 92 C1 lda $C192,y ; | |
| 250 | C1B2: 85 07 sta $07 ; | |
| 251 | C1B4: C0 0B cpy #$0B | |
| 252 | C1B6: B0 0C bcs $C1C4 | |
| 248 | C1AA: B9 9D C1 lda $C19D,y ; load PIA port address | |
| 249 | C1AD: 85 06 sta $06 ; into $06-$07 ZP vector. | |
| 250 | C1AF: B9 92 C1 lda $C192,y ; | |
| 251 | C1B2: 85 07 sta $07 ; | |
| 252 | C1B4: C0 0B cpy #$0B | |
| 253 | C1B6: B0 0C bcs $C1C4 | |
| 253 | 254 | |
| 254 | ... load values to store into Accumulator... | |
| 255 | ... | |
| 256 | C1C6: 91 06 sta ($06),y ; store value in PIA port, indexed (Y). | |
| 257 | C1C8: C8 iny ; increment Y | |
| 258 | C1C9: C0 0C cpy #$0C ; finish? | |
| 259 | C1CB: D0 DD bne $C1AA ; if not, branch to load a new PIA adress. | |
| 255 | ... load values to store into Accumulator... | |
| 256 | ... | |
| 257 | C1C6: 91 06 sta ($06),y ; store value in PIA port, indexed (Y). | |
| 258 | C1C8: C8 iny ; increment Y | |
| 259 | C1C9: C0 0C cpy #$0C ; finish? | |
| 260 | C1CB: D0 DD bne $C1AA ; if not, branch to load a new PIA adress. | |
| 260 | 261 | |
| 261 | In this example, as soon as Y register increments, the indexed writes go out of range. | |
| 262 | To get this piece of code working and initialize the PIAs properly, the instruction 0x91 should be | |
| 263 | "sta ($ZP)" instead of Y indexed. (like instruction 0x92 in stock 65c02's). | |
| 262 | In this example, as soon as Y register increments, the indexed writes go out of range. | |
| 263 | To get this piece of code working and initialize the PIAs properly, the instruction 0x91 should be | |
| 264 | "sta ($ZP)" instead of Y indexed. (like instruction 0x92 in stock 65c02's). | |
| 264 | 265 | |
| 265 | 266 | |
| 266 | | |
| 267 | | |
| 267 | 268 | |
| 268 | To boot this game for 1st time, DSW should be in the following position: | |
| 269 | 1=ON 2=OFF 3=ON 4=OFF 5=OFF 6=ON 7=ON 8=OFF | |
| 269 | To boot this game for 1st time, DSW should be in the following position: | |
| 270 | 1=ON 2=OFF 3=ON 4=OFF 5=OFF 6=ON 7=ON 8=OFF | |
| 270 | 271 | |
| 271 | Press RESET (key F3) and then SERVICE1 & SERVICE2 (keys 9 & 0), then RESET (key F3). | |
| 272 | When numbers start to fill the screen, press RESET (key F3) again to start the game. | |
| 272 | Press RESET (key F3) and then SERVICE1 & SERVICE2 (keys 9 & 0), then RESET (key F3). | |
| 273 | When numbers start to fill the screen, press RESET (key F3) again to start the game. | |
| 273 | 274 | |
| 274 | 275 | |
| 275 | * Mongolfier New | |
| 276 | * Soccer New | |
| 276 | * Mongolfier New | |
| 277 | * Soccer New | |
| 277 | 278 | |
| 278 | These games are based in Royal Card. They are running in a heavely modified Royal Card | |
| 279 | hardware with a microcontroller as an extra (protection?) component and a TDA2003 as | |
| 280 | audio amplifier. | |
| 279 | These games are based in Royal Card. They are running in a heavely modified Royal Card | |
| 280 | hardware with a microcontroller as an extra (protection?) component and a TDA2003 as | |
| 281 | audio amplifier. | |
| 281 | 282 | |
| 282 | | |
| 283 | | |
| 283 | 284 | |
| 284 | Each set has double sized ROMs. One half contains the proper set and the other half store | |
| 285 | a complete Royal Card set, so... Is possible the existence of a shortcut,'easter egg', | |
| 286 | simple hack or DIP switches combination to enable the Royal Card game. | |
| 285 | Each set has double sized ROMs. One half contains the proper set and the other half store | |
| 286 | a complete Royal Card set, so... Is possible the existence of a shortcut,'easter egg', | |
| 287 | simple hack or DIP switches combination to enable the Royal Card game. | |
| 287 | 288 | |
| 288 | These games should be moved to a new driver in a near future, as soon as we know a bit more | |
| 289 | about them and start to implement the missing pieces for an accurate emulation. | |
| 289 | These games should be moved to a new driver in a near future, as soon as we know a bit more | |
| 290 | about them and start to implement the missing pieces for an accurate emulation. | |
| 290 | 291 | |
| 291 | 292 | |
| 292 | | |
| 293 | | |
| 293 | 294 | |
| 294 | This game is totally encrypted. No PIAs to drive I/O. The PCB has printed "LEOPARDO 5", so we | |
| 295 | can expect a game called the same way to appear. | |
| 295 | This game is totally encrypted. No PIAs to drive I/O. The PCB has printed "LEOPARDO 5", so we | |
| 296 | can expect a game called the same way to appear. | |
| 296 | 297 | |
| 297 | | |
| 298 | | |
| 298 | 299 | |
| 299 | 300 | |
| 300 | 301 | |
| 301 | 302 | *********************************************************************************** |
| 302 | 303 | |
| 303 | 304 | |
| 304 | Memory Map (generic) | |
| 305 | -------------------- | |
| 305 | Memory Map (generic) | |
| 306 | -------------------- | |
| 306 | 307 | |
| 308 | $0000 - $07FF NVRAM // All registers and settings. | |
| 309 | $0800 - $0803 PIA1 // Input Ports 0 & 1. | |
| 310 | $0A00 - $0A03 PIA2 // Input Ports 2 & 3. | |
| 311 | $0C00 - $0C00 AY-8910 (R/C) // Read/Control. | |
| 312 | $0C01 - $0C01 AY-8910 (W) // Write. Lamps through output ports. | |
| 313 | $0E00 - $0E00 CRTC6845 (A) // MC6845 adressing. | |
| 314 | $0E01 - $0E01 CRTC6845 (R/W) // MC6845 Read/Write. | |
| 307 | 315 | |
| 308 | $0000 - $07FF NVRAM // All registers and settings. | |
| 309 | $0800 - $0803 PIA1 // Input Ports 0 & 1. | |
| 310 | $0A00 - $0A03 PIA2 // Input Ports 2 & 3. | |
| 311 | $0C00 - $0C00 AY-8910 (R/C) // Read/Control. | |
| 312 | $0C01 - $0C01 AY-8910 (W) // Write. Lamps through output ports. | |
| 313 | $0E00 - $0E00 CRTC6845 (A) // MC6845 adressing. | |
| 314 | $0E01 - $0E01 CRTC6845 (R/W) // MC6845 Read/Write. | |
| 316 | $2000 - $2FFF VideoRAM (funworld/bigdeal) | |
| 317 | $3000 - $3FFF ColorRAM (funworld/bigdeal) | |
| 315 | 318 | |
| 316 | $2000 - $2FFF VideoRAM (funworld/bigdeal) | |
| 317 | $3000 - $3FFF ColorRAM (funworld/bigdeal) | |
| 319 | $4000 - $4FFF VideoRAM (magicrd2/royalcrd) | |
| 320 | $5000 - $5FFF ColorRAM (magicrd2/royalcrd) | |
| 318 | 321 | |
| 319 | $4000 - $4FFF VideoRAM (magicrd2/royalcrd) | |
| 320 | $5000 - $5FFF ColorRAM (magicrd2/royalcrd) | |
| 322 | $6000 - $6FFF VideoRAM (CMC italian games) | |
| 323 | $7000 - $7FFF ColorRAM (CMC italian games) | |
| 321 | 324 | |
| 322 | $6000 - $6FFF VideoRAM (CMC italian games) | |
| 323 | $7000 - $7FFF ColorRAM (CMC italian games) | |
| 325 | $8000 - $FFFF ROM (almost all games) | |
| 324 | 326 | |
| 325 | $8000 - $FFFF ROM (almost all games) | |
| 326 | 327 | |
| 328 | *** MC6845 Initialization *** | |
| 327 | 329 | |
| 330 | ---------------------------------------------------------------------------------------------------------------------- | |
| 331 | register: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 | |
| 332 | ---------------------------------------------------------------------------------------------------------------------- | |
| 333 | jollycrd: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 334 | jolycdae: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 335 | jolycdcr: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 336 | jolycdit: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 337 | jolycdab: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 328 | 338 | |
| 329 | | |
| 339 | bigdeal: | |
| 330 | 340 | |
| 331 | ---------------------------------------------------------------------------------------------------------------------- | |
| 332 | register: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 | |
| 333 | ---------------------------------------------------------------------------------------------------------------------- | |
| 334 | jollycrd: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 335 | jolycdae: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 336 | jolycdcr: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 337 | jolycdit: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 338 | jolycdab: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 341 | cuoreuno: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 342 | elephfam: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 343 | pool10: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 344 | tortufam: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 339 | 345 | |
| 340 | bigdeal: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 346 | royalcrd: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 347 | magicrd2: 0x7B 0x70 0x66 0xA8 0x24 0x08 0x22 0x22 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 341 | 348 | |
| 342 | cuoreuno: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 343 | elephfam: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 344 | pool10: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 345 | tortufam: 0x7C 0x60 0x65 0x08 0x1E 0x08 0x1D 0x1D 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 349 | monglfir: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 350 | soccernw: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 346 | 351 | |
| 347 | royalcrd: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 348 | magicrd2: 0x7B 0x70 0x66 0xA8 0x24 0x08 0x22 0x22 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 349 | 352 | |
| 350 | monglfir: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 351 | soccernw: 0x7C 0x60 0x65 0xA8 0x1E 0x08 0x1D 0x1C 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00. | |
| 352 | ||
| 353 | ||
| 354 | 353 | *********************************************************************************** |
| 355 | 354 | |
| 356 | 355 | |
| 357 | | |
| 356 | | |
| 358 | 357 | |
| 358 | Moved all tech info to the ROM load section... | |
| 359 | 359 | |
| 360 | Jolly Card, TAB Austria | |
| 361 | ----------------------- | |
| 362 | 360 | |
| 363 | ||
| 361 | *********************************************************************************** | |
| 364 | 362 | |
| 365 | X1-01 GND X1-A GND | |
| 366 | X1-02 GND X1-B GND | |
| 367 | X1-03 GND X1-C GND | |
| 368 | X1-04 +5V X1-D +5V | |
| 369 | X1-05 +12V X1-E +12V | |
| 370 | X1-06 NC X1-F NC | |
| 371 | X1-07 NC X1-G NC | |
| 372 | X1-08 NC X1-H NC | |
| 373 | X1-09 NC X1-I Coin 1 | |
| 374 | X1-10 Coin 2 X1-J Pay Out SW | |
| 375 | X1-11 Hold 3 X1-K NC | |
| 376 | X1-12 NC X1-L GND | |
| 377 | X1-13 Hold 4 X1-M Remote | |
| 378 | X1-14 Bookkeeping SW X1-N GND | |
| 379 | X1-15 Hold 2 X1-O Cancel | |
| 380 | X1-16 Hold 1 X1-P Hold 5 | |
| 381 | X1-17 Start X1-Q | |
| 382 | X1-18 Hopper Out X1-R | |
| 383 | X1-19 Red X1-S Green | |
| 384 | X1-20 Blue X1-T Sync | |
| 385 | X1-21 GND X1-U Speaker GND | |
| 386 | X1-22 Speaker + X1-V Management SW | |
| 387 | 363 | |
| 388 | X2-01 GND X2-A GND | |
| 389 | X2-02 NC X2-B NC | |
| 390 | X2-03 Start X2-C NC | |
| 391 | X2-04 NC X2-D NC | |
| 392 | X2-05 NC X2-E NC | |
| 393 | X2-06 Lamp Start X2-F Lamp Hold 1+3 | |
| 394 | X2-07 Lamp Hold 2 X2-G Lamp Hold 4 | |
| 395 | X2-08 Lamp Hold 5 X2-H Lamp Cancel | |
| 396 | X2-09 NC X2-I NC | |
| 397 | X2-10 Counter In X2-J Counter Out | |
| 398 | X2-11 Hopper Count X2-K Hopper Drive | |
| 399 | X2-12 Counter Remote X2-L | |
| 400 | X2-13 X2-M | |
| 401 | X2-14 X2-N | |
| 402 | X2-15 NC X2-O | |
| 403 | X2-16 X2-P | |
| 404 | X2-17 X2-Q Coin Counter | |
| 405 | X2-18 X2-R | |
| 364 | *** Driver Updates by Roberto Fresca *** | |
| 406 | 365 | |
| 407 | --------------------------------------------------- | |
| 408 | 366 | |
| 409 | DIP Switches: | |
| 367 | [2005/09/08] | |
| 368 | - Added Cuore Uno, Elephant Family and Royal Card. | |
| 410 | 369 | |
| 411 | ON OFF | |
| 370 | [2005/09/19] | |
| 371 | - Added some clones. | |
| 372 | - Cleaned up and renamed all sets. Made parent-clone relationship. | |
| 412 | 373 | |
| 413 | 1 Hopper Manual Payout SW :Payout | |
| 414 | 2 Auto Hold No Auto Hold :Hold | |
| 415 | 3 Joker Without Joker :Joker | |
| 416 | 4 Dattl Insert TAB Insert :Inserts | |
| 417 | 5 5 Points/Coin 10 Points/Coin :Coin 1 | |
| 418 | 6 5 Points/Coin 10 Points/Coin :Coin 2 | |
| 419 | 7 10 Points/Pulse 100 Points/Pulse :Remote | |
| 420 | 8 Play Keyboard Test :Mode | |
| 374 | [2005/12/15] | |
| 375 | - Corrected CPU freq (2 MHz) in cuoreuno and elephfam (both have R65c02P2). | |
| 376 | (I suspect more games must have their CPU running at 2 MHz). | |
| 377 | - Corrected videoram and colorram offsets in cuoreuno and elephfam. | |
| 378 | - To initialize the NVRAM in cuoreuno and elephfam: | |
| 379 | Start game, press and hold Service1 & Service2, press reset (F3), | |
| 380 | release Service1 & Service2 and press reset (F3) again. | |
| 421 | 381 | |
| 422 | --------------------------------------------------- | |
| 382 | [2006/10/18] | |
| 383 | - Corrected the screen size and visible area to cuoreuno and elephfam based on mc6845 registers. | |
| 384 | - Added all inputs to cuoreuno and elephfam. | |
| 385 | - Added test mode DIP switch to cuoreuno and elephfam. | |
| 386 | - Managed cuoreuno and elephfam inputs to pass the initial checks. Now both games are playable. | |
| 387 | - Changed the cuoreuno full name to "Cuore 1" (as shown in the attract). | |
| 423 | 388 | |
| 389 | [2006/10/22-28] | |
| 390 | - Corrected cuoreuno and elephfam graphics to 4bpp. | |
| 391 | - Fixed elephfam gfx planes. | |
| 392 | - Simulated cuoreuno palette based on screenshots. | |
| 393 | - Simulated elephfam palette based on screenshots. | |
| 424 | 394 | |
| 425 | 395 | |
| 426 | Jolly Card (austrian, Funworld, bootleg) | |
| 427 | ---------------------------------------- | |
| 396 | [2006/11/01 to 2006/12/04] | |
| 428 | 397 | |
| 429 | - 1x G65SC02P (CPU) | |
| 430 | - 1x MC68B45P (CRTC) | |
| 431 | - 1x AY3-8910 (sound) | |
| 432 | - 2x MC6821P (PIAs) | |
| 398 | ******** REWRITE ******** | |
| 433 | 399 | |
| 434 | RAM: - 1x 6116 | |
| 435 | - 1x KM6264AL-10 | |
| 400 | - Merged/splitted some machine drivers, memory maps and inputs. | |
| 401 | - Unified get_bg_tile_info for all games. | |
| 402 | - Mapped the input buttons in a better format (all games). Keys: 156-QW-ZXCVBNM. | |
| 403 | - Added proper color PROM decode routines. | |
| 404 | - Rewrote the technical notes. | |
| 405 | - Splitted the driver to driver/video. | |
| 436 | 406 | |
| 437 | - 1x Crystal : 16.000 MHz | |
| 407 | - Corrected the screen size and visible area to magiccrd based on mc6845 registers. | |
| 408 | - Added the remaining 2 GFX planes to magiccrd, but GFX are imperfect (bad decode or bad dump?). Color PROM need to be dumped. | |
| 409 | - Royalcrd: Added all inputs and DIP switches. | |
| 410 | Fixed memory map, gfx decode | |
| 411 | Corrected screen size and visible area based on mc6845 registers. | |
| 412 | Corrected CPU clock to 2mhz. | |
| 438 | 413 | |
| 414 | - New game added: Joker Poker. Not working due to use of custom encrypted CPU. | |
| 415 | - New game added: Royal Card (Slovakia, encrypted). Not working due to use of a custom encrypted CPU. | |
| 416 | - Fixed jolycdcr gfx to 4bpp. | |
| 417 | - Other fixes to get jolycdcr running. | |
| 418 | - Managed royalcdb to work, using the 2nd half of program ROM. (seems to be mapped that way) | |
| 419 | - Managed jolycdit to work, but with imperfect graphics due to gfx encryption. | |
| 420 | - Fixed CPU clock to 2MHz. in all remaining games. | |
| 421 | - Fixed ay8910 frequency based on elephfam audio. | |
| 422 | - Fixed ay8910 volume in all games to avoid clipping. | |
| 423 | - Reworked jolycdcr inputs: The game was designed to work only with remote credits. After nvram init, set the payout dip to "manual". | |
| 424 | - Reworked jolycdit inputs: After nvram init, set the payout dip to "manual" to allow work the remote mode. | |
| 425 | - Set jolycdat as bigdeal clone. The game has the same layout/behaviour instead of the normal jolly card games, even when are sharing gfx roms. | |
| 426 | - Added the bipolar PROM and GAL to jolycdit. Confirmed the GFX ROMs as good dumps. | |
| 427 | - Added an alternate set of Elephant Family. This one lacks of test mode and doesn't allow to switch between min-max bets through stop1. | |
| 428 | - Added color PROMs to cuoreuno and elephfam sets but still no routed. Also added PLDs (protected, bad dumps). | |
| 429 | - Corrected jollycrd screen size and visible area based on mc6845 registers. | |
| 430 | - Hooked, wired and decoded the color prom in jollycrd sets based on jolycdit redump. Now colors are perfect. | |
| 431 | - Wired and decoded the color prom in cuoreuno and elephfam sets. Now colors are perfect. | |
| 432 | - Wired and decoded the color prom in royalcrd. Now colors are perfect. | |
| 433 | - Hooked, wired and decoded the color prom in bigdeal sets based on jolycdat (jollycrd palette). | |
| 434 | Colors seems to be correct, but need to check against the real thing. Flagged as IMPERFECT_COLORS till a color PROM dump appear. | |
| 435 | - Decrypted jolycdit gfx roms. | |
| 436 | - Added set Jolly Card (Austria, encrypted). | |
| 437 | - Decrypted jolycdae and managed the planes to show correct colors. The set is working properly. | |
| 439 | 438 | |
| 440 | 439 | |
| 441 | Jolly Card (other) | |
| 442 | ------------------ | |
| 440 | [2006/12/24] | |
| 441 | - Fixed some incomplete inputs. | |
| 442 | - Added new working game: Pool 10. | |
| 443 | - Added new working game: Tortuga Family. | |
| 444 | - Added new game: Mongolfier New. Not working due to the lack of MCU emulation. | |
| 445 | - Added new game: Soccer New. Not working due to the lack of MCU emulation. | |
| 446 | - Updated technical notes. | |
| 443 | 447 | |
| 444 | - 1x G65SC02P (CPU) | |
| 445 | - 1x MC68B45P (CRTC) | |
| 446 | - 1x AY3-8910 (sound) | |
| 447 | - 2x MC6821P (PIAs) | |
| 448 | [2007/02/01] | |
| 449 | - All crystals documented via #defines. | |
| 450 | - All CPU and sound clocks derived from #defined crystal values. | |
| 451 | - Added DIPLOCATIONS to all games. | |
| 452 | - Added a pool10 alternate set. | |
| 453 | - Added proper tsc87c52 MCU dumps to monglfir and soccernew. | |
| 454 | - Modified the refresh rate to 60 fps according to some video evidences. | |
| 455 | - Updated technical notes. | |
| 448 | 456 | |
| 449 | RAM: - 1x NVram DS1220Y (instead of 6116) | |
| 450 | - 1x KM6264AL-10 | |
| 457 | [2007/02/25] | |
| 458 | - Added new game: Snooker 10 (Ver 1.11). Preliminary. | |
| 459 | Properly decoded GFX | |
| 460 | Proper colors decoded. | |
| 461 | - Updated technical notes. | |
| 451 | 462 | |
| 452 | - 1x Crystal : 16.000 MHz | |
| 463 | [2007/09/21] | |
| 464 | - Added new game: Saloon (France, encrypted). Preliminary. | |
| 465 | - Updated technical notes. | |
| 453 | 466 | |
| 467 | [2008/02/10] | |
| 468 | - Switched to XTAL def. | |
| 469 | - Fixed Magic Card II graphics issues. | |
| 470 | - Fixed Magic Card II inputs. | |
| 471 | - Fixed screen and visible area to snooker10. | |
| 472 | - Renamed set monglfir to mongolnw. | |
| 473 | - Renamed sets description based on languages instead of countries. | |
| 474 | - Added new game: Magic Card II (green TAB or Impera board). Not working yet. | |
| 475 | - Added new game: Magic Card II (blue TAB board, encrypted). Not working yet. | |
| 476 | - Added new game: Jolly Card (3x3 deal). | |
| 477 | - Added new game: Jolly Card Professional 2.0 (with 'enter code' screen to boot). | |
| 478 | - Added new game: Lucky Lady (3x3 deal). | |
| 479 | - Added new game: Lucky Lady (4x1 aces). | |
| 480 | - Added new game: Royal Vegas Joker Card (fast deal). | |
| 481 | - Added new game: Royal Vegas Joker Card (slow deal). | |
| 482 | - Fixed some years and manufacturers. | |
| 483 | - Updated technical notes. | |
| 484 | - Cleaned up the driver. | |
| 454 | 485 | |
| 486 | [2008/02/22] | |
| 487 | - Switched the color decoding routines to use resnet code. | |
| 488 | - Added complete color connections to/from 74ls373 to the source. | |
| 455 | 489 | |
| 456 | Jolly Card (italian, blue Tab board, encrypted) | |
| 457 | ----------------------------------------------- | |
| 490 | [2008/02/25] | |
| 491 | - Added new game: Royal Vegas Joker Card (fast deal, english gfx). | |
| 492 | - Added new game: Jolly Joker. | |
| 493 | - Added new game: Jolly Joker (50bet). | |
| 494 | - Added new game: Jolly Card (croatian, set 2). | |
| 495 | - Added new game: Jolly Card (Evona Electronic) | |
| 496 | - Added new game: Super Joly 2000 - 3x | |
| 497 | - Fixed some inputs. | |
| 498 | - Masked inputs to allow jolyjokra to boot. | |
| 499 | - Added minor corrections. | |
| 500 | - Updated technical notes. | |
| 458 | 501 | |
| 459 | - 1x HY6264LP | |
| 460 | - 1x MC6845P | |
| 461 | - 1x HM6116LP | |
| 462 | - 1x G65SC02 (main) | |
| 463 | - 1x AY-3-8910 (sound) | |
| 464 | - 1x MC6821P | |
| 465 | - 1x oscillator 16.000 MHz | |
| 466 | - ROMs 2x TMS27c256 (1,2) | |
| 467 | 1x M5M27256 (jn) | |
| 468 | - 1x prom N82S147 | |
| 469 | - 1x GAL16V8B | |
| 470 | - 2x HY18CV85 (electrically-erasable PLD) | |
| 471 | - 1x 8 DIP switches | |
| 472 | - 1x 22x2 edge connector | |
| 473 | - 1x 18x2 edge connector | |
| 474 | - 1x trimmer (volume)(missing) | |
| 502 | [2008/03/14] | |
| 503 | - Added proper inputs to jolyc980. | |
| 504 | - Added temporary patch to allow bypass the "code" screen in jolyc980. | |
| 505 | - Updated technical notes. | |
| 475 | 506 | |
| 507 | [2008/03/18] | |
| 508 | - Added new game: Pot Game (italian). | |
| 509 | - Updated technical notes. | |
| 476 | 510 | |
| 477 | Jolly Card (italian encrypted bootleg) | |
| 478 | -------------------------------------- | |
| 511 | [2008/04/18] | |
| 512 | - Removed the temporary hack to jolyc980. | |
| 513 | - Updated technical notes regarding Magic Card II & Jolly Card Professional 2.0. | |
| 514 | - Moved snookr10 to its own driver. | |
| 515 | - Minor clean-up. | |
| 479 | 516 | |
| 480 | - 1x UM6845P | |
| 481 | - 1x R65C02P3 (main CPU) | |
| 482 | - 1x AY-3-8910 (sound) | |
| 483 | - 2x MC68B21P | |
| 484 | - 1x oscillator 16.000 MHz | |
| 485 | - ROMs 3x 27256. | |
| 486 | - 1x PROM M1-7649-5 (not dumped) | |
| 487 | - 2x PLD HY18CV8S (not dumped) | |
| 488 | - 1x PAL16L8ACN (not dumped) | |
| 489 | - 1x 22x2 edge connector | |
| 490 | - 1x 18x2 edge connector | |
| 491 | - 1x trimmer (volume) | |
| 492 | - 1x 8x2 DIP switches. | |
| 517 | [2008/04/27] | |
| 518 | - Fixed AY8910 volume to all games to avoid clips. | |
| 519 | - Merge bigdeal and funworld machine drivers thanks to the AY8910 rewrite. | |
| 520 | - Removed old unaccurate commentary about magiccrd tiles. | |
| 493 | 521 | |
| 522 | [2008/04/29] | |
| 523 | All CMC italian games: | |
| 524 | - Added TICKET and HOPPER buttons to allow payout through the SUPER GAME. | |
| 525 | - Documented the featured SUPER GAME with complete instructions. | |
| 526 | - Improved DIP switches to properly set the payout system. | |
| 494 | 527 | |
| 495 | Big Deal (hungarian) | |
| 496 | ------------------ | |
| 528 | [2008/05/13] | |
| 529 | - Found the proper algorithm to decrypt the blue TAB PCB. | |
| 530 | - Replaced the old decryption tables with the proper decryption scheme. | |
| 531 | - Updated technical notes. | |
| 497 | 532 | |
| 498 | - 1x MC6845P | |
| 499 | - 1x YM2149F | |
| 500 | - 2x MC6821P | |
| 501 | - 1x Crystal 16.000 MHz | |
| 533 | [2008/07/30] | |
| 534 | - Added new clone: Pool 10 (italian, set 3). | |
| 535 | - Updated technical notes. | |
| 502 | 536 | |
| 537 | [2008/09/12] | |
| 538 | - Added new clone: Pool 10 (italian, set 4). | |
| 539 | - Improved lamps layout for all games. | |
| 540 | - Added Pool 10 pinout and DIP switches info. | |
| 541 | - Updated technical notes. | |
| 503 | 542 | |
| 543 | [2008/12/01] | |
| 544 | - Decripted saloon's program, graphics and color PROM. | |
| 545 | - Created a new memory map and machine driver for saloon. | |
| 546 | - Removed set jolycdae (it's not coming from a real board). | |
| 547 | - Renamed the sets magiccrd, magiccda and magiccdb, to magicrd2, magicd2a and magicd2b. | |
| 548 | - Updated technical notes. | |
| 504 | 549 | |
| 505 | Magic Card II (bulgarian) | |
| 506 | --------------------------------- | |
| 550 | [2008/12/15] | |
| 551 | - Added new set: Jolly Card (italian, encrypted bootleg). | |
| 552 | No coins... Only remote credits. After nvram init, set the Payout DIP to 'manual' | |
| 553 | to allow the remote credits mode to work. | |
| 554 | - Created inputs from the scratch for jolycdib. | |
| 555 | - Updated technical notes. | |
| 507 | 556 | |
| 508 | - 1x Special CPU with CM602 (??) on it | |
| 509 | - 1x MC6845P | |
| 510 | - 1x YM2149F | |
| 511 | - 2x MC6821P | |
| 512 | - 1x Crystal 16.000 MHz | |
| 513 | - 2x HY18CV85 (electrically-erasable PLD) | |
| 557 | [2008-12-26] | |
| 558 | - Correctly setup the MC6845 device for all systems. | |
| 559 | - Added common MC6845 device interface. | |
| 560 | - Eliminated the screen size & visible area parameters to Magic Card 2. | |
| 514 | 561 | |
| 562 | [2009/01/23] | |
| 563 | - Added new sets: Bottle 10 (italian, set 1 & 2). | |
| 564 | - Updated technical notes. | |
| 515 | 565 | |
| 566 | [2009/09/09] | |
| 567 | - Discovered and documented new features in Jolly Card (Evona Electronics). | |
| 568 | - Removed the commented hack for joly980 driver init since is not needed anymore. | |
| 569 | - Fixed a bug introduced with the massive input change, that didn't allow initialize | |
| 570 | all sets that need the normal procedure to do it. | |
| 571 | - Updated technical notes. | |
| 516 | 572 | |
| 517 | Cuore Uno (italian) | |
| 518 | ----------------------------------- | |
| 573 | [2010/03/01] | |
| 574 | - Fixed Jolly Joker graphics and colors. | |
| 575 | - Changed Jolly Joker description to Jolly Joker (98bet). | |
| 576 | - Added a new croatian set of Jolly Joker with maximum bet = 40. | |
| 577 | - Moved the hardware description and tech notes to the ROM_LOAD section. | |
| 578 | - Added a external default NVRAM for Jolly Card Professional 2.0. | |
| 579 | - Updated technical notes. | |
| 519 | 580 | |
| 520 | - CPU 1x G65SC02P | |
| 521 | - 1x MC68B45P (CRT controller) | |
| 522 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 523 | - 1x unknown (95101) DIP40 mil600 | |
| 524 | - 1x oscillator 16.000000 MHz | |
| 525 | - ROMs 1x TMS27C512 | |
| 526 | 2x TMS27C256 | |
| 527 | - 1x PROM AM27S29 | |
| 528 | - 2x PALCE20V8H | |
| 529 | - 1x PALCE16V8H (soldered) | |
| 530 | - Note 1x JAMMA edge connector (keep -5 disconnected) | |
| 531 | - 1x trimmer (volume) | |
| 532 | - 1x 8 DIP switches | |
| 533 | - 1x battery | |
| 534 | 581 | |
| 582 | *** TO DO *** | |
| 535 | 583 | |
| 584 | - Figure out the royalcdc & jokercrd encryption. | |
| 585 | - Figure out the remaining PIA connections for almost all games. | |
| 586 | - Fix Saloon and move it to its own driver. | |
| 587 | - Fix the imperfect sound in Magic Card II. | |
| 588 | - Reverse-engineering the boot code of Jolly Card Professional 2.0, | |
| 589 | and Royal Card Professional 2.0 to get the proper codes to boot. | |
| 590 | - Analyze the unknown writes to $2000/$4000 in some games. | |
| 591 | - Check for the reads to the ay8910 output ports in some games. | |
| 592 | - Figure out the MCU in monglfir and soccernw. | |
| 593 | - Correct the ROM_REGION in some games to allow the use of RGN_FRAC | |
| 536 | 594 | |
| 537 | Elephant Family (italian, old) | |
| 538 | ----------------------------- | |
| 539 | 595 | |
| 540 | - CPU 1x R65C02P2 | |
| 541 | - 1x MC68B45P (CRT controller) | |
| 542 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 543 | - 1x unknown (95101) DIP40 mil600 | |
| 544 | - 1x oscillator 16.000 MHz | |
| 545 | - ROMs 2x M27C256 | |
| 546 | 1x TMS27C256 | |
| 547 | - 1x PROM AM27S29 | |
| 548 | - 2x PALCE20V8H (read protected) | |
| 549 | - 1x PALCE16V8H (read protected) | |
| 550 | - Note 1x JAMMA edge connector (keep -5 disconnected) | |
| 551 | - 1x trimmer (volume) | |
| 552 | - 1x 8 DIP switches | |
| 553 | - 1x battery | |
| 554 | ||
| 555 | ||
| 556 | ||
| 557 | Pool 10 (italian) | |
| 558 | ----------------- | |
| 559 | ||
| 560 | - 1x R65C02P2 (main) | |
| 561 | - 1x YM2149F (sound) | |
| 562 | - 1x HD46505 (CRT controller) | |
| 563 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 564 | - 1x oscillator 16.000000 MHz | |
| 565 | ||
| 566 | - 2x M27256 (pool,1) | |
| 567 | - 1x D27256 (2) | |
| 568 | - 1x PROM N82S147AN | |
| 569 | - 2x GAL20V8B (read protected) | |
| 570 | - 1x PALCE16V8H (read protected) | |
| 571 | ||
| 572 | - 1x JAMMA edge connector | |
| 573 | - 1x trimmer (volume) | |
| 574 | - 1x 8 DIP switches | |
| 575 | - 1x battery | |
| 576 | ||
| 577 | ||
| 578 | Connector, DIPs and instructions, | |
| 579 | copied from an original sheet... | |
| 580 | ||
| 581 | Components | | solder | |
| 582 | ---------------------|--|----------------- | |
| 583 | gnd |01| gnd | |
| 584 | gnd |02| gnd | |
| 585 | +5 |03| +5 | |
| 586 | +5 |04| +5 | |
| 587 | |06| | |
| 588 | +12 |07| +5 | |
| 589 | |08| contatore out | |
| 590 | motor hopper |09| contatore in | |
| 591 | audio |10| audio | |
| 592 | sw hopper |11| gnd | |
| 593 | rosso |12| verde | |
| 594 | blu |13| sync | |
| 595 | gnd |14| statistic | |
| 596 | manegement |15| | |
| 597 | coin 1 |16| coin 2 | |
| 598 | sw ticket |17| motor ticket | |
| 599 | hold 3 |18| lamp hold 3 | |
| 600 | hold 4 |19| lamp hold 4 | |
| 601 | hold 2 |20| lamp hold 2 | |
| 602 | hold 1 |21| lamp hold 1 | |
| 603 | hold 5 |22| lamp hold 5 | |
| 604 | start |23| lamp hold start | |
| 605 | cancel |24| lamp hold cancel | |
| 606 | nc |25| +5 lamp | |
| 607 | ric. ticket + hopper |26| +12 lamp | |
| 608 | gnd |27| gnd | |
| 609 | gnd |28| gnd | |
| 610 | ||
| 611 | ||
| 612 | DIPS | |
| 613 | 1 2 3 4 5 6 7 8 | |
| 614 | on | |
| 615 | off | |
| 616 | ticket + hopper on on | |
| 617 | hopper on off | |
| 618 | ticket off on | |
| 619 | no ticket - no hopper off off | |
| 620 | 1 coin 1 credit off off | |
| 621 | 1 coin 5 credits off on | |
| 622 | 1 coin 10 credits on off | |
| 623 | 1 coin 50 credits on on | |
| 624 | five of kind yes off | |
| 625 | five of kind no on | |
| 626 | royal flush yes off | |
| 627 | royal flush no on | |
| 628 | in test on | |
| 629 | in game off | |
| 630 | ||
| 631 | ||
| 632 | Instructions: | |
| 633 | ||
| 634 | STATISTICS = show in and out credits | |
| 635 | MANEGEMENT = It's the general statistic. It shows in and out credits. | |
| 636 | ||
| 637 | To cancel statistics press CANCEL for 5 seconds. | |
| 638 | To change max and min value for play connect to GND the manegement pin, | |
| 639 | at the same time press toghether HOLD 2 + HOLD 4 for some seconds. | |
| 640 | ||
| 641 | The following menu will show up: | |
| 642 | ||
| 643 | HOLD 1 = modify max value for play 1 to 10. | |
| 644 | HOLD 2 = modify min value foe play 1 to 5. | |
| 645 | Press start to exit from programming mode. | |
| 646 | ||
| 647 | To unlock PCB from a possible lock: | |
| 648 | connect GND to pins component15 and solder14 for 5 seconds | |
| 649 | ||
| 650 | NB. Use lamps by 12V 0,15W | |
| 651 | Memory version: V16 | |
| 652 | ||
| 653 | ||
| 654 | ||
| 655 | Tortuga Family (italian) & Pot Game (italian) | |
| 656 | --------------------------------------------- | |
| 657 | ||
| 658 | - 1x G65SC02P2 (main) | |
| 659 | - 1x 95101 (sound) | |
| 660 | - 1x MC68B45P (CRT controller) | |
| 661 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 662 | - 1x oscillator 16.000000 MHz | |
| 663 | ||
| 664 | - 3x TMS27C256 | |
| 665 | - 1x PROM AM27S29PC | |
| 666 | - 2x PALCE20V8H (read protected) | |
| 667 | - 1x PALCE16V8H (read protected) | |
| 668 | ||
| 669 | - 1x JAMMA edge connector | |
| 670 | - 1x trimmer (volume) | |
| 671 | - 1x 8 DIP switches | |
| 672 | - 1x battery | |
| 673 | ||
| 674 | ||
| 675 | ||
| 676 | Royal Card (set 1) | |
| 677 | ------------------ | |
| 678 | ||
| 679 | - 1x HM6264LP | |
| 680 | - 1x HD4650SP | |
| 681 | - 1x HM6116LP | |
| 682 | - 1x R65C02P2 (main) | |
| 683 | - 1x WB5300 (labeled YM8910)(sound) | |
| 684 | - 1x EF6821P | |
| 685 | - 1x oscillator 16.000 MHz | |
| 686 | ||
| 687 | - 1x D27256 (1) | |
| 688 | - 1x S27C256 (2) | |
| 689 | - 1x TMS27C256 (r2) | |
| 690 | - 2x PEEL18CV8 (1 protected) | |
| 691 | - 1x PALCE16V8H (protected) | |
| 692 | - 1x PROM N82S147AN | |
| 693 | ||
| 694 | - 1x 8 DIP Switches | |
| 695 | - 1x 22x2 edge connector | |
| 696 | - 1x 18x2 edge connector | |
| 697 | - 1x trimmer (volume) | |
| 698 | ||
| 699 | ||
| 700 | ||
| 701 | Royal Card (set 2) | |
| 702 | ------------------ | |
| 703 | ||
| 704 | - CPU 1x R65C02P2 (main) | |
| 705 | - 1x MC68B45P (CRT controller) | |
| 706 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 707 | - 1x oscillator 16.000 MHz | |
| 708 | - 3x ROMs TMS 27C512 | |
| 709 | - 1x PALCE16V8H | |
| 710 | - 1x prom AM27S29APC | |
| 711 | ||
| 712 | - 1x 28x2 connector (maybe NOT jamma) | |
| 713 | - 1x 10x2 connector | |
| 714 | - 1x 3 legs connector (solder side) | |
| 715 | - 1x 8 DIP Switches | |
| 716 | - 1x trimmer (volume) | |
| 717 | ||
| 718 | ||
| 719 | ||
| 720 | Royal Card (set 3, encrypted) | |
| 721 | ----------------------------- | |
| 722 | ||
| 723 | - Custom/encrypted CPU (epoxy block labelled "EVONA EX9511" -> www.evona.sk ) | |
| 724 | inserted into socked with "6502" mark. | |
| 725 | ||
| 726 | - 1x YM2149 | |
| 727 | ||
| 728 | - 1x HD6845 (CRT controller) | |
| 729 | - 1x MC68A21P (PIA) | |
| 730 | - 1x 40 pin IC with surface scratched (PIA) | |
| 731 | - 1x 8 DIP Switches | |
| 732 | - Sanyo LC3517B SRAM (videoram ?) | |
| 733 | - 6264 battery backed SRAM (battery is dead) | |
| 734 | - 1x PALCE16V8 | |
| 735 | - 1x GAL16V8B | |
| 736 | - 1x PEEL18CV8P x2 | |
| 737 | - 1x 82S147 PROM (near Yamaha and unknown 40pin) - "82s147.bin" | |
| 738 | - 1x 27256 close to CPU module - "1.bin" | |
| 739 | - 2x 27256 - gfx - "2.bin", "3.bin" | |
| 740 | ||
| 741 | ||
| 742 | ||
| 743 | Mongolfier New | |
| 744 | -------------- | |
| 745 | ||
| 746 | - 1x G65SC02P2 (main) | |
| 747 | - 1x KC89C72 (sound) | |
| 748 | - 1x TDA2003 (sound) | |
| 749 | - 1x MC68B45P (CRT controller) | |
| 750 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 751 | - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped) | |
| 752 | - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery) | |
| 753 | - 1x oscillator 16.0000 MHz | |
| 754 | ||
| 755 | - 3x M27C512 | |
| 756 | - 1x PROM AM27S29PC | |
| 757 | - 1x PALCE16V8H (read protected) | |
| 758 | ||
| 759 | - 1x JAMMA edge connector | |
| 760 | - 1x trimmer (volume) | |
| 761 | - 2x 8 DIP switches | |
| 762 | - 1x 4 DIP switches | |
| 763 | - 1x green led | |
| 764 | ||
| 765 | ||
| 766 | ||
| 767 | Soccer New (italian) | |
| 768 | -------------------- | |
| 769 | ||
| 770 | - 1x G65SC02P2 (main) | |
| 771 | - 1x KC89C72 (sound) | |
| 772 | - 1x TDA2003 (sound) | |
| 773 | - 1x MC68B45P (CRT controller) | |
| 774 | - 1x EF68B21P (Peripheral Interface Adapter) | |
| 775 | - 1x EF6821P (Peripheral Interface Adapter) | |
| 776 | - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped) | |
| 777 | - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery) | |
| 778 | - 1x oscillator 16.0000MHz | |
| 779 | ||
| 780 | - 3x M27C512 | |
| 781 | - 1x PROM AM27S29PC | |
| 782 | - 1x PALCE16V8H (read protected) | |
| 783 | ||
| 784 | - 1x JAMMA edge connector | |
| 785 | - 1x trimmer (volume) | |
| 786 | - 2x 8 DIP switches | |
| 787 | - 1x 4 DIP switches | |
| 788 | - 1x green led | |
| 789 | ||
| 790 | ||
| 791 | ||
| 792 | Saloon (France, encrypted) | |
| 793 | -------------------------- | |
| 794 | ||
| 795 | - 1x 65SC02 (main) | |
| 796 | - 1x 8948? (sound) | |
| 797 | - 1x MC6845P (CRT controller) | |
| 798 | - 1x oscillator 16.000000 MHz | |
| 799 | ||
| 800 | - 2x M27C512 | |
| 801 | - 1x M27C256B | |
| 802 | - 1x PROM N82S147N | |
| 803 | - 1x GAL16V8-25LNC (read protected) | |
| 804 | - 1x GAL18CV8-25 (read protected) | |
| 805 | ||
| 806 | - 1x HY6264ALP-12 | |
| 807 | - 1x UM6116K-3L | |
| 808 | ||
| 809 | - 1x JAMMA edge connector | |
| 810 | - 1x trimmer (volume?) | |
| 811 | - 1x LM380N (amplifier) | |
| 812 | - 1x ULN2803A (8 Darlington arrays) | |
| 813 | - 1x battery | |
| 814 | - 1x test button | |
| 815 | - 1x indicator LED | |
| 816 | - NO DIP switches | |
| 817 | ||
| 818 | Board has printed "LEOPARDO 5" | |
| 819 | ||
| 820 | ||
| 821 | ||
| 822 | *********************************************************************************** | |
| 823 | ||
| 824 | ||
| 825 | *** Driver Updates by Roberto Fresca *** | |
| 826 | ||
| 827 | ||
| 828 | [2005/09/08] | |
| 829 | - Added Cuore Uno, Elephant Family and Royal Card. | |
| 830 | ||
| 831 | [2005/09/19] | |
| 832 | - Added some clones. | |
| 833 | - Cleaned up and renamed all sets. Made parent-clone relationship. | |
| 834 | ||
| 835 | [2005/12/15] | |
| 836 | - Corrected CPU freq (2 MHz) in cuoreuno and elephfam (both have R65c02P2). | |
| 837 | (I suspect more games must have their CPU running at 2 MHz). | |
| 838 | - Corrected videoram and colorram offsets in cuoreuno and elephfam. | |
| 839 | - To initialize the NVRAM in cuoreuno and elephfam: | |
| 840 | Start game, press and hold Service1 & Service2, press reset (F3), | |
| 841 | release Service1 & Service2 and press reset (F3) again. | |
| 842 | ||
| 843 | [2006/10/18] | |
| 844 | - Corrected the screen size and visible area to cuoreuno and elephfam based on mc6845 registers. | |
| 845 | - Added all inputs to cuoreuno and elephfam. | |
| 846 | - Added test mode DIP switch to cuoreuno and elephfam. | |
| 847 | - Managed cuoreuno and elephfam inputs to pass the initial checks. Now both games are playable. | |
| 848 | - Changed the cuoreuno full name to "Cuore 1" (as shown in the attract). | |
| 849 | ||
| 850 | [2006/10/22-28] | |
| 851 | - Corrected cuoreuno and elephfam graphics to 4bpp. | |
| 852 | - Fixed elephfam gfx planes. | |
| 853 | - Simulated cuoreuno palette based on screenshots. | |
| 854 | - Simulated elephfam palette based on screenshots. | |
| 855 | ||
| 856 | ||
| 857 | [2006/11/01 to 2006/12/04] | |
| 858 | ||
| 859 | ******** REWRITE ******** | |
| 860 | ||
| 861 | - Merged/splitted some machine drivers, memory maps and inputs. | |
| 862 | - Unified get_bg_tile_info for all games. | |
| 863 | - Mapped the input buttons in a better format (all games). Keys: 156-QW-ZXCVBNM. | |
| 864 | - Added proper color PROM decode routines. | |
| 865 | - Rewrote the technical notes. | |
| 866 | - Splitted the driver to driver/video. | |
| 867 | ||
| 868 | - Corrected the screen size and visible area to magiccrd based on mc6845 registers. | |
| 869 | - Added the remaining 2 GFX planes to magiccrd, but GFX are imperfect (bad decode or bad dump?). Color PROM need to be dumped. | |
| 870 | - Royalcrd: Added all inputs and DIP switches. | |
| 871 | Fixed memory map, gfx decode | |
| 872 | Corrected screen size and visible area based on mc6845 registers. | |
| 873 | Corrected CPU clock to 2mhz. | |
| 874 | ||
| 875 | - New game added: Joker Poker. Not working due to use of custom encrypted CPU. | |
| 876 | - New game added: Royal Card (Slovakia, encrypted). Not working due to use of a custom encrypted CPU. | |
| 877 | - Fixed jolycdcr gfx to 4bpp. | |
| 878 | - Other fixes to get jolycdcr running. | |
| 879 | - Managed royalcdb to work, using the 2nd half of program ROM. (seems to be mapped that way) | |
| 880 | - Managed jolycdit to work, but with imperfect graphics due to gfx encryption. | |
| 881 | - Fixed CPU clock to 2MHz. in all remaining games. | |
| 882 | - Fixed ay8910 frequency based on elephfam audio. | |
| 883 | - Fixed ay8910 volume in all games to avoid clipping. | |
| 884 | - Reworked jolycdcr inputs: The game was designed to work only with remote credits. After nvram init, set the payout dip to "manual". | |
| 885 | - Reworked jolycdit inputs: After nvram init, set the payout dip to "manual" to allow work the remote mode. | |
| 886 | - Set jolycdat as bigdeal clone. The game has the same layout/behaviour instead of the normal jolly card games, even when are sharing gfx roms. | |
| 887 | - Added the bipolar PROM and GAL to jolycdit. Confirmed the GFX ROMs as good dumps. | |
| 888 | - Added an alternate set of Elephant Family. This one lacks of test mode and doesn't allow to switch between min-max bets through stop1. | |
| 889 | - Added color PROMs to cuoreuno and elephfam sets but still no routed. Also added PLDs (protected, bad dumps). | |
| 890 | - Corrected jollycrd screen size and visible area based on mc6845 registers. | |
| 891 | - Hooked, wired and decoded the color prom in jollycrd sets based on jolycdit redump. Now colors are perfect. | |
| 892 | - Wired and decoded the color prom in cuoreuno and elephfam sets. Now colors are perfect. | |
| 893 | - Wired and decoded the color prom in royalcrd. Now colors are perfect. | |
| 894 | - Hooked, wired and decoded the color prom in bigdeal sets based on jolycdat (jollycrd palette). | |
| 895 | Colors seems to be correct, but need to check against the real thing. Flagged as IMPERFECT_COLORS till a color PROM dump appear. | |
| 896 | - Decrypted jolycdit gfx roms. | |
| 897 | - Added set Jolly Card (Austria, encrypted). | |
| 898 | - Decrypted jolycdae and managed the planes to show correct colors. The set is working properly. | |
| 899 | ||
| 900 | ||
| 901 | [2006/12/24] | |
| 902 | - Fixed some incomplete inputs. | |
| 903 | - Added new working game: Pool 10. | |
| 904 | - Added new working game: Tortuga Family. | |
| 905 | - Added new game: Mongolfier New. Not working due to the lack of MCU emulation. | |
| 906 | - Added new game: Soccer New. Not working due to the lack of MCU emulation. | |
| 907 | - Updated technical notes. | |
| 908 | ||
| 909 | [2007/02/01] | |
| 910 | - All crystals documented via #defines. | |
| 911 | - All CPU and sound clocks derived from #defined crystal values. | |
| 912 | - Added DIPLOCATIONS to all games. | |
| 913 | - Added a pool10 alternate set. | |
| 914 | - Added proper tsc87c52 MCU dumps to monglfir and soccernew. | |
| 915 | - Modified the refresh rate to 60 fps according to some video evidences. | |
| 916 | - Updated technical notes. | |
| 917 | ||
| 918 | [2007/02/25] | |
| 919 | - Added new game: Snooker 10 (Ver 1.11). Preliminary. | |
| 920 | Properly decoded GFX | |
| 921 | Proper colors decoded. | |
| 922 | - Updated technical notes. | |
| 923 | ||
| 924 | [2007/09/21] | |
| 925 | - Added new game: Saloon (France, encrypted). Preliminary. | |
| 926 | - Updated technical notes. | |
| 927 | ||
| 928 | [2008/02/10] | |
| 929 | - Switched to XTAL def. | |
| 930 | - Fixed Magic Card II graphics issues. | |
| 931 | - Fixed Magic Card II inputs. | |
| 932 | - Fixed screen and visible area to snooker10. | |
| 933 | - Renamed set monglfir to mongolnw. | |
| 934 | - Renamed sets description based on languages instead of countries. | |
| 935 | - Added new game: Magic Card II (green TAB or Impera board). Not working yet. | |
| 936 | - Added new game: Magic Card II (blue TAB board, encrypted). Not working yet. | |
| 937 | - Added new game: Jolly Card (3x3 deal). | |
| 938 | - Added new game: Jolly Card Professional 2.0 (with 'enter code' screen to boot). | |
| 939 | - Added new game: Lucky Lady (3x3 deal). | |
| 940 | - Added new game: Lucky Lady (4x1 aces). | |
| 941 | - Added new game: Royal Vegas Joker Card (fast deal). | |
| 942 | - Added new game: Royal Vegas Joker Card (slow deal). | |
| 943 | - Fixed some years and manufacturers. | |
| 944 | - Updated technical notes. | |
| 945 | - Cleaned up the driver. | |
| 946 | ||
| 947 | [2008/02/22] | |
| 948 | - Switched the color decoding routines to use resnet code. | |
| 949 | - Added complete color connections to/from 74ls373 to the source. | |
| 950 | ||
| 951 | [2008/02/25] | |
| 952 | - Added new game: Royal Vegas Joker Card (fast deal, english gfx). | |
| 953 | - Added new game: Jolly Joker. | |
| 954 | - Added new game: Jolly Joker (50bet). | |
| 955 | - Added new game: Jolly Card (croatian, set 2). | |
| 956 | - Added new game: Jolly Card (Evona Electronic) | |
| 957 | - Added new game: Super Joly 2000 - 3x | |
| 958 | - Fixed some inputs. | |
| 959 | - Masked inputs to allow jolyjokra to boot. | |
| 960 | - Added minor corrections. | |
| 961 | - Updated technical notes. | |
| 962 | ||
| 963 | [2008/03/14] | |
| 964 | - Added proper inputs to jolyc980. | |
| 965 | - Added temporary patch to allow bypass the "code" screen in jolyc980. | |
| 966 | - Updated technical notes. | |
| 967 | ||
| 968 | [2008/03/18] | |
| 969 | - Added new game: Pot Game (italian). | |
| 970 | - Updated technical notes. | |
| 971 | ||
| 972 | [2008/04/18] | |
| 973 | - Removed the temporary hack to jolyc980. | |
| 974 | - Updated technical notes regarding Magic Card II & Jolly Card Professional 2.0. | |
| 975 | - Moved snookr10 to its own driver. | |
| 976 | - Minor clean-up. | |
| 977 | ||
| 978 | [2008/04/27] | |
| 979 | - Fixed AY8910 volume to all games to avoid clips. | |
| 980 | - Merge bigdeal and funworld machine drivers thanks to the AY8910 rewrite. | |
| 981 | - Removed old unaccurate commentary about magiccrd tiles. | |
| 982 | ||
| 983 | [2008/04/29] | |
| 984 | All CMC italian games: | |
| 985 | - Added TICKET and HOPPER buttons to allow payout through the SUPER GAME. | |
| 986 | - Documented the featured SUPER GAME with complete instructions. | |
| 987 | - Improved DIP switches to properly set the payout system. | |
| 988 | ||
| 989 | [2008/05/13] | |
| 990 | - Found the proper algorithm to decrypt the blue TAB PCB. | |
| 991 | - Replaced the old decryption tables with the proper decryption scheme. | |
| 992 | - Updated technical notes. | |
| 993 | ||
| 994 | [2008/07/30] | |
| 995 | - Added new clone: Pool 10 (italian, set 3). | |
| 996 | - Updated technical notes. | |
| 997 | ||
| 998 | [2008/09/12] | |
| 999 | - Added new clone: Pool 10 (italian, set 4). | |
| 1000 | - Improved lamps layout for all games. | |
| 1001 | - Added Pool 10 pinout and DIP switches info. | |
| 1002 | - Updated technical notes. | |
| 1003 | ||
| 1004 | [2008/12/01] | |
| 1005 | - Decripted saloon's program, graphics and color PROM. | |
| 1006 | - Created a new memory map and machine driver for saloon. | |
| 1007 | - Removed set jolycdae (it's not coming from a real board). | |
| 1008 | - Renamed the sets magiccrd, magiccda and magiccdb, to magicrd2, magicd2a and magicd2b. | |
| 1009 | - Updated technical notes. | |
| 1010 | ||
| 1011 | [2008/12/15] | |
| 1012 | - Added new set: Jolly Card (italian, encrypted bootleg). | |
| 1013 | No coins... Only remote credits. After nvram init, set the Payout DIP to 'manual' | |
| 1014 | to allow the remote credits mode to work. | |
| 1015 | - Created inputs from the scratch for jolycdib. | |
| 1016 | - Updated technical notes. | |
| 1017 | ||
| 1018 | [2008-12-26] | |
| 1019 | - Correctly setup the MC6845 device for all systems. | |
| 1020 | - Added common MC6845 device interface. | |
| 1021 | - Eliminated the screen size & visible area parameters to Magic Card 2. | |
| 1022 | ||
| 1023 | [2009/01/23] | |
| 1024 | - Added new sets: Bottle 10 (italian, set 1 & 2). | |
| 1025 | - Updated technical notes. | |
| 1026 | ||
| 1027 | [2009/09/09] | |
| 1028 | - Discovered and documented new features in Jolly Card (Evona Electronics). | |
| 1029 | - Removed the commented hack for joly980 driver init since is not needed anymore. | |
| 1030 | - Fixed a bug introduced with the massive input change, that didn't allow initialize | |
| 1031 | all sets that need the normal procedure to do it. | |
| 1032 | - Updated technical notes. | |
| 1033 | ||
| 1034 | ||
| 1035 | *** TO DO *** | |
| 1036 | ||
| 1037 | - Figure out the royalcdc & jokercrd encryption. | |
| 1038 | - Figure out the remaining PIA connections for almost all games. | |
| 1039 | - Fix Saloon and move it to its own driver. | |
| 1040 | - Fix the imperfect sound in Magic Card II. | |
| 1041 | - Reverse-engineering the boot code of Jolly Card Professional 2.0, | |
| 1042 | and Royal Card Professional 2.0 to get the proper codes to boot. | |
| 1043 | - Analyze the unknown writes to $2000/$4000 in some games. | |
| 1044 | - Check for the reads to the ay8910 output ports in some games. | |
| 1045 | - Figure out the MCU in monglfir and soccernw. | |
| 1046 | - Correct the ROM_REGION in some games to allow the use of RGN_FRAC | |
| 1047 | ||
| 1048 | ||
| 1049 | 596 | ***********************************************************************************/ |
| 1050 | 597 | |
| 1051 | 598 | |
| r7500 | r7501 | |
| 2146 | 1693 | MDRV_CPU_PROGRAM_MAP(saloon_map) |
| 2147 | 1694 | MACHINE_DRIVER_END |
| 2148 | 1695 | |
| 2149 | static const UINT8 jolyc980_default_eeprom[0x800] = { | |
| 2150 | 0x4C,0x17,0xAC,0x4C,0x3B,0xB6,0xAE,0x65,0x33,0x79,0x40,0x00,0x00,0x20,0x20,0x20, | |
| 2151 | 0x20,0x20,0x31,0x30,0x00,0x00,0x32,0x4D,0x64,0x30,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2152 | 0x00,0x00,0x00,0x00,0x60,0xE5,0x69,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2153 | 0x00,0x00,0x00,0x00,0x00,0x00,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2154 | 0x01,0x60,0x05,0x02,0x02,0x02,0xEE,0x07,0x00,0x01,0x00,0x09,0x09,0x99,0x6C,0xD8, | |
| 2155 | 0xA2,0x5A,0x00,0x04,0x00,0x01,0x2A,0x06,0x31,0x12,0x3D,0x00,0x00,0x00,0x01,0x0F, | |
| 2156 | 0x00,0x6D,0x00,0x00,0x00,0x00,0xBE,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2157 | 0xFE,0x04,0x04,0x04,0x40,0x02,0x15,0xB3,0x00,0x40,0x00,0x00,0x00,0x00,0xB8,0xFF, | |
| 2158 | 0x00,0x07,0x01,0x2A,0x38,0x18,0x03,0x3C,0x2C,0x24,0x35,0x0C,0x04,0x3F,0x06,0x31, | |
| 2159 | 0x12,0x3D,0x13,0x1A,0x23,0x11,0x21,0x24,0x1C,0x06,0x27,0xFF,0x00,0xFF,0x00,0xFF, | |
| 2160 | 0x00,0x00,0x01,0xFF,0x00,0xFF,0x00,0xF7,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x02,0x05, | |
| 2161 | 0x00,0x00,0x00,0xFF,0x00,0xFF,0x08,0xFF,0xE3,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF, | |
| 2162 | 0x40,0x6D,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF, | |
| 2163 | 0x00,0xFF,0x00,0xFF,0xDD,0xFD,0x07,0x80,0x07,0x02,0x08,0x80,0x08,0x02,0x0A,0x00, | |
| 2164 | 0x00,0x00,0x07,0x80,0x02,0x00,0x3F,0x00,0xFF,0xFF,0x00,0xFF,0xF0,0xFF,0x00,0x04, | |
| 2165 | 0x00,0x00,0xF0,0xFF,0x00,0x00,0x50,0xFF,0x00,0x00,0x6C,0x0C,0x80,0xE8,0x02,0xFE, | |
| 2166 | 0x48,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00, | |
| 2167 | 0xFF,0x00,0xFE,0x00,0xFF,0x00,0xEE,0xEC,0x68,0xED,0x00,0x3D,0x9B,0x81,0xC2,0x00, | |
| 2168 | 0x40,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2169 | 0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2170 | 0x00,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2171 | 0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2172 | 0x00,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2173 | 0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2174 | 0x40,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2175 | 0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00, | |
| 2176 | 0xDF,0x00,0xC2,0x00,0xDF,0x00,0xC2,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00, | |
| 2177 | 0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00, | |
| 2178 | 0x40,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00,0xFF,0x00,0xFE,0x00, | |
| 2179 | 0xFF,0x00,0xFE,0x00,0xFF,0xEB,0xEB,0x60,0x60,0x60,0xB1,0x60,0xB1,0x60,0x60,0x60, | |
| 2180 | 0xB1,0x89,0xB1,0x0E,0xB0,0x31,0x20,0x20,0x20,0x20,0x20,0x00,0x40,0x79,0x60,0x67, | |
| 2181 | 0x82,0x00,0x04,0x77,0x20,0xD0,0x28,0xA0,0xC3,0x8F,0x4A,0xAB,0x75,0xAB,0xA9,0x86, | |
| 2182 | 0x00,0x00,0x00,0x01,0x98,0x05,0x05,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2183 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x02,0x00, | |
| 2184 | 0x01,0x00,0x00,0x00,0x3F,0x06,0x31,0x12,0x3D,0x06,0x00,0x00,0x00,0x00,0x00,0xFF, | |
| 2185 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2186 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2187 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2188 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2189 | 0x01,0x01,0x00,0x02,0x00,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2190 | 0x56,0x32,0x2E,0x30,0x20,0x05,0x04,0x00,0x00,0x03,0x05,0x08,0x02,0x02,0x00,0x00, | |
| 2191 | 0x00,0x01,0x29,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2192 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2193 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2194 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2195 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2196 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2197 | 0x18,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2198 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2199 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2200 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2201 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2202 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2203 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2204 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2205 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2206 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2207 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2208 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2209 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2210 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2211 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2212 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2213 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2214 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2215 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2216 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2217 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2218 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2219 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2220 | 0x29,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2221 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2222 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2223 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2224 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2225 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2226 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2227 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2228 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2229 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2230 | 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2231 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2232 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2233 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2234 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2235 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2236 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2237 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2238 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2239 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2240 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2241 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2242 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2243 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2244 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2245 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2246 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2247 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2248 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2249 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2250 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2251 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2252 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2253 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2254 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2255 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2256 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2257 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2258 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2259 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2260 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2261 | 0xF0,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xF0,0x00,0x00,0x00,0x7C,0x00,0x00,0x9F, | |
| 2262 | 0x91,0x62,0x04,0x00,0x00,0x00,0x05,0x15,0x09,0x00,0x00,0x00,0x31,0x85,0x03,0x00, | |
| 2263 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2264 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2265 | 0x00,0x00,0x00,0x91,0x62,0x04,0x00,0x00,0x00,0x05,0x15,0x09,0x00,0x00,0x00,0x31, | |
| 2266 | 0x85,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2267 | 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2268 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2269 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2270 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2271 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2272 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2273 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2274 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2275 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 2276 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9D, | |
| 2277 | 0x1C,0x80,0xF0,0x02,0x00,0x00,0x00,0x80,0x60,0xEB,0x00,0xF7,0x40,0xFF,0x00,0x21 | |
| 2278 | }; | |
| 2279 | 1696 | |
| 1697 | ||
| 1698 | /************************* | |
| 1699 | * Rom Load * | |
| 1700 | *************************/ | |
| 1701 | ||
| 2280 | 1702 | /* |
| 2281 | Load a default eeprom, otherwise an annoying password system should be inserted with | |
| 2282 | inputs correlated to a code that pops up on the screen. | |
| 2283 | This code should be inserted into a PC-DOS program, that program is nowhere to be found right now. | |
| 2284 | */ | |
| 2285 | static NVRAM_HANDLER( jolyc980 ) | |
| 2286 | { | |
| 2287 | if (read_or_write) | |
| 2288 | mame_fwrite(file, machine->generic.nvram.v, machine->generic.nvram_size); | |
| 2289 | else if (file) | |
| 2290 | mame_fread(file, machine->generic.nvram.v, machine->generic.nvram_size); | |
| 2291 | else | |
| 2292 | { | |
| 2293 | int i; | |
| 2294 | for(i=0;i<machine->generic.nvram_size;i++) | |
| 2295 | machine->generic.nvram.u8[i] = jolyc980_default_eeprom[i]; | |
| 2296 | } | |
| 2297 | } | |
| 1703 | Jolly Card, TAB Austria | |
| 1704 | ----------------------- | |
| 2298 | 1705 | |
| 2299 | static MACHINE_DRIVER_START( jolyc980 ) | |
| 2300 | MDRV_IMPORT_FROM(cuoreuno) | |
| 1706 | Pinouts: | |
| 2301 | 1707 | |
| 2302 | MDRV_NVRAM_HANDLER( jolyc980 ) | |
| 2303 | MACHINE_DRIVER_END | |
| 1708 | X1-01 GND X1-A GND | |
| 1709 | X1-02 GND X1-B GND | |
| 1710 | X1-03 GND X1-C GND | |
| 1711 | X1-04 +5V X1-D +5V | |
| 1712 | X1-05 +12V X1-E +12V | |
| 1713 | X1-06 NC X1-F NC | |
| 1714 | X1-07 NC X1-G NC | |
| 1715 | X1-08 NC X1-H NC | |
| 1716 | X1-09 NC X1-I Coin 1 | |
| 1717 | X1-10 Coin 2 X1-J Pay Out SW | |
| 1718 | X1-11 Hold 3 X1-K NC | |
| 1719 | X1-12 NC X1-L GND | |
| 1720 | X1-13 Hold 4 X1-M Remote | |
| 1721 | X1-14 Bookkeeping SW X1-N GND | |
| 1722 | X1-15 Hold 2 X1-O Cancel | |
| 1723 | X1-16 Hold 1 X1-P Hold 5 | |
| 1724 | X1-17 Start X1-Q | |
| 1725 | X1-18 Hopper Out X1-R | |
| 1726 | X1-19 Red X1-S Green | |
| 1727 | X1-20 Blue X1-T Sync | |
| 1728 | X1-21 GND X1-U Speaker GND | |
| 1729 | X1-22 Speaker + X1-V Management SW | |
| 2304 | 1730 | |
| 1731 | X2-01 GND X2-A GND | |
| 1732 | X2-02 NC X2-B NC | |
| 1733 | X2-03 Start X2-C NC | |
| 1734 | X2-04 NC X2-D NC | |
| 1735 | X2-05 NC X2-E NC | |
| 1736 | X2-06 Lamp Start X2-F Lamp Hold 1+3 | |
| 1737 | X2-07 Lamp Hold 2 X2-G Lamp Hold 4 | |
| 1738 | X2-08 Lamp Hold 5 X2-H Lamp Cancel | |
| 1739 | X2-09 NC X2-I NC | |
| 1740 | X2-10 Counter In X2-J Counter Out | |
| 1741 | X2-11 Hopper Count X2-K Hopper Drive | |
| 1742 | X2-12 Counter Remote X2-L | |
| 1743 | X2-13 X2-M | |
| 1744 | X2-14 X2-N | |
| 1745 | X2-15 NC X2-O | |
| 1746 | X2-16 X2-P | |
| 1747 | X2-17 X2-Q Coin Counter | |
| 1748 | X2-18 X2-R | |
| 2305 | 1749 | |
| 2306 | /************************* | |
| 2307 | * Rom Load * | |
| 2308 | *************************/ | |
| 1750 | --------------------------------------------------- | |
| 2309 | 1751 | |
| 1752 | DIP Switches: | |
| 1753 | ||
| 1754 | ON OFF | |
| 1755 | ||
| 1756 | 1 Hopper Manual Payout SW :Payout | |
| 1757 | 2 Auto Hold No Auto Hold :Hold | |
| 1758 | 3 Joker Without Joker :Joker | |
| 1759 | 4 Dattl Insert TAB Insert :Inserts | |
| 1760 | 5 5 Points/Coin 10 Points/Coin :Coin 1 | |
| 1761 | 6 5 Points/Coin 10 Points/Coin :Coin 2 | |
| 1762 | 7 10 Points/Pulse 100 Points/Pulse :Remote | |
| 1763 | 8 Play Keyboard Test :Mode | |
| 1764 | ||
| 1765 | --------------------------------------------------- | |
| 1766 | */ | |
| 1767 | ||
| 2310 | 1768 | ROM_START( jollycrd ) |
| 2311 | 1769 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2312 | 1770 | ROM_LOAD( "jolycard.run", 0x8000, 0x8000, CRC(f531dd10) SHA1(969191fbfeff4349afef619d9241ef5186e6d57f) ) |
| r7500 | r7501 | |
| 2319 | 1777 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2320 | 1778 | ROM_END |
| 2321 | 1779 | |
| 1780 | ||
| 2322 | 1781 | ROM_START( jolycdae ) /* encrypted roms...*/ |
| 2323 | 1782 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2324 | 1783 | ROM_LOAD( "pokeru0.bin", 0x8000, 0x10000, CRC(7732f177) SHA1(b75fca596a7315d1379fa5bcf07c449ec32c90f5) ) |
| r7500 | r7501 | |
| 2332 | 1791 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2333 | 1792 | ROM_END |
| 2334 | 1793 | |
| 1794 | ||
| 2335 | 1795 | ROM_START( jolyc3x3 ) |
| 2336 | 1796 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2337 | 1797 | ROM_LOAD( "jc3x3.bin", 0x8000, 0x8000, CRC(71e304ad) SHA1(238b792d841432582c94b21a674d46a95e8f3826) ) |
| r7500 | r7501 | |
| 2344 | 1804 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2345 | 1805 | ROM_END |
| 2346 | 1806 | |
| 1807 | ||
| 1808 | /* | |
| 1809 | Jolly Card Professional 2.0 | |
| 1810 | ||
| 1811 | Special version with maximum bet up to 98 credits. | |
| 1812 | This game has an annoying password system through a DOS program. | |
| 1813 | */ | |
| 1814 | ||
| 2347 | 1815 | ROM_START( jolyc980 ) |
| 2348 | 1816 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2349 | 1817 | ROM_LOAD( "j980.bin", 0x8000, 0x8000, CRC(48249fff) SHA1(390cd0eb3399446a66363dc6760458170e1970fd) ) |
| r7500 | r7501 | |
| 2352 | 1820 | ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) ) |
| 2353 | 1821 | ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) ) |
| 2354 | 1822 | |
| 1823 | /* Load a default eeprom, otherwise an annoying password system should be inserted with | |
| 1824 | inputs correlated to a code that pops up on the screen. | |
| 1825 | This code should be inserted into a PC-DOS program, that program is nowhere to be found right now. | |
| 1826 | */ | |
| 1827 | ROM_REGION( 0x0800, "nvram", 0 ) | |
| 1828 | ROM_LOAD( "jolyc980_nv.bin", 0x0000, 0x0800, CRC(c917f071) SHA1(fdcd974d3acd4acf2e0ff5fca820cfc65fe18867) ) /* default NVRAM */ | |
| 1829 | ||
| 2355 | 1830 | ROM_REGION( 0x0200, "proms", 0 ) |
| 2356 | 1831 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2357 | 1832 | ROM_END |
| 2358 | 1833 | |
| 1834 | ||
| 2359 | 1835 | ROM_START( jolycdev ) /* Jolly Card (lipa) from Evona */ |
| 2360 | 1836 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2361 | 1837 | ROM_LOAD( "lipa.bin", 0x8000, 0x8000, CRC(62657c98) SHA1(237466dde26540c119c631c75f51c87ea59d1a91) ) |
| r7500 | r7501 | |
| 2371 | 1847 | ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) ) |
| 2372 | 1848 | ROM_END |
| 2373 | 1849 | |
| 1850 | ||
| 1851 | /* | |
| 1852 | Jolly Card (other) | |
| 1853 | ------------------ | |
| 1854 | ||
| 1855 | - 1x G65SC02P (CPU) | |
| 1856 | - 1x MC68B45P (CRTC) | |
| 1857 | - 1x AY3-8910 (sound) | |
| 1858 | - 2x MC6821P (PIAs) | |
| 1859 | ||
| 1860 | RAM: - 1x NVram DS1220Y (instead of 6116) | |
| 1861 | - 1x KM6264AL-10 | |
| 1862 | ||
| 1863 | - 1x Crystal : 16.000 MHz | |
| 1864 | */ | |
| 1865 | ||
| 2374 | 1866 | ROM_START( jolyccra ) /* Jolly Card (croatian, set 1) */ |
| 2375 | 1867 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2376 | 1868 | ROM_LOAD( "jollyc.bin", 0x8000, 0x8000, CRC(8926d99d) SHA1(dd5d1ac03d30d823dfcfe1349328ecb7afbc37fa) ) |
| r7500 | r7501 | |
| 2383 | 1875 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2384 | 1876 | ROM_END |
| 2385 | 1877 | |
| 1878 | ||
| 2386 | 1879 | ROM_START( jolyccrb ) /* Jolly Card (croatian, set 2) */ |
| 2387 | 1880 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2388 | 1881 | ROM_LOAD( "jollypkr.003", 0x8000, 0x8000, CRC(ea7340b4) SHA1(7dd468f28a488a4781521809d06db1d7917048ad) ) |
| r7500 | r7501 | |
| 2395 | 1888 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2396 | 1889 | ROM_END |
| 2397 | 1890 | |
| 1891 | ||
| 1892 | /* | |
| 1893 | Jolly Card (italian, blue Tab board, encrypted) | |
| 1894 | ----------------------------------------------- | |
| 1895 | ||
| 1896 | - 1x HY6264LP | |
| 1897 | - 1x MC6845P | |
| 1898 | - 1x HM6116LP | |
| 1899 | - 1x G65SC02 (main) | |
| 1900 | - 1x AY-3-8910 (sound) | |
| 1901 | - 1x MC6821P | |
| 1902 | - 1x oscillator 16.000 MHz | |
| 1903 | - ROMs 2x TMS27c256 (1,2) | |
| 1904 | 1x M5M27256 (jn) | |
| 1905 | - 1x prom N82S147 | |
| 1906 | - 1x GAL16V8B | |
| 1907 | - 2x HY18CV85 (electrically-erasable PLD) | |
| 1908 | - 1x 8 DIP switches | |
| 1909 | - 1x 22x2 edge connector | |
| 1910 | - 1x 18x2 edge connector | |
| 1911 | - 1x trimmer (volume)(missing) | |
| 1912 | */ | |
| 1913 | ||
| 2398 | 1914 | ROM_START( jolycdit ) /* blue TAB PCB, encrypted graphics */ |
| 2399 | 1915 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2400 | 1916 | ROM_LOAD( "jn.bin", 0x8000, 0x8000, CRC(6ae00ed0) SHA1(5921c2882aeb5eadd0e04a477fa505ad35e9d98c) ) |
| r7500 | r7501 | |
| 2410 | 1926 | ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) ) |
| 2411 | 1927 | ROM_END |
| 2412 | 1928 | |
| 2413 | /* jolycdit vs jolycdib: | |
| 2414 | 1929 | |
| 2415 | 1.BIN 1.BIN IDENTICAL | |
| 2416 | 2.BIN 2.bin IDENTICAL | |
| 2417 | jn.BIN 3.BIN 97.726440% | |
| 1930 | /* | |
| 1931 | Jolly Card (italian encrypted bootleg) | |
| 1932 | -------------------------------------- | |
| 2418 | 1933 | |
| 2419 | jolycdib program seems to be the original for blue TAB PCB. | |
| 2420 | jolycdit has some code patches and redirected parts to suspicious offsets (as d500, d000, etc) | |
| 1934 | - 1x UM6845P | |
| 1935 | - 1x R65C02P3 (main CPU) | |
| 1936 | - 1x AY-3-8910 (sound) | |
| 1937 | - 2x MC68B21P | |
| 1938 | - 1x oscillator 16.000 MHz | |
| 1939 | - ROMs 3x 27256. | |
| 1940 | - 1x PROM M1-7649-5 (not dumped) | |
| 1941 | - 2x PLD HY18CV8S (not dumped) | |
| 1942 | - 1x PAL16L8ACN (not dumped) | |
| 1943 | - 1x 22x2 edge connector | |
| 1944 | - 1x 18x2 edge connector | |
| 1945 | - 1x trimmer (volume) | |
| 1946 | - 1x 8x2 DIP switches. | |
| 1947 | ||
| 1948 | jolycdit vs jolycdib: | |
| 1949 | ||
| 1950 | 1.BIN 1.BIN IDENTICAL | |
| 1951 | 2.BIN 2.bin IDENTICAL | |
| 1952 | jn.BIN 3.BIN 97.726440% | |
| 1953 | ||
| 1954 | jolycdib program seems to be the original for blue TAB PCB. | |
| 1955 | jolycdit has some code patches and redirected parts to suspicious offsets (as d500, d000, etc) | |
| 2421 | 1956 | */ |
| 1957 | ||
| 2422 | 1958 | ROM_START( jolycdib ) /* bootleg PCB, encrypted graphics */ |
| 2423 | 1959 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2424 | 1960 | ROM_LOAD( "3.bin", 0x8000, 0x8000, CRC(c76fdc79) SHA1(fc75c274d64fa9c99a546d424f38e79f1acf2576) ) |
| r7500 | r7501 | |
| 2434 | 1970 | ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) ) |
| 2435 | 1971 | ROM_END |
| 2436 | 1972 | |
| 1973 | ||
| 2437 | 1974 | ROM_START( sjcd2kx3 ) /* Super Joly 2000 3x */ |
| 2438 | 1975 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2439 | 1976 | ROM_LOAD( "sj3.bin", 0x8000, 0x8000, CRC(c530b518) SHA1(36934d8e1e2cb2f71eb44a05b86ec970c9f398cd) ) |
| r7500 | r7501 | |
| 2449 | 1986 | ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) ) |
| 2450 | 1987 | ROM_END |
| 2451 | 1988 | |
| 1989 | ||
| 2452 | 1990 | ROM_START( jolycdab ) |
| 2453 | 1991 | ROM_REGION( 0x10000, "maincpu", 0 ) /* program is testing/writting RAM in offset $8800-$BFFF (ROM)...?? */ |
| 2454 | 1992 | ROM_LOAD( "ig1poker.run", 0x8000, 0x8000, CRC(c96e6542) SHA1(ed6c0cf9fe8597dba9149b2225320d8d9c39219a) ) |
| r7500 | r7501 | |
| 2462 | 2000 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2463 | 2001 | ROM_END |
| 2464 | 2002 | |
| 2003 | ||
| 2004 | /* | |
| 2005 | Big Deal (hungarian) | |
| 2006 | ------------------ | |
| 2007 | ||
| 2008 | - 1x MC6845P | |
| 2009 | - 1x YM2149F | |
| 2010 | - 2x MC6821P | |
| 2011 | - 1x Crystal 16.000 MHz | |
| 2012 | */ | |
| 2013 | ||
| 2465 | 2014 | ROM_START( bigdeal ) |
| 2466 | 2015 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2467 | 2016 | ROM_LOAD( "poker4.001", 0x8000, 0x8000, CRC(bb0198c1) SHA1(6e7d42beb5723a4368ae3788f83b448f86e5653d) ) |
| r7500 | r7501 | |
| 2474 | 2023 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2475 | 2024 | ROM_END |
| 2476 | 2025 | |
| 2026 | ||
| 2477 | 2027 | ROM_START( bigdealb ) |
| 2478 | 2028 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2479 | 2029 | ROM_LOAD( "poker8.003", 0x8000, 0x8000, CRC(09c93745) SHA1(a64e96ef3489bc37c2c642f49e62cfef371de6f1) ) |
| r7500 | r7501 | |
| 2486 | 2036 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2487 | 2037 | ROM_END |
| 2488 | 2038 | |
| 2039 | ||
| 2040 | /* | |
| 2041 | Jolly Card (austrian, Funworld, bootleg) | |
| 2042 | ---------------------------------------- | |
| 2043 | ||
| 2044 | - 1x G65SC02P (CPU) | |
| 2045 | - 1x MC68B45P (CRTC) | |
| 2046 | - 1x AY3-8910 (sound) | |
| 2047 | - 2x MC6821P (PIAs) | |
| 2048 | ||
| 2049 | RAM: - 1x 6116 | |
| 2050 | - 1x KM6264AL-10 | |
| 2051 | ||
| 2052 | - 1x Crystal : 16.000 MHz | |
| 2053 | */ | |
| 2054 | ||
| 2489 | 2055 | ROM_START( jolycdat ) /* there are unused pieces of code that compare or jumps within $4000-$5000 range */ |
| 2490 | 2056 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2491 | 2057 | ROM_LOAD( "bonucard.cpu", 0x8000, 0x4000, CRC(da342100) SHA1(451fa6074aad19e9efd148c3d18115a20a3d344a) ) |
| r7500 | r7501 | |
| 2499 | 2065 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2500 | 2066 | ROM_END |
| 2501 | 2067 | |
| 2068 | ||
| 2069 | /* | |
| 2070 | Cuore Uno (italian) | |
| 2071 | ----------------------------------- | |
| 2072 | ||
| 2073 | - CPU 1x G65SC02P | |
| 2074 | - 1x MC68B45P (CRT controller) | |
| 2075 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 2076 | - 1x unknown (95101) DIP40 mil600 | |
| 2077 | - 1x oscillator 16.000000 MHz | |
| 2078 | - ROMs 1x TMS27C512 | |
| 2079 | 2x TMS27C256 | |
| 2080 | - 1x PROM AM27S29 | |
| 2081 | - 2x PALCE20V8H | |
| 2082 | - 1x PALCE16V8H (soldered) | |
| 2083 | - Note 1x JAMMA edge connector (keep -5 disconnected) | |
| 2084 | - 1x trimmer (volume) | |
| 2085 | - 1x 8 DIP switches | |
| 2086 | - 1x battery | |
| 2087 | */ | |
| 2088 | ||
| 2502 | 2089 | ROM_START( cuoreuno ) |
| 2503 | 2090 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2504 | 2091 | ROM_LOAD( "cuore1a.u2", 0x8000, 0x8000, CRC(6e112184) SHA1(283ac534fc1cb33d11bbdf3447630333f2fc957f) ) |
| r7500 | r7501 | |
| 2516 | 2103 | ROM_LOAD( "palce20v8h_cu.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2517 | 2104 | ROM_END |
| 2518 | 2105 | |
| 2106 | ||
| 2107 | /* | |
| 2108 | Elephant Family (italian, old) | |
| 2109 | ----------------------------- | |
| 2110 | ||
| 2111 | - CPU 1x R65C02P2 | |
| 2112 | - 1x MC68B45P (CRT controller) | |
| 2113 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 2114 | - 1x unknown (95101) DIP40 mil600 | |
| 2115 | - 1x oscillator 16.000 MHz | |
| 2116 | - ROMs 2x M27C256 | |
| 2117 | 1x TMS27C256 | |
| 2118 | - 1x PROM AM27S29 | |
| 2119 | - 2x PALCE20V8H (read protected) | |
| 2120 | - 1x PALCE16V8H (read protected) | |
| 2121 | - Note 1x JAMMA edge connector (keep -5 disconnected) | |
| 2122 | - 1x trimmer (volume) | |
| 2123 | - 1x 8 DIP switches | |
| 2124 | - 1x battery | |
| 2125 | */ | |
| 2126 | ||
| 2519 | 2127 | ROM_START( elephfam ) |
| 2520 | 2128 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2521 | 2129 | ROM_LOAD( "eleph_a.u2", 0x8000, 0x10000, CRC(8392b842) SHA1(74c850c734ca8174167b2f826b9b1ac902669392) ) |
| r7500 | r7501 | |
| 2534 | 2142 | ROM_LOAD( "palce20v8h_ef.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2535 | 2143 | ROM_END |
| 2536 | 2144 | |
| 2145 | ||
| 2537 | 2146 | ROM_START( elephfmb ) |
| 2538 | 2147 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2539 | 2148 | ROM_LOAD( "now.u2", 0x8000, 0x8000, CRC(7b537ce6) SHA1(b221d08c53b9e14178335632420e78070b9cfb27) ) |
| r7500 | r7501 | |
| 2551 | 2160 | ROM_LOAD( "palce20v8h_ef.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2552 | 2161 | ROM_END |
| 2553 | 2162 | |
| 2163 | ||
| 2164 | /* | |
| 2165 | Pool 10 (italian) | |
| 2166 | ----------------- | |
| 2167 | ||
| 2168 | - 1x R65C02P2 (main) | |
| 2169 | - 1x YM2149F (sound) | |
| 2170 | - 1x HD46505 (CRT controller) | |
| 2171 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 2172 | - 1x oscillator 16.000000 MHz | |
| 2173 | ||
| 2174 | - 2x M27256 (pool,1) | |
| 2175 | - 1x D27256 (2) | |
| 2176 | - 1x PROM N82S147AN | |
| 2177 | - 2x GAL20V8B (read protected) | |
| 2178 | - 1x PALCE16V8H (read protected) | |
| 2179 | ||
| 2180 | - 1x JAMMA edge connector | |
| 2181 | - 1x trimmer (volume) | |
| 2182 | - 1x 8 DIP switches | |
| 2183 | - 1x battery | |
| 2184 | ||
| 2185 | ||
| 2186 | Connector, DIPs and instructions, | |
| 2187 | copied from an original sheet... | |
| 2188 | ||
| 2189 | Components | | solder | |
| 2190 | ---------------------|--|----------------- | |
| 2191 | gnd |01| gnd | |
| 2192 | gnd |02| gnd | |
| 2193 | +5 |03| +5 | |
| 2194 | +5 |04| +5 | |
| 2195 | |06| | |
| 2196 | +12 |07| +5 | |
| 2197 | |08| contatore out | |
| 2198 | motor hopper |09| contatore in | |
| 2199 | audio |10| audio | |
| 2200 | sw hopper |11| gnd | |
| 2201 | rosso |12| verde | |
| 2202 | blu |13| sync | |
| 2203 | gnd |14| statistic | |
| 2204 | manegement |15| | |
| 2205 | coin 1 |16| coin 2 | |
| 2206 | sw ticket |17| motor ticket | |
| 2207 | hold 3 |18| lamp hold 3 | |
| 2208 | hold 4 |19| lamp hold 4 | |
| 2209 | hold 2 |20| lamp hold 2 | |
| 2210 | hold 1 |21| lamp hold 1 | |
| 2211 | hold 5 |22| lamp hold 5 | |
| 2212 | start |23| lamp hold start | |
| 2213 | cancel |24| lamp hold cancel | |
| 2214 | nc |25| +5 lamp | |
| 2215 | ric. ticket + hopper |26| +12 lamp | |
| 2216 | gnd |27| gnd | |
| 2217 | gnd |28| gnd | |
| 2218 | ||
| 2219 | ||
| 2220 | DIPS | |
| 2221 | 1 2 3 4 5 6 7 8 | |
| 2222 | on | |
| 2223 | off | |
| 2224 | ticket + hopper on on | |
| 2225 | hopper on off | |
| 2226 | ticket off on | |
| 2227 | no ticket - no hopper off off | |
| 2228 | 1 coin 1 credit off off | |
| 2229 | 1 coin 5 credits off on | |
| 2230 | 1 coin 10 credits on off | |
| 2231 | 1 coin 50 credits on on | |
| 2232 | five of kind yes off | |
| 2233 | five of kind no on | |
| 2234 | royal flush yes off | |
| 2235 | royal flush no on | |
| 2236 | in test on | |
| 2237 | in game off | |
| 2238 | ||
| 2239 | ||
| 2240 | Instructions: | |
| 2241 | ||
| 2242 | STATISTICS = show in and out credits | |
| 2243 | MANEGEMENT = It's the general statistic. It shows in and out credits. | |
| 2244 | ||
| 2245 | To cancel statistics press CANCEL for 5 seconds. | |
| 2246 | To change max and min value for play connect to GND the manegement pin, | |
| 2247 | at the same time press toghether HOLD 2 + HOLD 4 for some seconds. | |
| 2248 | ||
| 2249 | The following menu will show up: | |
| 2250 | ||
| 2251 | HOLD 1 = modify max value for play 1 to 10. | |
| 2252 | HOLD 2 = modify min value foe play 1 to 5. | |
| 2253 | Press start to exit from programming mode. | |
| 2254 | ||
| 2255 | To unlock PCB from a possible lock: | |
| 2256 | connect GND to pins component15 and solder14 for 5 seconds | |
| 2257 | ||
| 2258 | NB. Use lamps by 12V 0,15W | |
| 2259 | Memory version: V16 | |
| 2260 | */ | |
| 2261 | ||
| 2554 | 2262 | ROM_START( pool10 ) |
| 2555 | 2263 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2556 | 2264 | ROM_LOAD( "pool10.u2", 0x8000, 0x8000, CRC(4e928756) SHA1(d9ac3d41ea32e060a7e269502b7f22333c5e6c61) ) |
| r7500 | r7501 | |
| 2568 | 2276 | ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */ |
| 2569 | 2277 | ROM_END |
| 2570 | 2278 | |
| 2279 | ||
| 2571 | 2280 | ROM_START( pool10b ) /* this set should be the parent */ |
| 2572 | 2281 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2573 | 2282 | ROM_LOAD( "u2.bin", 0x8000, 0x10000, CRC(64fee38e) SHA1(8a624a0b6eb4a3ba09e5b396dc5a01994dfdf294) ) |
| r7500 | r7501 | |
| 2587 | 2296 | ROM_LOAD( "palce20v8h_p10b.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2588 | 2297 | ROM_END |
| 2589 | 2298 | |
| 2299 | ||
| 2590 | 2300 | ROM_START( pool10c ) |
| 2591 | 2301 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2592 | 2302 | ROM_LOAD( "a.u2", 0x8000, 0x8000, CRC(ac157b17) SHA1(f2b7eb940273bc404d3e0d8dd0f00ca757cebf69) ) |
| r7500 | r7501 | |
| 2604 | 2314 | ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */ |
| 2605 | 2315 | ROM_END |
| 2606 | 2316 | |
| 2317 | ||
| 2607 | 2318 | ROM_START( pool10d ) |
| 2608 | 2319 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2609 | 2320 | ROM_LOAD( "3.50.u2", 0x8000, 0x10000, CRC(4c68e1f4) SHA1(bbab63a18e0c041ce519daa32e12dd1b6a672dce) ) |
| r7500 | r7501 | |
| 2621 | 2332 | ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */ |
| 2622 | 2333 | ROM_END |
| 2623 | 2334 | |
| 2335 | ||
| 2336 | /* | |
| 2337 | Tortuga Family (italian) & Pot Game (italian) | |
| 2338 | --------------------------------------------- | |
| 2339 | ||
| 2340 | - 1x G65SC02P2 (main) | |
| 2341 | - 1x 95101 (sound) | |
| 2342 | - 1x MC68B45P (CRT controller) | |
| 2343 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 2344 | - 1x oscillator 16.000000 MHz | |
| 2345 | ||
| 2346 | - 3x TMS27C256 | |
| 2347 | - 1x PROM AM27S29PC | |
| 2348 | - 2x PALCE20V8H (read protected) | |
| 2349 | - 1x PALCE16V8H (read protected) | |
| 2350 | ||
| 2351 | - 1x JAMMA edge connector | |
| 2352 | - 1x trimmer (volume) | |
| 2353 | - 1x 8 DIP switches | |
| 2354 | - 1x battery | |
| 2355 | */ | |
| 2356 | ||
| 2624 | 2357 | ROM_START( tortufam ) |
| 2625 | 2358 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2626 | 2359 | ROM_LOAD( "tortu.a.u2", 0x8000, 0x8000, CRC(6e112184) SHA1(283ac534fc1cb33d11bbdf3447630333f2fc957f) ) |
| r7500 | r7501 | |
| 2638 | 2371 | ROM_LOAD( "palce20v8h_tf.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2639 | 2372 | ROM_END |
| 2640 | 2373 | |
| 2374 | ||
| 2641 | 2375 | ROM_START( potgame ) |
| 2642 | 2376 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2643 | 2377 | ROM_LOAD( "now.u2", 0x8000, 0x8000, CRC(7b537ce6) SHA1(b221d08c53b9e14178335632420e78070b9cfb27) ) |
| r7500 | r7501 | |
| 2655 | 2389 | ROM_LOAD( "palce20v8h_pot.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */ |
| 2656 | 2390 | ROM_END |
| 2657 | 2391 | |
| 2392 | ||
| 2658 | 2393 | ROM_START( bottle10 ) |
| 2659 | 2394 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2660 | 2395 | ROM_LOAD( "boat_3.bin", 0x8000, 0x8000, CRC(e2db8334) SHA1(22ac4ce361a93b7e6d491e260635755dd562b294) ) |
| r7500 | r7501 | |
| 2672 | 2407 | ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */ |
| 2673 | 2408 | ROM_END |
| 2674 | 2409 | |
| 2410 | ||
| 2675 | 2411 | ROM_START( bottl10b ) |
| 2676 | 2412 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2677 | 2413 | ROM_LOAD( "3.u2", 0x8000, 0x8000, CRC(e2db8334) SHA1(22ac4ce361a93b7e6d491e260635755dd562b294) ) |
| r7500 | r7501 | |
| 2689 | 2425 | ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */ |
| 2690 | 2426 | ROM_END |
| 2691 | 2427 | |
| 2428 | ||
| 2429 | /* | |
| 2430 | Royal Card (set 1) | |
| 2431 | ------------------ | |
| 2432 | ||
| 2433 | - 1x HM6264LP | |
| 2434 | - 1x HD4650SP | |
| 2435 | - 1x HM6116LP | |
| 2436 | - 1x R65C02P2 (main) | |
| 2437 | - 1x WB5300 (labeled YM8910)(sound) | |
| 2438 | - 1x EF6821P | |
| 2439 | - 1x oscillator 16.000 MHz | |
| 2440 | ||
| 2441 | - 1x D27256 (1) | |
| 2442 | - 1x S27C256 (2) | |
| 2443 | - 1x TMS27C256 (r2) | |
| 2444 | - 2x PEEL18CV8 (1 protected) | |
| 2445 | - 1x PALCE16V8H (protected) | |
| 2446 | - 1x PROM N82S147AN | |
| 2447 | ||
| 2448 | - 1x 8 DIP Switches | |
| 2449 | - 1x 22x2 edge connector | |
| 2450 | - 1x 18x2 edge connector | |
| 2451 | - 1x trimmer (volume) | |
| 2452 | */ | |
| 2453 | ||
| 2692 | 2454 | ROM_START( royalcrd ) |
| 2693 | 2455 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2694 | 2456 | ROM_LOAD( "r2.bin", 0x8000, 0x8000, CRC(25dfe0dc) SHA1(1a857a910d0c34b6b5bfc2b6ea2e08ed8ed0cae0) ) |
| r7500 | r7501 | |
| 2706 | 2468 | ROM_LOAD( "2-peel18cv8.bin", 0x0400, 0x0155, CRC(8fdafd55) SHA1(fbb187ba682111648ea1586f400990cb81a3077a) ) |
| 2707 | 2469 | ROM_END |
| 2708 | 2470 | |
| 2471 | ||
| 2472 | /* | |
| 2473 | Royal Card (set 2) | |
| 2474 | ------------------ | |
| 2475 | ||
| 2476 | - CPU 1x R65C02P2 (main) | |
| 2477 | - 1x MC68B45P (CRT controller) | |
| 2478 | - 2x MC68B21CP (Peripheral Interface Adapter) | |
| 2479 | - 1x oscillator 16.000 MHz | |
| 2480 | - 3x ROMs TMS 27C512 | |
| 2481 | - 1x PALCE16V8H | |
| 2482 | - 1x prom AM27S29APC | |
| 2483 | ||
| 2484 | - 1x 28x2 connector (maybe NOT jamma) | |
| 2485 | - 1x 10x2 connector | |
| 2486 | - 1x 3 legs connector (solder side) | |
| 2487 | - 1x 8 DIP Switches | |
| 2488 | - 1x trimmer (volume) | |
| 2489 | */ | |
| 2490 | ||
| 2709 | 2491 | ROM_START( royalcdb ) /* both halves have different programs. we're using the 2nd one */ |
| 2710 | 2492 | ROM_REGION( 0x20000, "maincpu", 0 ) /* 1st half prg is testing RAM in offset $8600-$BF00...?? */ |
| 2711 | 2493 | ROM_LOAD( "rc.bin", 0x10000, 0x10000, CRC(8a9a6dd6) SHA1(04c3f9f17d5404ac1414c51ef8f930df54530e72) ) |
| r7500 | r7501 | |
| 2723 | 2505 | ROM_LOAD( "palce16v8h-4.bin", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */ |
| 2724 | 2506 | ROM_END |
| 2725 | 2507 | |
| 2508 | ||
| 2509 | /* | |
| 2510 | Royal Card (set 3, encrypted) | |
| 2511 | ----------------------------- | |
| 2512 | ||
| 2513 | - Custom/encrypted CPU (epoxy block labelled "EVONA EX9511" -> www.evona.sk ) | |
| 2514 | inserted into socked with "6502" mark. | |
| 2515 | ||
| 2516 | - 1x YM2149 | |
| 2517 | ||
| 2518 | - 1x HD6845 (CRT controller) | |
| 2519 | - 1x MC68A21P (PIA) | |
| 2520 | - 1x 40 pin IC with surface scratched (PIA) | |
| 2521 | - 1x 8 DIP Switches | |
| 2522 | - Sanyo LC3517B SRAM (videoram ?) | |
| 2523 | - 6264 battery backed SRAM (battery is dead) | |
| 2524 | - 1x PALCE16V8 | |
| 2525 | - 1x GAL16V8B | |
| 2526 | - 1x PEEL18CV8P x2 | |
| 2527 | - 1x 82S147 PROM (near Yamaha and unknown 40pin) - "82s147.bin" | |
| 2528 | - 1x 27256 close to CPU module - "1.bin" | |
| 2529 | - 2x 27256 - gfx - "2.bin", "3.bin" | |
| 2530 | */ | |
| 2531 | ||
| 2726 | 2532 | ROM_START( royalcdc ) /* encrypted program rom */ |
| 2727 | 2533 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2728 | 2534 | ROM_LOAD( "rc_1.bin", 0x8000, 0x8000, CRC(8cdcc978) SHA1(489b58760a7c8646399c8cdfb86ec4341823e7dd) ) |
| r7500 | r7501 | |
| 2740 | 2546 | ROM_LOAD( "2-peel18cv8p.bin", 0x0400, 0x0155, NO_DUMP ) /* not present in the set */ |
| 2741 | 2547 | ROM_END |
| 2742 | 2548 | |
| 2549 | ||
| 2743 | 2550 | ROM_START( royalcdp ) |
| 2744 | 2551 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2745 | 2552 | ROM_LOAD( "u16_m27c256b.bin", 0x8000, 0x8000, CRC(162996ff) SHA1(122c13ee9842e692d31490f216eb972df2321b7f) ) |
| r7500 | r7501 | |
| 2755 | 2562 | ROM_LOAD( "palce16v8h_1.bin", 0x0000, 0x0117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) |
| 2756 | 2563 | ROM_END |
| 2757 | 2564 | |
| 2565 | ||
| 2758 | 2566 | ROM_START( lluck3x3 ) |
| 2759 | 2567 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2760 | 2568 | ROM_LOAD( "l3x3.bin", 0x8000, 0x8000, CRC(dbdb07ff) SHA1(6be43aa0b2c10d83373f20f477606cb031bc6dd9) ) |
| r7500 | r7501 | |
| 2767 | 2575 | ROM_LOAD( "n82s147.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) ) |
| 2768 | 2576 | ROM_END |
| 2769 | 2577 | |
| 2578 | ||
| 2770 | 2579 | ROM_START( lluck4x1 ) |
| 2771 | 2580 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2772 | 2581 | ROM_LOAD( "rk4x1.bin", 0x8000, 0x8000, CRC(37f8a355) SHA1(a6eb4c53464e373bdecbbaaf146f5f7cf66b4bcd) ) |
| r7500 | r7501 | |
| 2779 | 2588 | ROM_LOAD( "n82s147.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) ) |
| 2780 | 2589 | ROM_END |
| 2781 | 2590 | |
| 2591 | ||
| 2592 | /* | |
| 2593 | Magic Card II (bulgarian) | |
| 2594 | --------------------------------- | |
| 2595 | ||
| 2596 | - 1x Special CPU with CM602 (??) on it | |
| 2597 | - 1x MC6845P | |
| 2598 | - 1x YM2149F | |
| 2599 | - 2x MC6821P | |
| 2600 | - 1x Crystal 16.000 MHz | |
| 2601 | - 2x HY18CV85 (electrically-erasable PLD) | |
| 2602 | ||
| 2603 | Some versions have Mexican Rockwell R65c02. | |
| 2604 | The game doesn't work with a regular 65c02 CPU. | |
| 2605 | */ | |
| 2606 | ||
| 2782 | 2607 | ROM_START( magicrd2 ) /* Impera */ |
| 2783 | 2608 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2784 | 2609 | ROM_LOAD( "magicard.004", 0x0000, 0x8000, CRC(f6e948b8) SHA1(7d5983015a508ab135ccbf69b7f3c526c229e3ef) ) /* only last 16kbyte visible? */ |
| r7500 | r7501 | |
| 2795 | 2620 | ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) ) |
| 2796 | 2621 | ROM_END |
| 2797 | 2622 | |
| 2623 | ||
| 2798 | 2624 | ROM_START( magicd2a ) /* for green TAB or Impera boards */ |
| 2799 | 2625 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2800 | 2626 | ROM_LOAD( "mc2prgv1.bin", 0x8000, 0x8000, CRC(7f759b70) SHA1(23a1a6e8eda57c4a90c51a970302f9a7bf590083) ) |
| r7500 | r7501 | |
| 2811 | 2637 | ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) ) |
| 2812 | 2638 | ROM_END |
| 2813 | 2639 | |
| 2640 | ||
| 2814 | 2641 | ROM_START( magicd2b ) /* for blue TAB board (encrypted)*/ |
| 2815 | 2642 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2816 | 2643 | // ROM_LOAD( "mc2prgv1.bin", 0x8000, 0x8000, CRC(7f759b70) SHA1(23a1a6e8eda57c4a90c51a970302f9a7bf590083) ) |
| r7500 | r7501 | |
| 2827 | 2654 | ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) ) |
| 2828 | 2655 | ROM_END |
| 2829 | 2656 | |
| 2657 | ||
| 2830 | 2658 | ROM_START( vegasslw ) |
| 2831 | 2659 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2832 | 2660 | ROM_LOAD( "vslow.bin", 0x8000, 0x8000, CRC(9cb7861a) SHA1(f934eacd5b3573a6bbeaa827f521b4a498e5bcdf) ) |
| r7500 | r7501 | |
| 2839 | 2667 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2840 | 2668 | ROM_END |
| 2841 | 2669 | |
| 2670 | ||
| 2842 | 2671 | ROM_START( vegasfst ) |
| 2843 | 2672 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2844 | 2673 | ROM_LOAD( "vfast.bin", 0x8000, 0x8000, CRC(87dfb28d) SHA1(9a06e695e59722b6c97e5a9fd2c8b238661e5a4a) ) |
| r7500 | r7501 | |
| 2851 | 2680 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2852 | 2681 | ROM_END |
| 2853 | 2682 | |
| 2683 | ||
| 2854 | 2684 | ROM_START( vegasfte ) /* Royal Vegas Joker Card (fast deal, english gfx) */ |
| 2855 | 2685 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2856 | 2686 | ROM_LOAD( "ch3.bin", 0x8000, 0x8000, CRC(87dfb28d) SHA1(9a06e695e59722b6c97e5a9fd2c8b238661e5a4a) ) |
| r7500 | r7501 | |
| 2863 | 2693 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2864 | 2694 | ROM_END |
| 2865 | 2695 | |
| 2866 | ROM_START( jolyjokr ) /* Jolly Joker (Impera, original) */ | |
| 2696 | ||
| 2697 | /* | |
| 2698 | ||
| 2699 | Impera - Jolly Joker | |
| 2700 | ||
| 2701 | PCB Layout: | |
| 2702 | _____________________________________________________________________________________________ | |
| 2703 | | __________ | | |
| 2704 | | | MOP1603 | | | |
| 2705 | | _________ __ |__________| | | |
| 2706 | | ________________________ | A | | | _______ __ __ |___ | |
| 2707 | | | | |_________| | | | | | | | | ___| | |
| 2708 | | | | |A | | | |D | |K | ___| | |
| 2709 | | | MC6845P | _________ | | | | | | | | ___| | |
| 2710 | | | | | A | | | |AY38910| | | | | ___| | |
| 2711 | | |________________________| |_________| |__| | A/P | |__| |__| ___| | |
| 2712 | | __ |9120CCA| ___| | |
| 2713 | | _________________ | | | | _______ ___| | |
| 2714 | | _____________ | | | | | | | K | ___| | |
| 2715 | | | T74LS245B1 | | KM6264BL_10 | |A | | | |_______| ___| | |
| 2716 | | |_____________| | | | | | | ___| | |
| 2717 | | | 206Y KOREA | | | | | _______ ___ ___| | |
| 2718 | | |_________________| |__| | | | | | |8 | | |
| 2719 | | | | | | |DIP| | | |
| 2720 | | _____________ _____________ |_______| | | | 1 | | | |
| 2721 | | | SN74LS374N | | SN74LS374N | |MC68B21| | | |___ | |
| 2722 | | |_____________| |_____________| ________________________ | P| | | ___| | |
| 2723 | | | R65C02P2 | | | |___|1 ___| | |
| 2724 | | __________________ _________ | 11450_12 | |0K2P | ___| | |
| 2725 | | |CH1 | |74LS194AN| | 9209 | |LLEG912| __ ___| | |
| 2726 | | | | |_________| |________________________| | 6| | | ___| | |
| 2727 | | | M27C512 | | | | | ___| | |
| 2728 | | | | ___ __________________ | | |J | ___| | |
| 2729 | | |__________________| _________ | | |JOKER RUN | | | | | ___| | |
| 2730 | | |74LS194AN| | | | | | | | | ___| | |
| 2731 | | __________________ |_________| | | | M27C512 | | | |__| ___| | |
| 2732 | | |CH2 | | B | | | |_______| ___| | |
| 2733 | | | | _________ | | |__________________| ___| | |
| 2734 | | | M27C512 | |74LS194AN| | | _______ __ ___| | |
| 2735 | | | | |_________| | | | | | | ___| | |
| 2736 | | |__________________| | | _______________ | | | | ___| | |
| 2737 | | |___| | | | | |J | ___| | |
| 2738 | | _________ ________ _________ | HYUNDAI | |MC68B21| | | ___| | |
| 2739 | | |T54LS174M| |DL002D | |74LS194AN| _______ | HY6116ALP_10 | | P| | | ___| | |
| 2740 | | |_________| |________| |_________| | C | | | | | |__| ___| | |
| 2741 | | |_______| |_______________| |0K2P | ___| | |
| 2742 | | __ __ __ _________ |LLEG912| __ ___| | |
| 2743 | | | | | | | | |XTAL | _______ | 6| | | ___| | |
| 2744 | | | | | | | | | | | D | | | | | ___| | |
| 2745 | | |I | |H | |G | | 16 Mhz | |_______| | | |J | ___| | |
| 2746 | | | | | | | | |_________| | | | | ___| | |
| 2747 | | | | | | | | _________ ____ | | | | ___| | |
| 2748 | | |__| | | | | | E | | F | | | |__| ___| | |
| 2749 | | |__| |__| |_________| |____| |_______| ___| | |
| 2750 | | | | |
| 2751 | |_____________________________________________________________________________________________| | |
| 2752 | ||
| 2753 | ||
| 2754 | A = PC74HCT157P | |
| 2755 | B = AMPAL16L8DC | |
| 2756 | C = HD74LS189P | |
| 2757 | D = T54LS14M2 | |
| 2758 | E = T74LS393B1 | |
| 2759 | F = TL7705ACP | |
| 2760 | G = SN74LS374N | |
| 2761 | H = AM27S29PC | |
| 2762 | I = PC74HCT174P | |
| 2763 | J = 4116R_001 | |
| 2764 | K = ULN2003A | |
| 2765 | ||
| 2766 | ||
| 2767 | DIP1: | |
| 2768 | ___________________ | |
| 2769 | | ON | | |
| 2770 | | _______________ | | |
| 2771 | | |#|#|#|#|#|#|#|#| | | |
| 2772 | | | | | | | | | | | | | |
| 2773 | | |_______________| | | |
| 2774 | | 1 2 3 4 5 6 7 8 | | |
| 2775 | |___________________| | |
| 2776 | ||
| 2777 | */ | |
| 2778 | ||
| 2779 | ROM_START( jolyjokr ) /* Jolly Joker (98bet, set 1) */ | |
| 2867 | 2780 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2868 | 2781 | ROM_LOAD( "impera3orig.bin", 0x8000, 0x8000, CRC(ceb3a0d5) SHA1(25efae9f225abddfa663e6abcc91801996e5b0ea) ) |
| 2869 | 2782 | |
| 2870 | 2783 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 2871 | ROM_LOAD( "impera2.bin", 0x0000, 0x8000, BAD_DUMP CRC(57c1ca04) SHA1(9d3e1f50795ebe5997532b67ba467fd6428e81d2) ) | |
| 2872 | ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(8e354c4a) SHA1(95d7edf83bb07b5c58312af6d8a7dff1cf87cba7) ) | |
| 2784 | ROM_LOAD( "impera2.bin", 0x0000, 0x8000, CRC(f0fa5941) SHA1(1fcade31ed6893ffcfd4efe97dfaaa31d24283ec) ) | |
| 2785 | ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(c3ab44dd) SHA1(e46c0fd94da561f57033647f1703fa135777ece5) ) | |
| 2873 | 2786 | |
| 2874 | 2787 | ROM_REGION( 0x0200, "proms", 0 ) |
| 2875 | ROM_LOAD( " | |
| 2788 | ROM_LOAD( "am2 | |
| 2876 | 2789 | ROM_END |
| 2877 | 2790 | |
| 2878 | ROM_START( jolyjokra ) /* Jolly Joker (Impera, 50bet) */ | |
| 2791 | ||
| 2792 | ROM_START( jolyjokra ) /* Jolly Joker (98bet, set 2) */ | |
| 2879 | 2793 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2880 | 2794 | ROM_LOAD( "impera50.bin", 0x8000, 0x8000, CRC(7effc044) SHA1(961438e7fb8222296fb959b510cdf646e4ac3226) ) |
| 2881 | 2795 | |
| 2882 | 2796 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 2883 | ROM_LOAD( "impera2.bin", 0x0000, 0x8000, BAD_DUMP CRC(57c1ca04) SHA1(9d3e1f50795ebe5997532b67ba467fd6428e81d2) ) | |
| 2884 | ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(8e354c4a) SHA1(95d7edf83bb07b5c58312af6d8a7dff1cf87cba7) ) | |
| 2797 | ROM_LOAD( "impera2.bin", 0x0000, 0x8000, CRC(f0fa5941) SHA1(1fcade31ed6893ffcfd4efe97dfaaa31d24283ec) ) | |
| 2798 | ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(c3ab44dd) SHA1(e46c0fd94da561f57033647f1703fa135777ece5) ) | |
| 2885 | 2799 | |
| 2886 | 2800 | ROM_REGION( 0x0200, "proms", 0 ) |
| 2887 | ROM_LOAD( " | |
| 2801 | ROM_LOAD( "am2 | |
| 2888 | 2802 | ROM_END |
| 2889 | 2803 | |
| 2804 | ||
| 2805 | /* | |
| 2806 | Jolly Joker (40bet, croatian hack) | |
| 2807 | ||
| 2808 | am27s29_ic40.bin 1ST AND 2ND HALF IDENTICAL | |
| 2809 | ic25.bin 1ST AND 2ND HALF IDENTICAL | |
| 2810 | ic26.bin 1ST AND 2ND HALF IDENTICAL | |
| 2811 | ||
| 2812 | These graphics ROMs have enough data to fix the bitrotten graphics from the other Jolly Joker sets. | |
| 2813 | impera1.bin ---> bits 7 & 6 | |
| 2814 | impera2.bin ---> bits 7 & 0 | |
| 2815 | ||
| 2816 | Two slightly different programs. One in each half. | |
| 2817 | Both have Min Bet (5), Max Bet (40). | |
| 2818 | Surely selectable through a PLD. | |
| 2819 | ||
| 2820 | */ | |
| 2821 | ROM_START( jolyjokrb ) | |
| 2822 | ROM_REGION( 0x18000, "maincpu", 0 ) /* Two slightly different programs. Using the 1st one...*/ | |
| 2823 | ROM_LOAD( "unbekannt.bin", 0x8000, 0x10000, CRC(327fa3d7) SHA1(2435aada2377b2f8f01d059a7aba9bc7a8993537) ) /* 1st prg */ | |
| 2824 | // ROM_LOAD( "unbekannt.bin", 0x0000, 0x10000, CRC(327fa3d7) SHA1(2435aada2377b2f8f01d059a7aba9bc7a8993537) ) /* 2nd prg */ | |
| 2825 | ||
| 2826 | ROM_REGION( 0x20000, "gfx1", 0 ) | |
| 2827 | ROM_LOAD( "ic25.bin", 0x00000, 0x10000, CRC(1bd067af) SHA1(9436fe085ba63c00a12ea80903470a84535e3dc1) ) | |
| 2828 | ROM_LOAD( "ic26.bin", 0x10000, 0x10000, CRC(3e45dfc6) SHA1(8fd0b0cc00cdd96244ae7e7a91f6613b1c144ee0) ) | |
| 2829 | ROM_COPY( "gfx1", 0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */ | |
| 2830 | ||
| 2831 | ROM_REGION( 0x0200, "proms", 0 ) | |
| 2832 | ROM_LOAD( "am27s29_ic40.bin", 0x0000, 0x0200, CRC(0b671bba) SHA1(92d512e02b50f98b7bc5a60deee4fee722656c4f) ) | |
| 2833 | ROM_END | |
| 2834 | ||
| 2835 | ||
| 2890 | 2836 | ROM_START( jokercrd ) |
| 2891 | 2837 | /* (Multi) Joker Card from Vesely Svet (Sprightly World). Czech poker game. |
| 2892 | 2838 | Program roms seems encrypted. Custom Funworld CPU based on 6502 family. |
| r7500 | r7501 | |
| 2905 | 2851 | ROM_LOAD( "ic13.bin", 0x0000, 0x0200, CRC(e59fc06e) SHA1(88a3bb89f020fe2b20f768ca010a082e0b974831) ) |
| 2906 | 2852 | ROM_END |
| 2907 | 2853 | |
| 2854 | ||
| 2855 | /* | |
| 2856 | Mongolfier New | |
| 2857 | -------------- | |
| 2858 | ||
| 2859 | - 1x G65SC02P2 (main) | |
| 2860 | - 1x KC89C72 (sound) | |
| 2861 | - 1x TDA2003 (sound) | |
| 2862 | - 1x MC68B45P (CRT controller) | |
| 2863 | - 2x EF6821P (Peripheral Interface Adapter) | |
| 2864 | - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped) | |
| 2865 | - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery) | |
| 2866 | - 1x oscillator 16.0000 MHz | |
| 2867 | ||
| 2868 | - 3x M27C512 | |
| 2869 | - 1x PROM AM27S29PC | |
| 2870 | - 1x PALCE16V8H (read protected) | |
| 2871 | ||
| 2872 | - 1x JAMMA edge connector | |
| 2873 | - 1x trimmer (volume) | |
| 2874 | - 2x 8 DIP switches | |
| 2875 | - 1x 4 DIP switches | |
| 2876 | - 1x green led | |
| 2877 | */ | |
| 2878 | ||
| 2908 | 2879 | ROM_START( mongolnw ) |
| 2909 | 2880 | ROM_REGION( 0x20000, "maincpu", 0 ) |
| 2910 | 2881 | ROM_LOAD( "prgteov.2.3m.u16", 0x10000, 0x10000, CRC(996b851a) SHA1(ef4e3d036ca10b33c83749024d04c4d4c09feeb7) ) |
| r7500 | r7501 | |
| 2925 | 2896 | ROM_LOAD( "palce16v8h_mf.u5", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */ |
| 2926 | 2897 | ROM_END |
| 2927 | 2898 | |
| 2899 | ||
| 2900 | /* | |
| 2901 | Soccer New (italian) | |
| 2902 | -------------------- | |
| 2903 | ||
| 2904 | - 1x G65SC02P2 (main) | |
| 2905 | - 1x KC89C72 (sound) | |
| 2906 | - 1x TDA2003 (sound) | |
| 2907 | - 1x MC68B45P (CRT controller) | |
| 2908 | - 1x EF68B21P (Peripheral Interface Adapter) | |
| 2909 | - 1x EF6821P (Peripheral Interface Adapter) | |
| 2910 | - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped) | |
| 2911 | - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery) | |
| 2912 | - 1x oscillator 16.0000MHz | |
| 2913 | ||
| 2914 | - 3x M27C512 | |
| 2915 | - 1x PROM AM27S29PC | |
| 2916 | - 1x PALCE16V8H (read protected) | |
| 2917 | ||
| 2918 | - 1x JAMMA edge connector | |
| 2919 | - 1x trimmer (volume) | |
| 2920 | - 2x 8 DIP switches | |
| 2921 | - 1x 4 DIP switches | |
| 2922 | - 1x green led | |
| 2923 | */ | |
| 2924 | ||
| 2928 | 2925 | ROM_START( soccernw ) |
| 2929 | 2926 | ROM_REGION( 0x20000, "maincpu", 0 ) |
| 2930 | 2927 | ROM_LOAD( "prgteo2gv2.3.u16", 0x10000, 0x10000, CRC(c61d1937) SHA1(c516f13a108da60b7ccee338b63a025009ef9099) ) |
| r7500 | r7501 | |
| 2945 | 2942 | ROM_LOAD( "palce16v8h_sn.u5", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */ |
| 2946 | 2943 | ROM_END |
| 2947 | 2944 | |
| 2945 | ||
| 2946 | /* | |
| 2947 | Saloon (France, encrypted) | |
| 2948 | -------------------------- | |
| 2949 | ||
| 2950 | - 1x 65SC02 (main) | |
| 2951 | - 1x 8948? (sound) | |
| 2952 | - 1x MC6845P (CRT controller) | |
| 2953 | - 1x oscillator 16.000000 MHz | |
| 2954 | ||
| 2955 | - 2x M27C512 | |
| 2956 | - 1x M27C256B | |
| 2957 | - 1x PROM N82S147N | |
| 2958 | - 1x GAL16V8-25LNC (read protected) | |
| 2959 | - 1x GAL18CV8-25 (read protected) | |
| 2960 | ||
| 2961 | - 1x HY6264ALP-12 | |
| 2962 | - 1x UM6116K-3L | |
| 2963 | ||
| 2964 | - 1x JAMMA edge connector | |
| 2965 | - 1x trimmer (volume?) | |
| 2966 | - 1x LM380N (amplifier) | |
| 2967 | - 1x ULN2803A (8 Darlington arrays) | |
| 2968 | - 1x battery | |
| 2969 | - 1x test button | |
| 2970 | - 1x indicator LED | |
| 2971 | - NO DIP switches | |
| 2972 | ||
| 2973 | Board has printed "LEOPARDO 5" | |
| 2974 | */ | |
| 2975 | ||
| 2948 | 2976 | ROM_START( saloon ) |
| 2949 | 2977 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2950 | 2978 | ROM_LOAD( "1s.bin", 0x8000, 0x8000, CRC(66938330) SHA1(09118d607eff7121472db7d2cc24079e063dc7cf) ) |
| r7500 | r7501 | |
| 2959 | 2987 | ROM_END |
| 2960 | 2988 | |
| 2961 | 2989 | |
| 2990 | ||
| 2962 | 2991 | /************************** |
| 2963 | 2992 | * Driver Initialization * |
| 2964 | 2993 | **************************/ |
| r7500 | r7501 | |
| 3170 | 3199 | * Game Drivers * |
| 3171 | 3200 | *************************/ |
| 3172 | 3201 | |
| 3173 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 3174 | GAME( 1985, jollycrd, 0, funworld, funworld, 0, ROT0, "TAB-Austria", "Jolly Card (austrian)", 0 ) | |
| 3175 | GAME( 1985, jolyc3x3, jollycrd, funworld, funworld, 0, ROT0, "TAB-Austria", "Jolly Card (3x3 deal)", 0 ) | |
| 3176 | GAME( 2000, jolyc980, jollycrd, jolyc980, jolyc980, 0, ROT0, "Spale-Soft", "Jolly Card Professional 2.0", 0 ) | |
| 3177 | GAME( 1998, jolycdev, jollycrd, funworld, funworld, 0, ROT0, "TAB/Evona", "Jolly Card (Evona Electronic)", 0 ) | |
| 3178 | GAME( 1985, jolyccra, jollycrd, cuoreuno, jolycdcr, 0, ROT0, "TAB-Austria", "Jolly Card (croatian, set 1)", 0 ) | |
| 3179 | GAME( 1993, jolyccrb, jollycrd, cuoreuno, jolycdcr, 0, ROT0, "Soft Design", "Jolly Card (croatian, set 2)", 0 ) | |
| 3180 | GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, tabblue, ROT0, "bootleg", "Jolly Card (italian, blue TAB board, encrypted)", 0 ) | |
| 3181 | GAME( 1990, jolycdib, jollycrd, cuoreuno, jolycdib, tabblue, ROT0, "bootleg", "Jolly Card (italian, encrypted bootleg)", 0 ) /* not a real TAB blue PCB */ | |
| 3182 | GAME( 1985, sjcd2kx3, jollycrd, funworld, funworld, 0, ROT0, "M.P.", "Super Joly 2000 - 3x", 0 ) | |
| 3183 | GAME( 1986, jolycdab, jollycrd, funworld, funworld, 0, ROT0, "Inter Games", "Jolly Card (austrian, Funworld, bootleg)", GAME_NOT_WORKING ) | |
| 3184 | GAME( 1986, bigdeal, 0, funworld, bigdeal, 0, ROT0, "Funworld", "Big Deal (hungarian, set 1)", GAME_IMPERFECT_COLORS ) | |
| 3185 | GAME( 1986, bigdealb, bigdeal, funworld, bigdeal, 0, ROT0, "Funworld", "Big Deal (hungarian, set 2)", GAME_IMPERFECT_COLORS ) | |
| 3186 | GAME( 1986, jolycdat, bigdeal, funworld, bigdeal, 0, ROT0, "Funworld", "Jolly Card (austrian, Funworld)", GAME_IMPERFECT_COLORS ) | |
| 3187 | GAME( 1996, cuoreuno, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Cuore 1 (italian)", 0 ) | |
| 3188 | GAME( 1997, elephfam, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Elephant Family (italian, new)", 0 ) | |
| 3189 | GAME( 1996, elephfmb, elephfam, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Elephant Family (italian, old)", 0 ) | |
| 3190 | GAME( 1996, pool10, 0, cuoreuno, pool10, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 1)", 0 ) | |
| 3191 | GAME( 1996, pool10b, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 2)", 0 ) | |
| 3192 | GAME( 1996, pool10c, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 3)", 0 ) | |
| 3193 | GAME( 1997, pool10d, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 4)", 0 ) | |
| 3194 | GAME( 1997, tortufam, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Tortuga Family (italian)", 0 ) | |
| 3195 | GAME( 1996, potgame, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pot Game (italian)", 0 ) | |
| 3196 | GAME( 1996, bottle10, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Bottle 10 (italian, set 1)", 0 ) | |
| 3197 | GAME( 1996, bottl10b, bottle10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Bottle 10 (italian, set 2)", 0 ) | |
| 3198 | GAME( 1991, royalcrd, 0, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 1)", 0 ) | |
| 3199 | GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 2)", 0 ) | |
| 3200 | GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, 0, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING ) | |
| 3201 | GAME( 1993, royalcdp, royalcrd, cuoreuno, royalcrd, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", GAME_NOT_WORKING ) | |
| 3202 | GAME( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (3x3 deal)", 0 ) | |
| 3203 | GAME( 1991, lluck4x1, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (4x1 aces)", 0 ) | |
| 3204 | GAME( 1996, magicrd2, 0, magicrd2, magicrd2, 0, ROT0, "Impera", "Magic Card II (bulgarian)", GAME_IMPERFECT_SOUND ) | |
| 3205 | GAME( 1996, magicd2a, magicrd2, magicrd2, magicrd2, magicd2a, ROT0, "Impera", "Magic Card II (green TAB or Impera board)", GAME_NOT_WORKING ) | |
| 3206 | GAME( 1996, magicd2b, magicrd2, magicrd2, magicrd2, magicd2b, ROT0, "Impera", "Magic Card II (blue TAB board, encrypted)", GAME_NOT_WORKING ) | |
| 3207 | GAME( 1993, vegasslw, 0, funworld, funworld, 0, ROT0, "Funworld", "Royal Vegas Joker Card (slow deal)", 0 ) | |
| 3208 | GAME( 1993, vegasfst, vegasslw, funworld, funworld, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal)", 0 ) | |
| 3209 | GAME( 1993, vegasfte, vegasslw, funworld, funworld, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal, english gfx)", 0 ) | |
| 3210 | GAME( 198?, jolyjokr, 0, funworld, funworld, 0, ROT0, "Impera", "Jolly Joker", 0 ) | |
| 3211 | GAME( 198?, jolyjokra,jolyjokr, funworld, jolyjokra,0, ROT0, "Impera", "Jolly Joker (50bet)", 0 ) | |
| 3212 | GAME( 1993, jokercrd, 0, funworld, funworld, 0, ROT0, "Vesely Svet", "Joker Card (Ver.A267BC, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING ) | |
| 3213 | GAME( 199?, mongolnw, 0, royalmcu, royalcrd, 0, ROT0, "bootleg", "Mongolfier New (italian)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3214 | GAME( 199?, soccernw, 0, royalcrd, royalcrd, soccernw, ROT0, "bootleg", "Soccer New (italian)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3215 | GAME( 198?, saloon, 0, saloon, saloon, saloon, ROT0, "<unknown>", "Saloon (french, encrypted)", GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3202 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 3203 | GAME( 1985, jollycrd, 0, funworld, funworld, 0, ROT0, "TAB-Austria", "Jolly Card (austrian)", 0 ) | |
| 3204 | GAME( 1985, jolyc3x3, jollycrd, funworld, funworld, 0, ROT0, "TAB-Austria", "Jolly Card (3x3 deal)", 0 ) | |
| 3205 | GAME( 2000, jolyc980, jollycrd, cuoreuno, jolyc980, 0, ROT0, "Spale-Soft", "Jolly Card Professional 2.0", 0 ) | |
| 3206 | GAME( 1998, jolycdev, jollycrd, funworld, funworld, 0, ROT0, "TAB/Evona", "Jolly Card (Evona Electronic)", 0 ) | |
| 3207 | GAME( 1985, jolyccra, jollycrd, cuoreuno, jolycdcr, 0, ROT0, "TAB-Austria", "Jolly Card (croatian, set 1)", 0 ) | |
| 3208 | GAME( 1993, jolyccrb, jollycrd, cuoreuno, jolycdcr, 0, ROT0, "Soft Design", "Jolly Card (croatian, set 2)", 0 ) | |
| 3209 | GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, tabblue, ROT0, "bootleg", "Jolly Card (italian, blue TAB board, encrypted)", 0 ) | |
| 3210 | GAME( 1990, jolycdib, jollycrd, cuoreuno, jolycdib, tabblue, ROT0, "bootleg", "Jolly Card (italian, encrypted bootleg)", 0 ) /* not a real TAB blue PCB */ | |
| 3211 | GAME( 1985, sjcd2kx3, jollycrd, funworld, funworld, 0, ROT0, "M.P.", "Super Joly 2000 - 3x", 0 ) | |
| 3212 | GAME( 1986, jolycdab, jollycrd, funworld, funworld, 0, ROT0, "Inter Games", "Jolly Card (austrian, Funworld, bootleg)", GAME_NOT_WORKING ) | |
| 3213 | GAME( 1986, bigdeal, 0, funworld, bigdeal, 0, ROT0, "Funworld", "Big Deal (hungarian, set 1)", GAME_IMPERFECT_COLORS ) | |
| 3214 | GAME( 1986, bigdealb, bigdeal, funworld, bigdeal, 0, ROT0, "Funworld", "Big Deal (hungarian, set 2)", GAME_IMPERFECT_COLORS ) | |
| 3215 | GAME( 1986, jolycdat, bigdeal, funworld, bigdeal, 0, ROT0, "Funworld", "Jolly Card (austrian, Funworld)", GAME_IMPERFECT_COLORS ) | |
| 3216 | GAME( 1996, cuoreuno, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Cuore 1 (italian)", 0 ) | |
| 3217 | GAME( 1997, elephfam, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Elephant Family (italian, new)", 0 ) | |
| 3218 | GAME( 1996, elephfmb, elephfam, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Elephant Family (italian, old)", 0 ) | |
| 3219 | GAME( 1996, pool10, 0, cuoreuno, pool10, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 1)", 0 ) | |
| 3220 | GAME( 1996, pool10b, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 2)", 0 ) | |
| 3221 | GAME( 1996, pool10c, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 3)", 0 ) | |
| 3222 | GAME( 1997, pool10d, pool10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pool 10 (italian, set 4)", 0 ) | |
| 3223 | GAME( 1997, tortufam, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Tortuga Family (italian)", 0 ) | |
| 3224 | GAME( 1996, potgame, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Pot Game (italian)", 0 ) | |
| 3225 | GAME( 1996, bottle10, 0, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Bottle 10 (italian, set 1)", 0 ) | |
| 3226 | GAME( 1996, bottl10b, bottle10, cuoreuno, cuoreuno, 0, ROT0, "C.M.C.", "Bottle 10 (italian, set 2)", 0 ) | |
| 3227 | GAME( 1991, royalcrd, 0, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 1)", 0 ) | |
| 3228 | GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 2)", 0 ) | |
| 3229 | GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, 0, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING ) | |
| 3230 | GAME( 1993, royalcdp, royalcrd, cuoreuno, royalcrd, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", GAME_NOT_WORKING ) | |
| 3231 | GAME( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (3x3 deal)", 0 ) | |
| 3232 | GAME( 1991, lluck4x1, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (4x1 aces)", 0 ) | |
| 3233 | GAME( 1996, magicrd2, 0, magicrd2, magicrd2, 0, ROT0, "Impera", "Magic Card II (bulgarian)", GAME_IMPERFECT_SOUND ) | |
| 3234 | GAME( 1996, magicd2a, magicrd2, magicrd2, magicrd2, magicd2a, ROT0, "Impera", "Magic Card II (green TAB or Impera board)", GAME_NOT_WORKING ) | |
| 3235 | GAME( 1996, magicd2b, magicrd2, magicrd2, magicrd2, magicd2b, ROT0, "Impera", "Magic Card II (blue TAB board, encrypted)", GAME_NOT_WORKING ) | |
| 3236 | GAME( 1993, vegasslw, 0, funworld, funworld, 0, ROT0, "Funworld", "Royal Vegas Joker Card (slow deal)", 0 ) | |
| 3237 | GAME( 1993, vegasfst, vegasslw, funworld, funworld, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal)", 0 ) | |
| 3238 | GAME( 1993, vegasfte, vegasslw, funworld, funworld, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal, english gfx)", 0 ) | |
| 3239 | GAME( 198?, jolyjokr, 0, funworld, funworld, 0, ROT0, "Impera", "Jolly Joker (98bet, set 1)", 0 ) | |
| 3240 | GAME( 198?, jolyjokra, jolyjokr, funworld, jolyjokra, 0, ROT0, "Impera", "Jolly Joker (98bet, set 2)", 0 ) | |
| 3241 | GAME( 198?, jolyjokrb, jolyjokr, funworld, funworld, 0, ROT0, "Impera", "Jolly Joker (40bet, croatian hack)", 0 ) | |
| 3242 | GAME( 1993, jokercrd, 0, funworld, funworld, 0, ROT0, "Vesely Svet", "Joker Card (Ver.A267BC, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING ) | |
| 3243 | GAME( 199?, mongolnw, 0, royalmcu, royalcrd, 0, ROT0, "bootleg", "Mongolfier New (italian)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3244 | GAME( 199?, soccernw, 0, royalcrd, royalcrd, soccernw, ROT0, "bootleg", "Soccer New (italian)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3245 | GAME( 198?, saloon, 0, saloon, saloon, saloon, ROT0, "<unknown>", "Saloon (french, encrypted)", GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 3246 |
| r7500 | r7501 | |
|---|---|---|
| 225 | 225 | #include "sound/okim6295.h" |
| 226 | 226 | #include "sound/3812intf.h" |
| 227 | 227 | |
| 228 | static tilemap_t *fg_tilemap,*bg_tilemap; | |
| 229 | static UINT16 *nmg5_bitmap; | |
| 230 | static UINT16 *fg_videoram,*bg_videoram,*scroll_ram; | |
| 231 | static UINT8 prot_val, input_data, priority_reg, gfx_bank; | |
| 232 | 228 | |
| 229 | class nmg5_state | |
| 230 | { | |
| 231 | public: | |
| 232 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, nmg5_state(machine)); } | |
| 233 | ||
| 234 | nmg5_state(running_machine &machine) { } | |
| 235 | ||
| 236 | /* memory pointers */ | |
| 237 | UINT16 * fg_videoram; | |
| 238 | UINT16 * bg_videoram; | |
| 239 | UINT16 * scroll_ram; | |
| 240 | UINT16 * bitmap; | |
| 241 | UINT16 * spriteram; | |
| 242 | // UINT16 * paletteram; // currently this uses generic palette handling | |
| 243 | size_t spriteram_size; | |
| 244 | ||
| 245 | /* video-related */ | |
| 246 | tilemap_t *bg_tilemap, *fg_tilemap; | |
| 247 | ||
| 248 | /* misc */ | |
| 249 | UINT8 prot_val, input_data, priority_reg, gfx_bank; | |
| 250 | ||
| 251 | /* devices */ | |
| 252 | running_device *maincpu; | |
| 253 | running_device *soundcpu; | |
| 254 | }; | |
| 255 | ||
| 256 | ||
| 257 | ||
| 233 | 258 | static WRITE16_HANDLER( fg_videoram_w ) |
| 234 | 259 | { |
| 235 | COMBINE_DATA(&fg_videoram[offset]); | |
| 236 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 260 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 261 | COMBINE_DATA(&state->fg_videoram[offset]); | |
| 262 | tilemap_mark_tile_dirty(state->fg_tilemap, offset); | |
| 237 | 263 | } |
| 238 | 264 | |
| 239 | 265 | static WRITE16_HANDLER( bg_videoram_w ) |
| 240 | 266 | { |
| 241 | COMBINE_DATA(&bg_videoram[offset]); | |
| 242 | tilemap_mark_tile_dirty(bg_tilemap,offset); | |
| 267 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 268 | COMBINE_DATA(&state->bg_videoram[offset]); | |
| 269 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 243 | 270 | } |
| 244 | 271 | |
| 245 | 272 | static WRITE16_HANDLER( nmg5_soundlatch_w ) |
| 246 | 273 | { |
| 274 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 275 | ||
| 247 | 276 | if (ACCESSING_BITS_0_7) |
| 248 | 277 | { |
| 249 | soundlatch_w(space,0,data & 0xff); | |
| 250 | cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 278 | soundlatch_w(space, 0, data & 0xff); | |
| 279 | cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE); | |
| 251 | 280 | } |
| 252 | 281 | } |
| 253 | 282 | |
| 254 | 283 | static READ16_HANDLER( prot_r ) |
| 255 | 284 | { |
| 256 | return prot_val | input_data; | |
| 285 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 286 | return state->prot_val | state->input_data; | |
| 257 | 287 | } |
| 258 | 288 | |
| 259 | 289 | static WRITE16_HANDLER( prot_w ) |
| 260 | 290 | { |
| 261 | input_data = data & 0xf; | |
| 291 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 292 | state->input_data = data & 0x0f; | |
| 262 | 293 | } |
| 263 | 294 | |
| 264 | 295 | static WRITE16_HANDLER( gfx_bank_w ) |
| 265 | 296 | { |
| 266 | if( gfx_bank != (data & 3) ) | |
| 297 | nmg5_state *state = (nmg5_state *)space->machine->driver_data; | |
| 298 | ||
| 299 | if (state->gfx_bank != (data & 3)) | |
| 267 | 300 | { |
| 268 | gfx_bank = data & 3; | |
| 301 | state->gfx_bank = data & 3; | |
| 269 | 302 | tilemap_mark_all_tiles_dirty_all(space->machine); |
| 270 | 303 | } |
| 271 | 304 | } |
| 272 | 305 | |
| 273 | 306 | static WRITE16_HANDLER( priority_reg_w ) |
| 274 | 307 | { |
| 275 | | |
| 308 | nmg5 | |
| 276 | 309 | |
| 277 | if(priority_reg == 4 || priority_reg == 5 || priority_reg == 6) | |
| 278 | popmessage("unknown priority_reg value = %d\n",priority_reg); | |
| 310 | state->priority_reg = data & 7; | |
| 311 | ||
| 312 | if (state->priority_reg == 4 || state->priority_reg == 5 || state->priority_reg == 6) | |
| 313 | popmessage("unknown priority_reg value = %d\n", state->priority_reg); | |
| 279 | 314 | } |
| 280 | 315 | |
| 281 | 316 | static WRITE8_DEVICE_HANDLER( oki_banking_w ) |
| 282 | 317 | { |
| 283 | okim6295_set_bank_base(device, (data & 1) ? 0x40000 : 0 | |
| 318 | okim6295_set_bank_base(device, (data & 1) ? 0x40000 : 0 | |
| 284 | 319 | } |
| 285 | 320 | |
| 286 | 321 | /******************************************************************* |
| r7500 | r7501 | |
| 293 | 328 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 294 | 329 | AM_RANGE(0x120000, 0x12ffff) AM_RAM |
| 295 | 330 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 296 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_ | |
| 331 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 297 | 332 | AM_RANGE(0x180000, 0x180001) AM_WRITE(nmg5_soundlatch_w) |
| 298 | 333 | AM_RANGE(0x180002, 0x180003) AM_WRITENOP |
| 299 | 334 | AM_RANGE(0x180004, 0x180005) AM_READWRITE(prot_r, prot_w) |
| r7500 | r7501 | |
| 302 | 337 | AM_RANGE(0x18000a, 0x18000b) AM_READ_PORT("SYSTEM") |
| 303 | 338 | AM_RANGE(0x18000c, 0x18000d) AM_READ_PORT("INPUTS") |
| 304 | 339 | AM_RANGE(0x18000e, 0x18000f) AM_WRITE(priority_reg_w) |
| 305 | AM_RANGE(0x300002, 0x300009) AM_WRITEONLY AM_BASE( | |
| 340 | AM_RANGE(0x300002, 0x300009) AM_WRITEONLY AM_BASE_MEMBER(nmg5_state, scroll_ram) | |
| 306 | 341 | AM_RANGE(0x30000a, 0x30000f) AM_WRITENOP |
| 307 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 308 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 309 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&nmg5_bitmap) | |
| 342 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE_MEMBER(nmg5_state, bg_videoram) | |
| 343 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE_MEMBER(nmg5_state, fg_videoram) | |
| 344 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER(nmg5_state, bitmap) | |
| 310 | 345 | ADDRESS_MAP_END |
| 311 | 346 | |
| 312 | 347 | static ADDRESS_MAP_START( pclubys_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 313 | 348 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 314 | 349 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 315 | 350 | AM_RANGE(0x440000, 0x4407ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 316 | AM_RANGE(0x460000, 0x4607ff) AM_RAM AM_BASE_SIZE_ | |
| 351 | AM_RANGE(0x460000, 0x4607ff) AM_RAM AM_BASE_SIZE_MEMBER | |
| 317 | 352 | AM_RANGE(0x480000, 0x480001) AM_WRITE(nmg5_soundlatch_w) |
| 318 | 353 | AM_RANGE(0x480002, 0x480003) AM_WRITENOP |
| 319 | 354 | AM_RANGE(0x480004, 0x480005) AM_READWRITE(prot_r, prot_w) |
| r7500 | r7501 | |
| 322 | 357 | AM_RANGE(0x48000a, 0x48000b) AM_READ_PORT("SYSTEM") |
| 323 | 358 | AM_RANGE(0x48000c, 0x48000d) AM_READ_PORT("INPUTS") |
| 324 | 359 | AM_RANGE(0x48000e, 0x48000f) AM_WRITE(priority_reg_w) |
| 325 | AM_RANGE(0x500002, 0x500009) AM_WRITEONLY AM_BASE(&scroll_ram) | |
| 326 | AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 327 | AM_RANGE(0x522000, 0x523fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 328 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&nmg5_bitmap) | |
| 360 | AM_RANGE(0x500002, 0x500009) AM_WRITEONLY AM_BASE_MEMBER(nmg5_state, scroll_ram) | |
| 361 | AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE_MEMBER(nmg5_state, bg_videoram) | |
| 362 | AM_RANGE(0x522000, 0x523fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE_MEMBER(nmg5_state, fg_videoram) | |
| 363 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER(nmg5_state, bitmap) | |
| 329 | 364 | ADDRESS_MAP_END |
| 330 | 365 | |
| 331 | 366 | /******************************************************************* |
| r7500 | r7501 | |
| 789 | 824 | INPUT_PORTS_END |
| 790 | 825 | |
| 791 | 826 | |
| 792 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *vram,int color) | |
| 827 | INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, UINT16 *vram, int color ) | |
| 793 | 828 | { |
| 794 | SET_TILE_INFO(0,vram[tile_index] | (gfx_bank << 16),color,0); | |
| 829 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 830 | SET_TILE_INFO(0, vram[tile_index] | (state->gfx_bank << 16), color, 0); | |
| 795 | 831 | } |
| 796 | 832 | |
| 797 | static TILE_GET_INFO( fg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,fg_videoram, 0); } | |
| 798 | static TILE_GET_INFO( bg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,bg_videoram, 1); } | |
| 833 | static TILE_GET_INFO( fg_get_tile_info ) { nmg5_state *state = (nmg5_state *)machine->driver_data; get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 0); } | |
| 834 | static TILE_GET_INFO( bg_get_tile_info ) { nmg5_state *state = (nmg5_state *)machine->driver_data; get_tile_info(machine, tileinfo, tile_index, state->bg_videoram, 1); } | |
| 799 | 835 | |
| 800 | 836 | static VIDEO_START( nmg5 ) |
| 801 | 837 | { |
| 802 | bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,8,8,64,64); | |
| 803 | fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,8,8,64,64); | |
| 838 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 804 | 839 | |
| 805 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 840 | state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8, 8, 64, 64); | |
| 841 | state->fg_tilemap = tilemap_create(machine, fg_get_tile_info, tilemap_scan_rows, 8, 8, 64, 64); | |
| 842 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 806 | 843 | } |
| 807 | 844 | |
| 808 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 845 | static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 809 | 846 | { |
| 810 | UINT16 *spriteram16 = machine->generic.spriteram.u16; | |
| 847 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 848 | UINT16 *spriteram = state->spriteram; | |
| 811 | 849 | int offs; |
| 812 | 850 | |
| 813 | for (offs = 0;offs < | |
| 851 | for (offs = 0; offs < stat | |
| 814 | 852 | { |
| 815 | int sx,sy,code,color,flipx,flipy,height,y; | |
| 853 | int sx, sy, code, color, flipx, flipy, height, y; | |
| 816 | 854 | |
| 817 | sx = spriteram16[offs + 2]; | |
| 818 | sy = spriteram16[offs + 0]; | |
| 819 | code = spriteram16[offs + 1]; | |
| 820 | color = (spriteram16[offs + 2] >> 9) & 0xf; | |
| 821 | height = 1 << ((spriteram16[offs + 0] & 0x0600) >> 9); | |
| 822 | flipx = spriteram16[offs + 0] & 0x2000; | |
| 823 | flipy = spriteram16[offs + 0] & 0x4000; | |
| 855 | sx = spriteram[offs + 2]; | |
| 856 | sy = spriteram[offs + 0]; | |
| 857 | code = spriteram[offs + 1]; | |
| 858 | color = (spriteram[offs + 2] >> 9) & 0xf; | |
| 859 | height = 1 << ((spriteram[offs + 0] & 0x0600) >> 9); | |
| 860 | flipx = spriteram[offs + 0] & 0x2000; | |
| 861 | flipy = spriteram[offs + 0] & 0x4000; | |
| 824 | 862 | |
| 825 | for (y = 0;y < height;y++) | |
| 863 | for (y = 0; y < height; y++) | |
| 826 | 864 | { |
| 827 | 865 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 828 | 866 | code + (flipy ? height-1 - y : y), |
| r7500 | r7501 | |
| 840 | 878 | } |
| 841 | 879 | } |
| 842 | 880 | |
| 843 | static void draw_bitmap(bitmap_t *bitmap) | |
| 881 | static void draw_bitmap( running_machine *machine, bitmap_t *bitmap ) | |
| 844 | 882 | { |
| 845 | int yyy=256; | |
| 846 | int xxx=512/4; | |
| 847 | UINT16 x,y,count; | |
| 848 | int xoff=-12; | |
| 849 | int yoff=-9; | |
| 883 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 884 | int yyy = 256; | |
| 885 | int xxx = 512 / 4; | |
| 886 | UINT16 x, y, count; | |
| 887 | int xoff = -12; | |
| 888 | int yoff = -9; | |
| 850 | 889 | int pix; |
| 851 | 890 | |
| 852 | count=0; | |
| 853 | for (y=0;y<yyy;y++) | |
| 891 | count = 0; | |
| 892 | for (y = 0; y < yyy; y++) | |
| 854 | 893 | { |
| 855 | for(x=0;x<xxx;x++) | |
| 894 | for (x = 0; x < xxx; x++) | |
| 856 | 895 | { |
| 857 | pix = (nmg5_bitmap[count]&0xf000)>>12; | |
| 858 | if (pix) *BITMAP_ADDR16(bitmap, y+yoff, x*4+0+xoff) = pix + 0x300; | |
| 859 | pix = (nmg5_bitmap[count]&0x0f00)>>8; | |
| 860 | if (pix) *BITMAP_ADDR16(bitmap, y+yoff, x*4+1+xoff) = pix + 0x300; | |
| 861 | pix = (nmg5_bitmap[count]&0x00f0)>>4; | |
| 862 | if (pix) *BITMAP_ADDR16(bitmap, y+yoff, x*4+2+xoff) = pix + 0x300; | |
| 863 | pix = (nmg5_bitmap[count]&0x000f)>>0; | |
| 864 | if (pix) *BITMAP_ADDR16(bitmap, y+yoff, x*4+3+xoff) = pix + 0x300; | |
| 896 | pix = (state->bitmap[count] & 0xf000) >> 12; | |
| 897 | if (pix) *BITMAP_ADDR16(bitmap, y + yoff, x * 4 + 0 + xoff) = pix + 0x300; | |
| 898 | pix = (state->bitmap[count] & 0x0f00) >> 8; | |
| 899 | if (pix) *BITMAP_ADDR16(bitmap, y + yoff, x * 4 + 1 + xoff) = pix + 0x300; | |
| 900 | pix = (state->bitmap[count] & 0x00f0) >> 4; | |
| 901 | if (pix) *BITMAP_ADDR16(bitmap, y + yoff, x * 4 + 2 + xoff) = pix + 0x300; | |
| 902 | pix = (state->bitmap[count] & 0x000f) >> 0; | |
| 903 | if (pix) *BITMAP_ADDR16(bitmap, y + yoff, x * 4 + 3 + xoff) = pix + 0x300; | |
| 865 | 904 | |
| 866 | 905 | count++; |
| 867 | 906 | } |
| r7500 | r7501 | |
| 871 | 910 | |
| 872 | 911 | static VIDEO_UPDATE( nmg5 ) |
| 873 | 912 | { |
| 874 | tilemap_set_scrolly(bg_tilemap,0,scroll_ram[3]+9); | |
| 875 | tilemap_set_scrollx(bg_tilemap,0,scroll_ram[2]+3); | |
| 876 | tilemap_set_scrolly(fg_tilemap,0,scroll_ram[1]+9); | |
| 877 | tilemap_set_scrollx(fg_tilemap,0,scroll_ram[0]-1); | |
| 913 | nmg5_state *state = (nmg5_state *)screen->machine->driver_data; | |
| 878 | 914 | |
| 879 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 915 | tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_ram[3] + 9); | |
| 916 | tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_ram[2] + 3); | |
| 917 | tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll_ram[1] + 9); | |
| 918 | tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll_ram[0] - 1); | |
| 880 | 919 | |
| 881 | if(priority_reg == 0) | |
| 920 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 921 | ||
| 922 | if (state->priority_reg == 0) | |
| 882 | 923 | { |
| 883 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 884 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 885 | draw_bitmap(bitmap); | |
| 924 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 925 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 926 | draw_bitmap(screen->machine, bitmap); | |
| 886 | 927 | } |
| 887 | else if(priority_reg == 1) | |
| 928 | else if (state->priority_reg == 1) | |
| 888 | 929 | { |
| 889 | draw_bitmap(bitmap); | |
| 890 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 891 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 930 | draw_bitmap(screen->machine, bitmap); | |
| 931 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 932 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 892 | 933 | } |
| 893 | else if(priority_reg == 2) | |
| 934 | else if (state->priority_reg == 2) | |
| 894 | 935 | { |
| 895 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 896 | draw_bitmap(bitmap); | |
| 897 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 936 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 937 | draw_bitmap(screen->machine, bitmap); | |
| 938 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 898 | 939 | } |
| 899 | else if(priority_reg == 3) | |
| 940 | else if (state->priority_reg == 3) | |
| 900 | 941 | { |
| 901 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 902 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 903 | draw_bitmap(bitmap); | |
| 942 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 943 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 944 | draw_bitmap(screen->machine, bitmap); | |
| 904 | 945 | } |
| 905 | else if(priority_reg == 7) | |
| 946 | else if (state->priority_reg == 7) | |
| 906 | 947 | { |
| 907 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 908 | draw_bitmap(bitmap); | |
| 909 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 948 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 949 | draw_bitmap(screen->machine, bitmap); | |
| 950 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 910 | 951 | } |
| 911 | 952 | return 0; |
| 912 | 953 | } |
| r7500 | r7501 | |
| 956 | 997 | GFXDECODE_END |
| 957 | 998 | |
| 958 | 999 | |
| 959 | static void soundirq(running_device *device, int state) | |
| 1000 | static void soundirq( running_device *device, int state ) | |
| 960 | 1001 | { |
| 961 | cputag_set_input_line(device->machine, "soundcpu", 0, state); | |
| 1002 | nmg5_state *driver_state = (nmg5_state *)device->machine->driver_data; | |
| 1003 | cpu_set_input_line(driver_state->soundcpu, 0, state); | |
| 962 | 1004 | } |
| 963 | 1005 | |
| 964 | 1006 | static const ym3812_interface ym3812_intf = |
| r7500 | r7501 | |
| 968 | 1010 | |
| 969 | 1011 | static MACHINE_START( nmg5 ) |
| 970 | 1012 | { |
| 971 | state_save_register_global(machine, gfx_bank); | |
| 972 | state_save_register_global(machine, priority_reg); | |
| 973 | state_save_register_global(machine, input_data); | |
| 1013 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1014 | ||
| 1015 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 1016 | state->soundcpu = devtag_get_device(machine, "soundcpu"); | |
| 1017 | ||
| 1018 | state_save_register_global(machine, state->gfx_bank); | |
| 1019 | state_save_register_global(machine, state->priority_reg); | |
| 1020 | state_save_register_global(machine, state->input_data); | |
| 974 | 1021 | } |
| 975 | 1022 | |
| 976 | 1023 | static MACHINE_RESET( nmg5 ) |
| 977 | 1024 | { |
| 1025 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1026 | ||
| 978 | 1027 | /* some games don't set the priority register so it should be hard-coded to a normal layout */ |
| 979 | priority_reg = 7; | |
| 1028 | state->priority_reg = 7; | |
| 1029 | ||
| 1030 | state->gfx_bank = 0; | |
| 1031 | state->input_data = 0; | |
| 980 | 1032 | } |
| 981 | 1033 | |
| 982 | 1034 | static MACHINE_DRIVER_START( nmg5 ) |
| 983 | 1035 | |
| 1036 | /* driver data */ | |
| 1037 | MDRV_DRIVER_DATA(nmg5_state) | |
| 1038 | ||
| 984 | 1039 | /* basic machine hardware */ |
| 985 | 1040 | MDRV_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */ |
| 986 | 1041 | MDRV_CPU_PROGRAM_MAP(nmg5_map) |
| r7500 | r7501 | |
| 1473 | 1528 | |
| 1474 | 1529 | static DRIVER_INIT( prot_val_00 ) |
| 1475 | 1530 | { |
| 1476 | prot_val = 0x00; | |
| 1531 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1532 | state->prot_val = 0x00; | |
| 1477 | 1533 | } |
| 1478 | 1534 | |
| 1479 | 1535 | static DRIVER_INIT( prot_val_10 ) |
| 1480 | 1536 | { |
| 1481 | prot_val = 0x10; | |
| 1537 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1538 | state->prot_val = 0x10; | |
| 1482 | 1539 | } |
| 1483 | 1540 | |
| 1484 | 1541 | static DRIVER_INIT( prot_val_20 ) |
| 1485 | 1542 | { |
| 1486 | prot_val = 0x20; | |
| 1543 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1544 | state->prot_val = 0x20; | |
| 1487 | 1545 | } |
| 1488 | 1546 | |
| 1489 | 1547 | static DRIVER_INIT( prot_val_40 ) |
| 1490 | 1548 | { |
| 1491 | prot_val = 0x40; | |
| 1549 | nmg5_state *state = (nmg5_state *)machine->driver_data; | |
| 1550 | state->prot_val = 0x40; | |
| 1492 | 1551 | } |
| 1493 | 1552 | |
| 1494 | 1553 | GAME( 1998, nmg5, 0, nmg5, nmg5, prot_val_10, ROT0, "Yun Sung", "Multi 5 / New Multi Game 5", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 49 | 49 | #include "sound/2610intf.h" |
| 50 | 50 | |
| 51 | 51 | |
| 52 | typedef struct __2mindril_state _2mindril_state; | |
| 53 | struct __2mindril_state | |
| 52 | class _2mindril_state | |
| 54 | 53 | { |
| 54 | public: | |
| 55 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _2mindril_state(machine)); } | |
| 56 | ||
| 57 | _2mindril_state(running_machine &machine) { } | |
| 58 | ||
| 55 | 59 | /* memory pointers */ |
| 56 | 60 | UINT16 * map1ram; |
| 57 | 61 | UINT16 * map2ram; |
| r7500 | r7501 | |
|---|---|---|
| 50 | 50 | #include "cpu/i8085/i8085.h" |
| 51 | 51 | #include "sound/samples.h" |
| 52 | 52 | |
| 53 | typedef struct _safarir_state safarir_state; | |
| 54 | struct _safarir_state | |
| 53 | class safarir_state | |
| 55 | 54 | { |
| 55 | public: | |
| 56 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, safarir_state(machine)); } | |
| 57 | ||
| 58 | safarir_state(running_machine &machine) { } | |
| 59 | ||
| 56 | 60 | UINT8 *ram_1, *ram_2; |
| 57 | 61 | size_t ram_size; |
| 58 | 62 | UINT8 ram_bank; |
| r7500 | r7501 | |
|---|---|---|
| 102 | 102 | #include "sound/ay8910.h" |
| 103 | 103 | |
| 104 | 104 | |
| 105 | typedef struct _jollyjgr_state jollyjgr_state; | |
| 106 | struct _jollyjgr_state | |
| 105 | class jollyjgr_state | |
| 107 | 106 | { |
| 107 | public: | |
| 108 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jollyjgr_state(machine)); } | |
| 109 | ||
| 110 | jollyjgr_state(running_machine &machine) { } | |
| 111 | ||
| 108 | 112 | /* memory pointers */ |
| 109 | 113 | UINT8 * videoram; |
| 110 | 114 | UINT8 * colorram; |
| r7500 | r7501 | |
|---|---|---|
| 56 | 56 | #include "sound/ay8910.h" |
| 57 | 57 | |
| 58 | 58 | |
| 59 | typedef struct _ddayjlc_state ddayjlc_state; | |
| 60 | struct _ddayjlc_state | |
| 59 | class ddayjlc_state | |
| 61 | 60 | { |
| 61 | public: | |
| 62 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ddayjlc_state(machine)); } | |
| 63 | ||
| 64 | ddayjlc_state(running_machine &machine) { } | |
| 65 | ||
| 62 | 66 | /* memory pointers */ |
| 63 | 67 | UINT8 * bgram; |
| 64 | 68 | UINT8 * mainram; |
| r7500 | r7501 | |
|---|---|---|
| 16 | 16 | #define NUM_PENS (8) |
| 17 | 17 | |
| 18 | 18 | |
| 19 | typedef struct _dorachan_state dorachan_state; | |
| 20 | struct _dorachan_state | |
| 19 | class dorachan_state | |
| 21 | 20 | { |
| 21 | public: | |
| 22 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, dorachan_state(machine)); } | |
| 23 | ||
| 24 | dorachan_state(running_machine &machine) { } | |
| 25 | ||
| 22 | 26 | /* memory pointers */ |
| 23 | 27 | UINT8 * videoram; |
| 24 | 28 | size_t videoram_size; |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #include "cpu/z80/z80.h" |
| 46 | 46 | #include "sound/okim6295.h" |
| 47 | 47 | |
| 48 | typedef struct _egghunt_state egghunt_state; | |
| 49 | struct _egghunt_state | |
| 48 | class egghunt_state | |
| 50 | 49 | { |
| 50 | public: | |
| 51 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, egghunt_state(machine)); } | |
| 52 | ||
| 53 | egghunt_state(running_machine &machine) { } | |
| 54 | ||
| 51 | 55 | /* memory pointers */ |
| 52 | 56 | UINT8 * bgram; |
| 53 | 57 | UINT8 * atram; |
| r7500 | r7501 | |
|---|---|---|
| 49 | 49 | static WRITE16_HANDLER( mugsmash_reg2_w ) |
| 50 | 50 | { |
| 51 | 51 | mugsmash_state *state = (mugsmash_state *)space->machine->driver_data; |
| 52 | ||
| 52 | 53 | state->regs2[offset] = data; |
| 53 | 54 | //popmessage ("Regs2 %04x, %04x, %04x, %04x", state->regs2[0], state->regs2[1], state->regs2[2], state->regs2[3]); |
| 54 | 55 | |
| r7500 | r7501 | |
| 56 | 57 | { |
| 57 | 58 | case 1: |
| 58 | 59 | soundlatch_w(space, 1, data & 0xff); |
| 59 | cpu | |
| 60 | cpu | |
| 60 | 61 | break; |
| 61 | 62 | |
| 62 | 63 | default: |
| r7500 | r7501 | |
| 173 | 174 | |
| 174 | 175 | static ADDRESS_MAP_START( mugsmash_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 175 | 176 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 176 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(mugsmash_videoram1_w) AM_BASE_MEMBER(mugsmash_state,videoram1) | |
| 177 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(mugsmash_videoram2_w) AM_BASE_MEMBER(mugsmash_state,videoram2) | |
| 178 | AM_RANGE(0x0c0000, 0x0c0007) AM_WRITE(mugsmash_reg_w) AM_BASE_MEMBER(mugsmash_state,regs1) /* video registers*/ | |
| 177 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(mugsmash_videoram1_w) AM_BASE_MEMBER(mugsmash_state, videoram1) | |
| 178 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(mugsmash_videoram2_w) AM_BASE_MEMBER(mugsmash_state, videoram2) | |
| 179 | AM_RANGE(0x0c0000, 0x0c0007) AM_WRITE(mugsmash_reg_w) AM_BASE_MEMBER(mugsmash_state, regs1) /* video registers*/ | |
| 179 | 180 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 180 | AM_RANGE(0x140000, 0x140007) AM_WRITE(mugsmash_reg2_w) AM_BASE_MEMBER(mugsmash_state,regs2) /* sound + ? */ | |
| 181 | AM_RANGE(0x140000, 0x140007) AM_WRITE(mugsmash_reg2_w) AM_BASE_MEMBER(mugsmash_state, regs2) /* sound + ? */ | |
| 181 | 182 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* main ram? */ |
| 182 | 183 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM |
| 183 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE_MEMBER(mugsmash_state,spriteram) /* sprite ram */ | |
| 184 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE_MEMBER(mugsmash_state, spriteram) /* sprite ram */ | |
| 184 | 185 | #if USE_FAKE_INPUT_PORTS |
| 185 | 186 | AM_RANGE(0x180000, 0x180007) AM_READ(mugsmash_input_ports_r) |
| 186 | 187 | #else |
| r7500 | r7501 | |
| 390 | 391 | |
| 391 | 392 | static void irq_handler(running_device *device, int irq) |
| 392 | 393 | { |
| 393 | cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 394 | mugsmash_state *state = (mugsmash_state *)device->machine->driver_data; | |
| 395 | cpu_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 394 | 396 | } |
| 395 | 397 | |
| 396 | 398 | static const ym2151_interface ym2151_config = |
| r7500 | r7501 | |
| 398 | 400 | irq_handler |
| 399 | 401 | }; |
| 400 | 402 | |
| 403 | static MACHINE_START( mugsmash ) | |
| 404 | { | |
| 405 | mugsmash_state *state = (mugsmash_state *)machine->driver_data; | |
| 406 | ||
| 407 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 408 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 409 | } | |
| 410 | ||
| 401 | 411 | static MACHINE_DRIVER_START( mugsmash ) |
| 402 | 412 | |
| 403 | 413 | MDRV_DRIVER_DATA( mugsmash_state ) |
| r7500 | r7501 | |
| 409 | 419 | MDRV_CPU_ADD("audiocpu", Z80, 4000000) /* Guess */ |
| 410 | 420 | MDRV_CPU_PROGRAM_MAP(mugsmash_sound_map) |
| 411 | 421 | |
| 422 | MDRV_MACHINE_START(mugsmash) | |
| 423 | ||
| 412 | 424 | MDRV_SCREEN_ADD("screen", RASTER) |
| 413 | 425 | MDRV_SCREEN_REFRESH_RATE(60) |
| 414 | 426 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r7500 | r7501 | |
| 462 | 474 | ROM_LOAD( "mugs_15.bin", 0x180000, 0x080000, CRC(82e8187c) SHA1(c7a0e1b3d90dbbe2588886a27a07a9c336447ae3) ) |
| 463 | 475 | ROM_END |
| 464 | 476 | |
| 465 | GAME( 1990?, mugsmash, 0, mugsmash, mugsmash, 0, ROT0, "Electronic Devices Italy / 3D Games England", "Mug Smashers", | |
| 477 | GAME( 1990?, mugsmash, 0, mugsmash, mugsmash, 0, ROT0, "Electronic Devices Italy / 3D Games England", "Mug Smashers", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 34 | 34 | lev 6 : 0x78 : 001f 002a - x |
| 35 | 35 | lev 7 : 0x7c : 001f 002a - x |
| 36 | 36 | |
| 37 | ******************************************************************************/ | |
| 38 | 37 | |
| 39 | #include "emu.h" | |
| 40 | #include "cpu/m68000/m68000.h" | |
| 41 | #include "sound/es5506.h" | |
| 38 | **** README INFO ************************************************************** | |
| 42 | 39 | |
| 43 | /*** README INFO ************************************************************** | |
| 44 | ||
| 45 | 40 | --- ROMSET: macrossp --- |
| 46 | 41 | |
| 47 | 42 | Macross Plus |
| r7500 | r7501 | |
| 301 | 296 | |
| 302 | 297 | ******************************************************************************/ |
| 303 | 298 | |
| 304 | extern UINT32 *macrossp_scra_videoram, *macrossp_scra_videoregs; | |
| 305 | extern UINT32 *macrossp_scrb_videoram, *macrossp_scrb_videoregs; | |
| 306 | extern UINT32 *macrossp_scrc_videoram, *macrossp_scrc_videoregs; | |
| 307 | extern UINT32 *macrossp_text_videoram, *macrossp_text_videoregs; | |
| 308 | extern UINT32 *macrossp_spriteram; | |
| 309 | 299 | |
| 310 | static UINT32 *macrossp_mainram; | |
| 300 | #include "emu.h" | |
| 301 | #include "cpu/m68000/m68000.h" | |
| 302 | #include "sound/es5506.h" | |
| 303 | #include "includes/macrossp.h" | |
| 311 | 304 | |
| 312 | /* in video */ | |
| 313 | WRITE32_HANDLER( macrossp_scra_videoram_w ); | |
| 314 | WRITE32_HANDLER( macrossp_scrb_videoram_w ); | |
| 315 | WRITE32_HANDLER( macrossp_scrc_videoram_w ); | |
| 316 | WRITE32_HANDLER( macrossp_text_videoram_w ); | |
| 317 | VIDEO_START(macrossp); | |
| 318 | VIDEO_UPDATE(macrossp); | |
| 319 | VIDEO_EOF(macrossp); | |
| 320 | ||
| 321 | 305 | /*** VARIOUS READ / WRITE HANDLERS *******************************************/ |
| 322 | 306 | |
| 323 | 307 | static WRITE32_HANDLER( paletteram32_macrossp_w ) |
| 324 | 308 | { |
| 309 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 325 | 310 | int r,g,b; |
| 326 | COMBINE_DATA(&s | |
| 311 | COMBINE_DATA(&state-> | |
| 327 | 312 | |
| 328 | b = ((space->machine->generic.paletteram.u32[offset] & 0x0000ff00) >>8); | |
| 329 | g = ((space->machine->generic.paletteram.u32[offset] & 0x00ff0000) >>16); | |
| 330 | r = ((space->machine->generic.paletteram.u32[offset] & 0xff000000) >>24); | |
| 313 | b = ((state->paletteram[offset] & 0x0000ff00) >>8); | |
| 314 | g = ((state->paletteram[offset] & 0x00ff0000) >>16); | |
| 315 | r = ((state->paletteram[offset] & 0xff000000) >>24); | |
| 331 | 316 | |
| 332 | palette_set_color(space->machine,offset,MAKE_RGB(r,g,b)); | |
| 317 | palette_set_color(space->machine, offset, MAKE_RGB(r,g,b)); | |
| 333 | 318 | } |
| 334 | 319 | |
| 335 | 320 | |
| 336 | static int sndpending; | |
| 337 | ||
| 338 | 321 | static READ32_HANDLER ( macrossp_soundstatus_r ) |
| 339 | 322 | { |
| 340 | stat | |
| 323 | macrossp_state | |
| 341 | 324 | |
| 342 | // logerror("%08x read soundstatus\n",cpu_get_pc(space->cpu)); | |
| 325 | // logerror("%08x read soundstatus\n", cpu_get_pc(space->cpu)); | |
| 343 | 326 | |
| 344 | 327 | /* bit 1 is sound status */ |
| 345 | 328 | /* bit 0 unknown - it is expected to toggle, vblank? */ |
| 346 | 329 | |
| 347 | toggle ^= 1; | |
| 330 | state->snd_toggle ^= 1; | |
| 348 | 331 | |
| 349 | return (sndpending << 1) | toggle; | |
| 332 | return (state->sndpending << 1) | state->snd_toggle; | |
| 350 | 333 | } |
| 351 | 334 | |
| 352 | 335 | static WRITE32_HANDLER( macrossp_soundcmd_w ) |
| 353 | 336 | { |
| 337 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 338 | ||
| 354 | 339 | if (ACCESSING_BITS_16_31) |
| 355 | 340 | { |
| 356 | 341 | //logerror("%08x write soundcmd %08x (%08x)\n",cpu_get_pc(space->cpu),data,mem_mask); |
| 357 | 342 | soundlatch_word_w(space, 0, data >> 16, 0xffff); |
| 358 | sndpending = 1; | |
| 359 | cputag_set_input_line(space->machine, "audiocpu", 2, HOLD_LINE); | |
| 343 | state->sndpending = 1; | |
| 344 | cpu_set_input_line(state->audiocpu, 2, HOLD_LINE); | |
| 360 | 345 | /* spin for a while to let the sound CPU read the command */ |
| 361 | 346 | cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(50)); |
| 362 | 347 | } |
| r7500 | r7501 | |
| 364 | 349 | |
| 365 | 350 | static READ16_HANDLER( macrossp_soundcmd_r ) |
| 366 | 351 | { |
| 367 | // logerror("%06x read soundcmd\n",cpu_get_pc(space->cpu)); | |
| 368 | sndpending = 0; | |
| 352 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 353 | ||
| 354 | // logerror("%06x read soundcmd\n",cpu_get_pc(space->cpu)); | |
| 355 | state->sndpending = 0; | |
| 369 | 356 | return soundlatch_word_r(space, offset, mem_mask); |
| 370 | 357 | } |
| 371 | 358 | |
| 372 | static INT32 fade_effect,old_fade; | |
| 373 | ||
| 374 | static void update_colors(running_machine *machine) | |
| 359 | static void update_colors( running_machine *machine ) | |
| 375 | 360 | { |
| 376 | static int i,r,g,b; | |
| 361 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 362 | int i, r, g, b; | |
| 377 | 363 | |
| 378 | for(i=0;i<0x1000;i++) | |
| 364 | for (i = 0; i < 0x1000; i++) | |
| 379 | 365 | { |
| 380 | b = ((machine->generic.paletteram.u32[i] & 0x0000ff00) >> 8); | |
| 381 | if(fade_effect > b) { b = 0; } | |
| 382 | else { b-=fade_effect; } | |
| 383 | g = ((machine->generic.paletteram.u32[i] & 0x00ff0000) >>16); | |
| 384 | if(fade_effect > g) { g = 0; } | |
| 385 | else { g-=fade_effect; } | |
| 386 | r = ((machine->generic.paletteram.u32[i] & 0xff000000) >>24); | |
| 387 | if(fade_effect > r) { r = 0; } | |
| 388 | else { r-=fade_effect; } | |
| 366 | b = ((state->paletteram[i] & 0x0000ff00) >> 8); | |
| 367 | g = ((state->paletteram[i] & 0x00ff0000) >> 16); | |
| 368 | r = ((state->paletteram[i] & 0xff000000) >> 24); | |
| 389 | 369 | |
| 390 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); | |
| 370 | if (state->fade_effect > b) | |
| 371 | b = 0; | |
| 372 | else | |
| 373 | b -= state->fade_effect; | |
| 374 | ||
| 375 | if (state->fade_effect > g) | |
| 376 | g = 0; | |
| 377 | else | |
| 378 | g -= state->fade_effect; | |
| 379 | ||
| 380 | if (state->fade_effect > r) | |
| 381 | r = 0; | |
| 382 | else | |
| 383 | r -= state->fade_effect; | |
| 384 | ||
| 385 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 391 | 386 | } |
| 392 | 387 | } |
| 393 | 388 | |
| 394 | 389 | static WRITE32_HANDLER( macrossp_palette_fade_w ) |
| 395 | 390 | { |
| 396 | fade_effect = ((data & 0xff00) >> 8) - 0x28;//it writes two times,first with a -0x28 then with the proper data | |
| 397 | // popmessage("%02x",fade_effect); | |
| 398 | if(old_fade != fade_effect) | |
| 391 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 392 | ||
| 393 | state->fade_effect = ((data & 0xff00) >> 8) - 0x28; //it writes two times, first with a -0x28 then with the proper data | |
| 394 | // popmessage("%02x",fade_effect); | |
| 395 | ||
| 396 | if (state->old_fade != state->fade_effect) | |
| 399 | 397 | { |
| 400 | old_fade = fade_effect; | |
| 398 | state->old_fade = state->fade_effect; | |
| 401 | 399 | update_colors(space->machine); |
| 402 | 400 | } |
| 403 | 401 | } |
| r7500 | r7501 | |
| 406 | 404 | |
| 407 | 405 | static ADDRESS_MAP_START( macrossp_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 408 | 406 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 409 | AM_RANGE(0x800000, 0x802fff) AM_RAM AM_BASE( | |
| 407 | AM_RANGE(0x800000, 0x802fff) AM_RAM AM_BASE_SIZE_MEMBER( | |
| 410 | 408 | /* SCR A Layer */ |
| 411 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(macrossp_scra_videoram_w) AM_BASE( | |
| 409 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(macrossp_scra_videoram_w) AM_BASE_MEMBER( | |
| 412 | 410 | AM_RANGE(0x904200, 0x9043ff) AM_WRITEONLY /* W/O? */ |
| 413 | AM_RANGE(0x905000, 0x90500b) AM_WRITEONLY AM_BASE( | |
| 411 | AM_RANGE(0x905000, 0x90500b) AM_WRITEONLY AM_BASE_MEMBER( | |
| 414 | 412 | /* SCR B Layer */ |
| 415 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(macrossp_scrb_videoram_w) AM_BASE( | |
| 413 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(macrossp_scrb_videoram_w) AM_BASE_MEMBER( | |
| 416 | 414 | AM_RANGE(0x90c200, 0x90c3ff) AM_WRITEONLY /* W/O? */ |
| 417 | AM_RANGE(0x90d000, 0x90d00b) AM_WRITEONLY AM_BASE( | |
| 415 | AM_RANGE(0x90d000, 0x90d00b) AM_WRITEONLY AM_BASE_MEMBER( | |
| 418 | 416 | /* SCR C Layer */ |
| 419 | AM_RANGE(0x910000, 0x913fff) AM_RAM_WRITE(macrossp_scrc_videoram_w) AM_BASE( | |
| 417 | AM_RANGE(0x910000, 0x913fff) AM_RAM_WRITE(macrossp_scrc_videoram_w) AM_BASE_MEMBER( | |
| 420 | 418 | AM_RANGE(0x914200, 0x9143ff) AM_WRITEONLY /* W/O? */ |
| 421 | AM_RANGE(0x915000, 0x91500b) AM_WRITEONLY AM_BASE( | |
| 419 | AM_RANGE(0x915000, 0x91500b) AM_WRITEONLY AM_BASE_MEMBER( | |
| 422 | 420 | /* Text Layer */ |
| 423 | AM_RANGE(0x918000, 0x91bfff) AM_RAM_WRITE(macrossp_text_videoram_w) AM_BASE( | |
| 421 | AM_RANGE(0x918000, 0x91bfff) AM_RAM_WRITE(macrossp_text_videoram_w) AM_BASE_MEMBER( | |
| 424 | 422 | AM_RANGE(0x91c200, 0x91c3ff) AM_WRITEONLY /* W/O? */ |
| 425 | AM_RANGE(0x91d000, 0x91d00b) AM_WRITEONLY AM_BASE( | |
| 423 | AM_RANGE(0x91d000, 0x91d00b) AM_WRITEONLY AM_BASE_MEMBER( | |
| 426 | 424 | |
| 427 | AM_RANGE(0xa00000, 0xa03fff) AM_RAM_WRITE(paletteram32_macrossp_w) AM_BASE_ | |
| 425 | AM_RANGE(0xa00000, 0xa03fff) AM_RAM_WRITE(paletteram32_macrossp_w) AM_BASE_MEMBER | |
| 428 | 426 | |
| 429 | 427 | AM_RANGE(0xb00000, 0xb00003) AM_READ_PORT("INPUTS") |
| 430 | 428 | AM_RANGE(0xb00004, 0xb00007) AM_READ(macrossp_soundstatus_r) AM_WRITENOP // irq related? |
| r7500 | r7501 | |
| 435 | 433 | |
| 436 | 434 | AM_RANGE(0xc00000, 0xc00003) AM_WRITE(macrossp_soundcmd_w) |
| 437 | 435 | |
| 438 | AM_RANGE(0xf00000, 0xf1ffff) AM_RAM AM_BASE( | |
| 436 | AM_RANGE(0xf00000, 0xf1ffff) AM_RAM AM_BASE_MEMBER( | |
| 439 | 437 | // AM_RANGE(0xfe0000, 0xfe0003) AM_NOP |
| 440 | 438 | ADDRESS_MAP_END |
| 441 | 439 | |
| r7500 | r7501 | |
| 586 | 584 | |
| 587 | 585 | static void irqhandler(running_device *device, int irq) |
| 588 | 586 | { |
| 589 | logerror("ES5506 irq %d\n",irq); | |
| 587 | // macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 588 | logerror("ES5506 irq %d\n", irq); | |
| 590 | 589 | |
| 591 | 590 | /* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506, |
| 592 | 591 | but I haven't noticed the ES5506 ever assert the line - maybe only used when developing the game? */ |
| 593 | // cpu | |
| 592 | // cpu | |
| 594 | 593 | } |
| 595 | 594 | |
| 596 | 595 | static const es5506_interface es5506_config = |
| r7500 | r7501 | |
| 603 | 602 | }; |
| 604 | 603 | |
| 605 | 604 | |
| 605 | static MACHINE_START( macrossp ) | |
| 606 | { | |
| 607 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 608 | ||
| 609 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 610 | state->audiocpu = devtag_get_device(machine, "audiocpu"); | |
| 611 | ||
| 612 | state_save_register_global(machine, state->sndpending); | |
| 613 | state_save_register_global(machine, state->snd_toggle); | |
| 614 | state_save_register_global(machine, state->fade_effect); | |
| 615 | state_save_register_global(machine, state->old_fade); | |
| 616 | } | |
| 617 | ||
| 618 | static MACHINE_RESET( macrossp ) | |
| 619 | { | |
| 620 | macrossp_state *state = (macrossp_state *)machine->driver_data; | |
| 621 | ||
| 622 | state->sndpending = 0; | |
| 623 | state->snd_toggle = 0; | |
| 624 | state->fade_effect = 0; | |
| 625 | state->old_fade = 0; | |
| 626 | } | |
| 627 | ||
| 606 | 628 | static MACHINE_DRIVER_START( macrossp ) |
| 629 | ||
| 630 | /* driver data */ | |
| 631 | MDRV_DRIVER_DATA(macrossp_state) | |
| 632 | ||
| 607 | 633 | /* basic machine hardware */ |
| 608 | 634 | MDRV_CPU_ADD("maincpu", M68EC020, 50000000/2) /* 25 MHz */ |
| 609 | 635 | MDRV_CPU_PROGRAM_MAP(macrossp_map) |
| r7500 | r7501 | |
| 612 | 638 | MDRV_CPU_ADD("audiocpu", M68000, 32000000/2) /* 16 MHz */ |
| 613 | 639 | MDRV_CPU_PROGRAM_MAP(macrossp_sound_map) |
| 614 | 640 | |
| 641 | MDRV_MACHINE_START(macrossp) | |
| 642 | MDRV_MACHINE_RESET(macrossp) | |
| 643 | ||
| 615 | 644 | /* video hardware */ |
| 616 | 645 | MDRV_SCREEN_ADD("screen", RASTER) |
| 617 | 646 | MDRV_SCREEN_REFRESH_RATE(60) |
| r7500 | r7501 | |
| 749 | 778 | PC :0001810A 01810A: cmp.w $f10140.l, D0 |
| 750 | 779 | PC :00018110 018110: beq 18104 |
| 751 | 780 | */ |
| 752 | COMBINE_DATA(¯ossp_mainram[0x10158/4]); | |
| 753 | if (cpu_get_pc(space->cpu)==0x001810A) cpu_spinuntil_int(space->cpu); | |
| 781 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 782 | ||
| 783 | COMBINE_DATA(&state->mainram[0x10158 / 4]); | |
| 784 | if (cpu_get_pc(space->cpu) == 0x001810A) cpu_spinuntil_int(space->cpu); | |
| 754 | 785 | } |
| 755 | 786 | |
| 756 | 787 | #ifdef UNUSED_FUNCTION |
| 757 | 788 | static WRITE32_HANDLER( quizmoon_speedup_w ) |
| 758 | 789 | { |
| 759 | COMBINE_DATA(¯ossp_mainram[0x00020/4]); | |
| 760 | if (cpu_get_pc(space->cpu)==0x1cc) cpu_spinuntil_int(space->cpu); | |
| 790 | macrossp_state *state = (macrossp_state *)space->machine->driver_data; | |
| 791 | ||
| 792 | COMBINE_DATA(&state->mainram[0x00020 / 4]); | |
| 793 | if (cpu_get_pc(space->cpu) == 0x1cc) cpu_spinuntil_int(space->cpu); | |
| 761 | 794 | } |
| 762 | 795 | #endif |
| 763 | 796 | |
| r7500 | r7501 | |
| 773 | 806 | #endif |
| 774 | 807 | } |
| 775 | 808 | |
| 776 | GAME( 1996, macrossp, 0, macrossp, macrossp, macrossp, ROT270, "Banpresto", "Macross Plus", GAME_IMPERFECT_GRAPHICS ) | |
| 777 | GAME( 1997, quizmoon, 0, quizmoon, quizmoon, quizmoon, ROT0, "Banpresto", "Quiz Bisyoujo Senshi Sailor Moon - Chiryoku Tairyoku Toki no Un", GAME_IMPERFECT_GRAPHICS ) | |
| 809 | GAME( 1996, macrossp, 0, macrossp, macrossp, macrossp, ROT270, "Banpresto", "Macross Plus", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 810 | GAME( 1997, quizmoon, 0, quizmoon, quizmoon, quizmoon, ROT0, "Banpresto", "Quiz Bisyoujo Senshi Sailor Moon - Chiryoku Tairyoku Toki no Un", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 83 | 83 | #define HLE_COM |
| 84 | 84 | |
| 85 | 85 | |
| 86 | typedef struct _imolagp_state imolagp_state; | |
| 87 | struct _imolagp_state | |
| 86 | class imolagp_state | |
| 88 | 87 | { |
| 88 | public: | |
| 89 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, imolagp_state(machine)); } | |
| 90 | ||
| 91 | imolagp_state(running_machine &machine) { } | |
| 92 | ||
| 89 | 93 | UINT8 *slave_workram; // used only ifdef HLE_COM |
| 90 | 94 | |
| 91 | 95 | #ifdef HLE_COM |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #include "cpu/i86/i86.h" |
| 46 | 46 | #include "sound/ay8910.h" |
| 47 | 47 | |
| 48 | typedef struct _hotblock_state hotblock_state; | |
| 49 | struct _hotblock_state | |
| 48 | class hotblock_state | |
| 50 | 49 | { |
| 50 | public: | |
| 51 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, hotblock_state(machine)); } | |
| 52 | ||
| 53 | hotblock_state(running_machine &machine) { } | |
| 54 | ||
| 51 | 55 | /* memory pointers */ |
| 52 | 56 | UINT8 * vram; |
| 53 | 57 | UINT8 * pal; |
| r7500 | r7501 | |
|---|---|---|
| 1072 | 1072 | state_save_register_global(machine, state->mj_last_val); |
| 1073 | 1073 | state_save_register_global(machine, state->hwc_input_value); |
| 1074 | 1074 | state_save_register_global(machine, state->atomicp_sound_divisor); |
| 1075 | state_save_register_global(machine, state->atomicp_sound_count); | |
| 1076 | 1075 | state_save_register_global_pointer(machine, segaic16_spriteram_0, 0x00800/2); |
| 1077 | 1076 | state_save_register_global_pointer(machine, segaic16_paletteram, 0x01000/2); |
| 1078 | 1077 | state_save_register_global_pointer(machine, segaic16_tileram_0, 0x10000/2); |
| r7500 | r7501 | |
|---|---|---|
| 56 | 56 | #include "cpu/m68000/m68000.h" |
| 57 | 57 | #include "includes/decocrpt.h" |
| 58 | 58 | #include "includes/decoprot.h" |
| 59 | #include "i | |
| 59 | #include "vi | |
| 60 | 60 | #include "sound/okim6295.h" |
| 61 | #include "includes/pktgaldx.h" | |
| 61 | 62 | |
| 62 | VIDEO_START(pktgaldx); | |
| 63 | VIDEO_UPDATE(pktgaldx); | |
| 64 | VIDEO_START(pktgaldb); | |
| 65 | VIDEO_UPDATE(pktgaldb); | |
| 66 | 63 | |
| 67 | extern UINT16* pcktgaldb_fgram; | |
| 68 | extern UINT16* pcktgaldb_sprites; | |
| 69 | ||
| 70 | 64 | /**********************************************************************************/ |
| 71 | 65 | |
| 72 | 66 | static WRITE16_DEVICE_HANDLER(pktgaldx_oki_bank_w) |
| r7500 | r7501 | |
| 79 | 73 | static ADDRESS_MAP_START( pktgaldx_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 80 | 74 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 81 | 75 | |
| 82 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 83 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 84 | AM_RANGE(0x110000, 0x1107ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) | |
| 85 | AM_RANGE(0x112000, 0x1127ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) | |
| 76 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_r, deco16ic_pf1_data_w) | |
| 77 | AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_r, deco16ic_pf2_data_w) | |
| 78 | AM_RANGE(0x110000, 0x1107ff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pf1_rowscroll) | |
| 79 | AM_RANGE(0x112000, 0x1127ff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pf2_rowscroll) | |
| 86 | 80 | |
| 87 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) | |
| 88 | AM_RANGE(0x130000, 0x130fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 81 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(pktgaldx_state, spriteram, spriteram_size) | |
| 82 | AM_RANGE(0x130000, 0x130fff) AM_RAM_DEVWRITE("deco_custom", deco16ic_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram) | |
| 89 | 83 | |
| 90 | 84 | AM_RANGE(0x140000, 0x14000f) AM_DEVWRITE8("oki1", okim6295_w, 0x00ff) |
| 91 | 85 | AM_RANGE(0x140006, 0x140007) AM_DEVREAD8("oki1", okim6295_r, 0x00ff) |
| 92 | 86 | AM_RANGE(0x150000, 0x15000f) AM_DEVWRITE8("oki2", okim6295_w, 0x00ff) |
| 93 | 87 | AM_RANGE(0x150006, 0x150007) AM_DEVREAD8("oki2", okim6295_r, 0x00ff) |
| 94 | 88 | |
| 95 | AM_RANGE(0x161800, 0x16180f) AM_WRITE | |
| 89 | AM_RANGE(0x161800, 0x16180f) AM_DEVWRITE | |
| 96 | 90 | AM_RANGE(0x164800, 0x164801) AM_DEVWRITE("oki2", pktgaldx_oki_bank_w) |
| 97 | 91 | AM_RANGE(0x167800, 0x167fff) AM_READWRITE(deco16_104_pktgaldx_prot_r,deco16_104_pktgaldx_prot_w) AM_BASE(&deco16_prot_ram) |
| 98 | 92 | AM_RANGE(0x170000, 0x17ffff) AM_RAM |
| r7500 | r7501 | |
| 127 | 121 | |
| 128 | 122 | static ADDRESS_MAP_START( pktgaldb_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 129 | 123 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 130 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE( | |
| 124 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE_MEMBER( | |
| 131 | 125 | AM_RANGE(0x102000, 0x102fff) AM_RAM // bgram on original? |
| 132 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE( | |
| 126 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER( | |
| 133 | 127 | |
| 134 | 128 | AM_RANGE(0x130000, 0x130fff) AM_RAM // palette on original? |
| 135 | 129 | |
| r7500 | r7501 | |
| 298 | 292 | GFXDECODE_END |
| 299 | 293 | |
| 300 | 294 | |
| 295 | static int pktgaldx_bank_callback( const int bank ) | |
| 296 | { | |
| 297 | return ((bank >> 4) & 0x7) * 0x1000; | |
| 298 | } | |
| 299 | ||
| 300 | static const deco16ic_interface pktgaldx_deco16ic_intf = | |
| 301 | { | |
| 302 | "screen", | |
| 303 | 1, 0, 1, | |
| 304 | 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ | |
| 305 | 0, 16, 0, 16, /* color base (default values) */ | |
| 306 | 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ | |
| 307 | NULL, | |
| 308 | pktgaldx_bank_callback, | |
| 309 | NULL, | |
| 310 | NULL | |
| 311 | }; | |
| 312 | ||
| 313 | static MACHINE_START( pktgaldx ) | |
| 314 | { | |
| 315 | pktgaldx_state *state = (pktgaldx_state *)machine->driver_data; | |
| 316 | ||
| 317 | state->maincpu = devtag_get_device(machine, "maincpu"); | |
| 318 | state->deco16ic = devtag_get_device(machine, "deco_custom"); | |
| 319 | } | |
| 320 | ||
| 301 | 321 | static MACHINE_DRIVER_START( pktgaldx ) |
| 322 | ||
| 323 | /* driver data */ | |
| 324 | MDRV_DRIVER_DATA(pktgaldx_state) | |
| 325 | ||
| 302 | 326 | /* basic machine hardware */ |
| 303 | 327 | MDRV_CPU_ADD("maincpu", M68000, 14000000) |
| 304 | 328 | MDRV_CPU_PROGRAM_MAP(pktgaldx_map) |
| 305 | 329 | MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 306 | 330 | |
| 331 | MDRV_MACHINE_START(pktgaldx) | |
| 332 | ||
| 307 | 333 | /* video hardware */ |
| 308 | 334 | MDRV_SCREEN_ADD("screen", RASTER) |
| 309 | 335 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 315 | 341 | MDRV_PALETTE_LENGTH(4096) |
| 316 | 342 | MDRV_GFXDECODE(pktgaldx) |
| 317 | 343 | |
| 318 | MDRV_VIDEO_START(pktgaldx) | |
| 319 | 344 | MDRV_VIDEO_UPDATE(pktgaldx) |
| 320 | 345 | |
| 346 | MDRV_DECO16IC_ADD("deco_custom", pktgaldx_deco16ic_intf) | |
| 347 | ||
| 321 | 348 | /* sound hardware */ |
| 322 | 349 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 323 | 350 | |
| r7500 | r7501 | |
| 334 | 361 | |
| 335 | 362 | |
| 336 | 363 | static MACHINE_DRIVER_START( pktgaldb ) |
| 364 | ||
| 365 | /* driver data */ | |
| 366 | MDRV_DRIVER_DATA(pktgaldx_state) | |
| 367 | ||
| 337 | 368 | /* basic machine hardware */ |
| 338 | 369 | MDRV_CPU_ADD("maincpu", M68000, 16000000) |
| 339 | 370 | MDRV_CPU_PROGRAM_MAP(pktgaldb_map) |
| 340 | 371 | MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 341 | 372 | |
| 373 | MDRV_MACHINE_START(pktgaldx) | |
| 374 | ||
| 342 | 375 | /* video hardware */ |
| 343 | 376 | MDRV_SCREEN_ADD("screen", RASTER) |
| 344 | 377 | MDRV_SCREEN_REFRESH_RATE(58) |
| r7500 | r7501 | |
| 350 | 383 | MDRV_PALETTE_LENGTH(4096) |
| 351 | 384 | MDRV_GFXDECODE(bootleg) |
| 352 | 385 | |
| 353 | MDRV_VIDEO_START(pktgaldb) | |
| 354 | 386 | MDRV_VIDEO_UPDATE(pktgaldb) |
| 355 | 387 | |
| 356 | 388 | /* sound hardware */ |
| r7500 | r7501 | |
| 433 | 465 | deco102_decrypt_cpu(machine, "maincpu", 0x42ba, 0x00, 0x00); |
| 434 | 466 | } |
| 435 | 467 | |
| 436 | GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", 0 ) | |
| 437 | GAME( 1993, pktgaldxj, pktgaldx, pktgaldx, pktgaldx, pktgaldx, ROT0, "Nihon System", "Pocket Gal Deluxe (Japan v3.00)", 0 ) | |
| 438 | GAME( 1992, pktgaldxb, pktgaldx, pktgaldb, pktgaldx, 0, ROT0, "bootleg", "Pocket Gal Deluxe (Euro v3.00, bootleg)", GAME_IMPERFECT_GRAPHICS ) | |
| 468 | GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", GAME_SUPPORTS_SAVE ) | |
| 469 | GAME( 1993, pktgaldxj, pktgaldx, pktgaldx, pktgaldx, pktgaldx, ROT0, "Nihon System", "Pocket Gal Deluxe (Japan v3.00)", GAME_SUPPORTS_SAVE ) | |
| 470 | GAME( 1992, pktgaldxb, pktgaldx, pktgaldb, pktgaldx, 0, ROT0, "bootleg", "Pocket Gal Deluxe (Euro v3.00, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 537 | 537 | ROM_LOAD( "crash.d14", 0x0000, 0x0200, CRC(833f81e4) SHA1(78a0ace3510546691ecaf6f6275cb3269495edc9) ) /* Cars */ |
| 538 | 538 | ROM_END |
| 539 | 539 | |
| 540 | ROM_START( smash ) | |
| 541 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 542 | ROM_LOAD( "smash.a1", 0x1000, 0x0200, CRC(b9571203) SHA1(1299e476598d07a67aa1640f3320de1198280296) ) /* Code */ | |
| 543 | ROM_LOAD( "smash.a2", 0x1200, 0x0200, CRC(b4581a95) SHA1(b3662bda5013443a56eabbe21fefa91e255e18e7) ) | |
| 544 | ROM_LOAD( "smash.a3", 0x1400, 0x0200, CRC(597555ae) SHA1(39a6d10e229be0e0d52b1061f2aa2f678b351f0b) ) | |
| 545 | ROM_LOAD( "smash.a4", 0x1600, 0x0200, CRC(0a15d69f) SHA1(c3a7b5ce4406cce511108e5c015b1dd5587b75ed) ) | |
| 546 | ROM_LOAD( "smash.a5", 0x1800, 0x0200, CRC(a9c7a328) SHA1(2f21ee58ba117bf4fe9101373c55449217a08da6) ) | |
| 547 | ROM_LOAD( "smash.a6", 0x1a00, 0x0200, CRC(c7d62d27) SHA1(974800cbeba2f2d0d796200d235371e2ce3a1d28) ) | |
| 548 | ROM_LOAD( "smash.a7", 0x1c00, 0x0200, CRC(5e5af244) SHA1(9ea27241a5ac97b260599d56f60bf9ec3ffcac7f) ) | |
| 549 | ROM_LOAD( "smash.a8", 0x1e00, 0x0200, CRC(3dc50839) SHA1(5782ea7d70e5cbe8b8245ed1075ce92b57cc6ddf) ) | |
| 550 | ROM_RELOAD( 0xfe00, 0x0200 ) /* for the reset and interrupt vectors */ | |
| 551 | ||
| 552 | ROM_REGION( 0x0800, "gfx1", 0 ) | |
| 553 | ROM_LOAD( "smash.c4", 0x0000, 0x0200, CRC(442500e5) SHA1(c54ebd5ccee096d8eed4153f623adc4e655b3909) ) /* Character Set */ | |
| 554 | ROM_LOAD( "smash.c3", 0x0200, 0x0200, CRC(3c8f7560) SHA1(ce4023167a0b4b912bbbc70b00fd3b462990a04c) ) | |
| 555 | ROM_LOAD( "smash.c2", 0x0400, 0x0200, CRC(38f3e4ed) SHA1(4e537402c09b58997bc45498fd721d83a0eac3a7) ) | |
| 556 | ROM_LOAD( "smash.c1", 0x0600, 0x0200, CRC(e9adf1e1) SHA1(c1f6d2a3be1e9b35c8675d1e3f57e6a85ddd99fd) ) | |
| 557 | ||
| 558 | ROM_REGION( 0x0200, "gfx2", 0 ) | |
| 559 | ROM_LOAD( "smash.d14", 0x0000, 0x0200, CRC(833f81e4) SHA1(78a0ace3510546691ecaf6f6275cb3269495edc9) ) /* Cars */ | |
| 560 | ROM_END | |
| 561 | ||
| 540 | 562 | ROM_START( ripcord ) |
| 541 | 563 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 542 | 564 | ROM_LOAD( "9027.1a", 0x1000, 0x0200, CRC(56b8dc06) SHA1(5432e4f2e321805a8dc9cfce20b8372793a9a4dd) ) /* Code */ |
| r7500 | r7501 | |
| 587 | 609 | GAMEL(1977, circusse, circus, circus, circus, circus, ROT0, "[Exidy] (Sub-Electro bootleg)", "Circus (Sub-Electro bootleg)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_circus ) // looks like a text hack, but we've seen 2 identical copies so it's worth supporting |
| 588 | 610 | GAME( 1977, robotbwl, 0, robotbwl, robotbwl, robotbwl, ROT0, "Exidy", "Robot Bowl", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) |
| 589 | 611 | GAMEL(1979, crash, 0, crash, crash, crash, ROT0, "Exidy", "Crash", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_crash ) |
| 612 | GAMEL(1979, smash, crash, crash, crash, crash, ROT0, "[Exidy] (bootleg)", "Smash (Crash bootleg)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_crash ) // looks like a text hack, but it also had a different bezel | |
| 590 | 613 | GAME( 1979, ripcord, 0, ripcord, ripcord, ripcord, ROT0, "Exidy", "Rip Cord", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) |
| r7500 | r7501 | |
|---|---|---|
| 495 | 495 | - Known bugs : |
| 496 | 496 | * Coins "buttons" don't work - we need to use fake BUTTON2 for each player |
| 497 | 497 | |
| 498 | **************************************************************************** | |
| 499 | ||
| 500 | HEXA | |
| 501 | ||
| 502 | This hardware is derived from Arkanoid's hardware. The 1986 date found in | |
| 503 | the roms probably comes from Arkanoid. This is a Columns style game and | |
| 504 | the original Columns wasn't released until 1990 and I find it hard to | |
| 505 | believe that this would pre-date Columns. | |
| 506 | ||
| 507 | driver by Howie Cohen | |
| 508 | ||
| 509 | Memory map (prelim) | |
| 510 | 0000 7fff ROM | |
| 511 | 8000 bfff bank switch rom space?? | |
| 512 | c000 c7ff RAM | |
| 513 | e000 e7ff video ram | |
| 514 | e800-efff unused RAM | |
| 515 | ||
| 516 | read: | |
| 517 | d001 AY8910 read | |
| 518 | f000 ??????? | |
| 519 | ||
| 520 | write: | |
| 521 | d000 AY8910 control | |
| 522 | d001 AY8910 write | |
| 523 | d008 bit0/1 = flip screen x/y | |
| 524 | bit 4 = ROM bank?? | |
| 525 | bit 5 = char bank | |
| 526 | other bits???????? | |
| 527 | d010 watchdog reset, or IRQ acknowledge, or both | |
| 528 | f000 ???????? | |
| 529 | ||
| 530 | main hardware consists of..... | |
| 531 | ||
| 532 | sub board with Z80 x2, 2 ROMs and a scratched 18 pin chip (probably a PIC) | |
| 533 | ||
| 534 | main board has.... | |
| 535 | 12MHz xtal | |
| 536 | ay3-8910 | |
| 537 | 8 position DSW x1 | |
| 538 | ROMs x4 | |
| 539 | 6116 SRAM x3 | |
| 540 | 82S123 PROMs x3 | |
| 541 | ||
| 498 | 542 | *************************************************************************** |
| 499 | 543 | |
| 500 | 544 | DIP locations verified for: |
| r7500 | r7501 | |
| 543 | 587 | AM_RANGE(0xf000, 0xffff) AM_READNOP /* fixes instant death in final level */ |
| 544 | 588 | ADDRESS_MAP_END |
| 545 | 589 | |
| 590 | static ADDRESS_MAP_START( hexa_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 591 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 592 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") | |
| 593 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 594 | AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_r) | |
| 595 | AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_address_data_w) | |
| 596 | AM_RANGE(0xd008, 0xd008) AM_WRITE(hexa_d008_w) | |
| 597 | AM_RANGE(0xd010, 0xd010) AM_WRITE(watchdog_reset_w) /* or IRQ acknowledge, or both */ | |
| 598 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_BASE_SIZE_MEMBER(arkanoid_state, videoram, videoram_size) | |
| 599 | ADDRESS_MAP_END | |
| 600 | ||
| 546 | 601 | static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 547 | 602 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 548 | 603 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(arkanoid_68705_port_a_r, arkanoid_68705_port_a_w) |
| r7500 | r7501 | |
| 761 | 816 | INPUT_PORTS_END |
| 762 | 817 | |
| 763 | 818 | |
| 819 | static INPUT_PORTS_START( hexa ) | |
| 820 | PORT_START("INPUTS") | |
| 821 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 822 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 823 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 824 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 825 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 826 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) | |
| 827 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 828 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 829 | ||
| 830 | PORT_START("DSW") | |
| 831 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 832 | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) | |
| 833 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 834 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 835 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 836 | PORT_DIPNAME( 0x04, 0x00, "Naughty Pics" ) PORT_DIPLOCATION("SW1:3") | |
| 837 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 838 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 839 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:4") | |
| 840 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 841 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 842 | PORT_DIPNAME( 0x30, 0x30, "Difficulty?" ) PORT_DIPLOCATION("SW1:5,6") | |
| 843 | PORT_DIPSETTING( 0x30, "Easy?" ) | |
| 844 | PORT_DIPSETTING( 0x20, "Medium?" ) | |
| 845 | PORT_DIPSETTING( 0x10, "Hard?" ) | |
| 846 | PORT_DIPSETTING( 0x00, "Hardest?" ) | |
| 847 | PORT_DIPNAME( 0x40, 0x40, "Pobys" ) PORT_DIPLOCATION("SW1:7") | |
| 848 | PORT_DIPSETTING( 0x40, "2" ) | |
| 849 | PORT_DIPSETTING( 0x00, "4" ) | |
| 850 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") | |
| 851 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 852 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 853 | INPUT_PORTS_END | |
| 854 | ||
| 764 | 855 | /***************************************************************************/ |
| 765 | 856 | |
| 766 | 857 | /* Graphics Layouts */ |
| r7500 | r7501 | |
| 783 | 874 | // sprites use the same characters above, but are 16x8 |
| 784 | 875 | GFXDECODE_END |
| 785 | 876 | |
| 877 | static GFXDECODE_START( hexa ) | |
| 878 | GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0 , 32 ) | |
| 879 | GFXDECODE_END | |
| 880 | ||
| 881 | ||
| 786 | 882 | /* Sound Interfaces */ |
| 787 | 883 | |
| 788 | 884 | static const ay8910_interface ay8910_config = |
| r7500 | r7501 | |
| 795 | 891 | DEVCB_NULL |
| 796 | 892 | }; |
| 797 | 893 | |
| 894 | ||
| 895 | static const ay8910_interface hexa_ay8910_config = | |
| 896 | { | |
| 897 | AY8910_LEGACY_OUTPUT, | |
| 898 | AY8910_DEFAULT_LOADS, | |
| 899 | DEVCB_INPUT_PORT("INPUTS"), | |
| 900 | DEVCB_INPUT_PORT("DSW"), | |
| 901 | DEVCB_NULL, | |
| 902 | DEVCB_NULL | |
| 903 | }; | |
| 904 | ||
| 905 | ||
| 906 | ||
| 798 | 907 | /* Machine Drivers */ |
| 799 | 908 | |
| 800 | 909 | static MACHINE_START( arkanoid ) |
| r7500 | r7501 | |
| 847 | 956 | /* driver data */ |
| 848 | 957 | MDRV_DRIVER_DATA(arkanoid_state) |
| 849 | 958 | |
| 850 | / | |
| 959 | /* basic machine hardware */ | |
| 851 | 960 | MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 852 | 961 | MDRV_CPU_PROGRAM_MAP(arkanoid_map) |
| 853 | 962 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r7500 | r7501 | |
| 860 | 969 | MDRV_MACHINE_START(arkanoid) |
| 861 | 970 | MDRV_MACHINE_RESET(arkanoid) |
| 862 | 971 | |
| 863 | / | |
| 972 | /* video hardware */ | |
| 864 | 973 | MDRV_SCREEN_ADD("screen", RASTER) |
| 865 | 974 | MDRV_SCREEN_REFRESH_RATE(60) |
| 866 | 975 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r7500 | r7501 | |
| 874 | 983 | MDRV_VIDEO_START(arkanoid) |
| 875 | 984 | MDRV_VIDEO_UPDATE(arkanoid) |
| 876 | 985 | |
| 877 | / | |
| 986 | /* sound hardware */ | |
| 878 | 987 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 879 | 988 | |
| 880 | 989 | MDRV_SOUND_ADD("aysnd", YM2149, XTAL_12MHz/4/2) /* YM2149 clock is 3mhz, pin 26 is low so 3mhz/2 */ |
| r7500 | r7501 | |
| 882 | 991 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
| 883 | 992 | MACHINE_DRIVER_END |
| 884 | 993 | |
| 994 | ||
| 995 | static MACHINE_DRIVER_START( hexa ) | |
| 996 | /* driver data */ | |
| 997 | MDRV_DRIVER_DATA(arkanoid_state) | |
| 998 | ||
| 999 | /* basic machine hardware */ | |
| 1000 | MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* Imported from arkanoid - correct? */ | |
| 1001 | MDRV_CPU_PROGRAM_MAP(hexa_map) | |
| 1002 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) | |
| 1003 | ||
| 1004 | MDRV_MACHINE_START(arkanoid) | |
| 1005 | MDRV_MACHINE_RESET(arkanoid) | |
| 1006 | ||
| 1007 | /* video hardware */ | |
| 1008 | MDRV_SCREEN_ADD("screen", RASTER) | |
| 1009 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1010 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1011 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1012 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1013 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
| 1014 | ||
| 1015 | MDRV_GFXDECODE(hexa) | |
| 1016 | MDRV_PALETTE_LENGTH(256) | |
| 1017 | ||
| 1018 | MDRV_PALETTE_INIT(RRRR_GGGG_BBBB) | |
| 1019 | MDRV_VIDEO_START(arkanoid) | |
| 1020 | MDRV_VIDEO_UPDATE(hexa) | |
| 1021 | ||
| 1022 | /* sound hardware */ | |
| 1023 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1024 | MDRV_SOUND_ADD("aysnd", AY8910, XTAL_12MHz/4/2) /* Imported from arkanoid - correct? */ | |
| 1025 | MDRV_SOUND_CONFIG(hexa_ay8910_config) | |
| 1026 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1027 | MACHINE_DRIVER_END | |
| 1028 | ||
| 1029 | ||
| 885 | 1030 | static MACHINE_DRIVER_START( bootleg ) |
| 886 | 1031 | MDRV_IMPORT_FROM(arkanoid) |
| 887 | 1032 | |
| 888 | / | |
| 1033 | /* basic machine hardware */ | |
| 889 | 1034 | MDRV_CPU_MODIFY("maincpu") |
| 890 | 1035 | MDRV_CPU_PROGRAM_MAP(bootleg_map) |
| 891 | 1036 | |
| r7500 | r7501 | |
| 1255 | 1400 | ROM_LOAD( "ic75.13e", 0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) ) /* blue component */ |
| 1256 | 1401 | ROM_END |
| 1257 | 1402 | |
| 1258 | /* the other Dr. Korea game (Hexa, hexa.c) also appears to be derived from Arkanoid hardware */ | |
| 1259 | 1403 | |
| 1260 | 1404 | ROM_START( tetrsark ) |
| 1261 | 1405 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| r7500 | r7501 | |
| 1274 | 1418 | ROM_END |
| 1275 | 1419 | |
| 1276 | 1420 | |
| 1421 | ROM_START( hexa ) | |
| 1422 | ROM_REGION( 0x18000, "maincpu", 0 ) /* 64k for code + 32k for banked ROM */ | |
| 1423 | ROM_LOAD( "hexa.20", 0x00000, 0x8000, CRC(98b00586) SHA1(3591a3b0486d720f0aaa9f0bf4be352cd0ffcbc7) ) | |
| 1424 | ROM_LOAD( "hexa.21", 0x10000, 0x8000, CRC(3d5d006c) SHA1(ad4eadab82024b122182eacb5a322cfd6e476a70) ) | |
| 1425 | ||
| 1426 | ROM_REGION( 0x18000, "gfx1", 0 ) | |
| 1427 | ROM_LOAD( "hexa.17", 0x00000, 0x8000, CRC(f6911dd6) SHA1(b12ea27ecddd60820a32d4346afab0cc9d06fa57) ) | |
| 1428 | ROM_LOAD( "hexa.18", 0x08000, 0x8000, CRC(6e3d95d2) SHA1(6399b7b5d088ceda08fdea9cf650f6b405f038e7) ) | |
| 1429 | ROM_LOAD( "hexa.19", 0x10000, 0x8000, CRC(ffe97a31) SHA1(f16b5d2b9ace09bcbbfe3dfb73db7fa377d1af7f) ) | |
| 1430 | ||
| 1431 | ROM_REGION( 0x0300, "proms", 0 ) | |
| 1432 | ROM_LOAD( "hexa.001", 0x0000, 0x0100, CRC(88a055b4) SHA1(eee86a7930d0a251f3e5c2134532cd1dede2026c) ) | |
| 1433 | ROM_LOAD( "hexa.003", 0x0100, 0x0100, CRC(3e9d4932) SHA1(9a336dba7134400312985b9902c77b4141105853) ) | |
| 1434 | ROM_LOAD( "hexa.002", 0x0200, 0x0100, CRC(ff15366c) SHA1(7feaf1c768bfe76432fb80991585e13d95960b34) ) | |
| 1435 | ROM_END | |
| 1436 | ||
| 1437 | ||
| 1277 | 1438 | /* Driver Initialization */ |
| 1278 | 1439 | |
| 1279 | 1440 | static void arkanoid_bootleg_init( running_machine *machine ) |
| r7500 | r7501 | |
| 1377 | 1538 | } |
| 1378 | 1539 | |
| 1379 | 1540 | |
| 1541 | static DRIVER_INIT( hexa ) | |
| 1542 | { | |
| 1543 | UINT8 *RAM = memory_region(machine, "maincpu"); | |
| 1544 | #if 0 | |
| 1545 | ||
| 1546 | ||
| 1547 | /* Hexa is not protected or anything, but it keeps writing 0x3f to register */ | |
| 1548 | /* 0x07 of the AY8910, to read the input ports. This causes clicks in the */ | |
| 1549 | /* music since the output channels are continuously disabled and reenabled. */ | |
| 1550 | /* To avoid that, we just NOP out the 0x3f write. */ | |
| 1551 | ||
| 1552 | RAM[0x0124] = 0x00; | |
| 1553 | RAM[0x0125] = 0x00; | |
| 1554 | RAM[0x0126] = 0x00; | |
| 1555 | #endif | |
| 1556 | ||
| 1557 | memory_configure_bank(machine, "bank1", 0, 2, &RAM[0x10000], 0x4000); | |
| 1558 | } | |
| 1559 | ||
| 1560 | ||
| 1380 | 1561 | /* Game Drivers */ |
| 1381 | 1562 | |
| 1382 | 1563 | GAME( 1986, arkanoid, 0, arkanoid, arkanoid, 0, ROT90, "Taito Corporation Japan", "Arkanoid (World)", GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
| 1398 | 1579 | GAME( 1986, arktayt2, arkanoid, bootleg, arktayt2, 0, ROT90, "bootleg", "Arkanoid (Tayto bootleg, harder)", GAME_SUPPORTS_SAVE ) |
| 1399 | 1580 | GAME( 1987, arkatour, arkanoid, arkanoid, arkanoid, 0, ROT90, "Taito America Corporation (Romstar license)", "Tournament Arkanoid (US)", GAME_SUPPORTS_SAVE ) |
| 1400 | 1581 | GAME( 19??, tetrsark, 0, bootleg, tetrsark, tetrsark, ROT0, "D.R. Korea", "Tetris (D.R. Korea)", GAME_SUPPORTS_SAVE ) |
| 1582 | GAME( 199?, hexa, 0, hexa, hexa, hexa, ROT0, "D.R. Korea", "Hexa", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r7500 | r7501 | |
|---|---|---|
| 71 | 71 | #include "deprecat.h" |
| 72 | 72 | #include "sound/nile.h" |
| 73 | 73 | |
| 74 | typedef struct _srmp6_state srmp6_state; | |
| 75 | struct _srmp6_state | |
| 74 | class srmp6_state | |
| 76 | 75 | { |
| 76 | public: | |
| 77 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, srmp6_state(machine)); } | |
| 78 | ||
| 79 | srmp6_state(running_machine &machine) { } | |
| 80 | ||
| 77 | 81 | UINT16* tileram; |
| 78 | 82 | UINT16* dmaram; |
| 79 | 83 |
| r7500 | r7501 | |
|---|---|---|
| 8 | 8 | #include "cpu/m6800/m6800.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | typedef struct _cball_state cball_state; | |
| 12 | struct _cball_state | |
| 11 | class cball_state | |
| 13 | 12 | { |
| 13 | public: | |
| 14 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cball_state(machine)); } | |
| 15 | ||
| 16 | cball_state(running_machine &machine) { } | |
| 17 | ||
| 14 | 18 | /* memory pointers */ |
| 15 | 19 | UINT8 * video_ram; |
| 16 | 20 |
| r7500 | r7501 | |
|---|---|---|
| 117 | 117 | #include "sound/3812intf.h" |
| 118 | 118 | |
| 119 | 119 | |
| 120 | typedef struct _bigfghtr_state bigfghtr_state; | |
| 121 | struct _bigfghtr_state | |
| 120 | class bigfghtr_state | |
| 122 | 121 | { |
| 122 | public: | |
| 123 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigfghtr_state(machine)); } | |
| 124 | ||
| 125 | bigfghtr_state(running_machine &machine) { } | |
| 126 | ||
| 123 | 127 | /* video-related */ |
| 124 | 128 | UINT16 * text_videoram; |
| 125 | 129 | UINT16 * bg_videoram; |
| r7500 | r7501 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | #include "emu.h" |
| 216 | 216 | #include "cpu/z80/z80.h" |
| 217 | #include "cpu/z180/z180.h" | |
| 217 | 218 | #include "cpu/m68000/m68000.h" |
| 218 | 219 | #include "includes/taitoipt.h" |
| 219 | 220 | #include "video/taitoic.h" |
| r7500 | r7501 | |
| 293 | 294 | state->adpcm_pos &= 0xff00; |
| 294 | 295 | } |
| 295 | 296 | |
| 297 | static UINT8 *cadash_shared_ram; | |
| 298 | ||
| 299 | static READ16_HANDLER( cadash_share_r ) | |
| 300 | { | |
| 301 | return cadash_shared_ram[offset]; | |
| 302 | } | |
| 303 | ||
| 304 | static WRITE16_HANDLER( cadash_share_w ) | |
| 305 | { | |
| 306 | cadash_shared_ram[offset] = data & 0xff; | |
| 307 | } | |
| 308 | ||
| 309 | ||
| 296 | 310 | /*********************************************************** |
| 297 | 311 | MEMORY STRUCTURES |
| 298 | 312 | ***********************************************************/ |
| r7500 | r7501 | |
| 338 | 352 | AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 339 | 353 | AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 340 | 354 | AM_RANGE(0x100000, 0x107fff) AM_RAM |
| 341 | AM_RANGE(0x800000, 0x800fff) AM_RA | |
| 355 | AM_RANGE(0x800000, 0x800fff) AM_READWRITE(cadash_share_r,cadash_share_w) /* network ram */ | |
| 342 | 356 | AM_RANGE(0x900000, 0x90000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 343 | 357 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_4bpg_word_w) |
| 344 | 358 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("pc090oj", pc090oj_word_r, pc090oj_word_w) /* sprite ram */ |
| r7500 | r7501 | |
| 401 | 415 | AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w) |
| 402 | 416 | ADDRESS_MAP_END |
| 403 | 417 | |
| 418 | /* | |
| 419 | Cadash communication CPU is a z180. | |
| 420 | [0x8000]: at pc=31, z180 checks a byte ... if it's equal to 0x4d ("M") then the board is in master mode, otherwise it's in slave mode. | |
| 421 | Right now, the z180 is too fast, so it never checks it properly ... maybe I'm missing a z180 halt line that's lying to somewhere on m68k side. | |
| 422 | [0x8002]: puts T in master mode, R in slave mode ... looks a rather obvious flag that says the current Tx / Rx state | |
| 423 | [0x8080-0x80ff]: slave data | |
| 424 | [0x8100-0x817f]: master data | |
| 404 | 425 | |
| 426 | Internal I/O Asynchronous SCI regs are then checked ... we can't emulate this at the current time, needs two MAME instances. | |
| 427 | ||
| 428 | m68k M communicates with z180 M thru shared ram, then the z180 M communicates with z180 S thru these ASCI regs ... finally, the z180 S | |
| 429 | communicates with m68k S with its own shared ram. In short: | |
| 430 | ||
| 431 | m68k M -> z180 M <-> z180 S <- m68k S | |
| 432 | */ | |
| 433 | ||
| 434 | static ADDRESS_MAP_START( cadash_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 435 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 436 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&cadash_shared_ram) | |
| 437 | ADDRESS_MAP_END | |
| 438 | ||
| 439 | static ADDRESS_MAP_START( cadash_sub_io, ADDRESS_SPACE_IO, 8 ) | |
| 440 | AM_RANGE(0x00, 0x3f) AM_RAM // z180 internal I/O regs | |
| 441 | ADDRESS_MAP_END | |
| 442 | ||
| 405 | 443 | /*********************************************************** |
| 406 | 444 | INPUT PORTS, DIPs |
| 407 | 445 | ***********************************************************/ |
| r7500 | r7501 | |
| 966 | 1004 | MDRV_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 967 | 1005 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map) |
| 968 | 1006 | |
| 1007 | MDRV_CPU_ADD("subcpu", Z180, 4000000) /* 4 MHz ??? */ | |
| 1008 | MDRV_CPU_PROGRAM_MAP(cadash_sub_map) | |
| 1009 | MDRV_CPU_IO_MAP(cadash_sub_io) | |
| 1010 | ||
| 969 | 1011 | MDRV_MACHINE_START(asuka) |
| 970 | 1012 | MDRV_MACHINE_RESET(asuka) |
| 971 | 1013 | |
| r7500 | r7501 | |
| 1340 | 1382 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1341 | 1383 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1342 | 1384 | |
| 1343 | ROM_REGION( 0x08000, " | |
| 1385 | ROM_REGION( 0x08000, " | |
| 1344 | 1386 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1345 | 1387 | |
| 1346 | 1388 | ROM_REGION( 0x0800, "plds", 0 ) |
| r7500 | r7501 | |
| 1367 | 1409 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1368 | 1410 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1369 | 1411 | |
| 1370 | ROM_REGION( 0x08000, " | |
| 1412 | ROM_REGION( 0x08000, " | |
| 1371 | 1413 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1372 | 1414 | ROM_END |
| 1373 | 1415 | |
| r7500 | r7501 | |
| 1390 | 1432 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1391 | 1433 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1392 | 1434 | |
| 1393 | ROM_REGION( 0x08000, " | |
| 1435 | ROM_REGION( 0x08000, " | |
| 1394 | 1436 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1395 | 1437 | ROM_END |
| 1396 | 1438 | |
| r7500 | r7501 | |
| 1411 | 1453 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1412 | 1454 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1413 | 1455 | |
| 1414 | ROM_REGION( 0x08000, " | |
| 1456 | ROM_REGION( 0x08000, " | |
| 1415 | 1457 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1416 | 1458 | ROM_END |
| 1417 | 1459 | |
| r7500 | r7501 | |
| 1432 | 1474 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1433 | 1475 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1434 | 1476 | |
| 1435 | ROM_REGION( 0x08000, " | |
| 1477 | ROM_REGION( 0x08000, " | |
| 1436 | 1478 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1437 | 1479 | ROM_END |
| 1438 | 1480 | |
| r7500 | r7501 | |
| 1453 | 1495 | ROM_LOAD( "c21-08.38", 0x00000, 0x04000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) |
| 1454 | 1496 | ROM_CONTINUE( 0x10000, 0x0c000 ) /* banked stuff */ |
| 1455 | 1497 | |
| 1456 | ROM_REGION( 0x08000, " | |
| 1498 | ROM_REGION( 0x08000, " | |
| 1457 | 1499 | ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) |
| 1458 | 1500 | ROM_END |
| 1459 | 1501 |
| r7500 | r7501 | |
|---|---|---|
| 333 | 333 | { "z8", _8bit, 0, CPU_DISASSEMBLE_NAME(z8) }, |
| 334 | 334 | }; |
| 335 | 335 | |
| 336 | void *malloc_file_line(size_t size, const char *file, int line) | |
| 337 | { | |
| 338 | void *result = malloc(size); | |
| 339 | return result; | |
| 340 | } | |
| 336 | 341 | |
| 342 | ||
| 343 | void free_file_line(void *memory, const char *file, int line) | |
| 344 | { | |
| 345 | free(memory); | |
| 346 | } | |
| 347 | ||
| 348 | ||
| 337 | 349 | void osd_break_into_debugger(const char *text) |
| 338 | 350 | { |
| 339 | 351 | /* we don't have a complete debugger to break in */ |
| r7500 | r7501 | |
|---|---|---|
| 10 | 10 | #ifndef __SDLSTRCONV__ |
| 11 | 11 | #define __SDLSTRCONV__ |
| 12 | 12 | |
| 13 | #include "osdco | |
| 13 | #include "osdcomm.h" | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 |
| r7500 | r7501 | |
|---|---|---|
| 24 | 24 | #include <unistd.h> |
| 25 | 25 | |
| 26 | 26 | // MAME headers |
| 27 | #include "osdcomm.h" | |
| 27 | 28 | #include "osdcore.h" |
| 28 | 29 | |
| 29 | 30 | #include "sdlsync.h" |
| r7500 | r7501 | |
|---|---|---|
| 95 | 95 | static void check_osd_inputs(running_machine *machine); |
| 96 | 96 | |
| 97 | 97 | static void extract_video_config(running_machine *machine); |
| 98 | static void extract_window_config(running_machine *machine, int index, sdl_window_config *conf); | |
| 98 | 99 | static void load_effect_overlay(running_machine *machine, const char *filename); |
| 99 | 100 | static float get_aspect(const char *name, int report_error); |
| 100 | 101 | static void get_resolution(const char *name, sdl_window_config *config, int report_error); |
| r7500 | r7501 | |
| 129 | 130 | // create the windows |
| 130 | 131 | for (index = 0; index < video_config.numscreens; index++) |
| 131 | 132 | { |
| 132 | video_config.window[index].totalColors = tc; | |
| 133 | if (sdlwindow_video_window_create(machine, index, pick_monitor(index), &video_config.window[index])) | |
| 133 | sdl_window_config conf; | |
| 134 | memset(&conf, 0, sizeof(conf)); | |
| 135 | extract_window_config(machine, index, &conf); | |
| 136 | conf.totalColors = tc; | |
| 137 | if (sdlwindow_video_window_create(machine, index, pick_monitor(index), &conf)) | |
| 134 | 138 | goto error; |
| 135 | 139 | } |
| 136 | 140 | |
| r7500 | r7501 | |
| 610 | 614 | sdlwindow_toggle_draw(machine, window); |
| 611 | 615 | } |
| 612 | 616 | |
| 617 | //============================================================ | |
| 618 | // extract_window_config | |
| 619 | //============================================================ | |
| 613 | 620 | |
| 621 | static void extract_window_config(running_machine *machine, int index, sdl_window_config *conf) | |
| 622 | { | |
| 623 | char buf[10]; | |
| 624 | ||
| 625 | sprintf(buf,SDLOPTION_RESOLUTION("%d"), index); | |
| 626 | // per-window options: extract the data | |
| 627 | get_resolution(buf, conf, TRUE); | |
| 628 | } | |
| 629 | ||
| 614 | 630 | //============================================================ |
| 615 | 631 | // extract_video_config |
| 616 | 632 | //============================================================ |
| r7500 | r7501 | |
| 638 | 654 | if (stemp != NULL && strcmp(stemp, "none") != 0) |
| 639 | 655 | load_effect_overlay(machine, stemp); |
| 640 | 656 | |
| 641 | // per-window options: extract the data | |
| 642 | get_resolution(SDLOPTION_RESOLUTION("0"), &video_config.window[0], TRUE); | |
| 643 | get_resolution(SDLOPTION_RESOLUTION("1"), &video_config.window[1], TRUE); | |
| 644 | get_resolution(SDLOPTION_RESOLUTION("2"), &video_config.window[2], TRUE); | |
| 645 | get_resolution(SDLOPTION_RESOLUTION("3"), &video_config.window[3], TRUE); | |
| 646 | ||
| 647 | 657 | // default to working video please |
| 648 | 658 | video_config.novideo = 0; |
| 649 | 659 |
| r7500 | r7501 | |
|---|---|---|
| 102 | 102 | int centerh; |
| 103 | 103 | int centerv; |
| 104 | 104 | |
| 105 | ||
| 106 | // per-window configuration | |
| 107 | sdl_window_config window[MAX_VIDEO_WINDOWS]; // configuration data per-window | |
| 108 | ||
| 109 | 105 | // hardware options |
| 110 | 106 | int mode; // output mode |
| 111 | 107 | int waitvsync; // spin until vsync |
| r7500 | r7501 | |
|---|---|---|
| 21 | 21 | #include <os2.h> |
| 22 | 22 | |
| 23 | 23 | // MAME headers |
| 24 | #include "osdepend.h" | |
| 25 | 24 | #include "osdcore.h" |
| 26 | 25 | |
| 27 | 26 | //============================================================ |
| r7500 | r7501 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | #else /* SDLMAME_WIN32 */ |
| 130 | 130 | |
| 131 | #include "emu.h" | |
| 131 | #include "emucore.h" | |
| 132 | 132 | |
| 133 | 133 | //============================================================ |
| 134 | 134 | // Stub for win32 |
| r7500 | r7501 | |
|---|---|---|
| 22 | 22 | #include "ui.h" |
| 23 | 23 | #include "uiinput.h" |
| 24 | 24 | #include "emuopts.h" |
| 25 | #include "osdepend.h" | |
| 26 | 25 | |
| 27 | 26 | |
| 28 | 27 | // MAMEOS headers |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #endif |
| 46 | 46 | |
| 47 | 47 | /* convert arguments to UTF-8 */ |
| 48 | utf8_argv = (char **) | |
| 48 | utf8_argv = (char **) | |
| 49 | 49 | if (utf8_argv == NULL) |
| 50 | 50 | return 999; |
| 51 | 51 | for (i = 0; i < argc; i++) |
| r7500 | r7501 | |
| 61 | 61 | /* free arguments */ |
| 62 | 62 | for (i = 0; i < argc; i++) |
| 63 | 63 | free(utf8_argv[i]); |
| 64 | | |
| 64 | | |
| 65 | 65 | |
| 66 | 66 | #ifdef MALLOC_DEBUG |
| 67 | 67 | { |
| r7500 | r7501 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | #include <SDL/SDL.h> |
| 3 | 3 | |
| 4 | #include "osdcomm.h" | |
| 5 | #include "osdcore.h" | |
| 6 | #include "osdepend.h" | |
| 7 | ||
| 8 | 4 | #include "osd_opengl.h" |
| 9 | 5 | |
| 10 | 6 | #include "gl_shader_mgr.h" |
| 11 | 7 | #include "gl_shader_tool.h" |
| 12 | 8 | |
| 13 | // OSD headers | |
| 14 | ||
| 15 | 9 | #define GLSL_VERTEX_SHADER_INT_NUMBER 1 // general |
| 16 | 10 | #define GLSL_VERTEX_SHADER_MAX_NUMBER 2 // general + custom |
| 17 | 11 | #define GLSL_VERTEX_SHADER_CUSTOM 1 // custom idx |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #include <mmsystem.h> |
| 46 | 46 | |
| 47 | 47 | // MAME headers |
| 48 | #include "osde | |
| 48 | #include "osdcore | |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 |
| r7500 | r7501 | |
|---|---|---|
| 771 | 771 | input_seq_set_2(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_LALT, KEYCODE_ENTER); |
| 772 | 772 | break; |
| 773 | 773 | |
| 774 | #ifdef MESS | |
| 774 | 775 | case IPT_UI_THROTTLE: |
| 775 | 776 | input_seq_set_0(&typedesc->seq[SEQ_TYPE_STANDARD]); |
| 776 | 777 | break; |
| 778 | #endif | |
| 777 | 779 | } |
| 778 | 780 | } |
| 779 | 781 |
| r7500 | r7501 | |
|---|---|---|
| 45 | 45 | #include <tchar.h> |
| 46 | 46 | |
| 47 | 47 | // MAME headers |
| 48 | #include " | |
| 48 | #include "osdcore.h" | |
| 49 | 49 | |
| 50 | 50 | // MAMEOS headers |
| 51 | 51 | #include "winutf8.h" |
| r7500 | r7501 | |
|---|---|---|
| 914 | 914 | { |
| 915 | 915 | /* if we have a number prefix, assume it is a number */ |
| 916 | 916 | bufindex = 0; |
| 917 | if (buffer[0] == '$') { numbase = 16; bufindex++; must_be_number = 1; } | |
| 918 | else if (buffer[0] == '0' && buffer[1] == 'x') { numbase = 16; bufindex += 2; must_be_number = 1; } | |
| 917 | if (buffer[0] == '0' && buffer[1] == 'x') { numbase = 16; bufindex += 2; must_be_number = 1; } | |
| 919 | 918 | else if (buffer[0] == '#') { numbase = 10; bufindex++; must_be_number = 1; } |
| 920 | 919 | |
| 921 | 920 | /* if we're not forced to be a number, check for a symbol match first */ |
| r7500 | r7501 | |
| 939 | 938 | /* see if we parse as a number */ |
| 940 | 939 | if (token->type == TOK_INVALID) |
| 941 | 940 | { |
| 941 | if (buffer[0] == '$') { numbase = 16; bufindex++; must_be_number = 1; } | |
| 942 | 942 | value = 0; |
| 943 | 943 | while (buffer[bufindex] != 0) |
| 944 | 944 | { |
| r7500 | r7501 | |
|---|---|---|
| 138 | 138 | if(h8->ccr & UIFLAG) h8->h8uiflag = 1; |
| 139 | 139 | if(h8->ccr & IFLAG) h8->h8iflag = 1; |
| 140 | 140 | |
| 141 | h8_check_irqs(h8); | |
| 141 | if (!h8->incheckirqs) h8_check_irqs(h8); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static INT16 h8_getreg16(h83xx_state *h8, UINT8 reg) |
| r7500 | r7501 | |
| 256 | 256 | h8->h8err = 0; |
| 257 | 257 | h8->pc = h8_mem_read32(h8, 0) & 0xffffff; |
| 258 | 258 | |
| 259 | h8->incheckirqs = 0; | |
| 260 | ||
| 259 | 261 | // disable timers |
| 260 | 262 | h8->h8TSTR = 0; |
| 261 | 263 | |
| r7500 | r7501 | |
| 323 | 325 | static void h8_check_irqs(h83xx_state *h8) |
| 324 | 326 | { |
| 325 | 327 | int lv = -1; |
| 328 | ||
| 329 | h8->incheckirqs = 1; | |
| 330 | ||
| 326 | 331 | if (h8->h8iflag == 0) |
| 327 | 332 | { |
| 328 | 333 | lv = 0; |
| r7500 | r7501 | |
| 377 | 382 | if (source != 0xff) |
| 378 | 383 | h8_GenException(h8, source); |
| 379 | 384 | } |
| 385 | ||
| 386 | h8->incheckirqs = 0; | |
| 380 | 387 | } |
| 381 | 388 | |
| 382 | 389 | #define H8_ADDR_MASK 0xffffff |
| r7500 | r7501 | |
|---|---|---|
| 23 | 23 | UINT8 ccr; |
| 24 | 24 | UINT8 h8nflag, h8vflag, h8cflag, h8zflag, h8iflag, h8hflag; |
| 25 | 25 | UINT8 h8uflag, h8uiflag; |
| 26 | UINT8 incheckirqs; | |
| 26 | 27 | |
| 27 | 28 | cpu_irq_callback irq_cb; |
| 28 | 29 | running_device *device; |
| r7500 | r7501 | |
|---|---|---|
| 154 | 154 | if(h8->ccr & UIFLAG) h8->h8uiflag = 1; |
| 155 | 155 | if(h8->ccr & IFLAG) h8->h8iflag = 1; |
| 156 | 156 | |
| 157 | h8_check_irqs(h8); | |
| 157 | if (!h8->incheckirqs) h8_check_irqs(h8); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static INT16 h8_getreg16(h83xx_state *h8, UINT8 reg) |
| r7500 | r7501 | |
| 268 | 268 | h8->h8err = 0; |
| 269 | 269 | h8->pc = h8_mem_read16(h8, 0); |
| 270 | 270 | |
| 271 | h8->incheckirqs = 0; | |
| 272 | ||
| 271 | 273 | // disable timers |
| 272 | 274 | h8->h8TSTR = 0; |
| 273 | 275 | h8->FRC = 0; |
| r7500 | r7501 | |
| 341 | 343 | { |
| 342 | 344 | int lv = 0; |
| 343 | 345 | |
| 346 | h8->incheckirqs = 1; | |
| 347 | ||
| 344 | 348 | if (h8->h8iflag != 0) |
| 345 | 349 | { |
| 346 | 350 | lv = 2; |
| r7500 | r7501 | |
| 386 | 390 | h8_GenException(h8, source); |
| 387 | 391 | } |
| 388 | 392 | } |
| 393 | ||
| 394 | h8->incheckirqs = 0; | |
| 389 | 395 | } |
| 390 | 396 | |
| 391 | 397 | #define H8_ADDR_MASK 0xffff |
| r7500 | r7501 | |
|---|---|---|
| 2053 | 2053 | bitnr = (ext16>>4)&7; |
| 2054 | 2054 | if(ext16&0x80) |
| 2055 | 2055 | { |
| 2056 | // bist | |
| 2057 | h8->h8err = 1; | |
| 2056 | h8_bist8(h8, bitnr, udata8); H8_IFETCH_TIMING(2); H8_BYTE_TIMING(2, address24); | |
| 2058 | 2057 | } |
| 2059 | 2058 | else |
| 2060 | 2059 | { |
| r7500 | r7501 | |
| 2065 | 2064 | bitnr = (ext16>>4)&7; |
| 2066 | 2065 | if(ext16&0x80) |
| 2067 | 2066 | { |
| 2068 | // bild | |
| 2069 | h8->h8err = 1; | |
| 2067 | h8_bild8(h8, bitnr, udata8); H8_IFETCH_TIMING(2); H8_BYTE_TIMING(2, address24); | |
| 2070 | 2068 | } |
| 2071 | 2069 | else |
| 2072 | 2070 | { |
| r7500 | r7501 | |
|---|---|---|
| 1553 | 1553 | if (inst->flags == 0 && (UINT32)param->value == 0) |
| 1554 | 1554 | /* skip */; |
| 1555 | 1555 | else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff) |
| 1556 | emit_mov_r32_imm(dst, reg, | |
| 1556 | emit_mov_r32_imm(dst, reg, ~0); // mov reg,-1 | |
| 1557 | 1557 | else |
| 1558 | 1558 | emit_or_r32_imm(dst, reg, param->value); // or reg,param |
| 1559 | 1559 | } |
| r7500 | r7501 | |
| 1576 | 1576 | if (inst->flags == 0 && (UINT32)param->value == 0) |
| 1577 | 1577 | /* skip */; |
| 1578 | 1578 | else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff) |
| 1579 | emit_mov_m32_imm(dst, MEMPARAMS, | |
| 1579 | emit_mov_m32_imm(dst, MEMPARAMS, ~0); // mov [dest],-1 | |
| 1580 | 1580 | else |
| 1581 | 1581 | emit_or_m32_imm(dst, MEMPARAMS, param->value); // or [dest],param |
| 1582 | 1582 | } |
| r7500 | r7501 | |
| 2501 | 2501 | if (inst->flags == 0 && (UINT32)param->value == 0) |
| 2502 | 2502 | /* skip */; |
| 2503 | 2503 | else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff) |
| 2504 | emit_mov_r32_imm(dst, reglo, | |
| 2504 | emit_mov_r32_imm(dst, reglo, ~0); // mov reglo,-1 | |
| 2505 | 2505 | else |
| 2506 | 2506 | emit_or_r32_imm(dst, reglo, param->value); // or reglo,param |
| 2507 | 2507 | if (saveflags) emit_pushf(dst); // pushf |
| 2508 | 2508 | if (inst->flags == 0 && (UINT32)(param->value >> 32) == 0) |
| 2509 | 2509 | /* skip */; |
| 2510 | 2510 | else if (inst->flags == 0 && (UINT32)(param->value >> 32) == 0xffffffff) |
| 2511 | emit_mov_r32_imm(dst, reghi, | |
| 2511 | emit_mov_r32_imm(dst, reghi, ~0); // mov reghi,-1 | |
| 2512 | 2512 | else |
| 2513 | 2513 | emit_or_r32_imm(dst, reghi, param->value >> 32); // or reghi,param >> 32 |
| 2514 | 2514 | } |
| r7500 | r7501 | |
| 2536 | 2536 | if (inst->flags == 0 && (UINT32)param->value == 0) |
| 2537 | 2537 | /* skip */; |
| 2538 | 2538 | else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff) |
| 2539 | emit_mov_m32_imm(dst, MEMPARAMS, | |
| 2539 | emit_mov_m32_imm(dst, MEMPARAMS, ~0); // mov [dest],-1 | |
| 2540 | 2540 | else |
| 2541 | 2541 | emit_or_m32_imm(dst, MEMPARAMS, param->value); // or [dest],param |
| 2542 | 2542 | if (saveflags) emit_pushf(dst); // pushf |
| 2543 | 2543 | if (inst->flags == 0 && (UINT32)(param->value >> 32) == 0) |
| 2544 | 2544 | /* skip */; |
| 2545 | 2545 | else if (inst->flags == 0 && (UINT32)(param->value >> 32) == 0xffffffff) |
| 2546 | emit_mov_m32_imm(dst, MEMPARAMS + 4, | |
| 2546 | emit_mov_m32_imm(dst, MEMPARAMS + 4, ~0); // mov [dest+4],-1 | |
| 2547 | 2547 | else |
| 2548 | 2548 | emit_or_m32_imm(dst, MEMPARAMS + 4, param->value >> 32); // or [dest+4],param >> 32 |
| 2549 | 2549 | } |
| r7500 | r7501 | |
|---|---|---|
| 897 | 897 | TOKEN_UINT32_PACK1(ADDRMAP_TOKEN_BASEPTR, 8), \ |
| 898 | 898 | TOKEN_PTR(memptr, _base), |
| 899 | 899 | |
| 900 | #define myoffsetof(_struct, _member) ((FPTR)&((_struct *)0x1000)->_member - 0x1000) | |
| 900 | 901 | #define AM_BASE_MEMBER(_struct, _member) \ |
| 901 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_MEMBER, 8, offsetof(_struct, _member), 24), | |
| 902 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_MEMBER, 8, myoffsetof(_struct, _member), 24), | |
| 902 | 903 | |
| 903 | 904 | #define AM_BASE_GENERIC(_member) \ |
| 904 | 905 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_GENERIC, 8, offsetof(generic_pointers, _member), 24), |
| r7500 | r7501 | |
| 908 | 909 | TOKEN_PTR(sizeptr, _size), |
| 909 | 910 | |
| 910 | 911 | #define AM_SIZE_MEMBER(_struct, _member) \ |
| 911 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_SIZE_MEMBER, 8, offsetof(_struct, _member), 24), | |
| 912 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_SIZE_MEMBER, 8, myoffsetof(_struct, _member), 24), | |
| 912 | 913 | |
| 913 | 914 | #define AM_SIZE_GENERIC(_member) \ |
| 914 | 915 | TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_SIZE_GENERIC, 8, offsetof(generic_pointers, _member##_size), 24), |
| r7500 | r7501 | |
|---|---|---|
| 1303 | 1303 | basename = mame_strdup(driver->name); |
| 1304 | 1304 | config = machine_config_alloc(driver->machine_config); |
| 1305 | 1305 | |
| 1306 | /* allocate the driver data */ | |
| 1307 | if (config->driver_data_size != 0) | |
| 1308 | driver_data = auto_alloc_array_clear(this, UINT8, config->driver_data_size); | |
| 1309 | ||
| 1310 | 1306 | /* attach this machine to all the devices in the configuration */ |
| 1311 | 1307 | devicelist.import_config_list(config->devicelist, *this); |
| 1312 | 1308 | |
| 1309 | /* allocate the driver data (after devices) */ | |
| 1310 | if (config->driver_data_alloc != NULL) | |
| 1311 | driver_data = (*config->driver_data_alloc)(*this); | |
| 1312 | ||
| 1313 | 1313 | /* find devices */ |
| 1314 | 1314 | firstcpu = cpu_first(this); |
| 1315 | 1315 | primary_screen = video_screen_first(this); |
| r7500 | r7501 | |
|---|---|---|
| 149 | 149 | UINT8 read_regs_follow[7]; |
| 150 | 150 | UINT8 status; |
| 151 | 151 | UINT8 dma_enabled; |
| 152 | ||
| 152 | ||
| 153 | 153 | UINT16 addressA; |
| 154 | 154 | UINT16 addressB; |
| 155 | 155 | UINT16 count; |
| r7500 | r7501 | |
| 378 | 378 | { |
| 379 | 379 | z80dma->dma_enabled = 0; //FIXME: Correct? |
| 380 | 380 | z80dma->status = 0x19; |
| 381 | ||
| 381 | ||
| 382 | 382 | if(!(z80dma->rdy ^ READY_ACTIVE_HIGH(z80dma))) z80dma->status |= 0x02; // ready line status |
| 383 | ||
| 383 | ||
| 384 | 384 | if(TRANSFER_MODE(z80dma) == TM_TRANSFER) z80dma->status |= 0x10; // no match found |
| 385 | ||
| 385 | ||
| 386 | 386 | z80dma_update_status(device); |
| 387 | 387 | if (LOG) logerror("Z80DMA '%s' End of Block\n", device->tag.cstr()); |
| 388 | ||
| 388 | ||
| 389 | 389 | if (INT_ON_END_OF_BLOCK(z80dma)) |
| 390 | 390 | { |
| 391 | 391 | trigger_interrupt(device, INT_END_OF_BLOCK); |
| r7500 | r7501 | |
| 721 | 721 | if (z80dma->ip) |
| 722 | 722 | { |
| 723 | 723 | if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", device->tag.cstr()); |
| 724 | ||
| 724 | ||
| 725 | 725 | /* clear interrupt pending flag */ |
| 726 | 726 | z80dma->ip = 0; |
| 727 | 727 | interrupt_check(z80dma); |
| 728 | 728 | |
| 729 | 729 | /* set interrupt under service flag */ |
| 730 | 730 | z80dma->ius = 1; |
| 731 | ||
| 731 | ||
| 732 | 732 | /* disable DMA */ |
| 733 | 733 | z80dma->dma_enabled = 0; |
| 734 | 734 |
| r7500 | r7501 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Copyright Nicola Salmoria and the MAME Team. |
| 6 | 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | ||
| 7 | ||
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| r7500 | r7501 | |
| 106 | 106 | z80pio_t *z80pio = get_safe_token(device); |
| 107 | 107 | |
| 108 | 108 | int state = CLEAR_LINE; |
| 109 | ||
| 109 | ||
| 110 | 110 | for (int index = PORT_A; index < PORT_COUNT; index++) |
| 111 | 111 | { |
| 112 | 112 | pio_port *port = &z80pio->port[index]; |
| r7500 | r7501 | |
| 333 | 333 | case MASK: /* interrupt mask */ |
| 334 | 334 | port->mask = data; |
| 335 | 335 | if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", device->tag.cstr(), 'A' + index, data); |
| 336 | ||
| 336 | ||
| 337 | 337 | /* set interrupt enable */ |
| 338 | 338 | port->ie = BIT(port->icw, 7); |
| 339 | 339 | check_interrupts(device); |
| r7500 | r7501 | |
| 509 | 509 | { |
| 510 | 510 | z80pio_t *z80pio = get_safe_token(device); |
| 511 | 511 | pio_port *port = &z80pio->port[PORT_A]; |
| 512 | ||
| 512 | ||
| 513 | 513 | UINT8 data = 0xff; |
| 514 | 514 | |
| 515 | 515 | switch (port->mode) |
| r7500 | r7501 | |
| 538 | 538 | { |
| 539 | 539 | z80pio_t *z80pio = get_safe_token(device); |
| 540 | 540 | pio_port *port = &z80pio->port[PORT_A]; |
| 541 | ||
| 541 | ||
| 542 | 542 | if (port->mode == MODE_BIT_CONTROL) |
| 543 | 543 | { |
| 544 | 544 | /* latch data */ |
| r7500 | r7501 | |
| 555 | 555 | { |
| 556 | 556 | z80pio_t *z80pio = get_safe_token(device); |
| 557 | 557 | pio_port *port = &z80pio->port[PORT_B]; |
| 558 | ||
| 558 | ||
| 559 | 559 | UINT8 data = 0xff; |
| 560 | 560 | |
| 561 | 561 | switch (port->mode) |
| r7500 | r7501 | |
| 580 | 580 | { |
| 581 | 581 | z80pio_t *z80pio = get_safe_token(device); |
| 582 | 582 | pio_port *port = &z80pio->port[PORT_B]; |
| 583 | ||
| 583 | ||
| 584 | 584 | if (port->mode == MODE_BIT_CONTROL) |
| 585 | 585 | { |
| 586 | 586 | /* latch data */ |
| r7500 | r7501 | |
| 616 | 616 | else if (!port->stb && state) /* rising edge */ |
| 617 | 617 | { |
| 618 | 618 | trigger_interrupt(device, index); |
| 619 | ||
| 619 | ||
| 620 | 620 | /* clear ready line */ |
| 621 | 621 | set_rdy(device, index, 0); |
| 622 | 622 | } |
| r7500 | r7501 | |
| 705 | 705 | z80pio_t *z80pio = get_safe_token(device); |
| 706 | 706 | |
| 707 | 707 | int state = 0; |
| 708 | ||
| 708 | ||
| 709 | 709 | for (int index = PORT_A; index < PORT_COUNT; index++) |
| 710 | 710 | { |
| 711 | 711 | pio_port *port = &z80pio->port[index]; |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | PA6 8 | | 33 PB6 |
| 18 | 18 | PA5 9 | | 32 PB5 |
| 19 | 19 | PA4 10 | Z8420 | 31 PB4 |
| 20 | GND 11 | | |
| 20 | GND 11 | | 30 PB3 | |
| 21 | 21 | PA3 12 | | 29 PB2 |
| 22 | 22 | PA2 13 | | 28 PB1 |
| 23 | 23 | PA1 14 | | 27 PB0 |
| r7500 | r7501 | |
|---|---|---|
| 25 | 25 | #ifndef __PIC8259_H__ |
| 26 | 26 | #define __PIC8259_H__ |
| 27 | 27 | |
| 28 | #include "devcb.h" | |
| 29 | ||
| 28 | 30 | #define PIC8259 DEVICE_GET_INFO_NAME(pic8259) |
| 29 | 31 | |
| 30 | 32 | /*************************************************************************** |
| r7500 | r7501 | |
|---|---|---|
| 41 | 41 | #include "coreutil.h" |
| 42 | 42 | |
| 43 | 43 | |
| 44 | /*************************************************************************** | |
| 45 | CONSTANTS | |
| 46 | ***************************************************************************/ | |
| 44 | //************************************************************************** | |
| 45 | // CONSTANTS | |
| 46 | //************************************************************************** | |
| 47 | 47 | |
| 48 | 48 | // align all allocated memory to this size |
| 49 | 49 | const int memory_align = 16; |
| r7500 | r7501 | |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | /*************************************************************************** | |
| 57 | MACROS | |
| 58 | ***************************************************************************/ | |
| 56 | //************************************************************************** | |
| 57 | // MACROS | |
| 58 | //************************************************************************** | |
| 59 | 59 | |
| 60 | 60 | // enable deletion |
| 61 | 61 | #undef delete |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | /*************************************************************************** | |
| 66 | TYPE DEFINITIONS | |
| 67 | ***************************************************************************/ | |
| 65 | //************************************************************************** | |
| 66 | // TYPE DEFINITIONS | |
| 67 | //************************************************************************** | |
| 68 | 68 | |
| 69 | 69 | // this struct is allocated in pools to track memory allocations |
| 70 | 70 | // it must be a POD type!! |
| 71 | 71 | class memory_entry |
| 72 | 72 | { |
| 73 | 73 | public: |
| 74 | memory_entry * next; // link to the next entry | |
| 75 | memory_entry * prev; // link to the previous entry | |
| 76 | size_t size; // size of the allocation (not including this header) | |
| 77 | void * base; // base of the allocation | |
| 78 | const char * file; // file the allocation was made from | |
| 79 | int line; // line number within that file | |
| 80 | int id; // unique id | |
| 74 | memory_entry * m_next; // link to the next entry | |
| 75 | memory_entry * m_prev; // link to the previous entry | |
| 76 | size_t m_size; // size of the allocation (not including this header) | |
| 77 | void * m_base; // base of the allocation | |
| 78 | const char * m_file; // file the allocation was made from | |
| 79 | int m_line; // line number within that file | |
| 80 | int m_id; // unique id | |
| 81 | 81 | |
| 82 | static const int hash_prime = 193; | |
| 82 | static const int k_hash_prime = 193; | |
| 83 | 83 | |
| 84 | static int curid; // current ID | |
| 85 | static osd_lock * lock; // lock for managing the list | |
| 86 | static bool lock_alloc; // set to true temporarily during lock allocation | |
| 87 | static memory_entry *hash[hash_prime];// hash table based on pointer | |
| 88 | static memory_entry *freehead; // pointer to the head of the free list | |
| 84 | static int s_curid; // current ID | |
| 85 | static osd_lock * s_lock; // lock for managing the list | |
| 86 | static bool s_lock_alloc; // set to true temporarily during lock allocation | |
| 87 | static memory_entry *s_hash[k_hash_prime];// hash table based on pointer | |
| 88 | static memory_entry *s_freehead; // pointer to the head of the free list | |
| 89 | 89 | |
| 90 | 90 | static memory_entry *allocate(size_t size, void *base, const char *file, int line); |
| 91 | 91 | static memory_entry *find(void *ptr); |
| r7500 | r7501 | |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | |
| 102 | /*************************************************************************** | |
| 103 | GLOBALS | |
| 104 | ***************************************************************************/ | |
| 102 | //************************************************************************** | |
| 103 | // GLOBALS | |
| 104 | //************************************************************************** | |
| 105 | 105 | |
| 106 | 106 | // global resource pool to handle allocations outside of the emulator context |
| 107 | 107 | resource_pool global_resource_pool; |
| r7500 | r7501 | |
| 110 | 110 | const zeromem_t zeromem = { }; |
| 111 | 111 | |
| 112 | 112 | // globals for memory_entry |
| 113 | int memory_entry::curid = 0; | |
| 114 | osd_lock *memory_entry::lock = NULL; | |
| 115 | bool memory_entry::lock_alloc = false; | |
| 116 | memory_entry *memory_entry::hash[memory_entry::hash_prime] = { NULL }; | |
| 117 | memory_entry *memory_entry::freehead = NULL; | |
| 113 | int memory_entry::s_curid = 0; | |
| 114 | osd_lock *memory_entry::s_lock = NULL; | |
| 115 | bool memory_entry::s_lock_alloc = false; | |
| 116 | memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL }; | |
| 117 | memory_entry *memory_entry::s_freehead = NULL; | |
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | |
| 121 | /*************************************************************************** | |
| 122 | GLOBAL HELPERS | |
| 123 | ***************************************************************************/ | |
| 121 | //************************************************************************** | |
| 122 | // GLOBAL HELPERS | |
| 123 | //************************************************************************** | |
| 124 | 124 | |
| 125 | 125 | /*------------------------------------------------- |
| 126 | 126 | malloc_file_line - allocate memory with file |
| r7500 | r7501 | |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | |
| 192 | /*************************************************************************** | |
| 193 | RESOURCE POOL | |
| 194 | ***************************************************************************/ | |
| 192 | //************************************************************************** | |
| 193 | // RESOURCE POOL | |
| 194 | //************************************************************************** | |
| 195 | 195 | |
| 196 | 196 | /*------------------------------------------------- |
| 197 | 197 | resource_pool - constructor for a new resource |
| r7500 | r7501 | |
| 199 | 199 | -------------------------------------------------*/ |
| 200 | 200 | |
| 201 | 201 | resource_pool::resource_pool() |
| 202 | : listlock(osd_lock_alloc()), | |
| 203 | ordered_head(NULL) | |
| 202 | : m_listlock(osd_lock_alloc()), | |
| 203 | m_ordered_head(NULL) | |
| 204 | 204 | { |
| 205 | memset(hash, 0, sizeof(hash)); | |
| 205 | memset(m_hash, 0, sizeof(m_hash)); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| r7500 | r7501 | |
| 215 | 215 | resource_pool::~resource_pool() |
| 216 | 216 | { |
| 217 | 217 | clear(); |
| 218 | if (listlock != NULL) | |
| 219 | osd_lock_free(listlock); | |
| 218 | if (m_listlock != NULL) | |
| 219 | osd_lock_free(m_listlock); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
| r7500 | r7501 | |
| 226 | 226 | |
| 227 | 227 | void resource_pool::add(resource_pool_item &item) |
| 228 | 228 | { |
| 229 | osd_lock_acquire(listlock); | |
| 229 | osd_lock_acquire(m_listlock); | |
| 230 | 230 | |
| 231 | 231 | // insert into hash table |
| 232 | int hashval = reinterpret_cast<FPTR>(item.ptr) % hash_prime; | |
| 233 | item.next = hash[hashval]; | |
| 234 | hash[hashval] = &item; | |
| 232 | int hashval = reinterpret_cast<FPTR>(item.m_ptr) % k_hash_prime; | |
| 233 | item.m_next = m_hash[hashval]; | |
| 234 | m_hash[hashval] = &item; | |
| 235 | 235 | |
| 236 | 236 | // insert into ordered list |
| 237 | item.ordered_next = ordered_head; | |
| 238 | if (ordered_head != NULL) | |
| 239 | ordered_head->ordered_prev = &item; | |
| 240 | ordered_head = &item; | |
| 237 | item.m_ordered_next = m_ordered_head; | |
| 238 | if (m_ordered_head != NULL) | |
| 239 | m_ordered_head->m_ordered_prev = &item; | |
| 240 | m_ordered_head = &item; | |
| 241 | 241 | |
| 242 | osd_lock_release(listlock); | |
| 242 | osd_lock_release(m_listlock); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| r7500 | r7501 | |
| 255 | 255 | return; |
| 256 | 256 | |
| 257 | 257 | // search for the item |
| 258 | osd_lock_acquire(listlock); | |
| 258 | osd_lock_acquire(m_listlock); | |
| 259 | 259 | |
| 260 | int hashval = reinterpret_cast<FPTR>(ptr) % hash_prime; | |
| 261 | for (resource_pool_item **scanptr = &hash[hashval]; *scanptr != NULL; scanptr = &(*scanptr)->next) | |
| 260 | int hashval = reinterpret_cast<FPTR>(ptr) % k_hash_prime; | |
| 261 | for (resource_pool_item **scanptr = &m_hash[hashval]; *scanptr != NULL; scanptr = &(*scanptr)->m_next) | |
| 262 | 262 | |
| 263 | 263 | // must match the pointer |
| 264 | if ((*scanptr)->ptr == ptr) | |
| 264 | if ((*scanptr)->m_ptr == ptr) | |
| 265 | 265 | { |
| 266 | 266 | // remove from hash table |
| 267 | 267 | resource_pool_item *deleteme = *scanptr; |
| 268 | *scanptr = deleteme->next; | |
| 268 | *scanptr = deleteme->m_next; | |
| 269 | 269 | |
| 270 | 270 | // remove from ordered list |
| 271 | if (deleteme->ordered_prev != NULL) | |
| 272 | deleteme->ordered_prev->ordered_next = deleteme->ordered_next; | |
| 271 | if (deleteme->m_ordered_prev != NULL) | |
| 272 | deleteme->m_ordered_prev->m_ordered_next = deleteme->m_ordered_next; | |
| 273 | 273 | else |
| 274 | ordered_head = deleteme->ordered_next; | |
| 275 | if (deleteme->ordered_next != NULL) | |
| 276 | deleteme->ordered_next->ordered_prev = deleteme->ordered_prev; | |
| 274 | m_ordered_head = deleteme->m_ordered_next; | |
| 275 | if (deleteme->m_ordered_next != NULL) | |
| 276 | deleteme->m_ordered_next->m_ordered_prev = deleteme->m_ordered_prev; | |
| 277 | 277 | |
| 278 | 278 | // delete the object and break |
| 279 | 279 | delete deleteme; |
| 280 | 280 | break; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | osd_lock_release(listlock); | |
| 283 | osd_lock_release(m_listlock); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | |
| r7500 | r7501 | |
| 292 | 292 | resource_pool_item *resource_pool::find(void *ptr) |
| 293 | 293 | { |
| 294 | 294 | // search for the item |
| 295 | osd_lock_acquire(listlock); | |
| 295 | osd_lock_acquire(m_listlock); | |
| 296 | 296 | |
| 297 | int hashval = reinterpret_cast<FPTR>(ptr) % hash_prime; | |
| 297 | int hashval = reinterpret_cast<FPTR>(ptr) % k_hash_prime; | |
| 298 | 298 | resource_pool_item *item; |
| 299 | for (item = hash[hashval]; item != NULL; item = item->next) | |
| 300 | if (item->ptr == ptr) | |
| 299 | for (item = m_hash[hashval]; item != NULL; item = item->m_next) | |
| 300 | if (item->m_ptr == ptr) | |
| 301 | 301 | break; |
| 302 | 302 | |
| 303 | osd_lock_release(listlock); | |
| 303 | osd_lock_release(m_listlock); | |
| 304 | 304 | |
| 305 | 305 | return item; |
| 306 | 306 | } |
| r7500 | r7501 | |
| 317 | 317 | UINT8 *ptrend = reinterpret_cast<UINT8 *>(_ptrend); |
| 318 | 318 | |
| 319 | 319 | // search for the item |
| 320 | osd_lock_acquire(listlock); | |
| 320 | osd_lock_acquire(m_listlock); | |
| 321 | 321 | |
| 322 | 322 | resource_pool_item *item = NULL; |
| 323 | for (item = ordered_head; item != NULL; item = item->ordered_next) | |
| 323 | for (item = m_ordered_head; item != NULL; item = item->m_ordered_next) | |
| 324 | 324 | { |
| 325 | UINT8 *objstart = reinterpret_cast<UINT8 *>(item->ptr); | |
| 326 | UINT8 *objend = objstart + item->size; | |
| 325 | UINT8 *objstart = reinterpret_cast<UINT8 *>(item->m_ptr); | |
| 326 | UINT8 *objend = objstart + item->m_size; | |
| 327 | 327 | if (ptrstart >= objstart && ptrend <= objend) |
| 328 | 328 | goto found; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | found: |
| 332 | osd_lock_release(listlock); | |
| 332 | osd_lock_release(m_listlock); | |
| 333 | 333 | |
| 334 | 334 | return (item != NULL); |
| 335 | 335 | } |
| r7500 | r7501 | |
| 341 | 341 | |
| 342 | 342 | void resource_pool::clear() |
| 343 | 343 | { |
| 344 | osd_lock_acquire(listlock); | |
| 344 | osd_lock_acquire(m_listlock); | |
| 345 | 345 | |
| 346 | 346 | // important: delete in reverse order of adding |
| 347 | while (ordered_head != NULL) | |
| 348 | remove(ordered_head->ptr); | |
| 347 | while (m_ordered_head != NULL) | |
| 348 | remove(m_ordered_head->m_ptr); | |
| 349 | 349 | |
| 350 | osd_lock_release(listlock); | |
| 350 | osd_lock_release(m_listlock); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | |
| 354 | 354 | |
| 355 | /*************************************************************************** | |
| 356 | MEMORY ENTRY | |
| 357 | ***************************************************************************/ | |
| 355 | //************************************************************************** | |
| 356 | // MEMORY ENTRY | |
| 357 | //************************************************************************** | |
| 358 | 358 | |
| 359 | 359 | /*------------------------------------------------- |
| 360 | 360 | acquire_lock - acquire the memory entry lock, |
| r7500 | r7501 | |
| 365 | 365 | { |
| 366 | 366 | // allocate a lock on first usage |
| 367 | 367 | // note that osd_lock_alloc() may re-enter this path, so protect against recursion! |
| 368 | if (lock == NULL) | |
| 368 | if (s_lock == NULL) | |
| 369 | 369 | { |
| 370 | if (lock_alloc) | |
| 370 | if (s_lock_alloc) | |
| 371 | 371 | return; |
| 372 | lock_alloc = true; | |
| 373 | lock = osd_lock_alloc(); | |
| 374 | lock_alloc = false; | |
| 372 | s_lock_alloc = true; | |
| 373 | s_lock = osd_lock_alloc(); | |
| 374 | s_lock_alloc = false; | |
| 375 | 375 | } |
| 376 | osd_lock_acquire(lock); | |
| 376 | osd_lock_acquire(s_lock); | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | |
| r7500 | r7501 | |
| 383 | 383 | |
| 384 | 384 | void memory_entry::release_lock() |
| 385 | 385 | { |
| 386 | osd_lock_release(lock); | |
| 386 | osd_lock_release(s_lock); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | |
| r7500 | r7501 | |
| 396 | 396 | acquire_lock(); |
| 397 | 397 | |
| 398 | 398 | // if we're out of free entries, allocate a new chunk |
| 399 | if (freehead == NULL) | |
| 399 | if (s_freehead == NULL) | |
| 400 | 400 | { |
| 401 | 401 | // create a new chunk, and fail if we can't |
| 402 | 402 | memory_entry *entry = reinterpret_cast<memory_entry *>(osd_malloc(memory_block_alloc_chunk * sizeof(memory_entry))); |
| r7500 | r7501 | |
| 409 | 409 | // add all the entries to the list |
| 410 | 410 | for (int entrynum = 0; entrynum < memory_block_alloc_chunk; entrynum++) |
| 411 | 411 | { |
| 412 | entry->next = freehead; | |
| 413 | freehead = entry++; | |
| 412 | entry->m_next = s_freehead; | |
| 413 | s_freehead = entry++; | |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | // grab a free entry |
| 418 | memory_entry *entry = freehead; | |
| 419 | freehead = entry->next; | |
| 418 | memory_entry *entry = s_freehead; | |
| 419 | s_freehead = entry->m_next; | |
| 420 | 420 | |
| 421 | 421 | // populate it |
| 422 | entry->size = size; | |
| 423 | entry->base = base; | |
| 424 | entry->file = file; | |
| 425 | entry->line = line; | |
| 426 | entry->id = curid++; | |
| 422 | entry->m_size = size; | |
| 423 | entry->m_base = base; | |
| 424 | entry->m_file = file; | |
| 425 | entry->m_line = line; | |
| 426 | entry->m_id = s_curid++; | |
| 427 | 427 | |
| 428 | 428 | // add it to the alloc list |
| 429 | int hashval = reinterpret_cast<FPTR>(base) % hash_prime; | |
| 430 | entry->next = hash[hashval]; | |
| 431 | if (entry->next != NULL) | |
| 432 | entry->next->prev = entry; | |
| 433 | entry->prev = NULL; | |
| 434 | hash[hashval] = entry; | |
| 429 | int hashval = reinterpret_cast<FPTR>(base) % k_hash_prime; | |
| 430 | entry->m_next = s_hash[hashval]; | |
| 431 | if (entry->m_next != NULL) | |
| 432 | entry->m_next->m_prev = entry; | |
| 433 | entry->m_prev = NULL; | |
| 434 | s_hash[hashval] = entry; | |
| 435 | 435 | |
| 436 | 436 | release_lock(); |
| 437 | 437 | return entry; |
| r7500 | r7501 | |
| 451 | 451 | // scan the list under the lock |
| 452 | 452 | acquire_lock(); |
| 453 | 453 | |
| 454 | int hashval = reinterpret_cast<FPTR>(ptr) % hash_prime; | |
| 454 | int hashval = reinterpret_cast<FPTR>(ptr) % k_hash_prime; | |
| 455 | 455 | memory_entry *entry; |
| 456 | for (entry = hash[hashval]; entry != NULL; entry = entry->next) | |
| 457 | if (entry->base == ptr) | |
| 456 | for (entry = s_hash[hashval]; entry != NULL; entry = entry->m_next) | |
| 457 | if (entry->m_base == ptr) | |
| 458 | 458 | break; |
| 459 | 459 | |
| 460 | 460 | release_lock(); |
| r7500 | r7501 | |
| 471 | 471 | acquire_lock(); |
| 472 | 472 | |
| 473 | 473 | // remove ourselves from the alloc list |
| 474 | int hashval = reinterpret_cast<FPTR>(entry->base) % hash_prime; | |
| 475 | if (entry->prev != NULL) | |
| 476 | entry->prev->next = entry->next; | |
| 474 | int hashval = reinterpret_cast<FPTR>(entry->m_base) % k_hash_prime; | |
| 475 | if (entry->m_prev != NULL) | |
| 476 | entry->m_prev->m_next = entry->m_next; | |
| 477 | 477 | else |
| 478 | hash[hashval] = entry->next; | |
| 479 | if (entry->next != NULL) | |
| 480 | entry->next->prev = entry->prev; | |
| 478 | s_hash[hashval] = entry->m_next; | |
| 479 | if (entry->m_next != NULL) | |
| 480 | entry->m_next->m_prev = entry->m_prev; | |
| 481 | 481 | |
| 482 | 482 | // add ourself to the free list |
| 483 | entry->next = freehead; | |
| 484 | freehead = entry; | |
| 483 | entry->m_next = s_freehead; | |
| 484 | s_freehead = entry; | |
| 485 | 485 | |
| 486 | 486 | release_lock(); |
| 487 | 487 | } |
| r7500 | r7501 | |
| 499 | 499 | // check for leaked memory |
| 500 | 500 | UINT32 total = 0; |
| 501 | 501 | |
| 502 | for (int hashnum = 0; hashnum < hash_prime; hashnum++) | |
| 503 | for (memory_entry *entry = hash[hashnum]; entry != NULL; entry = entry->next) | |
| 504 | if (entry->file != NULL) | |
| 502 | for (int hashnum = 0; hashnum < k_hash_prime; hashnum++) | |
| 503 | for (memory_entry *entry = s_hash[hashnum]; entry != NULL; entry = entry->m_next) | |
| 504 | if (entry->m_file != NULL) | |
| 505 | 505 | { |
| 506 | 506 | if (total == 0) |
| 507 | 507 | fprintf(stderr, "--- memory leak warning ---\n"); |
| 508 | total += entry->size; | |
| 509 | fprintf(stderr, "allocation #%06d, %d bytes (%s:%d)\n", entry->id, static_cast<UINT32>(entry->size), entry->file, (int)entry->line); | |
| 508 | total += entry->m_size; | |
| 509 | fprintf(stderr, "allocation #%06d, %d bytes (%s:%d)\n", entry->m_id, static_cast<UINT32>(entry->m_size), entry->m_file, (int)entry->m_line); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | release_lock(); |
| r7500 | r7501 | |
| 514 | 514 | if (total > 0) |
| 515 | 515 | fprintf(stderr, "a total of %d bytes were not free()'d\n", total); |
| 516 | 516 | } |
| 517 | ||
| 518 | ||
| 519 | ||
| 520 | /*************************************************************************** | |
| 521 | STANDARD NEW/DELETE OPERATORS | |
| 522 | ***************************************************************************/ | |
| 523 | ||
| 524 | void *operator new(std::size_t size) throw (std::bad_alloc) | |
| 525 | { | |
| 526 | void *result = malloc_file_line(size, NULL, 0); | |
| 527 | if (result == NULL) | |
| 528 | throw std::bad_alloc(); | |
| 529 | return result; | |
| 530 | } | |
| 531 | ||
| 532 | ||
| 533 | void *operator new[](std::size_t size) throw (std::bad_alloc) | |
| 534 | { | |
| 535 | void *result = malloc_file_line(size, NULL, 0); | |
| 536 | if (result == NULL) | |
| 537 | throw std::bad_alloc(); | |
| 538 | return result; | |
| 539 | } | |
| 540 | ||
| 541 | ||
| 542 | void operator delete(void *ptr) | |
| 543 | { | |
| 544 | if (ptr != NULL) | |
| 545 | free_file_line(ptr, NULL, 0); | |
| 546 | } | |
| 547 | ||
| 548 | ||
| 549 | void operator delete[](void *ptr) | |
| 550 | { | |
| 551 | if (ptr != NULL) | |
| 552 | free_file_line(ptr, NULL, 0); | |
| 553 | } | |
| 554 | ||
| 555 | ||
| 556 | ||
| 557 | /*************************************************************************** | |
| 558 | POOL NEW/DELETE OPERATORS | |
| 559 | ***************************************************************************/ | |
| 560 | ||
| 561 | void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) | |
| 562 | { | |
| 563 | void *result = malloc_file_line(size, file, line); | |
| 564 | if (result == NULL) | |
| 565 | throw std::bad_alloc(); | |
| 566 | return result; | |
| 567 | } | |
| 568 | ||
| 569 | ||
| 570 | void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) | |
| 571 | { | |
| 572 | void *result = malloc_file_line(size, file, line); | |
| 573 | if (result == NULL) | |
| 574 | throw std::bad_alloc(); | |
| 575 | return result; | |
| 576 | } | |
| 577 | ||
| 578 | ||
| 579 | void operator delete(void *ptr, const char *file, int line) | |
| 580 | { | |
| 581 | if (ptr != NULL) | |
| 582 | free_file_line(ptr, file, line); | |
| 583 | } | |
| 584 | ||
| 585 | ||
| 586 | void operator delete[](void *ptr, const char *file, int line) | |
| 587 | { | |
| 588 | if (ptr != NULL) | |
| 589 | free_file_line(ptr, file, line); | |
| 590 | } | |
| 591 | ||
| 592 | ||
| 593 | ||
| 594 | /*************************************************************************** | |
| 595 | POOL NEW/DELETE OPERATORS WITH ZEROING | |
| 596 | ***************************************************************************/ | |
| 597 | ||
| 598 | void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) | |
| 599 | { | |
| 600 | void *result = malloc_file_line(size, file, line); | |
| 601 | if (result == NULL) | |
| 602 | throw std::bad_alloc(); | |
| 603 | memset(result, 0, size); | |
| 604 | return result; | |
| 605 | } | |
| 606 | ||
| 607 | ||
| 608 | void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) | |
| 609 | { | |
| 610 | void *result = malloc_file_line(size, file, line); | |
| 611 | if (result == NULL) | |
| 612 | throw std::bad_alloc(); | |
| 613 | memset(result, 0, size); | |
| 614 | return result; | |
| 615 | } | |
| 616 | ||
| 617 | ||
| 618 | void operator delete(void *ptr, const char *file, int line, const zeromem_t &) | |
| 619 | { | |
| 620 | if (ptr != NULL) | |
| 621 | free_file_line(ptr, file, line); | |
| 622 | } | |
| 623 | ||
| 624 | ||
| 625 | void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) | |
| 626 | { | |
| 627 | if (ptr != NULL) | |
| 628 | free_file_line(ptr, file, line); | |
| 629 | } |
| r7500 | r7501 | |
|---|---|---|
| 46 | 46 | #include "osdcore.h" |
| 47 | 47 | |
| 48 | 48 | |
| 49 | /*************************************************************************** | |
| 50 | TYPE DEFINITIONS | |
| 51 | ***************************************************************************/ | |
| 49 | //************************************************************************** | |
| 50 | // MACROS | |
| 51 | //************************************************************************** | |
| 52 | 52 | |
| 53 | // pool allocation helpers | |
| 54 | #define pool_alloc(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__) _type) | |
| 55 | #define pool_alloc_clear(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__, zeromem) _type) | |
| 56 | #define pool_alloc_array(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__) _type[_num], (_num)) | |
| 57 | #define pool_alloc_array_clear(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__, zeromem) _type[_num], (_num)) | |
| 58 | #define pool_free(_pool, v) (_pool).remove(v) | |
| 59 | ||
| 60 | // global allocation helpers | |
| 61 | #define global_alloc(_type) pool_alloc(global_resource_pool, _type) | |
| 62 | #define global_alloc_clear(_type) pool_alloc_clear(global_resource_pool, _type) | |
| 63 | #define global_alloc_array(_type, _num) pool_alloc_array(global_resource_pool, _type, _num) | |
| 64 | #define global_alloc_array_clear(_type, _num) pool_alloc_array_clear(global_resource_pool, _type, _num) | |
| 65 | #define global_free(v) pool_free(global_resource_pool, v) | |
| 66 | ||
| 67 | ||
| 68 | ||
| 69 | //************************************************************************** | |
| 70 | // TYPE DEFINITIONS | |
| 71 | //************************************************************************** | |
| 72 | ||
| 53 | 73 | // zeromem_t is a dummy class used to tell new to zero memory after allocation |
| 54 | 74 | class zeromem_t { }; |
| 55 | 75 | |
| r7500 | r7501 | |
| 62 | 82 | resource_pool_item &operator=(const resource_pool_item &); |
| 63 | 83 | |
| 64 | 84 | public: |
| 65 | resource_pool_item(void *_ptr, size_t _size) | |
| 66 | : next(NULL), | |
| 67 | ordered_next(NULL), | |
| 68 | ordered_prev(NULL), | |
| 69 | ptr(_ptr), | |
| 70 | size(_size) { } | |
| 85 | resource_pool_item(void *ptr, size_t size) | |
| 86 | : m_next(NULL), | |
| 87 | m_ordered_next(NULL), | |
| 88 | m_ordered_prev(NULL), | |
| 89 | m_ptr(ptr), | |
| 90 | m_size(size) { } | |
| 71 | 91 | virtual ~resource_pool_item() { } |
| 72 | 92 | |
| 73 | resource_pool_item * next; | |
| 74 | resource_pool_item * ordered_next; | |
| 75 | resource_pool_item * ordered_prev; | |
| 76 | void * ptr; | |
| 77 | size_t size; | |
| 93 | resource_pool_item * m_next; | |
| 94 | resource_pool_item * m_ordered_next; | |
| 95 | resource_pool_item * m_ordered_prev; | |
| 96 | void * m_ptr; | |
| 97 | size_t m_size; | |
| 78 | 98 | }; |
| 79 | 99 | |
| 80 | 100 | |
| r7500 | r7501 | |
| 86 | 106 | resource_pool_object<T> &operator=(const resource_pool_object<T> &); |
| 87 | 107 | |
| 88 | 108 | public: |
| 89 | resource_pool_object(T *_object) | |
| 90 | : resource_pool_item(reinterpret_cast<void *>(_object), sizeof(T)), | |
| 91 | object(_object) { } | |
| 92 | virtual ~resource_pool_object() { delete object; } | |
| 109 | resource_pool_object(T *object) | |
| 110 | : resource_pool_item(reinterpret_cast<void *>(object), sizeof(T)), | |
| 111 | m_object(object) { } | |
| 112 | virtual ~resource_pool_object() { delete m_object; } | |
| 93 | 113 | |
| 94 | 114 | private: |
| 95 | T *object; | |
| 115 | T * m_object; | |
| 96 | 116 | }; |
| 97 | 117 | |
| 98 | 118 | |
| r7500 | r7501 | |
| 105 | 125 | resource_pool_array<T> &operator=(const resource_pool_array<T> &); |
| 106 | 126 | |
| 107 | 127 | public: |
| 108 | resource_pool_array(T *_array, int _count) | |
| 109 | : resource_pool_item(reinterpret_cast<void *>(_array), sizeof(T) * _count), | |
| 110 | array(_array), | |
| 111 | count(_count) { } | |
| 112 | virtual ~resource_pool_array() { delete[] array; } | |
| 128 | resource_pool_array(T *array, int count) | |
| 129 | : resource_pool_item(reinterpret_cast<void *>(array), sizeof(T) * count), | |
| 130 | m_array(array), | |
| 131 | m_count(count) { } | |
| 132 | virtual ~resource_pool_array() { delete[] m_array; } | |
| 113 | 133 | |
| 114 | 134 | private: |
| 115 | T *array; | |
| 116 | int count; | |
| 135 | T * m_array; | |
| 136 | int m_count; | |
| 117 | 137 | }; |
| 118 | 138 | |
| 119 | 139 | |
| r7500 | r7501 | |
| 129 | 149 | ~resource_pool(); |
| 130 | 150 | |
| 131 | 151 | void add(resource_pool_item &item); |
| 132 | void remove(resource_pool_item &item) { remove(item.ptr); } | |
| 152 | void remove(resource_pool_item &item) { remove(item.m_ptr); } | |
| 133 | 153 | void remove(void *ptr); |
| 134 | 154 | void remove(const void *ptr) { remove(const_cast<void *>(ptr)); } |
| 135 | 155 | resource_pool_item *find(void *ptr); |
| r7500 | r7501 | |
| 140 | 160 | template<class T> T *add_array(T* array, int count) { add(*new(__FILE__, __LINE__) resource_pool_array<T>(array, count)); return array; } |
| 141 | 161 | |
| 142 | 162 | private: |
| 143 | static const int hash_prime = 193; | |
| 163 | static const int k_hash_prime = 193; | |
| 144 | 164 | |
| 145 | osd_lock * listlock; | |
| 146 | resource_pool_item * hash[hash_prime]; | |
| 147 | resource_pool_item * ordered_head; | |
| 165 | osd_lock * m_listlock; | |
| 166 | resource_pool_item * m_hash[k_hash_prime]; | |
| 167 | resource_pool_item * m_ordered_head; | |
| 148 | 168 | }; |
| 149 | 169 | |
| 150 | 170 | |
| 151 | 171 | |
| 152 | /*************************************************************************** | |
| 153 | MACROS | |
| 154 | ***************************************************************************/ | |
| 172 | //************************************************************************** | |
| 173 | // GLOBAL VARIABLES | |
| 174 | //************************************************************************** | |
| 155 | 175 | |
| 156 | // re-route classic malloc-style allocations | |
| 157 | #undef malloc | |
| 158 | #undef calloc | |
| 159 | #undef realloc | |
| 160 | #undef free | |
| 161 | ||
| 162 | #define malloc(x) malloc_file_line(x, __FILE__, __LINE__) | |
| 163 | #define calloc(x,y) __error_use_auto_alloc_clear_or_global_alloc_clear_instead__ | |
| 164 | #define realloc(x,y) __error_realloc_is_dangerous__ | |
| 165 | #define free(x) free_file_line(x, __FILE__, __LINE__) | |
| 166 | ||
| 167 | // pool allocation helpers | |
| 168 | #define pool_alloc(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__) _type) | |
| 169 | #define pool_alloc_clear(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__, zeromem) _type) | |
| 170 | #define pool_alloc_array(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__) _type[_num], (_num)) | |
| 171 | #define pool_alloc_array_clear(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__, zeromem) _type[_num], (_num)) | |
| 172 | #define pool_free(_pool, v) (_pool).remove(v) | |
| 173 | ||
| 174 | // global allocation helpers | |
| 175 | #define global_alloc(_type) pool_alloc(global_resource_pool, _type) | |
| 176 | #define global_alloc_clear(_type) pool_alloc_clear(global_resource_pool, _type) | |
| 177 | #define global_alloc_array(_type, _num) pool_alloc_array(global_resource_pool, _type, _num) | |
| 178 | #define global_alloc_array_clear(_type, _num) pool_alloc_array_clear(global_resource_pool, _type, _num) | |
| 179 | #define global_free(v) pool_free(global_resource_pool, v) | |
| 180 | ||
| 181 | ||
| 182 | ||
| 183 | /*************************************************************************** | |
| 184 | GLOBAL VARIABLES | |
| 185 | ***************************************************************************/ | |
| 186 | ||
| 187 | 176 | // global resource pool |
| 188 | 177 | extern resource_pool global_resource_pool; |
| 189 | 178 | |
| r7500 | r7501 | |
| 192 | 181 | |
| 193 | 182 | |
| 194 | 183 | |
| 195 | /*************************************************************************** | |
| 196 | FUNCTION PROTOTYPES | |
| 197 | ***************************************************************************/ | |
| 184 | //************************************************************************** | |
| 185 | // FUNCTION PROTOTYPES | |
| 186 | //************************************************************************** | |
| 198 | 187 | |
| 199 | 188 | // allocate memory with file and line number information |
| 200 | 189 | void *malloc_file_line(size_t size, const char *file, int line); |
| r7500 | r7501 | |
| 202 | 191 | // free memory with file and line number information |
| 203 | 192 | void free_file_line(void *memory, const char *file, int line); |
| 204 | 193 | |
| 205 | // called from the exit path of any code that wants to check for unfreed | |
| 194 | // called from the exit path of any code that wants to check for unfreed | |
| 206 | 195 | void dump_unfreed_mem(); |
| 207 | 196 | |
| 197 | ||
| 198 | ||
| 199 | //************************************************************************** | |
| 200 | // INLINE FUNCTIONS | |
| 201 | //************************************************************************** | |
| 202 | ||
| 208 | 203 | // standard new/delete operators (try to avoid using) |
| 209 | void *operator new(std::size_t size) throw (std::bad_alloc); | |
| 210 | void *operator new[](std::size_t size) throw (std::bad_alloc); | |
| 211 | void operator delete(void *ptr); | |
| 212 | void operator delete[](void *ptr); | |
| 204 | inline void *operator new(std::size_t size) throw (std::bad_alloc) | |
| 205 | { | |
| 206 | void *result = malloc_file_line(size, NULL, 0); | |
| 207 | if (result == NULL) | |
| 208 | throw std::bad_alloc(); | |
| 209 | return result; | |
| 210 | } | |
| 213 | 211 | |
| 212 | inline void *operator new[](std::size_t size) throw (std::bad_alloc) | |
| 213 | { | |
| 214 | void *result = malloc_file_line(size, NULL, 0); | |
| 215 | if (result == NULL) | |
| 216 | throw std::bad_alloc(); | |
| 217 | return result; | |
| 218 | } | |
| 219 | ||
| 220 | inline void operator delete(void *ptr) | |
| 221 | { | |
| 222 | if (ptr != NULL) | |
| 223 | free_file_line(ptr, NULL, 0); | |
| 224 | } | |
| 225 | ||
| 226 | inline void operator delete[](void *ptr) | |
| 227 | { | |
| 228 | if (ptr != NULL) | |
| 229 | free_file_line(ptr, NULL, 0); | |
| 230 | } | |
| 231 | ||
| 232 | ||
| 214 | 233 | // file/line new/delete operators |
| 215 | void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc); | |
| 216 | void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc); | |
| 217 | void operator delete(void *ptr, const char *file, int line); | |
| 218 | void operator delete[](void *ptr, const char *file, int line); | |
| 234 | inline void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) | |
| 235 | { | |
| 236 | void *result = malloc_file_line(size, file, line); | |
| 237 | if (result == NULL) | |
| 238 | throw std::bad_alloc(); | |
| 239 | return result; | |
| 240 | } | |
| 219 | 241 | |
| 242 | inline void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) | |
| 243 | { | |
| 244 | void *result = malloc_file_line(size, file, line); | |
| 245 | if (result == NULL) | |
| 246 | throw std::bad_alloc(); | |
| 247 | return result; | |
| 248 | } | |
| 249 | ||
| 250 | inline void operator delete(void *ptr, const char *file, int line) | |
| 251 | { | |
| 252 | if (ptr != NULL) | |
| 253 | free_file_line(ptr, file, line); | |
| 254 | } | |
| 255 | ||
| 256 | inline void operator delete[](void *ptr, const char *file, int line) | |
| 257 | { | |
| 258 | if (ptr != NULL) | |
| 259 | free_file_line(ptr, file, line); | |
| 260 | } | |
| 261 | ||
| 262 | ||
| 220 | 263 | // file/line new/delete operators with zeroing |
| 221 | void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); | |
| 222 | void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); | |
| 223 | void operator delete(void *ptr, const char *file, int line, const zeromem_t &); | |
| 224 | void operator delete[](void *ptr, const char *file, int line, const zeromem_t &); | |
| 264 | inline void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) | |
| 265 | { | |
| 266 | void *result = malloc_file_line(size, file, line); | |
| 267 | if (result == NULL) | |
| 268 | throw std::bad_alloc(); | |
| 269 | memset(result, 0, size); | |
| 270 | return result; | |
| 271 | } | |
| 225 | 272 | |
| 273 | inline void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) | |
| 274 | { | |
| 275 | void *result = malloc_file_line(size, file, line); | |
| 276 | if (result == NULL) | |
| 277 | throw std::bad_alloc(); | |
| 278 | memset(result, 0, size); | |
| 279 | return result; | |
| 280 | } | |
| 226 | 281 | |
| 282 | inline void operator delete(void *ptr, const char *file, int line, const zeromem_t &) | |
| 283 | { | |
| 284 | if (ptr != NULL) | |
| 285 | free_file_line(ptr, file, line); | |
| 286 | } | |
| 227 | 287 | |
| 228 | /*************************************************************************** | |
| 229 | ADDITIONAL MACROS | |
| 230 | ***************************************************************************/ | |
| 288 | inline void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) | |
| 289 | { | |
| 290 | if (ptr != NULL) | |
| 291 | free_file_line(ptr, file, line); | |
| 292 | } | |
| 231 | 293 | |
| 294 | ||
| 295 | ||
| 296 | //************************************************************************** | |
| 297 | // ADDDITIONAL MACROS | |
| 298 | //************************************************************************** | |
| 299 | ||
| 300 | // re-route classic malloc-style allocations | |
| 301 | #undef malloc | |
| 302 | #undef calloc | |
| 303 | #undef realloc | |
| 304 | #undef free | |
| 305 | ||
| 306 | #define malloc(x) malloc_file_line(x, __FILE__, __LINE__) | |
| 307 | #define calloc(x,y) __error_use_auto_alloc_clear_or_global_alloc_clear_instead__ | |
| 308 | #define realloc(x,y) __error_realloc_is_dangerous__ | |
| 309 | #define free(x) free_file_line(x, __FILE__, __LINE__) | |
| 310 | ||
| 232 | 311 | // disable direct deletion |
| 233 | 312 | #define delete __error_use_pool_free_mechanisms__ |
| 234 | 313 | |
| 235 | 314 | |
| 236 | ||
| 237 | 315 | #endif /* __EMUALLOC_H__ */ |
| r7500 | r7501 | |
|---|---|---|
| 158 | 158 | int i; |
| 159 | 159 | |
| 160 | 160 | /* reset all the voices */ |
| 161 | for (i=0; i | |
| 161 | for (i = 0; i < 5; i++) { | |
| 162 | 162 | voice[i].frequency = 0; |
| 163 | 163 | voice[i].volume = 0; |
| 164 | 164 | voice[i].counter = 0; |
| r7500 | r7501 | |
|---|---|---|
| 506 | 506 | |
| 507 | 507 | |
| 508 | 508 | /*------------------------------------------------- |
| 509 | mos6560_video_update - copy the VIC bitmap to | |
| 509 | mos6560_video_update - copy the VIC bitmap to | |
| 510 | 510 | main screen bitmap |
| 511 | 511 | -------------------------------------------------*/ |
| 512 | 512 |
| r7500 | r7501 | |
|---|---|---|
| 1621 | 1621 | * input[3] - Threshold for enable |
| 1622 | 1622 | * |
| 1623 | 1623 | ************************************************************************/ |
| 1624 | #define DST_ASWITCH__CTRL DISCRETE_INPUT(1) | |
| 1625 | #define DST_ASWITCH__IN DISCRETE_INPUT(2) | |
| 1626 | #define DST_ASWITCH__THRESHOLD DISCRETE_INPUT(3) | |
| 1624 | #define DST_ASWITCH__CTRL DISCRETE_INPUT(0) | |
| 1625 | #define DST_ASWITCH__IN DISCRETE_INPUT(1) | |
| 1626 | #define DST_ASWITCH__THRESHOLD DISCRETE_INPUT(2) | |
| 1627 | 1627 | |
| 1628 | 1628 | |
| 1629 | 1629 | static DISCRETE_STEP(dst_aswitch) |
| r7500 | r7501 | |
|---|---|---|
| 88 | 88 | Thanks to PlgDavid for providing samples which helped immensely here. |
| 89 | 89 | Added true clock divider emulation, so sn94624 and sn76494 run 8x faster than |
| 90 | 90 | the others, as in real life. |
| 91 | ||
| 91 | ||
| 92 | 92 | 15/02/2010: Lord Nightmare & Michael Zapf (additional testing by PlgDavid) |
| 93 | 93 | Fix noise period when set to mirror channel 3 and channel 3 period is set to 0 (tested on hardware for noise, wave needs tests) - MZ |
| 94 | 94 | Fix phase of noise on sn94624 and sn76489; all chips use a standard XOR, the only inversion is the output itself - LN, Plgdavid |
| r7500 | r7501 | |
|---|---|---|
| 210 | 210 | /* allocate volume lookup table */ |
| 211 | 211 | chip->volume_lookup = auto_alloc_array(chip->device->machine, UINT16, 4096); |
| 212 | 212 | |
| 213 | /* generate | |
| 213 | /* generate volume lookup table */ | |
| 214 | 214 | for (i = 0; i < 4096; i++) |
| 215 | 215 | { |
| 216 | 216 | UINT8 exponent = i >> 8; |
| r7500 | r7501 | |
| 870 | 870 | /* allocate memory */ |
| 871 | 871 | chip->scratch = auto_alloc_array(device->machine, INT32, 2 * MAX_SAMPLE_CHUNK); |
| 872 | 872 | |
| 873 | /* register save */ | |
| 874 | state_save_register_device_item(device, 0, chip->sample_rate); | |
| 875 | state_save_register_device_item(device, 0, chip->write_latch); | |
| 876 | state_save_register_device_item(device, 0, chip->read_latch); | |
| 877 | ||
| 878 | state_save_register_device_item(device, 0, chip->current_page); | |
| 879 | state_save_register_device_item(device, 0, chip->active_voices); | |
| 880 | state_save_register_device_item(device, 0, chip->mode); | |
| 881 | state_save_register_device_item(device, 0, chip->wst); | |
| 882 | state_save_register_device_item(device, 0, chip->wend); | |
| 883 | state_save_register_device_item(device, 0, chip->lrend); | |
| 884 | state_save_register_device_item(device, 0, chip->irqv); | |
| 885 | ||
| 886 | state_save_register_device_item_pointer(device, 0, chip->scratch, 2 * MAX_SAMPLE_CHUNK); | |
| 887 | ||
| 888 | for (j = 0; j < 32; j++) | |
| 889 | { | |
| 890 | state_save_register_device_item(device, j, chip->voice[j].control); | |
| 891 | state_save_register_device_item(device, j, chip->voice[j].freqcount); | |
| 892 | state_save_register_device_item(device, j, chip->voice[j].start); | |
| 893 | state_save_register_device_item(device, j, chip->voice[j].lvol); | |
| 894 | state_save_register_device_item(device, j, chip->voice[j].end); | |
| 895 | state_save_register_device_item(device, j, chip->voice[j].lvramp); | |
| 896 | state_save_register_device_item(device, j, chip->voice[j].accum); | |
| 897 | state_save_register_device_item(device, j, chip->voice[j].rvol); | |
| 898 | state_save_register_device_item(device, j, chip->voice[j].rvramp); | |
| 899 | state_save_register_device_item(device, j, chip->voice[j].ecount); | |
| 900 | state_save_register_device_item(device, j, chip->voice[j].k2); | |
| 901 | state_save_register_device_item(device, j, chip->voice[j].k2ramp); | |
| 902 | state_save_register_device_item(device, j, chip->voice[j].k1); | |
| 903 | state_save_register_device_item(device, j, chip->voice[j].k1ramp); | |
| 904 | state_save_register_device_item(device, j, chip->voice[j].o4n1); | |
| 905 | state_save_register_device_item(device, j, chip->voice[j].o3n1); | |
| 906 | state_save_register_device_item(device, j, chip->voice[j].o3n2); | |
| 907 | state_save_register_device_item(device, j, chip->voice[j].o2n1); | |
| 908 | state_save_register_device_item(device, j, chip->voice[j].o2n2); | |
| 909 | state_save_register_device_item(device, j, chip->voice[j].o1n1); | |
| 910 | state_save_register_device_item(device, j, chip->voice[j].exbank); | |
| 911 | state_save_register_device_item(device, j, chip->voice[j].filtcount); | |
| 912 | } | |
| 913 | ||
| 873 | 914 | /* success */ |
| 874 | 915 | } |
| 875 | 916 |
| r7500 | r7501 | |
|---|---|---|
| 270 | 270 | endif |
| 271 | 271 | |
| 272 | 272 | |
| 273 | ||
| 273 | 274 | #------------------------------------------------- |
| 274 | 275 | # MOS 6560VIC |
| 275 | 276 | #------------------------------------------------- |
| r7500 | r7501 | |
|---|---|---|
| 153 | 153 | /* loop over all the planes, converting fractions */ |
| 154 | 154 | for (j = 0; j < planes; j++) |
| 155 | 155 | { |
| 156 | UINT32 value = extpoffs[j]; | |
| 157 | if (IS_FRAC(value)) | |
| 156 | UINT32 value1 = extpoffs[j]; | |
| 157 | if (IS_FRAC(value1)) | |
| 158 | 158 | { |
| 159 | 159 | assert(region_length != 0); |
| 160 | extpoffs[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); | |
| 160 | extpoffs[j] = FRAC_OFFSET(value1) + region_length * FRAC_NUM(value1) / FRAC_DEN(value1); | |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /* loop over all the X/Y offsets, converting fractions */ |
| 165 | 165 | for (j = 0; j < width; j++) |
| 166 | 166 | { |
| 167 | UINT32 value = extxoffs[j]; | |
| 168 | if (IS_FRAC(value)) | |
| 167 | UINT32 value2 = extxoffs[j]; | |
| 168 | if (IS_FRAC(value2)) | |
| 169 | 169 | { |
| 170 | 170 | assert(region_length != 0); |
| 171 | extxoffs[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); | |
| 171 | extxoffs[j] = FRAC_OFFSET(value2) + region_length * FRAC_NUM(value2) / FRAC_DEN(value2); | |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | for (j = 0; j < height; j++) |
| 176 | 176 | { |
| 177 | UINT32 value = extyoffs[j]; | |
| 178 | if (IS_FRAC(value)) | |
| 177 | UINT32 value3 = extyoffs[j]; | |
| 178 | if (IS_FRAC(value3)) | |
| 179 | 179 | { |
| 180 | 180 | assert(region_length != 0); |
| 181 | extyoffs[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); | |
| 181 | extyoffs[j] = FRAC_OFFSET(value3) + region_length * FRAC_NUM(value3) / FRAC_DEN(value3); | |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | } |
| r7500 | r7501 | |
|---|---|---|
| 1306 | 1306 | { |
| 1307 | 1307 | /* autoschow */ |
| 1308 | 1308 | cur_editor = &focus_view->editor; |
| 1309 | cur_editor->str = cur_editor->str.substr(0, cur_editor->str.len()); | |
| 1309 | cur_editor->str = cur_editor->str.substr(0, cur_editor->str.len()-1); | |
| 1310 | 1310 | } |
| 1311 | 1311 | /* if it's any other key and we're not maxed out, update */ |
| 1312 | 1312 | else if (event.ch >= ' ' && event.ch < 0x7f) |
| r7500 | r7501 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | /* core parameters */ |
| 190 | 190 | case MCONFIG_TOKEN_DRIVER_DATA: |
| 191 | TOKEN_UNGET_UINT32(tokens); | |
| 192 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->driver_data_size, 24); | |
| 191 | config->driver_data_alloc = TOKEN_GET_PTR(tokens, driver_data_alloc); | |
| 193 | 192 | break; |
| 194 | 193 | |
| 195 | 194 | case MCONFIG_TOKEN_QUANTUM_TIME: |
| r7500 | r7501 | |
|---|---|---|
| 1426 | 1426 | error |= validate_tag(driver, "bank", entry->write.tag); |
| 1427 | 1427 | if (entry->share != NULL) |
| 1428 | 1428 | error |= validate_tag(driver, "share", entry->share); |
| 1429 | ||
| 1430 | /* if there are base or size members, check that they are within bounds */ | |
| 1431 | if (entry->baseptroffs_plus1 != 0 && (entry->baseptroffs_plus1 - 1) >= config->driver_data_size) | |
| 1432 | { | |
| 1433 | mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_BASE_MEMBER entry\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum]); | |
| 1434 | error = TRUE; | |
| 1435 | } | |
| 1436 | if (entry->sizeptroffs_plus1 != 0 && (entry->sizeptroffs_plus1 - 1) >= config->driver_data_size) | |
| 1437 | { | |
| 1438 | mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_SIZE_MEMBER entry\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum]); | |
| 1439 | error = TRUE; | |
| 1440 | } | |
| 1441 | 1429 | } |
| 1442 | 1430 | |
| 1443 | 1431 | /* release the address map */ |
| r7500 | r7501 | |
|---|---|---|
| 89 | 89 | typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom); |
| 90 | 90 | typedef void (*video_eof_func)(running_machine *machine); |
| 91 | 91 | typedef UINT32 (*video_update_func)(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); |
| 92 | typedef void * (*driver_data_alloc_func)(running_machine &machine); | |
| 92 | 93 | |
| 93 | 94 | |
| 94 | 95 | |
| r7500 | r7501 | |
| 192 | 193 | typedef struct _machine_config machine_config; |
| 193 | 194 | struct _machine_config |
| 194 | 195 | { |
| 195 | | |
| 196 | | |
| 196 | 197 | |
| 197 | 198 | attotime minimum_quantum; /* minimum scheduling quantum */ |
| 198 | 199 | const char * perfect_cpu_quantum; /* tag of CPU to use for "perfect" scheduling */ |
| r7500 | r7501 | |
| 247 | 248 | palette_init_func palette_init; |
| 248 | 249 | video_eof_func video_eof; |
| 249 | 250 | video_update_func video_update; |
| 251 | driver_data_alloc_func driver_data_alloc; | |
| 250 | 252 | }; |
| 251 | 253 | |
| 252 | 254 | |
| r7500 | r7501 | |
| 276 | 278 | |
| 277 | 279 | |
| 278 | 280 | /* core parameters */ |
| 279 | #define MDRV_DRIVER_DATA(_struct) \ | |
| 280 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_DRIVER_DATA, 8, sizeof(_struct), 24), | |
| 281 | #define MDRV_DRIVER_DATA(_class) \ | |
| 282 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DRIVER_DATA, 8), \ | |
| 283 | TOKEN_PTR(driver_data_alloc, _class::alloc), | |
| 281 | 284 | |
| 282 | 285 | #define MDRV_QUANTUM_TIME(_time) \ |
| 283 | 286 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_QUANTUM_TIME, 8), \ |
| r0 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | /*============================================================================ | |
| 3 | ||
| 4 | This C source file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | |
| 5 | Package, Release 2b. | |
| 6 | ||
| 7 | Written by John R. Hauser. This work was made possible in part by the | |
| 8 | International Computer Science Institute, located at Suite 600, 1947 Center | |
| 9 | Street, Berkeley, California 94704. Funding was partially provided by the | |
| 10 | National Science Foundation under grant MIP-9311980. The original version | |
| 11 | of this code was written as part of a project to build a fixed-point vector | |
| 12 | processor in collaboration with the University of California at Berkeley, | |
| 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information | |
| 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | |
| 15 | arithmetic/SoftFloat.html'. | |
| 16 | ||
| 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | |
| 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | |
| 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | |
| 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | |
| 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | |
| 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | |
| 23 | INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | |
| 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | |
| 25 | ||
| 26 | Derivative works are acceptable, even for commercial purposes, so long as | |
| 27 | (1) the source code for the derivative work includes prominent notice that | |
| 28 | the work is derivative, and (2) the source code includes prominent notice with | |
| 29 | these four paragraphs for those parts of this code that are retained. | |
| 30 | ||
| 31 | =============================================================================*/ | |
| 32 | ||
| 33 | #include "milieu.h" | |
| 34 | #include "softfloat.h" | |
| 35 | ||
| 36 | /*---------------------------------------------------------------------------- | |
| 37 | | Floating-point rounding mode, extended double-precision rounding precision, | |
| 38 | | and exception flags. | |
| 39 | *----------------------------------------------------------------------------*/ | |
| 40 | int8 float_rounding_mode = float_round_nearest_even; | |
| 41 | int8 float_exception_flags = 0; | |
| 42 | #ifdef FLOATX80 | |
| 43 | int8 floatx80_rounding_precision = 80; | |
| 44 | #endif | |
| 45 | ||
| 46 | /*---------------------------------------------------------------------------- | |
| 47 | | Primitive arithmetic functions, including multi-word arithmetic, and | |
| 48 | | division and square root approximations. (Can be specialized to target if | |
| 49 | | desired.) | |
| 50 | *----------------------------------------------------------------------------*/ | |
| 51 | #include "softfloat-macros" | |
| 52 | ||
| 53 | /*---------------------------------------------------------------------------- | |
| 54 | | Functions and definitions to determine: (1) whether tininess for underflow | |
| 55 | | is detected before or after rounding by default, (2) what (if anything) | |
| 56 | | happens when exceptions are raised, (3) how signaling NaNs are distinguished | |
| 57 | | from quiet NaNs, (4) the default generated quiet NaNs, and (5) how NaNs | |
| 58 | | are propagated from function inputs to output. These details are target- | |
| 59 | | specific. | |
| 60 | *----------------------------------------------------------------------------*/ | |
| 61 | #include "softfloat-specialize" | |
| 62 | ||
| 63 | /*---------------------------------------------------------------------------- | |
| 64 | | Takes a 64-bit fixed-point value `absZ' with binary point between bits 6 | |
| 65 | | and 7, and returns the properly rounded 32-bit integer corresponding to the | |
| 66 | | input. If `zSign' is 1, the input is negated before being converted to an | |
| 67 | | integer. Bit 63 of `absZ' must be zero. Ordinarily, the fixed-point input | |
| 68 | | is simply rounded to an integer, with the inexact exception raised if the | |
| 69 | | input cannot be represented exactly as an integer. However, if the fixed- | |
| 70 | | point input is too large, the invalid exception is raised and the largest | |
| 71 | | positive or negative integer is returned. | |
| 72 | *----------------------------------------------------------------------------*/ | |
| 73 | ||
| 74 | static int32 roundAndPackInt32( flag zSign, bits64 absZ ) | |
| 75 | { | |
| 76 | int8 roundingMode; | |
| 77 | flag roundNearestEven; | |
| 78 | int8 roundIncrement, roundBits; | |
| 79 | int32 z; | |
| 80 | ||
| 81 | roundingMode = float_rounding_mode; | |
| 82 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 83 | roundIncrement = 0x40; | |
| 84 | if ( ! roundNearestEven ) { | |
| 85 | if ( roundingMode == float_round_to_zero ) { | |
| 86 | roundIncrement = 0; | |
| 87 | } | |
| 88 | else { | |
| 89 | roundIncrement = 0x7F; | |
| 90 | if ( zSign ) { | |
| 91 | if ( roundingMode == float_round_up ) roundIncrement = 0; | |
| 92 | } | |
| 93 | else { | |
| 94 | if ( roundingMode == float_round_down ) roundIncrement = 0; | |
| 95 | } | |
| 96 | } | |
| 97 | } | |
| 98 | roundBits = absZ & 0x7F; | |
| 99 | absZ = ( absZ + roundIncrement )>>7; | |
| 100 | absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); | |
| 101 | z = absZ; | |
| 102 | if ( zSign ) z = - z; | |
| 103 | if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { | |
| 104 | float_raise( float_flag_invalid ); | |
| 105 | return zSign ? (sbits32) 0x80000000 : 0x7FFFFFFF; | |
| 106 | } | |
| 107 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | |
| 108 | return z; | |
| 109 | ||
| 110 | } | |
| 111 | ||
| 112 | /*---------------------------------------------------------------------------- | |
| 113 | | Takes the 128-bit fixed-point value formed by concatenating `absZ0' and | |
| 114 | | `absZ1', with binary point between bits 63 and 64 (between the input words), | |
| 115 | | and returns the properly rounded 64-bit integer corresponding to the input. | |
| 116 | | If `zSign' is 1, the input is negated before being converted to an integer. | |
| 117 | | Ordinarily, the fixed-point input is simply rounded to an integer, with | |
| 118 | | the inexact exception raised if the input cannot be represented exactly as | |
| 119 | | an integer. However, if the fixed-point input is too large, the invalid | |
| 120 | | exception is raised and the largest positive or negative integer is | |
| 121 | | returned. | |
| 122 | *----------------------------------------------------------------------------*/ | |
| 123 | ||
| 124 | static int64 roundAndPackInt64( flag zSign, bits64 absZ0, bits64 absZ1 ) | |
| 125 | { | |
| 126 | int8 roundingMode; | |
| 127 | flag roundNearestEven, increment; | |
| 128 | int64 z; | |
| 129 | ||
| 130 | roundingMode = float_rounding_mode; | |
| 131 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 132 | increment = ( (sbits64) absZ1 < 0 ); | |
| 133 | if ( ! roundNearestEven ) { | |
| 134 | if ( roundingMode == float_round_to_zero ) { | |
| 135 | increment = 0; | |
| 136 | } | |
| 137 | else { | |
| 138 | if ( zSign ) { | |
| 139 | increment = ( roundingMode == float_round_down ) && absZ1; | |
| 140 | } | |
| 141 | else { | |
| 142 | increment = ( roundingMode == float_round_up ) && absZ1; | |
| 143 | } | |
| 144 | } | |
| 145 | } | |
| 146 | if ( increment ) { | |
| 147 | ++absZ0; | |
| 148 | if ( absZ0 == 0 ) goto overflow; | |
| 149 | absZ0 &= ~ ( ( (bits64) ( absZ1<<1 ) == 0 ) & roundNearestEven ); | |
| 150 | } | |
| 151 | z = absZ0; | |
| 152 | if ( zSign ) z = - z; | |
| 153 | if ( z && ( ( z < 0 ) ^ zSign ) ) { | |
| 154 | overflow: | |
| 155 | float_raise( float_flag_invalid ); | |
| 156 | return | |
| 157 | zSign ? (sbits64) LIT64( 0x8000000000000000 ) | |
| 158 | : LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 159 | } | |
| 160 | if ( absZ1 ) float_exception_flags |= float_flag_inexact; | |
| 161 | return z; | |
| 162 | ||
| 163 | } | |
| 164 | ||
| 165 | /*---------------------------------------------------------------------------- | |
| 166 | | Returns the fraction bits of the single-precision floating-point value `a'. | |
| 167 | *----------------------------------------------------------------------------*/ | |
| 168 | ||
| 169 | INLINE bits32 extractFloat32Frac( float32 a ) | |
| 170 | { | |
| 171 | ||
| 172 | return a & 0x007FFFFF; | |
| 173 | ||
| 174 | } | |
| 175 | ||
| 176 | /*---------------------------------------------------------------------------- | |
| 177 | | Returns the exponent bits of the single-precision floating-point value `a'. | |
| 178 | *----------------------------------------------------------------------------*/ | |
| 179 | ||
| 180 | INLINE int16 extractFloat32Exp( float32 a ) | |
| 181 | { | |
| 182 | ||
| 183 | return ( a>>23 ) & 0xFF; | |
| 184 | ||
| 185 | } | |
| 186 | ||
| 187 | /*---------------------------------------------------------------------------- | |
| 188 | | Returns the sign bit of the single-precision floating-point value `a'. | |
| 189 | *----------------------------------------------------------------------------*/ | |
| 190 | ||
| 191 | INLINE flag extractFloat32Sign( float32 a ) | |
| 192 | { | |
| 193 | ||
| 194 | return a>>31; | |
| 195 | ||
| 196 | } | |
| 197 | ||
| 198 | /*---------------------------------------------------------------------------- | |
| 199 | | Normalizes the subnormal single-precision floating-point value represented | |
| 200 | | by the denormalized significand `aSig'. The normalized exponent and | |
| 201 | | significand are stored at the locations pointed to by `zExpPtr' and | |
| 202 | | `zSigPtr', respectively. | |
| 203 | *----------------------------------------------------------------------------*/ | |
| 204 | ||
| 205 | static void | |
| 206 | normalizeFloat32Subnormal( bits32 aSig, int16 *zExpPtr, bits32 *zSigPtr ) | |
| 207 | { | |
| 208 | int8 shiftCount; | |
| 209 | ||
| 210 | shiftCount = countLeadingZeros32( aSig ) - 8; | |
| 211 | *zSigPtr = aSig<<shiftCount; | |
| 212 | *zExpPtr = 1 - shiftCount; | |
| 213 | ||
| 214 | } | |
| 215 | ||
| 216 | /*---------------------------------------------------------------------------- | |
| 217 | | Packs the sign `zSign', exponent `zExp', and significand `zSig' into a | |
| 218 | | single-precision floating-point value, returning the result. After being | |
| 219 | | shifted into the proper positions, the three fields are simply added | |
| 220 | | together to form the result. This means that any integer portion of `zSig' | |
| 221 | | will be added into the exponent. Since a properly normalized significand | |
| 222 | | will have an integer portion equal to 1, the `zExp' input should be 1 less | |
| 223 | | than the desired result exponent whenever `zSig' is a complete, normalized | |
| 224 | | significand. | |
| 225 | *----------------------------------------------------------------------------*/ | |
| 226 | ||
| 227 | INLINE float32 packFloat32( flag zSign, int16 zExp, bits32 zSig ) | |
| 228 | { | |
| 229 | ||
| 230 | return ( ( (bits32) zSign )<<31 ) + ( ( (bits32) zExp )<<23 ) + zSig; | |
| 231 | ||
| 232 | } | |
| 233 | ||
| 234 | /*---------------------------------------------------------------------------- | |
| 235 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 236 | | and significand `zSig', and returns the proper single-precision floating- | |
| 237 | | point value corresponding to the abstract input. Ordinarily, the abstract | |
| 238 | | value is simply rounded and packed into the single-precision format, with | |
| 239 | | the inexact exception raised if the abstract input cannot be represented | |
| 240 | | exactly. However, if the abstract value is too large, the overflow and | |
| 241 | | inexact exceptions are raised and an infinity or maximal finite value is | |
| 242 | | returned. If the abstract value is too small, the input value is rounded to | |
| 243 | | a subnormal number, and the underflow and inexact exceptions are raised if | |
| 244 | | the abstract input cannot be represented exactly as a subnormal single- | |
| 245 | | precision floating-point number. | |
| 246 | | The input significand `zSig' has its binary point between bits 30 | |
| 247 | | and 29, which is 7 bits to the left of the usual location. This shifted | |
| 248 | | significand must be normalized or smaller. If `zSig' is not normalized, | |
| 249 | | `zExp' must be 0; in that case, the result returned is a subnormal number, | |
| 250 | | and it must not require rounding. In the usual case that `zSig' is | |
| 251 | | normalized, `zExp' must be 1 less than the ``true'' floating-point exponent. | |
| 252 | | The handling of underflow and overflow follows the IEC/IEEE Standard for | |
| 253 | | Binary Floating-Point Arithmetic. | |
| 254 | *----------------------------------------------------------------------------*/ | |
| 255 | ||
| 256 | static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | |
| 257 | { | |
| 258 | int8 roundingMode; | |
| 259 | flag roundNearestEven; | |
| 260 | int8 roundIncrement, roundBits; | |
| 261 | flag isTiny; | |
| 262 | ||
| 263 | roundingMode = float_rounding_mode; | |
| 264 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 265 | roundIncrement = 0x40; | |
| 266 | if ( ! roundNearestEven ) { | |
| 267 | if ( roundingMode == float_round_to_zero ) { | |
| 268 | roundIncrement = 0; | |
| 269 | } | |
| 270 | else { | |
| 271 | roundIncrement = 0x7F; | |
| 272 | if ( zSign ) { | |
| 273 | if ( roundingMode == float_round_up ) roundIncrement = 0; | |
| 274 | } | |
| 275 | else { | |
| 276 | if ( roundingMode == float_round_down ) roundIncrement = 0; | |
| 277 | } | |
| 278 | } | |
| 279 | } | |
| 280 | roundBits = zSig & 0x7F; | |
| 281 | if ( 0xFD <= (bits16) zExp ) { | |
| 282 | if ( ( 0xFD < zExp ) | |
| 283 | || ( ( zExp == 0xFD ) | |
| 284 | && ( (sbits32) ( zSig + roundIncrement ) < 0 ) ) | |
| 285 | ) { | |
| 286 | float_raise( float_flag_overflow | float_flag_inexact ); | |
| 287 | return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 ); | |
| 288 | } | |
| 289 | if ( zExp < 0 ) { | |
| 290 | isTiny = | |
| 291 | ( float_detect_tininess == float_tininess_before_rounding ) | |
| 292 | || ( zExp < -1 ) | |
| 293 | || ( zSig + roundIncrement < 0x80000000 ); | |
| 294 | shift32RightJamming( zSig, - zExp, &zSig ); | |
| 295 | zExp = 0; | |
| 296 | roundBits = zSig & 0x7F; | |
| 297 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | |
| 298 | } | |
| 299 | } | |
| 300 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | |
| 301 | zSig = ( zSig + roundIncrement )>>7; | |
| 302 | zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); | |
| 303 | if ( zSig == 0 ) zExp = 0; | |
| 304 | return packFloat32( zSign, zExp, zSig ); | |
| 305 | ||
| 306 | } | |
| 307 | ||
| 308 | /*---------------------------------------------------------------------------- | |
| 309 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 310 | | and significand `zSig', and returns the proper single-precision floating- | |
| 311 | | point value corresponding to the abstract input. This routine is just like | |
| 312 | | `roundAndPackFloat32' except that `zSig' does not have to be normalized. | |
| 313 | | Bit 31 of `zSig' must be zero, and `zExp' must be 1 less than the ``true'' | |
| 314 | | floating-point exponent. | |
| 315 | *----------------------------------------------------------------------------*/ | |
| 316 | ||
| 317 | static float32 | |
| 318 | normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | |
| 319 | { | |
| 320 | int8 shiftCount; | |
| 321 | ||
| 322 | shiftCount = countLeadingZeros32( zSig ) - 1; | |
| 323 | return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount ); | |
| 324 | ||
| 325 | } | |
| 326 | ||
| 327 | /*---------------------------------------------------------------------------- | |
| 328 | | Returns the fraction bits of the double-precision floating-point value `a'. | |
| 329 | *----------------------------------------------------------------------------*/ | |
| 330 | ||
| 331 | INLINE bits64 extractFloat64Frac( float64 a ) | |
| 332 | { | |
| 333 | ||
| 334 | return a & LIT64( 0x000FFFFFFFFFFFFF ); | |
| 335 | ||
| 336 | } | |
| 337 | ||
| 338 | /*---------------------------------------------------------------------------- | |
| 339 | | Returns the exponent bits of the double-precision floating-point value `a'. | |
| 340 | *----------------------------------------------------------------------------*/ | |
| 341 | ||
| 342 | INLINE int16 extractFloat64Exp( float64 a ) | |
| 343 | { | |
| 344 | ||
| 345 | return ( a>>52 ) & 0x7FF; | |
| 346 | ||
| 347 | } | |
| 348 | ||
| 349 | /*---------------------------------------------------------------------------- | |
| 350 | | Returns the sign bit of the double-precision floating-point value `a'. | |
| 351 | *----------------------------------------------------------------------------*/ | |
| 352 | ||
| 353 | INLINE flag extractFloat64Sign( float64 a ) | |
| 354 | { | |
| 355 | ||
| 356 | return a>>63; | |
| 357 | ||
| 358 | } | |
| 359 | ||
| 360 | /*---------------------------------------------------------------------------- | |
| 361 | | Normalizes the subnormal double-precision floating-point value represented | |
| 362 | | by the denormalized significand `aSig'. The normalized exponent and | |
| 363 | | significand are stored at the locations pointed to by `zExpPtr' and | |
| 364 | | `zSigPtr', respectively. | |
| 365 | *----------------------------------------------------------------------------*/ | |
| 366 | ||
| 367 | static void | |
| 368 | normalizeFloat64Subnormal( bits64 aSig, int16 *zExpPtr, bits64 *zSigPtr ) | |
| 369 | { | |
| 370 | int8 shiftCount; | |
| 371 | ||
| 372 | shiftCount = countLeadingZeros64( aSig ) - 11; | |
| 373 | *zSigPtr = aSig<<shiftCount; | |
| 374 | *zExpPtr = 1 - shiftCount; | |
| 375 | ||
| 376 | } | |
| 377 | ||
| 378 | /*---------------------------------------------------------------------------- | |
| 379 | | Packs the sign `zSign', exponent `zExp', and significand `zSig' into a | |
| 380 | | double-precision floating-point value, returning the result. After being | |
| 381 | | shifted into the proper positions, the three fields are simply added | |
| 382 | | together to form the result. This means that any integer portion of `zSig' | |
| 383 | | will be added into the exponent. Since a properly normalized significand | |
| 384 | | will have an integer portion equal to 1, the `zExp' input should be 1 less | |
| 385 | | than the desired result exponent whenever `zSig' is a complete, normalized | |
| 386 | | significand. | |
| 387 | *----------------------------------------------------------------------------*/ | |
| 388 | ||
| 389 | INLINE float64 packFloat64( flag zSign, int16 zExp, bits64 zSig ) | |
| 390 | { | |
| 391 | ||
| 392 | return ( ( (bits64) zSign )<<63 ) + ( ( (bits64) zExp )<<52 ) + zSig; | |
| 393 | ||
| 394 | } | |
| 395 | ||
| 396 | /*---------------------------------------------------------------------------- | |
| 397 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 398 | | and significand `zSig', and returns the proper double-precision floating- | |
| 399 | | point value corresponding to the abstract input. Ordinarily, the abstract | |
| 400 | | value is simply rounded and packed into the double-precision format, with | |
| 401 | | the inexact exception raised if the abstract input cannot be represented | |
| 402 | | exactly. However, if the abstract value is too large, the overflow and | |
| 403 | | inexact exceptions are raised and an infinity or maximal finite value is | |
| 404 | | returned. If the abstract value is too small, the input value is rounded | |
| 405 | | to a subnormal number, and the underflow and inexact exceptions are raised | |
| 406 | | if the abstract input cannot be represented exactly as a subnormal double- | |
| 407 | | precision floating-point number. | |
| 408 | | The input significand `zSig' has its binary point between bits 62 | |
| 409 | | and 61, which is 10 bits to the left of the usual location. This shifted | |
| 410 | | significand must be normalized or smaller. If `zSig' is not normalized, | |
| 411 | | `zExp' must be 0; in that case, the result returned is a subnormal number, | |
| 412 | | and it must not require rounding. In the usual case that `zSig' is | |
| 413 | | normalized, `zExp' must be 1 less than the ``true'' floating-point exponent. | |
| 414 | | The handling of underflow and overflow follows the IEC/IEEE Standard for | |
| 415 | | Binary Floating-Point Arithmetic. | |
| 416 | *----------------------------------------------------------------------------*/ | |
| 417 | ||
| 418 | static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | |
| 419 | { | |
| 420 | int8 roundingMode; | |
| 421 | flag roundNearestEven; | |
| 422 | int16 roundIncrement, roundBits; | |
| 423 | flag isTiny; | |
| 424 | ||
| 425 | roundingMode = float_rounding_mode; | |
| 426 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 427 | roundIncrement = 0x200; | |
| 428 | if ( ! roundNearestEven ) { | |
| 429 | if ( roundingMode == float_round_to_zero ) { | |
| 430 | roundIncrement = 0; | |
| 431 | } | |
| 432 | else { | |
| 433 | roundIncrement = 0x3FF; | |
| 434 | if ( zSign ) { | |
| 435 | if ( roundingMode == float_round_up ) roundIncrement = 0; | |
| 436 | } | |
| 437 | else { | |
| 438 | if ( roundingMode == float_round_down ) roundIncrement = 0; | |
| 439 | } | |
| 440 | } | |
| 441 | } | |
| 442 | roundBits = zSig & 0x3FF; | |
| 443 | if ( 0x7FD <= (bits16) zExp ) { | |
| 444 | if ( ( 0x7FD < zExp ) | |
| 445 | || ( ( zExp == 0x7FD ) | |
| 446 | && ( (sbits64) ( zSig + roundIncrement ) < 0 ) ) | |
| 447 | ) { | |
| 448 | float_raise( float_flag_overflow | float_flag_inexact ); | |
| 449 | return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 ); | |
| 450 | } | |
| 451 | if ( zExp < 0 ) { | |
| 452 | isTiny = | |
| 453 | ( float_detect_tininess == float_tininess_before_rounding ) | |
| 454 | || ( zExp < -1 ) | |
| 455 | || ( zSig + roundIncrement < LIT64( 0x8000000000000000 ) ); | |
| 456 | shift64RightJamming( zSig, - zExp, &zSig ); | |
| 457 | zExp = 0; | |
| 458 | roundBits = zSig & 0x3FF; | |
| 459 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | |
| 460 | } | |
| 461 | } | |
| 462 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | |
| 463 | zSig = ( zSig + roundIncrement )>>10; | |
| 464 | zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); | |
| 465 | if ( zSig == 0 ) zExp = 0; | |
| 466 | return packFloat64( zSign, zExp, zSig ); | |
| 467 | ||
| 468 | } | |
| 469 | ||
| 470 | /*---------------------------------------------------------------------------- | |
| 471 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 472 | | and significand `zSig', and returns the proper double-precision floating- | |
| 473 | | point value corresponding to the abstract input. This routine is just like | |
| 474 | | `roundAndPackFloat64' except that `zSig' does not have to be normalized. | |
| 475 | | Bit 63 of `zSig' must be zero, and `zExp' must be 1 less than the ``true'' | |
| 476 | | floating-point exponent. | |
| 477 | *----------------------------------------------------------------------------*/ | |
| 478 | ||
| 479 | static float64 | |
| 480 | normalizeRoundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | |
| 481 | { | |
| 482 | int8 shiftCount; | |
| 483 | ||
| 484 | shiftCount = countLeadingZeros64( zSig ) - 1; | |
| 485 | return roundAndPackFloat64( zSign, zExp - shiftCount, zSig<<shiftCount ); | |
| 486 | ||
| 487 | } | |
| 488 | ||
| 489 | #ifdef FLOATX80 | |
| 490 | ||
| 491 | /*---------------------------------------------------------------------------- | |
| 492 | | Returns the fraction bits of the extended double-precision floating-point | |
| 493 | | value `a'. | |
| 494 | *----------------------------------------------------------------------------*/ | |
| 495 | ||
| 496 | INLINE bits64 extractFloatx80Frac( floatx80 a ) | |
| 497 | { | |
| 498 | ||
| 499 | return a.low; | |
| 500 | ||
| 501 | } | |
| 502 | ||
| 503 | /*---------------------------------------------------------------------------- | |
| 504 | | Returns the exponent bits of the extended double-precision floating-point | |
| 505 | | value `a'. | |
| 506 | *----------------------------------------------------------------------------*/ | |
| 507 | ||
| 508 | INLINE int32 extractFloatx80Exp( floatx80 a ) | |
| 509 | { | |
| 510 | ||
| 511 | return a.high & 0x7FFF; | |
| 512 | ||
| 513 | } | |
| 514 | ||
| 515 | /*---------------------------------------------------------------------------- | |
| 516 | | Returns the sign bit of the extended double-precision floating-point value | |
| 517 | | `a'. | |
| 518 | *----------------------------------------------------------------------------*/ | |
| 519 | ||
| 520 | INLINE flag extractFloatx80Sign( floatx80 a ) | |
| 521 | { | |
| 522 | ||
| 523 | return a.high>>15; | |
| 524 | ||
| 525 | } | |
| 526 | ||
| 527 | /*---------------------------------------------------------------------------- | |
| 528 | | Normalizes the subnormal extended double-precision floating-point value | |
| 529 | | represented by the denormalized significand `aSig'. The normalized exponent | |
| 530 | | and significand are stored at the locations pointed to by `zExpPtr' and | |
| 531 | | `zSigPtr', respectively. | |
| 532 | *----------------------------------------------------------------------------*/ | |
| 533 | ||
| 534 | static void | |
| 535 | normalizeFloatx80Subnormal( bits64 aSig, int32 *zExpPtr, bits64 *zSigPtr ) | |
| 536 | { | |
| 537 | int8 shiftCount; | |
| 538 | ||
| 539 | shiftCount = countLeadingZeros64( aSig ); | |
| 540 | *zSigPtr = aSig<<shiftCount; | |
| 541 | *zExpPtr = 1 - shiftCount; | |
| 542 | ||
| 543 | } | |
| 544 | ||
| 545 | /*---------------------------------------------------------------------------- | |
| 546 | | Packs the sign `zSign', exponent `zExp', and significand `zSig' into an | |
| 547 | | extended double-precision floating-point value, returning the result. | |
| 548 | *----------------------------------------------------------------------------*/ | |
| 549 | ||
| 550 | INLINE floatx80 packFloatx80( flag zSign, int32 zExp, bits64 zSig ) | |
| 551 | { | |
| 552 | floatx80 z; | |
| 553 | ||
| 554 | z.low = zSig; | |
| 555 | z.high = ( ( (bits16) zSign )<<15 ) + zExp; | |
| 556 | return z; | |
| 557 | ||
| 558 | } | |
| 559 | ||
| 560 | /*---------------------------------------------------------------------------- | |
| 561 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 562 | | and extended significand formed by the concatenation of `zSig0' and `zSig1', | |
| 563 | | and returns the proper extended double-precision floating-point value | |
| 564 | | corresponding to the abstract input. Ordinarily, the abstract value is | |
| 565 | | rounded and packed into the extended double-precision format, with the | |
| 566 | | inexact exception raised if the abstract input cannot be represented | |
| 567 | | exactly. However, if the abstract value is too large, the overflow and | |
| 568 | | inexact exceptions are raised and an infinity or maximal finite value is | |
| 569 | | returned. If the abstract value is too small, the input value is rounded to | |
| 570 | | a subnormal number, and the underflow and inexact exceptions are raised if | |
| 571 | | the abstract input cannot be represented exactly as a subnormal extended | |
| 572 | | double-precision floating-point number. | |
| 573 | | If `roundingPrecision' is 32 or 64, the result is rounded to the same | |
| 574 | | number of bits as single or double precision, respectively. Otherwise, the | |
| 575 | | result is rounded to the full precision of the extended double-precision | |
| 576 | | format. | |
| 577 | | The input significand must be normalized or smaller. If the input | |
| 578 | | significand is not normalized, `zExp' must be 0; in that case, the result | |
| 579 | | returned is a subnormal number, and it must not require rounding. The | |
| 580 | | handling of underflow and overflow follows the IEC/IEEE Standard for Binary | |
| 581 | | Floating-Point Arithmetic. | |
| 582 | *----------------------------------------------------------------------------*/ | |
| 583 | ||
| 584 | static floatx80 | |
| 585 | roundAndPackFloatx80( | |
| 586 | int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 | |
| 587 | ) | |
| 588 | { | |
| 589 | int8 roundingMode; | |
| 590 | flag roundNearestEven, increment, isTiny; | |
| 591 | int64 roundIncrement, roundMask, roundBits; | |
| 592 | ||
| 593 | roundingMode = float_rounding_mode; | |
| 594 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 595 | if ( roundingPrecision == 80 ) goto precision80; | |
| 596 | if ( roundingPrecision == 64 ) { | |
| 597 | roundIncrement = LIT64( 0x0000000000000400 ); | |
| 598 | roundMask = LIT64( 0x00000000000007FF ); | |
| 599 | } | |
| 600 | else if ( roundingPrecision == 32 ) { | |
| 601 | roundIncrement = LIT64( 0x0000008000000000 ); | |
| 602 | roundMask = LIT64( 0x000000FFFFFFFFFF ); | |
| 603 | } | |
| 604 | else { | |
| 605 | goto precision80; | |
| 606 | } | |
| 607 | zSig0 |= ( zSig1 != 0 ); | |
| 608 | if ( ! roundNearestEven ) { | |
| 609 | if ( roundingMode == float_round_to_zero ) { | |
| 610 | roundIncrement = 0; | |
| 611 | } | |
| 612 | else { | |
| 613 | roundIncrement = roundMask; | |
| 614 | if ( zSign ) { | |
| 615 | if ( roundingMode == float_round_up ) roundIncrement = 0; | |
| 616 | } | |
| 617 | else { | |
| 618 | if ( roundingMode == float_round_down ) roundIncrement = 0; | |
| 619 | } | |
| 620 | } | |
| 621 | } | |
| 622 | roundBits = zSig0 & roundMask; | |
| 623 | if ( 0x7FFD <= (bits32) ( zExp - 1 ) ) { | |
| 624 | if ( ( 0x7FFE < zExp ) | |
| 625 | || ( ( zExp == 0x7FFE ) && ( zSig0 + roundIncrement < zSig0 ) ) | |
| 626 | ) { | |
| 627 | goto overflow; | |
| 628 | } | |
| 629 | if ( zExp <= 0 ) { | |
| 630 | isTiny = | |
| 631 | ( float_detect_tininess == float_tininess_before_rounding ) | |
| 632 | || ( zExp < 0 ) | |
| 633 | || ( zSig0 <= zSig0 + roundIncrement ); | |
| 634 | shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); | |
| 635 | zExp = 0; | |
| 636 | roundBits = zSig0 & roundMask; | |
| 637 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | |
| 638 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | |
| 639 | zSig0 += roundIncrement; | |
| 640 | if ( (sbits64) zSig0 < 0 ) zExp = 1; | |
| 641 | roundIncrement = roundMask + 1; | |
| 642 | if ( roundNearestEven && ( roundBits<<1 == roundIncrement ) ) { | |
| 643 | roundMask |= roundIncrement; | |
| 644 | } | |
| 645 | zSig0 &= ~ roundMask; | |
| 646 | return packFloatx80( zSign, zExp, zSig0 ); | |
| 647 | } | |
| 648 | } | |
| 649 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | |
| 650 | zSig0 += roundIncrement; | |
| 651 | if ( zSig0 < roundIncrement ) { | |
| 652 | ++zExp; | |
| 653 | zSig0 = LIT64( 0x8000000000000000 ); | |
| 654 | } | |
| 655 | roundIncrement = roundMask + 1; | |
| 656 | if ( roundNearestEven && ( roundBits<<1 == roundIncrement ) ) { | |
| 657 | roundMask |= roundIncrement; | |
| 658 | } | |
| 659 | zSig0 &= ~ roundMask; | |
| 660 | if ( zSig0 == 0 ) zExp = 0; | |
| 661 | return packFloatx80( zSign, zExp, zSig0 ); | |
| 662 | precision80: | |
| 663 | increment = ( (sbits64) zSig1 < 0 ); | |
| 664 | if ( ! roundNearestEven ) { | |
| 665 | if ( roundingMode == float_round_to_zero ) { | |
| 666 | increment = 0; | |
| 667 | } | |
| 668 | else { | |
| 669 | if ( zSign ) { | |
| 670 | increment = ( roundingMode == float_round_down ) && zSig1; | |
| 671 | } | |
| 672 | else { | |
| 673 | increment = ( roundingMode == float_round_up ) && zSig1; | |
| 674 | } | |
| 675 | } | |
| 676 | } | |
| 677 | if ( 0x7FFD <= (bits32) ( zExp - 1 ) ) { | |
| 678 | if ( ( 0x7FFE < zExp ) | |
| 679 | || ( ( zExp == 0x7FFE ) | |
| 680 | && ( zSig0 == LIT64( 0xFFFFFFFFFFFFFFFF ) ) | |
| 681 | && increment | |
| 682 | ) | |
| 683 | ) { | |
| 684 | roundMask = 0; | |
| 685 | overflow: | |
| 686 | float_raise( float_flag_overflow | float_flag_inexact ); | |
| 687 | if ( ( roundingMode == float_round_to_zero ) | |
| 688 | || ( zSign && ( roundingMode == float_round_up ) ) | |
| 689 | || ( ! zSign && ( roundingMode == float_round_down ) ) | |
| 690 | ) { | |
| 691 | return packFloatx80( zSign, 0x7FFE, ~ roundMask ); | |
| 692 | } | |
| 693 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 694 | } | |
| 695 | if ( zExp <= 0 ) { | |
| 696 | isTiny = | |
| 697 | ( float_detect_tininess == float_tininess_before_rounding ) | |
| 698 | || ( zExp < 0 ) | |
| 699 | || ! increment | |
| 700 | || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); | |
| 701 | shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 ); | |
| 702 | zExp = 0; | |
| 703 | if ( isTiny && zSig1 ) float_raise( float_flag_underflow ); | |
| 704 | if ( zSig1 ) float_exception_flags |= float_flag_inexact; | |
| 705 | if ( roundNearestEven ) { | |
| 706 | increment = ( (sbits64) zSig1 < 0 ); | |
| 707 | } | |
| 708 | else { | |
| 709 | if ( zSign ) { | |
| 710 | increment = ( roundingMode == float_round_down ) && zSig1; | |
| 711 | } | |
| 712 | else { | |
| 713 | increment = ( roundingMode == float_round_up ) && zSig1; | |
| 714 | } | |
| 715 | } | |
| 716 | if ( increment ) { | |
| 717 | ++zSig0; | |
| 718 | zSig0 &= | |
| 719 | ~ ( ( (bits64) ( zSig1<<1 ) == 0 ) & roundNearestEven ); | |
| 720 | if ( (sbits64) zSig0 < 0 ) zExp = 1; | |
| 721 | } | |
| 722 | return packFloatx80( zSign, zExp, zSig0 ); | |
| 723 | } | |
| 724 | } | |
| 725 | if ( zSig1 ) float_exception_flags |= float_flag_inexact; | |
| 726 | if ( increment ) { | |
| 727 | ++zSig0; | |
| 728 | if ( zSig0 == 0 ) { | |
| 729 | ++zExp; | |
| 730 | zSig0 = LIT64( 0x8000000000000000 ); | |
| 731 | } | |
| 732 | else { | |
| 733 | zSig0 &= ~ ( ( (bits64) ( zSig1<<1 ) == 0 ) & roundNearestEven ); | |
| 734 | } | |
| 735 | } | |
| 736 | else { | |
| 737 | if ( zSig0 == 0 ) zExp = 0; | |
| 738 | } | |
| 739 | return packFloatx80( zSign, zExp, zSig0 ); | |
| 740 | ||
| 741 | } | |
| 742 | ||
| 743 | /*---------------------------------------------------------------------------- | |
| 744 | | Takes an abstract floating-point value having sign `zSign', exponent | |
| 745 | | `zExp', and significand formed by the concatenation of `zSig0' and `zSig1', | |
| 746 | | and returns the proper extended double-precision floating-point value | |
| 747 | | corresponding to the abstract input. This routine is just like | |
| 748 | | `roundAndPackFloatx80' except that the input significand does not have to be | |
| 749 | | normalized. | |
| 750 | *----------------------------------------------------------------------------*/ | |
| 751 | ||
| 752 | static floatx80 | |
| 753 | normalizeRoundAndPackFloatx80( | |
| 754 | int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 | |
| 755 | ) | |
| 756 | { | |
| 757 | int8 shiftCount; | |
| 758 | ||
| 759 | if ( zSig0 == 0 ) { | |
| 760 | zSig0 = zSig1; | |
| 761 | zSig1 = 0; | |
| 762 | zExp -= 64; | |
| 763 | } | |
| 764 | shiftCount = countLeadingZeros64( zSig0 ); | |
| 765 | shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); | |
| 766 | zExp -= shiftCount; | |
| 767 | return | |
| 768 | roundAndPackFloatx80( roundingPrecision, zSign, zExp, zSig0, zSig1 ); | |
| 769 | ||
| 770 | } | |
| 771 | ||
| 772 | #endif | |
| 773 | ||
| 774 | #ifdef FLOAT128 | |
| 775 | ||
| 776 | /*---------------------------------------------------------------------------- | |
| 777 | | Returns the least-significant 64 fraction bits of the quadruple-precision | |
| 778 | | floating-point value `a'. | |
| 779 | *----------------------------------------------------------------------------*/ | |
| 780 | ||
| 781 | INLINE bits64 extractFloat128Frac1( float128 a ) | |
| 782 | { | |
| 783 | ||
| 784 | return a.low; | |
| 785 | ||
| 786 | } | |
| 787 | ||
| 788 | /*---------------------------------------------------------------------------- | |
| 789 | | Returns the most-significant 48 fraction bits of the quadruple-precision | |
| 790 | | floating-point value `a'. | |
| 791 | *----------------------------------------------------------------------------*/ | |
| 792 | ||
| 793 | INLINE bits64 extractFloat128Frac0( float128 a ) | |
| 794 | { | |
| 795 | ||
| 796 | return a.high & LIT64( 0x0000FFFFFFFFFFFF ); | |
| 797 | ||
| 798 | } | |
| 799 | ||
| 800 | /*---------------------------------------------------------------------------- | |
| 801 | | Returns the exponent bits of the quadruple-precision floating-point value | |
| 802 | | `a'. | |
| 803 | *----------------------------------------------------------------------------*/ | |
| 804 | ||
| 805 | INLINE int32 extractFloat128Exp( float128 a ) | |
| 806 | { | |
| 807 | ||
| 808 | return ( a.high>>48 ) & 0x7FFF; | |
| 809 | ||
| 810 | } | |
| 811 | ||
| 812 | /*---------------------------------------------------------------------------- | |
| 813 | | Returns the sign bit of the quadruple-precision floating-point value `a'. | |
| 814 | *----------------------------------------------------------------------------*/ | |
| 815 | ||
| 816 | INLINE flag extractFloat128Sign( float128 a ) | |
| 817 | { | |
| 818 | ||
| 819 | return a.high>>63; | |
| 820 | ||
| 821 | } | |
| 822 | ||
| 823 | /*---------------------------------------------------------------------------- | |
| 824 | | Normalizes the subnormal quadruple-precision floating-point value | |
| 825 | | represented by the denormalized significand formed by the concatenation of | |
| 826 | | `aSig0' and `aSig1'. The normalized exponent is stored at the location | |
| 827 | | pointed to by `zExpPtr'. The most significant 49 bits of the normalized | |
| 828 | | significand are stored at the location pointed to by `zSig0Ptr', and the | |
| 829 | | least significant 64 bits of the normalized significand are stored at the | |
| 830 | | location pointed to by `zSig1Ptr'. | |
| 831 | *----------------------------------------------------------------------------*/ | |
| 832 | ||
| 833 | static void | |
| 834 | normalizeFloat128Subnormal( | |
| 835 | bits64 aSig0, | |
| 836 | bits64 aSig1, | |
| 837 | int32 *zExpPtr, | |
| 838 | bits64 *zSig0Ptr, | |
| 839 | bits64 *zSig1Ptr | |
| 840 | ) | |
| 841 | { | |
| 842 | int8 shiftCount; | |
| 843 | ||
| 844 | if ( aSig0 == 0 ) { | |
| 845 | shiftCount = countLeadingZeros64( aSig1 ) - 15; | |
| 846 | if ( shiftCount < 0 ) { | |
| 847 | *zSig0Ptr = aSig1>>( - shiftCount ); | |
| 848 | *zSig1Ptr = aSig1<<( shiftCount & 63 ); | |
| 849 | } | |
| 850 | else { | |
| 851 | *zSig0Ptr = aSig1<<shiftCount; | |
| 852 | *zSig1Ptr = 0; | |
| 853 | } | |
| 854 | *zExpPtr = - shiftCount - 63; | |
| 855 | } | |
| 856 | else { | |
| 857 | shiftCount = countLeadingZeros64( aSig0 ) - 15; | |
| 858 | shortShift128Left( aSig0, aSig1, shiftCount, zSig0Ptr, zSig1Ptr ); | |
| 859 | *zExpPtr = 1 - shiftCount; | |
| 860 | } | |
| 861 | ||
| 862 | } | |
| 863 | ||
| 864 | /*---------------------------------------------------------------------------- | |
| 865 | | Packs the sign `zSign', the exponent `zExp', and the significand formed | |
| 866 | | by the concatenation of `zSig0' and `zSig1' into a quadruple-precision | |
| 867 | | floating-point value, returning the result. After being shifted into the | |
| 868 | | proper positions, the three fields `zSign', `zExp', and `zSig0' are simply | |
| 869 | | added together to form the most significant 32 bits of the result. This | |
| 870 | | means that any integer portion of `zSig0' will be added into the exponent. | |
| 871 | | Since a properly normalized significand will have an integer portion equal | |
| 872 | | to 1, the `zExp' input should be 1 less than the desired result exponent | |
| 873 | | whenever `zSig0' and `zSig1' concatenated form a complete, normalized | |
| 874 | | significand. | |
| 875 | *----------------------------------------------------------------------------*/ | |
| 876 | ||
| 877 | INLINE float128 | |
| 878 | packFloat128( flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 ) | |
| 879 | { | |
| 880 | float128 z; | |
| 881 | ||
| 882 | z.low = zSig1; | |
| 883 | z.high = ( ( (bits64) zSign )<<63 ) + ( ( (bits64) zExp )<<48 ) + zSig0; | |
| 884 | return z; | |
| 885 | ||
| 886 | } | |
| 887 | ||
| 888 | /*---------------------------------------------------------------------------- | |
| 889 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 890 | | and extended significand formed by the concatenation of `zSig0', `zSig1', | |
| 891 | | and `zSig2', and returns the proper quadruple-precision floating-point value | |
| 892 | | corresponding to the abstract input. Ordinarily, the abstract value is | |
| 893 | | simply rounded and packed into the quadruple-precision format, with the | |
| 894 | | inexact exception raised if the abstract input cannot be represented | |
| 895 | | exactly. However, if the abstract value is too large, the overflow and | |
| 896 | | inexact exceptions are raised and an infinity or maximal finite value is | |
| 897 | | returned. If the abstract value is too small, the input value is rounded to | |
| 898 | | a subnormal number, and the underflow and inexact exceptions are raised if | |
| 899 | | the abstract input cannot be represented exactly as a subnormal quadruple- | |
| 900 | | precision floating-point number. | |
| 901 | | The input significand must be normalized or smaller. If the input | |
| 902 | | significand is not normalized, `zExp' must be 0; in that case, the result | |
| 903 | | returned is a subnormal number, and it must not require rounding. In the | |
| 904 | | usual case that the input significand is normalized, `zExp' must be 1 less | |
| 905 | | than the ``true'' floating-point exponent. The handling of underflow and | |
| 906 | | overflow follows the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 907 | *----------------------------------------------------------------------------*/ | |
| 908 | ||
| 909 | static float128 | |
| 910 | roundAndPackFloat128( | |
| 911 | flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1, bits64 zSig2 ) | |
| 912 | { | |
| 913 | int8 roundingMode; | |
| 914 | flag roundNearestEven, increment, isTiny; | |
| 915 | ||
| 916 | roundingMode = float_rounding_mode; | |
| 917 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | |
| 918 | increment = ( (sbits64) zSig2 < 0 ); | |
| 919 | if ( ! roundNearestEven ) { | |
| 920 | if ( roundingMode == float_round_to_zero ) { | |
| 921 | increment = 0; | |
| 922 | } | |
| 923 | else { | |
| 924 | if ( zSign ) { | |
| 925 | increment = ( roundingMode == float_round_down ) && zSig2; | |
| 926 | } | |
| 927 | else { | |
| 928 | increment = ( roundingMode == float_round_up ) && zSig2; | |
| 929 | } | |
| 930 | } | |
| 931 | } | |
| 932 | if ( 0x7FFD <= (bits32) zExp ) { | |
| 933 | if ( ( 0x7FFD < zExp ) | |
| 934 | || ( ( zExp == 0x7FFD ) | |
| 935 | && eq128( | |
| 936 | LIT64( 0x0001FFFFFFFFFFFF ), | |
| 937 | LIT64( 0xFFFFFFFFFFFFFFFF ), | |
| 938 | zSig0, | |
| 939 | zSig1 | |
| 940 | ) | |
| 941 | && increment | |
| 942 | ) | |
| 943 | ) { | |
| 944 | float_raise( float_flag_overflow | float_flag_inexact ); | |
| 945 | if ( ( roundingMode == float_round_to_zero ) | |
| 946 | || ( zSign && ( roundingMode == float_round_up ) ) | |
| 947 | || ( ! zSign && ( roundingMode == float_round_down ) ) | |
| 948 | ) { | |
| 949 | return | |
| 950 | packFloat128( | |
| 951 | zSign, | |
| 952 | 0x7FFE, | |
| 953 | LIT64( 0x0000FFFFFFFFFFFF ), | |
| 954 | LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 955 | ); | |
| 956 | } | |
| 957 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 958 | } | |
| 959 | if ( zExp < 0 ) { | |
| 960 | isTiny = | |
| 961 | ( float_detect_tininess == float_tininess_before_rounding ) | |
| 962 | || ( zExp < -1 ) | |
| 963 | || ! increment | |
| 964 | || lt128( | |
| 965 | zSig0, | |
| 966 | zSig1, | |
| 967 | LIT64( 0x0001FFFFFFFFFFFF ), | |
| 968 | LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 969 | ); | |
| 970 | shift128ExtraRightJamming( | |
| 971 | zSig0, zSig1, zSig2, - zExp, &zSig0, &zSig1, &zSig2 ); | |
| 972 | zExp = 0; | |
| 973 | if ( isTiny && zSig2 ) float_raise( float_flag_underflow ); | |
| 974 | if ( roundNearestEven ) { | |
| 975 | increment = ( (sbits64) zSig2 < 0 ); | |
| 976 | } | |
| 977 | else { | |
| 978 | if ( zSign ) { | |
| 979 | increment = ( roundingMode == float_round_down ) && zSig2; | |
| 980 | } | |
| 981 | else { | |
| 982 | increment = ( roundingMode == float_round_up ) && zSig2; | |
| 983 | } | |
| 984 | } | |
| 985 | } | |
| 986 | } | |
| 987 | if ( zSig2 ) float_exception_flags |= float_flag_inexact; | |
| 988 | if ( increment ) { | |
| 989 | add128( zSig0, zSig1, 0, 1, &zSig0, &zSig1 ); | |
| 990 | zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven ); | |
| 991 | } | |
| 992 | else { | |
| 993 | if ( ( zSig0 | zSig1 ) == 0 ) zExp = 0; | |
| 994 | } | |
| 995 | return packFloat128( zSign, zExp, zSig0, zSig1 ); | |
| 996 | ||
| 997 | } | |
| 998 | ||
| 999 | /*---------------------------------------------------------------------------- | |
| 1000 | | Takes an abstract floating-point value having sign `zSign', exponent `zExp', | |
| 1001 | | and significand formed by the concatenation of `zSig0' and `zSig1', and | |
| 1002 | | returns the proper quadruple-precision floating-point value corresponding | |
| 1003 | | to the abstract input. This routine is just like `roundAndPackFloat128' | |
| 1004 | | except that the input significand has fewer bits and does not have to be | |
| 1005 | | normalized. In all cases, `zExp' must be 1 less than the ``true'' floating- | |
| 1006 | | point exponent. | |
| 1007 | *----------------------------------------------------------------------------*/ | |
| 1008 | ||
| 1009 | static float128 | |
| 1010 | normalizeRoundAndPackFloat128( | |
| 1011 | flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 ) | |
| 1012 | { | |
| 1013 | int8 shiftCount; | |
| 1014 | bits64 zSig2; | |
| 1015 | ||
| 1016 | if ( zSig0 == 0 ) { | |
| 1017 | zSig0 = zSig1; | |
| 1018 | zSig1 = 0; | |
| 1019 | zExp -= 64; | |
| 1020 | } | |
| 1021 | shiftCount = countLeadingZeros64( zSig0 ) - 15; | |
| 1022 | if ( 0 <= shiftCount ) { | |
| 1023 | zSig2 = 0; | |
| 1024 | shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); | |
| 1025 | } | |
| 1026 | else { | |
| 1027 | shift128ExtraRightJamming( | |
| 1028 | zSig0, zSig1, 0, - shiftCount, &zSig0, &zSig1, &zSig2 ); | |
| 1029 | } | |
| 1030 | zExp -= shiftCount; | |
| 1031 | return roundAndPackFloat128( zSign, zExp, zSig0, zSig1, zSig2 ); | |
| 1032 | ||
| 1033 | } | |
| 1034 | ||
| 1035 | #endif | |
| 1036 | ||
| 1037 | /*---------------------------------------------------------------------------- | |
| 1038 | | Returns the result of converting the 32-bit two's complement integer `a' | |
| 1039 | | to the single-precision floating-point format. The conversion is performed | |
| 1040 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1041 | *----------------------------------------------------------------------------*/ | |
| 1042 | ||
| 1043 | float32 int32_to_float32( int32 a ) | |
| 1044 | { | |
| 1045 | flag zSign; | |
| 1046 | ||
| 1047 | if ( a == 0 ) return 0; | |
| 1048 | if ( a == (sbits32) 0x80000000 ) return packFloat32( 1, 0x9E, 0 ); | |
| 1049 | zSign = ( a < 0 ); | |
| 1050 | return normalizeRoundAndPackFloat32( zSign, 0x9C, zSign ? - a : a ); | |
| 1051 | ||
| 1052 | } | |
| 1053 | ||
| 1054 | /*---------------------------------------------------------------------------- | |
| 1055 | | Returns the result of converting the 32-bit two's complement integer `a' | |
| 1056 | | to the double-precision floating-point format. The conversion is performed | |
| 1057 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1058 | *----------------------------------------------------------------------------*/ | |
| 1059 | ||
| 1060 | float64 int32_to_float64( int32 a ) | |
| 1061 | { | |
| 1062 | flag zSign; | |
| 1063 | uint32 absA; | |
| 1064 | int8 shiftCount; | |
| 1065 | bits64 zSig; | |
| 1066 | ||
| 1067 | if ( a == 0 ) return 0; | |
| 1068 | zSign = ( a < 0 ); | |
| 1069 | absA = zSign ? - a : a; | |
| 1070 | shiftCount = countLeadingZeros32( absA ) + 21; | |
| 1071 | zSig = absA; | |
| 1072 | return packFloat64( zSign, 0x432 - shiftCount, zSig<<shiftCount ); | |
| 1073 | ||
| 1074 | } | |
| 1075 | ||
| 1076 | #ifdef FLOATX80 | |
| 1077 | ||
| 1078 | /*---------------------------------------------------------------------------- | |
| 1079 | | Returns the result of converting the 32-bit two's complement integer `a' | |
| 1080 | | to the extended double-precision floating-point format. The conversion | |
| 1081 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1082 | | Arithmetic. | |
| 1083 | *----------------------------------------------------------------------------*/ | |
| 1084 | ||
| 1085 | floatx80 int32_to_floatx80( int32 a ) | |
| 1086 | { | |
| 1087 | flag zSign; | |
| 1088 | uint32 absA; | |
| 1089 | int8 shiftCount; | |
| 1090 | bits64 zSig; | |
| 1091 | ||
| 1092 | if ( a == 0 ) return packFloatx80( 0, 0, 0 ); | |
| 1093 | zSign = ( a < 0 ); | |
| 1094 | absA = zSign ? - a : a; | |
| 1095 | shiftCount = countLeadingZeros32( absA ) + 32; | |
| 1096 | zSig = absA; | |
| 1097 | return packFloatx80( zSign, 0x403E - shiftCount, zSig<<shiftCount ); | |
| 1098 | ||
| 1099 | } | |
| 1100 | ||
| 1101 | #endif | |
| 1102 | ||
| 1103 | #ifdef FLOAT128 | |
| 1104 | ||
| 1105 | /*---------------------------------------------------------------------------- | |
| 1106 | | Returns the result of converting the 32-bit two's complement integer `a' to | |
| 1107 | | the quadruple-precision floating-point format. The conversion is performed | |
| 1108 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1109 | *----------------------------------------------------------------------------*/ | |
| 1110 | ||
| 1111 | float128 int32_to_float128( int32 a ) | |
| 1112 | { | |
| 1113 | flag zSign; | |
| 1114 | uint32 absA; | |
| 1115 | int8 shiftCount; | |
| 1116 | bits64 zSig0; | |
| 1117 | ||
| 1118 | if ( a == 0 ) return packFloat128( 0, 0, 0, 0 ); | |
| 1119 | zSign = ( a < 0 ); | |
| 1120 | absA = zSign ? - a : a; | |
| 1121 | shiftCount = countLeadingZeros32( absA ) + 17; | |
| 1122 | zSig0 = absA; | |
| 1123 | return packFloat128( zSign, 0x402E - shiftCount, zSig0<<shiftCount, 0 ); | |
| 1124 | ||
| 1125 | } | |
| 1126 | ||
| 1127 | #endif | |
| 1128 | ||
| 1129 | /*---------------------------------------------------------------------------- | |
| 1130 | | Returns the result of converting the 64-bit two's complement integer `a' | |
| 1131 | | to the single-precision floating-point format. The conversion is performed | |
| 1132 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1133 | *----------------------------------------------------------------------------*/ | |
| 1134 | ||
| 1135 | float32 int64_to_float32( int64 a ) | |
| 1136 | { | |
| 1137 | flag zSign; | |
| 1138 | uint64 absA; | |
| 1139 | int8 shiftCount; | |
| 1140 | // bits32 zSig; | |
| 1141 | ||
| 1142 | if ( a == 0 ) return 0; | |
| 1143 | zSign = ( a < 0 ); | |
| 1144 | absA = zSign ? - a : a; | |
| 1145 | shiftCount = countLeadingZeros64( absA ) - 40; | |
| 1146 | if ( 0 <= shiftCount ) { | |
| 1147 | return packFloat32( zSign, 0x95 - shiftCount, absA<<shiftCount ); | |
| 1148 | } | |
| 1149 | else { | |
| 1150 | shiftCount += 7; | |
| 1151 | if ( shiftCount < 0 ) { | |
| 1152 | shift64RightJamming( absA, - shiftCount, &absA ); | |
| 1153 | } | |
| 1154 | else { | |
| 1155 | absA <<= shiftCount; | |
| 1156 | } | |
| 1157 | return roundAndPackFloat32( zSign, 0x9C - shiftCount, absA ); | |
| 1158 | } | |
| 1159 | ||
| 1160 | } | |
| 1161 | ||
| 1162 | /*---------------------------------------------------------------------------- | |
| 1163 | | Returns the result of converting the 64-bit two's complement integer `a' | |
| 1164 | | to the double-precision floating-point format. The conversion is performed | |
| 1165 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1166 | *----------------------------------------------------------------------------*/ | |
| 1167 | ||
| 1168 | float64 int64_to_float64( int64 a ) | |
| 1169 | { | |
| 1170 | flag zSign; | |
| 1171 | ||
| 1172 | if ( a == 0 ) return 0; | |
| 1173 | if ( a == (sbits64) LIT64( 0x8000000000000000 ) ) { | |
| 1174 | return packFloat64( 1, 0x43E, 0 ); | |
| 1175 | } | |
| 1176 | zSign = ( a < 0 ); | |
| 1177 | return normalizeRoundAndPackFloat64( zSign, 0x43C, zSign ? - a : a ); | |
| 1178 | ||
| 1179 | } | |
| 1180 | ||
| 1181 | #ifdef FLOATX80 | |
| 1182 | ||
| 1183 | /*---------------------------------------------------------------------------- | |
| 1184 | | Returns the result of converting the 64-bit two's complement integer `a' | |
| 1185 | | to the extended double-precision floating-point format. The conversion | |
| 1186 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1187 | | Arithmetic. | |
| 1188 | *----------------------------------------------------------------------------*/ | |
| 1189 | ||
| 1190 | floatx80 int64_to_floatx80( int64 a ) | |
| 1191 | { | |
| 1192 | flag zSign; | |
| 1193 | uint64 absA; | |
| 1194 | int8 shiftCount; | |
| 1195 | ||
| 1196 | if ( a == 0 ) return packFloatx80( 0, 0, 0 ); | |
| 1197 | zSign = ( a < 0 ); | |
| 1198 | absA = zSign ? - a : a; | |
| 1199 | shiftCount = countLeadingZeros64( absA ); | |
| 1200 | return packFloatx80( zSign, 0x403E - shiftCount, absA<<shiftCount ); | |
| 1201 | ||
| 1202 | } | |
| 1203 | ||
| 1204 | #endif | |
| 1205 | ||
| 1206 | #ifdef FLOAT128 | |
| 1207 | ||
| 1208 | /*---------------------------------------------------------------------------- | |
| 1209 | | Returns the result of converting the 64-bit two's complement integer `a' to | |
| 1210 | | the quadruple-precision floating-point format. The conversion is performed | |
| 1211 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1212 | *----------------------------------------------------------------------------*/ | |
| 1213 | ||
| 1214 | float128 int64_to_float128( int64 a ) | |
| 1215 | { | |
| 1216 | flag zSign; | |
| 1217 | uint64 absA; | |
| 1218 | int8 shiftCount; | |
| 1219 | int32 zExp; | |
| 1220 | bits64 zSig0, zSig1; | |
| 1221 | ||
| 1222 | if ( a == 0 ) return packFloat128( 0, 0, 0, 0 ); | |
| 1223 | zSign = ( a < 0 ); | |
| 1224 | absA = zSign ? - a : a; | |
| 1225 | shiftCount = countLeadingZeros64( absA ) + 49; | |
| 1226 | zExp = 0x406E - shiftCount; | |
| 1227 | if ( 64 <= shiftCount ) { | |
| 1228 | zSig1 = 0; | |
| 1229 | zSig0 = absA; | |
| 1230 | shiftCount -= 64; | |
| 1231 | } | |
| 1232 | else { | |
| 1233 | zSig1 = absA; | |
| 1234 | zSig0 = 0; | |
| 1235 | } | |
| 1236 | shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); | |
| 1237 | return packFloat128( zSign, zExp, zSig0, zSig1 ); | |
| 1238 | ||
| 1239 | } | |
| 1240 | ||
| 1241 | #endif | |
| 1242 | ||
| 1243 | /*---------------------------------------------------------------------------- | |
| 1244 | | Returns the result of converting the single-precision floating-point value | |
| 1245 | | `a' to the 32-bit two's complement integer format. The conversion is | |
| 1246 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1247 | | Arithmetic---which means in particular that the conversion is rounded | |
| 1248 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 1249 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 1250 | | largest integer with the same sign as `a' is returned. | |
| 1251 | *----------------------------------------------------------------------------*/ | |
| 1252 | ||
| 1253 | int32 float32_to_int32( float32 a ) | |
| 1254 | { | |
| 1255 | flag aSign; | |
| 1256 | int16 aExp, shiftCount; | |
| 1257 | bits32 aSig; | |
| 1258 | bits64 aSig64; | |
| 1259 | ||
| 1260 | aSig = extractFloat32Frac( a ); | |
| 1261 | aExp = extractFloat32Exp( a ); | |
| 1262 | aSign = extractFloat32Sign( a ); | |
| 1263 | if ( ( aExp == 0xFF ) && aSig ) aSign = 0; | |
| 1264 | if ( aExp ) aSig |= 0x00800000; | |
| 1265 | shiftCount = 0xAF - aExp; | |
| 1266 | aSig64 = aSig; | |
| 1267 | aSig64 <<= 32; | |
| 1268 | if ( 0 < shiftCount ) shift64RightJamming( aSig64, shiftCount, &aSig64 ); | |
| 1269 | return roundAndPackInt32( aSign, aSig64 ); | |
| 1270 | ||
| 1271 | } | |
| 1272 | ||
| 1273 | /*---------------------------------------------------------------------------- | |
| 1274 | | Returns the result of converting the single-precision floating-point value | |
| 1275 | | `a' to the 32-bit two's complement integer format. The conversion is | |
| 1276 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1277 | | Arithmetic, except that the conversion is always rounded toward zero. | |
| 1278 | | If `a' is a NaN, the largest positive integer is returned. Otherwise, if | |
| 1279 | | the conversion overflows, the largest integer with the same sign as `a' is | |
| 1280 | | returned. | |
| 1281 | *----------------------------------------------------------------------------*/ | |
| 1282 | ||
| 1283 | int32 float32_to_int32_round_to_zero( float32 a ) | |
| 1284 | { | |
| 1285 | flag aSign; | |
| 1286 | int16 aExp, shiftCount; | |
| 1287 | bits32 aSig; | |
| 1288 | int32 z; | |
| 1289 | ||
| 1290 | aSig = extractFloat32Frac( a ); | |
| 1291 | aExp = extractFloat32Exp( a ); | |
| 1292 | aSign = extractFloat32Sign( a ); | |
| 1293 | shiftCount = aExp - 0x9E; | |
| 1294 | if ( 0 <= shiftCount ) { | |
| 1295 | if ( a != 0xCF000000 ) { | |
| 1296 | float_raise( float_flag_invalid ); | |
| 1297 | if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) return 0x7FFFFFFF; | |
| 1298 | } | |
| 1299 | return (sbits32) 0x80000000; | |
| 1300 | } | |
| 1301 | else if ( aExp <= 0x7E ) { | |
| 1302 | if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; | |
| 1303 | return 0; | |
| 1304 | } | |
| 1305 | aSig = ( aSig | 0x00800000 )<<8; | |
| 1306 | z = aSig>>( - shiftCount ); | |
| 1307 | if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) { | |
| 1308 | float_exception_flags |= float_flag_inexact; | |
| 1309 | } | |
| 1310 | if ( aSign ) z = - z; | |
| 1311 | return z; | |
| 1312 | ||
| 1313 | } | |
| 1314 | ||
| 1315 | /*---------------------------------------------------------------------------- | |
| 1316 | | Returns the result of converting the single-precision floating-point value | |
| 1317 | | `a' to the 64-bit two's complement integer format. The conversion is | |
| 1318 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1319 | | Arithmetic---which means in particular that the conversion is rounded | |
| 1320 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 1321 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 1322 | | largest integer with the same sign as `a' is returned. | |
| 1323 | *----------------------------------------------------------------------------*/ | |
| 1324 | ||
| 1325 | int64 float32_to_int64( float32 a ) | |
| 1326 | { | |
| 1327 | flag aSign; | |
| 1328 | int16 aExp, shiftCount; | |
| 1329 | bits32 aSig; | |
| 1330 | bits64 aSig64, aSigExtra; | |
| 1331 | ||
| 1332 | aSig = extractFloat32Frac( a ); | |
| 1333 | aExp = extractFloat32Exp( a ); | |
| 1334 | aSign = extractFloat32Sign( a ); | |
| 1335 | shiftCount = 0xBE - aExp; | |
| 1336 | if ( shiftCount < 0 ) { | |
| 1337 | float_raise( float_flag_invalid ); | |
| 1338 | if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) { | |
| 1339 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 1340 | } | |
| 1341 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 1342 | } | |
| 1343 | if ( aExp ) aSig |= 0x00800000; | |
| 1344 | aSig64 = aSig; | |
| 1345 | aSig64 <<= 40; | |
| 1346 | shift64ExtraRightJamming( aSig64, 0, shiftCount, &aSig64, &aSigExtra ); | |
| 1347 | return roundAndPackInt64( aSign, aSig64, aSigExtra ); | |
| 1348 | ||
| 1349 | } | |
| 1350 | ||
| 1351 | /*---------------------------------------------------------------------------- | |
| 1352 | | Returns the result of converting the single-precision floating-point value | |
| 1353 | | `a' to the 64-bit two's complement integer format. The conversion is | |
| 1354 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1355 | | Arithmetic, except that the conversion is always rounded toward zero. If | |
| 1356 | | `a' is a NaN, the largest positive integer is returned. Otherwise, if the | |
| 1357 | | conversion overflows, the largest integer with the same sign as `a' is | |
| 1358 | | returned. | |
| 1359 | *----------------------------------------------------------------------------*/ | |
| 1360 | ||
| 1361 | int64 float32_to_int64_round_to_zero( float32 a ) | |
| 1362 | { | |
| 1363 | flag aSign; | |
| 1364 | int16 aExp, shiftCount; | |
| 1365 | bits32 aSig; | |
| 1366 | bits64 aSig64; | |
| 1367 | int64 z; | |
| 1368 | ||
| 1369 | aSig = extractFloat32Frac( a ); | |
| 1370 | aExp = extractFloat32Exp( a ); | |
| 1371 | aSign = extractFloat32Sign( a ); | |
| 1372 | shiftCount = aExp - 0xBE; | |
| 1373 | if ( 0 <= shiftCount ) { | |
| 1374 | if ( a != 0xDF000000 ) { | |
| 1375 | float_raise( float_flag_invalid ); | |
| 1376 | if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) { | |
| 1377 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 1378 | } | |
| 1379 | } | |
| 1380 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 1381 | } | |
| 1382 | else if ( aExp <= 0x7E ) { | |
| 1383 | if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; | |
| 1384 | return 0; | |
| 1385 | } | |
| 1386 | aSig64 = aSig | 0x00800000; | |
| 1387 | aSig64 <<= 40; | |
| 1388 | z = aSig64>>( - shiftCount ); | |
| 1389 | if ( (bits64) ( aSig64<<( shiftCount & 63 ) ) ) { | |
| 1390 | float_exception_flags |= float_flag_inexact; | |
| 1391 | } | |
| 1392 | if ( aSign ) z = - z; | |
| 1393 | return z; | |
| 1394 | ||
| 1395 | } | |
| 1396 | ||
| 1397 | /*---------------------------------------------------------------------------- | |
| 1398 | | Returns the result of converting the single-precision floating-point value | |
| 1399 | | `a' to the double-precision floating-point format. The conversion is | |
| 1400 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1401 | | Arithmetic. | |
| 1402 | *----------------------------------------------------------------------------*/ | |
| 1403 | ||
| 1404 | float64 float32_to_float64( float32 a ) | |
| 1405 | { | |
| 1406 | flag aSign; | |
| 1407 | int16 aExp; | |
| 1408 | bits32 aSig; | |
| 1409 | ||
| 1410 | aSig = extractFloat32Frac( a ); | |
| 1411 | aExp = extractFloat32Exp( a ); | |
| 1412 | aSign = extractFloat32Sign( a ); | |
| 1413 | if ( aExp == 0xFF ) { | |
| 1414 | if ( aSig ) return commonNaNToFloat64( float32ToCommonNaN( a ) ); | |
| 1415 | return packFloat64( aSign, 0x7FF, 0 ); | |
| 1416 | } | |
| 1417 | if ( aExp == 0 ) { | |
| 1418 | if ( aSig == 0 ) return packFloat64( aSign, 0, 0 ); | |
| 1419 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1420 | --aExp; | |
| 1421 | } | |
| 1422 | return packFloat64( aSign, aExp + 0x380, ( (bits64) aSig )<<29 ); | |
| 1423 | ||
| 1424 | } | |
| 1425 | ||
| 1426 | #ifdef FLOATX80 | |
| 1427 | ||
| 1428 | /*---------------------------------------------------------------------------- | |
| 1429 | | Returns the result of converting the single-precision floating-point value | |
| 1430 | | `a' to the extended double-precision floating-point format. The conversion | |
| 1431 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1432 | | Arithmetic. | |
| 1433 | *----------------------------------------------------------------------------*/ | |
| 1434 | ||
| 1435 | floatx80 float32_to_floatx80( float32 a ) | |
| 1436 | { | |
| 1437 | flag aSign; | |
| 1438 | int16 aExp; | |
| 1439 | bits32 aSig; | |
| 1440 | ||
| 1441 | aSig = extractFloat32Frac( a ); | |
| 1442 | aExp = extractFloat32Exp( a ); | |
| 1443 | aSign = extractFloat32Sign( a ); | |
| 1444 | if ( aExp == 0xFF ) { | |
| 1445 | if ( aSig ) return commonNaNToFloatx80( float32ToCommonNaN( a ) ); | |
| 1446 | return packFloatx80( aSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 1447 | } | |
| 1448 | if ( aExp == 0 ) { | |
| 1449 | if ( aSig == 0 ) return packFloatx80( aSign, 0, 0 ); | |
| 1450 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1451 | } | |
| 1452 | aSig |= 0x00800000; | |
| 1453 | return packFloatx80( aSign, aExp + 0x3F80, ( (bits64) aSig )<<40 ); | |
| 1454 | ||
| 1455 | } | |
| 1456 | ||
| 1457 | #endif | |
| 1458 | ||
| 1459 | #ifdef FLOAT128 | |
| 1460 | ||
| 1461 | /*---------------------------------------------------------------------------- | |
| 1462 | | Returns the result of converting the single-precision floating-point value | |
| 1463 | | `a' to the double-precision floating-point format. The conversion is | |
| 1464 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 1465 | | Arithmetic. | |
| 1466 | *----------------------------------------------------------------------------*/ | |
| 1467 | ||
| 1468 | float128 float32_to_float128( float32 a ) | |
| 1469 | { | |
| 1470 | flag aSign; | |
| 1471 | int16 aExp; | |
| 1472 | bits32 aSig; | |
| 1473 | ||
| 1474 | aSig = extractFloat32Frac( a ); | |
| 1475 | aExp = extractFloat32Exp( a ); | |
| 1476 | aSign = extractFloat32Sign( a ); | |
| 1477 | if ( aExp == 0xFF ) { | |
| 1478 | if ( aSig ) return commonNaNToFloat128( float32ToCommonNaN( a ) ); | |
| 1479 | return packFloat128( aSign, 0x7FFF, 0, 0 ); | |
| 1480 | } | |
| 1481 | if ( aExp == 0 ) { | |
| 1482 | if ( aSig == 0 ) return packFloat128( aSign, 0, 0, 0 ); | |
| 1483 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1484 | --aExp; | |
| 1485 | } | |
| 1486 | return packFloat128( aSign, aExp + 0x3F80, ( (bits64) aSig )<<25, 0 ); | |
| 1487 | ||
| 1488 | } | |
| 1489 | ||
| 1490 | #endif | |
| 1491 | ||
| 1492 | /*---------------------------------------------------------------------------- | |
| 1493 | | Rounds the single-precision floating-point value `a' to an integer, and | |
| 1494 | | returns the result as a single-precision floating-point value. The | |
| 1495 | | operation is performed according to the IEC/IEEE Standard for Binary | |
| 1496 | | Floating-Point Arithmetic. | |
| 1497 | *----------------------------------------------------------------------------*/ | |
| 1498 | ||
| 1499 | float32 float32_round_to_int( float32 a ) | |
| 1500 | { | |
| 1501 | flag aSign; | |
| 1502 | int16 aExp; | |
| 1503 | bits32 lastBitMask, roundBitsMask; | |
| 1504 | int8 roundingMode; | |
| 1505 | float32 z; | |
| 1506 | ||
| 1507 | aExp = extractFloat32Exp( a ); | |
| 1508 | if ( 0x96 <= aExp ) { | |
| 1509 | if ( ( aExp == 0xFF ) && extractFloat32Frac( a ) ) { | |
| 1510 | return propagateFloat32NaN( a, a ); | |
| 1511 | } | |
| 1512 | return a; | |
| 1513 | } | |
| 1514 | if ( aExp <= 0x7E ) { | |
| 1515 | if ( (bits32) ( a<<1 ) == 0 ) return a; | |
| 1516 | float_exception_flags |= float_flag_inexact; | |
| 1517 | aSign = extractFloat32Sign( a ); | |
| 1518 | switch ( float_rounding_mode ) { | |
| 1519 | case float_round_nearest_even: | |
| 1520 | if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) { | |
| 1521 | return packFloat32( aSign, 0x7F, 0 ); | |
| 1522 | } | |
| 1523 | break; | |
| 1524 | case float_round_down: | |
| 1525 | return aSign ? 0xBF800000 : 0; | |
| 1526 | case float_round_up: | |
| 1527 | return aSign ? 0x80000000 : 0x3F800000; | |
| 1528 | } | |
| 1529 | return packFloat32( aSign, 0, 0 ); | |
| 1530 | } | |
| 1531 | lastBitMask = 1; | |
| 1532 | lastBitMask <<= 0x96 - aExp; | |
| 1533 | roundBitsMask = lastBitMask - 1; | |
| 1534 | z = a; | |
| 1535 | roundingMode = float_rounding_mode; | |
| 1536 | if ( roundingMode == float_round_nearest_even ) { | |
| 1537 | z += lastBitMask>>1; | |
| 1538 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; | |
| 1539 | } | |
| 1540 | else if ( roundingMode != float_round_to_zero ) { | |
| 1541 | if ( extractFloat32Sign( z ) ^ ( roundingMode == float_round_up ) ) { | |
| 1542 | z += roundBitsMask; | |
| 1543 | } | |
| 1544 | } | |
| 1545 | z &= ~ roundBitsMask; | |
| 1546 | if ( z != a ) float_exception_flags |= float_flag_inexact; | |
| 1547 | return z; | |
| 1548 | ||
| 1549 | } | |
| 1550 | ||
| 1551 | /*---------------------------------------------------------------------------- | |
| 1552 | | Returns the result of adding the absolute values of the single-precision | |
| 1553 | | floating-point values `a' and `b'. If `zSign' is 1, the sum is negated | |
| 1554 | | before being returned. `zSign' is ignored if the result is a NaN. | |
| 1555 | | The addition is performed according to the IEC/IEEE Standard for Binary | |
| 1556 | | Floating-Point Arithmetic. | |
| 1557 | *----------------------------------------------------------------------------*/ | |
| 1558 | ||
| 1559 | static float32 addFloat32Sigs( float32 a, float32 b, flag zSign ) | |
| 1560 | { | |
| 1561 | int16 aExp, bExp, zExp; | |
| 1562 | bits32 aSig, bSig, zSig; | |
| 1563 | int16 expDiff; | |
| 1564 | ||
| 1565 | aSig = extractFloat32Frac( a ); | |
| 1566 | aExp = extractFloat32Exp( a ); | |
| 1567 | bSig = extractFloat32Frac( b ); | |
| 1568 | bExp = extractFloat32Exp( b ); | |
| 1569 | expDiff = aExp - bExp; | |
| 1570 | aSig <<= 6; | |
| 1571 | bSig <<= 6; | |
| 1572 | if ( 0 < expDiff ) { | |
| 1573 | if ( aExp == 0xFF ) { | |
| 1574 | if ( aSig ) return propagateFloat32NaN( a, b ); | |
| 1575 | return a; | |
| 1576 | } | |
| 1577 | if ( bExp == 0 ) { | |
| 1578 | --expDiff; | |
| 1579 | } | |
| 1580 | else { | |
| 1581 | bSig |= 0x20000000; | |
| 1582 | } | |
| 1583 | shift32RightJamming( bSig, expDiff, &bSig ); | |
| 1584 | zExp = aExp; | |
| 1585 | } | |
| 1586 | else if ( expDiff < 0 ) { | |
| 1587 | if ( bExp == 0xFF ) { | |
| 1588 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1589 | return packFloat32( zSign, 0xFF, 0 ); | |
| 1590 | } | |
| 1591 | if ( aExp == 0 ) { | |
| 1592 | ++expDiff; | |
| 1593 | } | |
| 1594 | else { | |
| 1595 | aSig |= 0x20000000; | |
| 1596 | } | |
| 1597 | shift32RightJamming( aSig, - expDiff, &aSig ); | |
| 1598 | zExp = bExp; | |
| 1599 | } | |
| 1600 | else { | |
| 1601 | if ( aExp == 0xFF ) { | |
| 1602 | if ( aSig | bSig ) return propagateFloat32NaN( a, b ); | |
| 1603 | return a; | |
| 1604 | } | |
| 1605 | if ( aExp == 0 ) return packFloat32( zSign, 0, ( aSig + bSig )>>6 ); | |
| 1606 | zSig = 0x40000000 + aSig + bSig; | |
| 1607 | zExp = aExp; | |
| 1608 | goto roundAndPack; | |
| 1609 | } | |
| 1610 | aSig |= 0x20000000; | |
| 1611 | zSig = ( aSig + bSig )<<1; | |
| 1612 | --zExp; | |
| 1613 | if ( (sbits32) zSig < 0 ) { | |
| 1614 | zSig = aSig + bSig; | |
| 1615 | ++zExp; | |
| 1616 | } | |
| 1617 | roundAndPack: | |
| 1618 | return roundAndPackFloat32( zSign, zExp, zSig ); | |
| 1619 | ||
| 1620 | } | |
| 1621 | ||
| 1622 | /*---------------------------------------------------------------------------- | |
| 1623 | | Returns the result of subtracting the absolute values of the single- | |
| 1624 | | precision floating-point values `a' and `b'. If `zSign' is 1, the | |
| 1625 | | difference is negated before being returned. `zSign' is ignored if the | |
| 1626 | | result is a NaN. The subtraction is performed according to the IEC/IEEE | |
| 1627 | | Standard for Binary Floating-Point Arithmetic. | |
| 1628 | *----------------------------------------------------------------------------*/ | |
| 1629 | ||
| 1630 | static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) | |
| 1631 | { | |
| 1632 | int16 aExp, bExp, zExp; | |
| 1633 | bits32 aSig, bSig, zSig; | |
| 1634 | int16 expDiff; | |
| 1635 | ||
| 1636 | aSig = extractFloat32Frac( a ); | |
| 1637 | aExp = extractFloat32Exp( a ); | |
| 1638 | bSig = extractFloat32Frac( b ); | |
| 1639 | bExp = extractFloat32Exp( b ); | |
| 1640 | expDiff = aExp - bExp; | |
| 1641 | aSig <<= 7; | |
| 1642 | bSig <<= 7; | |
| 1643 | if ( 0 < expDiff ) goto aExpBigger; | |
| 1644 | if ( expDiff < 0 ) goto bExpBigger; | |
| 1645 | if ( aExp == 0xFF ) { | |
| 1646 | if ( aSig | bSig ) return propagateFloat32NaN( a, b ); | |
| 1647 | float_raise( float_flag_invalid ); | |
| 1648 | return float32_default_nan; | |
| 1649 | } | |
| 1650 | if ( aExp == 0 ) { | |
| 1651 | aExp = 1; | |
| 1652 | bExp = 1; | |
| 1653 | } | |
| 1654 | if ( bSig < aSig ) goto aBigger; | |
| 1655 | if ( aSig < bSig ) goto bBigger; | |
| 1656 | return packFloat32( float_rounding_mode == float_round_down, 0, 0 ); | |
| 1657 | bExpBigger: | |
| 1658 | if ( bExp == 0xFF ) { | |
| 1659 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1660 | return packFloat32( zSign ^ 1, 0xFF, 0 ); | |
| 1661 | } | |
| 1662 | if ( aExp == 0 ) { | |
| 1663 | ++expDiff; | |
| 1664 | } | |
| 1665 | else { | |
| 1666 | aSig |= 0x40000000; | |
| 1667 | } | |
| 1668 | shift32RightJamming( aSig, - expDiff, &aSig ); | |
| 1669 | bSig |= 0x40000000; | |
| 1670 | bBigger: | |
| 1671 | zSig = bSig - aSig; | |
| 1672 | zExp = bExp; | |
| 1673 | zSign ^= 1; | |
| 1674 | goto normalizeRoundAndPack; | |
| 1675 | aExpBigger: | |
| 1676 | if ( aExp == 0xFF ) { | |
| 1677 | if ( aSig ) return propagateFloat32NaN( a, b ); | |
| 1678 | return a; | |
| 1679 | } | |
| 1680 | if ( bExp == 0 ) { | |
| 1681 | --expDiff; | |
| 1682 | } | |
| 1683 | else { | |
| 1684 | bSig |= 0x40000000; | |
| 1685 | } | |
| 1686 | shift32RightJamming( bSig, expDiff, &bSig ); | |
| 1687 | aSig |= 0x40000000; | |
| 1688 | aBigger: | |
| 1689 | zSig = aSig - bSig; | |
| 1690 | zExp = aExp; | |
| 1691 | normalizeRoundAndPack: | |
| 1692 | --zExp; | |
| 1693 | return normalizeRoundAndPackFloat32( zSign, zExp, zSig ); | |
| 1694 | ||
| 1695 | } | |
| 1696 | ||
| 1697 | /*---------------------------------------------------------------------------- | |
| 1698 | | Returns the result of adding the single-precision floating-point values `a' | |
| 1699 | | and `b'. The operation is performed according to the IEC/IEEE Standard for | |
| 1700 | | Binary Floating-Point Arithmetic. | |
| 1701 | *----------------------------------------------------------------------------*/ | |
| 1702 | ||
| 1703 | float32 float32_add( float32 a, float32 b ) | |
| 1704 | { | |
| 1705 | flag aSign, bSign; | |
| 1706 | ||
| 1707 | aSign = extractFloat32Sign( a ); | |
| 1708 | bSign = extractFloat32Sign( b ); | |
| 1709 | if ( aSign == bSign ) { | |
| 1710 | return addFloat32Sigs( a, b, aSign ); | |
| 1711 | } | |
| 1712 | else { | |
| 1713 | return subFloat32Sigs( a, b, aSign ); | |
| 1714 | } | |
| 1715 | ||
| 1716 | } | |
| 1717 | ||
| 1718 | /*---------------------------------------------------------------------------- | |
| 1719 | | Returns the result of subtracting the single-precision floating-point values | |
| 1720 | | `a' and `b'. The operation is performed according to the IEC/IEEE Standard | |
| 1721 | | for Binary Floating-Point Arithmetic. | |
| 1722 | *----------------------------------------------------------------------------*/ | |
| 1723 | ||
| 1724 | float32 float32_sub( float32 a, float32 b ) | |
| 1725 | { | |
| 1726 | flag aSign, bSign; | |
| 1727 | ||
| 1728 | aSign = extractFloat32Sign( a ); | |
| 1729 | bSign = extractFloat32Sign( b ); | |
| 1730 | if ( aSign == bSign ) { | |
| 1731 | return subFloat32Sigs( a, b, aSign ); | |
| 1732 | } | |
| 1733 | else { | |
| 1734 | return addFloat32Sigs( a, b, aSign ); | |
| 1735 | } | |
| 1736 | ||
| 1737 | } | |
| 1738 | ||
| 1739 | /*---------------------------------------------------------------------------- | |
| 1740 | | Returns the result of multiplying the single-precision floating-point values | |
| 1741 | | `a' and `b'. The operation is performed according to the IEC/IEEE Standard | |
| 1742 | | for Binary Floating-Point Arithmetic. | |
| 1743 | *----------------------------------------------------------------------------*/ | |
| 1744 | ||
| 1745 | float32 float32_mul( float32 a, float32 b ) | |
| 1746 | { | |
| 1747 | flag aSign, bSign, zSign; | |
| 1748 | int16 aExp, bExp, zExp; | |
| 1749 | bits32 aSig, bSig; | |
| 1750 | bits64 zSig64; | |
| 1751 | bits32 zSig; | |
| 1752 | ||
| 1753 | aSig = extractFloat32Frac( a ); | |
| 1754 | aExp = extractFloat32Exp( a ); | |
| 1755 | aSign = extractFloat32Sign( a ); | |
| 1756 | bSig = extractFloat32Frac( b ); | |
| 1757 | bExp = extractFloat32Exp( b ); | |
| 1758 | bSign = extractFloat32Sign( b ); | |
| 1759 | zSign = aSign ^ bSign; | |
| 1760 | if ( aExp == 0xFF ) { | |
| 1761 | if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { | |
| 1762 | return propagateFloat32NaN( a, b ); | |
| 1763 | } | |
| 1764 | if ( ( bExp | bSig ) == 0 ) { | |
| 1765 | float_raise( float_flag_invalid ); | |
| 1766 | return float32_default_nan; | |
| 1767 | } | |
| 1768 | return packFloat32( zSign, 0xFF, 0 ); | |
| 1769 | } | |
| 1770 | if ( bExp == 0xFF ) { | |
| 1771 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1772 | if ( ( aExp | aSig ) == 0 ) { | |
| 1773 | float_raise( float_flag_invalid ); | |
| 1774 | return float32_default_nan; | |
| 1775 | } | |
| 1776 | return packFloat32( zSign, 0xFF, 0 ); | |
| 1777 | } | |
| 1778 | if ( aExp == 0 ) { | |
| 1779 | if ( aSig == 0 ) return packFloat32( zSign, 0, 0 ); | |
| 1780 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1781 | } | |
| 1782 | if ( bExp == 0 ) { | |
| 1783 | if ( bSig == 0 ) return packFloat32( zSign, 0, 0 ); | |
| 1784 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); | |
| 1785 | } | |
| 1786 | zExp = aExp + bExp - 0x7F; | |
| 1787 | aSig = ( aSig | 0x00800000 )<<7; | |
| 1788 | bSig = ( bSig | 0x00800000 )<<8; | |
| 1789 | shift64RightJamming( ( (bits64) aSig ) * bSig, 32, &zSig64 ); | |
| 1790 | zSig = zSig64; | |
| 1791 | if ( 0 <= (sbits32) ( zSig<<1 ) ) { | |
| 1792 | zSig <<= 1; | |
| 1793 | --zExp; | |
| 1794 | } | |
| 1795 | return roundAndPackFloat32( zSign, zExp, zSig ); | |
| 1796 | ||
| 1797 | } | |
| 1798 | ||
| 1799 | /*---------------------------------------------------------------------------- | |
| 1800 | | Returns the result of dividing the single-precision floating-point value `a' | |
| 1801 | | by the corresponding value `b'. The operation is performed according to the | |
| 1802 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1803 | *----------------------------------------------------------------------------*/ | |
| 1804 | ||
| 1805 | float32 float32_div( float32 a, float32 b ) | |
| 1806 | { | |
| 1807 | flag aSign, bSign, zSign; | |
| 1808 | int16 aExp, bExp, zExp; | |
| 1809 | bits32 aSig, bSig, zSig; | |
| 1810 | ||
| 1811 | aSig = extractFloat32Frac( a ); | |
| 1812 | aExp = extractFloat32Exp( a ); | |
| 1813 | aSign = extractFloat32Sign( a ); | |
| 1814 | bSig = extractFloat32Frac( b ); | |
| 1815 | bExp = extractFloat32Exp( b ); | |
| 1816 | bSign = extractFloat32Sign( b ); | |
| 1817 | zSign = aSign ^ bSign; | |
| 1818 | if ( aExp == 0xFF ) { | |
| 1819 | if ( aSig ) return propagateFloat32NaN( a, b ); | |
| 1820 | if ( bExp == 0xFF ) { | |
| 1821 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1822 | float_raise( float_flag_invalid ); | |
| 1823 | return float32_default_nan; | |
| 1824 | } | |
| 1825 | return packFloat32( zSign, 0xFF, 0 ); | |
| 1826 | } | |
| 1827 | if ( bExp == 0xFF ) { | |
| 1828 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1829 | return packFloat32( zSign, 0, 0 ); | |
| 1830 | } | |
| 1831 | if ( bExp == 0 ) { | |
| 1832 | if ( bSig == 0 ) { | |
| 1833 | if ( ( aExp | aSig ) == 0 ) { | |
| 1834 | float_raise( float_flag_invalid ); | |
| 1835 | return float32_default_nan; | |
| 1836 | } | |
| 1837 | float_raise( float_flag_divbyzero ); | |
| 1838 | return packFloat32( zSign, 0xFF, 0 ); | |
| 1839 | } | |
| 1840 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); | |
| 1841 | } | |
| 1842 | if ( aExp == 0 ) { | |
| 1843 | if ( aSig == 0 ) return packFloat32( zSign, 0, 0 ); | |
| 1844 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1845 | } | |
| 1846 | zExp = aExp - bExp + 0x7D; | |
| 1847 | aSig = ( aSig | 0x00800000 )<<7; | |
| 1848 | bSig = ( bSig | 0x00800000 )<<8; | |
| 1849 | if ( bSig <= ( aSig + aSig ) ) { | |
| 1850 | aSig >>= 1; | |
| 1851 | ++zExp; | |
| 1852 | } | |
| 1853 | zSig = ( ( (bits64) aSig )<<32 ) / bSig; | |
| 1854 | if ( ( zSig & 0x3F ) == 0 ) { | |
| 1855 | zSig |= ( (bits64) bSig * zSig != ( (bits64) aSig )<<32 ); | |
| 1856 | } | |
| 1857 | return roundAndPackFloat32( zSign, zExp, zSig ); | |
| 1858 | ||
| 1859 | } | |
| 1860 | ||
| 1861 | /*---------------------------------------------------------------------------- | |
| 1862 | | Returns the remainder of the single-precision floating-point value `a' | |
| 1863 | | with respect to the corresponding value `b'. The operation is performed | |
| 1864 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 1865 | *----------------------------------------------------------------------------*/ | |
| 1866 | ||
| 1867 | float32 float32_rem( float32 a, float32 b ) | |
| 1868 | { | |
| 1869 | flag aSign, bSign, zSign; | |
| 1870 | int16 aExp, bExp, expDiff; | |
| 1871 | bits32 aSig, bSig; | |
| 1872 | bits32 q; | |
| 1873 | bits64 aSig64, bSig64, q64; | |
| 1874 | bits32 alternateASig; | |
| 1875 | sbits32 sigMean; | |
| 1876 | ||
| 1877 | aSig = extractFloat32Frac( a ); | |
| 1878 | aExp = extractFloat32Exp( a ); | |
| 1879 | aSign = extractFloat32Sign( a ); | |
| 1880 | bSig = extractFloat32Frac( b ); | |
| 1881 | bExp = extractFloat32Exp( b ); | |
| 1882 | bSign = extractFloat32Sign( b ); | |
| 1883 | if ( aExp == 0xFF ) { | |
| 1884 | if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { | |
| 1885 | return propagateFloat32NaN( a, b ); | |
| 1886 | } | |
| 1887 | float_raise( float_flag_invalid ); | |
| 1888 | return float32_default_nan; | |
| 1889 | } | |
| 1890 | if ( bExp == 0xFF ) { | |
| 1891 | if ( bSig ) return propagateFloat32NaN( a, b ); | |
| 1892 | return a; | |
| 1893 | } | |
| 1894 | if ( bExp == 0 ) { | |
| 1895 | if ( bSig == 0 ) { | |
| 1896 | float_raise( float_flag_invalid ); | |
| 1897 | return float32_default_nan; | |
| 1898 | } | |
| 1899 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); | |
| 1900 | } | |
| 1901 | if ( aExp == 0 ) { | |
| 1902 | if ( aSig == 0 ) return a; | |
| 1903 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1904 | } | |
| 1905 | expDiff = aExp - bExp; | |
| 1906 | aSig |= 0x00800000; | |
| 1907 | bSig |= 0x00800000; | |
| 1908 | if ( expDiff < 32 ) { | |
| 1909 | aSig <<= 8; | |
| 1910 | bSig <<= 8; | |
| 1911 | if ( expDiff < 0 ) { | |
| 1912 | if ( expDiff < -1 ) return a; | |
| 1913 | aSig >>= 1; | |
| 1914 | } | |
| 1915 | q = ( bSig <= aSig ); | |
| 1916 | if ( q ) aSig -= bSig; | |
| 1917 | if ( 0 < expDiff ) { | |
| 1918 | q = ( ( (bits64) aSig )<<32 ) / bSig; | |
| 1919 | q >>= 32 - expDiff; | |
| 1920 | bSig >>= 2; | |
| 1921 | aSig = ( ( aSig>>1 )<<( expDiff - 1 ) ) - bSig * q; | |
| 1922 | } | |
| 1923 | else { | |
| 1924 | aSig >>= 2; | |
| 1925 | bSig >>= 2; | |
| 1926 | } | |
| 1927 | } | |
| 1928 | else { | |
| 1929 | if ( bSig <= aSig ) aSig -= bSig; | |
| 1930 | aSig64 = ( (bits64) aSig )<<40; | |
| 1931 | bSig64 = ( (bits64) bSig )<<40; | |
| 1932 | expDiff -= 64; | |
| 1933 | while ( 0 < expDiff ) { | |
| 1934 | q64 = estimateDiv128To64( aSig64, 0, bSig64 ); | |
| 1935 | q64 = ( 2 < q64 ) ? q64 - 2 : 0; | |
| 1936 | aSig64 = - ( ( bSig * q64 )<<38 ); | |
| 1937 | expDiff -= 62; | |
| 1938 | } | |
| 1939 | expDiff += 64; | |
| 1940 | q64 = estimateDiv128To64( aSig64, 0, bSig64 ); | |
| 1941 | q64 = ( 2 < q64 ) ? q64 - 2 : 0; | |
| 1942 | q = q64>>( 64 - expDiff ); | |
| 1943 | bSig <<= 6; | |
| 1944 | aSig = ( ( aSig64>>33 )<<( expDiff - 1 ) ) - bSig * q; | |
| 1945 | } | |
| 1946 | do { | |
| 1947 | alternateASig = aSig; | |
| 1948 | ++q; | |
| 1949 | aSig -= bSig; | |
| 1950 | } while ( 0 <= (sbits32) aSig ); | |
| 1951 | sigMean = aSig + alternateASig; | |
| 1952 | if ( ( sigMean < 0 ) || ( ( sigMean == 0 ) && ( q & 1 ) ) ) { | |
| 1953 | aSig = alternateASig; | |
| 1954 | } | |
| 1955 | zSign = ( (sbits32) aSig < 0 ); | |
| 1956 | if ( zSign ) aSig = - aSig; | |
| 1957 | return normalizeRoundAndPackFloat32( aSign ^ zSign, bExp, aSig ); | |
| 1958 | ||
| 1959 | } | |
| 1960 | ||
| 1961 | /*---------------------------------------------------------------------------- | |
| 1962 | | Returns the square root of the single-precision floating-point value `a'. | |
| 1963 | | The operation is performed according to the IEC/IEEE Standard for Binary | |
| 1964 | | Floating-Point Arithmetic. | |
| 1965 | *----------------------------------------------------------------------------*/ | |
| 1966 | ||
| 1967 | float32 float32_sqrt( float32 a ) | |
| 1968 | { | |
| 1969 | flag aSign; | |
| 1970 | int16 aExp, zExp; | |
| 1971 | bits32 aSig, zSig; | |
| 1972 | bits64 rem, term; | |
| 1973 | ||
| 1974 | aSig = extractFloat32Frac( a ); | |
| 1975 | aExp = extractFloat32Exp( a ); | |
| 1976 | aSign = extractFloat32Sign( a ); | |
| 1977 | if ( aExp == 0xFF ) { | |
| 1978 | if ( aSig ) return propagateFloat32NaN( a, 0 ); | |
| 1979 | if ( ! aSign ) return a; | |
| 1980 | float_raise( float_flag_invalid ); | |
| 1981 | return float32_default_nan; | |
| 1982 | } | |
| 1983 | if ( aSign ) { | |
| 1984 | if ( ( aExp | aSig ) == 0 ) return a; | |
| 1985 | float_raise( float_flag_invalid ); | |
| 1986 | return float32_default_nan; | |
| 1987 | } | |
| 1988 | if ( aExp == 0 ) { | |
| 1989 | if ( aSig == 0 ) return 0; | |
| 1990 | normalizeFloat32Subnormal( aSig, &aExp, &aSig ); | |
| 1991 | } | |
| 1992 | zExp = ( ( aExp - 0x7F )>>1 ) + 0x7E; | |
| 1993 | aSig = ( aSig | 0x00800000 )<<8; | |
| 1994 | zSig = estimateSqrt32( aExp, aSig ) + 2; | |
| 1995 | if ( ( zSig & 0x7F ) <= 5 ) { | |
| 1996 | if ( zSig < 2 ) { | |
| 1997 | zSig = 0x7FFFFFFF; | |
| 1998 | goto roundAndPack; | |
| 1999 | } | |
| 2000 | aSig >>= aExp & 1; | |
| 2001 | term = ( (bits64) zSig ) * zSig; | |
| 2002 | rem = ( ( (bits64) aSig )<<32 ) - term; | |
| 2003 | while ( (sbits64) rem < 0 ) { | |
| 2004 | --zSig; | |
| 2005 | rem += ( ( (bits64) zSig )<<1 ) | 1; | |
| 2006 | } | |
| 2007 | zSig |= ( rem != 0 ); | |
| 2008 | } | |
| 2009 | shift32RightJamming( zSig, 1, &zSig ); | |
| 2010 | roundAndPack: | |
| 2011 | return roundAndPackFloat32( 0, zExp, zSig ); | |
| 2012 | ||
| 2013 | } | |
| 2014 | ||
| 2015 | /*---------------------------------------------------------------------------- | |
| 2016 | | Returns 1 if the single-precision floating-point value `a' is equal to | |
| 2017 | | the corresponding value `b', and 0 otherwise. The comparison is performed | |
| 2018 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2019 | *----------------------------------------------------------------------------*/ | |
| 2020 | ||
| 2021 | flag float32_eq( float32 a, float32 b ) | |
| 2022 | { | |
| 2023 | ||
| 2024 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2025 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2026 | ) { | |
| 2027 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | |
| 2028 | float_raise( float_flag_invalid ); | |
| 2029 | } | |
| 2030 | return 0; | |
| 2031 | } | |
| 2032 | return ( a == b ) || ( (bits32) ( ( a | b )<<1 ) == 0 ); | |
| 2033 | ||
| 2034 | } | |
| 2035 | ||
| 2036 | /*---------------------------------------------------------------------------- | |
| 2037 | | Returns 1 if the single-precision floating-point value `a' is less than | |
| 2038 | | or equal to the corresponding value `b', and 0 otherwise. The comparison | |
| 2039 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2040 | | Arithmetic. | |
| 2041 | *----------------------------------------------------------------------------*/ | |
| 2042 | ||
| 2043 | flag float32_le( float32 a, float32 b ) | |
| 2044 | { | |
| 2045 | flag aSign, bSign; | |
| 2046 | ||
| 2047 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2048 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2049 | ) { | |
| 2050 | float_raise( float_flag_invalid ); | |
| 2051 | return 0; | |
| 2052 | } | |
| 2053 | aSign = extractFloat32Sign( a ); | |
| 2054 | bSign = extractFloat32Sign( b ); | |
| 2055 | if ( aSign != bSign ) return aSign || ( (bits32) ( ( a | b )<<1 ) == 0 ); | |
| 2056 | return ( a == b ) || ( aSign ^ ( a < b ) ); | |
| 2057 | ||
| 2058 | } | |
| 2059 | ||
| 2060 | /*---------------------------------------------------------------------------- | |
| 2061 | | Returns 1 if the single-precision floating-point value `a' is less than | |
| 2062 | | the corresponding value `b', and 0 otherwise. The comparison is performed | |
| 2063 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2064 | *----------------------------------------------------------------------------*/ | |
| 2065 | ||
| 2066 | flag float32_lt( float32 a, float32 b ) | |
| 2067 | { | |
| 2068 | flag aSign, bSign; | |
| 2069 | ||
| 2070 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2071 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2072 | ) { | |
| 2073 | float_raise( float_flag_invalid ); | |
| 2074 | return 0; | |
| 2075 | } | |
| 2076 | aSign = extractFloat32Sign( a ); | |
| 2077 | bSign = extractFloat32Sign( b ); | |
| 2078 | if ( aSign != bSign ) return aSign && ( (bits32) ( ( a | b )<<1 ) != 0 ); | |
| 2079 | return ( a != b ) && ( aSign ^ ( a < b ) ); | |
| 2080 | ||
| 2081 | } | |
| 2082 | ||
| 2083 | /*---------------------------------------------------------------------------- | |
| 2084 | | Returns 1 if the single-precision floating-point value `a' is equal to | |
| 2085 | | the corresponding value `b', and 0 otherwise. The invalid exception is | |
| 2086 | | raised if either operand is a NaN. Otherwise, the comparison is performed | |
| 2087 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2088 | *----------------------------------------------------------------------------*/ | |
| 2089 | ||
| 2090 | flag float32_eq_signaling( float32 a, float32 b ) | |
| 2091 | { | |
| 2092 | ||
| 2093 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2094 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2095 | ) { | |
| 2096 | float_raise( float_flag_invalid ); | |
| 2097 | return 0; | |
| 2098 | } | |
| 2099 | return ( a == b ) || ( (bits32) ( ( a | b )<<1 ) == 0 ); | |
| 2100 | ||
| 2101 | } | |
| 2102 | ||
| 2103 | /*---------------------------------------------------------------------------- | |
| 2104 | | Returns 1 if the single-precision floating-point value `a' is less than or | |
| 2105 | | equal to the corresponding value `b', and 0 otherwise. Quiet NaNs do not | |
| 2106 | | cause an exception. Otherwise, the comparison is performed according to the | |
| 2107 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2108 | *----------------------------------------------------------------------------*/ | |
| 2109 | ||
| 2110 | flag float32_le_quiet( float32 a, float32 b ) | |
| 2111 | { | |
| 2112 | flag aSign, bSign; | |
| 2113 | // int16 aExp, bExp; | |
| 2114 | ||
| 2115 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2116 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2117 | ) { | |
| 2118 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | |
| 2119 | float_raise( float_flag_invalid ); | |
| 2120 | } | |
| 2121 | return 0; | |
| 2122 | } | |
| 2123 | aSign = extractFloat32Sign( a ); | |
| 2124 | bSign = extractFloat32Sign( b ); | |
| 2125 | if ( aSign != bSign ) return aSign || ( (bits32) ( ( a | b )<<1 ) == 0 ); | |
| 2126 | return ( a == b ) || ( aSign ^ ( a < b ) ); | |
| 2127 | ||
| 2128 | } | |
| 2129 | ||
| 2130 | /*---------------------------------------------------------------------------- | |
| 2131 | | Returns 1 if the single-precision floating-point value `a' is less than | |
| 2132 | | the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause an | |
| 2133 | | exception. Otherwise, the comparison is performed according to the IEC/IEEE | |
| 2134 | | Standard for Binary Floating-Point Arithmetic. | |
| 2135 | *----------------------------------------------------------------------------*/ | |
| 2136 | ||
| 2137 | flag float32_lt_quiet( float32 a, float32 b ) | |
| 2138 | { | |
| 2139 | flag aSign, bSign; | |
| 2140 | ||
| 2141 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | |
| 2142 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | |
| 2143 | ) { | |
| 2144 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | |
| 2145 | float_raise( float_flag_invalid ); | |
| 2146 | } | |
| 2147 | return 0; | |
| 2148 | } | |
| 2149 | aSign = extractFloat32Sign( a ); | |
| 2150 | bSign = extractFloat32Sign( b ); | |
| 2151 | if ( aSign != bSign ) return aSign && ( (bits32) ( ( a | b )<<1 ) != 0 ); | |
| 2152 | return ( a != b ) && ( aSign ^ ( a < b ) ); | |
| 2153 | ||
| 2154 | } | |
| 2155 | ||
| 2156 | /*---------------------------------------------------------------------------- | |
| 2157 | | Returns the result of converting the double-precision floating-point value | |
| 2158 | | `a' to the 32-bit two's complement integer format. The conversion is | |
| 2159 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2160 | | Arithmetic---which means in particular that the conversion is rounded | |
| 2161 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 2162 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 2163 | | largest integer with the same sign as `a' is returned. | |
| 2164 | *----------------------------------------------------------------------------*/ | |
| 2165 | ||
| 2166 | int32 float64_to_int32( float64 a ) | |
| 2167 | { | |
| 2168 | flag aSign; | |
| 2169 | int16 aExp, shiftCount; | |
| 2170 | bits64 aSig; | |
| 2171 | ||
| 2172 | aSig = extractFloat64Frac( a ); | |
| 2173 | aExp = extractFloat64Exp( a ); | |
| 2174 | aSign = extractFloat64Sign( a ); | |
| 2175 | if ( ( aExp == 0x7FF ) && aSig ) aSign = 0; | |
| 2176 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); | |
| 2177 | shiftCount = 0x42C - aExp; | |
| 2178 | if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); | |
| 2179 | return roundAndPackInt32( aSign, aSig ); | |
| 2180 | ||
| 2181 | } | |
| 2182 | ||
| 2183 | /*---------------------------------------------------------------------------- | |
| 2184 | | Returns the result of converting the double-precision floating-point value | |
| 2185 | | `a' to the 32-bit two's complement integer format. The conversion is | |
| 2186 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2187 | | Arithmetic, except that the conversion is always rounded toward zero. | |
| 2188 | | If `a' is a NaN, the largest positive integer is returned. Otherwise, if | |
| 2189 | | the conversion overflows, the largest integer with the same sign as `a' is | |
| 2190 | | returned. | |
| 2191 | *----------------------------------------------------------------------------*/ | |
| 2192 | ||
| 2193 | int32 float64_to_int32_round_to_zero( float64 a ) | |
| 2194 | { | |
| 2195 | flag aSign; | |
| 2196 | int16 aExp, shiftCount; | |
| 2197 | bits64 aSig, savedASig; | |
| 2198 | int32 z; | |
| 2199 | ||
| 2200 | aSig = extractFloat64Frac( a ); | |
| 2201 | aExp = extractFloat64Exp( a ); | |
| 2202 | aSign = extractFloat64Sign( a ); | |
| 2203 | if ( 0x41E < aExp ) { | |
| 2204 | if ( ( aExp == 0x7FF ) && aSig ) aSign = 0; | |
| 2205 | goto invalid; | |
| 2206 | } | |
| 2207 | else if ( aExp < 0x3FF ) { | |
| 2208 | if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; | |
| 2209 | return 0; | |
| 2210 | } | |
| 2211 | aSig |= LIT64( 0x0010000000000000 ); | |
| 2212 | shiftCount = 0x433 - aExp; | |
| 2213 | savedASig = aSig; | |
| 2214 | aSig >>= shiftCount; | |
| 2215 | z = aSig; | |
| 2216 | if ( aSign ) z = - z; | |
| 2217 | if ( ( z < 0 ) ^ aSign ) { | |
| 2218 | invalid: | |
| 2219 | float_raise( float_flag_invalid ); | |
| 2220 | return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF; | |
| 2221 | } | |
| 2222 | if ( ( aSig<<shiftCount ) != savedASig ) { | |
| 2223 | float_exception_flags |= float_flag_inexact; | |
| 2224 | } | |
| 2225 | return z; | |
| 2226 | ||
| 2227 | } | |
| 2228 | ||
| 2229 | /*---------------------------------------------------------------------------- | |
| 2230 | | Returns the result of converting the double-precision floating-point value | |
| 2231 | | `a' to the 64-bit two's complement integer format. The conversion is | |
| 2232 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2233 | | Arithmetic---which means in particular that the conversion is rounded | |
| 2234 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 2235 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 2236 | | largest integer with the same sign as `a' is returned. | |
| 2237 | *----------------------------------------------------------------------------*/ | |
| 2238 | ||
| 2239 | int64 float64_to_int64( float64 a ) | |
| 2240 | { | |
| 2241 | flag aSign; | |
| 2242 | int16 aExp, shiftCount; | |
| 2243 | bits64 aSig, aSigExtra; | |
| 2244 | ||
| 2245 | aSig = extractFloat64Frac( a ); | |
| 2246 | aExp = extractFloat64Exp( a ); | |
| 2247 | aSign = extractFloat64Sign( a ); | |
| 2248 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); | |
| 2249 | shiftCount = 0x433 - aExp; | |
| 2250 | if ( shiftCount <= 0 ) { | |
| 2251 | if ( 0x43E < aExp ) { | |
| 2252 | float_raise( float_flag_invalid ); | |
| 2253 | if ( ! aSign | |
| 2254 | || ( ( aExp == 0x7FF ) | |
| 2255 | && ( aSig != LIT64( 0x0010000000000000 ) ) ) | |
| 2256 | ) { | |
| 2257 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 2258 | } | |
| 2259 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 2260 | } | |
| 2261 | aSigExtra = 0; | |
| 2262 | aSig <<= - shiftCount; | |
| 2263 | } | |
| 2264 | else { | |
| 2265 | shift64ExtraRightJamming( aSig, 0, shiftCount, &aSig, &aSigExtra ); | |
| 2266 | } | |
| 2267 | return roundAndPackInt64( aSign, aSig, aSigExtra ); | |
| 2268 | ||
| 2269 | } | |
| 2270 | ||
| 2271 | /*---------------------------------------------------------------------------- | |
| 2272 | | Returns the result of converting the double-precision floating-point value | |
| 2273 | | `a' to the 64-bit two's complement integer format. The conversion is | |
| 2274 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2275 | | Arithmetic, except that the conversion is always rounded toward zero. | |
| 2276 | | If `a' is a NaN, the largest positive integer is returned. Otherwise, if | |
| 2277 | | the conversion overflows, the largest integer with the same sign as `a' is | |
| 2278 | | returned. | |
| 2279 | *----------------------------------------------------------------------------*/ | |
| 2280 | ||
| 2281 | int64 float64_to_int64_round_to_zero( float64 a ) | |
| 2282 | { | |
| 2283 | flag aSign; | |
| 2284 | int16 aExp, shiftCount; | |
| 2285 | bits64 aSig; | |
| 2286 | int64 z; | |
| 2287 | ||
| 2288 | aSig = extractFloat64Frac( a ); | |
| 2289 | aExp = extractFloat64Exp( a ); | |
| 2290 | aSign = extractFloat64Sign( a ); | |
| 2291 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); | |
| 2292 | shiftCount = aExp - 0x433; | |
| 2293 | if ( 0 <= shiftCount ) { | |
| 2294 | if ( 0x43E <= aExp ) { | |
| 2295 | if ( a != LIT64( 0xC3E0000000000000 ) ) { | |
| 2296 | float_raise( float_flag_invalid ); | |
| 2297 | if ( ! aSign | |
| 2298 | || ( ( aExp == 0x7FF ) | |
| 2299 | && ( aSig != LIT64( 0x0010000000000000 ) ) ) | |
| 2300 | ) { | |
| 2301 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 2302 | } | |
| 2303 | } | |
| 2304 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 2305 | } | |
| 2306 | z = aSig<<shiftCount; | |
| 2307 | } | |
| 2308 | else { | |
| 2309 | if ( aExp < 0x3FE ) { | |
| 2310 | if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; | |
| 2311 | return 0; | |
| 2312 | } | |
| 2313 | z = aSig>>( - shiftCount ); | |
| 2314 | if ( (bits64) ( aSig<<( shiftCount & 63 ) ) ) { | |
| 2315 | float_exception_flags |= float_flag_inexact; | |
| 2316 | } | |
| 2317 | } | |
| 2318 | if ( aSign ) z = - z; | |
| 2319 | return z; | |
| 2320 | ||
| 2321 | } | |
| 2322 | ||
| 2323 | /*---------------------------------------------------------------------------- | |
| 2324 | | Returns the result of converting the double-precision floating-point value | |
| 2325 | | `a' to the single-precision floating-point format. The conversion is | |
| 2326 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2327 | | Arithmetic. | |
| 2328 | *----------------------------------------------------------------------------*/ | |
| 2329 | ||
| 2330 | float32 float64_to_float32( float64 a ) | |
| 2331 | { | |
| 2332 | flag aSign; | |
| 2333 | int16 aExp; | |
| 2334 | bits64 aSig; | |
| 2335 | bits32 zSig; | |
| 2336 | ||
| 2337 | aSig = extractFloat64Frac( a ); | |
| 2338 | aExp = extractFloat64Exp( a ); | |
| 2339 | aSign = extractFloat64Sign( a ); | |
| 2340 | if ( aExp == 0x7FF ) { | |
| 2341 | if ( aSig ) return commonNaNToFloat32( float64ToCommonNaN( a ) ); | |
| 2342 | return packFloat32( aSign, 0xFF, 0 ); | |
| 2343 | } | |
| 2344 | shift64RightJamming( aSig, 22, &aSig ); | |
| 2345 | zSig = aSig; | |
| 2346 | if ( aExp || zSig ) { | |
| 2347 | zSig |= 0x40000000; | |
| 2348 | aExp -= 0x381; | |
| 2349 | } | |
| 2350 | return roundAndPackFloat32( aSign, aExp, zSig ); | |
| 2351 | ||
| 2352 | } | |
| 2353 | ||
| 2354 | #ifdef FLOATX80 | |
| 2355 | ||
| 2356 | /*---------------------------------------------------------------------------- | |
| 2357 | | Returns the result of converting the double-precision floating-point value | |
| 2358 | | `a' to the extended double-precision floating-point format. The conversion | |
| 2359 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2360 | | Arithmetic. | |
| 2361 | *----------------------------------------------------------------------------*/ | |
| 2362 | ||
| 2363 | floatx80 float64_to_floatx80( float64 a ) | |
| 2364 | { | |
| 2365 | flag aSign; | |
| 2366 | int16 aExp; | |
| 2367 | bits64 aSig; | |
| 2368 | ||
| 2369 | aSig = extractFloat64Frac( a ); | |
| 2370 | aExp = extractFloat64Exp( a ); | |
| 2371 | aSign = extractFloat64Sign( a ); | |
| 2372 | if ( aExp == 0x7FF ) { | |
| 2373 | if ( aSig ) return commonNaNToFloatx80( float64ToCommonNaN( a ) ); | |
| 2374 | return packFloatx80( aSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 2375 | } | |
| 2376 | if ( aExp == 0 ) { | |
| 2377 | if ( aSig == 0 ) return packFloatx80( aSign, 0, 0 ); | |
| 2378 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2379 | } | |
| 2380 | return | |
| 2381 | packFloatx80( | |
| 2382 | aSign, aExp + 0x3C00, ( aSig | LIT64( 0x0010000000000000 ) )<<11 ); | |
| 2383 | ||
| 2384 | } | |
| 2385 | ||
| 2386 | #endif | |
| 2387 | ||
| 2388 | #ifdef FLOAT128 | |
| 2389 | ||
| 2390 | /*---------------------------------------------------------------------------- | |
| 2391 | | Returns the result of converting the double-precision floating-point value | |
| 2392 | | `a' to the quadruple-precision floating-point format. The conversion is | |
| 2393 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2394 | | Arithmetic. | |
| 2395 | *----------------------------------------------------------------------------*/ | |
| 2396 | ||
| 2397 | float128 float64_to_float128( float64 a ) | |
| 2398 | { | |
| 2399 | flag aSign; | |
| 2400 | int16 aExp; | |
| 2401 | bits64 aSig, zSig0, zSig1; | |
| 2402 | ||
| 2403 | aSig = extractFloat64Frac( a ); | |
| 2404 | aExp = extractFloat64Exp( a ); | |
| 2405 | aSign = extractFloat64Sign( a ); | |
| 2406 | if ( aExp == 0x7FF ) { | |
| 2407 | if ( aSig ) return commonNaNToFloat128( float64ToCommonNaN( a ) ); | |
| 2408 | return packFloat128( aSign, 0x7FFF, 0, 0 ); | |
| 2409 | } | |
| 2410 | if ( aExp == 0 ) { | |
| 2411 | if ( aSig == 0 ) return packFloat128( aSign, 0, 0, 0 ); | |
| 2412 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2413 | --aExp; | |
| 2414 | } | |
| 2415 | shift128Right( aSig, 0, 4, &zSig0, &zSig1 ); | |
| 2416 | return packFloat128( aSign, aExp + 0x3C00, zSig0, zSig1 ); | |
| 2417 | ||
| 2418 | } | |
| 2419 | ||
| 2420 | #endif | |
| 2421 | ||
| 2422 | /*---------------------------------------------------------------------------- | |
| 2423 | | Rounds the double-precision floating-point value `a' to an integer, and | |
| 2424 | | returns the result as a double-precision floating-point value. The | |
| 2425 | | operation is performed according to the IEC/IEEE Standard for Binary | |
| 2426 | | Floating-Point Arithmetic. | |
| 2427 | *----------------------------------------------------------------------------*/ | |
| 2428 | ||
| 2429 | float64 float64_round_to_int( float64 a ) | |
| 2430 | { | |
| 2431 | flag aSign; | |
| 2432 | int16 aExp; | |
| 2433 | bits64 lastBitMask, roundBitsMask; | |
| 2434 | int8 roundingMode; | |
| 2435 | float64 z; | |
| 2436 | ||
| 2437 | aExp = extractFloat64Exp( a ); | |
| 2438 | if ( 0x433 <= aExp ) { | |
| 2439 | if ( ( aExp == 0x7FF ) && extractFloat64Frac( a ) ) { | |
| 2440 | return propagateFloat64NaN( a, a ); | |
| 2441 | } | |
| 2442 | return a; | |
| 2443 | } | |
| 2444 | if ( aExp < 0x3FF ) { | |
| 2445 | if ( (bits64) ( a<<1 ) == 0 ) return a; | |
| 2446 | float_exception_flags |= float_flag_inexact; | |
| 2447 | aSign = extractFloat64Sign( a ); | |
| 2448 | switch ( float_rounding_mode ) { | |
| 2449 | case float_round_nearest_even: | |
| 2450 | if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) { | |
| 2451 | return packFloat64( aSign, 0x3FF, 0 ); | |
| 2452 | } | |
| 2453 | break; | |
| 2454 | case float_round_down: | |
| 2455 | return aSign ? LIT64( 0xBFF0000000000000 ) : 0; | |
| 2456 | case float_round_up: | |
| 2457 | return | |
| 2458 | aSign ? LIT64( 0x8000000000000000 ) : LIT64( 0x3FF0000000000000 ); | |
| 2459 | } | |
| 2460 | return packFloat64( aSign, 0, 0 ); | |
| 2461 | } | |
| 2462 | lastBitMask = 1; | |
| 2463 | lastBitMask <<= 0x433 - aExp; | |
| 2464 | roundBitsMask = lastBitMask - 1; | |
| 2465 | z = a; | |
| 2466 | roundingMode = float_rounding_mode; | |
| 2467 | if ( roundingMode == float_round_nearest_even ) { | |
| 2468 | z += lastBitMask>>1; | |
| 2469 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; | |
| 2470 | } | |
| 2471 | else if ( roundingMode != float_round_to_zero ) { | |
| 2472 | if ( extractFloat64Sign( z ) ^ ( roundingMode == float_round_up ) ) { | |
| 2473 | z += roundBitsMask; | |
| 2474 | } | |
| 2475 | } | |
| 2476 | z &= ~ roundBitsMask; | |
| 2477 | if ( z != a ) float_exception_flags |= float_flag_inexact; | |
| 2478 | return z; | |
| 2479 | ||
| 2480 | } | |
| 2481 | ||
| 2482 | /*---------------------------------------------------------------------------- | |
| 2483 | | Returns the result of adding the absolute values of the double-precision | |
| 2484 | | floating-point values `a' and `b'. If `zSign' is 1, the sum is negated | |
| 2485 | | before being returned. `zSign' is ignored if the result is a NaN. | |
| 2486 | | The addition is performed according to the IEC/IEEE Standard for Binary | |
| 2487 | | Floating-Point Arithmetic. | |
| 2488 | *----------------------------------------------------------------------------*/ | |
| 2489 | ||
| 2490 | static float64 addFloat64Sigs( float64 a, float64 b, flag zSign ) | |
| 2491 | { | |
| 2492 | int16 aExp, bExp, zExp; | |
| 2493 | bits64 aSig, bSig, zSig; | |
| 2494 | int16 expDiff; | |
| 2495 | ||
| 2496 | aSig = extractFloat64Frac( a ); | |
| 2497 | aExp = extractFloat64Exp( a ); | |
| 2498 | bSig = extractFloat64Frac( b ); | |
| 2499 | bExp = extractFloat64Exp( b ); | |
| 2500 | expDiff = aExp - bExp; | |
| 2501 | aSig <<= 9; | |
| 2502 | bSig <<= 9; | |
| 2503 | if ( 0 < expDiff ) { | |
| 2504 | if ( aExp == 0x7FF ) { | |
| 2505 | if ( aSig ) return propagateFloat64NaN( a, b ); | |
| 2506 | return a; | |
| 2507 | } | |
| 2508 | if ( bExp == 0 ) { | |
| 2509 | --expDiff; | |
| 2510 | } | |
| 2511 | else { | |
| 2512 | bSig |= LIT64( 0x2000000000000000 ); | |
| 2513 | } | |
| 2514 | shift64RightJamming( bSig, expDiff, &bSig ); | |
| 2515 | zExp = aExp; | |
| 2516 | } | |
| 2517 | else if ( expDiff < 0 ) { | |
| 2518 | if ( bExp == 0x7FF ) { | |
| 2519 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2520 | return packFloat64( zSign, 0x7FF, 0 ); | |
| 2521 | } | |
| 2522 | if ( aExp == 0 ) { | |
| 2523 | ++expDiff; | |
| 2524 | } | |
| 2525 | else { | |
| 2526 | aSig |= LIT64( 0x2000000000000000 ); | |
| 2527 | } | |
| 2528 | shift64RightJamming( aSig, - expDiff, &aSig ); | |
| 2529 | zExp = bExp; | |
| 2530 | } | |
| 2531 | else { | |
| 2532 | if ( aExp == 0x7FF ) { | |
| 2533 | if ( aSig | bSig ) return propagateFloat64NaN( a, b ); | |
| 2534 | return a; | |
| 2535 | } | |
| 2536 | if ( aExp == 0 ) return packFloat64( zSign, 0, ( aSig + bSig )>>9 ); | |
| 2537 | zSig = LIT64( 0x4000000000000000 ) + aSig + bSig; | |
| 2538 | zExp = aExp; | |
| 2539 | goto roundAndPack; | |
| 2540 | } | |
| 2541 | aSig |= LIT64( 0x2000000000000000 ); | |
| 2542 | zSig = ( aSig + bSig )<<1; | |
| 2543 | --zExp; | |
| 2544 | if ( (sbits64) zSig < 0 ) { | |
| 2545 | zSig = aSig + bSig; | |
| 2546 | ++zExp; | |
| 2547 | } | |
| 2548 | roundAndPack: | |
| 2549 | return roundAndPackFloat64( zSign, zExp, zSig ); | |
| 2550 | ||
| 2551 | } | |
| 2552 | ||
| 2553 | /*---------------------------------------------------------------------------- | |
| 2554 | | Returns the result of subtracting the absolute values of the double- | |
| 2555 | | precision floating-point values `a' and `b'. If `zSign' is 1, the | |
| 2556 | | difference is negated before being returned. `zSign' is ignored if the | |
| 2557 | | result is a NaN. The subtraction is performed according to the IEC/IEEE | |
| 2558 | | Standard for Binary Floating-Point Arithmetic. | |
| 2559 | *----------------------------------------------------------------------------*/ | |
| 2560 | ||
| 2561 | static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) | |
| 2562 | { | |
| 2563 | int16 aExp, bExp, zExp; | |
| 2564 | bits64 aSig, bSig, zSig; | |
| 2565 | int16 expDiff; | |
| 2566 | ||
| 2567 | aSig = extractFloat64Frac( a ); | |
| 2568 | aExp = extractFloat64Exp( a ); | |
| 2569 | bSig = extractFloat64Frac( b ); | |
| 2570 | bExp = extractFloat64Exp( b ); | |
| 2571 | expDiff = aExp - bExp; | |
| 2572 | aSig <<= 10; | |
| 2573 | bSig <<= 10; | |
| 2574 | if ( 0 < expDiff ) goto aExpBigger; | |
| 2575 | if ( expDiff < 0 ) goto bExpBigger; | |
| 2576 | if ( aExp == 0x7FF ) { | |
| 2577 | if ( aSig | bSig ) return propagateFloat64NaN( a, b ); | |
| 2578 | float_raise( float_flag_invalid ); | |
| 2579 | return float64_default_nan; | |
| 2580 | } | |
| 2581 | if ( aExp == 0 ) { | |
| 2582 | aExp = 1; | |
| 2583 | bExp = 1; | |
| 2584 | } | |
| 2585 | if ( bSig < aSig ) goto aBigger; | |
| 2586 | if ( aSig < bSig ) goto bBigger; | |
| 2587 | return packFloat64( float_rounding_mode == float_round_down, 0, 0 ); | |
| 2588 | bExpBigger: | |
| 2589 | if ( bExp == 0x7FF ) { | |
| 2590 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2591 | return packFloat64( zSign ^ 1, 0x7FF, 0 ); | |
| 2592 | } | |
| 2593 | if ( aExp == 0 ) { | |
| 2594 | ++expDiff; | |
| 2595 | } | |
| 2596 | else { | |
| 2597 | aSig |= LIT64( 0x4000000000000000 ); | |
| 2598 | } | |
| 2599 | shift64RightJamming( aSig, - expDiff, &aSig ); | |
| 2600 | bSig |= LIT64( 0x4000000000000000 ); | |
| 2601 | bBigger: | |
| 2602 | zSig = bSig - aSig; | |
| 2603 | zExp = bExp; | |
| 2604 | zSign ^= 1; | |
| 2605 | goto normalizeRoundAndPack; | |
| 2606 | aExpBigger: | |
| 2607 | if ( aExp == 0x7FF ) { | |
| 2608 | if ( aSig ) return propagateFloat64NaN( a, b ); | |
| 2609 | return a; | |
| 2610 | } | |
| 2611 | if ( bExp == 0 ) { | |
| 2612 | --expDiff; | |
| 2613 | } | |
| 2614 | else { | |
| 2615 | bSig |= LIT64( 0x4000000000000000 ); | |
| 2616 | } | |
| 2617 | shift64RightJamming( bSig, expDiff, &bSig ); | |
| 2618 | aSig |= LIT64( 0x4000000000000000 ); | |
| 2619 | aBigger: | |
| 2620 | zSig = aSig - bSig; | |
| 2621 | zExp = aExp; | |
| 2622 | normalizeRoundAndPack: | |
| 2623 | --zExp; | |
| 2624 | return normalizeRoundAndPackFloat64( zSign, zExp, zSig ); | |
| 2625 | ||
| 2626 | } | |
| 2627 | ||
| 2628 | /*---------------------------------------------------------------------------- | |
| 2629 | | Returns the result of adding the double-precision floating-point values `a' | |
| 2630 | | and `b'. The operation is performed according to the IEC/IEEE Standard for | |
| 2631 | | Binary Floating-Point Arithmetic. | |
| 2632 | *----------------------------------------------------------------------------*/ | |
| 2633 | ||
| 2634 | float64 float64_add( float64 a, float64 b ) | |
| 2635 | { | |
| 2636 | flag aSign, bSign; | |
| 2637 | ||
| 2638 | aSign = extractFloat64Sign( a ); | |
| 2639 | bSign = extractFloat64Sign( b ); | |
| 2640 | if ( aSign == bSign ) { | |
| 2641 | return addFloat64Sigs( a, b, aSign ); | |
| 2642 | } | |
| 2643 | else { | |
| 2644 | return subFloat64Sigs( a, b, aSign ); | |
| 2645 | } | |
| 2646 | ||
| 2647 | } | |
| 2648 | ||
| 2649 | /*---------------------------------------------------------------------------- | |
| 2650 | | Returns the result of subtracting the double-precision floating-point values | |
| 2651 | | `a' and `b'. The operation is performed according to the IEC/IEEE Standard | |
| 2652 | | for Binary Floating-Point Arithmetic. | |
| 2653 | *----------------------------------------------------------------------------*/ | |
| 2654 | ||
| 2655 | float64 float64_sub( float64 a, float64 b ) | |
| 2656 | { | |
| 2657 | flag aSign, bSign; | |
| 2658 | ||
| 2659 | aSign = extractFloat64Sign( a ); | |
| 2660 | bSign = extractFloat64Sign( b ); | |
| 2661 | if ( aSign == bSign ) { | |
| 2662 | return subFloat64Sigs( a, b, aSign ); | |
| 2663 | } | |
| 2664 | else { | |
| 2665 | return addFloat64Sigs( a, b, aSign ); | |
| 2666 | } | |
| 2667 | ||
| 2668 | } | |
| 2669 | ||
| 2670 | /*---------------------------------------------------------------------------- | |
| 2671 | | Returns the result of multiplying the double-precision floating-point values | |
| 2672 | | `a' and `b'. The operation is performed according to the IEC/IEEE Standard | |
| 2673 | | for Binary Floating-Point Arithmetic. | |
| 2674 | *----------------------------------------------------------------------------*/ | |
| 2675 | ||
| 2676 | float64 float64_mul( float64 a, float64 b ) | |
| 2677 | { | |
| 2678 | flag aSign, bSign, zSign; | |
| 2679 | int16 aExp, bExp, zExp; | |
| 2680 | bits64 aSig, bSig, zSig0, zSig1; | |
| 2681 | ||
| 2682 | aSig = extractFloat64Frac( a ); | |
| 2683 | aExp = extractFloat64Exp( a ); | |
| 2684 | aSign = extractFloat64Sign( a ); | |
| 2685 | bSig = extractFloat64Frac( b ); | |
| 2686 | bExp = extractFloat64Exp( b ); | |
| 2687 | bSign = extractFloat64Sign( b ); | |
| 2688 | zSign = aSign ^ bSign; | |
| 2689 | if ( aExp == 0x7FF ) { | |
| 2690 | if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { | |
| 2691 | return propagateFloat64NaN( a, b ); | |
| 2692 | } | |
| 2693 | if ( ( bExp | bSig ) == 0 ) { | |
| 2694 | float_raise( float_flag_invalid ); | |
| 2695 | return float64_default_nan; | |
| 2696 | } | |
| 2697 | return packFloat64( zSign, 0x7FF, 0 ); | |
| 2698 | } | |
| 2699 | if ( bExp == 0x7FF ) { | |
| 2700 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2701 | if ( ( aExp | aSig ) == 0 ) { | |
| 2702 | float_raise( float_flag_invalid ); | |
| 2703 | return float64_default_nan; | |
| 2704 | } | |
| 2705 | return packFloat64( zSign, 0x7FF, 0 ); | |
| 2706 | } | |
| 2707 | if ( aExp == 0 ) { | |
| 2708 | if ( aSig == 0 ) return packFloat64( zSign, 0, 0 ); | |
| 2709 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2710 | } | |
| 2711 | if ( bExp == 0 ) { | |
| 2712 | if ( bSig == 0 ) return packFloat64( zSign, 0, 0 ); | |
| 2713 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); | |
| 2714 | } | |
| 2715 | zExp = aExp + bExp - 0x3FF; | |
| 2716 | aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<10; | |
| 2717 | bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11; | |
| 2718 | mul64To128( aSig, bSig, &zSig0, &zSig1 ); | |
| 2719 | zSig0 |= ( zSig1 != 0 ); | |
| 2720 | if ( 0 <= (sbits64) ( zSig0<<1 ) ) { | |
| 2721 | zSig0 <<= 1; | |
| 2722 | --zExp; | |
| 2723 | } | |
| 2724 | return roundAndPackFloat64( zSign, zExp, zSig0 ); | |
| 2725 | ||
| 2726 | } | |
| 2727 | ||
| 2728 | /*---------------------------------------------------------------------------- | |
| 2729 | | Returns the result of dividing the double-precision floating-point value `a' | |
| 2730 | | by the corresponding value `b'. The operation is performed according to | |
| 2731 | | the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2732 | *----------------------------------------------------------------------------*/ | |
| 2733 | ||
| 2734 | float64 float64_div( float64 a, float64 b ) | |
| 2735 | { | |
| 2736 | flag aSign, bSign, zSign; | |
| 2737 | int16 aExp, bExp, zExp; | |
| 2738 | bits64 aSig, bSig, zSig; | |
| 2739 | bits64 rem0, rem1; | |
| 2740 | bits64 term0, term1; | |
| 2741 | ||
| 2742 | aSig = extractFloat64Frac( a ); | |
| 2743 | aExp = extractFloat64Exp( a ); | |
| 2744 | aSign = extractFloat64Sign( a ); | |
| 2745 | bSig = extractFloat64Frac( b ); | |
| 2746 | bExp = extractFloat64Exp( b ); | |
| 2747 | bSign = extractFloat64Sign( b ); | |
| 2748 | zSign = aSign ^ bSign; | |
| 2749 | if ( aExp == 0x7FF ) { | |
| 2750 | if ( aSig ) return propagateFloat64NaN( a, b ); | |
| 2751 | if ( bExp == 0x7FF ) { | |
| 2752 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2753 | float_raise( float_flag_invalid ); | |
| 2754 | return float64_default_nan; | |
| 2755 | } | |
| 2756 | return packFloat64( zSign, 0x7FF, 0 ); | |
| 2757 | } | |
| 2758 | if ( bExp == 0x7FF ) { | |
| 2759 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2760 | return packFloat64( zSign, 0, 0 ); | |
| 2761 | } | |
| 2762 | if ( bExp == 0 ) { | |
| 2763 | if ( bSig == 0 ) { | |
| 2764 | if ( ( aExp | aSig ) == 0 ) { | |
| 2765 | float_raise( float_flag_invalid ); | |
| 2766 | return float64_default_nan; | |
| 2767 | } | |
| 2768 | float_raise( float_flag_divbyzero ); | |
| 2769 | return packFloat64( zSign, 0x7FF, 0 ); | |
| 2770 | } | |
| 2771 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); | |
| 2772 | } | |
| 2773 | if ( aExp == 0 ) { | |
| 2774 | if ( aSig == 0 ) return packFloat64( zSign, 0, 0 ); | |
| 2775 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2776 | } | |
| 2777 | zExp = aExp - bExp + 0x3FD; | |
| 2778 | aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<10; | |
| 2779 | bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11; | |
| 2780 | if ( bSig <= ( aSig + aSig ) ) { | |
| 2781 | aSig >>= 1; | |
| 2782 | ++zExp; | |
| 2783 | } | |
| 2784 | zSig = estimateDiv128To64( aSig, 0, bSig ); | |
| 2785 | if ( ( zSig & 0x1FF ) <= 2 ) { | |
| 2786 | mul64To128( bSig, zSig, &term0, &term1 ); | |
| 2787 | sub128( aSig, 0, term0, term1, &rem0, &rem1 ); | |
| 2788 | while ( (sbits64) rem0 < 0 ) { | |
| 2789 | --zSig; | |
| 2790 | add128( rem0, rem1, 0, bSig, &rem0, &rem1 ); | |
| 2791 | } | |
| 2792 | zSig |= ( rem1 != 0 ); | |
| 2793 | } | |
| 2794 | return roundAndPackFloat64( zSign, zExp, zSig ); | |
| 2795 | ||
| 2796 | } | |
| 2797 | ||
| 2798 | /*---------------------------------------------------------------------------- | |
| 2799 | | Returns the remainder of the double-precision floating-point value `a' | |
| 2800 | | with respect to the corresponding value `b'. The operation is performed | |
| 2801 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2802 | *----------------------------------------------------------------------------*/ | |
| 2803 | ||
| 2804 | float64 float64_rem( float64 a, float64 b ) | |
| 2805 | { | |
| 2806 | flag aSign, bSign, zSign; | |
| 2807 | int16 aExp, bExp, expDiff; | |
| 2808 | bits64 aSig, bSig; | |
| 2809 | bits64 q, alternateASig; | |
| 2810 | sbits64 sigMean; | |
| 2811 | ||
| 2812 | aSig = extractFloat64Frac( a ); | |
| 2813 | aExp = extractFloat64Exp( a ); | |
| 2814 | aSign = extractFloat64Sign( a ); | |
| 2815 | bSig = extractFloat64Frac( b ); | |
| 2816 | bExp = extractFloat64Exp( b ); | |
| 2817 | bSign = extractFloat64Sign( b ); | |
| 2818 | if ( aExp == 0x7FF ) { | |
| 2819 | if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { | |
| 2820 | return propagateFloat64NaN( a, b ); | |
| 2821 | } | |
| 2822 | float_raise( float_flag_invalid ); | |
| 2823 | return float64_default_nan; | |
| 2824 | } | |
| 2825 | if ( bExp == 0x7FF ) { | |
| 2826 | if ( bSig ) return propagateFloat64NaN( a, b ); | |
| 2827 | return a; | |
| 2828 | } | |
| 2829 | if ( bExp == 0 ) { | |
| 2830 | if ( bSig == 0 ) { | |
| 2831 | float_raise( float_flag_invalid ); | |
| 2832 | return float64_default_nan; | |
| 2833 | } | |
| 2834 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); | |
| 2835 | } | |
| 2836 | if ( aExp == 0 ) { | |
| 2837 | if ( aSig == 0 ) return a; | |
| 2838 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2839 | } | |
| 2840 | expDiff = aExp - bExp; | |
| 2841 | aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<11; | |
| 2842 | bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11; | |
| 2843 | if ( expDiff < 0 ) { | |
| 2844 | if ( expDiff < -1 ) return a; | |
| 2845 | aSig >>= 1; | |
| 2846 | } | |
| 2847 | q = ( bSig <= aSig ); | |
| 2848 | if ( q ) aSig -= bSig; | |
| 2849 | expDiff -= 64; | |
| 2850 | while ( 0 < expDiff ) { | |
| 2851 | q = estimateDiv128To64( aSig, 0, bSig ); | |
| 2852 | q = ( 2 < q ) ? q - 2 : 0; | |
| 2853 | aSig = - ( ( bSig>>2 ) * q ); | |
| 2854 | expDiff -= 62; | |
| 2855 | } | |
| 2856 | expDiff += 64; | |
| 2857 | if ( 0 < expDiff ) { | |
| 2858 | q = estimateDiv128To64( aSig, 0, bSig ); | |
| 2859 | q = ( 2 < q ) ? q - 2 : 0; | |
| 2860 | q >>= 64 - expDiff; | |
| 2861 | bSig >>= 2; | |
| 2862 | aSig = ( ( aSig>>1 )<<( expDiff - 1 ) ) - bSig * q; | |
| 2863 | } | |
| 2864 | else { | |
| 2865 | aSig >>= 2; | |
| 2866 | bSig >>= 2; | |
| 2867 | } | |
| 2868 | do { | |
| 2869 | alternateASig = aSig; | |
| 2870 | ++q; | |
| 2871 | aSig -= bSig; | |
| 2872 | } while ( 0 <= (sbits64) aSig ); | |
| 2873 | sigMean = aSig + alternateASig; | |
| 2874 | if ( ( sigMean < 0 ) || ( ( sigMean == 0 ) && ( q & 1 ) ) ) { | |
| 2875 | aSig = alternateASig; | |
| 2876 | } | |
| 2877 | zSign = ( (sbits64) aSig < 0 ); | |
| 2878 | if ( zSign ) aSig = - aSig; | |
| 2879 | return normalizeRoundAndPackFloat64( aSign ^ zSign, bExp, aSig ); | |
| 2880 | ||
| 2881 | } | |
| 2882 | ||
| 2883 | /*---------------------------------------------------------------------------- | |
| 2884 | | Returns the square root of the double-precision floating-point value `a'. | |
| 2885 | | The operation is performed according to the IEC/IEEE Standard for Binary | |
| 2886 | | Floating-Point Arithmetic. | |
| 2887 | *----------------------------------------------------------------------------*/ | |
| 2888 | ||
| 2889 | float64 float64_sqrt( float64 a ) | |
| 2890 | { | |
| 2891 | flag aSign; | |
| 2892 | int16 aExp, zExp; | |
| 2893 | bits64 aSig, zSig, doubleZSig; | |
| 2894 | bits64 rem0, rem1, term0, term1; | |
| 2895 | // float64 z; | |
| 2896 | ||
| 2897 | aSig = extractFloat64Frac( a ); | |
| 2898 | aExp = extractFloat64Exp( a ); | |
| 2899 | aSign = extractFloat64Sign( a ); | |
| 2900 | if ( aExp == 0x7FF ) { | |
| 2901 | if ( aSig ) return propagateFloat64NaN( a, a ); | |
| 2902 | if ( ! aSign ) return a; | |
| 2903 | float_raise( float_flag_invalid ); | |
| 2904 | return float64_default_nan; | |
| 2905 | } | |
| 2906 | if ( aSign ) { | |
| 2907 | if ( ( aExp | aSig ) == 0 ) return a; | |
| 2908 | float_raise( float_flag_invalid ); | |
| 2909 | return float64_default_nan; | |
| 2910 | } | |
| 2911 | if ( aExp == 0 ) { | |
| 2912 | if ( aSig == 0 ) return 0; | |
| 2913 | normalizeFloat64Subnormal( aSig, &aExp, &aSig ); | |
| 2914 | } | |
| 2915 | zExp = ( ( aExp - 0x3FF )>>1 ) + 0x3FE; | |
| 2916 | aSig |= LIT64( 0x0010000000000000 ); | |
| 2917 | zSig = estimateSqrt32( aExp, aSig>>21 ); | |
| 2918 | aSig <<= 9 - ( aExp & 1 ); | |
| 2919 | zSig = estimateDiv128To64( aSig, 0, zSig<<32 ) + ( zSig<<30 ); | |
| 2920 | if ( ( zSig & 0x1FF ) <= 5 ) { | |
| 2921 | doubleZSig = zSig<<1; | |
| 2922 | mul64To128( zSig, zSig, &term0, &term1 ); | |
| 2923 | sub128( aSig, 0, term0, term1, &rem0, &rem1 ); | |
| 2924 | while ( (sbits64) rem0 < 0 ) { | |
| 2925 | --zSig; | |
| 2926 | doubleZSig -= 2; | |
| 2927 | add128( rem0, rem1, zSig>>63, doubleZSig | 1, &rem0, &rem1 ); | |
| 2928 | } | |
| 2929 | zSig |= ( ( rem0 | rem1 ) != 0 ); | |
| 2930 | } | |
| 2931 | return roundAndPackFloat64( 0, zExp, zSig ); | |
| 2932 | ||
| 2933 | } | |
| 2934 | ||
| 2935 | /*---------------------------------------------------------------------------- | |
| 2936 | | Returns 1 if the double-precision floating-point value `a' is equal to the | |
| 2937 | | corresponding value `b', and 0 otherwise. The comparison is performed | |
| 2938 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2939 | *----------------------------------------------------------------------------*/ | |
| 2940 | ||
| 2941 | flag float64_eq( float64 a, float64 b ) | |
| 2942 | { | |
| 2943 | ||
| 2944 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 2945 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 2946 | ) { | |
| 2947 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | |
| 2948 | float_raise( float_flag_invalid ); | |
| 2949 | } | |
| 2950 | return 0; | |
| 2951 | } | |
| 2952 | return ( a == b ) || ( (bits64) ( ( a | b )<<1 ) == 0 ); | |
| 2953 | ||
| 2954 | } | |
| 2955 | ||
| 2956 | /*---------------------------------------------------------------------------- | |
| 2957 | | Returns 1 if the double-precision floating-point value `a' is less than or | |
| 2958 | | equal to the corresponding value `b', and 0 otherwise. The comparison is | |
| 2959 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 2960 | | Arithmetic. | |
| 2961 | *----------------------------------------------------------------------------*/ | |
| 2962 | ||
| 2963 | flag float64_le( float64 a, float64 b ) | |
| 2964 | { | |
| 2965 | flag aSign, bSign; | |
| 2966 | ||
| 2967 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 2968 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 2969 | ) { | |
| 2970 | float_raise( float_flag_invalid ); | |
| 2971 | return 0; | |
| 2972 | } | |
| 2973 | aSign = extractFloat64Sign( a ); | |
| 2974 | bSign = extractFloat64Sign( b ); | |
| 2975 | if ( aSign != bSign ) return aSign || ( (bits64) ( ( a | b )<<1 ) == 0 ); | |
| 2976 | return ( a == b ) || ( aSign ^ ( a < b ) ); | |
| 2977 | ||
| 2978 | } | |
| 2979 | ||
| 2980 | /*---------------------------------------------------------------------------- | |
| 2981 | | Returns 1 if the double-precision floating-point value `a' is less than | |
| 2982 | | the corresponding value `b', and 0 otherwise. The comparison is performed | |
| 2983 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 2984 | *----------------------------------------------------------------------------*/ | |
| 2985 | ||
| 2986 | flag float64_lt( float64 a, float64 b ) | |
| 2987 | { | |
| 2988 | flag aSign, bSign; | |
| 2989 | ||
| 2990 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 2991 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 2992 | ) { | |
| 2993 | float_raise( float_flag_invalid ); | |
| 2994 | return 0; | |
| 2995 | } | |
| 2996 | aSign = extractFloat64Sign( a ); | |
| 2997 | bSign = extractFloat64Sign( b ); | |
| 2998 | if ( aSign != bSign ) return aSign && ( (bits64) ( ( a | b )<<1 ) != 0 ); | |
| 2999 | return ( a != b ) && ( aSign ^ ( a < b ) ); | |
| 3000 | ||
| 3001 | } | |
| 3002 | ||
| 3003 | /*---------------------------------------------------------------------------- | |
| 3004 | | Returns 1 if the double-precision floating-point value `a' is equal to the | |
| 3005 | | corresponding value `b', and 0 otherwise. The invalid exception is raised | |
| 3006 | | if either operand is a NaN. Otherwise, the comparison is performed | |
| 3007 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3008 | *----------------------------------------------------------------------------*/ | |
| 3009 | ||
| 3010 | flag float64_eq_signaling( float64 a, float64 b ) | |
| 3011 | { | |
| 3012 | ||
| 3013 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 3014 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 3015 | ) { | |
| 3016 | float_raise( float_flag_invalid ); | |
| 3017 | return 0; | |
| 3018 | } | |
| 3019 | return ( a == b ) || ( (bits64) ( ( a | b )<<1 ) == 0 ); | |
| 3020 | ||
| 3021 | } | |
| 3022 | ||
| 3023 | /*---------------------------------------------------------------------------- | |
| 3024 | | Returns 1 if the double-precision floating-point value `a' is less than or | |
| 3025 | | equal to the corresponding value `b', and 0 otherwise. Quiet NaNs do not | |
| 3026 | | cause an exception. Otherwise, the comparison is performed according to the | |
| 3027 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3028 | *----------------------------------------------------------------------------*/ | |
| 3029 | ||
| 3030 | flag float64_le_quiet( float64 a, float64 b ) | |
| 3031 | { | |
| 3032 | flag aSign, bSign; | |
| 3033 | // int16 aExp, bExp; | |
| 3034 | ||
| 3035 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 3036 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 3037 | ) { | |
| 3038 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | |
| 3039 | float_raise( float_flag_invalid ); | |
| 3040 | } | |
| 3041 | return 0; | |
| 3042 | } | |
| 3043 | aSign = extractFloat64Sign( a ); | |
| 3044 | bSign = extractFloat64Sign( b ); | |
| 3045 | if ( aSign != bSign ) return aSign || ( (bits64) ( ( a | b )<<1 ) == 0 ); | |
| 3046 | return ( a == b ) || ( aSign ^ ( a < b ) ); | |
| 3047 | ||
| 3048 | } | |
| 3049 | ||
| 3050 | /*---------------------------------------------------------------------------- | |
| 3051 | | Returns 1 if the double-precision floating-point value `a' is less than | |
| 3052 | | the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause an | |
| 3053 | | exception. Otherwise, the comparison is performed according to the IEC/IEEE | |
| 3054 | | Standard for Binary Floating-Point Arithmetic. | |
| 3055 | *----------------------------------------------------------------------------*/ | |
| 3056 | ||
| 3057 | flag float64_lt_quiet( float64 a, float64 b ) | |
| 3058 | { | |
| 3059 | flag aSign, bSign; | |
| 3060 | ||
| 3061 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | |
| 3062 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | |
| 3063 | ) { | |
| 3064 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | |
| 3065 | float_raise( float_flag_invalid ); | |
| 3066 | } | |
| 3067 | return 0; | |
| 3068 | } | |
| 3069 | aSign = extractFloat64Sign( a ); | |
| 3070 | bSign = extractFloat64Sign( b ); | |
| 3071 | if ( aSign != bSign ) return aSign && ( (bits64) ( ( a | b )<<1 ) != 0 ); | |
| 3072 | return ( a != b ) && ( aSign ^ ( a < b ) ); | |
| 3073 | ||
| 3074 | } | |
| 3075 | ||
| 3076 | #ifdef FLOATX80 | |
| 3077 | ||
| 3078 | /*---------------------------------------------------------------------------- | |
| 3079 | | Returns the result of converting the extended double-precision floating- | |
| 3080 | | point value `a' to the 32-bit two's complement integer format. The | |
| 3081 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3082 | | Floating-Point Arithmetic---which means in particular that the conversion | |
| 3083 | | is rounded according to the current rounding mode. If `a' is a NaN, the | |
| 3084 | | largest positive integer is returned. Otherwise, if the conversion | |
| 3085 | | overflows, the largest integer with the same sign as `a' is returned. | |
| 3086 | *----------------------------------------------------------------------------*/ | |
| 3087 | ||
| 3088 | int32 floatx80_to_int32( floatx80 a ) | |
| 3089 | { | |
| 3090 | flag aSign; | |
| 3091 | int32 aExp, shiftCount; | |
| 3092 | bits64 aSig; | |
| 3093 | ||
| 3094 | aSig = extractFloatx80Frac( a ); | |
| 3095 | aExp = extractFloatx80Exp( a ); | |
| 3096 | aSign = extractFloatx80Sign( a ); | |
| 3097 | if ( ( aExp == 0x7FFF ) && (bits64) ( aSig<<1 ) ) aSign = 0; | |
| 3098 | shiftCount = 0x4037 - aExp; | |
| 3099 | if ( shiftCount <= 0 ) shiftCount = 1; | |
| 3100 | shift64RightJamming( aSig, shiftCount, &aSig ); | |
| 3101 | return roundAndPackInt32( aSign, aSig ); | |
| 3102 | ||
| 3103 | } | |
| 3104 | ||
| 3105 | /*---------------------------------------------------------------------------- | |
| 3106 | | Returns the result of converting the extended double-precision floating- | |
| 3107 | | point value `a' to the 32-bit two's complement integer format. The | |
| 3108 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3109 | | Floating-Point Arithmetic, except that the conversion is always rounded | |
| 3110 | | toward zero. If `a' is a NaN, the largest positive integer is returned. | |
| 3111 | | Otherwise, if the conversion overflows, the largest integer with the same | |
| 3112 | | sign as `a' is returned. | |
| 3113 | *----------------------------------------------------------------------------*/ | |
| 3114 | ||
| 3115 | int32 floatx80_to_int32_round_to_zero( floatx80 a ) | |
| 3116 | { | |
| 3117 | flag aSign; | |
| 3118 | int32 aExp, shiftCount; | |
| 3119 | bits64 aSig, savedASig; | |
| 3120 | int32 z; | |
| 3121 | ||
| 3122 | aSig = extractFloatx80Frac( a ); | |
| 3123 | aExp = extractFloatx80Exp( a ); | |
| 3124 | aSign = extractFloatx80Sign( a ); | |
| 3125 | if ( 0x401E < aExp ) { | |
| 3126 | if ( ( aExp == 0x7FFF ) && (bits64) ( aSig<<1 ) ) aSign = 0; | |
| 3127 | goto invalid; | |
| 3128 | } | |
| 3129 | else if ( aExp < 0x3FFF ) { | |
| 3130 | if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; | |
| 3131 | return 0; | |
| 3132 | } | |
| 3133 | shiftCount = 0x403E - aExp; | |
| 3134 | savedASig = aSig; | |
| 3135 | aSig >>= shiftCount; | |
| 3136 | z = aSig; | |
| 3137 | if ( aSign ) z = - z; | |
| 3138 | if ( ( z < 0 ) ^ aSign ) { | |
| 3139 | invalid: | |
| 3140 | float_raise( float_flag_invalid ); | |
| 3141 | return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF; | |
| 3142 | } | |
| 3143 | if ( ( aSig<<shiftCount ) != savedASig ) { | |
| 3144 | float_exception_flags |= float_flag_inexact; | |
| 3145 | } | |
| 3146 | return z; | |
| 3147 | ||
| 3148 | } | |
| 3149 | ||
| 3150 | /*---------------------------------------------------------------------------- | |
| 3151 | | Returns the result of converting the extended double-precision floating- | |
| 3152 | | point value `a' to the 64-bit two's complement integer format. The | |
| 3153 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3154 | | Floating-Point Arithmetic---which means in particular that the conversion | |
| 3155 | | is rounded according to the current rounding mode. If `a' is a NaN, | |
| 3156 | | the largest positive integer is returned. Otherwise, if the conversion | |
| 3157 | | overflows, the largest integer with the same sign as `a' is returned. | |
| 3158 | *----------------------------------------------------------------------------*/ | |
| 3159 | ||
| 3160 | int64 floatx80_to_int64( floatx80 a ) | |
| 3161 | { | |
| 3162 | flag aSign; | |
| 3163 | int32 aExp, shiftCount; | |
| 3164 | bits64 aSig, aSigExtra; | |
| 3165 | ||
| 3166 | aSig = extractFloatx80Frac( a ); | |
| 3167 | aExp = extractFloatx80Exp( a ); | |
| 3168 | aSign = extractFloatx80Sign( a ); | |
| 3169 | shiftCount = 0x403E - aExp; | |
| 3170 | if ( shiftCount <= 0 ) { | |
| 3171 | if ( shiftCount ) { | |
| 3172 | float_raise( float_flag_invalid ); | |
| 3173 | if ( ! aSign | |
| 3174 | || ( ( aExp == 0x7FFF ) | |
| 3175 | && ( aSig != LIT64( 0x8000000000000000 ) ) ) | |
| 3176 | ) { | |
| 3177 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 3178 | } | |
| 3179 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 3180 | } | |
| 3181 | aSigExtra = 0; | |
| 3182 | } | |
| 3183 | else { | |
| 3184 | shift64ExtraRightJamming( aSig, 0, shiftCount, &aSig, &aSigExtra ); | |
| 3185 | } | |
| 3186 | return roundAndPackInt64( aSign, aSig, aSigExtra ); | |
| 3187 | ||
| 3188 | } | |
| 3189 | ||
| 3190 | /*---------------------------------------------------------------------------- | |
| 3191 | | Returns the result of converting the extended double-precision floating- | |
| 3192 | | point value `a' to the 64-bit two's complement integer format. The | |
| 3193 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3194 | | Floating-Point Arithmetic, except that the conversion is always rounded | |
| 3195 | | toward zero. If `a' is a NaN, the largest positive integer is returned. | |
| 3196 | | Otherwise, if the conversion overflows, the largest integer with the same | |
| 3197 | | sign as `a' is returned. | |
| 3198 | *----------------------------------------------------------------------------*/ | |
| 3199 | ||
| 3200 | int64 floatx80_to_int64_round_to_zero( floatx80 a ) | |
| 3201 | { | |
| 3202 | flag aSign; | |
| 3203 | int32 aExp, shiftCount; | |
| 3204 | bits64 aSig; | |
| 3205 | int64 z; | |
| 3206 | ||
| 3207 | aSig = extractFloatx80Frac( a ); | |
| 3208 | aExp = extractFloatx80Exp( a ); | |
| 3209 | aSign = extractFloatx80Sign( a ); | |
| 3210 | shiftCount = aExp - 0x403E; | |
| 3211 | if ( 0 <= shiftCount ) { | |
| 3212 | aSig &= LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 3213 | if ( ( a.high != 0xC03E ) || aSig ) { | |
| 3214 | float_raise( float_flag_invalid ); | |
| 3215 | if ( ! aSign || ( ( aExp == 0x7FFF ) && aSig ) ) { | |
| 3216 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 3217 | } | |
| 3218 | } | |
| 3219 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 3220 | } | |
| 3221 | else if ( aExp < 0x3FFF ) { | |
| 3222 | if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; | |
| 3223 | return 0; | |
| 3224 | } | |
| 3225 | z = aSig>>( - shiftCount ); | |
| 3226 | if ( (bits64) ( aSig<<( shiftCount & 63 ) ) ) { | |
| 3227 | float_exception_flags |= float_flag_inexact; | |
| 3228 | } | |
| 3229 | if ( aSign ) z = - z; | |
| 3230 | return z; | |
| 3231 | ||
| 3232 | } | |
| 3233 | ||
| 3234 | /*---------------------------------------------------------------------------- | |
| 3235 | | Returns the result of converting the extended double-precision floating- | |
| 3236 | | point value `a' to the single-precision floating-point format. The | |
| 3237 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3238 | | Floating-Point Arithmetic. | |
| 3239 | *----------------------------------------------------------------------------*/ | |
| 3240 | ||
| 3241 | float32 floatx80_to_float32( floatx80 a ) | |
| 3242 | { | |
| 3243 | flag aSign; | |
| 3244 | int32 aExp; | |
| 3245 | bits64 aSig; | |
| 3246 | ||
| 3247 | aSig = extractFloatx80Frac( a ); | |
| 3248 | aExp = extractFloatx80Exp( a ); | |
| 3249 | aSign = extractFloatx80Sign( a ); | |
| 3250 | if ( aExp == 0x7FFF ) { | |
| 3251 | if ( (bits64) ( aSig<<1 ) ) { | |
| 3252 | return commonNaNToFloat32( floatx80ToCommonNaN( a ) ); | |
| 3253 | } | |
| 3254 | return packFloat32( aSign, 0xFF, 0 ); | |
| 3255 | } | |
| 3256 | shift64RightJamming( aSig, 33, &aSig ); | |
| 3257 | if ( aExp || aSig ) aExp -= 0x3F81; | |
| 3258 | return roundAndPackFloat32( aSign, aExp, aSig ); | |
| 3259 | ||
| 3260 | } | |
| 3261 | ||
| 3262 | /*---------------------------------------------------------------------------- | |
| 3263 | | Returns the result of converting the extended double-precision floating- | |
| 3264 | | point value `a' to the double-precision floating-point format. The | |
| 3265 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3266 | | Floating-Point Arithmetic. | |
| 3267 | *----------------------------------------------------------------------------*/ | |
| 3268 | ||
| 3269 | float64 floatx80_to_float64( floatx80 a ) | |
| 3270 | { | |
| 3271 | flag aSign; | |
| 3272 | int32 aExp; | |
| 3273 | bits64 aSig, zSig; | |
| 3274 | ||
| 3275 | aSig = extractFloatx80Frac( a ); | |
| 3276 | aExp = extractFloatx80Exp( a ); | |
| 3277 | aSign = extractFloatx80Sign( a ); | |
| 3278 | if ( aExp == 0x7FFF ) { | |
| 3279 | if ( (bits64) ( aSig<<1 ) ) { | |
| 3280 | return commonNaNToFloat64( floatx80ToCommonNaN( a ) ); | |
| 3281 | } | |
| 3282 | return packFloat64( aSign, 0x7FF, 0 ); | |
| 3283 | } | |
| 3284 | shift64RightJamming( aSig, 1, &zSig ); | |
| 3285 | if ( aExp || aSig ) aExp -= 0x3C01; | |
| 3286 | return roundAndPackFloat64( aSign, aExp, zSig ); | |
| 3287 | ||
| 3288 | } | |
| 3289 | ||
| 3290 | #ifdef FLOAT128 | |
| 3291 | ||
| 3292 | /*---------------------------------------------------------------------------- | |
| 3293 | | Returns the result of converting the extended double-precision floating- | |
| 3294 | | point value `a' to the quadruple-precision floating-point format. The | |
| 3295 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 3296 | | Floating-Point Arithmetic. | |
| 3297 | *----------------------------------------------------------------------------*/ | |
| 3298 | ||
| 3299 | float128 floatx80_to_float128( floatx80 a ) | |
| 3300 | { | |
| 3301 | flag aSign; | |
| 3302 | int16 aExp; | |
| 3303 | bits64 aSig, zSig0, zSig1; | |
| 3304 | ||
| 3305 | aSig = extractFloatx80Frac( a ); | |
| 3306 | aExp = extractFloatx80Exp( a ); | |
| 3307 | aSign = extractFloatx80Sign( a ); | |
| 3308 | if ( ( aExp == 0x7FFF ) && (bits64) ( aSig<<1 ) ) { | |
| 3309 | return commonNaNToFloat128( floatx80ToCommonNaN( a ) ); | |
| 3310 | } | |
| 3311 | shift128Right( aSig<<1, 0, 16, &zSig0, &zSig1 ); | |
| 3312 | return packFloat128( aSign, aExp, zSig0, zSig1 ); | |
| 3313 | ||
| 3314 | } | |
| 3315 | ||
| 3316 | #endif | |
| 3317 | ||
| 3318 | /*---------------------------------------------------------------------------- | |
| 3319 | | Rounds the extended double-precision floating-point value `a' to an integer, | |
| 3320 | | and returns the result as an extended quadruple-precision floating-point | |
| 3321 | | value. The operation is performed according to the IEC/IEEE Standard for | |
| 3322 | | Binary Floating-Point Arithmetic. | |
| 3323 | *----------------------------------------------------------------------------*/ | |
| 3324 | ||
| 3325 | floatx80 floatx80_round_to_int( floatx80 a ) | |
| 3326 | { | |
| 3327 | flag aSign; | |
| 3328 | int32 aExp; | |
| 3329 | bits64 lastBitMask, roundBitsMask; | |
| 3330 | int8 roundingMode; | |
| 3331 | floatx80 z; | |
| 3332 | ||
| 3333 | aExp = extractFloatx80Exp( a ); | |
| 3334 | if ( 0x403E <= aExp ) { | |
| 3335 | if ( ( aExp == 0x7FFF ) && (bits64) ( extractFloatx80Frac( a )<<1 ) ) { | |
| 3336 | return propagateFloatx80NaN( a, a ); | |
| 3337 | } | |
| 3338 | return a; | |
| 3339 | } | |
| 3340 | if ( aExp < 0x3FFF ) { | |
| 3341 | if ( ( aExp == 0 ) | |
| 3342 | && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) { | |
| 3343 | return a; | |
| 3344 | } | |
| 3345 | float_exception_flags |= float_flag_inexact; | |
| 3346 | aSign = extractFloatx80Sign( a ); | |
| 3347 | switch ( float_rounding_mode ) { | |
| 3348 | case float_round_nearest_even: | |
| 3349 | if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 ) | |
| 3350 | ) { | |
| 3351 | return | |
| 3352 | packFloatx80( aSign, 0x3FFF, LIT64( 0x8000000000000000 ) ); | |
| 3353 | } | |
| 3354 | break; | |
| 3355 | case float_round_down: | |
| 3356 | return | |
| 3357 | aSign ? | |
| 3358 | packFloatx80( 1, 0x3FFF, LIT64( 0x8000000000000000 ) ) | |
| 3359 | : packFloatx80( 0, 0, 0 ); | |
| 3360 | case float_round_up: | |
| 3361 | return | |
| 3362 | aSign ? packFloatx80( 1, 0, 0 ) | |
| 3363 | : packFloatx80( 0, 0x3FFF, LIT64( 0x8000000000000000 ) ); | |
| 3364 | } | |
| 3365 | return packFloatx80( aSign, 0, 0 ); | |
| 3366 | } | |
| 3367 | lastBitMask = 1; | |
| 3368 | lastBitMask <<= 0x403E - aExp; | |
| 3369 | roundBitsMask = lastBitMask - 1; | |
| 3370 | z = a; | |
| 3371 | roundingMode = float_rounding_mode; | |
| 3372 | if ( roundingMode == float_round_nearest_even ) { | |
| 3373 | z.low += lastBitMask>>1; | |
| 3374 | if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; | |
| 3375 | } | |
| 3376 | else if ( roundingMode != float_round_to_zero ) { | |
| 3377 | if ( extractFloatx80Sign( z ) ^ ( roundingMode == float_round_up ) ) { | |
| 3378 | z.low += roundBitsMask; | |
| 3379 | } | |
| 3380 | } | |
| 3381 | z.low &= ~ roundBitsMask; | |
| 3382 | if ( z.low == 0 ) { | |
| 3383 | ++z.high; | |
| 3384 | z.low = LIT64( 0x8000000000000000 ); | |
| 3385 | } | |
| 3386 | if ( z.low != a.low ) float_exception_flags |= float_flag_inexact; | |
| 3387 | return z; | |
| 3388 | ||
| 3389 | } | |
| 3390 | ||
| 3391 | /*---------------------------------------------------------------------------- | |
| 3392 | | Returns the result of adding the absolute values of the extended double- | |
| 3393 | | precision floating-point values `a' and `b'. If `zSign' is 1, the sum is | |
| 3394 | | negated before being returned. `zSign' is ignored if the result is a NaN. | |
| 3395 | | The addition is performed according to the IEC/IEEE Standard for Binary | |
| 3396 | | Floating-Point Arithmetic. | |
| 3397 | *----------------------------------------------------------------------------*/ | |
| 3398 | ||
| 3399 | static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |
| 3400 | { | |
| 3401 | int32 aExp, bExp, zExp; | |
| 3402 | bits64 aSig, bSig, zSig0, zSig1; | |
| 3403 | int32 expDiff; | |
| 3404 | ||
| 3405 | aSig = extractFloatx80Frac( a ); | |
| 3406 | aExp = extractFloatx80Exp( a ); | |
| 3407 | bSig = extractFloatx80Frac( b ); | |
| 3408 | bExp = extractFloatx80Exp( b ); | |
| 3409 | expDiff = aExp - bExp; | |
| 3410 | if ( 0 < expDiff ) { | |
| 3411 | if ( aExp == 0x7FFF ) { | |
| 3412 | if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3413 | return a; | |
| 3414 | } | |
| 3415 | if ( bExp == 0 ) --expDiff; | |
| 3416 | shift64ExtraRightJamming( bSig, 0, expDiff, &bSig, &zSig1 ); | |
| 3417 | zExp = aExp; | |
| 3418 | } | |
| 3419 | else if ( expDiff < 0 ) { | |
| 3420 | if ( bExp == 0x7FFF ) { | |
| 3421 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3422 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3423 | } | |
| 3424 | if ( aExp == 0 ) ++expDiff; | |
| 3425 | shift64ExtraRightJamming( aSig, 0, - expDiff, &aSig, &zSig1 ); | |
| 3426 | zExp = bExp; | |
| 3427 | } | |
| 3428 | else { | |
| 3429 | if ( aExp == 0x7FFF ) { | |
| 3430 | if ( (bits64) ( ( aSig | bSig )<<1 ) ) { | |
| 3431 | return propagateFloatx80NaN( a, b ); | |
| 3432 | } | |
| 3433 | return a; | |
| 3434 | } | |
| 3435 | zSig1 = 0; | |
| 3436 | zSig0 = aSig + bSig; | |
| 3437 | if ( aExp == 0 ) { | |
| 3438 | normalizeFloatx80Subnormal( zSig0, &zExp, &zSig0 ); | |
| 3439 | goto roundAndPack; | |
| 3440 | } | |
| 3441 | zExp = aExp; | |
| 3442 | goto shiftRight1; | |
| 3443 | } | |
| 3444 | zSig0 = aSig + bSig; | |
| 3445 | if ( (sbits64) zSig0 < 0 ) goto roundAndPack; | |
| 3446 | shiftRight1: | |
| 3447 | shift64ExtraRightJamming( zSig0, zSig1, 1, &zSig0, &zSig1 ); | |
| 3448 | zSig0 |= LIT64( 0x8000000000000000 ); | |
| 3449 | ++zExp; | |
| 3450 | roundAndPack: | |
| 3451 | return | |
| 3452 | roundAndPackFloatx80( | |
| 3453 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | |
| 3454 | ||
| 3455 | } | |
| 3456 | ||
| 3457 | /*---------------------------------------------------------------------------- | |
| 3458 | | Returns the result of subtracting the absolute values of the extended | |
| 3459 | | double-precision floating-point values `a' and `b'. If `zSign' is 1, the | |
| 3460 | | difference is negated before being returned. `zSign' is ignored if the | |
| 3461 | | result is a NaN. The subtraction is performed according to the IEC/IEEE | |
| 3462 | | Standard for Binary Floating-Point Arithmetic. | |
| 3463 | *----------------------------------------------------------------------------*/ | |
| 3464 | ||
| 3465 | static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |
| 3466 | { | |
| 3467 | int32 aExp, bExp, zExp; | |
| 3468 | bits64 aSig, bSig, zSig0, zSig1; | |
| 3469 | int32 expDiff; | |
| 3470 | floatx80 z; | |
| 3471 | ||
| 3472 | aSig = extractFloatx80Frac( a ); | |
| 3473 | aExp = extractFloatx80Exp( a ); | |
| 3474 | bSig = extractFloatx80Frac( b ); | |
| 3475 | bExp = extractFloatx80Exp( b ); | |
| 3476 | expDiff = aExp - bExp; | |
| 3477 | if ( 0 < expDiff ) goto aExpBigger; | |
| 3478 | if ( expDiff < 0 ) goto bExpBigger; | |
| 3479 | if ( aExp == 0x7FFF ) { | |
| 3480 | if ( (bits64) ( ( aSig | bSig )<<1 ) ) { | |
| 3481 | return propagateFloatx80NaN( a, b ); | |
| 3482 | } | |
| 3483 | float_raise( float_flag_invalid ); | |
| 3484 | z.low = floatx80_default_nan_low; | |
| 3485 | z.high = floatx80_default_nan_high; | |
| 3486 | return z; | |
| 3487 | } | |
| 3488 | if ( aExp == 0 ) { | |
| 3489 | aExp = 1; | |
| 3490 | bExp = 1; | |
| 3491 | } | |
| 3492 | zSig1 = 0; | |
| 3493 | if ( bSig < aSig ) goto aBigger; | |
| 3494 | if ( aSig < bSig ) goto bBigger; | |
| 3495 | return packFloatx80( float_rounding_mode == float_round_down, 0, 0 ); | |
| 3496 | bExpBigger: | |
| 3497 | if ( bExp == 0x7FFF ) { | |
| 3498 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3499 | return packFloatx80( zSign ^ 1, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3500 | } | |
| 3501 | if ( aExp == 0 ) ++expDiff; | |
| 3502 | shift128RightJamming( aSig, 0, - expDiff, &aSig, &zSig1 ); | |
| 3503 | bBigger: | |
| 3504 | sub128( bSig, 0, aSig, zSig1, &zSig0, &zSig1 ); | |
| 3505 | zExp = bExp; | |
| 3506 | zSign ^= 1; | |
| 3507 | goto normalizeRoundAndPack; | |
| 3508 | aExpBigger: | |
| 3509 | if ( aExp == 0x7FFF ) { | |
| 3510 | if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3511 | return a; | |
| 3512 | } | |
| 3513 | if ( bExp == 0 ) --expDiff; | |
| 3514 | shift128RightJamming( bSig, 0, expDiff, &bSig, &zSig1 ); | |
| 3515 | aBigger: | |
| 3516 | sub128( aSig, 0, bSig, zSig1, &zSig0, &zSig1 ); | |
| 3517 | zExp = aExp; | |
| 3518 | normalizeRoundAndPack: | |
| 3519 | return | |
| 3520 | normalizeRoundAndPackFloatx80( | |
| 3521 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | |
| 3522 | ||
| 3523 | } | |
| 3524 | ||
| 3525 | /*---------------------------------------------------------------------------- | |
| 3526 | | Returns the result of adding the extended double-precision floating-point | |
| 3527 | | values `a' and `b'. The operation is performed according to the IEC/IEEE | |
| 3528 | | Standard for Binary Floating-Point Arithmetic. | |
| 3529 | *----------------------------------------------------------------------------*/ | |
| 3530 | ||
| 3531 | floatx80 floatx80_add( floatx80 a, floatx80 b ) | |
| 3532 | { | |
| 3533 | flag aSign, bSign; | |
| 3534 | ||
| 3535 | aSign = extractFloatx80Sign( a ); | |
| 3536 | bSign = extractFloatx80Sign( b ); | |
| 3537 | if ( aSign == bSign ) { | |
| 3538 | return addFloatx80Sigs( a, b, aSign ); | |
| 3539 | } | |
| 3540 | else { | |
| 3541 | return subFloatx80Sigs( a, b, aSign ); | |
| 3542 | } | |
| 3543 | ||
| 3544 | } | |
| 3545 | ||
| 3546 | /*---------------------------------------------------------------------------- | |
| 3547 | | Returns the result of subtracting the extended double-precision floating- | |
| 3548 | | point values `a' and `b'. The operation is performed according to the | |
| 3549 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3550 | *----------------------------------------------------------------------------*/ | |
| 3551 | ||
| 3552 | floatx80 floatx80_sub( floatx80 a, floatx80 b ) | |
| 3553 | { | |
| 3554 | flag aSign, bSign; | |
| 3555 | ||
| 3556 | aSign = extractFloatx80Sign( a ); | |
| 3557 | bSign = extractFloatx80Sign( b ); | |
| 3558 | if ( aSign == bSign ) { | |
| 3559 | return subFloatx80Sigs( a, b, aSign ); | |
| 3560 | } | |
| 3561 | else { | |
| 3562 | return addFloatx80Sigs( a, b, aSign ); | |
| 3563 | } | |
| 3564 | ||
| 3565 | } | |
| 3566 | ||
| 3567 | /*---------------------------------------------------------------------------- | |
| 3568 | | Returns the result of multiplying the extended double-precision floating- | |
| 3569 | | point values `a' and `b'. The operation is performed according to the | |
| 3570 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3571 | *----------------------------------------------------------------------------*/ | |
| 3572 | ||
| 3573 | floatx80 floatx80_mul( floatx80 a, floatx80 b ) | |
| 3574 | { | |
| 3575 | flag aSign, bSign, zSign; | |
| 3576 | int32 aExp, bExp, zExp; | |
| 3577 | bits64 aSig, bSig, zSig0, zSig1; | |
| 3578 | floatx80 z; | |
| 3579 | ||
| 3580 | aSig = extractFloatx80Frac( a ); | |
| 3581 | aExp = extractFloatx80Exp( a ); | |
| 3582 | aSign = extractFloatx80Sign( a ); | |
| 3583 | bSig = extractFloatx80Frac( b ); | |
| 3584 | bExp = extractFloatx80Exp( b ); | |
| 3585 | bSign = extractFloatx80Sign( b ); | |
| 3586 | zSign = aSign ^ bSign; | |
| 3587 | if ( aExp == 0x7FFF ) { | |
| 3588 | if ( (bits64) ( aSig<<1 ) | |
| 3589 | || ( ( bExp == 0x7FFF ) && (bits64) ( bSig<<1 ) ) ) { | |
| 3590 | return propagateFloatx80NaN( a, b ); | |
| 3591 | } | |
| 3592 | if ( ( bExp | bSig ) == 0 ) goto invalid; | |
| 3593 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3594 | } | |
| 3595 | if ( bExp == 0x7FFF ) { | |
| 3596 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3597 | if ( ( aExp | aSig ) == 0 ) { | |
| 3598 | invalid: | |
| 3599 | float_raise( float_flag_invalid ); | |
| 3600 | z.low = floatx80_default_nan_low; | |
| 3601 | z.high = floatx80_default_nan_high; | |
| 3602 | return z; | |
| 3603 | } | |
| 3604 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3605 | } | |
| 3606 | if ( aExp == 0 ) { | |
| 3607 | if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 ); | |
| 3608 | normalizeFloatx80Subnormal( aSig, &aExp, &aSig ); | |
| 3609 | } | |
| 3610 | if ( bExp == 0 ) { | |
| 3611 | if ( bSig == 0 ) return packFloatx80( zSign, 0, 0 ); | |
| 3612 | normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); | |
| 3613 | } | |
| 3614 | zExp = aExp + bExp - 0x3FFE; | |
| 3615 | mul64To128( aSig, bSig, &zSig0, &zSig1 ); | |
| 3616 | if ( 0 < (sbits64) zSig0 ) { | |
| 3617 | shortShift128Left( zSig0, zSig1, 1, &zSig0, &zSig1 ); | |
| 3618 | --zExp; | |
| 3619 | } | |
| 3620 | return | |
| 3621 | roundAndPackFloatx80( | |
| 3622 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | |
| 3623 | ||
| 3624 | } | |
| 3625 | ||
| 3626 | /*---------------------------------------------------------------------------- | |
| 3627 | | Returns the result of dividing the extended double-precision floating-point | |
| 3628 | | value `a' by the corresponding value `b'. The operation is performed | |
| 3629 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3630 | *----------------------------------------------------------------------------*/ | |
| 3631 | ||
| 3632 | floatx80 floatx80_div( floatx80 a, floatx80 b ) | |
| 3633 | { | |
| 3634 | flag aSign, bSign, zSign; | |
| 3635 | int32 aExp, bExp, zExp; | |
| 3636 | bits64 aSig, bSig, zSig0, zSig1; | |
| 3637 | bits64 rem0, rem1, rem2, term0, term1, term2; | |
| 3638 | floatx80 z; | |
| 3639 | ||
| 3640 | aSig = extractFloatx80Frac( a ); | |
| 3641 | aExp = extractFloatx80Exp( a ); | |
| 3642 | aSign = extractFloatx80Sign( a ); | |
| 3643 | bSig = extractFloatx80Frac( b ); | |
| 3644 | bExp = extractFloatx80Exp( b ); | |
| 3645 | bSign = extractFloatx80Sign( b ); | |
| 3646 | zSign = aSign ^ bSign; | |
| 3647 | if ( aExp == 0x7FFF ) { | |
| 3648 | if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3649 | if ( bExp == 0x7FFF ) { | |
| 3650 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3651 | goto invalid; | |
| 3652 | } | |
| 3653 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3654 | } | |
| 3655 | if ( bExp == 0x7FFF ) { | |
| 3656 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3657 | return packFloatx80( zSign, 0, 0 ); | |
| 3658 | } | |
| 3659 | if ( bExp == 0 ) { | |
| 3660 | if ( bSig == 0 ) { | |
| 3661 | if ( ( aExp | aSig ) == 0 ) { | |
| 3662 | invalid: | |
| 3663 | float_raise( float_flag_invalid ); | |
| 3664 | z.low = floatx80_default_nan_low; | |
| 3665 | z.high = floatx80_default_nan_high; | |
| 3666 | return z; | |
| 3667 | } | |
| 3668 | float_raise( float_flag_divbyzero ); | |
| 3669 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 3670 | } | |
| 3671 | normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); | |
| 3672 | } | |
| 3673 | if ( aExp == 0 ) { | |
| 3674 | if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 ); | |
| 3675 | normalizeFloatx80Subnormal( aSig, &aExp, &aSig ); | |
| 3676 | } | |
| 3677 | zExp = aExp - bExp + 0x3FFE; | |
| 3678 | rem1 = 0; | |
| 3679 | if ( bSig <= aSig ) { | |
| 3680 | shift128Right( aSig, 0, 1, &aSig, &rem1 ); | |
| 3681 | ++zExp; | |
| 3682 | } | |
| 3683 | zSig0 = estimateDiv128To64( aSig, rem1, bSig ); | |
| 3684 | mul64To128( bSig, zSig0, &term0, &term1 ); | |
| 3685 | sub128( aSig, rem1, term0, term1, &rem0, &rem1 ); | |
| 3686 | while ( (sbits64) rem0 < 0 ) { | |
| 3687 | --zSig0; | |
| 3688 | add128( rem0, rem1, 0, bSig, &rem0, &rem1 ); | |
| 3689 | } | |
| 3690 | zSig1 = estimateDiv128To64( rem1, 0, bSig ); | |
| 3691 | if ( (bits64) ( zSig1<<1 ) <= 8 ) { | |
| 3692 | mul64To128( bSig, zSig1, &term1, &term2 ); | |
| 3693 | sub128( rem1, 0, term1, term2, &rem1, &rem2 ); | |
| 3694 | while ( (sbits64) rem1 < 0 ) { | |
| 3695 | --zSig1; | |
| 3696 | add128( rem1, rem2, 0, bSig, &rem1, &rem2 ); | |
| 3697 | } | |
| 3698 | zSig1 |= ( ( rem1 | rem2 ) != 0 ); | |
| 3699 | } | |
| 3700 | return | |
| 3701 | roundAndPackFloatx80( | |
| 3702 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | |
| 3703 | ||
| 3704 | } | |
| 3705 | ||
| 3706 | /*---------------------------------------------------------------------------- | |
| 3707 | | Returns the remainder of the extended double-precision floating-point value | |
| 3708 | | `a' with respect to the corresponding value `b'. The operation is performed | |
| 3709 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3710 | *----------------------------------------------------------------------------*/ | |
| 3711 | ||
| 3712 | floatx80 floatx80_rem( floatx80 a, floatx80 b ) | |
| 3713 | { | |
| 3714 | flag aSign, bSign, zSign; | |
| 3715 | int32 aExp, bExp, expDiff; | |
| 3716 | bits64 aSig0, aSig1, bSig; | |
| 3717 | bits64 q, term0, term1, alternateASig0, alternateASig1; | |
| 3718 | floatx80 z; | |
| 3719 | ||
| 3720 | aSig0 = extractFloatx80Frac( a ); | |
| 3721 | aExp = extractFloatx80Exp( a ); | |
| 3722 | aSign = extractFloatx80Sign( a ); | |
| 3723 | bSig = extractFloatx80Frac( b ); | |
| 3724 | bExp = extractFloatx80Exp( b ); | |
| 3725 | bSign = extractFloatx80Sign( b ); | |
| 3726 | if ( aExp == 0x7FFF ) { | |
| 3727 | if ( (bits64) ( aSig0<<1 ) | |
| 3728 | || ( ( bExp == 0x7FFF ) && (bits64) ( bSig<<1 ) ) ) { | |
| 3729 | return propagateFloatx80NaN( a, b ); | |
| 3730 | } | |
| 3731 | goto invalid; | |
| 3732 | } | |
| 3733 | if ( bExp == 0x7FFF ) { | |
| 3734 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | |
| 3735 | return a; | |
| 3736 | } | |
| 3737 | if ( bExp == 0 ) { | |
| 3738 | if ( bSig == 0 ) { | |
| 3739 | invalid: | |
| 3740 | float_raise( float_flag_invalid ); | |
| 3741 | z.low = floatx80_default_nan_low; | |
| 3742 | z.high = floatx80_default_nan_high; | |
| 3743 | return z; | |
| 3744 | } | |
| 3745 | normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); | |
| 3746 | } | |
| 3747 | if ( aExp == 0 ) { | |
| 3748 | if ( (bits64) ( aSig0<<1 ) == 0 ) return a; | |
| 3749 | normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 ); | |
| 3750 | } | |
| 3751 | bSig |= LIT64( 0x8000000000000000 ); | |
| 3752 | zSign = aSign; | |
| 3753 | expDiff = aExp - bExp; | |
| 3754 | aSig1 = 0; | |
| 3755 | if ( expDiff < 0 ) { | |
| 3756 | if ( expDiff < -1 ) return a; | |
| 3757 | shift128Right( aSig0, 0, 1, &aSig0, &aSig1 ); | |
| 3758 | expDiff = 0; | |
| 3759 | } | |
| 3760 | q = ( bSig <= aSig0 ); | |
| 3761 | if ( q ) aSig0 -= bSig; | |
| 3762 | expDiff -= 64; | |
| 3763 | while ( 0 < expDiff ) { | |
| 3764 | q = estimateDiv128To64( aSig0, aSig1, bSig ); | |
| 3765 | q = ( 2 < q ) ? q - 2 : 0; | |
| 3766 | mul64To128( bSig, q, &term0, &term1 ); | |
| 3767 | sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 ); | |
| 3768 | shortShift128Left( aSig0, aSig1, 62, &aSig0, &aSig1 ); | |
| 3769 | expDiff -= 62; | |
| 3770 | } | |
| 3771 | expDiff += 64; | |
| 3772 | if ( 0 < expDiff ) { | |
| 3773 | q = estimateDiv128To64( aSig0, aSig1, bSig ); | |
| 3774 | q = ( 2 < q ) ? q - 2 : 0; | |
| 3775 | q >>= 64 - expDiff; | |
| 3776 | mul64To128( bSig, q<<( 64 - expDiff ), &term0, &term1 ); | |
| 3777 | sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 ); | |
| 3778 | shortShift128Left( 0, bSig, 64 - expDiff, &term0, &term1 ); | |
| 3779 | while ( le128( term0, term1, aSig0, aSig1 ) ) { | |
| 3780 | ++q; | |
| 3781 | sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 ); | |
| 3782 | } | |
| 3783 | } | |
| 3784 | else { | |
| 3785 | term1 = 0; | |
| 3786 | term0 = bSig; | |
| 3787 | } | |
| 3788 | sub128( term0, term1, aSig0, aSig1, &alternateASig0, &alternateASig1 ); | |
| 3789 | if ( lt128( alternateASig0, alternateASig1, aSig0, aSig1 ) | |
| 3790 | || ( eq128( alternateASig0, alternateASig1, aSig0, aSig1 ) | |
| 3791 | && ( q & 1 ) ) | |
| 3792 | ) { | |
| 3793 | aSig0 = alternateASig0; | |
| 3794 | aSig1 = alternateASig1; | |
| 3795 | zSign = ! zSign; | |
| 3796 | } | |
| 3797 | return | |
| 3798 | normalizeRoundAndPackFloatx80( | |
| 3799 | 80, zSign, bExp + expDiff, aSig0, aSig1 ); | |
| 3800 | ||
| 3801 | } | |
| 3802 | ||
| 3803 | /*---------------------------------------------------------------------------- | |
| 3804 | | Returns the square root of the extended double-precision floating-point | |
| 3805 | | value `a'. The operation is performed according to the IEC/IEEE Standard | |
| 3806 | | for Binary Floating-Point Arithmetic. | |
| 3807 | *----------------------------------------------------------------------------*/ | |
| 3808 | ||
| 3809 | floatx80 floatx80_sqrt( floatx80 a ) | |
| 3810 | { | |
| 3811 | flag aSign; | |
| 3812 | int32 aExp, zExp; | |
| 3813 | bits64 aSig0, aSig1, zSig0, zSig1, doubleZSig0; | |
| 3814 | bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; | |
| 3815 | floatx80 z; | |
| 3816 | ||
| 3817 | aSig0 = extractFloatx80Frac( a ); | |
| 3818 | aExp = extractFloatx80Exp( a ); | |
| 3819 | aSign = extractFloatx80Sign( a ); | |
| 3820 | if ( aExp == 0x7FFF ) { | |
| 3821 | if ( (bits64) ( aSig0<<1 ) ) return propagateFloatx80NaN( a, a ); | |
| 3822 | if ( ! aSign ) return a; | |
| 3823 | goto invalid; | |
| 3824 | } | |
| 3825 | if ( aSign ) { | |
| 3826 | if ( ( aExp | aSig0 ) == 0 ) return a; | |
| 3827 | invalid: | |
| 3828 | float_raise( float_flag_invalid ); | |
| 3829 | z.low = floatx80_default_nan_low; | |
| 3830 | z.high = floatx80_default_nan_high; | |
| 3831 | return z; | |
| 3832 | } | |
| 3833 | if ( aExp == 0 ) { | |
| 3834 | if ( aSig0 == 0 ) return packFloatx80( 0, 0, 0 ); | |
| 3835 | normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 ); | |
| 3836 | } | |
| 3837 | zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFF; | |
| 3838 | zSig0 = estimateSqrt32( aExp, aSig0>>32 ); | |
| 3839 | shift128Right( aSig0, 0, 2 + ( aExp & 1 ), &aSig0, &aSig1 ); | |
| 3840 | zSig0 = estimateDiv128To64( aSig0, aSig1, zSig0<<32 ) + ( zSig0<<30 ); | |
| 3841 | doubleZSig0 = zSig0<<1; | |
| 3842 | mul64To128( zSig0, zSig0, &term0, &term1 ); | |
| 3843 | sub128( aSig0, aSig1, term0, term1, &rem0, &rem1 ); | |
| 3844 | while ( (sbits64) rem0 < 0 ) { | |
| 3845 | --zSig0; | |
| 3846 | doubleZSig0 -= 2; | |
| 3847 | add128( rem0, rem1, zSig0>>63, doubleZSig0 | 1, &rem0, &rem1 ); | |
| 3848 | } | |
| 3849 | zSig1 = estimateDiv128To64( rem1, 0, doubleZSig0 ); | |
| 3850 | if ( ( zSig1 & LIT64( 0x3FFFFFFFFFFFFFFF ) ) <= 5 ) { | |
| 3851 | if ( zSig1 == 0 ) zSig1 = 1; | |
| 3852 | mul64To128( doubleZSig0, zSig1, &term1, &term2 ); | |
| 3853 | sub128( rem1, 0, term1, term2, &rem1, &rem2 ); | |
| 3854 | mul64To128( zSig1, zSig1, &term2, &term3 ); | |
| 3855 | sub192( rem1, rem2, 0, 0, term2, term3, &rem1, &rem2, &rem3 ); | |
| 3856 | while ( (sbits64) rem1 < 0 ) { | |
| 3857 | --zSig1; | |
| 3858 | shortShift128Left( 0, zSig1, 1, &term2, &term3 ); | |
| 3859 | term3 |= 1; | |
| 3860 | term2 |= doubleZSig0; | |
| 3861 | add192( rem1, rem2, rem3, 0, term2, term3, &rem1, &rem2, &rem3 ); | |
| 3862 | } | |
| 3863 | zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 ); | |
| 3864 | } | |
| 3865 | shortShift128Left( 0, zSig1, 1, &zSig0, &zSig1 ); | |
| 3866 | zSig0 |= doubleZSig0; | |
| 3867 | return | |
| 3868 | roundAndPackFloatx80( | |
| 3869 | floatx80_rounding_precision, 0, zExp, zSig0, zSig1 ); | |
| 3870 | ||
| 3871 | } | |
| 3872 | ||
| 3873 | /*---------------------------------------------------------------------------- | |
| 3874 | | Returns 1 if the extended double-precision floating-point value `a' is | |
| 3875 | | equal to the corresponding value `b', and 0 otherwise. The comparison is | |
| 3876 | | performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 3877 | | Arithmetic. | |
| 3878 | *----------------------------------------------------------------------------*/ | |
| 3879 | ||
| 3880 | flag floatx80_eq( floatx80 a, floatx80 b ) | |
| 3881 | { | |
| 3882 | ||
| 3883 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 3884 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 3885 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 3886 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 3887 | ) { | |
| 3888 | if ( floatx80_is_signaling_nan( a ) | |
| 3889 | || floatx80_is_signaling_nan( b ) ) { | |
| 3890 | float_raise( float_flag_invalid ); | |
| 3891 | } | |
| 3892 | return 0; | |
| 3893 | } | |
| 3894 | return | |
| 3895 | ( a.low == b.low ) | |
| 3896 | && ( ( a.high == b.high ) | |
| 3897 | || ( ( a.low == 0 ) | |
| 3898 | && ( (bits16) ( ( a.high | b.high )<<1 ) == 0 ) ) | |
| 3899 | ); | |
| 3900 | ||
| 3901 | } | |
| 3902 | ||
| 3903 | /*---------------------------------------------------------------------------- | |
| 3904 | | Returns 1 if the extended double-precision floating-point value `a' is | |
| 3905 | | less than or equal to the corresponding value `b', and 0 otherwise. The | |
| 3906 | | comparison is performed according to the IEC/IEEE Standard for Binary | |
| 3907 | | Floating-Point Arithmetic. | |
| 3908 | *----------------------------------------------------------------------------*/ | |
| 3909 | ||
| 3910 | flag floatx80_le( floatx80 a, floatx80 b ) | |
| 3911 | { | |
| 3912 | flag aSign, bSign; | |
| 3913 | ||
| 3914 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 3915 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 3916 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 3917 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 3918 | ) { | |
| 3919 | float_raise( float_flag_invalid ); | |
| 3920 | return 0; | |
| 3921 | } | |
| 3922 | aSign = extractFloatx80Sign( a ); | |
| 3923 | bSign = extractFloatx80Sign( b ); | |
| 3924 | if ( aSign != bSign ) { | |
| 3925 | return | |
| 3926 | aSign | |
| 3927 | || ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 3928 | == 0 ); | |
| 3929 | } | |
| 3930 | return | |
| 3931 | aSign ? le128( b.high, b.low, a.high, a.low ) | |
| 3932 | : le128( a.high, a.low, b.high, b.low ); | |
| 3933 | ||
| 3934 | } | |
| 3935 | ||
| 3936 | /*---------------------------------------------------------------------------- | |
| 3937 | | Returns 1 if the extended double-precision floating-point value `a' is | |
| 3938 | | less than the corresponding value `b', and 0 otherwise. The comparison | |
| 3939 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 3940 | | Arithmetic. | |
| 3941 | *----------------------------------------------------------------------------*/ | |
| 3942 | ||
| 3943 | flag floatx80_lt( floatx80 a, floatx80 b ) | |
| 3944 | { | |
| 3945 | flag aSign, bSign; | |
| 3946 | ||
| 3947 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 3948 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 3949 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 3950 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 3951 | ) { | |
| 3952 | float_raise( float_flag_invalid ); | |
| 3953 | return 0; | |
| 3954 | } | |
| 3955 | aSign = extractFloatx80Sign( a ); | |
| 3956 | bSign = extractFloatx80Sign( b ); | |
| 3957 | if ( aSign != bSign ) { | |
| 3958 | return | |
| 3959 | aSign | |
| 3960 | && ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 3961 | != 0 ); | |
| 3962 | } | |
| 3963 | return | |
| 3964 | aSign ? lt128( b.high, b.low, a.high, a.low ) | |
| 3965 | : lt128( a.high, a.low, b.high, b.low ); | |
| 3966 | ||
| 3967 | } | |
| 3968 | ||
| 3969 | /*---------------------------------------------------------------------------- | |
| 3970 | | Returns 1 if the extended double-precision floating-point value `a' is equal | |
| 3971 | | to the corresponding value `b', and 0 otherwise. The invalid exception is | |
| 3972 | | raised if either operand is a NaN. Otherwise, the comparison is performed | |
| 3973 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 3974 | *----------------------------------------------------------------------------*/ | |
| 3975 | ||
| 3976 | flag floatx80_eq_signaling( floatx80 a, floatx80 b ) | |
| 3977 | { | |
| 3978 | ||
| 3979 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 3980 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 3981 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 3982 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 3983 | ) { | |
| 3984 | float_raise( float_flag_invalid ); | |
| 3985 | return 0; | |
| 3986 | } | |
| 3987 | return | |
| 3988 | ( a.low == b.low ) | |
| 3989 | && ( ( a.high == b.high ) | |
| 3990 | || ( ( a.low == 0 ) | |
| 3991 | && ( (bits16) ( ( a.high | b.high )<<1 ) == 0 ) ) | |
| 3992 | ); | |
| 3993 | ||
| 3994 | } | |
| 3995 | ||
| 3996 | /*---------------------------------------------------------------------------- | |
| 3997 | | Returns 1 if the extended double-precision floating-point value `a' is less | |
| 3998 | | than or equal to the corresponding value `b', and 0 otherwise. Quiet NaNs | |
| 3999 | | do not cause an exception. Otherwise, the comparison is performed according | |
| 4000 | | to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 4001 | *----------------------------------------------------------------------------*/ | |
| 4002 | ||
| 4003 | flag floatx80_le_quiet( floatx80 a, floatx80 b ) | |
| 4004 | { | |
| 4005 | flag aSign, bSign; | |
| 4006 | ||
| 4007 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 4008 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 4009 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 4010 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 4011 | ) { | |
| 4012 | if ( floatx80_is_signaling_nan( a ) | |
| 4013 | || floatx80_is_signaling_nan( b ) ) { | |
| 4014 | float_raise( float_flag_invalid ); | |
| 4015 | } | |
| 4016 | return 0; | |
| 4017 | } | |
| 4018 | aSign = extractFloatx80Sign( a ); | |
| 4019 | bSign = extractFloatx80Sign( b ); | |
| 4020 | if ( aSign != bSign ) { | |
| 4021 | return | |
| 4022 | aSign | |
| 4023 | || ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 4024 | == 0 ); | |
| 4025 | } | |
| 4026 | return | |
| 4027 | aSign ? le128( b.high, b.low, a.high, a.low ) | |
| 4028 | : le128( a.high, a.low, b.high, b.low ); | |
| 4029 | ||
| 4030 | } | |
| 4031 | ||
| 4032 | /*---------------------------------------------------------------------------- | |
| 4033 | | Returns 1 if the extended double-precision floating-point value `a' is less | |
| 4034 | | than the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause | |
| 4035 | | an exception. Otherwise, the comparison is performed according to the | |
| 4036 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 4037 | *----------------------------------------------------------------------------*/ | |
| 4038 | ||
| 4039 | flag floatx80_lt_quiet( floatx80 a, floatx80 b ) | |
| 4040 | { | |
| 4041 | flag aSign, bSign; | |
| 4042 | ||
| 4043 | if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) | |
| 4044 | && (bits64) ( extractFloatx80Frac( a )<<1 ) ) | |
| 4045 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | |
| 4046 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | |
| 4047 | ) { | |
| 4048 | if ( floatx80_is_signaling_nan( a ) | |
| 4049 | || floatx80_is_signaling_nan( b ) ) { | |
| 4050 | float_raise( float_flag_invalid ); | |
| 4051 | } | |
| 4052 | return 0; | |
| 4053 | } | |
| 4054 | aSign = extractFloatx80Sign( a ); | |
| 4055 | bSign = extractFloatx80Sign( b ); | |
| 4056 | if ( aSign != bSign ) { | |
| 4057 | return | |
| 4058 | aSign | |
| 4059 | && ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 4060 | != 0 ); | |
| 4061 | } | |
| 4062 | return | |
| 4063 | aSign ? lt128( b.high, b.low, a.high, a.low ) | |
| 4064 | : lt128( a.high, a.low, b.high, b.low ); | |
| 4065 | ||
| 4066 | } | |
| 4067 | ||
| 4068 | #endif | |
| 4069 | ||
| 4070 | #ifdef FLOAT128 | |
| 4071 | ||
| 4072 | /*---------------------------------------------------------------------------- | |
| 4073 | | Returns the result of converting the quadruple-precision floating-point | |
| 4074 | | value `a' to the 32-bit two's complement integer format. The conversion | |
| 4075 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4076 | | Arithmetic---which means in particular that the conversion is rounded | |
| 4077 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 4078 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 4079 | | largest integer with the same sign as `a' is returned. | |
| 4080 | *----------------------------------------------------------------------------*/ | |
| 4081 | ||
| 4082 | int32 float128_to_int32( float128 a ) | |
| 4083 | { | |
| 4084 | flag aSign; | |
| 4085 | int32 aExp, shiftCount; | |
| 4086 | bits64 aSig0, aSig1; | |
| 4087 | ||
| 4088 | aSig1 = extractFloat128Frac1( a ); | |
| 4089 | aSig0 = extractFloat128Frac0( a ); | |
| 4090 | aExp = extractFloat128Exp( a ); | |
| 4091 | aSign = extractFloat128Sign( a ); | |
| 4092 | if ( ( aExp == 0x7FFF ) && ( aSig0 | aSig1 ) ) aSign = 0; | |
| 4093 | if ( aExp ) aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4094 | aSig0 |= ( aSig1 != 0 ); | |
| 4095 | shiftCount = 0x4028 - aExp; | |
| 4096 | if ( 0 < shiftCount ) shift64RightJamming( aSig0, shiftCount, &aSig0 ); | |
| 4097 | return roundAndPackInt32( aSign, aSig0 ); | |
| 4098 | ||
| 4099 | } | |
| 4100 | ||
| 4101 | /*---------------------------------------------------------------------------- | |
| 4102 | | Returns the result of converting the quadruple-precision floating-point | |
| 4103 | | value `a' to the 32-bit two's complement integer format. The conversion | |
| 4104 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4105 | | Arithmetic, except that the conversion is always rounded toward zero. If | |
| 4106 | | `a' is a NaN, the largest positive integer is returned. Otherwise, if the | |
| 4107 | | conversion overflows, the largest integer with the same sign as `a' is | |
| 4108 | | returned. | |
| 4109 | *----------------------------------------------------------------------------*/ | |
| 4110 | ||
| 4111 | int32 float128_to_int32_round_to_zero( float128 a ) | |
| 4112 | { | |
| 4113 | flag aSign; | |
| 4114 | int32 aExp, shiftCount; | |
| 4115 | bits64 aSig0, aSig1, savedASig; | |
| 4116 | int32 z; | |
| 4117 | ||
| 4118 | aSig1 = extractFloat128Frac1( a ); | |
| 4119 | aSig0 = extractFloat128Frac0( a ); | |
| 4120 | aExp = extractFloat128Exp( a ); | |
| 4121 | aSign = extractFloat128Sign( a ); | |
| 4122 | aSig0 |= ( aSig1 != 0 ); | |
| 4123 | if ( 0x401E < aExp ) { | |
| 4124 | if ( ( aExp == 0x7FFF ) && aSig0 ) aSign = 0; | |
| 4125 | goto invalid; | |
| 4126 | } | |
| 4127 | else if ( aExp < 0x3FFF ) { | |
| 4128 | if ( aExp || aSig0 ) float_exception_flags |= float_flag_inexact; | |
| 4129 | return 0; | |
| 4130 | } | |
| 4131 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4132 | shiftCount = 0x402F - aExp; | |
| 4133 | savedASig = aSig0; | |
| 4134 | aSig0 >>= shiftCount; | |
| 4135 | z = aSig0; | |
| 4136 | if ( aSign ) z = - z; | |
| 4137 | if ( ( z < 0 ) ^ aSign ) { | |
| 4138 | invalid: | |
| 4139 | float_raise( float_flag_invalid ); | |
| 4140 | return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF; | |
| 4141 | } | |
| 4142 | if ( ( aSig0<<shiftCount ) != savedASig ) { | |
| 4143 | float_exception_flags |= float_flag_inexact; | |
| 4144 | } | |
| 4145 | return z; | |
| 4146 | ||
| 4147 | } | |
| 4148 | ||
| 4149 | /*---------------------------------------------------------------------------- | |
| 4150 | | Returns the result of converting the quadruple-precision floating-point | |
| 4151 | | value `a' to the 64-bit two's complement integer format. The conversion | |
| 4152 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4153 | | Arithmetic---which means in particular that the conversion is rounded | |
| 4154 | | according to the current rounding mode. If `a' is a NaN, the largest | |
| 4155 | | positive integer is returned. Otherwise, if the conversion overflows, the | |
| 4156 | | largest integer with the same sign as `a' is returned. | |
| 4157 | *----------------------------------------------------------------------------*/ | |
| 4158 | ||
| 4159 | int64 float128_to_int64( float128 a ) | |
| 4160 | { | |
| 4161 | flag aSign; | |
| 4162 | int32 aExp, shiftCount; | |
| 4163 | bits64 aSig0, aSig1; | |
| 4164 | ||
| 4165 | aSig1 = extractFloat128Frac1( a ); | |
| 4166 | aSig0 = extractFloat128Frac0( a ); | |
| 4167 | aExp = extractFloat128Exp( a ); | |
| 4168 | aSign = extractFloat128Sign( a ); | |
| 4169 | if ( aExp ) aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4170 | shiftCount = 0x402F - aExp; | |
| 4171 | if ( shiftCount <= 0 ) { | |
| 4172 | if ( 0x403E < aExp ) { | |
| 4173 | float_raise( float_flag_invalid ); | |
| 4174 | if ( ! aSign | |
| 4175 | || ( ( aExp == 0x7FFF ) | |
| 4176 | && ( aSig1 || ( aSig0 != LIT64( 0x0001000000000000 ) ) ) | |
| 4177 | ) | |
| 4178 | ) { | |
| 4179 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 4180 | } | |
| 4181 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 4182 | } | |
| 4183 | shortShift128Left( aSig0, aSig1, - shiftCount, &aSig0, &aSig1 ); | |
| 4184 | } | |
| 4185 | else { | |
| 4186 | shift64ExtraRightJamming( aSig0, aSig1, shiftCount, &aSig0, &aSig1 ); | |
| 4187 | } | |
| 4188 | return roundAndPackInt64( aSign, aSig0, aSig1 ); | |
| 4189 | ||
| 4190 | } | |
| 4191 | ||
| 4192 | /*---------------------------------------------------------------------------- | |
| 4193 | | Returns the result of converting the quadruple-precision floating-point | |
| 4194 | | value `a' to the 64-bit two's complement integer format. The conversion | |
| 4195 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4196 | | Arithmetic, except that the conversion is always rounded toward zero. | |
| 4197 | | If `a' is a NaN, the largest positive integer is returned. Otherwise, if | |
| 4198 | | the conversion overflows, the largest integer with the same sign as `a' is | |
| 4199 | | returned. | |
| 4200 | *----------------------------------------------------------------------------*/ | |
| 4201 | ||
| 4202 | int64 float128_to_int64_round_to_zero( float128 a ) | |
| 4203 | { | |
| 4204 | flag aSign; | |
| 4205 | int32 aExp, shiftCount; | |
| 4206 | bits64 aSig0, aSig1; | |
| 4207 | int64 z; | |
| 4208 | ||
| 4209 | aSig1 = extractFloat128Frac1( a ); | |
| 4210 | aSig0 = extractFloat128Frac0( a ); | |
| 4211 | aExp = extractFloat128Exp( a ); | |
| 4212 | aSign = extractFloat128Sign( a ); | |
| 4213 | if ( aExp ) aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4214 | shiftCount = aExp - 0x402F; | |
| 4215 | if ( 0 < shiftCount ) { | |
| 4216 | if ( 0x403E <= aExp ) { | |
| 4217 | aSig0 &= LIT64( 0x0000FFFFFFFFFFFF ); | |
| 4218 | if ( ( a.high == LIT64( 0xC03E000000000000 ) ) | |
| 4219 | && ( aSig1 < LIT64( 0x0002000000000000 ) ) ) { | |
| 4220 | if ( aSig1 ) float_exception_flags |= float_flag_inexact; | |
| 4221 | } | |
| 4222 | else { | |
| 4223 | float_raise( float_flag_invalid ); | |
| 4224 | if ( ! aSign || ( ( aExp == 0x7FFF ) && ( aSig0 | aSig1 ) ) ) { | |
| 4225 | return LIT64( 0x7FFFFFFFFFFFFFFF ); | |
| 4226 | } | |
| 4227 | } | |
| 4228 | return (sbits64) LIT64( 0x8000000000000000 ); | |
| 4229 | } | |
| 4230 | z = ( aSig0<<shiftCount ) | ( aSig1>>( ( - shiftCount ) & 63 ) ); | |
| 4231 | if ( (bits64) ( aSig1<<shiftCount ) ) { | |
| 4232 | float_exception_flags |= float_flag_inexact; | |
| 4233 | } | |
| 4234 | } | |
| 4235 | else { | |
| 4236 | if ( aExp < 0x3FFF ) { | |
| 4237 | if ( aExp | aSig0 | aSig1 ) { | |
| 4238 | float_exception_flags |= float_flag_inexact; | |
| 4239 | } | |
| 4240 | return 0; | |
| 4241 | } | |
| 4242 | z = aSig0>>( - shiftCount ); | |
| 4243 | if ( aSig1 | |
| 4244 | || ( shiftCount && (bits64) ( aSig0<<( shiftCount & 63 ) ) ) ) { | |
| 4245 | float_exception_flags |= float_flag_inexact; | |
| 4246 | } | |
| 4247 | } | |
| 4248 | if ( aSign ) z = - z; | |
| 4249 | return z; | |
| 4250 | ||
| 4251 | } | |
| 4252 | ||
| 4253 | /*---------------------------------------------------------------------------- | |
| 4254 | | Returns the result of converting the quadruple-precision floating-point | |
| 4255 | | value `a' to the single-precision floating-point format. The conversion | |
| 4256 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4257 | | Arithmetic. | |
| 4258 | *----------------------------------------------------------------------------*/ | |
| 4259 | ||
| 4260 | float32 float128_to_float32( float128 a ) | |
| 4261 | { | |
| 4262 | flag aSign; | |
| 4263 | int32 aExp; | |
| 4264 | bits64 aSig0, aSig1; | |
| 4265 | bits32 zSig; | |
| 4266 | ||
| 4267 | aSig1 = extractFloat128Frac1( a ); | |
| 4268 | aSig0 = extractFloat128Frac0( a ); | |
| 4269 | aExp = extractFloat128Exp( a ); | |
| 4270 | aSign = extractFloat128Sign( a ); | |
| 4271 | if ( aExp == 0x7FFF ) { | |
| 4272 | if ( aSig0 | aSig1 ) { | |
| 4273 | return commonNaNToFloat32( float128ToCommonNaN( a ) ); | |
| 4274 | } | |
| 4275 | return packFloat32( aSign, 0xFF, 0 ); | |
| 4276 | } | |
| 4277 | aSig0 |= ( aSig1 != 0 ); | |
| 4278 | shift64RightJamming( aSig0, 18, &aSig0 ); | |
| 4279 | zSig = aSig0; | |
| 4280 | if ( aExp || zSig ) { | |
| 4281 | zSig |= 0x40000000; | |
| 4282 | aExp -= 0x3F81; | |
| 4283 | } | |
| 4284 | return roundAndPackFloat32( aSign, aExp, zSig ); | |
| 4285 | ||
| 4286 | } | |
| 4287 | ||
| 4288 | /*---------------------------------------------------------------------------- | |
| 4289 | | Returns the result of converting the quadruple-precision floating-point | |
| 4290 | | value `a' to the double-precision floating-point format. The conversion | |
| 4291 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 4292 | | Arithmetic. | |
| 4293 | *----------------------------------------------------------------------------*/ | |
| 4294 | ||
| 4295 | float64 float128_to_float64( float128 a ) | |
| 4296 | { | |
| 4297 | flag aSign; | |
| 4298 | int32 aExp; | |
| 4299 | bits64 aSig0, aSig1; | |
| 4300 | ||
| 4301 | aSig1 = extractFloat128Frac1( a ); | |
| 4302 | aSig0 = extractFloat128Frac0( a ); | |
| 4303 | aExp = extractFloat128Exp( a ); | |
| 4304 | aSign = extractFloat128Sign( a ); | |
| 4305 | if ( aExp == 0x7FFF ) { | |
| 4306 | if ( aSig0 | aSig1 ) { | |
| 4307 | return commonNaNToFloat64( float128ToCommonNaN( a ) ); | |
| 4308 | } | |
| 4309 | return packFloat64( aSign, 0x7FF, 0 ); | |
| 4310 | } | |
| 4311 | shortShift128Left( aSig0, aSig1, 14, &aSig0, &aSig1 ); | |
| 4312 | aSig0 |= ( aSig1 != 0 ); | |
| 4313 | if ( aExp || aSig0 ) { | |
| 4314 | aSig0 |= LIT64( 0x4000000000000000 ); | |
| 4315 | aExp -= 0x3C01; | |
| 4316 | } | |
| 4317 | return roundAndPackFloat64( aSign, aExp, aSig0 ); | |
| 4318 | ||
| 4319 | } | |
| 4320 | ||
| 4321 | #ifdef FLOATX80 | |
| 4322 | ||
| 4323 | /*---------------------------------------------------------------------------- | |
| 4324 | | Returns the result of converting the quadruple-precision floating-point | |
| 4325 | | value `a' to the extended double-precision floating-point format. The | |
| 4326 | | conversion is performed according to the IEC/IEEE Standard for Binary | |
| 4327 | | Floating-Point Arithmetic. | |
| 4328 | *----------------------------------------------------------------------------*/ | |
| 4329 | ||
| 4330 | floatx80 float128_to_floatx80( float128 a ) | |
| 4331 | { | |
| 4332 | flag aSign; | |
| 4333 | int32 aExp; | |
| 4334 | bits64 aSig0, aSig1; | |
| 4335 | ||
| 4336 | aSig1 = extractFloat128Frac1( a ); | |
| 4337 | aSig0 = extractFloat128Frac0( a ); | |
| 4338 | aExp = extractFloat128Exp( a ); | |
| 4339 | aSign = extractFloat128Sign( a ); | |
| 4340 | if ( aExp == 0x7FFF ) { | |
| 4341 | if ( aSig0 | aSig1 ) { | |
| 4342 | return commonNaNToFloatx80( float128ToCommonNaN( a ) ); | |
| 4343 | } | |
| 4344 | return packFloatx80( aSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | |
| 4345 | } | |
| 4346 | if ( aExp == 0 ) { | |
| 4347 | if ( ( aSig0 | aSig1 ) == 0 ) return packFloatx80( aSign, 0, 0 ); | |
| 4348 | normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); | |
| 4349 | } | |
| 4350 | else { | |
| 4351 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4352 | } | |
| 4353 | shortShift128Left( aSig0, aSig1, 15, &aSig0, &aSig1 ); | |
| 4354 | return roundAndPackFloatx80( 80, aSign, aExp, aSig0, aSig1 ); | |
| 4355 | ||
| 4356 | } | |
| 4357 | ||
| 4358 | #endif | |
| 4359 | ||
| 4360 | /*---------------------------------------------------------------------------- | |
| 4361 | | Rounds the quadruple-precision floating-point value `a' to an integer, and | |
| 4362 | | returns the result as a quadruple-precision floating-point value. The | |
| 4363 | | operation is performed according to the IEC/IEEE Standard for Binary | |
| 4364 | | Floating-Point Arithmetic. | |
| 4365 | *----------------------------------------------------------------------------*/ | |
| 4366 | ||
| 4367 | float128 float128_round_to_int( float128 a ) | |
| 4368 | { | |
| 4369 | flag aSign; | |
| 4370 | int32 aExp; | |
| 4371 | bits64 lastBitMask, roundBitsMask; | |
| 4372 | int8 roundingMode; | |
| 4373 | float128 z; | |
| 4374 | ||
| 4375 | aExp = extractFloat128Exp( a ); | |
| 4376 | if ( 0x402F <= aExp ) { | |
| 4377 | if ( 0x406F <= aExp ) { | |
| 4378 | if ( ( aExp == 0x7FFF ) | |
| 4379 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) | |
| 4380 | ) { | |
| 4381 | return propagateFloat128NaN( a, a ); | |
| 4382 | } | |
| 4383 | return a; | |
| 4384 | } | |
| 4385 | lastBitMask = 1; | |
| 4386 | lastBitMask = ( lastBitMask<<( 0x406E - aExp ) )<<1; | |
| 4387 | roundBitsMask = lastBitMask - 1; | |
| 4388 | z = a; | |
| 4389 | roundingMode = float_rounding_mode; | |
| 4390 | if ( roundingMode == float_round_nearest_even ) { | |
| 4391 | if ( lastBitMask ) { | |
| 4392 | add128( z.high, z.low, 0, lastBitMask>>1, &z.high, &z.low ); | |
| 4393 | if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; | |
| 4394 | } | |
| 4395 | else { | |
| 4396 | if ( (sbits64) z.low < 0 ) { | |
| 4397 | ++z.high; | |
| 4398 | if ( (bits64) ( z.low<<1 ) == 0 ) z.high &= ~1; | |
| 4399 | } | |
| 4400 | } | |
| 4401 | } | |
| 4402 | else if ( roundingMode != float_round_to_zero ) { | |
| 4403 | if ( extractFloat128Sign( z ) | |
| 4404 | ^ ( roundingMode == float_round_up ) ) { | |
| 4405 | add128( z.high, z.low, 0, roundBitsMask, &z.high, &z.low ); | |
| 4406 | } | |
| 4407 | } | |
| 4408 | z.low &= ~ roundBitsMask; | |
| 4409 | } | |
| 4410 | else { | |
| 4411 | if ( aExp < 0x3FFF ) { | |
| 4412 | if ( ( ( (bits64) ( a.high<<1 ) ) | a.low ) == 0 ) return a; | |
| 4413 | float_exception_flags |= float_flag_inexact; | |
| 4414 | aSign = extractFloat128Sign( a ); | |
| 4415 | switch ( float_rounding_mode ) { | |
| 4416 | case float_round_nearest_even: | |
| 4417 | if ( ( aExp == 0x3FFE ) | |
| 4418 | && ( extractFloat128Frac0( a ) | |
| 4419 | | extractFloat128Frac1( a ) ) | |
| 4420 | ) { | |
| 4421 | return packFloat128( aSign, 0x3FFF, 0, 0 ); | |
| 4422 | } | |
| 4423 | break; | |
| 4424 | case float_round_down: | |
| 4425 | return | |
| 4426 | aSign ? packFloat128( 1, 0x3FFF, 0, 0 ) | |
| 4427 | : packFloat128( 0, 0, 0, 0 ); | |
| 4428 | case float_round_up: | |
| 4429 | return | |
| 4430 | aSign ? packFloat128( 1, 0, 0, 0 ) | |
| 4431 | : packFloat128( 0, 0x3FFF, 0, 0 ); | |
| 4432 | } | |
| 4433 | return packFloat128( aSign, 0, 0, 0 ); | |
| 4434 | } | |
| 4435 | lastBitMask = 1; | |
| 4436 | lastBitMask <<= 0x402F - aExp; | |
| 4437 | roundBitsMask = lastBitMask - 1; | |
| 4438 | z.low = 0; | |
| 4439 | z.high = a.high; | |
| 4440 | roundingMode = float_rounding_mode; | |
| 4441 | if ( roundingMode == float_round_nearest_even ) { | |
| 4442 | z.high += lastBitMask>>1; | |
| 4443 | if ( ( ( z.high & roundBitsMask ) | a.low ) == 0 ) { | |
| 4444 | z.high &= ~ lastBitMask; | |
| 4445 | } | |
| 4446 | } | |
| 4447 | else if ( roundingMode != float_round_to_zero ) { | |
| 4448 | if ( extractFloat128Sign( z ) | |
| 4449 | ^ ( roundingMode == float_round_up ) ) { | |
| 4450 | z.high |= ( a.low != 0 ); | |
| 4451 | z.high += roundBitsMask; | |
| 4452 | } | |
| 4453 | } | |
| 4454 | z.high &= ~ roundBitsMask; | |
| 4455 | } | |
| 4456 | if ( ( z.low != a.low ) || ( z.high != a.high ) ) { | |
| 4457 | float_exception_flags |= float_flag_inexact; | |
| 4458 | } | |
| 4459 | return z; | |
| 4460 | ||
| 4461 | } | |
| 4462 | ||
| 4463 | /*---------------------------------------------------------------------------- | |
| 4464 | | Returns the result of adding the absolute values of the quadruple-precision | |
| 4465 | | floating-point values `a' and `b'. If `zSign' is 1, the sum is negated | |
| 4466 | | before being returned. `zSign' is ignored if the result is a NaN. | |
| 4467 | | The addition is performed according to the IEC/IEEE Standard for Binary | |
| 4468 | | Floating-Point Arithmetic. | |
| 4469 | *----------------------------------------------------------------------------*/ | |
| 4470 | ||
| 4471 | static float128 addFloat128Sigs( float128 a, float128 b, flag zSign ) | |
| 4472 | { | |
| 4473 | int32 aExp, bExp, zExp; | |
| 4474 | bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2; | |
| 4475 | int32 expDiff; | |
| 4476 | ||
| 4477 | aSig1 = extractFloat128Frac1( a ); | |
| 4478 | aSig0 = extractFloat128Frac0( a ); | |
| 4479 | aExp = extractFloat128Exp( a ); | |
| 4480 | bSig1 = extractFloat128Frac1( b ); | |
| 4481 | bSig0 = extractFloat128Frac0( b ); | |
| 4482 | bExp = extractFloat128Exp( b ); | |
| 4483 | expDiff = aExp - bExp; | |
| 4484 | if ( 0 < expDiff ) { | |
| 4485 | if ( aExp == 0x7FFF ) { | |
| 4486 | if ( aSig0 | aSig1 ) return propagateFloat128NaN( a, b ); | |
| 4487 | return a; | |
| 4488 | } | |
| 4489 | if ( bExp == 0 ) { | |
| 4490 | --expDiff; | |
| 4491 | } | |
| 4492 | else { | |
| 4493 | bSig0 |= LIT64( 0x0001000000000000 ); | |
| 4494 | } | |
| 4495 | shift128ExtraRightJamming( | |
| 4496 | bSig0, bSig1, 0, expDiff, &bSig0, &bSig1, &zSig2 ); | |
| 4497 | zExp = aExp; | |
| 4498 | } | |
| 4499 | else if ( expDiff < 0 ) { | |
| 4500 | if ( bExp == 0x7FFF ) { | |
| 4501 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4502 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 4503 | } | |
| 4504 | if ( aExp == 0 ) { | |
| 4505 | ++expDiff; | |
| 4506 | } | |
| 4507 | else { | |
| 4508 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4509 | } | |
| 4510 | shift128ExtraRightJamming( | |
| 4511 | aSig0, aSig1, 0, - expDiff, &aSig0, &aSig1, &zSig2 ); | |
| 4512 | zExp = bExp; | |
| 4513 | } | |
| 4514 | else { | |
| 4515 | if ( aExp == 0x7FFF ) { | |
| 4516 | if ( aSig0 | aSig1 | bSig0 | bSig1 ) { | |
| 4517 | return propagateFloat128NaN( a, b ); | |
| 4518 | } | |
| 4519 | return a; | |
| 4520 | } | |
| 4521 | add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 ); | |
| 4522 | if ( aExp == 0 ) return packFloat128( zSign, 0, zSig0, zSig1 ); | |
| 4523 | zSig2 = 0; | |
| 4524 | zSig0 |= LIT64( 0x0002000000000000 ); | |
| 4525 | zExp = aExp; | |
| 4526 | goto shiftRight1; | |
| 4527 | } | |
| 4528 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4529 | add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 ); | |
| 4530 | --zExp; | |
| 4531 | if ( zSig0 < LIT64( 0x0002000000000000 ) ) goto roundAndPack; | |
| 4532 | ++zExp; | |
| 4533 | shiftRight1: | |
| 4534 | shift128ExtraRightJamming( | |
| 4535 | zSig0, zSig1, zSig2, 1, &zSig0, &zSig1, &zSig2 ); | |
| 4536 | roundAndPack: | |
| 4537 | return roundAndPackFloat128( zSign, zExp, zSig0, zSig1, zSig2 ); | |
| 4538 | ||
| 4539 | } | |
| 4540 | ||
| 4541 | /*---------------------------------------------------------------------------- | |
| 4542 | | Returns the result of subtracting the absolute values of the quadruple- | |
| 4543 | | precision floating-point values `a' and `b'. If `zSign' is 1, the | |
| 4544 | | difference is negated before being returned. `zSign' is ignored if the | |
| 4545 | | result is a NaN. The subtraction is performed according to the IEC/IEEE | |
| 4546 | | Standard for Binary Floating-Point Arithmetic. | |
| 4547 | *----------------------------------------------------------------------------*/ | |
| 4548 | ||
| 4549 | static float128 subFloat128Sigs( float128 a, float128 b, flag zSign ) | |
| 4550 | { | |
| 4551 | int32 aExp, bExp, zExp; | |
| 4552 | bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1; | |
| 4553 | int32 expDiff; | |
| 4554 | float128 z; | |
| 4555 | ||
| 4556 | aSig1 = extractFloat128Frac1( a ); | |
| 4557 | aSig0 = extractFloat128Frac0( a ); | |
| 4558 | aExp = extractFloat128Exp( a ); | |
| 4559 | bSig1 = extractFloat128Frac1( b ); | |
| 4560 | bSig0 = extractFloat128Frac0( b ); | |
| 4561 | bExp = extractFloat128Exp( b ); | |
| 4562 | expDiff = aExp - bExp; | |
| 4563 | shortShift128Left( aSig0, aSig1, 14, &aSig0, &aSig1 ); | |
| 4564 | shortShift128Left( bSig0, bSig1, 14, &bSig0, &bSig1 ); | |
| 4565 | if ( 0 < expDiff ) goto aExpBigger; | |
| 4566 | if ( expDiff < 0 ) goto bExpBigger; | |
| 4567 | if ( aExp == 0x7FFF ) { | |
| 4568 | if ( aSig0 | aSig1 | bSig0 | bSig1 ) { | |
| 4569 | return propagateFloat128NaN( a, b ); | |
| 4570 | } | |
| 4571 | float_raise( float_flag_invalid ); | |
| 4572 | z.low = float128_default_nan_low; | |
| 4573 | z.high = float128_default_nan_high; | |
| 4574 | return z; | |
| 4575 | } | |
| 4576 | if ( aExp == 0 ) { | |
| 4577 | aExp = 1; | |
| 4578 | bExp = 1; | |
| 4579 | } | |
| 4580 | if ( bSig0 < aSig0 ) goto aBigger; | |
| 4581 | if ( aSig0 < bSig0 ) goto bBigger; | |
| 4582 | if ( bSig1 < aSig1 ) goto aBigger; | |
| 4583 | if ( aSig1 < bSig1 ) goto bBigger; | |
| 4584 | return packFloat128( float_rounding_mode == float_round_down, 0, 0, 0 ); | |
| 4585 | bExpBigger: | |
| 4586 | if ( bExp == 0x7FFF ) { | |
| 4587 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4588 | return packFloat128( zSign ^ 1, 0x7FFF, 0, 0 ); | |
| 4589 | } | |
| 4590 | if ( aExp == 0 ) { | |
| 4591 | ++expDiff; | |
| 4592 | } | |
| 4593 | else { | |
| 4594 | aSig0 |= LIT64( 0x4000000000000000 ); | |
| 4595 | } | |
| 4596 | shift128RightJamming( aSig0, aSig1, - expDiff, &aSig0, &aSig1 ); | |
| 4597 | bSig0 |= LIT64( 0x4000000000000000 ); | |
| 4598 | bBigger: | |
| 4599 | sub128( bSig0, bSig1, aSig0, aSig1, &zSig0, &zSig1 ); | |
| 4600 | zExp = bExp; | |
| 4601 | zSign ^= 1; | |
| 4602 | goto normalizeRoundAndPack; | |
| 4603 | aExpBigger: | |
| 4604 | if ( aExp == 0x7FFF ) { | |
| 4605 | if ( aSig0 | aSig1 ) return propagateFloat128NaN( a, b ); | |
| 4606 | return a; | |
| 4607 | } | |
| 4608 | if ( bExp == 0 ) { | |
| 4609 | --expDiff; | |
| 4610 | } | |
| 4611 | else { | |
| 4612 | bSig0 |= LIT64( 0x4000000000000000 ); | |
| 4613 | } | |
| 4614 | shift128RightJamming( bSig0, bSig1, expDiff, &bSig0, &bSig1 ); | |
| 4615 | aSig0 |= LIT64( 0x4000000000000000 ); | |
| 4616 | aBigger: | |
| 4617 | sub128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 ); | |
| 4618 | zExp = aExp; | |
| 4619 | normalizeRoundAndPack: | |
| 4620 | --zExp; | |
| 4621 | return normalizeRoundAndPackFloat128( zSign, zExp - 14, zSig0, zSig1 ); | |
| 4622 | ||
| 4623 | } | |
| 4624 | ||
| 4625 | /*---------------------------------------------------------------------------- | |
| 4626 | | Returns the result of adding the quadruple-precision floating-point values | |
| 4627 | | `a' and `b'. The operation is performed according to the IEC/IEEE Standard | |
| 4628 | | for Binary Floating-Point Arithmetic. | |
| 4629 | *----------------------------------------------------------------------------*/ | |
| 4630 | ||
| 4631 | float128 float128_add( float128 a, float128 b ) | |
| 4632 | { | |
| 4633 | flag aSign, bSign; | |
| 4634 | ||
| 4635 | aSign = extractFloat128Sign( a ); | |
| 4636 | bSign = extractFloat128Sign( b ); | |
| 4637 | if ( aSign == bSign ) { | |
| 4638 | return addFloat128Sigs( a, b, aSign ); | |
| 4639 | } | |
| 4640 | else { | |
| 4641 | return subFloat128Sigs( a, b, aSign ); | |
| 4642 | } | |
| 4643 | ||
| 4644 | } | |
| 4645 | ||
| 4646 | /*---------------------------------------------------------------------------- | |
| 4647 | | Returns the result of subtracting the quadruple-precision floating-point | |
| 4648 | | values `a' and `b'. The operation is performed according to the IEC/IEEE | |
| 4649 | | Standard for Binary Floating-Point Arithmetic. | |
| 4650 | *----------------------------------------------------------------------------*/ | |
| 4651 | ||
| 4652 | float128 float128_sub( float128 a, float128 b ) | |
| 4653 | { | |
| 4654 | flag aSign, bSign; | |
| 4655 | ||
| 4656 | aSign = extractFloat128Sign( a ); | |
| 4657 | bSign = extractFloat128Sign( b ); | |
| 4658 | if ( aSign == bSign ) { | |
| 4659 | return subFloat128Sigs( a, b, aSign ); | |
| 4660 | } | |
| 4661 | else { | |
| 4662 | return addFloat128Sigs( a, b, aSign ); | |
| 4663 | } | |
| 4664 | ||
| 4665 | } | |
| 4666 | ||
| 4667 | /*---------------------------------------------------------------------------- | |
| 4668 | | Returns the result of multiplying the quadruple-precision floating-point | |
| 4669 | | values `a' and `b'. The operation is performed according to the IEC/IEEE | |
| 4670 | | Standard for Binary Floating-Point Arithmetic. | |
| 4671 | *----------------------------------------------------------------------------*/ | |
| 4672 | ||
| 4673 | float128 float128_mul( float128 a, float128 b ) | |
| 4674 | { | |
| 4675 | flag aSign, bSign, zSign; | |
| 4676 | int32 aExp, bExp, zExp; | |
| 4677 | bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2, zSig3; | |
| 4678 | float128 z; | |
| 4679 | ||
| 4680 | aSig1 = extractFloat128Frac1( a ); | |
| 4681 | aSig0 = extractFloat128Frac0( a ); | |
| 4682 | aExp = extractFloat128Exp( a ); | |
| 4683 | aSign = extractFloat128Sign( a ); | |
| 4684 | bSig1 = extractFloat128Frac1( b ); | |
| 4685 | bSig0 = extractFloat128Frac0( b ); | |
| 4686 | bExp = extractFloat128Exp( b ); | |
| 4687 | bSign = extractFloat128Sign( b ); | |
| 4688 | zSign = aSign ^ bSign; | |
| 4689 | if ( aExp == 0x7FFF ) { | |
| 4690 | if ( ( aSig0 | aSig1 ) | |
| 4691 | || ( ( bExp == 0x7FFF ) && ( bSig0 | bSig1 ) ) ) { | |
| 4692 | return propagateFloat128NaN( a, b ); | |
| 4693 | } | |
| 4694 | if ( ( bExp | bSig0 | bSig1 ) == 0 ) goto invalid; | |
| 4695 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 4696 | } | |
| 4697 | if ( bExp == 0x7FFF ) { | |
| 4698 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4699 | if ( ( aExp | aSig0 | aSig1 ) == 0 ) { | |
| 4700 | invalid: | |
| 4701 | float_raise( float_flag_invalid ); | |
| 4702 | z.low = float128_default_nan_low; | |
| 4703 | z.high = float128_default_nan_high; | |
| 4704 | return z; | |
| 4705 | } | |
| 4706 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 4707 | } | |
| 4708 | if ( aExp == 0 ) { | |
| 4709 | if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 ); | |
| 4710 | normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); | |
| 4711 | } | |
| 4712 | if ( bExp == 0 ) { | |
| 4713 | if ( ( bSig0 | bSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 ); | |
| 4714 | normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 ); | |
| 4715 | } | |
| 4716 | zExp = aExp + bExp - 0x4000; | |
| 4717 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4718 | shortShift128Left( bSig0, bSig1, 16, &bSig0, &bSig1 ); | |
| 4719 | mul128To256( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1, &zSig2, &zSig3 ); | |
| 4720 | add128( zSig0, zSig1, aSig0, aSig1, &zSig0, &zSig1 ); | |
| 4721 | zSig2 |= ( zSig3 != 0 ); | |
| 4722 | if ( LIT64( 0x0002000000000000 ) <= zSig0 ) { | |
| 4723 | shift128ExtraRightJamming( | |
| 4724 | zSig0, zSig1, zSig2, 1, &zSig0, &zSig1, &zSig2 ); | |
| 4725 | ++zExp; | |
| 4726 | } | |
| 4727 | return roundAndPackFloat128( zSign, zExp, zSig0, zSig1, zSig2 ); | |
| 4728 | ||
| 4729 | } | |
| 4730 | ||
| 4731 | /*---------------------------------------------------------------------------- | |
| 4732 | | Returns the result of dividing the quadruple-precision floating-point value | |
| 4733 | | `a' by the corresponding value `b'. The operation is performed according to | |
| 4734 | | the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 4735 | *----------------------------------------------------------------------------*/ | |
| 4736 | ||
| 4737 | float128 float128_div( float128 a, float128 b ) | |
| 4738 | { | |
| 4739 | flag aSign, bSign, zSign; | |
| 4740 | int32 aExp, bExp, zExp; | |
| 4741 | bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2; | |
| 4742 | bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; | |
| 4743 | float128 z; | |
| 4744 | ||
| 4745 | aSig1 = extractFloat128Frac1( a ); | |
| 4746 | aSig0 = extractFloat128Frac0( a ); | |
| 4747 | aExp = extractFloat128Exp( a ); | |
| 4748 | aSign = extractFloat128Sign( a ); | |
| 4749 | bSig1 = extractFloat128Frac1( b ); | |
| 4750 | bSig0 = extractFloat128Frac0( b ); | |
| 4751 | bExp = extractFloat128Exp( b ); | |
| 4752 | bSign = extractFloat128Sign( b ); | |
| 4753 | zSign = aSign ^ bSign; | |
| 4754 | if ( aExp == 0x7FFF ) { | |
| 4755 | if ( aSig0 | aSig1 ) return propagateFloat128NaN( a, b ); | |
| 4756 | if ( bExp == 0x7FFF ) { | |
| 4757 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4758 | goto invalid; | |
| 4759 | } | |
| 4760 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 4761 | } | |
| 4762 | if ( bExp == 0x7FFF ) { | |
| 4763 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4764 | return packFloat128( zSign, 0, 0, 0 ); | |
| 4765 | } | |
| 4766 | if ( bExp == 0 ) { | |
| 4767 | if ( ( bSig0 | bSig1 ) == 0 ) { | |
| 4768 | if ( ( aExp | aSig0 | aSig1 ) == 0 ) { | |
| 4769 | invalid: | |
| 4770 | float_raise( float_flag_invalid ); | |
| 4771 | z.low = float128_default_nan_low; | |
| 4772 | z.high = float128_default_nan_high; | |
| 4773 | return z; | |
| 4774 | } | |
| 4775 | float_raise( float_flag_divbyzero ); | |
| 4776 | return packFloat128( zSign, 0x7FFF, 0, 0 ); | |
| 4777 | } | |
| 4778 | normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 ); | |
| 4779 | } | |
| 4780 | if ( aExp == 0 ) { | |
| 4781 | if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 ); | |
| 4782 | normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); | |
| 4783 | } | |
| 4784 | zExp = aExp - bExp + 0x3FFD; | |
| 4785 | shortShift128Left( | |
| 4786 | aSig0 | LIT64( 0x0001000000000000 ), aSig1, 15, &aSig0, &aSig1 ); | |
| 4787 | shortShift128Left( | |
| 4788 | bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 ); | |
| 4789 | if ( le128( bSig0, bSig1, aSig0, aSig1 ) ) { | |
| 4790 | shift128Right( aSig0, aSig1, 1, &aSig0, &aSig1 ); | |
| 4791 | ++zExp; | |
| 4792 | } | |
| 4793 | zSig0 = estimateDiv128To64( aSig0, aSig1, bSig0 ); | |
| 4794 | mul128By64To192( bSig0, bSig1, zSig0, &term0, &term1, &term2 ); | |
| 4795 | sub192( aSig0, aSig1, 0, term0, term1, term2, &rem0, &rem1, &rem2 ); | |
| 4796 | while ( (sbits64) rem0 < 0 ) { | |
| 4797 | --zSig0; | |
| 4798 | add192( rem0, rem1, rem2, 0, bSig0, bSig1, &rem0, &rem1, &rem2 ); | |
| 4799 | } | |
| 4800 | zSig1 = estimateDiv128To64( rem1, rem2, bSig0 ); | |
| 4801 | if ( ( zSig1 & 0x3FFF ) <= 4 ) { | |
| 4802 | mul128By64To192( bSig0, bSig1, zSig1, &term1, &term2, &term3 ); | |
| 4803 | sub192( rem1, rem2, 0, term1, term2, term3, &rem1, &rem2, &rem3 ); | |
| 4804 | while ( (sbits64) rem1 < 0 ) { | |
| 4805 | --zSig1; | |
| 4806 | add192( rem1, rem2, rem3, 0, bSig0, bSig1, &rem1, &rem2, &rem3 ); | |
| 4807 | } | |
| 4808 | zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 ); | |
| 4809 | } | |
| 4810 | shift128ExtraRightJamming( zSig0, zSig1, 0, 15, &zSig0, &zSig1, &zSig2 ); | |
| 4811 | return roundAndPackFloat128( zSign, zExp, zSig0, zSig1, zSig2 ); | |
| 4812 | ||
| 4813 | } | |
| 4814 | ||
| 4815 | /*---------------------------------------------------------------------------- | |
| 4816 | | Returns the remainder of the quadruple-precision floating-point value `a' | |
| 4817 | | with respect to the corresponding value `b'. The operation is performed | |
| 4818 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 4819 | *----------------------------------------------------------------------------*/ | |
| 4820 | ||
| 4821 | float128 float128_rem( float128 a, float128 b ) | |
| 4822 | { | |
| 4823 | flag aSign, bSign, zSign; | |
| 4824 | int32 aExp, bExp, expDiff; | |
| 4825 | bits64 aSig0, aSig1, bSig0, bSig1, q, term0, term1, term2; | |
| 4826 | bits64 allZero, alternateASig0, alternateASig1, sigMean1; | |
| 4827 | sbits64 sigMean0; | |
| 4828 | float128 z; | |
| 4829 | ||
| 4830 | aSig1 = extractFloat128Frac1( a ); | |
| 4831 | aSig0 = extractFloat128Frac0( a ); | |
| 4832 | aExp = extractFloat128Exp( a ); | |
| 4833 | aSign = extractFloat128Sign( a ); | |
| 4834 | bSig1 = extractFloat128Frac1( b ); | |
| 4835 | bSig0 = extractFloat128Frac0( b ); | |
| 4836 | bExp = extractFloat128Exp( b ); | |
| 4837 | bSign = extractFloat128Sign( b ); | |
| 4838 | if ( aExp == 0x7FFF ) { | |
| 4839 | if ( ( aSig0 | aSig1 ) | |
| 4840 | || ( ( bExp == 0x7FFF ) && ( bSig0 | bSig1 ) ) ) { | |
| 4841 | return propagateFloat128NaN( a, b ); | |
| 4842 | } | |
| 4843 | goto invalid; | |
| 4844 | } | |
| 4845 | if ( bExp == 0x7FFF ) { | |
| 4846 | if ( bSig0 | bSig1 ) return propagateFloat128NaN( a, b ); | |
| 4847 | return a; | |
| 4848 | } | |
| 4849 | if ( bExp == 0 ) { | |
| 4850 | if ( ( bSig0 | bSig1 ) == 0 ) { | |
| 4851 | invalid: | |
| 4852 | float_raise( float_flag_invalid ); | |
| 4853 | z.low = float128_default_nan_low; | |
| 4854 | z.high = float128_default_nan_high; | |
| 4855 | return z; | |
| 4856 | } | |
| 4857 | normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 ); | |
| 4858 | } | |
| 4859 | if ( aExp == 0 ) { | |
| 4860 | if ( ( aSig0 | aSig1 ) == 0 ) return a; | |
| 4861 | normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); | |
| 4862 | } | |
| 4863 | expDiff = aExp - bExp; | |
| 4864 | if ( expDiff < -1 ) return a; | |
| 4865 | shortShift128Left( | |
| 4866 | aSig0 | LIT64( 0x0001000000000000 ), | |
| 4867 | aSig1, | |
| 4868 | 15 - ( expDiff < 0 ), | |
| 4869 | &aSig0, | |
| 4870 | &aSig1 | |
| 4871 | ); | |
| 4872 | shortShift128Left( | |
| 4873 | bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 ); | |
| 4874 | q = le128( bSig0, bSig1, aSig0, aSig1 ); | |
| 4875 | if ( q ) sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); | |
| 4876 | expDiff -= 64; | |
| 4877 | while ( 0 < expDiff ) { | |
| 4878 | q = estimateDiv128To64( aSig0, aSig1, bSig0 ); | |
| 4879 | q = ( 4 < q ) ? q - 4 : 0; | |
| 4880 | mul128By64To192( bSig0, bSig1, q, &term0, &term1, &term2 ); | |
| 4881 | shortShift192Left( term0, term1, term2, 61, &term1, &term2, &allZero ); | |
| 4882 | shortShift128Left( aSig0, aSig1, 61, &aSig0, &allZero ); | |
| 4883 | sub128( aSig0, 0, term1, term2, &aSig0, &aSig1 ); | |
| 4884 | expDiff -= 61; | |
| 4885 | } | |
| 4886 | if ( -64 < expDiff ) { | |
| 4887 | q = estimateDiv128To64( aSig0, aSig1, bSig0 ); | |
| 4888 | q = ( 4 < q ) ? q - 4 : 0; | |
| 4889 | q >>= - expDiff; | |
| 4890 | shift128Right( bSig0, bSig1, 12, &bSig0, &bSig1 ); | |
| 4891 | expDiff += 52; | |
| 4892 | if ( expDiff < 0 ) { | |
| 4893 | shift128Right( aSig0, aSig1, - expDiff, &aSig0, &aSig1 ); | |
| 4894 | } | |
| 4895 | else { | |
| 4896 | shortShift128Left( aSig0, aSig1, expDiff, &aSig0, &aSig1 ); | |
| 4897 | } | |
| 4898 | mul128By64To192( bSig0, bSig1, q, &term0, &term1, &term2 ); | |
| 4899 | sub128( aSig0, aSig1, term1, term2, &aSig0, &aSig1 ); | |
| 4900 | } | |
| 4901 | else { | |
| 4902 | shift128Right( aSig0, aSig1, 12, &aSig0, &aSig1 ); | |
| 4903 | shift128Right( bSig0, bSig1, 12, &bSig0, &bSig1 ); | |
| 4904 | } | |
| 4905 | do { | |
| 4906 | alternateASig0 = aSig0; | |
| 4907 | alternateASig1 = aSig1; | |
| 4908 | ++q; | |
| 4909 | sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); | |
| 4910 | } while ( 0 <= (sbits64) aSig0 ); | |
| 4911 | add128( | |
| 4912 | aSig0, aSig1, alternateASig0, alternateASig1, (bits64 *)&sigMean0, &sigMean1 ); | |
| 4913 | if ( ( sigMean0 < 0 ) | |
| 4914 | || ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) { | |
| 4915 | aSig0 = alternateASig0; | |
| 4916 | aSig1 = alternateASig1; | |
| 4917 | } | |
| 4918 | zSign = ( (sbits64) aSig0 < 0 ); | |
| 4919 | if ( zSign ) sub128( 0, 0, aSig0, aSig1, &aSig0, &aSig1 ); | |
| 4920 | return | |
| 4921 | normalizeRoundAndPackFloat128( aSign ^ zSign, bExp - 4, aSig0, aSig1 ); | |
| 4922 | ||
| 4923 | } | |
| 4924 | ||
| 4925 | /*---------------------------------------------------------------------------- | |
| 4926 | | Returns the square root of the quadruple-precision floating-point value `a'. | |
| 4927 | | The operation is performed according to the IEC/IEEE Standard for Binary | |
| 4928 | | Floating-Point Arithmetic. | |
| 4929 | *----------------------------------------------------------------------------*/ | |
| 4930 | ||
| 4931 | float128 float128_sqrt( float128 a ) | |
| 4932 | { | |
| 4933 | flag aSign; | |
| 4934 | int32 aExp, zExp; | |
| 4935 | bits64 aSig0, aSig1, zSig0, zSig1, zSig2, doubleZSig0; | |
| 4936 | bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; | |
| 4937 | float128 z; | |
| 4938 | ||
| 4939 | aSig1 = extractFloat128Frac1( a ); | |
| 4940 | aSig0 = extractFloat128Frac0( a ); | |
| 4941 | aExp = extractFloat128Exp( a ); | |
| 4942 | aSign = extractFloat128Sign( a ); | |
| 4943 | if ( aExp == 0x7FFF ) { | |
| 4944 | if ( aSig0 | aSig1 ) return propagateFloat128NaN( a, a ); | |
| 4945 | if ( ! aSign ) return a; | |
| 4946 | goto invalid; | |
| 4947 | } | |
| 4948 | if ( aSign ) { | |
| 4949 | if ( ( aExp | aSig0 | aSig1 ) == 0 ) return a; | |
| 4950 | invalid: | |
| 4951 | float_raise( float_flag_invalid ); | |
| 4952 | z.low = float128_default_nan_low; | |
| 4953 | z.high = float128_default_nan_high; | |
| 4954 | return z; | |
| 4955 | } | |
| 4956 | if ( aExp == 0 ) { | |
| 4957 | if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( 0, 0, 0, 0 ); | |
| 4958 | normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); | |
| 4959 | } | |
| 4960 | zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFE; | |
| 4961 | aSig0 |= LIT64( 0x0001000000000000 ); | |
| 4962 | zSig0 = estimateSqrt32( aExp, aSig0>>17 ); | |
| 4963 | shortShift128Left( aSig0, aSig1, 13 - ( aExp & 1 ), &aSig0, &aSig1 ); | |
| 4964 | zSig0 = estimateDiv128To64( aSig0, aSig1, zSig0<<32 ) + ( zSig0<<30 ); | |
| 4965 | doubleZSig0 = zSig0<<1; | |
| 4966 | mul64To128( zSig0, zSig0, &term0, &term1 ); | |
| 4967 | sub128( aSig0, aSig1, term0, term1, &rem0, &rem1 ); | |
| 4968 | while ( (sbits64) rem0 < 0 ) { | |
| 4969 | --zSig0; | |
| 4970 | doubleZSig0 -= 2; | |
| 4971 | add128( rem0, rem1, zSig0>>63, doubleZSig0 | 1, &rem0, &rem1 ); | |
| 4972 | } | |
| 4973 | zSig1 = estimateDiv128To64( rem1, 0, doubleZSig0 ); | |
| 4974 | if ( ( zSig1 & 0x1FFF ) <= 5 ) { | |
| 4975 | if ( zSig1 == 0 ) zSig1 = 1; | |
| 4976 | mul64To128( doubleZSig0, zSig1, &term1, &term2 ); | |
| 4977 | sub128( rem1, 0, term1, term2, &rem1, &rem2 ); | |
| 4978 | mul64To128( zSig1, zSig1, &term2, &term3 ); | |
| 4979 | sub192( rem1, rem2, 0, 0, term2, term3, &rem1, &rem2, &rem3 ); | |
| 4980 | while ( (sbits64) rem1 < 0 ) { | |
| 4981 | --zSig1; | |
| 4982 | shortShift128Left( 0, zSig1, 1, &term2, &term3 ); | |
| 4983 | term3 |= 1; | |
| 4984 | term2 |= doubleZSig0; | |
| 4985 | add192( rem1, rem2, rem3, 0, term2, term3, &rem1, &rem2, &rem3 ); | |
| 4986 | } | |
| 4987 | zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 ); | |
| 4988 | } | |
| 4989 | shift128ExtraRightJamming( zSig0, zSig1, 0, 14, &zSig0, &zSig1, &zSig2 ); | |
| 4990 | return roundAndPackFloat128( 0, zExp, zSig0, zSig1, zSig2 ); | |
| 4991 | ||
| 4992 | } | |
| 4993 | ||
| 4994 | /*---------------------------------------------------------------------------- | |
| 4995 | | Returns 1 if the quadruple-precision floating-point value `a' is equal to | |
| 4996 | | the corresponding value `b', and 0 otherwise. The comparison is performed | |
| 4997 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 4998 | *----------------------------------------------------------------------------*/ | |
| 4999 | ||
| 5000 | flag float128_eq( float128 a, float128 b ) | |
| 5001 | { | |
| 5002 | ||
| 5003 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5004 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5005 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5006 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5007 | ) { | |
| 5008 | if ( float128_is_signaling_nan( a ) | |
| 5009 | || float128_is_signaling_nan( b ) ) { | |
| 5010 | float_raise( float_flag_invalid ); | |
| 5011 | } | |
| 5012 | return 0; | |
| 5013 | } | |
| 5014 | return | |
| 5015 | ( a.low == b.low ) | |
| 5016 | && ( ( a.high == b.high ) | |
| 5017 | || ( ( a.low == 0 ) | |
| 5018 | && ( (bits64) ( ( a.high | b.high )<<1 ) == 0 ) ) | |
| 5019 | ); | |
| 5020 | ||
| 5021 | } | |
| 5022 | ||
| 5023 | /*---------------------------------------------------------------------------- | |
| 5024 | | Returns 1 if the quadruple-precision floating-point value `a' is less than | |
| 5025 | | or equal to the corresponding value `b', and 0 otherwise. The comparison | |
| 5026 | | is performed according to the IEC/IEEE Standard for Binary Floating-Point | |
| 5027 | | Arithmetic. | |
| 5028 | *----------------------------------------------------------------------------*/ | |
| 5029 | ||
| 5030 | flag float128_le( float128 a, float128 b ) | |
| 5031 | { | |
| 5032 | flag aSign, bSign; | |
| 5033 | ||
| 5034 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5035 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5036 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5037 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5038 | ) { | |
| 5039 | float_raise( float_flag_invalid ); | |
| 5040 | return 0; | |
| 5041 | } | |
| 5042 | aSign = extractFloat128Sign( a ); | |
| 5043 | bSign = extractFloat128Sign( b ); | |
| 5044 | if ( aSign != bSign ) { | |
| 5045 | return | |
| 5046 | aSign | |
| 5047 | || ( ( ( (bits64) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 5048 | == 0 ); | |
| 5049 | } | |
| 5050 | return | |
| 5051 | aSign ? le128( b.high, b.low, a.high, a.low ) | |
| 5052 | : le128( a.high, a.low, b.high, b.low ); | |
| 5053 | ||
| 5054 | } | |
| 5055 | ||
| 5056 | /*---------------------------------------------------------------------------- | |
| 5057 | | Returns 1 if the quadruple-precision floating-point value `a' is less than | |
| 5058 | | the corresponding value `b', and 0 otherwise. The comparison is performed | |
| 5059 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 5060 | *----------------------------------------------------------------------------*/ | |
| 5061 | ||
| 5062 | flag float128_lt( float128 a, float128 b ) | |
| 5063 | { | |
| 5064 | flag aSign, bSign; | |
| 5065 | ||
| 5066 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5067 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5068 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5069 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5070 | ) { | |
| 5071 | float_raise( float_flag_invalid ); | |
| 5072 | return 0; | |
| 5073 | } | |
| 5074 | aSign = extractFloat128Sign( a ); | |
| 5075 | bSign = extractFloat128Sign( b ); | |
| 5076 | if ( aSign != bSign ) { | |
| 5077 | return | |
| 5078 | aSign | |
| 5079 | && ( ( ( (bits64) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 5080 | != 0 ); | |
| 5081 | } | |
| 5082 | return | |
| 5083 | aSign ? lt128( b.high, b.low, a.high, a.low ) | |
| 5084 | : lt128( a.high, a.low, b.high, b.low ); | |
| 5085 | ||
| 5086 | } | |
| 5087 | ||
| 5088 | /*---------------------------------------------------------------------------- | |
| 5089 | | Returns 1 if the quadruple-precision floating-point value `a' is equal to | |
| 5090 | | the corresponding value `b', and 0 otherwise. The invalid exception is | |
| 5091 | | raised if either operand is a NaN. Otherwise, the comparison is performed | |
| 5092 | | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 5093 | *----------------------------------------------------------------------------*/ | |
| 5094 | ||
| 5095 | flag float128_eq_signaling( float128 a, float128 b ) | |
| 5096 | { | |
| 5097 | ||
| 5098 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5099 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5100 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5101 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5102 | ) { | |
| 5103 | float_raise( float_flag_invalid ); | |
| 5104 | return 0; | |
| 5105 | } | |
| 5106 | return | |
| 5107 | ( a.low == b.low ) | |
| 5108 | && ( ( a.high == b.high ) | |
| 5109 | || ( ( a.low == 0 ) | |
| 5110 | && ( (bits64) ( ( a.high | b.high )<<1 ) == 0 ) ) | |
| 5111 | ); | |
| 5112 | ||
| 5113 | } | |
| 5114 | ||
| 5115 | /*---------------------------------------------------------------------------- | |
| 5116 | | Returns 1 if the quadruple-precision floating-point value `a' is less than | |
| 5117 | | or equal to the corresponding value `b', and 0 otherwise. Quiet NaNs do not | |
| 5118 | | cause an exception. Otherwise, the comparison is performed according to the | |
| 5119 | | IEC/IEEE Standard for Binary Floating-Point Arithmetic. | |
| 5120 | *----------------------------------------------------------------------------*/ | |
| 5121 | ||
| 5122 | flag float128_le_quiet( float128 a, float128 b ) | |
| 5123 | { | |
| 5124 | flag aSign, bSign; | |
| 5125 | ||
| 5126 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5127 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5128 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5129 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5130 | ) { | |
| 5131 | if ( float128_is_signaling_nan( a ) | |
| 5132 | || float128_is_signaling_nan( b ) ) { | |
| 5133 | float_raise( float_flag_invalid ); | |
| 5134 | } | |
| 5135 | return 0; | |
| 5136 | } | |
| 5137 | aSign = extractFloat128Sign( a ); | |
| 5138 | bSign = extractFloat128Sign( b ); | |
| 5139 | if ( aSign != bSign ) { | |
| 5140 | return | |
| 5141 | aSign | |
| 5142 | || ( ( ( (bits64) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 5143 | == 0 ); | |
| 5144 | } | |
| 5145 | return | |
| 5146 | aSign ? le128( b.high, b.low, a.high, a.low ) | |
| 5147 | : le128( a.high, a.low, b.high, b.low ); | |
| 5148 | ||
| 5149 | } | |
| 5150 | ||
| 5151 | /*---------------------------------------------------------------------------- | |
| 5152 | | Returns 1 if the quadruple-precision floating-point value `a' is less than | |
| 5153 | | the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause an | |
| 5154 | | exception. Otherwise, the comparison is performed according to the IEC/IEEE | |
| 5155 | | Standard for Binary Floating-Point Arithmetic. | |
| 5156 | *----------------------------------------------------------------------------*/ | |
| 5157 | ||
| 5158 | flag float128_lt_quiet( float128 a, float128 b ) | |
| 5159 | { | |
| 5160 | flag aSign, bSign; | |
| 5161 | ||
| 5162 | if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) | |
| 5163 | && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) ) | |
| 5164 | || ( ( extractFloat128Exp( b ) == 0x7FFF ) | |
| 5165 | && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) ) | |
| 5166 | ) { | |
| 5167 | if ( float128_is_signaling_nan( a ) | |
| 5168 | || float128_is_signaling_nan( b ) ) { | |
| 5169 | float_raise( float_flag_invalid ); | |
| 5170 | } | |
| 5171 | return 0; | |
| 5172 | } | |
| 5173 | aSign = extractFloat128Sign( a ); | |
| 5174 | bSign = extractFloat128Sign( b ); | |
| 5175 | if ( aSign != bSign ) { | |
| 5176 | return | |
| 5177 | aSign | |
| 5178 | && ( ( ( (bits64) ( ( a.high | b.high )<<1 ) ) | a.low | b.low ) | |
| 5179 | != 0 ); | |
| 5180 | } | |
| 5181 | return | |
| 5182 | aSign ? lt128( b.high, b.low, a.high, a.low ) | |
| 5183 | : lt128( a.high, a.low, b.high, b.low ); | |
| 5184 | ||
| 5185 | } | |
| 5186 | ||
| 5187 | #endif | |
| 5188 |
| r0 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | /*============================================================================ | |
| 3 | ||
| 4 | This C source fragment is part of the SoftFloat IEC/IEEE Floating-point | |
| 5 | Arithmetic Package, Release 2b. | |
| 6 | ||
| 7 | Written by John R. Hauser. This work was made possible in part by the | |
| 8 | International Computer Science Institute, located at Suite 600, 1947 Center | |
| 9 | Street, Berkeley, California 94704. Funding was partially provided by the | |
| 10 | National Science Foundation under grant MIP-9311980. The original version | |
| 11 | of this code was written as part of a project to build a fixed-point vector | |
| 12 | processor in collaboration with the University of California at Berkeley, | |
| 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information | |
| 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | |
| 15 | arithmetic/SoftFloat.html'. | |
| 16 | ||
| 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | |
| 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | |
| 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | |
| 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | |
| 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | |
| 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | |
| 23 | INSTITUTE (possibly via similar legal notice) AGAINST ALL LOSSES, COSTS, OR | |
| 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | |
| 25 | ||
| 26 | Derivative works are acceptable, even for commercial purposes, so long as | |
| 27 | (1) the source code for the derivative work includes prominent notice that | |
| 28 | the work is derivative, and (2) the source code includes prominent notice with | |
| 29 | these four paragraphs for those parts of this code that are retained. | |
| 30 | ||
| 31 | =============================================================================*/ | |
| 32 | ||
| 33 | /*---------------------------------------------------------------------------- | |
| 34 | | Shifts `a' right by the number of bits given in `count'. If any nonzero | |
| 35 | | bits are shifted off, they are ``jammed'' into the least significant bit of | |
| 36 | | the result by setting the least significant bit to 1. The value of `count' | |
| 37 | | can be arbitrarily large; in particular, if `count' is greater than 32, the | |
| 38 | | result will be either 0 or 1, depending on whether `a' is zero or nonzero. | |
| 39 | | The result is stored in the location pointed to by `zPtr'. | |
| 40 | *----------------------------------------------------------------------------*/ | |
| 41 | ||
| 42 | INLINE void shift32RightJamming( bits32 a, int16 count, bits32 *zPtr ) | |
| 43 | { | |
| 44 | bits32 z; | |
| 45 | ||
| 46 | if ( count == 0 ) { | |
| 47 | z = a; | |
| 48 | } | |
| 49 | else if ( count < 32 ) { | |
| 50 | z = ( a>>count ) | ( ( a<<( ( - count ) & 31 ) ) != 0 ); | |
| 51 | } | |
| 52 | else { | |
| 53 | z = ( a != 0 ); | |
| 54 | } | |
| 55 | *zPtr = z; | |
| 56 | ||
| 57 | } | |
| 58 | ||
| 59 | /*---------------------------------------------------------------------------- | |
| 60 | | Shifts `a' right by the number of bits given in `count'. If any nonzero | |
| 61 | | bits are shifted off, they are ``jammed'' into the least significant bit of | |
| 62 | | the result by setting the least significant bit to 1. The value of `count' | |
| 63 | | can be arbitrarily large; in particular, if `count' is greater than 64, the | |
| 64 | | result will be either 0 or 1, depending on whether `a' is zero or nonzero. | |
| 65 | | The result is stored in the location pointed to by `zPtr'. | |
| 66 | *----------------------------------------------------------------------------*/ | |
| 67 | ||
| 68 | INLINE void shift64RightJamming( bits64 a, int16 count, bits64 *zPtr ) | |
| 69 | { | |
| 70 | bits64 z; | |
| 71 | ||
| 72 | if ( count == 0 ) { | |
| 73 | z = a; | |
| 74 | } | |
| 75 | else if ( count < 64 ) { | |
| 76 | z = ( a>>count ) | ( ( a<<( ( - count ) & 63 ) ) != 0 ); | |
| 77 | } | |
| 78 | else { | |
| 79 | z = ( a != 0 ); | |
| 80 | } | |
| 81 | *zPtr = z; | |
| 82 | ||
| 83 | } | |
| 84 | ||
| 85 | /*---------------------------------------------------------------------------- | |
| 86 | | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by 64 | |
| 87 | | _plus_ the number of bits given in `count'. The shifted result is at most | |
| 88 | | 64 nonzero bits; this is stored at the location pointed to by `z0Ptr'. The | |
| 89 | | bits shifted off form a second 64-bit result as follows: The _last_ bit | |
| 90 | | shifted off is the most-significant bit of the extra result, and the other | |
| 91 | | 63 bits of the extra result are all zero if and only if _all_but_the_last_ | |
| 92 | | bits shifted off were all zero. This extra result is stored in the location | |
| 93 | | pointed to by `z1Ptr'. The value of `count' can be arbitrarily large. | |
| 94 | | (This routine makes more sense if `a0' and `a1' are considered to form | |
| 95 | | a fixed-point value with binary point between `a0' and `a1'. This fixed- | |
| 96 | | point value is shifted right by the number of bits given in `count', and | |
| 97 | | the integer part of the result is returned at the location pointed to by | |
| 98 | | `z0Ptr'. The fractional part of the result may be slightly corrupted as | |
| 99 | | described above, and is returned at the location pointed to by `z1Ptr'.) | |
| 100 | *----------------------------------------------------------------------------*/ | |
| 101 | ||
| 102 | INLINE void | |
| 103 | shift64ExtraRightJamming( | |
| 104 | bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 105 | { | |
| 106 | bits64 z0, z1; | |
| 107 | int8 negCount = ( - count ) & 63; | |
| 108 | ||
| 109 | if ( count == 0 ) { | |
| 110 | z1 = a1; | |
| 111 | z0 = a0; | |
| 112 | } | |
| 113 | else if ( count < 64 ) { | |
| 114 | z1 = ( a0<<negCount ) | ( a1 != 0 ); | |
| 115 | z0 = a0>>count; | |
| 116 | } | |
| 117 | else { | |
| 118 | if ( count == 64 ) { | |
| 119 | z1 = a0 | ( a1 != 0 ); | |
| 120 | } | |
| 121 | else { | |
| 122 | z1 = ( ( a0 | a1 ) != 0 ); | |
| 123 | } | |
| 124 | z0 = 0; | |
| 125 | } | |
| 126 | *z1Ptr = z1; | |
| 127 | *z0Ptr = z0; | |
| 128 | ||
| 129 | } | |
| 130 | ||
| 131 | /*---------------------------------------------------------------------------- | |
| 132 | | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the | |
| 133 | | number of bits given in `count'. Any bits shifted off are lost. The value | |
| 134 | | of `count' can be arbitrarily large; in particular, if `count' is greater | |
| 135 | | than 128, the result will be 0. The result is broken into two 64-bit pieces | |
| 136 | | which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. | |
| 137 | *----------------------------------------------------------------------------*/ | |
| 138 | ||
| 139 | INLINE void | |
| 140 | shift128Right( | |
| 141 | bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 142 | { | |
| 143 | bits64 z0, z1; | |
| 144 | int8 negCount = ( - count ) & 63; | |
| 145 | ||
| 146 | if ( count == 0 ) { | |
| 147 | z1 = a1; | |
| 148 | z0 = a0; | |
| 149 | } | |
| 150 | else if ( count < 64 ) { | |
| 151 | z1 = ( a0<<negCount ) | ( a1>>count ); | |
| 152 | z0 = a0>>count; | |
| 153 | } | |
| 154 | else { | |
| 155 | z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0; | |
| 156 | z0 = 0; | |
| 157 | } | |
| 158 | *z1Ptr = z1; | |
| 159 | *z0Ptr = z0; | |
| 160 | ||
| 161 | } | |
| 162 | ||
| 163 | /*---------------------------------------------------------------------------- | |
| 164 | | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the | |
| 165 | | number of bits given in `count'. If any nonzero bits are shifted off, they | |
| 166 | | are ``jammed'' into the least significant bit of the result by setting the | |
| 167 | | least significant bit to 1. The value of `count' can be arbitrarily large; | |
| 168 | | in particular, if `count' is greater than 128, the result will be either | |
| 169 | | 0 or 1, depending on whether the concatenation of `a0' and `a1' is zero or | |
| 170 | | nonzero. The result is broken into two 64-bit pieces which are stored at | |
| 171 | | the locations pointed to by `z0Ptr' and `z1Ptr'. | |
| 172 | *----------------------------------------------------------------------------*/ | |
| 173 | ||
| 174 | INLINE void | |
| 175 | shift128RightJamming( | |
| 176 | bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 177 | { | |
| 178 | bits64 z0, z1; | |
| 179 | int8 negCount = ( - count ) & 63; | |
| 180 | ||
| 181 | if ( count == 0 ) { | |
| 182 | z1 = a1; | |
| 183 | z0 = a0; | |
| 184 | } | |
| 185 | else if ( count < 64 ) { | |
| 186 | z1 = ( a0<<negCount ) | ( a1>>count ) | ( ( a1<<negCount ) != 0 ); | |
| 187 | z0 = a0>>count; | |
| 188 | } | |
| 189 | else { | |
| 190 | if ( count == 64 ) { | |
| 191 | z1 = a0 | ( a1 != 0 ); | |
| 192 | } | |
| 193 | else if ( count < 128 ) { | |
| 194 | z1 = ( a0>>( count & 63 ) ) | ( ( ( a0<<negCount ) | a1 ) != 0 ); | |
| 195 | } | |
| 196 | else { | |
| 197 | z1 = ( ( a0 | a1 ) != 0 ); | |
| 198 | } | |
| 199 | z0 = 0; | |
| 200 | } | |
| 201 | *z1Ptr = z1; | |
| 202 | *z0Ptr = z0; | |
| 203 | ||
| 204 | } | |
| 205 | ||
| 206 | /*---------------------------------------------------------------------------- | |
| 207 | | Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' right | |
| 208 | | by 64 _plus_ the number of bits given in `count'. The shifted result is | |
| 209 | | at most 128 nonzero bits; these are broken into two 64-bit pieces which are | |
| 210 | | stored at the locations pointed to by `z0Ptr' and `z1Ptr'. The bits shifted | |
| 211 | | off form a third 64-bit result as follows: The _last_ bit shifted off is | |
| 212 | | the most-significant bit of the extra result, and the other 63 bits of the | |
| 213 | | extra result are all zero if and only if _all_but_the_last_ bits shifted off | |
| 214 | | were all zero. This extra result is stored in the location pointed to by | |
| 215 | | `z2Ptr'. The value of `count' can be arbitrarily large. | |
| 216 | | (This routine makes more sense if `a0', `a1', and `a2' are considered | |
| 217 | | to form a fixed-point value with binary point between `a1' and `a2'. This | |
| 218 | | fixed-point value is shifted right by the number of bits given in `count', | |
| 219 | | and the integer part of the result is returned at the locations pointed to | |
| 220 | | by `z0Ptr' and `z1Ptr'. The fractional part of the result may be slightly | |
| 221 | | corrupted as described above, and is returned at the location pointed to by | |
| 222 | | `z2Ptr'.) | |
| 223 | *----------------------------------------------------------------------------*/ | |
| 224 | ||
| 225 | INLINE void | |
| 226 | shift128ExtraRightJamming( | |
| 227 | bits64 a0, | |
| 228 | bits64 a1, | |
| 229 | bits64 a2, | |
| 230 | int16 count, | |
| 231 | bits64 *z0Ptr, | |
| 232 | bits64 *z1Ptr, | |
| 233 | bits64 *z2Ptr | |
| 234 | ) | |
| 235 | { | |
| 236 | bits64 z0, z1, z2; | |
| 237 | int8 negCount = ( - count ) & 63; | |
| 238 | ||
| 239 | if ( count == 0 ) { | |
| 240 | z2 = a2; | |
| 241 | z1 = a1; | |
| 242 | z0 = a0; | |
| 243 | } | |
| 244 | else { | |
| 245 | if ( count < 64 ) { | |
| 246 | z2 = a1<<negCount; | |
| 247 | z1 = ( a0<<negCount ) | ( a1>>count ); | |
| 248 | z0 = a0>>count; | |
| 249 | } | |
| 250 | else { | |
| 251 | if ( count == 64 ) { | |
| 252 | z2 = a1; | |
| 253 | z1 = a0; | |
| 254 | } | |
| 255 | else { | |
| 256 | a2 |= a1; | |
| 257 | if ( count < 128 ) { | |
| 258 | z2 = a0<<negCount; | |
| 259 | z1 = a0>>( count & 63 ); | |
| 260 | } | |
| 261 | else { | |
| 262 | z2 = ( count == 128 ) ? a0 : ( a0 != 0 ); | |
| 263 | z1 = 0; | |
| 264 | } | |
| 265 | } | |
| 266 | z0 = 0; | |
| 267 | } | |
| 268 | z2 |= ( a2 != 0 ); | |
| 269 | } | |
| 270 | *z2Ptr = z2; | |
| 271 | *z1Ptr = z1; | |
| 272 | *z0Ptr = z0; | |
| 273 | ||
| 274 | } | |
| 275 | ||
| 276 | /*---------------------------------------------------------------------------- | |
| 277 | | Shifts the 128-bit value formed by concatenating `a0' and `a1' left by the | |
| 278 | | number of bits given in `count'. Any bits shifted off are lost. The value | |
| 279 | | of `count' must be less than 64. The result is broken into two 64-bit | |
| 280 | | pieces which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. | |
| 281 | *----------------------------------------------------------------------------*/ | |
| 282 | ||
| 283 | INLINE void | |
| 284 | shortShift128Left( | |
| 285 | bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 286 | { | |
| 287 | ||
| 288 | *z1Ptr = a1<<count; | |
| 289 | *z0Ptr = | |
| 290 | ( count == 0 ) ? a0 : ( a0<<count ) | ( a1>>( ( - count ) & 63 ) ); | |
| 291 | ||
| 292 | } | |
| 293 | ||
| 294 | /*---------------------------------------------------------------------------- | |
| 295 | | Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' left | |
| 296 | | by the number of bits given in `count'. Any bits shifted off are lost. | |
| 297 | | The value of `count' must be less than 64. The result is broken into three | |
| 298 | | 64-bit pieces which are stored at the locations pointed to by `z0Ptr', | |
| 299 | | `z1Ptr', and `z2Ptr'. | |
| 300 | *----------------------------------------------------------------------------*/ | |
| 301 | ||
| 302 | INLINE void | |
| 303 | shortShift192Left( | |
| 304 | bits64 a0, | |
| 305 | bits64 a1, | |
| 306 | bits64 a2, | |
| 307 | int16 count, | |
| 308 | bits64 *z0Ptr, | |
| 309 | bits64 *z1Ptr, | |
| 310 | bits64 *z2Ptr | |
| 311 | ) | |
| 312 | { | |
| 313 | bits64 z0, z1, z2; | |
| 314 | int8 negCount; | |
| 315 | ||
| 316 | z2 = a2<<count; | |
| 317 | z1 = a1<<count; | |
| 318 | z0 = a0<<count; | |
| 319 | if ( 0 < count ) { | |
| 320 | negCount = ( ( - count ) & 63 ); | |
| 321 | z1 |= a2>>negCount; | |
| 322 | z0 |= a1>>negCount; | |
| 323 | } | |
| 324 | *z2Ptr = z2; | |
| 325 | *z1Ptr = z1; | |
| 326 | *z0Ptr = z0; | |
| 327 | ||
| 328 | } | |
| 329 | ||
| 330 | /*---------------------------------------------------------------------------- | |
| 331 | | Adds the 128-bit value formed by concatenating `a0' and `a1' to the 128-bit | |
| 332 | | value formed by concatenating `b0' and `b1'. Addition is modulo 2^128, so | |
| 333 | | any carry out is lost. The result is broken into two 64-bit pieces which | |
| 334 | | are stored at the locations pointed to by `z0Ptr' and `z1Ptr'. | |
| 335 | *----------------------------------------------------------------------------*/ | |
| 336 | ||
| 337 | INLINE void | |
| 338 | add128( | |
| 339 | bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 340 | { | |
| 341 | bits64 z1; | |
| 342 | ||
| 343 | z1 = a1 + b1; | |
| 344 | *z1Ptr = z1; | |
| 345 | *z0Ptr = a0 + b0 + ( z1 < a1 ); | |
| 346 | ||
| 347 | } | |
| 348 | ||
| 349 | /*---------------------------------------------------------------------------- | |
| 350 | | Adds the 192-bit value formed by concatenating `a0', `a1', and `a2' to the | |
| 351 | | 192-bit value formed by concatenating `b0', `b1', and `b2'. Addition is | |
| 352 | | modulo 2^192, so any carry out is lost. The result is broken into three | |
| 353 | | 64-bit pieces which are stored at the locations pointed to by `z0Ptr', | |
| 354 | | `z1Ptr', and `z2Ptr'. | |
| 355 | *----------------------------------------------------------------------------*/ | |
| 356 | ||
| 357 | INLINE void | |
| 358 | add192( | |
| 359 | bits64 a0, | |
| 360 | bits64 a1, | |
| 361 | bits64 a2, | |
| 362 | bits64 b0, | |
| 363 | bits64 b1, | |
| 364 | bits64 b2, | |
| 365 | bits64 *z0Ptr, | |
| 366 | bits64 *z1Ptr, | |
| 367 | bits64 *z2Ptr | |
| 368 | ) | |
| 369 | { | |
| 370 | bits64 z0, z1, z2; | |
| 371 | int8 carry0, carry1; | |
| 372 | ||
| 373 | z2 = a2 + b2; | |
| 374 | carry1 = ( z2 < a2 ); | |
| 375 | z1 = a1 + b1; | |
| 376 | carry0 = ( z1 < a1 ); | |
| 377 | z0 = a0 + b0; | |
| 378 | z1 += carry1; | |
| 379 | z0 += ( z1 < carry1 ); | |
| 380 | z0 += carry0; | |
| 381 | *z2Ptr = z2; | |
| 382 | *z1Ptr = z1; | |
| 383 | *z0Ptr = z0; | |
| 384 | ||
| 385 | } | |
| 386 | ||
| 387 | /*---------------------------------------------------------------------------- | |
| 388 | | Subtracts the 128-bit value formed by concatenating `b0' and `b1' from the | |
| 389 | | 128-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo | |
| 390 | | 2^128, so any borrow out (carry out) is lost. The result is broken into two | |
| 391 | | 64-bit pieces which are stored at the locations pointed to by `z0Ptr' and | |
| 392 | | `z1Ptr'. | |
| 393 | *----------------------------------------------------------------------------*/ | |
| 394 | ||
| 395 | INLINE void | |
| 396 | sub128( | |
| 397 | bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 398 | { | |
| 399 | ||
| 400 | *z1Ptr = a1 - b1; | |
| 401 | *z0Ptr = a0 - b0 - ( a1 < b1 ); | |
| 402 | ||
| 403 | } | |
| 404 | ||
| 405 | /*---------------------------------------------------------------------------- | |
| 406 | | Subtracts the 192-bit value formed by concatenating `b0', `b1', and `b2' | |
| 407 | | from the 192-bit value formed by concatenating `a0', `a1', and `a2'. | |
| 408 | | Subtraction is modulo 2^192, so any borrow out (carry out) is lost. The | |
| 409 | | result is broken into three 64-bit pieces which are stored at the locations | |
| 410 | | pointed to by `z0Ptr', `z1Ptr', and `z2Ptr'. | |
| 411 | *----------------------------------------------------------------------------*/ | |
| 412 | ||
| 413 | INLINE void | |
| 414 | sub192( | |
| 415 | bits64 a0, | |
| 416 | bits64 a1, | |
| 417 | bits64 a2, | |
| 418 | bits64 b0, | |
| 419 | bits64 b1, | |
| 420 | bits64 b2, | |
| 421 | bits64 *z0Ptr, | |
| 422 | bits64 *z1Ptr, | |
| 423 | bits64 *z2Ptr | |
| 424 | ) | |
| 425 | { | |
| 426 | bits64 z0, z1, z2; | |
| 427 | int8 borrow0, borrow1; | |
| 428 | ||
| 429 | z2 = a2 - b2; | |
| 430 | borrow1 = ( a2 < b2 ); | |
| 431 | z1 = a1 - b1; | |
| 432 | borrow0 = ( a1 < b1 ); | |
| 433 | z0 = a0 - b0; | |
| 434 | z0 -= ( z1 < borrow1 ); | |
| 435 | z1 -= borrow1; | |
| 436 | z0 -= borrow0; | |
| 437 | *z2Ptr = z2; | |
| 438 | *z1Ptr = z1; | |
| 439 | *z0Ptr = z0; | |
| 440 | ||
| 441 | } | |
| 442 | ||
| 443 | /*---------------------------------------------------------------------------- | |
| 444 | | Multiplies `a' by `b' to obtain a 128-bit product. The product is broken | |
| 445 | | into two 64-bit pieces which are stored at the locations pointed to by | |
| 446 | | `z0Ptr' and `z1Ptr'. | |
| 447 | *----------------------------------------------------------------------------*/ | |
| 448 | ||
| 449 | INLINE void mul64To128( bits64 a, bits64 b, bits64 *z0Ptr, bits64 *z1Ptr ) | |
| 450 | { | |
| 451 | bits32 aHigh, aLow, bHigh, bLow; | |
| 452 | bits64 z0, zMiddleA, zMiddleB, z1; | |
| 453 | ||
| 454 | aLow = a; | |
| 455 | aHigh = a>>32; | |
| 456 | bLow = b; | |
| 457 | bHigh = b>>32; | |
| 458 | z1 = ( (bits64) aLow ) * bLow; | |
| 459 | zMiddleA = ( (bits64) aLow ) * bHigh; | |
| 460 | zMiddleB = ( (bits64) aHigh ) * bLow; | |
| 461 | z0 = ( (bits64) aHigh ) * bHigh; | |
| 462 | zMiddleA += zMiddleB; | |
| 463 | z0 += ( ( (bits64) ( zMiddleA < zMiddleB ) )<<32 ) + ( zMiddleA>>32 ); | |
| 464 | zMiddleA <<= 32; | |
| 465 | z1 += zMiddleA; | |
| 466 | z0 += ( z1 < zMiddleA ); | |
| 467 | *z1Ptr = z1; | |
| 468 | *z0Ptr = z0; | |
| 469 | ||
| 470 | } | |
| 471 | ||
| 472 | /*---------------------------------------------------------------------------- | |
| 473 | | Multiplies the 128-bit value formed by concatenating `a0' and `a1' by | |
| 474 | | `b' to obtain a 192-bit product. The product is broken into three 64-bit | |
| 475 | | pieces which are stored at the locations pointed to by `z0Ptr', `z1Ptr', and | |
| 476 | | `z2Ptr'. | |
| 477 | *----------------------------------------------------------------------------*/ | |
| 478 | ||
| 479 | INLINE void | |
| 480 | mul128By64To192( | |
| 481 | bits64 a0, | |
| 482 | bits64 a1, | |
| 483 | bits64 b, | |
| 484 | bits64 *z0Ptr, | |
| 485 | bits64 *z1Ptr, | |
| 486 | bits64 *z2Ptr | |
| 487 | ) | |
| 488 | { | |
| 489 | bits64 z0, z1, z2, more1; | |
| 490 | ||
| 491 | mul64To128( a1, b, &z1, &z2 ); | |
| 492 | mul64To128( a0, b, &z0, &more1 ); | |
| 493 | add128( z0, more1, 0, z1, &z0, &z1 ); | |
| 494 | *z2Ptr = z2; | |
| 495 | *z1Ptr = z1; | |
| 496 | *z0Ptr = z0; | |
| 497 | ||
| 498 | } | |
| 499 | ||
| 500 | /*---------------------------------------------------------------------------- | |
| 501 | | Multiplies the 128-bit value formed by concatenating `a0' and `a1' to the | |
| 502 | | 128-bit value formed by concatenating `b0' and `b1' to obtain a 256-bit | |
| 503 | | product. The product is broken into four 64-bit pieces which are stored at | |
| 504 | | the locations pointed to by `z0Ptr', `z1Ptr', `z2Ptr', and `z3Ptr'. | |
| 505 | *----------------------------------------------------------------------------*/ | |
| 506 | ||
| 507 | INLINE void | |
| 508 | mul128To256( | |
| 509 | bits64 a0, | |
| 510 | bits64 a1, | |
| 511 | bits64 b0, | |
| 512 | bits64 b1, | |
| 513 | bits64 *z0Ptr, | |
| 514 | bits64 *z1Ptr, | |
| 515 | bits64 *z2Ptr, | |
| 516 | bits64 *z3Ptr | |
| 517 | ) | |
| 518 | { | |
| 519 | bits64 z0, z1, z2, z3; | |
| 520 | bits64 more1, more2; | |
| 521 | ||
| 522 | mul64To128( a1, b1, &z2, &z3 ); | |
| 523 | mul64To128( a1, b0, &z1, &more2 ); | |
| 524 | add128( z1, more2, 0, z2, &z1, &z2 ); | |
| 525 | mul64To128( a0, b0, &z0, &more1 ); | |
| 526 | add128( z0, more1, 0, z1, &z0, &z1 ); | |
| 527 | mul64To128( a0, b1, &more1, &more2 ); | |
| 528 | add128( more1, more2, 0, z2, &more1, &z2 ); | |
| 529 | add128( z0, z1, 0, more1, &z0, &z1 ); | |
| 530 | *z3Ptr = z3; | |
| 531 | *z2Ptr = z2; | |
| 532 | *z1Ptr = z1; | |
| 533 | *z0Ptr = z0; | |
| 534 | ||
| 535 | } | |
| 536 | ||
| 537 | /*---------------------------------------------------------------------------- | |
| 538 | | Returns an approximation to the 64-bit integer quotient obtained by dividing | |
| 539 | | `b' into the 128-bit value formed by concatenating `a0' and `a1'. The | |
| 540 | | divisor `b' must be at least 2^63. If q is the exact quotient truncated | |
| 541 | | toward zero, the approximation returned lies between q and q + 2 inclusive. | |
| 542 | | If the exact quotient q is larger than 64 bits, the maximum positive 64-bit | |
| 543 | | unsigned integer is returned. | |
| 544 | *----------------------------------------------------------------------------*/ | |
| 545 | ||
| 546 | static bits64 estimateDiv128To64( bits64 a0, bits64 a1, bits64 b ) | |
| 547 | { | |
| 548 | bits64 b0, b1; | |
| 549 | bits64 rem0, rem1, term0, term1; | |
| 550 | bits64 z; | |
| 551 | ||
| 552 | if ( b <= a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF ); | |
| 553 | b0 = b>>32; | |
| 554 | z = ( b0<<32 <= a0 ) ? LIT64( 0xFFFFFFFF00000000 ) : ( a0 / b0 )<<32; | |
| 555 | mul64To128( b, z, &term0, &term1 ); | |
| 556 | sub128( a0, a1, term0, term1, &rem0, &rem1 ); | |
| 557 | while ( ( (sbits64) rem0 ) < 0 ) { | |
| 558 | z -= LIT64( 0x100000000 ); | |
| 559 | b1 = b<<32; | |
| 560 | add128( rem0, rem1, b0, b1, &rem0, &rem1 ); | |
| 561 | } | |
| 562 | rem0 = ( rem0<<32 ) | ( rem1>>32 ); | |
| 563 | z |= ( b0<<32 <= rem0 ) ? 0xFFFFFFFF : rem0 / b0; | |
| 564 | return z; | |
| 565 | ||
| 566 | } | |
| 567 | ||
| 568 | /*---------------------------------------------------------------------------- | |
| 569 | | Returns an approximation to the square root of the 32-bit significand given | |
| 570 | | by `a'. Considered as an integer, `a' must be at least 2^31. If bit 0 of | |
| 571 | | `aExp' (the least significant bit) is 1, the integer returned approximates | |
| 572 | | 2^31*sqrt(`a'/2^31), where `a' is considered an integer. If bit 0 of `aExp' | |
| 573 | | is 0, the integer returned approximates 2^31*sqrt(`a'/2^30). In either | |
| 574 | | case, the approximation returned lies strictly within +/-2 of the exact | |
| 575 | | value. | |
| 576 | *----------------------------------------------------------------------------*/ | |
| 577 | ||
| 578 | static bits32 estimateSqrt32( int16 aExp, bits32 a ) | |
| 579 | { | |
| 580 | static const bits16 sqrtOddAdjustments[] = { | |
| 581 | 0x0004, 0x0022, 0x005D, 0x00B1, 0x011D, 0x019F, 0x0236, 0x02E0, | |
| 582 | 0x039C, 0x0468, 0x0545, 0x0631, 0x072B, 0x0832, 0x0946, 0x0A67 | |
| 583 | }; | |
| 584 | static const bits16 sqrtEvenAdjustments[] = { | |
| 585 | 0x0A2D, 0x08AF, 0x075A, 0x0629, 0x051A, 0x0429, 0x0356, 0x029E, | |
| 586 | 0x0200, 0x0179, 0x0109, 0x00AF, 0x0068, 0x0034, 0x0012, 0x0002 | |
| 587 | }; | |
| 588 | int8 index; | |
| 589 | bits32 z; | |
| 590 | ||
| 591 | index = ( a>>27 ) & 15; | |
| 592 | if ( aExp & 1 ) { | |
| 593 | z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ index ]; | |
| 594 | z = ( ( a / z )<<14 ) + ( z<<15 ); | |
| 595 | a >>= 1; | |
| 596 | } | |
| 597 | else { | |
| 598 | z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ index ]; | |
| 599 | z = a / z + z; | |
| 600 | z = ( 0x20000 <= z ) ? 0xFFFF8000 : ( z<<15 ); | |
| 601 | if ( z <= a ) return (bits32) ( ( (sbits32) a )>>1 ); | |
| 602 | } | |
| 603 | return ( (bits32) ( ( ( (bits64) a )<<31 ) / z ) ) + ( z>>1 ); | |
| 604 | ||
| 605 | } | |
| 606 | ||
| 607 | /*---------------------------------------------------------------------------- | |
| 608 | | Returns the number of leading 0 bits before the most-significant 1 bit of | |
| 609 | | `a'. If `a' is zero, 32 is returned. | |
| 610 | *----------------------------------------------------------------------------*/ | |
| 611 | ||
| 612 | static int8 countLeadingZeros32( bits32 a ) | |
| 613 | { | |
| 614 | static const int8 countLeadingZerosHigh[] = { | |
| 615 | 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, | |
| 616 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | |
| 617 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| 618 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| 619 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 620 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 621 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 622 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 623 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 624 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 625 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 626 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 627 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 628 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 629 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 630 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | |
| 631 | }; | |
| 632 | int8 shiftCount; | |
| 633 | ||
| 634 | shiftCount = 0; | |
| 635 | if ( a < 0x10000 ) { | |
| 636 | shiftCount += 16; | |
| 637 | a <<= 16; | |
| 638 | } | |
| 639 | if ( a < 0x1000000 ) { | |
| 640 | shiftCount += 8; | |
| 641 | a <<= 8; | |
| 642 | } | |
| 643 | shiftCount += countLeadingZerosHigh[ a>>24 ]; | |
| 644 | return shiftCount; | |
| 645 | ||
| 646 | } | |
| 647 | ||
| 648 | /*---------------------------------------------------------------------------- | |
| 649 | | Returns the number of leading 0 bits before the most-significant 1 bit of | |
| 650 | | `a'. If `a' is zero, 64 is returned. | |
| 651 | *----------------------------------------------------------------------------*/ | |
| 652 | ||
| 653 | static int8 countLeadingZeros64( bits64 a ) | |
| 654 | { | |
| 655 | int8 shiftCount; | |
| 656 | ||
| 657 | shiftCount = 0; | |
| 658 | if ( a < ( (bits64) 1 )<<32 ) { | |
| 659 | shiftCount += 32; | |
| 660 | } | |
| 661 | else { | |
| 662 | a >>= 32; | |
| 663 | } | |
| 664 | shiftCount += countLeadingZeros32( a ); | |
| 665 | return shiftCount; | |
| 666 | ||
| 667 | } | |
| 668 | ||
| 669 | /*---------------------------------------------------------------------------- | |
| 670 | | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' | |
| 671 | | is equal to the 128-bit value formed by concatenating `b0' and `b1'. | |
| 672 | | Otherwise, returns 0. | |
| 673 | *----------------------------------------------------------------------------*/ | |
| 674 | ||
| 675 | INLINE flag eq128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 ) | |
| 676 | { | |
| 677 | ||
| 678 | return ( a0 == b0 ) && ( a1 == b1 ); | |
| 679 | ||
| 680 | } | |
| 681 | ||
| 682 | /*---------------------------------------------------------------------------- | |
| 683 | | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less | |
| 684 | | than or equal to the 128-bit value formed by concatenating `b0' and `b1'. | |
| 685 | | Otherwise, returns 0. | |
| 686 | *----------------------------------------------------------------------------*/ | |
| 687 | ||
| 688 | INLINE flag le128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 ) | |
| 689 | { | |
| 690 | ||
| 691 | return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 <= b1 ) ); | |
| 692 | ||
| 693 | } | |
| 694 | ||
| 695 | /*---------------------------------------------------------------------------- | |
| 696 | | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less | |
| 697 | | than the 128-bit value formed by concatenating `b0' and `b1'. Otherwise, | |
| 698 | | returns 0. | |
| 699 | *----------------------------------------------------------------------------*/ | |
| 700 | ||
| 701 | INLINE flag lt128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 ) | |
| 702 | { | |
| 703 | ||
| 704 | return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 < b1 ) ); | |
| 705 | ||
| 706 | } | |
| 707 | ||
| 708 | /*---------------------------------------------------------------------------- | |
| 709 | | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is | |
| 710 | | not equal to the 128-bit value formed by concatenating `b0' and `b1'. | |
| 711 | | Otherwise, returns 0. | |
| 712 | *----------------------------------------------------------------------------*/ | |
| 713 | ||
| 714 | INLINE flag ne128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 ) | |
| 715 | { | |
| 716 | ||
| 717 | return ( a0 != b0 ) || ( a1 != b1 ); | |
| 718 | ||
| 719 | } | |
| 720 |
| r0 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | /*============================================================================ | |
| 3 | ||
| 4 | This C source fragment is part of the SoftFloat IEC/IEEE Floating-point | |
| 5 | Arithmetic Package, Release 2b. | |
| 6 | ||
| 7 | Written by John R. Hauser. This work was made possible in part by the | |
| 8 | International Computer Science Institute, located at Suite 600, 1947 Center | |
| 9 | Street, Berkeley, California 94704. Funding was partially provided by the | |
| 10 | National Science Foundation under grant MIP-9311980. The original version | |
| 11 | of this code was written as part of a project to build a fixed-point vector | |
| 12 | processor in collaboration with the University of California at Berkeley, | |
| 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information | |
| 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | |
| 15 | arithmetic/SoftFloat.html'. | |
| 16 | ||
| 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | |
| 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | |
| 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | |
| 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | |
| 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | |
| 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | |
| 23 | INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | |
| 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | |
| 25 | ||
| 26 | Derivative works are acceptable, even for commercial purposes, so long as | |
| 27 | (1) the source code for the derivative work includes prominent notice that | |
| 28 | the work is derivative, and (2) the source code includes prominent notice with | |
| 29 | these four paragraphs for those parts of this code that are retained. | |
| 30 | ||
| 31 | =============================================================================*/ | |
| 32 | ||
| 33 | /*---------------------------------------------------------------------------- | |
| 34 | | Underflow tininess-detection mode, statically initialized to default value. | |
| 35 | | (The declaration in `softfloat.h' must match the `int8' type here.) | |
| 36 | *----------------------------------------------------------------------------*/ | |
| 37 | int8 float_detect_tininess = float_tininess_after_rounding; | |
| 38 | ||
| 39 | /*---------------------------------------------------------------------------- | |
| 40 | | Raises the exceptions specified by `flags'. Floating-point traps can be | |
| 41 | | defined here if desired. It is currently not possible for such a trap to | |
| 42 | | substitute a result value. If traps are not implemented, this routine | |
| 43 | | should be simply `float_exception_flags |= flags;'. | |
| 44 | *----------------------------------------------------------------------------*/ | |
| 45 | ||
| 46 | void float_raise( int8 flags ) | |
| 47 | { | |
| 48 | ||
| 49 | float_exception_flags |= flags; | |
| 50 | ||
| 51 | } | |
| 52 | ||
| 53 | /*---------------------------------------------------------------------------- | |
| 54 | | Internal canonical NaN format. | |
| 55 | *----------------------------------------------------------------------------*/ | |
| 56 | typedef struct { | |
| 57 | flag sign; | |
| 58 | bits64 high, low; | |
| 59 | } commonNaNT; | |
| 60 | ||
| 61 | /*---------------------------------------------------------------------------- | |
| 62 | | The pattern for a default generated single-precision NaN. | |
| 63 | *----------------------------------------------------------------------------*/ | |
| 64 | #define float32_default_nan 0xFFFFFFFF | |
| 65 | ||
| 66 | /*---------------------------------------------------------------------------- | |
| 67 | | Returns 1 if the single-precision floating-point value `a' is a NaN; | |
| 68 | | otherwise returns 0. | |
| 69 | *----------------------------------------------------------------------------*/ | |
| 70 | ||
| 71 | flag float32_is_nan( float32 a ) | |
| 72 | { | |
| 73 | ||
| 74 | return ( 0xFF000000 < (bits32) ( a<<1 ) ); | |
| 75 | ||
| 76 | } | |
| 77 | ||
| 78 | /*---------------------------------------------------------------------------- | |
| 79 | | Returns 1 if the single-precision floating-point value `a' is a signaling | |
| 80 | | NaN; otherwise returns 0. | |
| 81 | *----------------------------------------------------------------------------*/ | |
| 82 | ||
| 83 | flag float32_is_signaling_nan( float32 a ) | |
| 84 | { | |
| 85 | ||
| 86 | return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); | |
| 87 | ||
| 88 | } | |
| 89 | ||
| 90 | /*---------------------------------------------------------------------------- | |
| 91 | | Returns the result of converting the single-precision floating-point NaN | |
| 92 | | `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | |
| 93 | | exception is raised. | |
| 94 | *----------------------------------------------------------------------------*/ | |
| 95 | ||
| 96 | static commonNaNT float32ToCommonNaN( float32 a ) | |
| 97 | { | |
| 98 | commonNaNT z; | |
| 99 | ||
| 100 | if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | |
| 101 | z.sign = a>>31; | |
| 102 | z.low = 0; | |
| 103 | z.high = ( (bits64) a )<<41; | |
| 104 | return z; | |
| 105 | ||
| 106 | } | |
| 107 | ||
| 108 | /*---------------------------------------------------------------------------- | |
| 109 | | Returns the result of converting the canonical NaN `a' to the single- | |
| 110 | | precision floating-point format. | |
| 111 | *----------------------------------------------------------------------------*/ | |
| 112 | ||
| 113 | static float32 commonNaNToFloat32( commonNaNT a ) | |
| 114 | { | |
| 115 | ||
| 116 | return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 ); | |
| 117 | ||
| 118 | } | |
| 119 | ||
| 120 | /*---------------------------------------------------------------------------- | |
| 121 | | Takes two single-precision floating-point values `a' and `b', one of which | |
| 122 | | is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | |
| 123 | | signaling NaN, the invalid exception is raised. | |
| 124 | *----------------------------------------------------------------------------*/ | |
| 125 | ||
| 126 | static float32 propagateFloat32NaN( float32 a, float32 b ) | |
| 127 | { | |
| 128 | flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | |
| 129 | ||
| 130 | aIsNaN = float32_is_nan( a ); | |
| 131 | aIsSignalingNaN = float32_is_signaling_nan( a ); | |
| 132 | bIsNaN = float32_is_nan( b ); | |
| 133 | bIsSignalingNaN = float32_is_signaling_nan( b ); | |
| 134 | a |= 0x00400000; | |
| 135 | b |= 0x00400000; | |
| 136 | if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | |
| 137 | if ( aIsNaN ) { | |
| 138 | return ( aIsSignalingNaN & bIsNaN ) ? b : a; | |
| 139 | } | |
| 140 | else { | |
| 141 | return b; | |
| 142 | } | |
| 143 | ||
| 144 | } | |
| 145 | ||
| 146 | /*---------------------------------------------------------------------------- | |
| 147 | | The pattern for a default generated double-precision NaN. | |
| 148 | *----------------------------------------------------------------------------*/ | |
| 149 | #define float64_default_nan LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 150 | ||
| 151 | /*---------------------------------------------------------------------------- | |
| 152 | | Returns 1 if the double-precision floating-point value `a' is a NaN; | |
| 153 | | otherwise returns 0. | |
| 154 | *----------------------------------------------------------------------------*/ | |
| 155 | ||
| 156 | flag float64_is_nan( float64 a ) | |
| 157 | { | |
| 158 | ||
| 159 | return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) ); | |
| 160 | ||
| 161 | } | |
| 162 | ||
| 163 | /*---------------------------------------------------------------------------- | |
| 164 | | Returns 1 if the double-precision floating-point value `a' is a signaling | |
| 165 | | NaN; otherwise returns 0. | |
| 166 | *----------------------------------------------------------------------------*/ | |
| 167 | ||
| 168 | flag float64_is_signaling_nan( float64 a ) | |
| 169 | { | |
| 170 | ||
| 171 | return | |
| 172 | ( ( ( a>>51 ) & 0xFFF ) == 0xFFE ) | |
| 173 | && ( a & LIT64( 0x0007FFFFFFFFFFFF ) ); | |
| 174 | ||
| 175 | } | |
| 176 | ||
| 177 | /*---------------------------------------------------------------------------- | |
| 178 | | Returns the result of converting the double-precision floating-point NaN | |
| 179 | | `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | |
| 180 | | exception is raised. | |
| 181 | *----------------------------------------------------------------------------*/ | |
| 182 | ||
| 183 | static commonNaNT float64ToCommonNaN( float64 a ) | |
| 184 | { | |
| 185 | commonNaNT z; | |
| 186 | ||
| 187 | if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | |
| 188 | z.sign = a>>63; | |
| 189 | z.low = 0; | |
| 190 | z.high = a<<12; | |
| 191 | return z; | |
| 192 | ||
| 193 | } | |
| 194 | ||
| 195 | /*---------------------------------------------------------------------------- | |
| 196 | | Returns the result of converting the canonical NaN `a' to the double- | |
| 197 | | precision floating-point format. | |
| 198 | *----------------------------------------------------------------------------*/ | |
| 199 | ||
| 200 | static float64 commonNaNToFloat64( commonNaNT a ) | |
| 201 | { | |
| 202 | ||
| 203 | return | |
| 204 | ( ( (bits64) a.sign )<<63 ) | |
| 205 | | LIT64( 0x7FF8000000000000 ) | |
| 206 | | ( a.high>>12 ); | |
| 207 | ||
| 208 | } | |
| 209 | ||
| 210 | /*---------------------------------------------------------------------------- | |
| 211 | | Takes two double-precision floating-point values `a' and `b', one of which | |
| 212 | | is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | |
| 213 | | signaling NaN, the invalid exception is raised. | |
| 214 | *----------------------------------------------------------------------------*/ | |
| 215 | ||
| 216 | static float64 propagateFloat64NaN( float64 a, float64 b ) | |
| 217 | { | |
| 218 | flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | |
| 219 | ||
| 220 | aIsNaN = float64_is_nan( a ); | |
| 221 | aIsSignalingNaN = float64_is_signaling_nan( a ); | |
| 222 | bIsNaN = float64_is_nan( b ); | |
| 223 | bIsSignalingNaN = float64_is_signaling_nan( b ); | |
| 224 | a |= LIT64( 0x0008000000000000 ); | |
| 225 | b |= LIT64( 0x0008000000000000 ); | |
| 226 | if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | |
| 227 | if ( aIsNaN ) { | |
| 228 | return ( aIsSignalingNaN & bIsNaN ) ? b : a; | |
| 229 | } | |
| 230 | else { | |
| 231 | return b; | |
| 232 | } | |
| 233 | ||
| 234 | } | |
| 235 | ||
| 236 | #ifdef FLOATX80 | |
| 237 | ||
| 238 | /*---------------------------------------------------------------------------- | |
| 239 | | The pattern for a default generated extended double-precision NaN. The | |
| 240 | | `high' and `low' values hold the most- and least-significant bits, | |
| 241 | | respectively. | |
| 242 | *----------------------------------------------------------------------------*/ | |
| 243 | #define floatx80_default_nan_high 0xFFFF | |
| 244 | #define floatx80_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 245 | ||
| 246 | /*---------------------------------------------------------------------------- | |
| 247 | | Returns 1 if the extended double-precision floating-point value `a' is a | |
| 248 | | NaN; otherwise returns 0. | |
| 249 | *----------------------------------------------------------------------------*/ | |
| 250 | ||
| 251 | flag floatx80_is_nan( floatx80 a ) | |
| 252 | { | |
| 253 | ||
| 254 | return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( a.low<<1 ); | |
| 255 | ||
| 256 | } | |
| 257 | ||
| 258 | /*---------------------------------------------------------------------------- | |
| 259 | | Returns 1 if the extended double-precision floating-point value `a' is a | |
| 260 | | signaling NaN; otherwise returns 0. | |
| 261 | *----------------------------------------------------------------------------*/ | |
| 262 | ||
| 263 | flag floatx80_is_signaling_nan( floatx80 a ) | |
| 264 | { | |
| 265 | bits64 aLow; | |
| 266 | ||
| 267 | aLow = a.low & ~ LIT64( 0x4000000000000000 ); | |
| 268 | return | |
| 269 | ( ( a.high & 0x7FFF ) == 0x7FFF ) | |
| 270 | && (bits64) ( aLow<<1 ) | |
| 271 | && ( a.low == aLow ); | |
| 272 | ||
| 273 | } | |
| 274 | ||
| 275 | /*---------------------------------------------------------------------------- | |
| 276 | | Returns the result of converting the extended double-precision floating- | |
| 277 | | point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the | |
| 278 | | invalid exception is raised. | |
| 279 | *----------------------------------------------------------------------------*/ | |
| 280 | ||
| 281 | static commonNaNT floatx80ToCommonNaN( floatx80 a ) | |
| 282 | { | |
| 283 | commonNaNT z; | |
| 284 | ||
| 285 | if ( floatx80_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | |
| 286 | z.sign = a.high>>15; | |
| 287 | z.low = 0; | |
| 288 | z.high = a.low<<1; | |
| 289 | return z; | |
| 290 | ||
| 291 | } | |
| 292 | ||
| 293 | /*---------------------------------------------------------------------------- | |
| 294 | | Returns the result of converting the canonical NaN `a' to the extended | |
| 295 | | double-precision floating-point format. | |
| 296 | *----------------------------------------------------------------------------*/ | |
| 297 | ||
| 298 | static floatx80 commonNaNToFloatx80( commonNaNT a ) | |
| 299 | { | |
| 300 | floatx80 z; | |
| 301 | ||
| 302 | z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 ); | |
| 303 | z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF; | |
| 304 | return z; | |
| 305 | ||
| 306 | } | |
| 307 | ||
| 308 | /*---------------------------------------------------------------------------- | |
| 309 | | Takes two extended double-precision floating-point values `a' and `b', one | |
| 310 | | of which is a NaN, and returns the appropriate NaN result. If either `a' or | |
| 311 | | `b' is a signaling NaN, the invalid exception is raised. | |
| 312 | *----------------------------------------------------------------------------*/ | |
| 313 | ||
| 314 | static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) | |
| 315 | { | |
| 316 | flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | |
| 317 | ||
| 318 | aIsNaN = floatx80_is_nan( a ); | |
| 319 | aIsSignalingNaN = floatx80_is_signaling_nan( a ); | |
| 320 | bIsNaN = floatx80_is_nan( b ); | |
| 321 | bIsSignalingNaN = floatx80_is_signaling_nan( b ); | |
| 322 | a.low |= LIT64( 0xC000000000000000 ); | |
| 323 | b.low |= LIT64( 0xC000000000000000 ); | |
| 324 | if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | |
| 325 | if ( aIsNaN ) { | |
| 326 | return ( aIsSignalingNaN & bIsNaN ) ? b : a; | |
| 327 | } | |
| 328 | else { | |
| 329 | return b; | |
| 330 | } | |
| 331 | ||
| 332 | } | |
| 333 | ||
| 334 | #endif | |
| 335 | ||
| 336 | #ifdef FLOAT128 | |
| 337 | ||
| 338 | /*---------------------------------------------------------------------------- | |
| 339 | | The pattern for a default generated quadruple-precision NaN. The `high' and | |
| 340 | | `low' values hold the most- and least-significant bits, respectively. | |
| 341 | *----------------------------------------------------------------------------*/ | |
| 342 | #define float128_default_nan_high LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 343 | #define float128_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) | |
| 344 | ||
| 345 | /*---------------------------------------------------------------------------- | |
| 346 | | Returns 1 if the quadruple-precision floating-point value `a' is a NaN; | |
| 347 | | otherwise returns 0. | |
| 348 | *----------------------------------------------------------------------------*/ | |
| 349 | ||
| 350 | flag float128_is_nan( float128 a ) | |
| 351 | { | |
| 352 | ||
| 353 | return | |
| 354 | ( LIT64( 0xFFFE000000000000 ) <= (bits64) ( a.high<<1 ) ) | |
| 355 | && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) ); | |
| 356 | ||
| 357 | } | |
| 358 | ||
| 359 | /*---------------------------------------------------------------------------- | |
| 360 | | Returns 1 if the quadruple-precision floating-point value `a' is a | |
| 361 | | signaling NaN; otherwise returns 0. | |
| 362 | *----------------------------------------------------------------------------*/ | |
| 363 | ||
| 364 | flag float128_is_signaling_nan( float128 a ) | |
| 365 | { | |
| 366 | ||
| 367 | return | |
| 368 | ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE ) | |
| 369 | && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) ); | |
| 370 | ||
| 371 | } | |
| 372 | ||
| 373 | /*---------------------------------------------------------------------------- | |
| 374 | | Returns the result of converting the quadruple-precision floating-point NaN | |
| 375 | | `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | |
| 376 | | exception is raised. | |
| 377 | *----------------------------------------------------------------------------*/ | |
| 378 | ||
| 379 | static commonNaNT float128ToCommonNaN( float128 a ) | |
| 380 | { | |
| 381 | commonNaNT z; | |
| 382 | ||
| 383 | if ( float128_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | |
| 384 | z.sign = a.high>>63; | |
| 385 | shortShift128Left( a.high, a.low, 16, &z.high, &z.low ); | |
| 386 | return z; | |
| 387 | ||
| 388 | } | |
| 389 | ||
| 390 | /*---------------------------------------------------------------------------- | |
| 391 | | Returns the result of converting the canonical NaN `a' to the quadruple- | |
| 392 | | precision floating-point format. | |
| 393 | *----------------------------------------------------------------------------*/ | |
| 394 | ||
| 395 | static float128 commonNaNToFloat128( commonNaNT a ) | |
| 396 | { | |
| 397 | float128 z; | |
| 398 | ||
| 399 | shift128Right( a.high, a.low, 16, &z.high, &z.low ); | |
| 400 | z.high |= ( ( (bits64) a.sign )<<63 ) | LIT64( 0x7FFF800000000000 ); | |
| 401 | return z; | |
| 402 | ||
| 403 | } | |
| 404 | ||
| 405 | /*---------------------------------------------------------------------------- | |
| 406 | | Takes two quadruple-precision floating-point values `a' and `b', one of | |
| 407 | | which is a NaN, and returns the appropriate NaN result. If either `a' or | |
| 408 | | `b' is a signaling NaN, the invalid exception is raised. | |
| 409 | *----------------------------------------------------------------------------*/ | |
| 410 | ||
| 411 | static float128 propagateFloat128NaN( float128 a, float128 b ) | |
| 412 | { | |
| 413 | flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | |
| 414 | ||
| 415 | aIsNaN = float128_is_nan( a ); | |
| 416 | aIsSignalingNaN = float128_is_signaling_nan( a ); | |
| 417 | bIsNaN = float128_is_nan( b ); | |
| 418 | bIsSignalingNaN = float128_is_signaling_nan( b ); | |
| 419 | a.high |= LIT64( 0x0000800000000000 ); | |
| 420 | b.high |= LIT64( 0x0000800000000000 ); | |
| 421 | if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | |
| 422 | if ( aIsNaN ) { | |
| 423 | return ( aIsSignalingNaN & bIsNaN ) ? b : a; | |
| 424 | } | |
| 425 | else { | |
| 426 | return b; | |
| 427 | } | |
| 428 | ||
| 429 | } | |
| 430 | ||
| 431 | #endif | |
| 432 |
| r0 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | /*============================================================================ | |
| 3 | ||
| 4 | This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | |
| 5 | Package, Release 2b. | |
| 6 | ||
| 7 | Written by John R. Hauser. This work was made possible in part by the | |
| 8 | International Computer Science Institute, located at Suite 600, 1947 Center | |
| 9 | Street, Berkeley, California 94704. Funding was partially provided by the | |
| 10 | National Science Foundation under grant MIP-9311980. The original version | |
| 11 | of this code was written as part of a project to build a fixed-point vector | |
| 12 | processor in collaboration with the University of California at Berkeley, | |
| 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information | |
| 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | |
| 15 | arithmetic/SoftFloat.html'. | |
| 16 | ||
| 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | |
| 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | |
| 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | |
| 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | |
| 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | |
| 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | |
| 23 | INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | |
| 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | |
| 25 | ||
| 26 | Derivative works are acceptable, even for commercial purposes, so long as | |
| 27 | (1) the source code for the derivative work includes prominent notice that | |
| 28 | the work is derivative, and (2) the source code includes prominent notice with | |
| 29 | these four paragraphs for those parts of this code that are retained. | |
| 30 | ||
| 31 | =============================================================================*/ | |
| 32 | ||
| 33 | /*---------------------------------------------------------------------------- | |
| 34 | | The macro `FLOATX80' must be defined to enable the extended double-precision | |
| 35 | | floating-point format `floatx80'. If this macro is not defined, the | |
| 36 | | `floatx80' type will not be defined, and none of the functions that either | |
| 37 | | input or output the `floatx80' type will be defined. The same applies to | |
| 38 | | the `FLOAT128' macro and the quadruple-precision format `float128'. | |
| 39 | *----------------------------------------------------------------------------*/ | |
| 40 | #define FLOATX80 | |
| 41 | #define FLOAT128 | |
| 42 | ||
| 43 | /*---------------------------------------------------------------------------- | |
| 44 | | Software IEC/IEEE floating-point types. | |
| 45 | *----------------------------------------------------------------------------*/ | |
| 46 | typedef bits32 float32; | |
| 47 | typedef bits64 float64; | |
| 48 | #ifdef FLOATX80 | |
| 49 | typedef struct { | |
| 50 | bits16 high; | |
| 51 | bits64 low; | |
| 52 | } floatx80; | |
| 53 | #endif | |
| 54 | #ifdef FLOAT128 | |
| 55 | typedef struct { | |
| 56 | bits64 high, low; | |
| 57 | } float128; | |
| 58 | #endif | |
| 59 | ||
| 60 | /*---------------------------------------------------------------------------- | |
| 61 | | Software IEC/IEEE floating-point underflow tininess-detection mode. | |
| 62 | *----------------------------------------------------------------------------*/ | |
| 63 | extern int8 float_detect_tininess; | |
| 64 | enum { | |
| 65 | float_tininess_after_rounding = 0, | |
| 66 | float_tininess_before_rounding = 1 | |
| 67 | }; | |
| 68 | ||
| 69 | /*---------------------------------------------------------------------------- | |
| 70 | | Software IEC/IEEE floating-point rounding mode. | |
| 71 | *----------------------------------------------------------------------------*/ | |
| 72 | extern int8 float_rounding_mode; | |
| 73 | enum { | |
| 74 | float_round_nearest_even = 0, | |
| 75 | float_round_to_zero = 1, | |
| 76 | float_round_down = 2, | |
| 77 | float_round_up = 3 | |
| 78 | }; | |
| 79 | ||
| 80 | /*---------------------------------------------------------------------------- | |
| 81 | | Software IEC/IEEE floating-point exception flags. | |
| 82 | *----------------------------------------------------------------------------*/ | |
| 83 | extern int8 float_exception_flags; | |
| 84 | enum { | |
| 85 | float_flag_inexact = 1, | |
| 86 | float_flag_underflow = 2, | |
| 87 | float_flag_overflow = 4, | |
| 88 | float_flag_divbyzero = 8, | |
| 89 | float_flag_invalid = 16 | |
| 90 | }; | |
| 91 | ||
| 92 | /*---------------------------------------------------------------------------- | |
| 93 | | Routine to raise any or all of the software IEC/IEEE floating-point | |
| 94 | | exception flags. | |
| 95 | *----------------------------------------------------------------------------*/ | |
| 96 | void float_raise( int8 ); | |
| 97 | ||
| 98 | /*---------------------------------------------------------------------------- | |
| 99 | | Software IEC/IEEE integer-to-floating-point conversion routines. | |
| 100 | *----------------------------------------------------------------------------*/ | |
| 101 | float32 int32_to_float32( int32 ); | |
| 102 | float64 int32_to_float64( int32 ); | |
| 103 | #ifdef FLOATX80 | |
| 104 | floatx80 int32_to_floatx80( int32 ); | |
| 105 | #endif | |
| 106 | #ifdef FLOAT128 | |
| 107 | float128 int32_to_float128( int32 ); | |
| 108 | #endif | |
| 109 | float32 int64_to_float32( int64 ); | |
| 110 | float64 int64_to_float64( int64 ); | |
| 111 | #ifdef FLOATX80 | |
| 112 | floatx80 int64_to_floatx80( int64 ); | |
| 113 | #endif | |
| 114 | #ifdef FLOAT128 | |
| 115 | float128 int64_to_float128( int64 ); | |
| 116 | #endif | |
| 117 | ||
| 118 | /*---------------------------------------------------------------------------- | |
| 119 | | Software IEC/IEEE single-precision conversion routines. | |
| 120 | *----------------------------------------------------------------------------*/ | |
| 121 | int32 float32_to_int32( float32 ); | |
| 122 | int32 float32_to_int32_round_to_zero( float32 ); | |
| 123 | int64 float32_to_int64( float32 ); | |
| 124 | int64 float32_to_int64_round_to_zero( float32 ); | |
| 125 | float64 float32_to_float64( float32 ); | |
| 126 | #ifdef FLOATX80 | |
| 127 | floatx80 float32_to_floatx80( float32 ); | |
| 128 | #endif | |
| 129 | #ifdef FLOAT128 | |
| 130 | float128 float32_to_float128( float32 ); | |
| 131 | #endif | |
| 132 | ||
| 133 | /*---------------------------------------------------------------------------- | |
| 134 | | Software IEC/IEEE single-precision operations. | |
| 135 | *----------------------------------------------------------------------------*/ | |
| 136 | float32 float32_round_to_int( float32 ); | |
| 137 | float32 float32_add( float32, float32 ); | |
| 138 | float32 float32_sub( float32, float32 ); | |
| 139 | float32 float32_mul( float32, float32 ); | |
| 140 | float32 float32_div( float32, float32 ); | |
| 141 | float32 float32_rem( float32, float32 ); | |
| 142 | float32 float32_sqrt( float32 ); | |
| 143 | flag float32_eq( float32, float32 ); | |
| 144 | flag float32_le( float32, float32 ); | |
| 145 | flag float32_lt( float32, float32 ); | |
| 146 | flag float32_eq_signaling( float32, float32 ); | |
| 147 | flag float32_le_quiet( float32, float32 ); | |
| 148 | flag float32_lt_quiet( float32, float32 ); | |
| 149 | flag float32_is_signaling_nan( float32 ); | |
| 150 | ||
| 151 | /*---------------------------------------------------------------------------- | |
| 152 | | Software IEC/IEEE double-precision conversion routines. | |
| 153 | *----------------------------------------------------------------------------*/ | |
| 154 | int32 float64_to_int32( float64 ); | |
| 155 | int32 float64_to_int32_round_to_zero( float64 ); | |
| 156 | int64 float64_to_int64( float64 ); | |
| 157 | int64 float64_to_int64_round_to_zero( float64 ); | |
| 158 | float32 float64_to_float32( float64 ); | |
| 159 | #ifdef FLOATX80 | |
| 160 | floatx80 float64_to_floatx80( float64 ); | |
| 161 | #endif | |
| 162 | #ifdef FLOAT128 | |
| 163 | float128 float64_to_float128( float64 ); | |
| 164 | #endif | |
| 165 | ||
| 166 | /*---------------------------------------------------------------------------- | |
| 167 | | Software IEC/IEEE double-precision operations. | |
| 168 | *----------------------------------------------------------------------------*/ | |
| 169 | float64 float64_round_to_int( float64 ); | |
| 170 | float64 float64_add( float64, float64 ); | |
| 171 | float64 float64_sub( float64, float64 ); | |
| 172 | float64 float64_mul( float64, float64 ); | |
| 173 | float64 float64_div( float64, float64 ); | |
| 174 | float64 float64_rem( float64, float64 ); | |
| 175 | float64 float64_sqrt( float64 ); | |
| 176 | flag float64_eq( float64, float64 ); | |
| 177 | flag float64_le( float64, float64 ); | |
| 178 | flag float64_lt( float64, float64 ); | |
| 179 | flag float64_eq_signaling( float64, float64 ); | |
| 180 | flag float64_le_quiet( float64, float64 ); | |
| 181 | flag float64_lt_quiet( float64, float64 ); | |
| 182 | flag float64_is_signaling_nan( float64 ); | |
| 183 | ||
| 184 | #ifdef FLOATX80 | |
| 185 | ||
| 186 | /*---------------------------------------------------------------------------- | |
| 187 | | Software IEC/IEEE extended double-precision conversion routines. | |
| 188 | *----------------------------------------------------------------------------*/ | |
| 189 | int32 floatx80_to_int32( floatx80 ); | |
| 190 | int32 floatx80_to_int32_round_to_zero( floatx80 ); | |
| 191 | int64 floatx80_to_int64( floatx80 ); | |
| 192 | int64 floatx80_to_int64_round_to_zero( floatx80 ); | |
| 193 | float32 floatx80_to_float32( floatx80 ); | |
| 194 | float64 floatx80_to_float64( floatx80 ); | |
| 195 | #ifdef FLOAT128 | |
| 196 | float128 floatx80_to_float128( floatx80 ); | |
| 197 | #endif | |
| 198 | ||
| 199 | /*---------------------------------------------------------------------------- | |
| 200 | | Software IEC/IEEE extended double-precision rounding precision. Valid | |
| 201 | | values are 32, 64, and 80. | |
| 202 | *----------------------------------------------------------------------------*/ | |
| 203 | extern int8 floatx80_rounding_precision; | |
| 204 | ||
| 205 | /*---------------------------------------------------------------------------- | |
| 206 | | Software IEC/IEEE extended double-precision operations. | |
| 207 | *----------------------------------------------------------------------------*/ | |
| 208 | floatx80 floatx80_round_to_int( floatx80 ); | |
| 209 | floatx80 floatx80_add( floatx80, floatx80 ); | |
| 210 | floatx80 floatx80_sub( floatx80, floatx80 ); | |
| 211 | floatx80 floatx80_mul( floatx80, floatx80 ); | |
| 212 | floatx80 floatx80_div( floatx80, floatx80 ); | |
| 213 | floatx80 floatx80_rem( floatx80, floatx80 ); | |
| 214 | floatx80 floatx80_sqrt( floatx80 ); | |
| 215 | flag floatx80_eq( floatx80, floatx80 ); | |
| 216 | flag floatx80_le( floatx80, floatx80 ); | |
| 217 | flag floatx80_lt( floatx80, floatx80 ); | |
| 218 | flag floatx80_eq_signaling( floatx80, floatx80 ); | |
| 219 | flag floatx80_le_quiet( floatx80, floatx80 ); | |
| 220 | flag floatx80_lt_quiet( floatx80, floatx80 ); | |
| 221 | flag floatx80_is_signaling_nan( floatx80 ); | |
| 222 | ||
| 223 | #endif | |
| 224 | ||
| 225 | #ifdef FLOAT128 | |
| 226 | ||
| 227 | /*---------------------------------------------------------------------------- | |
| 228 | | Software IEC/IEEE quadruple-precision conversion routines. | |
| 229 | *----------------------------------------------------------------------------*/ | |
| 230 | int32 float128_to_int32( float128 ); | |
| 231 | int32 float128_to_int32_round_to_zero( float128 ); | |
| 232 | int64 float128_to_int64( float128 ); | |
| 233 | int64 float128_to_int64_round_to_zero( float128 ); | |
| 234 | float32 float128_to_float32( float128 ); | |
| 235 | float64 float128_to_float64( float128 ); | |
| 236 | #ifdef FLOATX80 | |
| 237 | floatx80 float128_to_floatx80( float128 ); | |
| 238 | #endif | |
| 239 | ||
| 240 | /*---------------------------------------------------------------------------- | |
| 241 | | Software IEC/IEEE quadruple-precision operations. | |
| 242 | *----------------------------------------------------------------------------*/ | |
| 243 | float128 float128_round_to_int( float128 ); | |
| 244 | float128 float128_add( float128, float128 ); | |
| 245 | float128 float128_sub( float128, float128 ); | |
| 246 | float128 float128_mul( float128, float128 ); | |
| 247 | float128 float128_div( float128, float128 ); | |
| 248 | float128 float128_rem( float128, float128 ); | |
| 249 | float128 float128_sqrt( float128 ); | |
| 250 | flag float128_eq( float128, float128 ); | |
| 251 | flag float128_le( float128, float128 ); | |
| 252 | flag float128_lt( float128, float128 ); | |
| 253 | flag float128_eq_signaling( float128, float128 ); | |
| 254 | flag float128_le_quiet( float128, float128 ); | |
| 255 | flag float128_lt_quiet( float128, float128 ); | |
| 256 | flag float128_is_signaling_nan( float128 ); | |
| 257 | ||
| 258 | #endif | |
| 259 |
| r0 | r7501 | |
|---|---|---|
| 1 | ||
| 2 | /*============================================================================ | |
| 3 | ||
| 4 | This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | |
| 5 | Package, Release 2b. | |
| 6 | ||
| 7 | Written by John R. Hauser. This work was made possible in part by the | |
| 8 | International Computer Science Institute, located at Suite 600, 1947 Center | |
| 9 | Street, Berkeley, California 94704. Funding was partially provided by the | |
| 10 | National Science Foundation under grant MIP-9311980. The original version | |
| 11 | of this code was written as part of a project to build a fixed-point vector | |
| 12 | processor in collaboration with the University of California at Berkeley, | |
| 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information | |
| 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | |
| 15 | arithmetic/SoftFloat.html'. | |
| 16 | ||
| 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | |
| 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | |
| 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | |
| 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | |
| 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | |
| 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | |
| 23 | INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | |
| 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | |
| 25 | ||
| 26 | Derivative works are acceptable, even for commercial purposes, so long as | |
| 27 | (1) the source code for the derivative work includes prominent notice that | |
| 28 | the work is derivative, and (2) the source code includes prominent notice with | |
| 29 | these four paragraphs for those parts of this code that are retained. | |
| 30 | ||
| 31 | =============================================================================*/ | |
| 32 | ||
| 33 | /*---------------------------------------------------------------------------- | |
| 34 | | Include common integer types and flags. | |
| 35 | *----------------------------------------------------------------------------*/ | |
| 36 | #include "mamesf.h" | |
| 37 | ||
| 38 | /*---------------------------------------------------------------------------- | |
| 39 | | Symbolic Boolean literals. | |
| 40 | *----------------------------------------------------------------------------*/ | |
| 41 | #define FALSE 0 | |
| 42 | #define TRUE 1 |
| r0 | r7501 | |
|---|---|---|
| 1 | MAME note: this package is derived from the following original SoftFloat | |
| 2 | package and has been "re-packaged" to work with MAME's conventions and | |
| 3 | build system. The source files come from bits64/ and bits64/templates | |
| 4 | in the original distribution as MAME requires a compiler with a 64-bit | |
| 5 | integer type. | |
| 6 | ||
| 7 | ||
| 8 | Package Overview for SoftFloat Release 2b | |
| 9 | ||
| 10 | John R. Hauser | |
| 11 | 2002 May 27 | |
| 12 | ||
| 13 | ||
| 14 | ---------------------------------------------------------------------------- | |
| 15 | Overview | |
| 16 | ||
| 17 | SoftFloat is a software implementation of floating-point that conforms to | |
| 18 | the IEC/IEEE Standard for Binary Floating-Point Arithmetic. SoftFloat is | |
| 19 | distributed in the form of C source code. Compiling the SoftFloat sources | |
| 20 | generates two things: | |
| 21 | ||
| 22 | -- A SoftFloat object file (typically `softfloat.o') containing the complete | |
| 23 | set of IEC/IEEE floating-point routines. | |
| 24 | ||
| 25 | -- A `timesoftfloat' program for evaluating the speed of the SoftFloat | |
| 26 | routines. (The SoftFloat module is linked into this program.) | |
| 27 | ||
| 28 | The SoftFloat package is documented in four text files: | |
| 29 | ||
| 30 | SoftFloat.txt Documentation for using the SoftFloat functions. | |
| 31 | SoftFloat-source.txt Documentation for compiling SoftFloat. | |
| 32 | SoftFloat-history.txt History of major changes to SoftFloat. | |
| 33 | timesoftfloat.txt Documentation for using `timesoftfloat'. | |
| 34 | ||
| 35 | Other files in the package comprise the source code for SoftFloat. | |
| 36 | ||
| 37 | Please be aware that some work is involved in porting this software to other | |
| 38 | targets. It is not just a matter of getting `make' to complete without | |
| 39 | error messages. I would have written the code that way if I could, but | |
| 40 | there are fundamental differences between systems that can't be hidden. | |
| 41 | You should not attempt to compile SoftFloat without first reading both | |
| 42 | `SoftFloat.txt' and `SoftFloat-source.txt'. | |
| 43 | ||
| 44 | ||
| 45 | ---------------------------------------------------------------------------- | |
| 46 | Legal Notice | |
| 47 | ||
| 48 | SoftFloat was written by me, John R. Hauser. This work was made possible in | |
| 49 | part by the International Computer Science Institute, located at Suite 600, | |
| 50 | 1947 Center Street, Berkeley, California 94704. Funding was partially | |
| 51 | provided by the National Science Foundation under grant MIP-9311980. The | |
| 52 | original version of this code was written as part of a project to build | |
| 53 | a fixed-point vector processor in collaboration with the University of | |
| 54 | California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. | |
| 55 | ||
| 56 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | |
| 57 | has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | |
| 58 | TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | |
| 59 | PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL | |
| 60 | LOSSES, COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO | |
| 61 | FURTHERMORE EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER | |
| 62 | SCIENCE INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, | |
| 63 | COSTS, OR OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE | |
| 64 | SOFTWARE. | |
| 65 | ||
| 66 | Derivative works are acceptable, even for commercial purposes, provided | |
| 67 | that the minimal documentation requirements stated in the source code are | |
| 68 | satisfied. | |
| 69 | ||
| 70 | ||
| 71 | ---------------------------------------------------------------------------- | |
| 72 | Contact Information | |
| 73 | ||
| 74 | At the time of this writing, the most up-to-date information about | |
| 75 | SoftFloat and the latest release can be found at the Web page `http:// | |
| 76 | www.cs.berkeley.edu/~jhauser/arithmetic/SoftFloat.html'. | |
| 77 | ||
| 78 |
| r0 | r7501 | |
|---|---|---|
| 1 | /*---------------------------------------------------------------------------- | |
| 2 | | One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. | |
| 3 | *----------------------------------------------------------------------------*/ | |
| 4 | #ifdef LSB_FIRST | |
| 5 | #define LITTLEENDIAN | |
| 6 | #else | |
| 7 | #define BIGENDIAN | |
| 8 | #endif | |
| 9 | ||
| 10 | /*---------------------------------------------------------------------------- | |
| 11 | | The macro `BITS64' can be defined to indicate that 64-bit integer types are | |
| 12 | | supported by the compiler. | |
| 13 | *----------------------------------------------------------------------------*/ | |
| 14 | #define BITS64 | |
| 15 | ||
| 16 | /*---------------------------------------------------------------------------- | |
| 17 | | Each of the following `typedef's defines the most convenient type that holds | |
| 18 | | integers of at least as many bits as specified. For example, `uint8' should | |
| 19 | | be the most convenient type that can hold unsigned integers of as many as | |
| 20 | | 8 bits. The `flag' type must be able to hold either a 0 or 1. For most | |
| 21 | | implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed | |
| 22 | | to the same as `int'. | |
| 23 | *----------------------------------------------------------------------------*/ | |
| 24 | #include "emu.h" | |
| 25 | ||
| 26 | typedef INT8 flag; | |
| 27 | typedef UINT8 uint8; | |
| 28 | typedef INT8 int8; | |
| 29 | typedef UINT16 uint16; | |
| 30 | typedef INT16 int16; | |
| 31 | typedef UINT32 uint32; | |
| 32 | typedef INT32 int32; | |
| 33 | typedef UINT64 uint64; | |
| 34 | typedef INT64 int64; | |
| 35 | ||
| 36 | /*---------------------------------------------------------------------------- | |
| 37 | | Each of the following `typedef's defines a type that holds integers | |
| 38 | | of _exactly_ the number of bits specified. For instance, for most | |
| 39 | | implementation of C, `bits16' and `sbits16' should be `typedef'ed to | |
| 40 | | `unsigned short int' and `signed short int' (or `short int'), respectively. | |
| 41 | *----------------------------------------------------------------------------*/ | |
| 42 | typedef UINT8 bits8; | |
| 43 | typedef INT8 sbits8; | |
| 44 | typedef UINT16 bits16; | |
| 45 | typedef INT16 sbits16; | |
| 46 | typedef UINT32 bits32; | |
| 47 | typedef INT32 sbits32; | |
| 48 | typedef UINT64 bits64; | |
| 49 | typedef INT64 sbits64; | |
| 50 | ||
| 51 | /*---------------------------------------------------------------------------- | |
| 52 | | The `LIT64' macro takes as its argument a textual integer literal and | |
| 53 | | if necessary ``marks'' the literal as having a 64-bit integer type. | |
| 54 | | For example, the GNU C Compiler (`gcc') requires that 64-bit literals be | |
| 55 | | appended with the letters `LL' standing for `long long', which is `gcc's | |
| 56 | | name for the 64-bit integer type. Some compilers may allow `LIT64' to be | |
| 57 | | defined as the identity macro: `#define LIT64( a ) a'. | |
| 58 | *----------------------------------------------------------------------------*/ | |
| 59 | #define LIT64( a ) a##LL | |
| 60 | ||
| 61 | /*---------------------------------------------------------------------------- | |
| 62 | | The macro `INLINE' can be used before functions that should be inlined. If | |
| 63 | | a compiler does not support explicit inlining, this macro should be defined | |
| 64 | | to be `static'. | |
| 65 | *----------------------------------------------------------------------------*/ | |
| 66 | // MAME defines INLINE |
| r7500 | r7501 | |
|---|---|---|
| 17 | 17 | $(LIBOBJ)/util \ |
| 18 | 18 | $(LIBOBJ)/expat \ |
| 19 | 19 | $(LIBOBJ)/zlib \ |
| 20 | $(LIBOBJ)/softfloat \ | |
| 20 | 21 | |
| 21 | 22 | |
| 22 | 23 | |
| r7500 | r7501 | |
| 93 | 94 | $(LIBOBJ)/zlib/%.o: $(LIBSRC)/zlib/%.c | $(OSPREBUILD) |
| 94 | 95 | @echo Compiling $<... |
| 95 | 96 | $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -c $< -o $@ |
| 97 | ||
| 98 | #------------------------------------------------- | |
| 99 | # SoftFloat library objects | |
| 100 | #------------------------------------------------- | |
| 101 | ||
| 102 | PROCESSOR_H = $(LIBSRC)/softfloat/processors/mamesf.h | |
| 103 | SOFTFLOAT_MACROS = $(LIBSRC)/softfloat/softfloat/bits64/softfloat-macros | |
| 104 | ||
| 105 | SOFTFLOATOBJS = \ | |
| 106 | $(LIBOBJ)/softfloat/softfloat.o | |
| 107 | ||
| 108 | $(OBJ)/libsoftfloat.a: $(SOFTFLOATOBJS) | |
| 109 | ||
| 110 | $(LIBOBJ)/softfloat/softfloat.o: $(LIBSRC)/softfloat/softfloat.c $(LIBSRC)/softfloat/softfloat.h $(LIBSRC)/softfloat/softfloat-macros $(LIBSRC)/softfloat/softfloat-specialize | |
| 111 |
| r7500 | r7501 | |
|---|---|---|
| 230 | 230 | SOUNDS += CDP1863 |
| 231 | 231 | SOUNDS += CDP1864 |
| 232 | 232 | #SOUNDS += ZSG2 |
| 233 | SOUNDS += MOS656X | |
| 233 | 234 | SOUNDS += SOCRATES |
| 234 | 235 | SOUNDS += TMC0285 |
| 235 | 236 | SOUNDS += TMS5200 |
| r7500 | r7501 | |
| 239 | 240 | #SOUNDS += TMC0281 |
| 240 | 241 | #SOUNDS += TMS5100 |
| 241 | 242 | #SOUNDS += TMS5110A |
| 242 | SOUNDS += MOS656X | |
| 243 | 243 | |
| 244 | 244 | |
| 245 | 245 | #------------------------------------------------- |
| r7500 | r7501 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | Source Changes: |
| 96 | 96 | ---------------- |
| 97 | - The core is based on MAME 0.136u | |
| 97 | - The core is based on MAME 0.136u4. This incorporates all features of the | |
| 98 | 98 | update to this core. [MAME team] |
| 99 | 99 | |
| 100 | 100 | - Refactored MOS6526 CIA interface, added SP/CNT callbacks, and fixed serial |
| r7500 | r7501 | |
|---|---|---|
| 420 | 420 | ifndef NOWERROR |
| 421 | 421 | CCOMFLAGS += -Werror -fno-strict-aliasing $(ARCHOPTS) |
| 422 | 422 | else |
| 423 | CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) | |
| 423 | 424 | endif |
| 424 | 425 | else |
| 425 | 426 | CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) |
| r7500 | r7501 | |
| 462 | 463 | -I$(SRC)/osd/$(OSD) \ |
| 463 | 464 | |
| 464 | 465 | |
| 466 | #------------------------------------------------- | |
| 467 | # archiving flags | |
| 468 | #------------------------------------------------- | |
| 469 | # Default to something reasonable for all platforms | |
| 470 | ARFLAGS = -cr | |
| 471 | # Deal with macosx brain damage if COMMAND_MODE is in | |
| 472 | # the luser's environment: | |
| 473 | ifeq ($(TARGETOS),macosx) | |
| 474 | ifeq ($(COMMAND_MODE),"legacy") | |
| 475 | ARFLAGS = -crs | |
| 476 | endif | |
| 477 | endif | |
| 465 | 478 | |
| 479 | ||
| 466 | 480 | #------------------------------------------------- |
| 467 | 481 | # linking flags |
| 468 | 482 | #------------------------------------------------- |
| r7500 | r7501 | |
| 552 | 566 | ZLIB = |
| 553 | 567 | endif |
| 554 | 568 | |
| 569 | # add SoftFloat floating point emulation library | |
| 570 | SOFTFLOAT = $(OBJ)/libsoftfloat.a | |
| 555 | 571 | |
| 556 | ||
| 557 | 572 | #------------------------------------------------- |
| 558 | 573 | # 'default' target needs to go here, before the |
| 559 | 574 | # include files which define additional targets |
| r7500 | r7501 | |
| 642 | 657 | ifndef EXECUTABLE_DEFINED |
| 643 | 658 | |
| 644 | 659 | # always recompile the version string |
| 645 | $(VERSIONOBJ): $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE) | |
| 660 | $(VERSIONOBJ): $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(SOFTFLOAT) $(LIBOCORE) $(RESFILE) | |
| 646 | 661 | |
| 647 | $(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBDASM) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE) | |
| 662 | $(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBDASM) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(ZLIB) $(LIBOCORE) $(RESFILE) | |
| 648 | 663 | @echo Linking $@... |
| 649 | 664 | $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@ |
| 650 | 665 | |
| r7500 | r7501 | |
| 680 | 695 | $(OBJ)/%.a: |
| 681 | 696 | @echo Archiving $@... |
| 682 | 697 | $(RM) $@ |
| 683 | $(AR) | |
| 698 | $(AR) $(ARFLAGS) $@ $^ | |
| 684 | 699 | |
| 685 | 700 | ifeq ($(TARGETOS),macosx) |
| 686 | 701 | $(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD) |
| Previous | 15994 Revisions | Next |