| Previous | 15994 Revisions | Next |
| r2419 Saturday 19th April, 2008 at 22:41:40 UTC by Nathan Woods |
|---|
| Updated to MAME 0.124u3 core - IDE hard disks that exist as MESS devices are temporarily broken; will fix soon |
| [docs] | messnew.txt |
| [src/emu] | devconv.h inptport.c inptport.h mamecore.h memconv.h memory.c memory.h |
| [src/emu/cpu/cdp1802] | cdp1802.h |
| [src/emu/cpu/dsp56k] | dsp56k.c |
| [src/emu/cpu/mips] | psx.c |
| [src/emu/cpu/nec] | necdasm.c |
| [src/emu/cpu/t11] | t11.c |
| [src/emu/drivers] | xtal.h |
| [src/emu/machine] | 6821pia.c 6821pia.h idectrl.c idectrl.h |
| [src/mame] | mamedriv.c |
| [src/mame/audio] | atarijsa.c cage.c cage.h cinemat.c dcs.c dcs.h exidy440.c jaguar.c jedi.c leland.c mcr.c namcoc7x.c seibu.c seibu.h |
| [src/mame/drivers] | 1942.c 1943.c 1945kiii.c 2mindril.c 88games.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c airbustr.c ajax.c aladbl.c alg.c alpha68k.c ampoker2.c amspdwy.c angelkds.c aquarium.c arabian.c arcadecl.c arcadia.c argus.c arkanoid.c armedf.c artmagic.c ashnojoe.c asterix.c asteroid.c astinvad.c astrocde.c astrocorp.c astrof.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c ataxx.c atetris.c backfire.c badlands.c bagman.c balsente.c bankp.c batman.c battlane.c battlera.c beathead.c berzerk.c bestleag.c bking.c blktiger.c bloodbro.c blstroid.c blueprnt.c bnstars.c bogeyman.c brkthru.c bsktball.c btime.c bublbobl.c bzone.c calomega.c calorie.c canyon.c cave.c ccastles.c cclimber.c centiped.c champbas.c cherrym.c cherrym2.c chinagat.c chqflag.c cidelsa.c cinemat.c cischeat.c cloak.c cloud9.c cninja.c cntsteer.c coinmstr.c cojag.c combatsc.c commando.c coolpool.c cosmic.c couple.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c cubocd32.c cultures.c cyberbal.c cybertnk.c dacholer.c darius.c dassault.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c deadang.c deco_mlc.c decocass.c dgpix.c djmain.c dkong.c docastle.c dreamwld.c drgnmst.c drtomy.c drw80pkr.c dynadice.c dynax.c dynduke.c eprom.c equites.c ettrivia.c exctsccr.c exidy.c exidy440.c exprraid.c exterm.c f1gp.c fantland.c fastfred.c fcrash.c firebeat.c fitfight.c flower.c flstory.c foodf.c funworld.c gaelco3d.c gaiden.c galaga.c galaxian.c galaxold.c galivan.c galpani2.c galpani3.c gamecstl.c gauntlet.c gberet.c getrivia.c gladiatr.c gng.c good.c goodejan.c gottlieb.c gradius3.c grchamp.c groundfx.c gstream.c gstriker.c gsword.c gticlub.c gunbustr.c gundealr.c gunsmoke.c gyruss.c harddriv.c hitme.c hng64.c homedata.c homerun.c hshavoc.c hyprduel.c igs_m027.c iqblock.c ironhors.c itech32.c itech8.c jack.c jackal.c jailbrek.c jalmah.c jchan.c jcross.c jedi.c jollyjgr.c jrpacman.c kaneko16.c kangaroo.c kickgoal.c kinst.c kncljoe.c konamigv.c konamigx.c kopunch.c ksayakyu.c ksys573.c kyugo.c ladybug.c lasso.c lastduel.c legionna.c leland.c lethalj.c liberate.c liberatr.c limenko.c lkage.c lockon.c looping.c lordgun.c lucky8.c lvcards.c m10.c m107.c m52.c m57.c m58.c m72.c m79amb.c m90.c m92.c macrossp.c macs.c magic10.c magicfly.c mainsnk.c malzak.c mappy.c marineb.c mario.c marvins.c mcr.c mcr3.c mcr68.c meadows.c mediagx.c megadriv.c megadriv.h megaplay.c megasys1.c megatech.c merit.c meritm.c mermaid.c mhavoc.c micro3d.c midtunit.c midvunit.c midwunit.c midyunit.c midzeus.c mikie.c miniboy7.c missb2.c model1.c model2.c model3.c mole.c mquake.c ms32.c multigam.c mustache.c mwarr.c namcofl.c namcos11.c namcos12.c namcos22.c naughtyb.c nemesis.c neodrvr.c neogeo.c ninjakd2.c nmg5.c nmk16.c nova2001.c nwk-tr.c offtwall.c onetwo.c orbit.c pacland.c pacman.c paradise.c pasha2.c pbaction.c pengo.c pgm.c phoenix.c pingpong.c pipedrm.c pipeline.c pirates.c pkscram.c pktgaldx.c playch10.c playmark.c pmpoker.c polepos.c policetr.c polyplay.c pooyan.c portrait.c powerbal.c ppmast93.c prehisle.c psikyo.c psikyo4.c psikyosh.c pturn.c punchout.c qdrmfgp.c qix.c raiden.c raiden2.c rallyx.c rampart.c rastan.c rbmk.c rcasino.c redalert.c relief.c retofinv.c rockola.c sandscrp.c sbowling.c sbrkout.c scotrsht.c scramble.c sderby.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c sengokmj.c seta.c seta2.c shangkid.c shuuz.c simpl156.c skullxbo.c skydiver.c slapfght.c snowbros.c solomon.c sonson.c spaceg.c speedbal.c speglsht.c sprint4.c srmp5.c srmp6.c ssf2md.c sslam.c ssv.c st0016.c stadhero.c starfire.c starwars.c stlforce.c strnskil.c stv.c stvinit.c superchs.c superdq.c superqix.c suprloco.c suprnova.c suprridr.c system1.c system18.c taito_f3.c taito_l.c taito_x.c taitoair.c taitosj.c taitowlf.c tatsumi.c tceptor.c tehkanwc.c terracre.c tetrisp2.c thepit.c thunderj.c tigeroad.c timeplt.c tmaster.c tmnt.c toaplan2.c toki.c topshoot.c tp84.c trackfld.c travrusa.c trvmadns.c tumbleb.c turbo.c twincobr.c tx1.c ultraman.c ultratnk.c ultrsprt.c undrfire.c upscope.c usgames.c vamphalf.c vaportra.c vastar.c vegaeo.c vegas.c vendetta.c vertigo.c vicdual.c videopin.c vigilant.c vindictr.c viper.c vmetal.c volfied.c vroulet.c vulgus.c wardner.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wilytowr.c wink.c witch.c wiz.c wrally.c wwfsstar.c wwfwfest.c xexex.c xmen.c xorworld.c xxmissio.c xybots.c xyonix.c yumefuda.c yunsun16.c zac2650.c zaxxon.c zerozone.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | cps1.h exidy440.h jaguar.h neogeo.h williams.h |
| [src/mame/machine] | atari.c atarigen.c beezer.c dec0.c drakton.c galaxold.c irem_cpu.c midtunit.c midwayic.c midwayic.h midwunit.c midyunit.c namcos1.c neoboot.c neoprot.c playch10.c scramble.c segaic16.c segaic16.h seicop.c simpsons.c strtheat.c stvprot.c stvprot.h tnzs.c vsnes.c williams.c |
| [src/mame/video] | aerofgt.c bionicc.c combatsc.c cps1.c exidy440.c lastduel.c legionna.c ninjakd2.c qix.c simpsons.c taitoic.c tetrisp2.c |
| [src/mess] | compcfg.c mess.h |
| [src/mess/devices] | idedrive.c |
| [src/mess/drivers] | a2600.c abc80x.c amiga.c amstrad.c atarist.c avigo.c bebox.c bw2.c crvision.c genesis.c geneve.c jaguar.c nc.c pcw.c pcw16.c sg1000.c spectrum.c svi318.c ti99_4p.c ti99_4x.c ti99_8.c tmc600.c vc4000.c vip.c x68k.c z88.c |
| [src/mess/includes] | bebox.h spectrum.h |
| [src/mess/machine] | 99_ide.c 99_ide.h a7800.c aim65.c amigacd.c amigacrt.c apple1.c apple2.c apple2gs.c apple3.c aquarius.c at.c bebox.c c128.c c16.c c64.c c65.c cgenie.c coco.c compis.c coupe.c cybiko.c dgn_beta.c electron.c galaxy.c gb.c genesis.c hp48.c i82439tx.c jupiter.c kc.c lviv.c lynx.c mac.c mc10.c microtan.c mpc105.c msx_slot.c mtx.c mz700.c nascom1.c nes.c oric.c orion.c pc.c pc1251.c pc1350.c pc1401.c pc1403.c pc8801.c pce.c pet.c pmd85.c primo.c sms.c special.c spectrum.c sym1.c thomson.c ti85.c ti99_4x.c vtech1.c vtech2.c zx.c |
| [src/mess/video] | pc8801.c pc_aga.c pc_cga.c pc_mda.c pc_vga.c |
| r2418 | r2419 | |
|---|---|---|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | void jaguar_external_int(int state) | |
| 224 | void jaguar_external_int(const device_config *device, int state) | |
| 225 | 225 | { |
| 226 | 226 | if (state != CLEAR_LINE) |
| 227 | 227 | gpu_irq_state |= 1; |
| r2418 | r2419 | |
| 238 | 238 | * |
| 239 | 239 | *************************************/ |
| 240 | 240 | |
| 241 | void cojag_sound_init( | |
| 241 | void cojag_sound_init(running_machine *machine) | |
| 242 | 242 | { |
| 243 | 243 | int i; |
| 244 | 244 | |
| r2418 | r2419 | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | #if ENABLE_SPEEDUP_HACKS |
| 274 | memory_install_write32_handler(2, ADDRESS_SPACE_PROGRAM, 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w); | |
| 274 | memory_install_write32_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w); | |
| 275 | 275 | #endif |
| 276 | 276 | } |
| 277 | 277 |
| r2418 | r2419 | |
|---|---|---|
| 1595 | 1595 | static MACHINE_RESET( qb3_sound ) |
| 1596 | 1596 | { |
| 1597 | 1597 | MACHINE_RESET_CALL(demon_sound); |
| 1598 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w); | |
| 1598 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w); | |
| 1599 | 1599 | |
| 1600 | 1600 | /* this patch prevents the sound ROM from eating itself when command $0A is sent */ |
| 1601 | 1601 | /* on a cube rotate */ |
| r2418 | r2419 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | /* install POKEY memory handlers */ |
| 145 | 145 | if (has_pokey) |
| 146 | { | |
| 147 | memory_install_read8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r); | |
| 148 | memory_install_write8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_w); | |
| 149 | } | |
| 146 | memory_install_readwrite8_handler(machine, cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r, pokey1_w); | |
| 150 | 147 | |
| 151 | 148 | init_save_state(); |
| 152 | 149 | atarijsa_reset(); |
| r2418 | r2419 | |
|---|---|---|
| 152 | 152 | * |
| 153 | 153 | *************************************/ |
| 154 | 154 | |
| 155 | void cage_init(int boot_region, offs_t speedup) | |
| 155 | void cage_init(running_machine *machine, int boot_region, offs_t speedup) | |
| 156 | 156 | { |
| 157 | 157 | attotime cage_cpu_clock_period; |
| 158 | 158 | |
| r2418 | r2419 | |
| 170 | 170 | timer[1] = timer_alloc(cage_timer_callback, NULL); |
| 171 | 171 | |
| 172 | 172 | if (speedup) |
| 173 | speedup_ram = memory_install_write32_handler(cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w); | |
| 173 | speedup_ram = memory_install_write32_handler(machine, cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 |
| r2418 | r2419 | |
|---|---|---|
| 10 | 10 | MACHINE_DRIVER_EXTERN( cage ); |
| 11 | 11 | MACHINE_DRIVER_EXTERN( cage_seattle ); |
| 12 | 12 | |
| 13 | void cage_init(int boot_region, offs_t speedup); | |
| 13 | void cage_init(running_machine *machine, int boot_region, offs_t speedup); | |
| 14 | 14 | void cage_set_irq_handler(void (*irqhandler)(int)); |
| 15 | 15 | void cage_reset_w(int state); |
| 16 | 16 |
| r2418 | r2419 | |
|---|---|---|
| 894 | 894 | static ADDRESS_MAP_START( exidy440_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 895 | 895 | AM_RANGE(0x0000, 0x7fff) AM_NOP |
| 896 | 896 | AM_RANGE(0x8000, 0x801f) AM_MIRROR(0x03e0) AM_READWRITE(m6844_r, m6844_w) AM_BASE(&m6844_data) |
| 897 | AM_RANGE(0x8400, 0x840f) AM_MIRROR(0x03f0) AM_R | |
| 897 | AM_RANGE(0x8400, 0x840f) AM_MIRROR(0x03f0) AM_R | |
| 898 | 898 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03ff) AM_READWRITE(sound_command_r, SMH_NOP) |
| 899 | 899 | AM_RANGE(0x8c00, 0x93ff) AM_NOP |
| 900 | 900 | AM_RANGE(0x9400, 0x9403) AM_MIRROR(0x03fc) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&sound_banks) |
| r2418 | r2419 | |
|---|---|---|
| 692 | 692 | ADDRESS_MAP_UNMAP_HIGH |
| 693 | 693 | ADDRESS_MAP_GLOBAL_MASK(0x7ffff) |
| 694 | 694 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 695 | AM_RANGE(0x060000, 0x060007) AM_READWRITE(pia_1_ | |
| 695 | AM_RANGE(0x060000, 0x060007) AM_READWRITE8(pia_1_ | |
| 696 | 696 | AM_RANGE(0x070000, 0x070fff) AM_RAM |
| 697 | 697 | ADDRESS_MAP_END |
| 698 | 698 |
| r2418 | r2419 | |
|---|---|---|
| 1419 | 1419 | |
| 1420 | 1420 | temp = (i80186.mem.peripheral & 0xffc0) << 4; |
| 1421 | 1421 | if (i80186.mem.middle_size & 0x0040) |
| 1422 | { | |
| 1423 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r); | |
| 1424 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_w); | |
| 1425 | } | |
| 1422 | memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w); | |
| 1426 | 1423 | else |
| 1427 | 1424 | { |
| 1428 | 1425 | temp &= 0xffff; |
| 1429 | memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r); | |
| 1430 | memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_w); | |
| 1426 | memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w); | |
| 1431 | 1427 | } |
| 1432 | 1428 | |
| 1433 | 1429 | /* we need to do this at a time when the 80186 context is swapped in */ |
| r2418 | r2419 | |
| 1492 | 1488 | /* okay to leave us mapped where we were */ |
| 1493 | 1489 | temp = (data & 0x0fff) << 8; |
| 1494 | 1490 | if (data & 0x1000) |
| 1495 | { | |
| 1496 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r); | |
| 1497 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_w); | |
| 1498 | } | |
| 1491 | memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w); | |
| 1499 | 1492 | else |
| 1500 | 1493 | { |
| 1501 | 1494 | temp &= 0xffff; |
| 1502 | memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r); | |
| 1503 | memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_w); | |
| 1495 | memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w); | |
| 1504 | 1496 | } |
| 1505 | 1497 | /* popmessage("Sound CPU reset");*/ |
| 1506 | 1498 | break; |
| r2418 | r2419 | |
|---|---|---|
| 541 | 541 | AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1) |
| 542 | 542 | ADDRESS_MAP_END |
| 543 | 543 | |
| 544 | ADDRESS_MAP_START( seibu2_raiden2_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 545 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 546 | AM_RANGE(0x2000, 0x27ff) AM_RAM | |
| 547 | AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w) | |
| 548 | AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w) | |
| 549 | AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w) | |
| 550 | AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w) | |
| 551 | AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w) | |
| 552 | AM_RANGE(0x4008, 0x4008) AM_WRITE(YM2151_register_port_0_w) | |
| 553 | AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 554 | AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r) | |
| 555 | AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r) | |
| 556 | AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN") | |
| 557 | AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w) | |
| 558 | AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w) | |
| 559 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 560 | AM_RANGE(0x6002, 0x6002) AM_READWRITE(OKIM6295_status_1_r, OKIM6295_data_1_w) | |
| 561 | AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1) | |
| 562 | ADDRESS_MAP_END | |
| 544 | 563 | |
| 545 | 564 | |
| 546 | 565 | ADDRESS_MAP_START( seibu3_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | ADDRESS_MAP_EXTERN(seibu_sound_map, 8); |
| 33 | 33 | ADDRESS_MAP_EXTERN(seibu2_sound_map, 8); |
| 34 | ADDRESS_MAP_EXTERN(seibu2_raiden2_sound_map, 8); | |
| 34 | 35 | ADDRESS_MAP_EXTERN(seibu3_sound_map, 8); |
| 35 | 36 | ADDRESS_MAP_EXTERN(seibu3_adpcm_sound_map, 8); |
| 36 | 37 | |
| r2418 | r2419 | |
| 83 | 84 | MDRV_CPU_ADD(Z80, freq) \ |
| 84 | 85 | MDRV_CPU_PROGRAM_MAP(seibu2_sound_map,0) \ |
| 85 | 86 | |
| 87 | #define SEIBU2_RAIDEN2_SOUND_SYSTEM_CPU(freq) \ | |
| 88 | MDRV_CPU_ADD(Z80, freq) \ | |
| 89 | MDRV_CPU_PROGRAM_MAP(seibu2_raiden2_sound_map,0) \ | |
| 90 | ||
| 86 | 91 | #define SEIBU3_SOUND_SYSTEM_CPU(freq) \ |
| 87 | 92 | MDRV_CPU_ADD(Z80, freq) \ |
| 88 | 93 | MDRV_CPU_PROGRAM_MAP(seibu3_sound_map,0) \ |
| r2418 | r2419 | |
| 125 | 130 | MDRV_SOUND_CONFIG(okim6295_interface_region_##region##_pin7low) \ |
| 126 | 131 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ |
| 127 | 132 | |
| 133 | ||
| 134 | #define SEIBU_SOUND_SYSTEM_YM2151_RAIDEN2_INTERFACE(freq1,freq2,regiona, regionb) \ | |
| 135 | MDRV_SPEAKER_STANDARD_MONO("mono") \ | |
| 136 | \ | |
| 137 | MDRV_SOUND_ADD(YM2151, freq1) \ | |
| 138 | MDRV_SOUND_CONFIG(seibu_ym2151_interface) \ | |
| 139 | MDRV_SOUND_ROUTE(0, "mono", 0.50) \ | |
| 140 | MDRV_SOUND_ROUTE(1, "mono", 0.50) \ | |
| 141 | \ | |
| 142 | MDRV_SOUND_ADD(OKIM6295, freq2) \ | |
| 143 | MDRV_SOUND_CONFIG(okim6295_interface_region_##regiona##_pin7high) \ | |
| 144 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ | |
| 145 | \ | |
| 146 | MDRV_SOUND_ADD(OKIM6295, freq2) \ | |
| 147 | MDRV_SOUND_CONFIG(okim6295_interface_region_##regionb##_pin7high) \ | |
| 148 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ | |
| 149 | ||
| 150 | ||
| 128 | 151 | #define SEIBU_SOUND_SYSTEM_YM2203_INTERFACE(freq) \ |
| 129 | 152 | MDRV_SPEAKER_STANDARD_MONO("mono") \ |
| 130 | 153 | \ |
| r2418 | r2419 | |
|---|---|---|
| 67 | 67 | // install speedup cheat |
| 68 | 68 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) |
| 69 | 69 | if (Machine->config->cpu[cpunum].type == CPU_M37702) |
| 70 | { | |
| 71 | memory_install_read16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r); | |
| 72 | memory_install_write16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_w); | |
| 73 | } | |
| 70 | memory_install_readwrite16_handler(Machine, cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r, speedup_w); | |
| 74 | 71 | } |
| 75 | 72 | |
| 76 | 73 | void namcoc7x_set_host_ram(UINT32 *hostram) |
| r2418 | r2419 | |
|---|---|---|
| 379 | 379 | static WRITE16_HANDLER( dcs_dataram_w ); |
| 380 | 380 | static WRITE16_HANDLER( dcs_data_bank_select_w ); |
| 381 | 381 | |
| 382 | static void sdrc_reset( | |
| 382 | static void sdrc_reset(running_machine *machine); | |
| 383 | 383 | static READ16_HANDLER( sdrc_r ); |
| 384 | 384 | static WRITE16_HANDLER( sdrc_w ); |
| 385 | 385 | |
| r2418 | r2419 | |
| 412 | 412 | static READ16_HANDLER( dcs_polling_r ); |
| 413 | 413 | |
| 414 | 414 | static TIMER_CALLBACK( transfer_watchdog_callback ); |
| 415 | static int preprocess_write(UINT16 data); | |
| 415 | static int preprocess_write(running_machine *machine, UINT16 data); | |
| 416 | 416 | |
| 417 | 417 | |
| 418 | 418 | |
| r2418 | r2419 | |
| 787 | 787 | |
| 788 | 788 | /* rev 2: reset the SDRC ASIC */ |
| 789 | 789 | case 2: |
| 790 | sdrc_reset(); | |
| 790 | sdrc_reset(machine); | |
| 791 | 791 | break; |
| 792 | 792 | |
| 793 | 793 | /* rev 3: reset the DSIO ASIC */ |
| r2418 | r2419 | |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | |
| 933 | void dcs2_init(int dram_in_mb, offs_t polling_offset) | |
| 933 | void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset) | |
| 934 | 934 | { |
| 935 | 935 | memset(&dcs, 0, sizeof(dcs)); |
| 936 | 936 | |
| r2418 | r2419 | |
| 978 | 978 | |
| 979 | 979 | /* install the speedup handler */ |
| 980 | 980 | if (polling_offset) |
| 981 | dcs_polling_base = memory_install_read16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, polling_offset, polling_offset, 0, 0, dcs_polling_r); | |
| 981 | dcs_polling_base = memory_install_read16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, polling_offset, polling_offset, 0, 0, dcs_polling_r); | |
| 982 | 982 | |
| 983 | 983 | /* allocate a watchdog timer for HLE transfers */ |
| 984 | 984 | transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0); |
| r2418 | r2419 | |
| 994 | 994 | |
| 995 | 995 | |
| 996 | 996 | #ifdef UNUSED_FUNCTION |
| 997 | void dsio_init(int dram_in_mb, offs_t polling_offset) | |
| 997 | void dsio_init(running_machine *machine, int dram_in_mb, offs_t polling_offset) | |
| 998 | 998 | { |
| 999 | dcs2_init(dram_in_mb, polling_offset); | |
| 999 | dcs2_init(machine, dram_in_mb, polling_offset); | |
| 1000 | 1000 | } |
| 1001 | 1001 | #endif |
| 1002 | 1002 | |
| r2418 | r2419 | |
| 1072 | 1072 | } |
| 1073 | 1073 | |
| 1074 | 1074 | |
| 1075 | static void sdrc_remap_memory( | |
| 1075 | static void sdrc_remap_memory(running_machine *machine) | |
| 1076 | 1076 | { |
| 1077 | 1077 | /* if SRAM disabled, clean it out */ |
| 1078 | 1078 | if (SDRC_SM_EN == 0) |
| 1079 | 1079 | { |
| 1080 | memory_install_read32_handler (dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP); | |
| 1081 | memory_install_write32_handler(dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP); | |
| 1082 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP); | |
| 1083 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP); | |
| 1080 | memory_install_readwrite32_handler(machine, dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1081 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1084 | 1082 | } |
| 1085 | 1083 | |
| 1086 | 1084 | /* otherwise, map the SRAM */ |
| 1087 | 1085 | else |
| 1088 | 1086 | { |
| 1089 | 1087 | /* first start with a clean program map */ |
| 1090 | memory_install_read32_handler (dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21); | |
| 1091 | memory_install_write32_handler(dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21); | |
| 1088 | memory_install_readwrite32_handler(machine, dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21, SMH_BANK21); | |
| 1092 | 1089 | memory_set_bankptr(21, dcs_sram + 0x4800); |
| 1093 | 1090 | |
| 1094 | 1091 | /* set up the data map based on the SRAM banking */ |
| 1095 | 1092 | /* map 0: ram from 0800-37ff */ |
| 1096 | 1093 | if (SDRC_SM_BK == 0) |
| 1097 | 1094 | { |
| 1098 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22); | |
| 1099 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22); | |
| 1100 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23); | |
| 1101 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23); | |
| 1102 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24); | |
| 1103 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24); | |
| 1095 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22, SMH_BANK22); | |
| 1096 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23); | |
| 1097 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24); | |
| 1104 | 1098 | memory_set_bankptr(22, dcs_sram + 0x0000); |
| 1105 | 1099 | memory_set_bankptr(23, dcs_sram + 0x1000); |
| 1106 | 1100 | memory_set_bankptr(24, dcs_sram + 0x2000); |
| r2418 | r2419 | |
| 1109 | 1103 | /* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */ |
| 1110 | 1104 | else |
| 1111 | 1105 | { |
| 1112 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP); | |
| 1113 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP); | |
| 1114 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23); | |
| 1115 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23); | |
| 1116 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24); | |
| 1117 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24); | |
| 1106 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1107 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23); | |
| 1108 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24); | |
| 1118 | 1109 | memory_set_bankptr(23, dcs_sram + 0x3000); |
| 1119 | 1110 | memory_set_bankptr(24, dcs_sram + 0x2000); |
| 1120 | 1111 | } |
| r2418 | r2419 | |
| 1125 | 1116 | { |
| 1126 | 1117 | int baseaddr = (SDRC_ROM_ST == 0) ? 0x0000 : (SDRC_ROM_ST == 1) ? 0x3000 : 0x3400; |
| 1127 | 1118 | int pagesize = (SDRC_ROM_SZ == 0 && SDRC_ROM_ST != 0) ? 4096 : 1024; |
| 1128 | memory_install_read16_handler | |
| 1119 | memory_install_read16_handler | |
| 1129 | 1120 | } |
| 1130 | 1121 | |
| 1131 | 1122 | /* map the DRAM page as bank 26 */ |
| 1132 | 1123 | if (SDRC_DM_ST != 0) |
| 1133 | 1124 | { |
| 1134 | 1125 | int baseaddr = (SDRC_DM_ST == 1) ? 0x0000 : (SDRC_DM_ST == 2) ? 0x3000 : 0x3400; |
| 1135 | memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26); | |
| 1136 | memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26); | |
| 1126 | memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26, SMH_BANK26); | |
| 1137 | 1127 | } |
| 1138 | 1128 | |
| 1139 | 1129 | /* update the bank pointers */ |
| r2418 | r2419 | |
| 1141 | 1131 | } |
| 1142 | 1132 | |
| 1143 | 1133 | |
| 1144 | static void sdrc_reset( | |
| 1134 | static void sdrc_reset(running_machine *machine) | |
| 1145 | 1135 | { |
| 1146 | 1136 | memset(sdrc.reg, 0, sizeof(sdrc.reg)); |
| 1147 | sdrc_remap_memory(); | |
| 1137 | sdrc_remap_memory(machine); | |
| 1148 | 1138 | } |
| 1149 | 1139 | |
| 1150 | 1140 | |
| r2418 | r2419 | |
| 1213 | 1203 | case 0: |
| 1214 | 1204 | sdrc.reg[0] = data; |
| 1215 | 1205 | if (diff & 0x1833) |
| 1216 | sdrc_remap_memory(); | |
| 1206 | sdrc_remap_memory(machine); | |
| 1217 | 1207 | if (diff & 0x0380) |
| 1218 | 1208 | sdrc_update_bank_pointers(); |
| 1219 | 1209 | break; |
| r2418 | r2419 | |
| 1223 | 1213 | sdrc.reg[1] = data; |
| 1224 | 1214 | // dmadac_enable(0, dcs.channels, SDRC_MUTE); |
| 1225 | 1215 | if (diff & 0x0003) |
| 1226 | sdrc_remap_memory(); | |
| 1216 | sdrc_remap_memory(machine); | |
| 1227 | 1217 | break; |
| 1228 | 1218 | |
| 1229 | 1219 | /* offset 2 controls paging */ |
| r2418 | r2419 | |
| 1549 | 1539 | void dcs_data_w(int data) |
| 1550 | 1540 | { |
| 1551 | 1541 | /* preprocess the write */ |
| 1552 | if (preprocess_write(data)) | |
| 1542 | if (preprocess_write(Machine, data)) | |
| 1553 | 1543 | return; |
| 1554 | 1544 | |
| 1555 | 1545 | /* if we are DCS1, set a timer to latch the data */ |
| r2418 | r2419 | |
| 2054 | 2044 | if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256) |
| 2055 | 2045 | { |
| 2056 | 2046 | for ( ; transfer.fifo_entries; transfer.fifo_entries--) |
| 2057 | preprocess_write((*dcs.fifo_data_r)()); | |
| 2047 | preprocess_write(Machine, (*dcs.fifo_data_r)()); | |
| 2058 | 2048 | } |
| 2059 | 2049 | } |
| 2060 | 2050 | |
| r2418 | r2419 | |
| 2066 | 2056 | if (transfer.fifo_entries && starting_writes_left == transfer.writes_left) |
| 2067 | 2057 | { |
| 2068 | 2058 | for ( ; transfer.fifo_entries; transfer.fifo_entries--) |
| 2069 | preprocess_write((*dcs.fifo_data_r)()); | |
| 2059 | preprocess_write(machine, (*dcs.fifo_data_r)()); | |
| 2070 | 2060 | } |
| 2071 | 2061 | timer_adjust_oneshot(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left); |
| 2072 | 2062 | } |
| r2418 | r2419 | |
| 2099 | 2089 | } |
| 2100 | 2090 | |
| 2101 | 2091 | |
| 2102 | static int preprocess_stage_1(UINT16 data) | |
| 2092 | static int preprocess_stage_1(running_machine *machine, UINT16 data) | |
| 2103 | 2093 | { |
| 2104 | 2094 | switch (transfer.state) |
| 2105 | 2095 | { |
| r2418 | r2419 | |
| 2173 | 2163 | if (transfer.type == 1 && SDRC_SM_BK == 1) |
| 2174 | 2164 | { |
| 2175 | 2165 | sdrc.reg[0] &= ~0x1000; |
| 2176 | sdrc_remap_memory(); | |
| 2166 | sdrc_remap_memory(machine); | |
| 2177 | 2167 | } |
| 2178 | 2168 | if (transfer.type == 2 && SDRC_SM_BK == 0) |
| 2179 | 2169 | { |
| 2180 | 2170 | sdrc.reg[0] |= 0x1000; |
| 2181 | sdrc_remap_memory(); | |
| 2171 | sdrc_remap_memory(machine); | |
| 2182 | 2172 | } |
| 2183 | 2173 | return 1; |
| 2184 | 2174 | } |
| r2418 | r2419 | |
| 2235 | 2225 | } |
| 2236 | 2226 | |
| 2237 | 2227 | |
| 2238 | static int preprocess_stage_2(UINT16 data) | |
| 2228 | static int preprocess_stage_2(running_machine *machine, UINT16 data) | |
| 2239 | 2229 | { |
| 2240 | 2230 | switch (transfer.state) |
| 2241 | 2231 | { |
| r2418 | r2419 | |
| 2335 | 2325 | } |
| 2336 | 2326 | |
| 2337 | 2327 | |
| 2338 | static int preprocess_write(UINT16 data) | |
| 2328 | static int preprocess_write(running_machine *machine, UINT16 data) | |
| 2339 | 2329 | { |
| 2340 | 2330 | int result; |
| 2341 | 2331 | |
| r2418 | r2419 | |
| 2345 | 2335 | |
| 2346 | 2336 | /* state 0 - initialization phase */ |
| 2347 | 2337 | if (transfer.dcs_state == 0) |
| 2348 | result = preprocess_stage_1(data); | |
| 2338 | result = preprocess_stage_1(machine, data); | |
| 2349 | 2339 | else |
| 2350 | result = preprocess_stage_2(data); | |
| 2340 | result = preprocess_stage_2(machine, data); | |
| 2351 | 2341 | |
| 2352 | 2342 | /* if we did the write, toggle the full/not full state so interrupts are generated */ |
| 2353 | 2343 | if (result && dcs.input_empty_cb) |
| r2418 | r2419 | |
|---|---|---|
| 185 | 185 | AM_RANGE(0x1600, 0x17ff) AM_NOP |
| 186 | 186 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x03ff) AM_READWRITE(audio_latch_r, SMH_NOP) |
| 187 | 187 | AM_RANGE(0x1c00, 0x1c00) AM_MIRROR(0x03fe) AM_READWRITE(speech_ready_r, SMH_NOP) |
| 188 | AM_RANGE(0x1c01, 0x1c01) AM_MIRROR(0x03fe) AM_R | |
| 188 | AM_RANGE(0x1c01, 0x1c01) AM_MIRROR(0x03fe) AM_R | |
| 189 | 189 | AM_RANGE(0x2000, 0x7fff) AM_NOP |
| 190 | 190 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 191 | 191 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 13 | 13 | MACHINE_DRIVER_EXTERN( dcs2_audio_denver ); |
| 14 | 14 | |
| 15 | 15 | void dcs_init(void); |
| 16 | void dcs2_init(int dram_in_mb, offs_t polling_offset); | |
| 16 | void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset); | |
| 17 | 17 | void dcs_set_auto_ack(int state); |
| 18 | 18 | |
| 19 | 19 | void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(void), UINT16 (*fifo_status_r)(void)); |
| r2418 | r2419 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | const UINT8 lethalth_decryption_table[256] = { |
| 111 | 0x7f,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,xxxx,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */ | |
| 112 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 113 | xxxx,0xbd,xxxx,0x22,0x10,xxxx,0x02,0x57, 0x70,xxxx,0x7c,xxxx,0xe7,0x52,xxxx,0xa9, /* 10 */ | |
| 114 | // !!!! !!!! !!!! !!!! !!!! | |
| 115 | xxxx,xxxx,0xc6,0x06,0xa0,0xfe,0xcf,0x8e, 0x43,0x8f,0x2d,xxxx,0xd4,0x85,0x75,0xa2, /* 20 */ | |
| 116 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 117 | 0x3d,xxxx,xxxx,0x38,0x7c,0x89,0xd1,0x80, 0x3b,0x72,0x07,xxxx,0x42,0x37,0x0a,0x18, /* 30 */ | |
| 118 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 119 | 0x88,0xb4,0x98,0x8b,0xb9,0x9c,0xad,0x0e, 0x2b,xxxx,0xbf,xxxx,0x55,xxxx,0x56,0xb0, /* 40 */ | |
| 120 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 121 | 0x93,0x91,xxxx,0xeb,xxxx,0x50,0x41,0x29, 0x47,xxxx,xxxx,0x60,xxxx,0xab,xxxx,xxxx, /* 50 */ | |
| 111 | 0x7d,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,xxxx,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */ | |
| 112 | // ???? !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 113 | xxxx,0xbd,xxxx,0x22,0x10,xxxx,0x02,0x57, 0x70,xxxx,0x7e,xxxx,0xe7,0x52,xxxx,0xa9, /* 10 */ | |
| 114 | // !!!! !!!! !!!! ???? !!!! !!!! gggg | |
| 115 | xxxx,xxxx,0xc6,0x06,0xa0,0xfe,0xcf,0x8e, 0x43,0x8f,0x2d,xxxx,0xd4,0x85,0x75,0xa2, /* 20 */ | |
| 116 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 117 | 0x3d,xxxx,xxxx,0x38,0x78,0x89,0xd1,0x80, 0x3b,0x72,0x07,xxxx,0x42,0x37,0x0a,0x18, /* 30 */ | |
| 118 | // gggg !!!! ???? !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 119 | 0x88,0xb4,0x98,0x8b,0xb9,0x9c,0xad,0x0e, 0x2b,xxxx,0xbf,xxxx,0x55,xxxx,0x56,0xb0, /* 40 */ | |
| 120 | // !!!! !!!! !!!! !!!! !!!! gggg !!!! !!!! !!!! !!!! | |
| 121 | 0x93,0x91,xxxx,0xeb,xxxx,0x50,0x41,0x29, 0x47,xxxx,xxxx,0x60,xxxx,0xab,xxxx,xxxx, /* 50 */ | |
| 122 | 122 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! |
| 123 | 0xc3,0xe2,0xd0,0xb2,0x11,0x79,xxxx,0x08, xxxx,0xfb,xxxx,0x2c,0x23,xxxx,0x28,0x0d, /* 60 */ | |
| 124 | // !!!! !!!! !!!! !!!! !!!! !!!! | |
| 125 | xxxx,xxxx,xxxx,0x83,0x3c,xxxx,0x1b,0x34, 0x5b,xxxx,0x40,xxxx,xxxx,0x04,0xfc,0x09, /* 70 */ | |
| 126 | // !!!! !!!! !!!! !!!! !!!! | |
| 127 | 0xb1,0xf3,0x8a,xxxx,xxxx,0x87,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xbe,0x84,0x1f,0xe6, /* 80 */ | |
| 128 | // !!!! !!!! !!!! !!!! | |
| 129 | 0xff,xxxx,0x12,xxxx,0xb5,0x36,xxxx,0xb3, xxxx,xxxx,xxxx,0xd2,0x4e,xxxx,xxxx,xxxx, /* 90 */ | |
| 130 | // !!!! !!!! !!!! | |
| 131 | 0xa5,xxxx,xxxx,0xc7,xxxx,0x27,0x0b,xxxx, 0x20,xxxx,xxxx,xxxx,xxxx,xxxx,0x61,0x7f, /* A0 */ | |
| 132 | // !!!! !!!! !!!! !!!! | |
| 133 | xxxx,xxxx,0x86,0x0f,xxxx,0xb7,xxxx,0x4f, xxxx,xxxx,0xc0,0xfd,xxxx,0x39,xxxx,0x77, /* B0 */ | |
| 134 | // !!!! !!!! !!!! !!!! !!!! | |
| 135 | 0x05,0x3a,xxxx,0x48,0x92,0x7a,0x3e,0x03, xxxx,0xf8,xxxx,0x59,0xa8,0x5f,0xf9,0xbb, /* C0 */ | |
| 136 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 137 | 0x81,0xfa,0x9d,0xe9,0x2e,0xa1,0xc1,0x33, xxxx,0x78,xxxx,0x0c,xxxx,0x24,0xaa,0xac, /* D0 */ | |
| 138 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 139 | xxxx,0xb6,xxxx,0xea,xxxx,0x73,0xe5,0x58, 0x00,0xf7,xxxx,0x74,xxxx,0x7e,xxxx,0xa3, /* E0 */ | |
| 140 | // !!!! !!!! !!!! !!!! !!!! !!!! | |
| 141 | xxxx,0x5a,0xf6,0x32,0x46,0x2a,xxxx,xxxx, 0x53,0x4b,0x90,xxxx,0x51,0x68,0x99,0x13, /* F0 */ | |
| 142 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
| 123 | 0xc3,0xe2,0xd0,0xb2,0x11,0x79,xxxx,0x08, xxxx,0xfb,xxxx,0x2c,0x23,xxxx,0x28,0x0d, /* 60 */ | |
| 124 | // !!!! !!!! !!!! !!!! ???? !!!! !!!! | |
| 125 | xxxx,xxxx,xxxx,0x83,0x3c,xxxx,0x1b,0x34, 0x5b,xxxx,0x40,xxxx,xxxx,0x04,0xfc,0x30, /* 70 */ | |
| 126 | // !!!! !!!! !!!! !!!! !!!! ???? | |
| 127 | 0xb1,0xf3,0x8a,xxxx,xxxx,0x87,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xbe,0x84,0x1f,0xe6, /* 80 */ | |
| 128 | // !!!! !!!! !!!! !!!! !!!! | |
| 129 | 0xff,xxxx,0x12,xxxx,0xb5,0x36,xxxx,0xb3, xxxx,xxxx,xxxx,0xd2,0x4e,xxxx,xxxx,xxxx, /* 90 */ | |
| 130 | // !!!! !!!! !!!! | |
| 131 | 0xa5,xxxx,xxxx,0xc7,xxxx,0x27,0x0b,xxxx, 0x20,xxxx,xxxx,xxxx,xxxx,xxxx,0x61,0x7f, /* A0 */ | |
| 132 | // !!!! !!!! !!!! !!!! ???? | |
| 133 | xxxx,xxxx,0x86,0x0f,xxxx,0xb7,xxxx,0x4f, xxxx,xxxx,0xc0,0xfd,xxxx,0x39,xxxx,0x77, /* B0 */ | |
| 134 | // !!!! !!!! !!!! !!!! !!!! | |
| 135 | 0x05,0x3a,xxxx,0x48,0x92,0x76,0x3e,0x03, xxxx,0xf8,xxxx,0x59,0xa8,0x5f,0xf9,0xbb, /* C0 */ | |
| 136 | // !!!! !!!! pppp !!!! !!!! !!!! !!!! !!!! | |
| 137 | 0x81,0xfa,0x9d,0xe9,0x2e,0xa1,0xc1,0x33, xxxx,0x78,xxxx,0x0c,xxxx,0x24,0xaa,0xac, /* D0 */ | |
| 138 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! ???? !!!! !!!! | |
| 139 | xxxx,0xb6,xxxx,0xea,xxxx,0x73,0xe5,0x58, 0x00,0xf7,xxxx,0x74,xxxx,0x76,xxxx,0xa3, /* E0 */ | |
| 140 | // !!!! gggg !!!! !!!! !!!! !!!! ???? !!!! | |
| 141 | xxxx,0x5a,0xf6,0x32,0x46,0x2a,xxxx,xxxx, 0x53,0x4b,0x90,0x0d,0x51,0x68,0x99,0x13, /* F0 */ | |
| 142 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! ???? !!!! !!!! | |
| 143 | 143 | }; |
| 144 | 144 | /* |
| 145 | 145 | missing opcode: |
| r2418 | r2419 | |
| 149 | 149 | "pppp" -> probably |
| 150 | 150 | "????" -> missing |
| 151 | 151 | |
| 152 | RZ notes: | |
| 153 | 0xbf (0x77) risky challenge use same code | |
| 152 | 00 -> (79,7d,"7f") -> | |
| 153 | 1a -> (78,7c,7e) -> | |
| 154 | 34 -> (78,7c,7e) -> 78 | |
| 154 | 155 | |
| 156 | 65 -> (79, | |
| 157 | af -> (79,7d,7f) (strange 71) -> | |
| 158 | d9 -> (11e07 from 11de6) (70,78 -> to handle a01ce=000-7d0 -> 0x78 | |
| 159 | ed -> (p76,78,7c,7e) -> | |
| 160 | fb -> | |
| 161 | ||
| 162 | probably: | |
| 163 | 7f -> 30 (little machine in the game) | |
| 164 | c5 -> (18d56 - from 1844f) (71,73,76,79,7a,7d,7e) -> to handle level number (a008d=00-0f) -> 0x76 | |
| 165 | ||
| 166 | very probably: | |
| 167 | 48 -> 0x2b | |
| 168 | e5 -> 0x73 | |
| 155 | 169 | */ |
| 156 | ||
| 157 | 170 | // 0x2c (0xd4) complete guess |
| 158 | 171 | // 0x2d (0x85) complete guess |
| 159 | 172 | // 0xc4 (0x92) guess |
| r2418 | r2419 | |
|---|---|---|
| 435 | 435 | DRIVER_INIT( pcaboard ) |
| 436 | 436 | { |
| 437 | 437 | /* switches vrom with writes to the $803e-$8041 area */ |
| 438 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, aboard_vrom_switch_w ); | |
| 438 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, aboard_vrom_switch_w ); | |
| 439 | 439 | |
| 440 | 440 | /* common init */ |
| 441 | 441 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 462 | 462 | memcpy( &memory_region( REGION_CPU2 )[0x08000], &memory_region( REGION_CPU2 )[0x28000], 0x8000 ); |
| 463 | 463 | |
| 464 | 464 | /* Roms are banked at $8000 to $bfff */ |
| 465 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, bboard_rom_switch_w ); | |
| 465 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, bboard_rom_switch_w ); | |
| 466 | 466 | |
| 467 | 467 | /* common init */ |
| 468 | 468 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 483 | 483 | DRIVER_INIT( pccboard ) |
| 484 | 484 | { |
| 485 | 485 | /* switches vrom with writes to $6000 */ |
| 486 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w ); | |
| 486 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w ); | |
| 487 | 487 | |
| 488 | 488 | /* common init */ |
| 489 | 489 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 502 | 502 | mmc1_rom_mask = 0x07; |
| 503 | 503 | |
| 504 | 504 | /* MMC mapper at writes to $8000-$ffff */ |
| 505 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 505 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 506 | 506 | |
| 507 | 507 | /* common init */ |
| 508 | 508 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 513 | 513 | DRIVER_INIT( pcdboard_2 ) |
| 514 | 514 | { |
| 515 | 515 | /* extra ram at $6000-$7fff */ |
| 516 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 516 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 517 | 517 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 518 | 518 | |
| 519 | 519 | /* common init */ |
| r2418 | r2419 | |
| 599 | 599 | memcpy( &memory_region( REGION_CPU2 )[0x08000], &memory_region( REGION_CPU2 )[0x28000], 0x8000 ); |
| 600 | 600 | |
| 601 | 601 | /* basically a mapper 9 on a nes */ |
| 602 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, eboard_rom_switch_w ); | |
| 602 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, eboard_rom_switch_w ); | |
| 603 | 603 | |
| 604 | 604 | /* ppu_latch callback */ |
| 605 | 605 | ppu_latch = mapper9_latch; |
| 606 | 606 | |
| 607 | 607 | /* nvram at $6000-$6fff */ |
| 608 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 608 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 609 | 609 | memory_set_bankptr(1, auto_malloc(0x1000)); |
| 610 | 610 | |
| 611 | 611 | /* common init */ |
| r2418 | r2419 | |
| 625 | 625 | mmc1_rom_mask = 0x07; |
| 626 | 626 | |
| 627 | 627 | /* MMC mapper at writes to $8000-$ffff */ |
| 628 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 628 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 629 | 629 | |
| 630 | 630 | /* common init */ |
| 631 | 631 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 636 | 636 | DRIVER_INIT( pcfboard_2 ) |
| 637 | 637 | { |
| 638 | 638 | /* extra ram at $6000-$6fff */ |
| 639 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 639 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 640 | 640 | memory_set_bankptr(1, auto_malloc(0x1000)); |
| 641 | 641 | |
| 642 | 642 | /* common init */ |
| r2418 | r2419 | |
| 802 | 802 | memcpy( &memory_region( REGION_CPU2 )[0x0c000], &memory_region( REGION_CPU2 )[0x4c000], 0x4000 ); |
| 803 | 803 | |
| 804 | 804 | /* MMC3 mapper at writes to $8000-$ffff */ |
| 805 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); | |
| 805 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); | |
| 806 | 806 | |
| 807 | 807 | /* extra ram at $6000-$7fff */ |
| 808 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 808 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 809 | 809 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 810 | 810 | |
| 811 | 811 | gboard_banks[0] = 0x1e; |
| r2418 | r2419 | |
| 850 | 850 | memcpy( &memory_region( REGION_CPU2 )[0x08000], &memory_region( REGION_CPU2 )[0x10000], 0x8000 ); |
| 851 | 851 | |
| 852 | 852 | /* Roms are banked at $8000 to $bfff */ |
| 853 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, iboard_rom_switch_w ); | |
| 853 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, iboard_rom_switch_w ); | |
| 854 | 854 | |
| 855 | 855 | /* common init */ |
| 856 | 856 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
| 866 | 866 | memcpy( &memory_region( REGION_CPU2 )[0x0c000], &memory_region( REGION_CPU2 )[0x4c000], 0x4000 ); |
| 867 | 867 | |
| 868 | 868 | /* Roms are banked at $8000 to $bfff */ |
| 869 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); | |
| 869 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); | |
| 870 | 870 | |
| 871 | 871 | /* extra ram at $6000-$7fff */ |
| 872 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 872 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 873 | 873 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 874 | 874 | |
| 875 | 875 | gboard_banks[0] = 0x1e; |
| r2418 | r2419 | |
| 894 | 894 | mmc1_rom_mask = 0x0f; |
| 895 | 895 | |
| 896 | 896 | /* extra ram at $6000-$7fff */ |
| 897 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 897 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 898 | 898 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 899 | 899 | |
| 900 | 900 | /* Roms are banked at $8000 to $bfff */ |
| 901 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 901 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); | |
| 902 | 902 | |
| 903 | 903 | /* common init */ |
| 904 | 904 | DRIVER_INIT_CALL(playch10); |
| r2418 | r2419 | |
|---|---|---|
| 284 | 284 | //popmessage("%04x %04x",data,offset/4); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | void install_standard_protection( | |
| 287 | void install_standard_protection(running_machine *machine) | |
| 288 | 288 | { |
| 289 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4fffff0, 0x4ffffff, 0, 0, a_bus_ctrl_r); | |
| 290 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x04fffff0, 0x04ffffff, 0, 0, a_bus_ctrl_w); | |
| 289 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4fffff0, 0x4ffffff, 0, 0, a_bus_ctrl_r, a_bus_ctrl_w); | |
| 291 | 290 | } |
| 292 | 291 | |
| 293 | 292 | static READ32_HANDLER(astrass_prot_r) |
| r2418 | r2419 | |
| 318 | 317 | } |
| 319 | 318 | } |
| 320 | 319 | |
| 321 | void install_astrass_protection( | |
| 320 | void install_astrass_protection(running_machine *machine) | |
| 322 | 321 | { |
| 323 | 322 | ctrl_index = -1; |
| 324 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4fffff0, 0x4ffffff, 0, 0, astrass_prot_r); | |
| 325 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x04fffff0, 0x04ffffff, 0, 0, astrass_prot_w); | |
| 323 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4fffff0, 0x4ffffff, 0, 0, astrass_prot_r, astrass_prot_w); | |
| 326 | 324 | } |
| 327 | 325 | |
| 328 | 326 | |
| r2418 | r2419 | |
| 460 | 458 | |
| 461 | 459 | } |
| 462 | 460 | |
| 463 | void install_decathlt_protection( | |
| 461 | void install_decathlt_protection(running_machine *machine) | |
| 464 | 462 | { |
| 465 | 463 | /* It uploads 2 tables here, then performs what looks like a number of transfers, setting |
| 466 | 464 | a source address of some kind (scrambled?) and then making many reads from a single address */ |
| 467 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x37FFFF0, 0x37FFFFF, 0, 0, decathlt_prot_r); | |
| 468 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x37FFFF0, 0x37FFFFF, 0, 0, decathlt_prot_w); | |
| 465 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x37FFFF0, 0x37FFFFF, 0, 0, decathlt_prot_r, decathlt_prot_w); | |
| 469 | 466 | /* It uploads 2 tables here too, but nothing else, mirror? unused? */ |
| 470 | // memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x27FFFF0, 0x27FFFFF, 0, 0, decathlt_prot_r); | |
| 471 | // memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x27FFFF0, 0x27FFFFF, 0, 0, decathlt_prot_w); | |
| 467 | // memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x27FFFF0, 0x27FFFFF, 0, 0, decathlt_prot_r, decathlt_prot_w); | |
| 472 | 468 | } |
| 473 | 469 | |
| 474 | 470 | void stv_register_protection_savestates(void) |
| r2418 | r2419 | |
|---|---|---|
| 1 | 1 | /* stvprot.h */ |
| 2 | 2 | |
| 3 | void install_standard_protection(void); | |
| 4 | void install_decathlt_protection(void); | |
| 5 | void install_astrass_protection(void); | |
| 3 | void install_standard_protection(running_machine *machine); | |
| 4 | void install_decathlt_protection(running_machine *machine); | |
| 5 | void install_astrass_protection(running_machine *machine); | |
| 6 | 6 | |
| 7 | 7 | void stv_register_protection_savestates(void); |
| 8 | 8 |
| r2418 | r2419 | |
|---|---|---|
| 551 | 551 | memcpy(&RAM[0x08000],&RAM[0x18000],0x4000); |
| 552 | 552 | |
| 553 | 553 | /* drtoppel writes to the palette RAM area even if it has PROMs! We have to patch it out. */ |
| 554 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xfbff, 0, 0, SMH_NOP); | |
| 554 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xfbff, 0, 0, SMH_NOP); | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | DRIVER_INIT( chukatai ) |
| r2418 | r2419 | |
| 569 | 569 | memcpy(&RAM[0x08000],&RAM[0x2c000],0x4000); |
| 570 | 570 | |
| 571 | 571 | /* we need to install a kludge to avoid problems with a bug in the original code */ |
| 572 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xef10, 0xef10, 0, 0, tnzs_sync_kludge_w); | |
| 572 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xef10, 0xef10, 0, 0, tnzs_sync_kludge_w); | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | DRIVER_INIT( tnzsb ) |
| r2418 | r2419 | |
| 582 | 582 | memcpy(&RAM[0x08000],&RAM[0x2c000],0x4000); |
| 583 | 583 | |
| 584 | 584 | /* we need to install a kludge to avoid problems with a bug in the original code */ |
| 585 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xef10, 0xef10, 0, 0, tnzs_sync_kludge_w); | |
| 585 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xef10, 0xef10, 0, 0, tnzs_sync_kludge_w); | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | DRIVER_INIT( kabukiz ) |
| r2418 | r2419 | |
| 595 | 595 | mcu_type = MCU_NONE_INSECTX; |
| 596 | 596 | |
| 597 | 597 | /* this game has no mcu, replace the handler with plain input port handlers */ |
| 598 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_2_r ); | |
| 599 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc001, 0xc001, 0, 0, input_port_3_r ); | |
| 600 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc002, 0xc002, 0, 0, input_port_4_r ); | |
| 598 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_2_r ); | |
| 599 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc001, 0xc001, 0, 0, input_port_3_r ); | |
| 600 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc002, 0xc002, 0, 0, input_port_4_r ); | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | DRIVER_INIT( kageki ) |
| r2418 | r2419 | |
|---|---|---|
| 35 | 35 | static int a800_cart_is_16k = 0; |
| 36 | 36 | #endif |
| 37 | 37 | |
| 38 | static void a800xl_mmu(UINT8 new_mmu); | |
| 39 | static void a600xl_mmu(UINT8 new_mmu); | |
| 38 | static void a800xl_mmu(running_machine *machine, UINT8 new_mmu); | |
| 39 | static void a600xl_mmu(running_machine *machine, UINT8 new_mmu); | |
| 40 | 40 | |
| 41 | 41 | static void pokey_reset(running_machine *machine); |
| 42 | 42 | |
| r2418 | r2419 | |
| 88 | 88 | return atari_input_disabled() ? 0xFF : input_port_read_safe(machine, "djoy_2_3", 0); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | static WRITE8_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(data); } | |
| 92 | static WRITE8_HANDLER(a800xl_pia_pb_w) { a800xl_mmu(data); } | |
| 91 | static WRITE8_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(machine, data); } | |
| 92 | static WRITE8_HANDLER(a800xl_pia_pb_w) { a800xl_mmu(machine, data); } | |
| 93 | 93 | |
| 94 | 94 | #ifdef MESS |
| 95 | 95 | extern WRITE8_HANDLER(atari_pia_cb2_w); |
| r2418 | r2419 | |
| 127 | 127 | * |
| 128 | 128 | **************************************************************/ |
| 129 | 129 | |
| 130 | void a600xl_mmu(UINT8 new_mmu) | |
| 130 | void a600xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 131 | 131 | { |
| 132 | 132 | read8_machine_func rbank2; |
| 133 | 133 | write8_machine_func wbank2; |
| r2418 | r2419 | |
| 145 | 145 | rbank2 = SMH_BANK2; |
| 146 | 146 | wbank2 = SMH_UNMAP; |
| 147 | 147 | } |
| 148 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2); | |
| 149 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, wbank2); | |
| 148 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2, wbank2); | |
| 150 | 149 | if (rbank2 == SMH_BANK2) |
| 151 | 150 | memory_set_bankptr(2, memory_region(REGION_CPU1)+0x5000); |
| 152 | 151 | } |
| 153 | 152 | |
| 154 | void a800xl_mmu(UINT8 new_mmu) | |
| 153 | void a800xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 155 | 154 | { |
| 156 | 155 | read8_machine_func rbank1, rbank2, rbank3, rbank4; |
| 157 | 156 | write8_machine_func wbank1, wbank2, wbank3, wbank4; |
| r2418 | r2419 | |
| 178 | 177 | wbank4 = SMH_BANK4; |
| 179 | 178 | base4 = memory_region(REGION_CPU1)+0x0d800; /* 4K RAM + 8K RAM */ |
| 180 | 179 | } |
| 181 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, rbank3); | |
| 182 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, wbank3); | |
| 183 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xffff, 0, 0, rbank4); | |
| 184 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xffff, 0, 0, wbank4); | |
| 180 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, rbank3, wbank3); | |
| 181 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xffff, 0, 0, rbank4, wbank4); | |
| 185 | 182 | memory_set_bankptr(3, base3); |
| 186 | 183 | memory_set_bankptr(4, base4); |
| 187 | 184 | |
| r2418 | r2419 | |
| 200 | 197 | wbank1 = SMH_UNMAP; |
| 201 | 198 | base1 = memory_region(REGION_CPU1)+0x10000; /* 8K BASIC */ |
| 202 | 199 | } |
| 203 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rbank1); | |
| 204 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, wbank1); | |
| 200 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rbank1, wbank1); | |
| 205 | 201 | memory_set_bankptr(1, base1); |
| 206 | 202 | |
| 207 | 203 | /* check if self-test ROM changed */ |
| r2418 | r2419 | |
| 219 | 215 | wbank2 = SMH_UNMAP; |
| 220 | 216 | base2 = memory_region(REGION_CPU1)+0x15000; /* 0x0800 bytes */ |
| 221 | 217 | } |
| 222 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2); | |
| 223 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, wbank2); | |
| 218 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2, wbank2); | |
| 224 | 219 | memory_set_bankptr(2, base2); |
| 225 | 220 | } |
| 226 | 221 | |
| r2418 | r2419 | |
| 638 | 633 | |
| 639 | 634 | /* install RAM */ |
| 640 | 635 | ram_top = MIN(mess_ram_size, ram_size) - 1; |
| 641 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 636 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 642 | 637 | 0x0000, ram_top, 0, 0, SMH_BANK2); |
| 643 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 638 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 644 | 639 | 0x0000, ram_top, 0, 0, SMH_BANK2); |
| 645 | 640 | memory_set_bankptr(2, mess_ram); |
| 646 | 641 | } |
| r2418 | r2419 | |
| 655 | 650 | *************************************/ |
| 656 | 651 | |
| 657 | 652 | #ifdef MESS |
| 658 | static void a800_setbank(int n) | |
| 653 | static void a800_setbank(running_machine *machine, int n) | |
| 659 | 654 | { |
| 660 | 655 | void *read_addr; |
| 661 | 656 | void *write_addr; |
| r2418 | r2419 | |
| 682 | 677 | break; |
| 683 | 678 | } |
| 684 | 679 | |
| 685 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, | |
| 680 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, | |
| 686 | 681 | read_addr ? SMH_BANK1 : SMH_NOP); |
| 687 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, | |
| 682 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, | |
| 688 | 683 | write_addr ? SMH_BANK1 : SMH_NOP); |
| 689 | 684 | if (read_addr) |
| 690 | 685 | memory_set_bankptr(1, read_addr); |
| r2418 | r2419 | |
| 706 | 701 | { |
| 707 | 702 | #ifdef MESS |
| 708 | 703 | if (a800_cart_loaded) |
| 709 | a800_setbank(1); | |
| 704 | a800_setbank(machine, 1); | |
| 710 | 705 | #endif /* MESS */ |
| 711 | 706 | } |
| 712 | 707 | |
| r2418 | r2419 | |
| 790 | 785 | |
| 791 | 786 | /* install RAM */ |
| 792 | 787 | ram_top = MIN(mess_ram_size, ram_size) - 1; |
| 793 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 788 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 794 | 789 | 0x0000, ram_top, 0, 0, SMH_BANK2); |
| 795 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 790 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 796 | 791 | 0x0000, ram_top, 0, 0, SMH_BANK2); |
| 797 | 792 | memory_set_bankptr(2, mess_ram); |
| 798 | 793 | } |
| r2418 | r2419 | |
| 866 | 861 | if( image_index_in_device(image) > 0 ) |
| 867 | 862 | { |
| 868 | 863 | a800_cart_is_16k = 0; |
| 869 | a800_setbank(1); | |
| 864 | a800_setbank(image->machine, 1); | |
| 870 | 865 | } |
| 871 | 866 | else |
| 872 | 867 | { |
| 873 | 868 | a800_cart_loaded = 0; |
| 874 | a800_setbank(0); | |
| 869 | a800_setbank(image->machine, 0); | |
| 875 | 870 | } |
| 876 | 871 | } |
| 877 | 872 | #endif |
| r2418 | r2419 | |
|---|---|---|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| 237 | static void init_generic(int bpp, int sound, int prot_start, int prot_end) | |
| 237 | static void init_generic(running_machine *machine, int bpp, int sound, int prot_start, int prot_end) | |
| 238 | 238 | { |
| 239 | 239 | offs_t gfx_chunk = midyunit_gfx_rom_size / 4; |
| 240 | 240 | UINT8 d1, d2, d3, d4, d5, d6; |
| r2418 | r2419 | |
| 290 | 290 | { |
| 291 | 291 | case SOUND_CVSD_SMALL: |
| 292 | 292 | williams_cvsd_init(0); |
| 293 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, cvsd_protection_w); | |
| 293 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, cvsd_protection_w); | |
| 294 | 294 | cvsd_protection_base = memory_region(REGION_CPU2) + 0x10000 + (prot_start - 0x8000); |
| 295 | 295 | break; |
| 296 | 296 | |
| 297 | 297 | case SOUND_CVSD: |
| 298 | 298 | williams_cvsd_init(0); |
| 299 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 299 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 300 | 300 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 301 | 301 | break; |
| 302 | 302 | |
| 303 | 303 | case SOUND_ADPCM: |
| 304 | 304 | williams_adpcm_init(); |
| 305 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 305 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 306 | 306 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 307 | 307 | break; |
| 308 | 308 | |
| 309 | 309 | case SOUND_NARC: |
| 310 | 310 | williams_narc_init(); |
| 311 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 311 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 312 | 312 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 313 | 313 | break; |
| 314 | 314 | |
| r2418 | r2419 | |
| 331 | 331 | DRIVER_INIT( narc ) |
| 332 | 332 | { |
| 333 | 333 | /* common init */ |
| 334 | init_generic(8, SOUND_NARC, 0xcdff, 0xce29); | |
| 334 | init_generic(machine, 8, SOUND_NARC, 0xcdff, 0xce29); | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | |
| r2418 | r2419 | |
| 361 | 361 | prot_data = &trog_protection_data; |
| 362 | 362 | |
| 363 | 363 | /* common init */ |
| 364 | init_generic(4, SOUND_CVSD_SMALL, 0x9eaf, 0x9ed9); | |
| 364 | init_generic(machine, 4, SOUND_CVSD_SMALL, 0x9eaf, 0x9ed9); | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
| r2418 | r2419 | |
| 370 | 370 | DRIVER_INIT( smashtv ) |
| 371 | 371 | { |
| 372 | 372 | /* common init */ |
| 373 | init_generic(6, SOUND_CVSD_SMALL, 0x9cf6, 0x9d21); | |
| 373 | init_generic(machine, 6, SOUND_CVSD_SMALL, 0x9cf6, 0x9d21); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | |
| r2418 | r2419 | |
| 388 | 388 | prot_data = &hiimpact_protection_data; |
| 389 | 389 | |
| 390 | 390 | /* common init */ |
| 391 | init_generic(6, SOUND_CVSD, 0x9b79, 0x9ba3); | |
| 391 | init_generic(machine, 6, SOUND_CVSD, 0x9b79, 0x9ba3); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| r2418 | r2419 | |
| 406 | 406 | prot_data = &shimpact_protection_data; |
| 407 | 407 | |
| 408 | 408 | /* common init */ |
| 409 | init_generic(6, SOUND_CVSD, 0x9c06, 0x9c15); | |
| 409 | init_generic(machine, 6, SOUND_CVSD, 0x9c06, 0x9c15); | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | |
| r2418 | r2419 | |
| 422 | 422 | prot_data = &strkforc_protection_data; |
| 423 | 423 | |
| 424 | 424 | /* common init */ |
| 425 | init_generic(4, SOUND_CVSD_SMALL, 0x9f7d, 0x9fa7); | |
| 425 | init_generic(machine, 4, SOUND_CVSD_SMALL, 0x9f7d, 0x9fa7); | |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
| r2418 | r2419 | |
| 451 | 451 | prot_data = &mk_protection_data; |
| 452 | 452 | |
| 453 | 453 | /* common init */ |
| 454 | init_generic(6, SOUND_ADPCM, 0xfb9c, 0xfbc6); | |
| 454 | init_generic(machine, 6, SOUND_ADPCM, 0xfb9c, 0xfbc6); | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | DRIVER_INIT( mkyawdim ) |
| 458 | 458 | { |
| 459 | 459 | /* common init */ |
| 460 | init_generic(6, SOUND_YAWDIM, 0, 0); | |
| 460 | init_generic(machine, 6, SOUND_YAWDIM, 0, 0); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
| 464 | 464 | /********************** Terminator 2 **********************/ |
| 465 | 465 | |
| 466 | static void term2_init_common(write16_machine_func hack_w) | |
| 466 | static void term2_init_common(running_machine *machine, write16_machine_func hack_w) | |
| 467 | 467 | { |
| 468 | 468 | /* protection */ |
| 469 | 469 | static const struct protection_data term2_protection_data = |
| r2418 | r2419 | |
| 474 | 474 | prot_data = &term2_protection_data; |
| 475 | 475 | |
| 476 | 476 | /* common init */ |
| 477 | init_generic(6, SOUND_ADPCM, 0xfa8d, 0xfa9c); | |
| 477 | init_generic(machine, 6, SOUND_ADPCM, 0xfa8d, 0xfa9c); | |
| 478 | 478 | |
| 479 | 479 | /* special inputs */ |
| 480 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01c00000, 0x01c0005f, 0, 0, term2_input_r); | |
| 481 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01e00000, 0x01e0001f, 0, 0, term2_sound_w); | |
| 480 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c00000, 0x01c0005f, 0, 0, term2_input_r); | |
| 481 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01e00000, 0x01e0001f, 0, 0, term2_sound_w); | |
| 482 | 482 | |
| 483 | 483 | /* HACK: this prevents the freeze on the movies */ |
| 484 | 484 | /* until we figure whats causing it, this is better than nothing */ |
| 485 | t2_hack_mem = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x010aa0e0, 0x010aa0ff, 0, 0, hack_w); | |
| 485 | t2_hack_mem = memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010aa0e0, 0x010aa0ff, 0, 0, hack_w); | |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | DRIVER_INIT( term2 ) { term2_init_common(term2_hack_w); } | |
| 489 | DRIVER_INIT( term2la2 ) { term2_init_common(term2la2_hack_w); } | |
| 490 | DRIVER_INIT( term2la1 ) { term2_init_common(term2la1_hack_w); } | |
| 488 | DRIVER_INIT( term2 ) { term2_init_common(machine, term2_hack_w); } | |
| 489 | DRIVER_INIT( term2la2 ) { term2_init_common(machine, term2la2_hack_w); } | |
| 490 | DRIVER_INIT( term2la1 ) { term2_init_common(machine, term2la1_hack_w); } | |
| 491 | 491 | |
| 492 | 492 | |
| 493 | 493 | |
| r2418 | r2419 | |
| 505 | 505 | prot_data = &totcarn_protection_data; |
| 506 | 506 | |
| 507 | 507 | /* common init */ |
| 508 | init_generic(6, SOUND_ADPCM, 0xfc04, 0xfc2e); | |
| 508 | init_generic(machine, 6, SOUND_ADPCM, 0xfc04, 0xfc2e); | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 |
| r2418 | r2419 | |
|---|---|---|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | void install_kof10th_protection ( | |
| 175 | void install_kof10th_protection ( running_machine *machine ) | |
| 176 | 176 | { |
| 177 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof10th_RAMB_r); | |
| 178 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x23ffff, 0, 0, kof10th_custom_w); | |
| 179 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x2fffff, 0, 0, kof10th_bankswitch_w); | |
| 177 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof10th_RAMB_r); | |
| 178 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x23ffff, 0, 0, kof10th_custom_w); | |
| 179 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x2fffff, 0, 0, kof10th_bankswitch_w); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | void decrypt_kof10th( void ) |
| r2418 | r2419 | |
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | void patch_cthd2003( | |
| 428 | void patch_cthd2003( running_machine *machine ) | |
| 429 | 429 | { |
| 430 | 430 | /* patches thanks to razoola */ |
| 431 | 431 | int i; |
| 432 | 432 | UINT16 *mem16 = (UINT16 *)memory_region(NEOGEO_REGION_MAIN_CPU_CARTRIDGE); |
| 433 | 433 | |
| 434 | 434 | /* special ROM banking handler */ |
| 435 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, cthd2003_bankswitch_w); | |
| 435 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, cthd2003_bankswitch_w); | |
| 436 | 436 | |
| 437 | 437 | // theres still a problem on the character select screen but it seems to be related to cpu core timing issues, |
| 438 | 438 | // overclocking the 68k prevents it. |
| r2418 | r2419 | |
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | void install_ms5plus_protection( | |
| 663 | void install_ms5plus_protection(running_machine *machine) | |
| 664 | 664 | { |
| 665 | 665 | // special ROM banking handler / additional protection |
| 666 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM,0x2ffff0, 0x2fffff,0, 0, mslug5_prot_r, ms5plus_bankswitch_w); | |
| 666 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM,0x2ffff0, 0x2fffff,0, 0, mslug5_prot_r, ms5plus_bankswitch_w); | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
| r2418 | r2419 | |
| 903 | 903 | free( buf ); |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | void kof2003b_install_protection( | |
| 906 | void kof2003b_install_protection(running_machine *machine) | |
| 907 | 907 | { |
| 908 | memory_install_readwrite16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); | |
| 908 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); | |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| r2418 | r2419 | |
| 932 | 932 | rom[0xf38ac/2] = 0x4e75; |
| 933 | 933 | } |
| 934 | 934 | |
| 935 | void kf2k3pl_install_protection( | |
| 935 | void kf2k3pl_install_protection(running_machine *machine) | |
| 936 | 936 | { |
| 937 | memory_install_readwrite16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003p_w ); | |
| 937 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003p_w ); | |
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | |
| r2418 | r2419 | |
| 965 | 965 | } |
| 966 | 966 | } |
| 967 | 967 | |
| 968 | void kof2k3up_install_protection( | |
| 968 | void kof2k3up_install_protection(running_machine *machine) | |
| 969 | 969 | { |
| 970 | memory_install_readwrite16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); | |
| 970 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); | |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | /* samsho5bl */ |
| r2418 | r2419 | |
|---|---|---|
| 1066 | 1066 | * |
| 1067 | 1067 | *************************************/ |
| 1068 | 1068 | |
| 1069 | READ32_HANDLER( midway_ide_asic_r ) | |
| 1069 | READ32_DEVICE_HANDLER( midway_ide_asic_r ) | |
| 1070 | 1070 | { |
| 1071 | 1071 | /* convert to standard IDE offsets */ |
| 1072 | 1072 | offs_t ideoffs = 0x1f0/4 + (offset >> 2); |
| r2418 | r2419 | |
| 1075 | 1075 | |
| 1076 | 1076 | /* offset 0 is a special case */ |
| 1077 | 1077 | if (offset == 0) |
| 1078 | result = ide_controller32_ | |
| 1078 | result = ide_controller32_ | |
| 1079 | 1079 | |
| 1080 | 1080 | /* everything else is byte-sized */ |
| 1081 | 1081 | else |
| 1082 | result = ide_controller32_ | |
| 1082 | result = ide_controller32_ | |
| 1083 | 1083 | return result; |
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 | |
| 1087 | WRITE32_HANDLER( midway_ide_asic_w ) | |
| 1087 | WRITE32_DEVICE_HANDLER( midway_ide_asic_w ) | |
| 1088 | 1088 | { |
| 1089 | 1089 | /* convert to standard IDE offsets */ |
| 1090 | 1090 | offs_t ideoffs = 0x1f0/4 + (offset >> 2); |
| r2418 | r2419 | |
| 1092 | 1092 | |
| 1093 | 1093 | /* offset 0 is a special case */ |
| 1094 | 1094 | if (offset == 0) |
| 1095 | ide_controller32_ | |
| 1095 | ide_controller32_ | |
| 1096 | 1096 | |
| 1097 | 1097 | /* everything else is byte-sized */ |
| 1098 | 1098 | else |
| 1099 | ide_controller32_ | |
| 1099 | ide_controller32_ | |
| 1100 | 1100 | } |
| r2418 | r2419 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | /* IDE ASIC maps the IDE registers */ |
| 54 | READ32_HANDLER( midway_ide_asic_r ); | |
| 55 | WRITE32_HANDLER( midway_ide_asic_w ); | |
| 54 | READ32_DEVICE_HANDLER( midway_ide_asic_r ); | |
| 55 | WRITE32_DEVICE_HANDLER( midway_ide_asic_w ); |
| r2418 | r2419 | |
|---|---|---|
| 333 | 333 | { |
| 334 | 334 | DRIVER_INIT_CALL(scramble_ppi); |
| 335 | 335 | |
| 336 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scrambold_background_enable_w); | |
| 336 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scrambold_background_enable_w); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | DRIVER_INIT( atlantis ) |
| 340 | 340 | { |
| 341 | 341 | DRIVER_INIT_CALL(scramble_ppi); |
| 342 | 342 | |
| 343 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scrambold_background_enable_w); | |
| 343 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scrambold_background_enable_w); | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | DRIVER_INIT( scramble ) |
| r2418 | r2419 | |
| 371 | 371 | { |
| 372 | 372 | DRIVER_INIT_CALL(scramble_ppi); |
| 373 | 373 | |
| 374 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scrambold_background_green_w); | |
| 375 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_blue_w); | |
| 376 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, scrambold_background_red_w); | |
| 374 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scrambold_background_green_w); | |
| 375 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_blue_w); | |
| 376 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, scrambold_background_red_w); | |
| 377 | 377 | |
| 378 | 378 | ppi8255_set_portCread(0, stratgyx_input_port_2_r); |
| 379 | 379 | ppi8255_set_portCread(1, stratgyx_input_port_3_r); |
| r2418 | r2419 | |
| 383 | 383 | { |
| 384 | 384 | DRIVER_INIT_CALL(scramble_ppi); |
| 385 | 385 | |
| 386 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_enable_w); | |
| 386 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_enable_w); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | DRIVER_INIT( amidar ) |
| r2418 | r2419 | |
| 407 | 407 | DRIVER_INIT_CALL(scramble_ppi); |
| 408 | 408 | |
| 409 | 409 | /* extra ROM */ |
| 410 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 410 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 411 | 411 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800); |
| 412 | 412 | |
| 413 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9008, 0x9008, 0, 0, mariner_protection_2_r); | |
| 414 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb401, 0xb401, 0, 0, mariner_protection_1_r); | |
| 413 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9008, 0x9008, 0, 0, mariner_protection_2_r); | |
| 414 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb401, 0xb401, 0, 0, mariner_protection_1_r); | |
| 415 | 415 | |
| 416 | 416 | /* ??? (it's NOT a background enable) */ |
| 417 | /*memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);*/ | |
| 417 | /*memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);*/ | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | DRIVER_INIT( frogger ) |
| r2418 | r2419 | |
| 506 | 506 | DRIVER_INIT_CALL(scramble_ppi); |
| 507 | 507 | |
| 508 | 508 | /* banked ROM */ |
| 509 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 509 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 510 | 510 | memory_configure_bank(1, 0, 2, &ROM[0x00000], 0x10000); |
| 511 | 511 | cavelon_banksw(); |
| 512 | 512 | |
| 513 | 513 | /* A15 switches memory banks */ |
| 514 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, cavelon_banksw_r); | |
| 515 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, cavelon_banksw_w); | |
| 514 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, cavelon_banksw_r, cavelon_banksw_w); | |
| 516 | 515 | |
| 517 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, SMH_NOP); /* ??? */ | |
| 518 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3801, 0, 0, SMH_NOP); /* looks suspicously like | |
| 516 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, SMH_NOP); /* ??? */ | |
| 517 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3801, 0, 0, SMH_NOP); /* looks suspicously like | |
| 519 | 518 | an AY8910, but not sure */ |
| 520 | 519 | state_save_register_global(cavelon_bank); |
| 521 | 520 | } |
| r2418 | r2419 | |
| 538 | 537 | /* special handler for the spinner */ |
| 539 | 538 | ppi8255_set_portBread(0, darkplnt_input_port_1_r); |
| 540 | 539 | |
| 541 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, darkplnt_bullet_color_w); | |
| 540 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, darkplnt_bullet_color_w); | |
| 542 | 541 | } |
| 543 | 542 | |
| 544 | 543 | DRIVER_INIT( mimonkey ) |
| r2418 | r2419 | |
| 576 | 575 | |
| 577 | 576 | DRIVER_INIT_CALL(scramble_ppi); |
| 578 | 577 | |
| 579 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w); | |
| 578 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w); | |
| 580 | 579 | } |
| 581 | 580 | |
| 582 | 581 | DRIVER_INIT( mimonsco ) |
| 583 | 582 | { |
| 584 | 583 | DRIVER_INIT_CALL(scramble_ppi); |
| 585 | 584 | |
| 586 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w); | |
| 585 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w); | |
| 587 | 586 | } |
| 588 | 587 | |
| 589 | 588 | DRIVER_INIT( mimonscr ) |
| 590 | 589 | { |
| 591 | 590 | DRIVER_INIT_CALL(scramble_ppi); |
| 592 | 591 | |
| 593 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scrambold_background_enable_w); | |
| 592 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scrambold_background_enable_w); | |
| 594 | 593 | } |
| 595 | 594 | |
| 596 | 595 | |
| r2418 | r2419 | |
| 898 | 897 | ppi8255_init(&monsterz_ppi8255_intf); |
| 899 | 898 | |
| 900 | 899 | /* extra ROM */ |
| 901 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK1); | |
| 900 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK1); | |
| 902 | 901 | memory_set_bankptr(1, memory_region(REGION_CPU2) + 0x3000); |
| 903 | 902 | } |
| 904 | 903 | |
| r2418 | r2419 | |
| 920 | 919 | ppi8255_set_portCread(1, scorpion_prot_r); |
| 921 | 920 | |
| 922 | 921 | /* extra ROM */ |
| 923 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1); | |
| 922 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1); | |
| 924 | 923 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800); |
| 925 | 924 | |
| 926 | 925 | /* no background related */ |
| 927 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP); | |
| 926 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP); | |
| 928 | 927 | |
| 929 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r); | |
| 928 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r); | |
| 930 | 929 | } |
| 931 | 930 | |
| 932 | 931 | DRIVER_INIT( ad2083 ) |
| r2418 | r2419 | |
|---|---|---|
| 445 | 445 | init_tunit_generic(SOUND_ADPCM); |
| 446 | 446 | |
| 447 | 447 | /* protection */ |
| 448 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_r); | |
| 449 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_w); | |
| 448 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_r, mk_prot_w); | |
| 450 | 449 | |
| 451 | 450 | /* sound chip protection (hidden RAM) */ |
| 452 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfb9c, 0xfbc6, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 451 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfb9c, 0xfbc6, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 453 | 452 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 454 | 453 | } |
| 455 | 454 | |
| 456 | static void init_nbajam_common(int te_protection) | |
| 455 | static void init_nbajam_common(running_machine *machine, int te_protection) | |
| 457 | 456 | { |
| 458 | 457 | /* common init */ |
| 459 | 458 | init_tunit_generic(SOUND_ADPCM_LARGE); |
| r2418 | r2419 | |
| 462 | 461 | if (!te_protection) |
| 463 | 462 | { |
| 464 | 463 | nbajam_prot_table = nbajam_prot_values; |
| 465 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b14020, 0x1b2503f, 0, 0, nbajam_prot_r); | |
| 466 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b14020, 0x1b2503f, 0, 0, nbajam_prot_w); | |
| 464 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1b14020, 0x1b2503f, 0, 0, nbajam_prot_r, nbajam_prot_w); | |
| 467 | 465 | } |
| 468 | 466 | else |
| 469 | 467 | { |
| 470 | 468 | nbajam_prot_table = nbajamte_prot_values; |
| 471 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b15f40, 0x1b37f5f, 0, 0, nbajam_prot_r); | |
| 472 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b95f40, 0x1bb7f5f, 0, 0, nbajam_prot_r); | |
| 473 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b15f40, 0x1b37f5f, 0, 0, nbajam_prot_w); | |
| 474 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b95f40, 0x1bb7f5f, 0, 0, nbajam_prot_w); | |
| 469 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1b15f40, 0x1b37f5f, 0, 0, nbajam_prot_r, nbajam_prot_w); | |
| 470 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1b95f40, 0x1bb7f5f, 0, 0, nbajam_prot_r, nbajam_prot_w); | |
| 475 | 471 | } |
| 476 | 472 | |
| 477 | 473 | /* sound chip protection (hidden RAM) */ |
| 478 | 474 | if (!te_protection) |
| 479 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 475 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 480 | 476 | else |
| 481 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbec, 0xfc16, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 477 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfbec, 0xfc16, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 482 | 478 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 483 | 479 | } |
| 484 | 480 | |
| 485 | 481 | DRIVER_INIT( nbajam ) |
| 486 | 482 | { |
| 487 | init_nbajam_common(0); | |
| 483 | init_nbajam_common(machine, 0); | |
| 488 | 484 | } |
| 489 | 485 | |
| 490 | 486 | DRIVER_INIT( nbajamte ) |
| 491 | 487 | { |
| 492 | init_nbajam_common(1); | |
| 488 | init_nbajam_common(machine, 1); | |
| 493 | 489 | } |
| 494 | 490 | |
| 495 | 491 | DRIVER_INIT( jdreddp ) |
| r2418 | r2419 | |
| 498 | 494 | init_tunit_generic(SOUND_ADPCM_LARGE); |
| 499 | 495 | |
| 500 | 496 | /* looks like the watchdog needs to be disabled */ |
| 501 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d81060, 0x01d8107f, 0, 0, SMH_NOP); | |
| 497 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d81060, 0x01d8107f, 0, 0, SMH_NOP); | |
| 502 | 498 | |
| 503 | 499 | /* protection */ |
| 504 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1bfffff, 0, 0, jdredd_prot_r); | |
| 505 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1bfffff, 0, 0, jdredd_prot_w); | |
| 500 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1bfffff, 0, 0, jdredd_prot_r, jdredd_prot_w); | |
| 506 | 501 | |
| 507 | 502 | /* sound chip protection (hidden RAM) */ |
| 508 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbcf, 0xfbf9, 0, 0, SMH_BANK7, SMH_BANK9); | |
| 503 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfbcf, 0xfbf9, 0, 0, SMH_BANK7, SMH_BANK9); | |
| 509 | 504 | memory_set_bankptr(9, auto_malloc(0x80)); |
| 510 | 505 | |
| 511 | 506 | #if ENABLE_ALL_JDREDD_LEVELS |
| 512 | 507 | /* how about the final levels? */ |
| 513 | jdredd_hack = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFBA7FF0, 0xFFBA7FFf, 0, 0, jdredd_hack_r); | |
| 508 | jdredd_hack = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFBA7FF0, 0xFFBA7FFf, 0, 0, jdredd_hack_r); | |
| 514 | 509 | #endif |
| 515 | 510 | } |
| 516 | 511 | |
| r2418 | r2419 | |
| 531 | 526 | midtunit_gfx_rom_large = 1; |
| 532 | 527 | |
| 533 | 528 | /* protection */ |
| 534 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00f20c60, 0x00f20c7f, 0, 0, mk2_prot_w); | |
| 535 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00f42820, 0x00f4283f, 0, 0, mk2_prot_w); | |
| 536 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01a190e0, 0x01a190ff, 0, 0, mk2_prot_r); | |
| 537 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01a191c0, 0x01a191df, 0, 0, mk2_prot_shift_r); | |
| 538 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01a3d0c0, 0x01a3d0ff, 0, 0, mk2_prot_r); | |
| 539 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d9d1e0, 0x01d9d1ff, 0, 0, mk2_prot_const_r); | |
| 540 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01def920, 0x01def93f, 0, 0, mk2_prot_const_r); | |
| 529 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00f20c60, 0x00f20c7f, 0, 0, mk2_prot_w); | |
| 530 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00f42820, 0x00f4283f, 0, 0, mk2_prot_w); | |
| 531 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01a190e0, 0x01a190ff, 0, 0, mk2_prot_r); | |
| 532 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01a191c0, 0x01a191df, 0, 0, mk2_prot_shift_r); | |
| 533 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01a3d0c0, 0x01a3d0ff, 0, 0, mk2_prot_r); | |
| 534 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d9d1e0, 0x01d9d1ff, 0, 0, mk2_prot_const_r); | |
| 535 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01def920, 0x01def93f, 0, 0, mk2_prot_const_r); | |
| 541 | 536 | } |
| 542 | 537 | |
| 543 | 538 |
| r2418 | r2419 | |
|---|---|---|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | /* Main bankswitching routine */ |
| 667 | static void set_bank(int banknum, const bankhandler *handler) | |
| 667 | static void set_bank(running_machine *machine, int banknum, const bankhandler *handler) | |
| 668 | 668 | { |
| 669 | 669 | int bankstart = (banknum & 7) * 0x2000; |
| 670 | 670 | int cpunum = (banknum >> 3) & 1; |
| r2418 | r2419 | |
| 677 | 677 | if (!handler->bank_handler_r) |
| 678 | 678 | { |
| 679 | 679 | if (namcos1_active_bank[banknum].bank_handler_r) |
| 680 | memory_install_read8_handler(cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_r[banknum]); | |
| 680 | memory_install_read8_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_r[banknum]); | |
| 681 | 681 | } |
| 682 | 682 | else |
| 683 | 683 | { |
| 684 | 684 | if (!namcos1_active_bank[banknum].bank_handler_r) |
| 685 | memory_install_read8_handler(cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, io_bank_handler_r[banknum]); | |
| 685 | memory_install_read8_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, io_bank_handler_r[banknum]); | |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /* write handlers (except for the 0xe000-0xffff range) */ |
| r2418 | r2419 | |
| 691 | 691 | if (!handler->bank_handler_w) |
| 692 | 692 | { |
| 693 | 693 | if (namcos1_active_bank[banknum].bank_handler_w) |
| 694 | memory_install_write8_handler(cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_w[banknum]); | |
| 694 | memory_install_write8_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_w[banknum]); | |
| 695 | 695 | } |
| 696 | 696 | else |
| 697 | 697 | { |
| 698 | 698 | if (!namcos1_active_bank[banknum].bank_handler_r) |
| 699 | memory_install_write8_handler(cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, io_bank_handler_w[banknum]); | |
| 699 | memory_install_write8_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, bankstart, bankstart + 0x1fff, 0, 0, io_bank_handler_w[banknum]); | |
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | |
| r2418 | r2419 | |
| 704 | 704 | namcos1_active_bank[banknum] = *handler; |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | static void namcos1_bankswitch(int cpu, offs_t offset, UINT8 data) | |
| 707 | static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset, UINT8 data) | |
| 708 | 708 | { |
| 709 | 709 | int bank = (cpu*8) + (( offset >> 9) & 0x07); |
| 710 | 710 | |
| r2418 | r2419 | |
| 719 | 719 | chip[bank] |= (data & 0x03) << 8; |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | set_bank(bank, &namcos1_bank_element[chip[bank]]); | |
| 722 | set_bank(machine, bank, &namcos1_bank_element[chip[bank]]); | |
| 723 | 723 | |
| 724 | 724 | /* unmapped bank warning */ |
| 725 | 725 | if( namcos1_active_bank[bank].bank_handler_r == unknown_r) |
| r2418 | r2419 | |
| 736 | 736 | { |
| 737 | 737 | // logerror("cpu %d: namcos1_bankswitch_w offset %04x data %02x\n",cpu_getactivecpu(),offset,data); |
| 738 | 738 | |
| 739 | namcos1_bankswitch(cpu_getactivecpu(), offset, data); | |
| 739 | namcos1_bankswitch(machine, cpu_getactivecpu(), offset, data); | |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | /* Sub cpu set start bank port */ |
| r2418 | r2419 | |
| 745 | 745 | // logerror("namcos1_subcpu_bank_w offset %04x data %02x\n",offset,data); |
| 746 | 746 | |
| 747 | 747 | /* Prepare code for CPU 1 */ |
| 748 | namcos1_bankswitch( 1, 0x0e00, 0x03 ); | |
| 749 | namcos1_bankswitch( 1, 0x0e01, data ); | |
| 748 | namcos1_bankswitch( machine, 1, 0x0e00, 0x03 ); | |
| 749 | namcos1_bankswitch( machine, 1, 0x0e01, data ); | |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | /******************************************************************************* |
| r2418 | r2419 | |
| 842 | 842 | |
| 843 | 843 | /* Point all of our bankhandlers to the error handlers */ |
| 844 | 844 | for (bank = 0; bank < 2*8 ; bank++) |
| 845 | set_bank(bank, &unknown_handler); | |
| 845 | set_bank(machine, bank, &unknown_handler); | |
| 846 | 846 | |
| 847 | 847 | /* Default MMU setup for Cpu 0 */ |
| 848 | namcos1_bankswitch(0, 0x0000, 0x01 ); /* bank0 = 0x180(RAM) - evidence: wldcourt */ | |
| 849 | namcos1_bankswitch(0, 0x0001, 0x80 ); | |
| 850 | namcos1_bankswitch(0, 0x0200, 0x01 ); /* bank1 = 0x180(RAM) - evidence: berabohm */ | |
| 851 | namcos1_bankswitch(0, 0x0201, 0x80 ); | |
| 848 | namcos1_bankswitch(machine, 0, 0x0000, 0x01 ); /* bank0 = 0x180(RAM) - evidence: wldcourt */ | |
| 849 | namcos1_bankswitch(machine, 0, 0x0001, 0x80 ); | |
| 850 | namcos1_bankswitch(machine, 0, 0x0200, 0x01 ); /* bank1 = 0x180(RAM) - evidence: berabohm */ | |
| 851 | namcos1_bankswitch(machine, 0, 0x0201, 0x80 ); | |
| 852 | 852 | |
| 853 | namcos1_bankswitch(0, 0x0e00, 0x03 ); /* bank7 = 0x3ff(PRG7) */ | |
| 854 | namcos1_bankswitch(0, 0x0e01, 0xff ); | |
| 853 | namcos1_bankswitch(machine, 0, 0x0e00, 0x03 ); /* bank7 = 0x3ff(PRG7) */ | |
| 854 | namcos1_bankswitch(machine, 0, 0x0e01, 0xff ); | |
| 855 | 855 | |
| 856 | 856 | /* Default MMU setup for Cpu 1 */ |
| 857 | namcos1_bankswitch(1, 0x0000, 0x01 ); /* bank0 = 0x180(RAM) - evidence: wldcourt */ | |
| 858 | namcos1_bankswitch(1, 0x0001, 0x80 ); | |
| 857 | namcos1_bankswitch(machine, 1, 0x0000, 0x01 ); /* bank0 = 0x180(RAM) - evidence: wldcourt */ | |
| 858 | namcos1_bankswitch(machine, 1, 0x0001, 0x80 ); | |
| 859 | 859 | |
| 860 | namcos1_bankswitch(1, 0x0e00, 0x03); /* bank7 = 0x3ff(PRG7) */ | |
| 861 | namcos1_bankswitch(1, 0x0e01, 0xff); | |
| 860 | namcos1_bankswitch(machine, 1, 0x0e00, 0x03); /* bank7 = 0x3ff(PRG7) */ | |
| 861 | namcos1_bankswitch(machine, 1, 0x0e01, 0xff); | |
| 862 | 862 | |
| 863 | 863 | /* stop all CPUs */ |
| 864 | 864 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); |
| r2418 | r2419 | |
| 1283 | 1283 | DRIVER_INIT( quester ) |
| 1284 | 1284 | { |
| 1285 | 1285 | namcos1_driver_init(NULL); |
| 1286 | memory_install_read8_handler(3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, quester_paddle_r); | |
| 1286 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, quester_paddle_r); | |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | |
| r2418 | r2419 | |
| 1372 | 1372 | DRIVER_INIT( berabohm ) |
| 1373 | 1373 | { |
| 1374 | 1374 | namcos1_driver_init(NULL); |
| 1375 | memory_install_read8_handler(3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, berabohm_buttons_r); | |
| 1375 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, berabohm_buttons_r); | |
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | |
| r2418 | r2419 | |
| 1434 | 1434 | DRIVER_INIT( faceoff ) |
| 1435 | 1435 | { |
| 1436 | 1436 | namcos1_driver_init(NULL); |
| 1437 | memory_install_read8_handler(3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, faceoff_inputs_r); | |
| 1437 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x1400, 0x1401, 0, 0, faceoff_inputs_r); | |
| 1438 | 1438 | } |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | * |
| 86 | 86 | *************************************/ |
| 87 | 87 | |
| 88 | static void update_memory_mapping(struct memory_mapper_chip *chip); | |
| 88 | static void update_memory_mapping(running_machine *machine, struct memory_mapper_chip *chip); | |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | |
| r2418 | r2419 | |
| 127 | 127 | * |
| 128 | 128 | *************************************/ |
| 129 | 129 | |
| 130 | void segaic16_memory_mapper_init(int cpunum, const struct segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(UINT8), UINT8 (*sound_r_callback)(void)) | |
| 130 | void segaic16_memory_mapper_init(running_machine *machine, int cpunum, const struct segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(UINT8), UINT8 (*sound_r_callback)(void)) | |
| 131 | 131 | { |
| 132 | 132 | struct memory_mapper_chip *chip = &memory_mapper; |
| 133 | 133 | |
| r2418 | r2419 | |
| 139 | 139 | chip->sound_r = sound_r_callback; |
| 140 | 140 | |
| 141 | 141 | /* create the initial regions */ |
| 142 | segaic16_memory_mapper_reset(); | |
| 142 | segaic16_memory_mapper_reset(machine); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | void segaic16_memory_mapper_reset( | |
| 146 | void segaic16_memory_mapper_reset(running_machine *machine) | |
| 147 | 147 | { |
| 148 | 148 | struct memory_mapper_chip *chip = &memory_mapper; |
| 149 | 149 | |
| 150 | 150 | /* zap to 0 and remap everything */ |
| 151 | 151 | memset(chip->regs, 0, sizeof(chip->regs)); |
| 152 | update_memory_mapping(chip); | |
| 152 | update_memory_mapping(machine, chip); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | void segaic16_memory_mapper_config(const UINT8 *map_data) | |
| 156 | void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_data) | |
| 157 | 157 | { |
| 158 | 158 | struct memory_mapper_chip *chip = &memory_mapper; |
| 159 | 159 | |
| 160 | 160 | /* zap to 0 and remap everything */ |
| 161 | 161 | memcpy(&chip->regs[0x10], map_data, 0x10); |
| 162 | update_memory_mapping(chip); | |
| 162 | update_memory_mapping(machine, chip); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| r2418 | r2419 | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | static void memory_mapper_w(struct memory_mapper_chip *chip, offs_t offset, UINT8 data) | |
| 201 | static void memory_mapper_w(running_machine *machine, struct memory_mapper_chip *chip, offs_t offset, UINT8 data) | |
| 202 | 202 | { |
| 203 | 203 | UINT8 oldval; |
| 204 | 204 | |
| r2418 | r2419 | |
| 275 | 275 | case 0x1c: case 0x1d: |
| 276 | 276 | case 0x1e: case 0x1f: |
| 277 | 277 | if (oldval != data) |
| 278 | update_memory_mapping(chip); | |
| 278 | update_memory_mapping(machine, chip); | |
| 279 | 279 | break; |
| 280 | 280 | |
| 281 | 281 | default: |
| r2418 | r2419 | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | static void update_memory_mapping(struct memory_mapper_chip *chip) | |
| 326 | static void update_memory_mapping(running_machine *machine, struct memory_mapper_chip *chip) | |
| 327 | 327 | { |
| 328 | 328 | int rgnum; |
| 329 | 329 | |
| 330 | 330 | if (LOG_MEMORY_MAP) mame_printf_debug("----\nRemapping:\n"); |
| 331 | 331 | |
| 332 | 332 | /* first reset everything back to the beginning */ |
| 333 | memory_install_read16_handler (chip->cpunum, ADDRESS_SPACE_PROGRAM, 0x000000, 0xffffff, 0, 0, segaic16_memory_mapper_lsb_r); | |
| 334 | memory_install_write16_handler(chip->cpunum, ADDRESS_SPACE_PROGRAM, 0x000000, 0xffffff, 0, 0, segaic16_memory_mapper_lsb_w); | |
| 333 | memory_install_readwrite16_handler(machine, chip->cpunum, ADDRESS_SPACE_PROGRAM, 0x000000, 0xffffff, 0, 0, segaic16_memory_mapper_lsb_r, segaic16_memory_mapper_lsb_w); | |
| 335 | 334 | |
| 336 | 335 | /* loop over the regions */ |
| 337 | 336 | for (rgnum = 0; chip->map[rgnum].regbase != 0; rgnum++) |
| r2418 | r2419 | |
| 365 | 364 | |
| 366 | 365 | /* map it */ |
| 367 | 366 | if (read) |
| 368 | memory_install_read16_handler(chip->cpunum, ADDRESS_SPACE_PROGRAM, region_start, region_end, 0, region_mirror, read); | |
| 367 | memory_install_read16_handler(machine, chip->cpunum, ADDRESS_SPACE_PROGRAM, region_start, region_end, 0, region_mirror, read); | |
| 369 | 368 | if (write) |
| 370 | memory_install_write16_handler(chip->cpunum, ADDRESS_SPACE_PROGRAM, region_start, region_end, 0, region_mirror, write); | |
| 369 | memory_install_write16_handler(machine, chip->cpunum, ADDRESS_SPACE_PROGRAM, region_start, region_end, 0, region_mirror, write); | |
| 371 | 370 | |
| 372 | 371 | /* set the bank pointer */ |
| 373 | 372 | if (banknum && read) |
| r2418 | r2419 | |
| 405 | 404 | |
| 406 | 405 | WRITE8_HANDLER( segaic16_memory_mapper_w ) |
| 407 | 406 | { |
| 408 | memory_mapper_w(&memory_mapper, offset, data); | |
| 407 | memory_mapper_w(machine, &memory_mapper, offset, data); | |
| 409 | 408 | } |
| 410 | 409 | |
| 411 | 410 | |
| r2418 | r2419 | |
| 418 | 417 | WRITE16_HANDLER( segaic16_memory_mapper_lsb_w ) |
| 419 | 418 | { |
| 420 | 419 | if (ACCESSING_BITS_0_7) |
| 421 | memory_mapper_w(&memory_mapper, offset, data & 0xff); | |
| 420 | memory_mapper_w(machine, &memory_mapper, offset, data & 0xff); | |
| 422 | 421 | } |
| 423 | 422 | |
| 424 | 423 |
| r2418 | r2419 | |
|---|---|---|
| 21 | 21 | const char * name; /* friendly name for debugging */ |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | void segaic16_memory_mapper_init(int cpunum, const struct segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(UINT8), UINT8 (*sound_r_callback)(void)); | |
| 25 | void segaic16_memory_mapper_reset(void); | |
| 26 | void segaic16_memory_mapper_config(const UINT8 *map_data); | |
| 24 | void segaic16_memory_mapper_init(running_machine *machine, int cpunum, const struct segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(UINT8), UINT8 (*sound_r_callback)(void)); | |
| 25 | void segaic16_memory_mapper_reset(running_machine *machine); | |
| 26 | void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_data); | |
| 27 | 27 | void segaic16_memory_mapper_set_decrypted(UINT8 *decrypted); |
| 28 | 28 | READ8_HANDLER( segaic16_memory_mapper_r ); |
| 29 | 29 | WRITE8_HANDLER( segaic16_memory_mapper_w ); |
| r2418 | r2419 | |
|---|---|---|
| 288 | 288 | DRIVER_INIT( vsnormal ) |
| 289 | 289 | { |
| 290 | 290 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 291 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vsnormal_vrom_banking ); | |
| 291 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vsnormal_vrom_banking ); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | static WRITE8_HANDLER( ppuRC2C05_protection ) |
| r2418 | r2419 | |
| 317 | 317 | DRIVER_INIT_CALL(vsnormal); |
| 318 | 318 | |
| 319 | 319 | /* extra ram at $6000 is enabled with bit 1 of $4016 */ |
| 320 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 320 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 321 | 321 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 322 | 322 | |
| 323 | 323 | /* now override the vidaccess callback */ |
| r2418 | r2419 | |
| 382 | 382 | |
| 383 | 383 | DRIVER_INIT( duckhunt ) |
| 384 | 384 | { |
| 385 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r); | |
| 386 | 385 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 387 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_w ); | |
| 386 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w ); | |
| 388 | 387 | |
| 389 | 388 | /* common init */ |
| 390 | 389 | init_vsnes(machine); |
| r2418 | r2419 | |
| 434 | 433 | memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x18000], 0x8000 ); |
| 435 | 434 | |
| 436 | 435 | /* banking is done with writes to the $8000-$ffff area */ |
| 437 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, goonies_rom_banking ); | |
| 436 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, goonies_rom_banking ); | |
| 438 | 437 | |
| 439 | 438 | /* common init */ |
| 440 | 439 | init_vsnes(machine); |
| r2418 | r2419 | |
| 450 | 449 | memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x18000], 0x8000 ); |
| 451 | 450 | |
| 452 | 451 | /* banking is done with writes to the $8000-$ffff area */ |
| 453 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, goonies_rom_banking ); | |
| 452 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, goonies_rom_banking ); | |
| 454 | 453 | |
| 455 | 454 | /* common init */ |
| 456 | 455 | init_vsnes(machine); |
| r2418 | r2419 | |
| 475 | 474 | DRIVER_INIT( hogalley ) |
| 476 | 475 | { |
| 477 | 476 | |
| 478 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r); | |
| 479 | 477 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 480 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_w ); | |
| 478 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w ); | |
| 481 | 479 | |
| 482 | 480 | /* common init */ |
| 483 | 481 | init_vsnes(machine); |
| r2418 | r2419 | |
| 520 | 518 | memcpy (&memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x12000], 0x2000); |
| 521 | 519 | |
| 522 | 520 | /* Protection */ |
| 523 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, vsgshoe_security_r ); | |
| 524 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 521 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, vsgshoe_security_r ); | |
| 522 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 525 | 523 | |
| 526 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r); | |
| 527 | 524 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 528 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vsgshoe_gun_in0_w ); | |
| 525 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r, vsgshoe_gun_in0_w ); | |
| 529 | 526 | |
| 530 | 527 | /* common init */ |
| 531 | 528 | init_vsnes(machine); |
| r2418 | r2419 | |
| 659 | 656 | memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_CPU1 )[0x1c000], 0x4000 ); |
| 660 | 657 | |
| 661 | 658 | /* MMC1 mapper at writes to $8000-$ffff */ |
| 662 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, drmario_rom_banking ); | |
| 659 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, drmario_rom_banking ); | |
| 663 | 660 | |
| 664 | 661 | drmario_shiftreg = 0; |
| 665 | 662 | drmario_shiftcount = 0; |
| r2418 | r2419 | |
| 754 | 751 | memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x28000], 0x8000 ); |
| 755 | 752 | |
| 756 | 753 | /* banking is done with writes to the $8000-$ffff area */ |
| 757 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, castlevania_rom_banking ); | |
| 754 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, castlevania_rom_banking ); | |
| 758 | 755 | |
| 759 | 756 | /* common init */ |
| 760 | 757 | init_vsnes(machine); |
| r2418 | r2419 | |
| 781 | 778 | memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x28000], 0x8000 ); |
| 782 | 779 | |
| 783 | 780 | /* banking is done with writes to the $8000-$ffff area */ |
| 784 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, castlevania_rom_banking ); | |
| 781 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, castlevania_rom_banking ); | |
| 785 | 782 | |
| 786 | 783 | /* tap on the PPU, due to some tricky protection */ |
| 787 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, topgun_security_r ); | |
| 788 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 784 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, topgun_security_r ); | |
| 785 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 789 | 786 | |
| 790 | 787 | /* common init */ |
| 791 | 788 | init_vsnes(machine); |
| r2418 | r2419 | |
| 963 | 960 | memcpy( &memory_region( REGION_CPU1 )[0xe000], &memory_region( REGION_CPU1 )[(MMC3_prg_chunks-1) * 0x4000 + 0x12000], 0x2000 ); |
| 964 | 961 | |
| 965 | 962 | /* MMC3 mapper at writes to $8000-$ffff */ |
| 966 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper4_w ); | |
| 963 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper4_w ); | |
| 967 | 964 | |
| 968 | 965 | /* extra ram at $6000-$7fff */ |
| 969 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 966 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 970 | 967 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 971 | 968 | |
| 972 | 969 | /* common init */ |
| r2418 | r2419 | |
| 1011 | 1008 | DRIVER_INIT_CALL(MMC3); |
| 1012 | 1009 | |
| 1013 | 1010 | /* RBI Base ball hack */ |
| 1014 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, rbi_hack_r) ; | |
| 1011 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, rbi_hack_r) ; | |
| 1015 | 1012 | |
| 1016 | 1013 | remapped_colortable = rp2c04003_colortable; |
| 1017 | 1014 | } |
| r2418 | r2419 | |
| 1061 | 1058 | DRIVER_INIT_CALL(MMC3); |
| 1062 | 1059 | |
| 1063 | 1060 | /* Vs. Super Xevious Protection */ |
| 1064 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x54ff, 0x54ff, 0, 0, supxevs_read_prot_1_r ); | |
| 1065 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5678, 0x5678, 0, 0, supxevs_read_prot_2_r ); | |
| 1066 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x578f, 0x578f, 0, 0, supxevs_read_prot_3_r ); | |
| 1067 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5567, 0x5567, 0, 0, supxevs_read_prot_4_r ); | |
| 1061 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x54ff, 0x54ff, 0, 0, supxevs_read_prot_1_r ); | |
| 1062 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5678, 0x5678, 0, 0, supxevs_read_prot_2_r ); | |
| 1063 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x578f, 0x578f, 0, 0, supxevs_read_prot_3_r ); | |
| 1064 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5567, 0x5567, 0, 0, supxevs_read_prot_4_r ); | |
| 1068 | 1065 | |
| 1069 | 1066 | remapped_colortable = rp2c04001_colortable; |
| 1070 | 1067 | } |
| r2418 | r2419 | |
| 1096 | 1093 | DRIVER_INIT_CALL(MMC3); |
| 1097 | 1094 | |
| 1098 | 1095 | /* security device at $5e00-$5e01 */ |
| 1099 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, tko_security_r ); | |
| 1096 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, tko_security_r ); | |
| 1100 | 1097 | |
| 1101 | 1098 | /* now override the vidaccess callback */ |
| 1102 | 1099 | /* we need to remap color tables */ |
| r2418 | r2419 | |
| 1110 | 1107 | { |
| 1111 | 1108 | DRIVER_INIT_CALL(MMC3); |
| 1112 | 1109 | |
| 1113 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r ); | |
| 1114 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_w ); | |
| 1110 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w ); | |
| 1115 | 1111 | |
| 1116 | 1112 | vsnes_gun_controller = 1; |
| 1117 | 1113 | vsnes_do_vrom_bank = 0; |
| r2418 | r2419 | |
| 1160 | 1156 | memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[0x10000], 0x4000 ); |
| 1161 | 1157 | memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_CPU1 )[0x2c000], 0x4000 ); |
| 1162 | 1158 | |
| 1163 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper68_rom_banking ); | |
| 1159 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper68_rom_banking ); | |
| 1164 | 1160 | |
| 1165 | 1161 | init_vsnes(machine); |
| 1166 | 1162 | |
| r2418 | r2419 | |
| 1187 | 1183 | |
| 1188 | 1184 | DRIVER_INIT( bnglngby ) |
| 1189 | 1185 | { |
| 1190 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0231, 0x0231, 0, 0, set_bnglngby_irq_r ); | |
| 1191 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0231, 0x0231, 0, 0, set_bnglngby_irq_w ); | |
| 1186 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0231, 0x0231, 0, 0, set_bnglngby_irq_r, set_bnglngby_irq_w ); | |
| 1192 | 1187 | |
| 1193 | 1188 | /* extra ram */ |
| 1194 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1189 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1195 | 1190 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 1196 | 1191 | |
| 1197 | 1192 | ret = 0; |
| r2418 | r2419 | |
| 1221 | 1216 | //Maybe it should be a DOP (double NOP) |
| 1222 | 1217 | |
| 1223 | 1218 | /* Protection */ |
| 1224 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, jajamaru_security_r ); | |
| 1225 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 1219 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, jajamaru_security_r ); | |
| 1220 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 1226 | 1221 | |
| 1227 | 1222 | /* common init */ |
| 1228 | 1223 | init_vsnes(machine); |
| r2418 | r2419 | |
| 1244 | 1239 | DRIVER_INIT( mightybj ) |
| 1245 | 1240 | { |
| 1246 | 1241 | /* Protection */ |
| 1247 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, mightybj_security_r ); | |
| 1248 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 1242 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2002, 0x2002, 0, 0, mightybj_security_r ); | |
| 1243 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2001, 0, 0, ppuRC2C05_protection ); | |
| 1249 | 1244 | |
| 1250 | 1245 | /* common init */ |
| 1251 | 1246 | init_vsnes(machine); |
| r2418 | r2419 | |
| 1274 | 1269 | DRIVER_INIT( vstennis ) |
| 1275 | 1270 | { |
| 1276 | 1271 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 1277 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vstennis_vrom_banking ); | |
| 1278 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vstennis_vrom_banking ); | |
| 1272 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vstennis_vrom_banking ); | |
| 1273 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, vstennis_vrom_banking ); | |
| 1279 | 1274 | |
| 1280 | 1275 | /* shared ram at $6000 */ |
| 1281 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1 ); | |
| 1282 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1 ); | |
| 1283 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1 ); | |
| 1284 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1 ); | |
| 1276 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1277 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1285 | 1278 | |
| 1286 | 1279 | memory_set_bankptr(1, &memory_region(REGION_CPU1)[0x6000]); |
| 1287 | 1280 | } |
| r2418 | r2419 | |
| 1351 | 1344 | DRIVER_INIT( vstetris ) |
| 1352 | 1345 | { |
| 1353 | 1346 | /* extra ram at $6000 is enabled with bit 1 of $4016 */ |
| 1354 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1347 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1355 | 1348 | memory_set_bankptr(1, auto_malloc(0x2000)); |
| 1356 | 1349 | |
| 1357 | 1350 | init_vsnes(machine); |
| r2418 | r2419 | |
|---|---|---|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | void fatfury2_install_protection( | |
| 103 | void fatfury2_install_protection(running_machine *machine) | |
| 104 | 104 | { |
| 105 | 105 | /* the protection involves reading and writing addresses in the */ |
| 106 | 106 | /* 0x2xxxxx range. There are several checks all around the code. */ |
| 107 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2fffff, 0, 0, fatfury2_protection_16_r, fatfury2_protection_16_w); | |
| 107 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2fffff, 0, 0, fatfury2_protection_16_r, fatfury2_protection_16_w); | |
| 108 | 108 | |
| 109 | 109 | state_save_register_global(fatfury2_prot_data); |
| 110 | 110 | } |
| r2418 | r2419 | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| 143 | void install_kof98_protection( | |
| 143 | void install_kof98_protection(running_machine *machine) | |
| 144 | 144 | { |
| 145 | 145 | /* when 0x20aaaa contains 0x0090 (word) then 0x100 (normally the neogeo header) should return 0x00c200fd |
| 146 | 146 | worked out using real hw */ |
| 147 | 147 | |
| 148 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20aaaa, 0x20aaab, 0, 0, kof98_prot_w); | |
| 148 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20aaaa, 0x20aaab, 0, 0, kof98_prot_w); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| r2418 | r2419 | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| 398 | static void sma_install_random_read_handler(int addr1, int addr2) | |
| 398 | static void sma_install_random_read_handler(running_machine *machine, int addr1, int addr2) | |
| 399 | 399 | { |
| 400 | 400 | state_save_register_global(neogeo_rng); |
| 401 | 401 | |
| 402 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, addr1, addr1 + 1, 0, 0, sma_random_r); | |
| 403 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, addr2, addr2 + 2, 0, 0, sma_random_r); | |
| 402 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, addr1, addr1 + 1, 0, 0, sma_random_r); | |
| 403 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, addr2, addr2 + 2, 0, 0, sma_random_r); | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | |
| 407 | void kof99_install_protection( | |
| 407 | void kof99_install_protection(running_machine *machine) | |
| 408 | 408 | { |
| 409 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff1, 0, 0, kof99_bankswitch_w); | |
| 410 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 409 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff1, 0, 0, kof99_bankswitch_w); | |
| 410 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 411 | 411 | |
| 412 | sma_install_random_read_handler(0x2ffff8, 0x2ffffa); | |
| 412 | sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa); | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| 416 | void garou_install_protection( | |
| 416 | void garou_install_protection(running_machine *machine) | |
| 417 | 417 | { |
| 418 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffc0, 0x2fffc1, 0, 0, garou_bankswitch_w); | |
| 419 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 418 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fffc0, 0x2fffc1, 0, 0, garou_bankswitch_w); | |
| 419 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 420 | 420 | |
| 421 | sma_install_random_read_handler(0x2fffcc, 0x2ffff0); | |
| 421 | sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0); | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | |
| 425 | void garouo_install_protection( | |
| 425 | void garouo_install_protection(running_machine *machine) | |
| 426 | 426 | { |
| 427 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffc0, 0x2fffc1, 0, 0, garouo_bankswitch_w); | |
| 428 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 427 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fffc0, 0x2fffc1, 0, 0, garouo_bankswitch_w); | |
| 428 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 429 | 429 | |
| 430 | sma_install_random_read_handler(0x2fffcc, 0x2ffff0); | |
| 430 | sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | |
| 434 | void mslug3_install_protection( | |
| 434 | void mslug3_install_protection(running_machine *machine) | |
| 435 | 435 | { |
| 436 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffe4, 0x2fffe5, 0, 0, mslug3_bankswitch_w); | |
| 437 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 436 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fffe4, 0x2fffe5, 0, 0, mslug3_bankswitch_w); | |
| 437 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 438 | 438 | |
| 439 | // sma_install_random_read_handler(0x2ffff8, 0x2ffffa); | |
| 439 | // sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | void kof2000_install_protection( | |
| 443 | void kof2000_install_protection(running_machine *machine) | |
| 444 | 444 | { |
| 445 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffec, 0x2fffed, 0, 0, kof2000_bankswitch_w); | |
| 446 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 445 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fffec, 0x2fffed, 0, 0, kof2000_bankswitch_w); | |
| 446 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); | |
| 447 | 447 | |
| 448 | sma_install_random_read_handler(0x2fffd8, 0x2fffda); | |
| 448 | sma_install_random_read_handler(machine, 0x2fffd8, 0x2fffda); | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | |
| r2418 | r2419 | |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | |
| 519 | void install_pvc_protection( | |
| 519 | void install_pvc_protection( running_machine *machine ) | |
| 520 | 520 | { |
| 521 | 521 | pvc_cartridge_ram = auto_malloc(0x2000); |
| 522 | 522 | state_save_register_global_pointer(pvc_cartridge_ram, 0x2000 / 2); |
| 523 | 523 | |
| 524 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, pvc_prot_r, pvc_prot_w); | |
| 524 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, pvc_prot_r, pvc_prot_w); | |
| 525 | 525 | } |
| r2418 | r2419 | |
|---|---|---|
| 549 | 549 | slapstic_init(chipnum); |
| 550 | 550 | |
| 551 | 551 | /* install the memory handlers */ |
| 552 | atarigen_slapstic = memory_install_readwrite16_handler(cpunum, ADDRESS_SPACE_PROGRAM, base, base + 0x7fff, 0, mirror, atarigen_slapstic_r, atarigen_slapstic_w); | |
| 552 | atarigen_slapstic = memory_install_readwrite16_handler(Machine, cpunum, ADDRESS_SPACE_PROGRAM, base, base + 0x7fff, 0, mirror, atarigen_slapstic_r, atarigen_slapstic_w); | |
| 553 | 553 | |
| 554 | 554 | /* allocate memory for a copy of bank 0 */ |
| 555 | 555 | atarigen_slapstic_bank0 = auto_malloc(0x2000); |
| r2418 | r2419 | |
|---|---|---|
| 460 | 460 | DRIVER_INIT( umk3 ) |
| 461 | 461 | { |
| 462 | 462 | init_mk3_common(); |
| 463 | umk3_palette = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0106a060, 0x0106a09f, 0, 0, umk3_palette_hack_w); | |
| 463 | umk3_palette = memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0106a060, 0x0106a09f, 0, 0, umk3_palette_hack_w); | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | DRIVER_INIT( umk3r11 ) |
| 467 | 467 | { |
| 468 | 468 | init_mk3_common(); |
| 469 | umk3_palette = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0106a060, 0x0106a09f, 0, 0, umk3_palette_hack_w); | |
| 469 | umk3_palette = memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0106a060, 0x0106a09f, 0, 0, umk3_palette_hack_w); | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
| r2418 | r2419 | |
| 551 | 551 | init_wunit_generic(); |
| 552 | 552 | |
| 553 | 553 | /* enable I/O shuffling */ |
| 554 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x01800000, 0x0180000f, 0, 0, wwfmania_io_0_w); | |
| 554 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01800000, 0x0180000f, 0, 0, wwfmania_io_0_w); | |
| 555 | 555 | |
| 556 | 556 | /* serial prefixes 430, 528 */ |
| 557 | 557 | midway_serial_pic_init(528); |
| r2418 | r2419 | |
|---|---|---|
| 215 | 215 | rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ | |
| 218 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ | |
| 219 | 219 | |
| 220 | 220 | } |
| 221 | 221 | |
| r2418 | r2419 | |
| 337 | 337 | DRIVER_INIT( pisces ) |
| 338 | 338 | { |
| 339 | 339 | /* the coin lockout was replaced */ |
| 340 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 340 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | DRIVER_INIT( checkmaj ) |
| 344 | 344 | { |
| 345 | 345 | /* for the title screen */ |
| 346 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r); | |
| 346 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | DRIVER_INIT( dingo ) |
| 350 | 350 | { |
| 351 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r); | |
| 352 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r); | |
| 351 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r); | |
| 352 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r); | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | DRIVER_INIT( kingball ) |
| 356 | 356 | { |
| 357 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, kingball_IN0_r); | |
| 358 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0, kingball_IN1_r); | |
| 357 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, kingball_IN0_r); | |
| 358 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0, kingball_IN1_r); | |
| 359 | 359 | |
| 360 | 360 | state_save_register_global(kingball_speech_dip); |
| 361 | 361 | state_save_register_global(kingball_sound); |
| r2418 | r2419 | |
| 376 | 376 | |
| 377 | 377 | DRIVER_INIT( mooncrsu ) |
| 378 | 378 | { |
| 379 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w); | |
| 379 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w); | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | DRIVER_INIT( mooncrst ) |
| r2418 | r2419 | |
| 393 | 393 | |
| 394 | 394 | DRIVER_INIT( mooncrgx ) |
| 395 | 395 | { |
| 396 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 396 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | DRIVER_INIT( moonqsr ) |
| r2418 | r2419 | |
| 477 | 477 | { |
| 478 | 478 | DRIVER_INIT_CALL(pisces); |
| 479 | 479 | |
| 480 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r); | |
| 481 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r); | |
| 480 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r); | |
| 481 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r); | |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | DRIVER_INIT( 4in1 ) |
| r2418 | r2419 | |
| 506 | 506 | DRIVER_INIT( ladybugg ) |
| 507 | 507 | { |
| 508 | 508 | /* Doesn't actually use the bank, but it mustn't have a coin lock! */ |
| 509 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 509 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | DRIVER_INIT( gmgalax ) |
| r2418 | r2419 | |
|---|---|---|
| 181 | 181 | DRIVER_INIT( strtheat ) |
| 182 | 182 | { |
| 183 | 183 | |
| 184 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 ); | |
| 184 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 ); | |
| 185 | 185 | |
| 186 | 186 | /* While the PAL supports up to 16 decryption methods, only four |
| 187 | 187 | are actually used in the PAL. Therefore, we'll take a little |
| r2418 | r2419 | |
| 192 | 192 | strtheat_decrypt_rom_B(); |
| 193 | 193 | |
| 194 | 194 | /* custom handlers supporting Joystick or Steering Wheel */ |
| 195 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7c00, 0x7c00, 0, 0, strtheat_inputport_0_r); | |
| 196 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r); | |
| 195 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7c00, 0x7c00, 0, 0, strtheat_inputport_0_r); | |
| 196 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r); | |
| 197 | 197 | } |
| r2418 | r2419 | |
|---|---|---|
| 104 | 104 | DRIVER_INIT( drakton ) |
| 105 | 105 | { |
| 106 | 106 | |
| 107 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 ); | |
| 107 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 ); | |
| 108 | 108 | |
| 109 | 109 | /* While the PAL supports up to 16 decryption methods, only four |
| 110 | 110 | are actually used in the PAL. Therefore, we'll take a little |
| r2418 | r2419 | |
|---|---|---|
| 546 | 546 | { |
| 547 | 547 | UINT8 *RAM = memory_region(REGION_CPU3); |
| 548 | 548 | |
| 549 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, hippodrm_68000_share_r); | |
| 550 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, hippodrm_68000_share_w); | |
| 551 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc800, 0xffcfff, 0, 0, sprite_mirror_w); | |
| 549 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, hippodrm_68000_share_r, hippodrm_68000_share_w); | |
| 550 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xffc800, 0xffcfff, 0, 0, sprite_mirror_w); | |
| 552 | 551 | |
| 553 | 552 | h6280_decrypt(REGION_CPU3); |
| 554 | 553 | |
| r2418 | r2419 | |
| 572 | 571 | |
| 573 | 572 | DRIVER_INIT( robocop ) |
| 574 | 573 | { |
| 575 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, robocop_68000_share_r); | |
| 576 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, robocop_68000_share_w); | |
| 574 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180000, 0x180fff, 0, 0, robocop_68000_share_r, robocop_68000_share_w); | |
| 577 | 575 | } |
| 578 | 576 | |
| 579 | 577 | DRIVER_INIT( baddudes ) |
| r2418 | r2419 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | if ((data & 0x07) == 0) |
| 128 | 128 | { |
| 129 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc7ff, 0, 0, watchdog_reset_w); | |
| 130 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc9ff, 0, 0, beezer_map_w); | |
| 131 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xca00, 0xcbff, 0, 0, beezer_line_r); | |
| 132 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xce00, 0xcfff, 0, 0, via_0_r); | |
| 133 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xce00, 0xcfff, 0, 0, via_0_w); | |
| 129 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc7ff, 0, 0, watchdog_reset_w); | |
| 130 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc9ff, 0, 0, beezer_map_w); | |
| 131 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xca00, 0xcbff, 0, 0, beezer_line_r); | |
| 132 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xce00, 0xcfff, 0, 0, via_0_r, via_0_w); | |
| 134 | 133 | } |
| 135 | 134 | else |
| 136 | 135 | { |
| 137 | 136 | UINT8 *rom = memory_region(REGION_CPU1) + 0x10000; |
| 138 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK1); | |
| 139 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK1); | |
| 137 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 140 | 138 | memory_set_bankptr(1, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0)); |
| 141 | 139 | } |
| 142 | 140 | } |
| r2418 | r2419 | |
|---|---|---|
| 491 | 491 | { |
| 492 | 492 | /* page 0 is video ram */ |
| 493 | 493 | case 0: |
| 494 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 495 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4); | |
| 494 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 495 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4); | |
| 496 | 496 | memory_set_bank(1, 0); |
| 497 | 497 | memory_set_bankptr(4, &williams_videoram[0x8000]); |
| 498 | 498 | break; |
| r2418 | r2419 | |
| 500 | 500 | /* pages 1 and 2 are ROM */ |
| 501 | 501 | case 1: |
| 502 | 502 | case 2: |
| 503 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 504 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4); | |
| 503 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 504 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4); | |
| 505 | 505 | memory_set_bank(1, 1 + ((vram_bank & 6) >> 1)); |
| 506 | 506 | memory_set_bankptr(4, &williams_videoram[0x8000]); |
| 507 | 507 | break; |
| 508 | 508 | |
| 509 | 509 | /* page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected */ |
| 510 | 510 | case 3: |
| 511 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4); | |
| 512 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, williams2_paletteram_w); | |
| 511 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK4, williams2_paletteram_w); | |
| 513 | 512 | memory_set_bank(1, 1 + ((vram_bank & 4) >> 1)); |
| 514 | 513 | memory_set_bankptr(4, paletteram); |
| 515 | 514 | break; |
| r2418 | r2419 | |
| 744 | 743 | { |
| 745 | 744 | /* page 0 is I/O space */ |
| 746 | 745 | case 0: |
| 747 | defender_install_io_space(); | |
| 746 | defender_install_io_space(machine); | |
| 748 | 747 | break; |
| 749 | 748 | |
| 750 | 749 | /* pages 1-9 map to ROM banks */ |
| r2418 | r2419 | |
| 757 | 756 | case 7: |
| 758 | 757 | case 8: |
| 759 | 758 | case 9: |
| 760 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK1); | |
| 761 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_UNMAP); | |
| 759 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 762 | 760 | memory_set_bank(1, vram_bank - 1); |
| 763 | 761 | break; |
| 764 | 762 | |
| 765 | 763 | /* pages A-F are not connected */ |
| 766 | 764 | default: |
| 767 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_NOP); | |
| 768 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_NOP); | |
| 765 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_NOP, SMH_NOP); | |
| 769 | 766 | break; |
| 770 | 767 | } |
| 771 | 768 | } |
| r2418 | r2419 | |
|---|---|---|
| 6 | 6 | #include "sound/k053260.h" |
| 7 | 7 | |
| 8 | 8 | /* from video */ |
| 9 | extern void simpsons_video_banking( int select ); | |
| 9 | extern void simpsons_video_banking( running_machine *machine, int select ); | |
| 10 | 10 | extern UINT8 *simpsons_xtraram; |
| 11 | 11 | |
| 12 | 12 | int simpsons_firq_enabled; |
| r2418 | r2419 | |
| 76 | 76 | EEPROM_set_cs_line((data & 0x08) ? CLEAR_LINE : ASSERT_LINE); |
| 77 | 77 | EEPROM_set_clock_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 78 | 78 | |
| 79 | simpsons_video_banking( data & 3 ); | |
| 79 | simpsons_video_banking( machine, data & 3 ); | |
| 80 | 80 | |
| 81 | 81 | simpsons_firq_enabled = data & 0x04; |
| 82 | 82 | } |
| r2418 | r2419 | |
| 143 | 143 | memory_configure_bank(2, 2, 6, memory_region(REGION_CPU2) + 0x10000, 0x4000); |
| 144 | 144 | memory_set_bank(2, 0); |
| 145 | 145 | |
| 146 | simpsons_video_banking( 0 ); | |
| 146 | simpsons_video_banking( machine, 0 ); | |
| 147 | 147 | } |
| r2418 | r2419 | |
|---|---|---|
| 49 | 49 | #include "driver.h" |
| 50 | 50 | #include "audio/seibu.h" |
| 51 | 51 | |
| 52 | #define seibu_cop_log printf | |
| 53 | ||
| 52 | 54 | UINT16 *cop_mcu_ram; |
| 53 | 55 | |
| 54 | 56 | static UINT16 copd2_table[0x100]; |
| r2418 | r2419 | |
| 60 | 62 | static UINT16 cop_43a; |
| 61 | 63 | static UINT16 cop_43c; |
| 62 | 64 | |
| 65 | static UINT16 cop_clearfill_address[0x200]; | |
| 66 | static UINT16 cop_clearfill_length[0x200]; | |
| 67 | static UINT16 cop_clearfill_value[0x200]; | |
| 68 | static UINT16 cop_clearfill_lasttrigger = 0; | |
| 63 | 69 | |
| 70 | ||
| 64 | 71 | static UINT16 copd2_offs = 0; |
| 65 | 72 | |
| 66 | 73 | extern UINT16* legionna_scrollram16; |
| 67 | 74 | extern UINT8 sdgndmrb_pri_n; |
| 68 | 75 | extern void heatbrl_setgfxbank(UINT16 data); |
| 69 | 76 | extern void denjinmk_setgfxbank(UINT16 data); |
| 77 | extern UINT16 legionna_layer_disable; | |
| 70 | 78 | |
| 71 | 79 | void copd2_set_tableoffset(UINT16 data, running_machine *machine) |
| 72 | 80 | { |
| r2418 | r2419 | |
| 135 | 143 | } |
| 136 | 144 | } |
| 137 | 145 | |
| 138 | /* Mcu reads in attract in Legionnaire game demo | |
| 139 | 146 | |
| 140 | Guess the 0x400-0x5ff area of the COP is protection related. | |
| 141 | ||
| 142 | CPU0 PC 0032a2 unknown MCU write offset: 0260 data: 9c6c | |
| 143 | CPU0 PC 0032a8 unknown MCU write offset: 0250 data: 0010 | |
| 144 | CPU0 PC 0032c8 unknown MCU write offset: 0261 data: 987c | |
| 145 | CPU0 PC 0032ce unknown MCU write offset: 0251 data: 0010 | |
| 146 | CPU0 PC 003546 unknown MCU write offset: 0262 data: 02c4 | |
| 147 | CPU0 PC 00354a unknown MCU write offset: 0252 data: 0004 | |
| 148 | CPU0 PC 00355c unknown MCU write offset: 0263 data: 0000 | |
| 149 | CPU0 PC 003560 unknown MCU write offset: 0253 data: 0004 | |
| 150 | CPU0 PC 003568 unknown MCU write offset: 0280 data: a180 | |
| 151 | CPU0 PC 00356e unknown MCU write offset: 0280 data: a980 | |
| 152 | CPU0 PC 003574 unknown MCU write offset: 0280 data: b100 | |
| 153 | CPU0 PC 00357a unknown MCU write offset: 0280 data: b900 | |
| 154 | CPU0 PC 003580 unknown MCU read offset: 02c4 | |
| 155 | CPU0 PC 003588 unknown MCU read offset: 02c2 | |
| 156 | CPU0 PC 003594 unknown MCU read offset: 02c1 | |
| 157 | CPU0 PC 0035a0 unknown MCU read offset: 02c3 | |
| 158 | CPU0 PC 0032a2 unknown MCU write offset: 0260 data: 9c6c | |
| 159 | CPU0 PC 0032a8 unknown MCU write offset: 0250 data: 0010 | |
| 160 | CPU0 PC 0032c8 unknown MCU write offset: 0261 data: 987c | |
| 161 | CPU0 PC 0032ce unknown MCU write offset: 0251 data: 0010 | |
| 162 | CPU0 PC 003422 unknown MCU write offset: 0280 data: 138e | |
| 163 | CPU0 PC 003428 unknown MCU read offset: 02da | |
| 164 | CPU0 PC 00342e unknown MCU read offset: 02d8 | |
| 165 | CPU0 PC 00346c unknown MCU write offset: 0280 data: 3bb0 | |
| 166 | CPU0 PC 0032a2 unknown MCU write offset: 0260 data: 987c | |
| 167 | CPU0 PC 0032a8 unknown MCU write offset: 0250 data: 0010 | |
| 168 | CPU0 PC 003306 unknown MCU write offset: 0280 data: 8100 | |
| 169 | CPU0 PC 00330c unknown MCU write offset: 0280 data: 8900 | |
| 170 | ||
| 171 | ||
| 172 | Mcu reads in attract in Heated Barrel game demo (note | |
| 173 | partial similarity) | |
| 174 | ||
| 175 | (i) This sequence repeats a number of times early on: | |
| 176 | ||
| 177 | CPU0 PC 0085b4 unknown MCU write offset: 0210 data: 0064 | |
| 178 | CPU0 PC 0085ba unknown MCU write offset: 0211 data: 0000 | |
| 179 | CPU0 PC 0085be unknown MCU read offset: 02ca | |
| 180 | CPU0 PC 0085ee unknown MCU read offset: 02c9 | |
| 181 | CPU0 PC 008622 unknown MCU read offset: 02c8 | |
| 182 | [Protection BCD,see protection_bcd_jsr()] | |
| 183 | ||
| 184 | (ii) This happens a few times: | |
| 185 | ||
| 186 | CPU0 PC 0017ac unknown MCU write offset: 0260 data: b6cc | |
| 187 | CPU0 PC 0017b2 unknown MCU write offset: 0250 data: 0010 | |
| 188 | CPU0 PC 0017d2 unknown MCU write offset: 0261 data: babc | |
| 189 | CPU0 PC 0017d8 unknown MCU write offset: 0251 data: 0010 | |
| 190 | CPU0 PC 00192c unknown MCU write offset: 0280 data: 138e | |
| 191 | CPU0 PC 001932 unknown MCU read offset: 02da | |
| 192 | CPU0 PC 001938 unknown MCU read offset: 02d8 | |
| 193 | CPU0 PC 001976 unknown MCU write offset: 0280 data: 3bb0 | |
| 194 | CPU0 PC 0017ac unknown MCU write offset: 0260 data: b6cc | |
| 195 | CPU0 PC 0017b2 unknown MCU write offset: 0250 data: 0010 | |
| 196 | CPU0 PC 0017d2 unknown MCU write offset: 0261 data: bb9c | |
| 197 | CPU0 PC 0017d8 unknown MCU write offset: 0251 data: 0010 | |
| 198 | CPU0 PC 00192c unknown MCU write offset: 0280 data: 138e | |
| 199 | CPU0 PC 001932 unknown MCU read offset: 02da | |
| 200 | CPU0 PC 001938 unknown MCU read offset: 02d8 | |
| 201 | CPU0 PC 001976 unknown MCU write offset: 0280 data: 3bb0 | |
| 202 | ||
| 203 | ||
| 204 | ||
| 205 | (iii) Later on this happens a lot: | |
| 206 | ||
| 207 | CPU0 PC 0017ac unknown MCU write offset: 0260 data: c61c | |
| 208 | CPU0 PC 0017b2 unknown MCU write offset: 0250 data: 0010 | |
| 209 | CPU0 PC 0017d2 unknown MCU write offset: 0261 data: bb9c | |
| 210 | CPU0 PC 0017d8 unknown MCU write offset: 0251 data: 0010 | |
| 211 | CPU0 PC 001a5c unknown MCU write offset: 0262 data: aa48 | |
| 212 | CPU0 PC 001a62 unknown MCU write offset: 0252 data: 0003 | |
| 213 | CPU0 PC 001a7c unknown MCU write offset: 0263 data: a0c8 | |
| 214 | CPU0 PC 001a82 unknown MCU write offset: 0253 data: 0003 | |
| 215 | CPU0 PC 001a86 unknown MCU write offset: 0280 data: a100 | |
| 216 | CPU0 PC 001a8c unknown MCU write offset: 0280 data: b080 | |
| 217 | CPU0 PC 001a92 unknown MCU write offset: 0280 data: a900 | |
| 218 | CPU0 PC 001a98 unknown MCU write offset: 0280 data: b880 | |
| 219 | CPU0 PC 001a9e unknown MCU read offset: 02c0 | |
| 220 | CPU0 PC 001aa6 unknown MCU read offset: 02c2 | |
| 221 | CPU0 PC 001ab2 unknown MCU read offset: 02c1 | |
| 222 | ||
| 223 | write to $500 these values to determine the kind of sub-routine to do | |
| 224 | hit_check | |
| 225 | a180 | |
| 226 | a980 | |
| 227 | b100 | |
| 228 | b900 | |
| 229 | || b880 (heatbrl) | |
| 230 | ||
| 231 | movement protection | |
| 232 | 8100 | |
| 233 | 8900 | |
| 234 | ||
| 235 | 00DB2A: D6A8 0048 add.l ($48,A0), D3 | |
| 236 | 00DB2E: D8A8 0044 add.l ($44,A0), D4 | |
| 237 | 00DB32: 0C83 FFF0 0000 cmpi.l #-$100000, D3 | |
| 238 | 00DB38: 6D2E blt $db68 | |
| 239 | 00DB3A: 0C83 0100 0000 cmpi.l #$1000000, D3 | |
| 240 | 00DB40: 6C26 bge $db68 | |
| 241 | 00DB42: 2143 003C move.l D3, ($3c,A0) | |
| 242 | 00DB46: 0C84 FFF0 0000 cmpi.l #-$100000, D4 | |
| 243 | 00DB4C: 6D1A blt $db68 | |
| 244 | 00DB4E: 0C84 0100 0000 cmpi.l #$1000000, D4 | |
| 245 | 00DB54: 6E12 bgt $db68 | |
| 246 | 00DB56: 2144 0038 move.l D4, ($38,A0) | |
| 247 | 00DB5A: 3168 003C 0022 move.w ($3c,A0), ($22,A0) | |
| 248 | 00DB60: 3168 0038 0024 move.w ($38,A0), ($24,A0) | |
| 249 | 00DB66: 4E75 rts | |
| 250 | ||
| 251 | ||
| 252 | sprite DMA | |
| 253 | ||
| 254 | */ | |
| 255 | 147 | /*Movement protection*//*Legionnaire,Heated Barrel*/ |
| 256 | static UINT32 | |
| 148 | static UINT32 c | |
| 257 | 149 | /*Sprite DMA protection*//*SD Gundam*/ |
| 258 | 150 | static UINT8 dma_status; |
| 259 | static UINT32 dma_src | |
| 151 | static UINT32 dma_src | |
| 260 | 152 | static UINT16 prot_data[2],dma_size; |
| 261 | 153 | /*Number protection*//*Heated Barrel,SD Gundam,Godzilla,Denjin Makai*/ |
| 262 | 154 | static UINT32 prot_bcd[4]; |
| 263 | 155 | /*Hit check protection*//*Legionnaire,Heated Barrel,SD Gundam*/ |
| 264 | 156 | static UINT8 xy_check; |
| 265 | static UINT32 hit_check_x,hit_check_y; | |
| 266 | 157 | |
| 267 | 158 | |
| 268 | 159 | |
| 160 | ||
| 269 | 161 | #define CRT_MODE(_x_,_y_,_flip_) \ |
| 270 | 162 | { \ |
| 271 | 163 | rectangle visarea = *video_screen_get_visible_area(machine->primary_screen); \ |
| r2418 | r2419 | |
| 370 | 262 | program_write_word(work_ram+0x4,y_data); |
| 371 | 263 | } |
| 372 | 264 | |
| 373 | #ifdef UNUSED_FUNCTION | |
| 374 | static void protection_move2_jsr(void) | |
| 375 | { | |
| 376 | // static UINT32 move_data; | |
| 377 | // popmessage("%08x %08x %08x %08x",ram_addr[0],ram_addr[1],rom_addr[0],rom_addr[1]); | |
| 378 | } | |
| 379 | #endif | |
| 380 | 265 | |
| 381 | 266 | static UINT16 hit_check; |
| 382 | 267 | |
| r2418 | r2419 | |
| 406 | 291 | { |
| 407 | 292 | static INT16 x_axis,y_axis; |
| 408 | 293 | static UINT16 move_data,distance,move_type; |
| 409 | move_data = program_read_word(ram_addr[0]+0x36); | |
| 410 | x_axis = program_read_word(ram_addr[0]+0x08); | |
| 411 | y_axis = program_read_word(ram_addr[0]+0x04); | |
| 294 | move_data = program_read_word(cop_register[0]+0x36); | |
| 295 | x_axis = program_read_word(cop_register[0]+0x08); | |
| 296 | y_axis = program_read_word(cop_register[0]+0x04); | |
| 412 | 297 | |
| 413 | 298 | distance = (move_data & 0xf); |
| 414 | 299 | move_type = (move_data & 0xf0)>>4; |
| 415 | 300 | switch(move_type) |
| 416 | 301 | { |
| 417 | 302 | case 0x0f://right |
| 418 | program_write_word( | |
| 303 | program_write_word(cop_register[0]+0x08,x_axis+distance); | |
| 419 | 304 | //program_write_word(0x110004,); |
| 420 | 305 | break; |
| 421 | 306 | case 0x0b://up |
| 422 | program_write_word( | |
| 307 | program_write_word(cop_register[0]+0x04,y_axis-distance); | |
| 423 | 308 | break; |
| 424 | 309 | case 0x07://left |
| 425 | program_write_word( | |
| 310 | program_write_word(cop_register[0]+0x08,x_axis-distance); | |
| 426 | 311 | break; |
| 427 | 312 | case 0x03://down |
| 428 | program_write_word( | |
| 313 | program_write_word(cop_register[0]+0x04,y_axis+distance); | |
| 429 | 314 | break; |
| 430 | 315 | case 0x0d://up-right |
| 431 | program_write_word(ram_addr[0]+0x08,x_axis+distance); | |
| 432 | program_write_word(ram_addr[0]+0x04,y_axis-distance); | |
| 316 | program_write_word(cop_register[0]+0x08,x_axis+distance); | |
| 317 | program_write_word(cop_register[0]+0x04,y_axis-distance); | |
| 433 | 318 | break; |
| 434 | 319 | case 0x09://up-left |
| 435 | program_write_word(ram_addr[0]+0x04,y_axis-distance); | |
| 436 | program_write_word(ram_addr[0]+0x08,x_axis-distance); | |
| 320 | program_write_word(cop_register[0]+0x04,y_axis-distance); | |
| 321 | program_write_word(cop_register[0]+0x08,x_axis-distance); | |
| 437 | 322 | break; |
| 438 | 323 | case 0x01://down-right |
| 439 | program_write_word(ram_addr[0]+0x04,y_axis+distance); | |
| 440 | program_write_word(ram_addr[0]+0x08,x_axis+distance); | |
| 324 | program_write_word(cop_register[0]+0x04,y_axis+distance); | |
| 325 | program_write_word(cop_register[0]+0x08,x_axis+distance); | |
| 441 | 326 | break; |
| 442 | 327 | case 0x05://down-left |
| 443 | program_write_word(ram_addr[0]+0x04,y_axis+distance); | |
| 444 | program_write_word(ram_addr[0]+0x08,x_axis-distance); | |
| 328 | program_write_word(cop_register[0]+0x04,y_axis+distance); | |
| 329 | program_write_word(cop_register[0]+0x08,x_axis-distance); | |
| 445 | 330 | break; |
| 446 | 331 | default: |
| 447 | 332 | logerror("Warning: \"0x205\" command called with move_type parameter = %02x\n",move_type); |
| r2418 | r2419 | |
| 471 | 356 | static void move2prot_jsr(void) |
| 472 | 357 | { |
| 473 | 358 | static INT16 x_pl,y_pl,x_en,y_en,res; |
| 474 | x_pl = program_read_word(ram_addr[1]+0x8); | |
| 475 | y_pl = program_read_word(ram_addr[1]+0x4); | |
| 476 | x_en = program_read_word(ram_addr[0]+0x8); | |
| 477 | y_en = program_read_word(ram_addr[0]+0x4); | |
| 359 | x_pl = program_read_word(cop_register[1]+0x8); | |
| 360 | y_pl = program_read_word(cop_register[1]+0x4); | |
| 361 | x_en = program_read_word(cop_register[0]+0x8); | |
| 362 | y_en = program_read_word(cop_register[0]+0x4); | |
| 478 | 363 | |
| 479 | 364 | res = 0; |
| 480 | 365 | if(x_en > x_pl) |
| r2418 | r2419 | |
| 486 | 371 | //if(y_en > y_pl) |
| 487 | 372 | // res|=0x40; |
| 488 | 373 | |
| 489 | program_write_word( | |
| 374 | program_write_word(cop_register[0]+0x36,res); | |
| 490 | 375 | } |
| 491 | 376 | |
| 492 | 377 | #ifdef UNUSED_FUNCTION |
| r2418 | r2419 | |
| 494 | 379 | static void move3x_prot_jsr(void) |
| 495 | 380 | { |
| 496 | 381 | static INT16 x_pl,x_en,x_dis; |
| 497 | x_pl = program_read_word(ram_addr[1]+0x8); | |
| 498 | x_en = program_read_word(ram_addr[0]+0x8); | |
| 499 | x_dis = ((program_read_word(ram_addr[0]+0x34) & 0xf0) >> 4); | |
| 382 | x_pl = program_read_word(cop_register[1]+0x8); | |
| 383 | x_en = program_read_word(cop_register[0]+0x8); | |
| 384 | x_dis = ((program_read_word(cop_register[0]+0x34) & 0xf0) >> 4); | |
| 500 | 385 | |
| 501 | 386 | if(x_en > x_pl) |
| 502 | 387 | x_dis^=0xffff; |
| 503 | 388 | |
| 504 | program_write_word(ram_addr[0]+0x36,-0x40);/*enable command*/ | |
| 505 | program_write_word(ram_addr[0]+0x14,x_dis); | |
| 389 | program_write_word(cop_register[0]+0x36,-0x40);/*enable command*/ | |
| 390 | program_write_word(cop_register[0]+0x14,x_dis); | |
| 506 | 391 | } |
| 507 | 392 | |
| 508 | 393 | static void move3y_prot_jsr(void) |
| 509 | 394 | { |
| 510 | 395 | static INT16 y_pl,y_en,y_dis; |
| 511 | y_pl = program_read_word(ram_addr[1]+0x4); | |
| 512 | y_en = program_read_word(ram_addr[0]+0x4); | |
| 513 | y_dis = (program_read_word(ram_addr[0]+0x34) & 0xf); | |
| 396 | y_pl = program_read_word(cop_register[1]+0x4); | |
| 397 | y_en = program_read_word(cop_register[0]+0x4); | |
| 398 | y_dis = (program_read_word(cop_register[0]+0x34) & 0xf); | |
| 514 | 399 | |
| 515 | 400 | if(y_en > y_pl) |
| 516 | 401 | y_dis^=0xffff; |
| 517 | 402 | |
| 518 | program_write_word(ram_addr[0]+0x36,-0x80);/*enable command*/ | |
| 519 | program_write_word(ram_addr[0]+0x10,y_dis); | |
| 403 | program_write_word(cop_register[0]+0x36,-0x80);/*enable command*/ | |
| 404 | program_write_word(cop_register[0]+0x10,y_dis); | |
| 520 | 405 | } |
| 521 | 406 | #endif |
| 522 | 407 | |
| 523 | 408 | |
| 524 | READ16_HANDLER( legionna_mcu_r ) | |
| 525 | { | |
| 526 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 527 | 409 | |
| 528 | switch (offset) | |
| 529 | { | |
| 530 | default: | |
| 531 | { | |
| 532 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 533 | return retvalue; | |
| 534 | } | |
| 535 | 410 | |
| 536 | /********************************************************************* | |
| 537 | 400-5ff - Protection reads | |
| 538 | *********************************************************************/ | |
| 539 | 411 | |
| 540 | case (0x470/2): return (mame_rand(machine) &0xffff); /* read PC $110a, could be some sort of control word: sometimes a bit is changed then it's poked back in... */ | |
| 541 | case (0x582/2): return (0); /* read PC $3594 */ | |
| 542 | case (0x584/2): return (0); /* read PC $3588 */ | |
| 543 | case (0x586/2): return (0); /* read PC $35a0 */ | |
| 544 | case (0x588/2): return hit_check; /* read PC $3580 */ | |
| 545 | case (0x5b0/2): return (0); /* bit 15 is branched on a few times in the $3300 area */ | |
| 546 | case (0x5b4/2): return (0); /* read and stored in ram before +0x5b0 bit 15 tested */ | |
| 547 | 412 | |
| 548 | ||
| 549 | /********************************************************************* | |
| 550 | 700-7ff - Non-protection reads | |
| 551 | *********************************************************************/ | |
| 552 | ||
| 553 | /* Seibu Sound System */ | |
| 554 | case (0x708/2): return seibu_main_word_r(machine,2,0); | |
| 555 | case (0x70c/2): return seibu_main_word_r(machine,3,0); | |
| 556 | case (0x714/2): return seibu_main_word_r(machine,5,0); | |
| 557 | ||
| 558 | /* Inputs */ | |
| 559 | case (0x740/2): return input_port_1_word_r(machine,0,0); | |
| 560 | case (0x744/2): return input_port_2_word_r(machine,0,0); | |
| 561 | case (0x748/2): return input_port_0_word_r(machine,0,0); | |
| 562 | case (0x74c/2): return input_port_3_word_r(machine,0,0); | |
| 563 | ||
| 564 | } | |
| 565 | } | |
| 566 | ||
| 567 | ||
| 568 | WRITE16_HANDLER( legionna_mcu_w ) | |
| 569 | { | |
| 570 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 571 | ||
| 572 | switch (offset) | |
| 573 | { | |
| 574 | default: | |
| 575 | { | |
| 576 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 577 | break; | |
| 578 | } | |
| 579 | ||
| 580 | /********************************************************************* | |
| 581 | 400-5ff - Protection writes | |
| 582 | *********************************************************************/ | |
| 583 | ||
| 584 | /* Trigger Table upload */ | |
| 585 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 586 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 587 | case (0x438/2): { cop_438 = data; break; } | |
| 588 | case (0x43a/2): { cop_43a = data; break; } | |
| 589 | case (0x43c/2): { cop_43c = data; break; } | |
| 590 | ||
| 591 | /* Registers */ | |
| 592 | case (0x4c0/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 593 | case (0x4a0/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 594 | case (0x4c2/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 595 | case (0x4a2/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 596 | case (0x4c4/2): { prot_data[0] = cop_mcu_ram[offset]; rom_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 597 | case (0x4a4/2): { prot_data[1] = cop_mcu_ram[offset]; rom_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 598 | case (0x4c6/2): { prot_data[0] = cop_mcu_ram[offset]; rom_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 599 | case (0x4a6/2): { prot_data[1] = cop_mcu_ram[offset]; rom_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 600 | ||
| 601 | /* Execute Macro command from table */ | |
| 602 | case (0x500/2): | |
| 603 | { | |
| 604 | /*Movement protection*/ | |
| 605 | if(cop_mcu_ram[0x500/2] == 0x8900 || cop_mcu_ram[0x500/2] == 0x0205) | |
| 606 | { | |
| 607 | static UINT16 xy_data[2]; | |
| 608 | static UINT8 k; | |
| 609 | xy_data[0] = program_read_word(rom_addr[0]); | |
| 610 | xy_data[1] = program_read_word(rom_addr[1]); | |
| 611 | k = (cop_mcu_ram[0x500/2] == 0x0205) ? ENEMY : PLAYER; | |
| 612 | protection_move_jsr(ram_addr[0],k); | |
| 613 | //protection_move_jsr(ram_addr[1]); //??? | |
| 614 | //popmessage("%08x %08x %04x %04x",ram_addr[0],ram_addr[1],xy_data[0],xy_data[1]); | |
| 615 | } | |
| 616 | else if(cop_mcu_ram[0x500/2] == 0x3bb0 || cop_mcu_ram[0x500/2] == 0x138e) | |
| 617 | { | |
| 618 | protection_hit_jsr(ram_addr[0],ram_addr[1]); | |
| 619 | } | |
| 620 | break; | |
| 621 | } | |
| 622 | ||
| 623 | /********************************************************************* | |
| 624 | 600-6ff - Video Registers | |
| 625 | *********************************************************************/ | |
| 626 | ||
| 627 | // 61a bit 0 is flipscreen | |
| 628 | // 61c probably layer disables, like Dcon | |
| 629 | ||
| 630 | case (0x620/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 631 | case (0x622/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 632 | case (0x624/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 633 | case (0x626/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 634 | case (0x628/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 635 | case (0x62a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 636 | ||
| 637 | /********************************************************************* | |
| 638 | 700-7ff - Output (Seibu Sound System) | |
| 639 | *********************************************************************/ | |
| 640 | ||
| 641 | case (0x700/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 642 | case (0x704/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 643 | case (0x710/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 644 | case (0x718/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 645 | } | |
| 646 | } | |
| 647 | ||
| 648 | ||
| 649 | ||
| 650 | 413 | /* |
| 651 | 414 | player-1 priorities list: |
| 652 | 415 | 1086d8: show this sprite (bit 15) |
| r2418 | r2419 | |
| 754 | 517 | /*Sprite Color*/ |
| 755 | 518 | param = program_read_word(0x100400) & 0x3f; |
| 756 | 519 | /*Write the entire parameters [offs+0]*/ |
| 757 | program_write_word( | |
| 520 | program_write_word(cop_register[5]+4,program_read_word(dma_src) + param); | |
| 758 | 521 | /*Sprite Priority (guess)*/ |
| 759 | 522 | //param = ((program_read_word(0x100400) & 0x40) ? 0x4000 : 0); |
| 760 | 523 | /*Write the sprite number [offs+1]*/ |
| 761 | program_write_word( | |
| 524 | program_write_word(cop_register[5]+6,program_read_word(dma_src+2)); | |
| 762 | 525 | /*Sprite Relative x/y coords*/ |
| 763 | 526 | rel_xy = program_read_word(dma_src+4); /*???*/ |
| 764 | 527 | /*temporary hardwired,it should point to 0x4c0/0x4a0*/ |
| 765 | 528 | abs_x = (program_read_word(0x110008) - program_read_word(0x10048e)); |
| 766 | 529 | abs_y = (program_read_word(0x110004) - program_read_word(0x10048c)); |
| 767 | program_write_word(dma_dst+4,((rel_xy & 0x7f) + (abs_x) - ((rel_xy & 0x80) ? 0x80 : 0)) & 0x1ff); | |
| 768 | program_write_word(dma_dst+6,(((rel_xy & 0x7f00) >> 8) + (abs_y) + (0x10) - ((rel_xy & 0x8000) ? 0x80 : 0)) & 0x1ff); | |
| 769 | dma_dst+=8; | |
| 530 | program_write_word(cop_register[5]+8,((rel_xy & 0x7f) + (abs_x) - ((rel_xy & 0x80) ? 0x80 : 0)) & 0x1ff); | |
| 531 | program_write_word(cop_register[5]+10,(((rel_xy & 0x7f00) >> 8) + (abs_y) + (0x10) - ((rel_xy & 0x8000) ? 0x80 : 0)) & 0x1ff); | |
| 532 | cop_register[5]+=8; | |
| 770 | 533 | dma_src+=6; |
| 771 | 534 | } |
| 772 | 535 | } |
| 773 | 536 | |
| 774 | 537 | |
| 775 | 538 | /* |
| 776 | switch(program_read_word( | |
| 539 | switch(program_read_word(cop_regist | |
| 777 | 540 | { |
| 778 | 541 | case 0xb4: xparam = 0x0c/2; break; |
| 779 | 542 | case 0xb8: xparam = 0x10/2; break; |
| r2418 | r2419 | |
| 810 | 573 | |
| 811 | 574 | /*Here we check the destination sprite width*/ |
| 812 | 575 | /*0x4a4/0x4c4*/ |
| 813 | xparam = check_calc(program_read_word( | |
| 576 | xparam = check_calc(program_read_word(cop_regist | |
| 814 | 577 | /*Here we check the destination sprite height*/ |
| 815 | 578 | /*0x4a6/0x4c6*/ |
| 816 | yparam = check_calc(program_read_word( | |
| 579 | yparam = check_calc(program_read_word(cop_regist | |
| 817 | 580 | |
| 818 | 581 | if(!xparam || !yparam) |
| 819 | popmessage("SRC:%04x %04x DST:%04x %04x V:%08x %08x",xsrc,ysrc,xdst,ydst,program_read_word( | |
| 582 | popmessage("SRC:%04x %04x DST:%04x %04x V:%08x %08x",xsrc,ysrc,xdst,ydst,program_read_word(cop_regist | |
| 820 | 583 | if(xdst >= (xsrc-xparam) && ydst >= (ysrc-yparam) && |
| 821 | 584 | xdst <= (xsrc+xparam) && ydst <= (ysrc+yparam)) |
| 822 | 585 | return 0;//sprites collide |
| r2418 | r2419 | |
| 842 | 605 | static INT16 y_pl,y_en; |
| 843 | 606 | static INT16 x_dis,y_dis; |
| 844 | 607 | static INT16 dir,dis; |
| 845 | x_pl = program_read_word(ram_addr[1]+0x8); | |
| 846 | x_en = program_read_word(ram_addr[0]+0x8); | |
| 847 | dis = ((program_read_word(ram_addr[0]+0x34) & 0xf0) >> 4); | |
| 848 | y_pl = program_read_word(ram_addr[1]+0x4); | |
| 849 | y_en = program_read_word(ram_addr[0]+0x4); | |
| 608 | x_pl = program_read_word(cop_register[1]+0x8); | |
| 609 | x_en = program_read_word(cop_register[0]+0x8); | |
| 610 | dis = ((program_read_word(cop_register[0]+0x34) & 0xf0) >> 4); | |
| 611 | y_pl = program_read_word(cop_register[1]+0x4); | |
| 612 | y_en = program_read_word(cop_register[0]+0x4); | |
| 850 | 613 | |
| 851 | 614 | /* |
| 852 | 615 | xxxx ---- select the direction of the enemy sprite |
| r2418 | r2419 | |
| 885 | 648 | dir = DOWN; |
| 886 | 649 | } |
| 887 | 650 | |
| 888 | program_write_word( | |
| 651 | program_write_word(cop_register[0]+0x36,dir); | |
| 889 | 652 | |
| 890 | 653 | /*TODO*/ |
| 891 | 654 | x_dis = (x_pl-x_en); |
| r2418 | r2419 | |
| 909 | 672 | //if(x_en > x_pl) |
| 910 | 673 | // x_dis^=0xffff; |
| 911 | 674 | |
| 912 | program_write_word(ram_addr[0]+0x10,y_dis); | |
| 913 | program_write_word(ram_addr[0]+0x14,x_dis); | |
| 675 | program_write_word(cop_register[0]+0x10,y_dis); | |
| 676 | program_write_word(cop_register[0]+0x14,x_dis); | |
| 914 | 677 | } |
| 915 | 678 | |
| 916 | 679 | /**/ |
| r2418 | r2419 | |
| 922 | 685 | static INT16 param1,param2; |
| 923 | 686 | static INT16 val; |
| 924 | 687 | |
| 925 | param1 = program_read_word(rom_addr[0]); | |
| 926 | param2 = program_read_word(rom_addr[1]); | |
| 688 | param1 = program_read_word(cop_register[2]); | |
| 689 | param2 = program_read_word(cop_register[3]); | |
| 927 | 690 | |
| 928 | xsrc = program_read_word(ram_addr[0]+0x8) + program_read_word(ram_addr[0]+0x14); | |
| 929 | ysrc = program_read_word(ram_addr[0]+0x4) + program_read_word(ram_addr[0]+0x10); | |
| 930 | xdst = program_read_word(ram_addr[1]+0x8) + program_read_word(ram_addr[1]+0x14); | |
| 931 | ydst = program_read_word(ram_addr[1]+0x4) + program_read_word(ram_addr[1]+0x10); | |
| 691 | xsrc = program_read_word(cop_register[0]+0x8) + program_read_word(cop_register[0]+0x14); | |
| 692 | ysrc = program_read_word(cop_register[0]+0x4) + program_read_word(cop_register[0]+0x10); | |
| 693 | xdst = program_read_word(cop_register[1]+0x8) + program_read_word(cop_register[1]+0x14); | |
| 694 | ydst = program_read_word(cop_register[1]+0x4) + program_read_word(cop_register[1]+0x10); | |
| 932 | 695 | |
| 933 | 696 | // xp = (param1 & 0x00f0) >> 4; |
| 934 | 697 | // yp = (param1 & 0x0f00) >> 8; |
| r2418 | r2419 | |
| 958 | 721 | static INT16 xsrc,ysrc; |
| 959 | 722 | static INT16 param2; |
| 960 | 723 | |
| 961 | xsrc = program_read_word(ram_addr[0]+0x14); | |
| 962 | ysrc = program_read_word(ram_addr[0]+0x10); | |
| 963 | param2 = program_read_word(rom_addr[1]); | |
| 724 | xsrc = program_read_word(cop_register[0]+0x14); | |
| 725 | ysrc = program_read_word(cop_register[0]+0x10); | |
| 726 | param2 = program_read_word(cop_register[3]); | |
| 964 | 727 | |
| 965 | 728 | switch(param2) |
| 966 | 729 | { |
| r2418 | r2419 | |
| 974 | 737 | case 0x18: ysrc++; xsrc++; break; //down-right |
| 975 | 738 | } |
| 976 | 739 | |
| 977 | program_write_word(ram_addr[0]+0x14,xsrc); | |
| 978 | program_write_word(ram_addr[0]+0x10,ysrc); | |
| 740 | program_write_word(cop_register[0]+0x14,xsrc); | |
| 741 | program_write_word(cop_register[0]+0x10,ysrc); | |
| 979 | 742 | } |
| 980 | 743 | |
| 981 | /****************************************************************************************** | |
| 982 | Heated Barrel Specific | |
| 983 | ******************************************************************************************/ | |
| 984 | 744 | |
| 985 | READ16_HANDLER( heatbrl_mcu_r ) | |
| 986 | { | |
| 987 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 988 | 745 | |
| 989 | switch (offset) | |
| 990 | { | |
| 991 | default: | |
| 992 | { | |
| 993 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 994 | return retvalue; | |
| 995 | } | |
| 996 | 746 | |
| 997 | /********************************************************************* | |
| 998 | 400-5ff - Protection reads | |
| 999 | *********************************************************************/ | |
| 1000 | ||
| 1001 | case (0x580/2): { return xy_check; } /*hit protection*/ | |
| 1002 | case (0x582/2): { if(input_code_pressed(KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1003 | case (0x584/2): { if(input_code_pressed(KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1004 | ||
| 1005 | case (0x590/2): { return ((prot_bcd[0] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1006 | case (0x592/2): { return ((prot_bcd[0] & 0xffff0000) >> 16) + 0x3030; } | |
| 1007 | case (0x594/2): { return ((prot_bcd[1] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1008 | case (0x596/2): { return ((prot_bcd[1] & 0xffff0000) >> 16) + 0x3030; } | |
| 1009 | case (0x598/2): { return ((prot_bcd[2] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1010 | case (0x59a/2): { return ((prot_bcd[2] & 0xffff0000) >> 16) + 0x3030; } | |
| 1011 | case (0x59c/2): { return 0x3030; } | |
| 1012 | ||
| 1013 | //case (0x5b0/2): return (cop_mcu_ram[offset]); /* bit 15 is branched on a few times in the $1938 area */ | |
| 1014 | case (0x5b4/2): return (0); /* read at $1932 and stored in ram before +0x5b0 bit 15 tested */ | |
| 1015 | ||
| 1016 | /********************************************************************* | |
| 1017 | 700-7ff - Non-protection reads | |
| 1018 | *********************************************************************/ | |
| 1019 | ||
| 1020 | /* Seibu Sound System */ | |
| 1021 | case (0x7c8/2): return seibu_main_word_r(machine,2,0); | |
| 1022 | case (0x7cc/2): return seibu_main_word_r(machine,3,0); | |
| 1023 | case (0x7d4/2): return seibu_main_word_r(machine,5,0); | |
| 1024 | ||
| 1025 | /* Inputs */ | |
| 1026 | case (0x740/2): return input_port_1_word_r(machine,0,0); | |
| 1027 | case (0x744/2): return input_port_2_word_r(machine,0,0); | |
| 1028 | case (0x748/2): return input_port_4_word_r(machine,0,0); | |
| 1029 | case (0x74c/2): return input_port_3_word_r(machine,0,0); | |
| 1030 | ||
| 1031 | } | |
| 1032 | } | |
| 1033 | ||
| 1034 | WRITE16_HANDLER( heatbrl_mcu_w ) | |
| 1035 | { | |
| 1036 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1037 | ||
| 1038 | switch (offset) | |
| 1039 | { | |
| 1040 | default: | |
| 1041 | { | |
| 1042 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1043 | break; | |
| 1044 | } | |
| 1045 | ||
| 1046 | /********************************************************************* | |
| 1047 | 400-5ff - Protection writes | |
| 1048 | *********************************************************************/ | |
| 1049 | ||
| 1050 | case (0x420/2): { prot_bcd[0] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1051 | case (0x422/2): { prot_bcd[1] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1052 | case (0x424/2): { prot_bcd[2] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1053 | ||
| 1054 | ||
| 1055 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 1056 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1057 | case (0x438/2): {cop_438 = data; break; } | |
| 1058 | case (0x43a/2): {cop_43a = data; break; } | |
| 1059 | case (0x43c/2): {cop_43c = data; break; } | |
| 1060 | ||
| 1061 | ||
| 1062 | /* Odd, this is a video register */ | |
| 1063 | case (0x470/2): { heatbrl_setgfxbank( cop_mcu_ram[offset] ); break; } | |
| 1064 | ||
| 1065 | /* Layer Clearing */ | |
| 1066 | case (0x478/2): | |
| 1067 | { | |
| 1068 | static UINT16 i; | |
| 1069 | /* | |
| 1070 | AM_RANGE(0x100800, 0x100fff) AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 1071 | AM_RANGE(0x101000, 0x1017ff) AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 1072 | AM_RANGE(0x101800, 0x101fff) AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 1073 | AM_RANGE(0x102000, 0x102fff) AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 1074 | */ | |
| 1075 | switch(cop_mcu_ram[offset]) | |
| 1076 | { | |
| 1077 | /*layer clearance*/ | |
| 1078 | case 0x4080: | |
| 1079 | /*text layer*/ | |
| 1080 | for(i=0;i<0x1000;i+=2) | |
| 1081 | program_write_word(i+0x102000,0x0000); | |
| 1082 | /*background layer*/ | |
| 1083 | for(i=0;i<0x800;i+=2) | |
| 1084 | program_write_word(i+0x100800,0x0000); | |
| 1085 | break; | |
| 1086 | case 0x4100: break; | |
| 1087 | case 0x41c0: break; | |
| 1088 | //default: popmessage("%04x",cop_mcu_ram[offset]); | |
| 1089 | } | |
| 1090 | break; | |
| 1091 | } | |
| 1092 | ||
| 1093 | /*sprite ram clear(Guess)*/ | |
| 1094 | case (0x47e/2): | |
| 1095 | { | |
| 1096 | static UINT16 i; | |
| 1097 | if(cop_mcu_ram[0x47e/2] == 0x118) | |
| 1098 | { | |
| 1099 | for(i=0;i<0x800;i+=2) | |
| 1100 | program_write_word((0x103000 | i),0x0000); | |
| 1101 | } | |
| 1102 | break; | |
| 1103 | } | |
| 1104 | ||
| 1105 | ||
| 1106 | /* Registers */ | |
| 1107 | case (0x4c0/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1108 | case (0x4a0/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1109 | case (0x4c2/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1110 | case (0x4a2/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1111 | case (0x4c4/2): { prot_data[0] = cop_mcu_ram[offset]; rom_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1112 | case (0x4a4/2): { prot_data[1] = cop_mcu_ram[offset]; rom_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1113 | case (0x4c6/2): { prot_data[0] = cop_mcu_ram[offset]; rom_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1114 | case (0x4a6/2): { prot_data[1] = cop_mcu_ram[offset]; rom_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1115 | ||
| 1116 | ||
| 1117 | /* Macros Command Trigger */ | |
| 1118 | case (0x500/2): | |
| 1119 | { | |
| 1120 | switch(cop_mcu_ram[0x500/2]) | |
| 1121 | { | |
| 1122 | case 0x8100: | |
| 1123 | break; | |
| 1124 | case 0x8900: | |
| 1125 | { | |
| 1126 | cop2_move3_prot(); | |
| 1127 | break; | |
| 1128 | } | |
| 1129 | case 0x205: | |
| 1130 | { | |
| 1131 | cop2_move2_prot(); | |
| 1132 | break; | |
| 1133 | } | |
| 1134 | case 0xa100: | |
| 1135 | break; | |
| 1136 | case 0xb080: | |
| 1137 | break; | |
| 1138 | case 0xa900: | |
| 1139 | break; | |
| 1140 | case 0xb880: | |
| 1141 | { | |
| 1142 | xy_check = cop2_hit_prot(); | |
| 1143 | break; | |
| 1144 | } | |
| 1145 | default: | |
| 1146 | logerror("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); | |
| 1147 | } | |
| 1148 | break; | |
| 1149 | } | |
| 1150 | ||
| 1151 | ||
| 1152 | /********************************************************************* | |
| 1153 | 600-6ff - Video Registers | |
| 1154 | *********************************************************************/ | |
| 1155 | ||
| 1156 | // 65a bit 0 is flipscreen | |
| 1157 | // 65c probably layer disables, like Dcon? Used on screen when you press P1-4 start (values 13, 11, 0 seen) | |
| 1158 | // 660 - 66a scroll control; is there a layer priority switch...? | |
| 1159 | case (0x660/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1160 | case (0x662/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1161 | case (0x664/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1162 | case (0x666/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1163 | case (0x668/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1164 | case (0x66a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1165 | ||
| 1166 | /********************************************************************* | |
| 1167 | 700-7ff - Output (Seibu Sound System) | |
| 1168 | *********************************************************************/ | |
| 1169 | ||
| 1170 | case (0x7c0/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1171 | case (0x7c4/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1172 | case (0x7d0/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1173 | case (0x7d8/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1174 | } | |
| 1175 | } | |
| 1176 | ||
| 1177 | ||
| 1178 | READ16_HANDLER( sdgndmrb_cop_mcu_r ) | |
| 1179 | { | |
| 1180 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 1181 | ||
| 1182 | switch (offset) | |
| 1183 | { | |
| 1184 | default: | |
| 1185 | { | |
| 1186 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 1187 | return retvalue; | |
| 1188 | } | |
| 1189 | ||
| 1190 | /*hit protection*/ | |
| 1191 | case (0x580/2): { return xy_check; } | |
| 1192 | ||
| 1193 | /* BCD protection */ | |
| 1194 | case (0x590/2): { return ((prot_bcd[0] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1195 | case (0x592/2): { return ((prot_bcd[0] & 0xffff0000) >> 16) + 0x3030; } | |
| 1196 | case (0x594/2): { return ((prot_bcd[1] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1197 | case (0x596/2): { return ((prot_bcd[1] & 0xffff0000) >> 16) + 0x3030; } | |
| 1198 | case (0x598/2): { return ((prot_bcd[2] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1199 | case (0x59a/2): { return ((prot_bcd[2] & 0xffff0000) >> 16) + 0x3030; } | |
| 1200 | case (0x59c/2): { return 0x3030; } | |
| 1201 | ||
| 1202 | case (0x5b0/2): | |
| 1203 | /*check if the DMA has been finished*/ | |
| 1204 | if(dma_status == 1) | |
| 1205 | { | |
| 1206 | dma_status = 0; | |
| 1207 | return 2; | |
| 1208 | } | |
| 1209 | return cop_mcu_ram[offset]; | |
| 1210 | ||
| 1211 | /* Non-protection reads */ | |
| 1212 | case (0x708/2): return seibu_main_word_r(machine,2,0); | |
| 1213 | case (0x70c/2): return seibu_main_word_r(machine,3,0); | |
| 1214 | case (0x714/2): return seibu_main_word_r(machine,5,0); | |
| 1215 | ||
| 1216 | /* Inputs */ | |
| 1217 | case (0x740/2): return input_port_1_word_r(machine,0,0); | |
| 1218 | case (0x744/2): return input_port_2_word_r(machine,0,0); | |
| 1219 | case (0x748/2): return input_port_4_word_r(machine,0,0); | |
| 1220 | case (0x74c/2): return input_port_3_word_r(machine,0,0); | |
| 1221 | case (0x75c/2): return input_port_5_word_r(machine,0,0); | |
| 1222 | } | |
| 1223 | } | |
| 1224 | ||
| 1225 | WRITE16_HANDLER( sdgndmrb_cop_mcu_w ) | |
| 1226 | { | |
| 1227 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1228 | ||
| 1229 | ||
| 1230 | switch (offset) | |
| 1231 | { | |
| 1232 | default: | |
| 1233 | { | |
| 1234 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1235 | break; | |
| 1236 | } | |
| 1237 | ||
| 1238 | /********************************************************************* | |
| 1239 | 400-5ff - Protection writes | |
| 1240 | *********************************************************************/ | |
| 1241 | ||
| 1242 | case (0x40c/2): { dma_size = cop_mcu_ram[offset]; break; } | |
| 1243 | ||
| 1244 | /*DMA source address*/ | |
| 1245 | case (0x412/2): { prot_data[1] = cop_mcu_ram[offset]; dma_src = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1246 | case (0x414/2): { prot_data[0] = cop_mcu_ram[offset]; dma_src = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1247 | ||
| 1248 | case (0x420/2): { prot_bcd[0] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1249 | case (0x422/2): { prot_bcd[1] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1250 | case (0x424/2): { prot_bcd[2] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1251 | ||
| 1252 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 1253 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1254 | case (0x438/2): {cop_438 = data; break; } | |
| 1255 | case (0x43a/2): {cop_43a = data; break; } | |
| 1256 | case (0x43c/2): {cop_43c = data; break; } | |
| 1257 | ||
| 1258 | case (0x478/2): | |
| 1259 | { | |
| 1260 | static UINT16 i; | |
| 1261 | /* | |
| 1262 | AM_RANGE(0x100800, 0x100fff) AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 1263 | AM_RANGE(0x101000, 0x1017ff) AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 1264 | AM_RANGE(0x101800, 0x101fff) AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 1265 | AM_RANGE(0x102000, 0x102fff) AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 1266 | */ | |
| 1267 | switch(cop_mcu_ram[offset]) | |
| 1268 | { | |
| 1269 | /*txt layer clearance*/ | |
| 1270 | case 0x4080: | |
| 1271 | for(i=0;i<0x1000;i+=2) | |
| 1272 | program_write_word(i+0x102000,0x0000); | |
| 1273 | break; | |
| 1274 | case 0x4100: break; | |
| 1275 | case 0x41c0: break; | |
| 1276 | //default: popmessage("%04x",cop_mcu_ram[offset]); | |
| 1277 | } | |
| 1278 | break; | |
| 1279 | } | |
| 1280 | ||
| 1281 | /*sprite ram clear(Guess)*/ | |
| 1282 | case (0x47e/2): | |
| 1283 | { | |
| 1284 | static UINT16 i; | |
| 1285 | if(cop_mcu_ram[0x47e/2] == 0x118) | |
| 1286 | { | |
| 1287 | for(i=0;i<0x800;i+=2) | |
| 1288 | program_write_word((0x107000 | i),0x0000); | |
| 1289 | } | |
| 1290 | break; | |
| 1291 | } | |
| 1292 | ||
| 1293 | /* MCU registers */ | |
| 1294 | case (0x4c0/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1295 | case (0x4a0/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1296 | case (0x4c2/2): { prot_data[0] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1297 | case (0x4a2/2): { prot_data[1] = cop_mcu_ram[offset]; ram_addr[1] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1298 | case (0x4c4/2): { prot_data[0] = cop_mcu_ram[offset]; hit_check_x = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1299 | case (0x4a4/2): { prot_data[1] = cop_mcu_ram[offset]; hit_check_x = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1300 | case (0x4c6/2): { prot_data[0] = cop_mcu_ram[offset]; hit_check_y = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1301 | case (0x4a6/2): { prot_data[1] = cop_mcu_ram[offset]; hit_check_y = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1302 | case (0x4c8/2): { prot_data[0] = cop_mcu_ram[offset]; dma_dst = ((prot_data[0]&0xffff)+4)|((prot_data[1]&0xffff)<<16); break; } | |
| 1303 | case (0x4a8/2): { prot_data[1] = cop_mcu_ram[offset]; dma_dst = ((prot_data[0]&0xffff)+4)|((prot_data[1]&0xffff)<<16); break; } | |
| 1304 | ||
| 1305 | /* Execute Macro Command */ | |
| 1306 | case (0x500/2): | |
| 1307 | { | |
| 1308 | switch(cop_mcu_ram[0x500/2]) | |
| 1309 | { | |
| 1310 | case 0xa180:/*do the job [1]*/ | |
| 1311 | { | |
| 1312 | //popmessage("%08x %08x %04x",dma_src,dma_dst,dma_size); | |
| 1313 | /*fix the offset for easier reading*/ | |
| 1314 | dma_src+=4; | |
| 1315 | //dma_dst+=4; | |
| 1316 | s_i = dma_size; | |
| 1317 | //dma_dst+=((program_read_word(0x110000) & 0x000f) * 8); | |
| 1318 | //program_write_word(0x1004c8,dma_dst & 0xffff); | |
| 1319 | //dma_status = 1; | |
| 1320 | break; | |
| 1321 | } | |
| 1322 | case 0xb100: | |
| 1323 | break; | |
| 1324 | case 0xa980: | |
| 1325 | break; | |
| 1326 | case 0xb900: | |
| 1327 | { | |
| 1328 | xy_check = hit_check_jsr(); | |
| 1329 | break; | |
| 1330 | } | |
| 1331 | /*bullet movement protection,conflicts with [3],will be worked out*/ | |
| 1332 | case 0x8100: | |
| 1333 | { | |
| 1334 | //move3x_prot_jsr(); | |
| 1335 | break; | |
| 1336 | } | |
| 1337 | case 0x8900: | |
| 1338 | { | |
| 1339 | //move3y_prot_jsr(); | |
| 1340 | break; | |
| 1341 | } | |
| 1342 | case 0x0205:/*do the job [3]*/ | |
| 1343 | { | |
| 1344 | moveprot_jsr(); | |
| 1345 | break; | |
| 1346 | } | |
| 1347 | case 0x138e:/*do the job [4]*/ | |
| 1348 | break; | |
| 1349 | case 0x3bb0: | |
| 1350 | { | |
| 1351 | move2prot_jsr(); | |
| 1352 | break; | |
| 1353 | } | |
| 1354 | default: | |
| 1355 | logerror("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); | |
| 1356 | } | |
| 1357 | break; | |
| 1358 | } | |
| 1359 | ||
| 1360 | case (0x502/2): | |
| 1361 | { | |
| 1362 | if(cop_mcu_ram[0x502/2] == 0xc480) | |
| 1363 | { | |
| 1364 | dma_transfer(); | |
| 1365 | s_i--; | |
| 1366 | if(s_i == 0) | |
| 1367 | dma_status = 1; | |
| 1368 | } | |
| 1369 | break; | |
| 1370 | } | |
| 1371 | ||
| 1372 | /*Layer Enable,bit wise active low*/ | |
| 1373 | case (0x61c/2): | |
| 1374 | { | |
| 1375 | /* | |
| 1376 | ---x ---- (used in test mode) | |
| 1377 | ---- x--- Text Layer | |
| 1378 | ---- -x-- Foreground Layer | |
| 1379 | ---- --x- Midground Layer | |
| 1380 | ---- ---x Background Layer | |
| 1381 | */ | |
| 1382 | sdgndmrb_pri_n = cop_mcu_ram[offset] & 0xf; | |
| 1383 | break; | |
| 1384 | } | |
| 1385 | ||
| 1386 | /* TODO: tilemaps x-axis are offset,we use a temporary kludge for now */ | |
| 1387 | case (0x620/2): { legionna_scrollram16[0] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1388 | case (0x622/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1389 | case (0x624/2): { legionna_scrollram16[2] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1390 | case (0x626/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1391 | case (0x628/2): { legionna_scrollram16[4] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1392 | case (0x62a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1393 | ||
| 1394 | /* scroll mirrors? */ | |
| 1395 | case (0x62c/2): | |
| 1396 | case (0x62e/2): | |
| 1397 | case (0x630/2): | |
| 1398 | case (0x632/2): | |
| 1399 | case (0x634/2): | |
| 1400 | case (0x636/2): | |
| 1401 | break; | |
| 1402 | ||
| 1403 | ||
| 1404 | /* Text Layer scroll registers */ | |
| 1405 | case (0x638/2): { legionna_scrollram16[6] = 0x38 + cop_mcu_ram[offset]; break; } | |
| 1406 | case (0x63a/2): { legionna_scrollram16[7] = cop_mcu_ram[offset]; break; } | |
| 1407 | /*C.R.T. Controller (note:game calls it OBJ register)*/ | |
| 1408 | case (0x644/2): | |
| 1409 | { | |
| 1410 | /* | |
| 1411 | data = setting | |
| 1412 | 0x01e = 320x256 | |
| 1413 | 0x0e1 = 320x256 REVERSE | |
| 1414 | 0x016 = 320x240 | |
| 1415 | 0x0e9 = 320x240 REVERSE | |
| 1416 | 0x004 = 320x224 | |
| 1417 | 0x10b = 320x224 REVERSE | |
| 1418 | It is like to be per cases and not per bits. | |
| 1419 | */ | |
| 1420 | switch(data) | |
| 1421 | { | |
| 1422 | case 0x0000: | |
| 1423 | case 0x0003: | |
| 1424 | case 0x001e: CRT_MODE(320,224,0); break; | |
| 1425 | case 0x00e1: CRT_MODE(320,224,1); break; | |
| 1426 | case 0x0016: CRT_MODE(320,256,0); break; | |
| 1427 | case 0x00e9: CRT_MODE(320,256,1); break; | |
| 1428 | case 0x0004: CRT_MODE(320,240,0); break; | |
| 1429 | case 0x00fb: CRT_MODE(320,240,1); break; | |
| 1430 | default: | |
| 1431 | #ifdef MAME_DEBUG | |
| 1432 | popmessage("Warning: Undefined CRT Mode %04x",data); | |
| 1433 | #endif | |
| 1434 | CRT_MODE(320,256,0); | |
| 1435 | } | |
| 1436 | } | |
| 1437 | break; | |
| 1438 | ||
| 1439 | /* Seems a mirror for the choices in the test menu... */ | |
| 1440 | case (0x67c/2): break; | |
| 1441 | case (0x680/2): break; | |
| 1442 | case (0x6fc/2): break; | |
| 1443 | ||
| 1444 | case (0x700/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1445 | case (0x704/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1446 | case (0x710/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1447 | case (0x718/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1448 | } | |
| 1449 | } | |
| 1450 | ||
| 1451 | READ16_HANDLER( denjinmk_cop_mcu_r ) | |
| 1452 | { | |
| 1453 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 1454 | ||
| 1455 | switch (offset) | |
| 1456 | { | |
| 1457 | default: | |
| 1458 | { | |
| 1459 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 1460 | return retvalue; | |
| 1461 | } | |
| 1462 | ||
| 1463 | /* BCD protection */ | |
| 1464 | case (0x590/2): { return ((prot_bcd[0] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1465 | case (0x592/2): { return ((prot_bcd[0] & 0xffff0000) >> 16) + 0x3030; } | |
| 1466 | case (0x594/2): { return ((prot_bcd[1] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1467 | case (0x596/2): { return ((prot_bcd[1] & 0xffff0000) >> 16) + 0x3030; } | |
| 1468 | case (0x598/2): { return ((prot_bcd[2] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1469 | case (0x59a/2): { return ((prot_bcd[2] & 0xffff0000) >> 16) + 0x3030; } | |
| 1470 | case (0x59c/2): { return 0x3030; } | |
| 1471 | ||
| 1472 | /* Non-protection reads */ | |
| 1473 | ||
| 1474 | case (0x708/2): return seibu_main_word_r(machine,2,0); | |
| 1475 | case (0x70c/2): return seibu_main_word_r(machine,3,0); | |
| 1476 | case (0x714/2): return seibu_main_word_r(machine,5,0); | |
| 1477 | ||
| 1478 | /* Inputs */ | |
| 1479 | case (0x740/2): return input_port_1_word_r(machine,0,0); | |
| 1480 | case (0x744/2): return input_port_2_word_r(machine,0,0); | |
| 1481 | case (0x748/2): return input_port_4_word_r(machine,0,0); | |
| 1482 | case (0x74c/2): return input_port_3_word_r(machine,0,0); | |
| 1483 | case (0x75c/2): return input_port_5_word_r(machine,0,0); | |
| 1484 | ||
| 1485 | } | |
| 1486 | } | |
| 1487 | ||
| 1488 | WRITE16_HANDLER( denjinmk_cop_mcu_w ) | |
| 1489 | { | |
| 1490 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1491 | ||
| 1492 | switch (offset) | |
| 1493 | { | |
| 1494 | default: | |
| 1495 | { | |
| 1496 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1497 | break; | |
| 1498 | } | |
| 1499 | ||
| 1500 | /********************************************************************* | |
| 1501 | 400-5ff - Protection writes | |
| 1502 | *********************************************************************/ | |
| 1503 | ||
| 1504 | case (0x420/2): { prot_bcd[0] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1505 | case (0x422/2): { prot_bcd[1] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1506 | case (0x424/2): { prot_bcd[2] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1507 | ||
| 1508 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 1509 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1510 | case (0x438/2): {cop_438 = data; break; } | |
| 1511 | case (0x43a/2): {cop_43a = data; break; } | |
| 1512 | case (0x43c/2): {cop_43c = data; break; } | |
| 1513 | ||
| 1514 | ||
| 1515 | /* again, strange, this is a video register */ | |
| 1516 | case (0x470/2): { denjinmk_setgfxbank( cop_mcu_ram[offset] ); break; } | |
| 1517 | ||
| 1518 | case (0x620/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1519 | case (0x622/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1520 | case (0x624/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1521 | case (0x626/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1522 | case (0x628/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1523 | case (0x62a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1524 | ||
| 1525 | case (0x700/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1526 | case (0x704/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1527 | case (0x710/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1528 | case (0x718/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1529 | } | |
| 1530 | } | |
| 1531 | ||
| 1532 | READ16_HANDLER( godzilla_cop_mcu_r ) | |
| 1533 | { | |
| 1534 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 1535 | ||
| 1536 | switch (offset) | |
| 1537 | { | |
| 1538 | default: | |
| 1539 | { | |
| 1540 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 1541 | return retvalue; | |
| 1542 | } | |
| 1543 | ||
| 1544 | /* BCD protection */ | |
| 1545 | case (0x590/2): { return ((prot_bcd[0] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1546 | case (0x592/2): { return ((prot_bcd[0] & 0xffff0000) >> 16) + 0x3030; } | |
| 1547 | case (0x594/2): { return ((prot_bcd[1] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1548 | case (0x596/2): { return ((prot_bcd[1] & 0xffff0000) >> 16) + 0x3030; } | |
| 1549 | case (0x598/2): { return ((prot_bcd[2] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1550 | case (0x59a/2): { return ((prot_bcd[2] & 0xffff0000) >> 16) + 0x3030; } | |
| 1551 | case (0x59c/2): { return 0x3030; } | |
| 1552 | ||
| 1553 | /* Non-protection reads */ | |
| 1554 | case (0x7c8/2): return seibu_main_word_r(machine,2,0); | |
| 1555 | case (0x7cc/2): return seibu_main_word_r(machine,3,0); | |
| 1556 | case (0x7d4/2): return seibu_main_word_r(machine,5,0); | |
| 1557 | ||
| 1558 | /* Inputs */ | |
| 1559 | case (0x740/2): return input_port_1_word_r(machine,0,0); | |
| 1560 | case (0x744/2): return input_port_2_word_r(machine,0,0); | |
| 1561 | case (0x748/2): return input_port_4_word_r(machine,0,0); | |
| 1562 | case (0x74c/2): return input_port_3_word_r(machine,0,0); | |
| 1563 | } | |
| 1564 | } | |
| 1565 | ||
| 1566 | WRITE16_HANDLER( godzilla_cop_mcu_w ) | |
| 1567 | { | |
| 1568 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1569 | ||
| 1570 | switch (offset) | |
| 1571 | { | |
| 1572 | default: | |
| 1573 | { | |
| 1574 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1575 | break; | |
| 1576 | } | |
| 1577 | ||
| 1578 | /********************************************************************* | |
| 1579 | 400-5ff - Protection writes | |
| 1580 | *********************************************************************/ | |
| 1581 | ||
| 1582 | case (0x420/2): { prot_bcd[0] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1583 | case (0x422/2): { prot_bcd[1] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1584 | case (0x424/2): { prot_bcd[2] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1585 | ||
| 1586 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 1587 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1588 | case (0x438/2): {cop_438 = data; break; } | |
| 1589 | case (0x43a/2): {cop_43a = data; break; } | |
| 1590 | case (0x43c/2): {cop_43c = data; break; } | |
| 1591 | ||
| 1592 | /* Layer Clear */ | |
| 1593 | case (0x478/2): | |
| 1594 | { | |
| 1595 | static UINT16 i; | |
| 1596 | /* | |
| 1597 | */ | |
| 1598 | switch(cop_mcu_ram[offset]) | |
| 1599 | { | |
| 1600 | /*txt layer clearance*/ | |
| 1601 | case 0x40a0: | |
| 1602 | for(i=0;i<0x1000;i+=2) | |
| 1603 | program_write_word(i+0x102800,0x0000); | |
| 1604 | break; | |
| 1605 | case 0x4040: break; | |
| 1606 | case 0x4140: break; | |
| 1607 | case 0x4180: break; | |
| 1608 | case 0x4100: break; | |
| 1609 | case 0x41c0: break; | |
| 1610 | //default: popmessage("%04x",cop_mcu_ram[offset]); | |
| 1611 | } | |
| 1612 | break; | |
| 1613 | } | |
| 1614 | ||
| 1615 | case (0x620/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1616 | case (0x622/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1617 | case (0x624/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1618 | case (0x626/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1619 | case (0x628/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1620 | case (0x62a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1621 | ||
| 1622 | case (0x7c0/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1623 | case (0x7c4/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1624 | case (0x7d0/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1625 | case (0x7d8/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1626 | } | |
| 1627 | } | |
| 1628 | ||
| 1629 | 747 | /******************************************************************************************** |
| 1630 | 748 | |
| 1631 | COPX simulation | |
| 1632 | - Seibu Cup Soccer | |
| 1633 | ||
| 1634 | *******************************************************************************************/ | |
| 1635 | ||
| 1636 | ||
| 1637 | READ16_HANDLER( copdx_0_r ) | |
| 1638 | { | |
| 1639 | UINT16 retvalue = cop_mcu_ram[offset]; | |
| 1640 | ||
| 1641 | switch(offset) | |
| 1642 | { | |
| 1643 | default: | |
| 1644 | { | |
| 1645 | logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 1646 | return retvalue; | |
| 1647 | } | |
| 1648 | ||
| 1649 | //case (0x47e/2): | |
| 1650 | //case (0x5b0/2): | |
| 1651 | //case (0x5b4/2): | |
| 1652 | // return cop_mcu_ram[offset]; | |
| 1653 | ||
| 1654 | case (0x700/2): return input_port_1_word_r(machine,0,0); | |
| 1655 | case (0x704/2): return input_port_2_word_r(machine,0,0); | |
| 1656 | case (0x708/2): return input_port_4_word_r(machine,0,0); | |
| 1657 | case (0x70c/2): return input_port_3_word_r(machine,0,0); | |
| 1658 | ||
| 1659 | case (0x71c/2): return input_port_5_word_r(machine,0,0); | |
| 1660 | case (0x748/2): return seibu_main_word_r(machine,2,0); | |
| 1661 | case (0x74c/2): return seibu_main_word_r(machine,3,0); | |
| 1662 | case (0x754/2): return seibu_main_word_r(machine,5,0); | |
| 1663 | } | |
| 1664 | } | |
| 1665 | ||
| 1666 | static UINT16 cop_fct; | |
| 1667 | static UINT32 cop_reg[8]; | |
| 1668 | ||
| 1669 | /*This is version 1,so some stuff is different (less complex)*/ | |
| 1670 | static void cop_run(void) | |
| 1671 | { | |
| 1672 | switch(cop_fct) | |
| 1673 | { | |
| 1674 | /*???*/ | |
| 1675 | case 0x8100: | |
| 1676 | { | |
| 1677 | UINT32 src = cop_reg[0]; | |
| 1678 | program_write_word(src+0x36,0xffc0); | |
| 1679 | break; | |
| 1680 | } | |
| 1681 | case 0x8900: | |
| 1682 | { | |
| 1683 | UINT32 src = cop_reg[0]; | |
| 1684 | program_write_word(src+0x36,0xff80); | |
| 1685 | break; | |
| 1686 | } | |
| 1687 | /*Right*/ | |
| 1688 | case 0x0205: | |
| 1689 | { | |
| 1690 | UINT32 src = cop_reg[0]; | |
| 1691 | INT16 y = program_read_word(src+0x4); | |
| 1692 | INT16 x = program_read_word(src+0x8); | |
| 1693 | INT16 y_rel = program_read_word(src+0x10); | |
| 1694 | INT16 x_rel = program_read_word(src+0x14); | |
| 1695 | program_write_word(src+0x4,(y+y_rel)); | |
| 1696 | program_write_word(src+0x8,(x+x_rel)); | |
| 1697 | /*logerror("%08x %08x %08x %08x %08x\n",cop_reg[0], | |
| 1698 | program_read_word(cop_reg[0]+0x4), | |
| 1699 | program_read_word(cop_reg[0]+0x8), | |
| 1700 | program_read_word(cop_reg[0]+0x10), | |
| 1701 | program_read_word(cop_reg[0]+0x14));*/ | |
| 1702 | break; | |
| 1703 | } | |
| 1704 | /*???*/ | |
| 1705 | case 0x3bb0: | |
| 1706 | { | |
| 1707 | //UINT32 dst = cop_reg[0]; | |
| 1708 | //UINT32 dst = cop_reg[1]; | |
| 1709 | //program_write_word(dst, mame_rand(Machine)/*program_read_word(src)*/); | |
| 1710 | //program_write_word(dst+2,mame_rand(Machine)/*program_read_word(src+2)*/); | |
| 1711 | //program_write_word(dst+4,mame_rand(Machine)/*program_read_word(src+4)*/); | |
| 1712 | //program_write_word(dst+6,mame_rand(Machine)/*program_read_word(src+6)*/); | |
| 1713 | //logerror("%04x\n",cop_reg[0]); | |
| 1714 | break; | |
| 1715 | } | |
| 1716 | default: | |
| 1717 | //logerror("%04x\n",cop_fct); | |
| 1718 | break; | |
| 1719 | } | |
| 1720 | } | |
| 1721 | //tmp_data[1] = cop_mcu_ram[offset]; | |
| 1722 | //cop_reg[0] = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); | |
| 1723 | ||
| 1724 | static void cop_reg_w(UINT16 data,UINT8 offset,UINT8 mask) | |
| 1725 | { | |
| 1726 | if(mask) | |
| 1727 | cop_reg[offset] = ((data&0xffff)<<16) | (cop_reg[offset]&0xffff); | |
| 1728 | else | |
| 1729 | cop_reg[offset] = (cop_reg[offset]&0xffff0000) | (data&0xffff); | |
| 1730 | ||
| 1731 | //popmessage("%08x",cop_reg[offset]); | |
| 1732 | } | |
| 1733 | ||
| 1734 | WRITE16_HANDLER( copdx_0_w ) | |
| 1735 | { | |
| 1736 | ||
| 1737 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1738 | ||
| 1739 | switch(offset) | |
| 1740 | { | |
| 1741 | default: | |
| 1742 | { | |
| 1743 | logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1744 | break; | |
| 1745 | } | |
| 1746 | ||
| 1747 | /********************************************************************* | |
| 1748 | 400-5ff - Protection writes | |
| 1749 | *********************************************************************/ | |
| 1750 | ||
| 1751 | case (0x432/2): { copd2_set_tabledata(data, machine); break; } | |
| 1752 | case (0x434/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1753 | case (0x438/2): {cop_438 = data; break; } | |
| 1754 | case (0x43a/2): {cop_43a = data; break; } | |
| 1755 | case (0x43c/2): {cop_43c = data; break; } | |
| 1756 | ||
| 1757 | case (0x4a0/2): | |
| 1758 | case (0x4a2/2): | |
| 1759 | case (0x4a4/2): | |
| 1760 | case (0x4a6/2): | |
| 1761 | case (0x4a8/2): | |
| 1762 | case (0x4aa/2): | |
| 1763 | case (0x4ac/2): | |
| 1764 | case (0x4ae/2): | |
| 1765 | case (0x4c0/2): | |
| 1766 | case (0x4c2/2): | |
| 1767 | case (0x4c4/2): | |
| 1768 | case (0x4c6/2): | |
| 1769 | case (0x4c8/2): | |
| 1770 | case (0x4ca/2): | |
| 1771 | case (0x4cc/2): | |
| 1772 | case (0x4ce/2): | |
| 1773 | cop_reg_w(cop_mcu_ram[offset],offset & 0x000f, (offset < (0x4b0/2)) ? 1 : 0); | |
| 1774 | break; | |
| 1775 | /*layer clearance,but the bootleg doesn't send values,so this function is an | |
| 1776 | original left-over.*/ | |
| 1777 | case (0x478/2): | |
| 1778 | { | |
| 1779 | /* | |
| 1780 | AM_RANGE(0x100800, 0x100fff) AM_READWRITE(SMH_RAM,legionna_background_w) AM_BASE(&legionna_back_data) | |
| 1781 | AM_RANGE(0x101000, 0x1017ff) AM_READWRITE(SMH_RAM,legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 1782 | AM_RANGE(0x101800, 0x101fff) AM_READWRITE(SMH_RAM,legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 1783 | AM_RANGE(0x102000, 0x102fff) AM_READWRITE(SMH_RAM,legionna_text_w) AM_BASE(&legionna_textram) | |
| 1784 | */ | |
| 1785 | break; | |
| 1786 | } | |
| 1787 | ||
| 1788 | /* Trigger Macro Command */ | |
| 1789 | case (0x500/2): | |
| 1790 | { | |
| 1791 | cop_fct = cop_mcu_ram[offset]; | |
| 1792 | cop_run(); | |
| 1793 | break; | |
| 1794 | } | |
| 1795 | ||
| 1796 | /* Video Regs */ | |
| 1797 | case (0x604/2): | |
| 1798 | { | |
| 1799 | //C.R.T. Controller | |
| 1800 | /* | |
| 1801 | data = setting | |
| 1802 | 0x01e = 320x256 ---- ---x xxx- | |
| 1803 | 0x0e1 = 320x256 REVERSE ---- xxx- ---x | |
| 1804 | 0x016 = 320x240 ---- ---x -xx- | |
| 1805 | 0x0e9 = 320x240 REVERSE ---- xxx- x--x | |
| 1806 | 0x004 = 320x224 ---- ---- -x-- | |
| 1807 | 0x10b = 320x224 REVERSE ---x ---- x-xx | |
| 1808 | For now we use this by cases and not per bits. | |
| 1809 | */ | |
| 1810 | ||
| 1811 | switch(data) | |
| 1812 | { | |
| 1813 | case 0x0000: | |
| 1814 | case 0x001e: CRT_MODE(320,256,0); break; | |
| 1815 | case 0x00e1: CRT_MODE(320,256,1); break; | |
| 1816 | case 0x0016: CRT_MODE(320,240,0); break; | |
| 1817 | case 0x00e9: CRT_MODE(320,240,1); break; | |
| 1818 | case 0x0004: CRT_MODE(320,224,0); break; | |
| 1819 | case 0x010b: CRT_MODE(320,224,1); break; | |
| 1820 | default: | |
| 1821 | #ifdef MAME_DEBUG | |
| 1822 | popmessage("Warning: Undefined CRT Mode %04x",data); | |
| 1823 | #endif | |
| 1824 | CRT_MODE(320,256,0); | |
| 1825 | } | |
| 1826 | break; | |
| 1827 | } | |
| 1828 | /*TODO: what's going on here,some scroll values aren't sent in these locations | |
| 1829 | but somewhere else?*/ | |
| 1830 | case (0x62c/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1831 | case (0x62e/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1832 | case (0x630/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1833 | case (0x632/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1834 | case (0x634/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1835 | case (0x636/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1836 | case (0x638/2): { legionna_scrollram16[6] = cop_mcu_ram[offset]; break; } | |
| 1837 | case (0x63a/2): { legionna_scrollram16[7] = cop_mcu_ram[offset]; break; } | |
| 1838 | /*video regs (not scrollram,something else)*/ | |
| 1839 | //case (0x660/2): | |
| 1840 | //case (0x662/2): | |
| 1841 | //case (0x664/2): | |
| 1842 | //case (0x666/2): | |
| 1843 | //case (0x668/2): | |
| 1844 | //case (0x66a/2): | |
| 1845 | //case (0x66c/2): | |
| 1846 | //case (0x66e/2): | |
| 1847 | // break; | |
| 1848 | ||
| 1849 | case (0x740/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1850 | case (0x744/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1851 | case (0x750/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1852 | case (0x758/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1853 | } | |
| 1854 | } | |
| 1855 | ||
| 1856 | /******************************************************************************************** | |
| 1857 | ||
| 1858 | 749 | COPX bootleg simulation |
| 1859 | 750 | - Seibu Cup Soccer (bootleg) |
| 1860 | 751 | |
| r2418 | r2419 | |
| 1919 | 810 | case (0x4ca/2): |
| 1920 | 811 | case (0x4cc/2): |
| 1921 | 812 | case (0x4ce/2): |
| 1922 | cop_reg_w(cop_mcu_ram[offset],offset & 0x000f, (offset < (0x4b0/2)) ? 1 : 0); | |
| 813 | //cop_reg_w(cop_mcu_ram[offset],offset & 0x000f, (offset < (0x4b0/2)) ? 1 : 0); | |
| 1923 | 814 | break; |
| 1924 | 815 | /*layer clearance,but the bootleg doesn't send values,so this function |
| 1925 | 816 | is an original left-over.*/ |
| r2418 | r2419 | |
| 1935 | 826 | } |
| 1936 | 827 | case (0x500/2): |
| 1937 | 828 | { |
| 1938 | cop_fct = cop_mcu_ram[offset]; | |
| 1939 | cop_run(); | |
| 829 | //cop_fct = cop_mcu_ram[offset]; | |
| 830 | //cop_run(); | |
| 1940 | 831 | break; |
| 1941 | 832 | } |
| 1942 | 833 | case (0x604/2): |
| r2418 | r2419 | |
| 2007 | 898 | } |
| 2008 | 899 | } |
| 2009 | 900 | |
| 901 | // this still probably contains some useful information, but we should handle | |
| 902 | // things as generically as possible | |
| 903 | #if 0 | |
| 2010 | 904 | /******************************************************************************************** |
| 2011 | 905 | |
| 2012 | 906 | COPX-D2 simulation |
| r2418 | r2419 | |
| 2071 | 965 | memset(&cop_data, 0, sizeof(cop_data)); |
| 2072 | 966 | } |
| 2073 | 967 | |
| 2074 | void raiden2_save_cop_table( running_machine* machine ) | |
| 2075 | { | |
| 2076 | cop_state *cop = &cop_data; | |
| 2077 | ||
| 2078 | { | |
| 2079 | FILE *fp; | |
| 2080 | char filename[256]; | |
| 2081 | sprintf(filename,"r2_cop_%s_program", machine->gamedrv->name); | |
| 2082 | fp=fopen(filename, "w+b"); | |
| 2083 | if (fp) | |
| 2084 | { | |
| 2085 | fwrite(cop->program, 0x200, 1, fp); | |
| 2086 | fclose(fp); | |
| 2087 | } | |
| 2088 | } | |
| 2089 | ||
| 2090 | { | |
| 2091 | FILE *fp; | |
| 2092 | char filename[256]; | |
| 2093 | sprintf(filename,"r2_cop_%s_value", machine->gamedrv->name); | |
| 2094 | fp=fopen(filename, "w+b"); | |
| 2095 | if (fp) | |
| 2096 | { | |
| 2097 | fwrite(cop->func_value, 0x200/8, 1, fp); | |
| 2098 | fclose(fp); | |
| 2099 | } | |
| 2100 | } | |
| 2101 | ||
| 2102 | { | |
| 2103 | FILE *fp; | |
| 2104 | char filename[256]; | |
| 2105 | sprintf(filename,"r2_cop_%s_mask", machine->gamedrv->name); | |
| 2106 | fp=fopen(filename, "w+b"); | |
| 2107 | if (fp) | |
| 2108 | { | |
| 2109 | fwrite(cop->func_mask, 0x200/8, 1, fp); | |
| 2110 | fclose(fp); | |
| 2111 | } | |
| 2112 | } | |
| 2113 | ||
| 2114 | { | |
| 2115 | FILE *fp; | |
| 2116 | char filename[256]; | |
| 2117 | sprintf(filename,"r2_cop_%s_trigger", machine->gamedrv->name); | |
| 2118 | fp=fopen(filename, "w+b"); | |
| 2119 | if (fp) | |
| 2120 | { | |
| 2121 | fwrite(cop->func_trigger, 0x200/8, 1, fp); | |
| 2122 | fclose(fp); | |
| 2123 | } | |
| 2124 | } | |
| 2125 | } | |
| 2126 | ||
| 2127 | 968 | WRITE16_HANDLER( raiden2_cop2_w ) |
| 2128 | 969 | { |
| 2129 | 970 | cop_state *cop = &cop_data; |
| r2418 | r2419 | |
| 2164 | 1005 | cop->func_mask[temp32] = cop_ram_r(cop, 0x43a); |
| 2165 | 1006 | cop->func_trigger[temp32] = cop_ram_r(cop, 0x43c); |
| 2166 | 1007 | |
| 2167 | raiden2_save_cop_table(machine); | |
| 2168 | ||
| 2169 | 1008 | break; |
| 2170 | 1009 | |
| 2171 | 1010 | case 0x438/2: /* COP program entry value (0,4,5,6,7,8,9,F) */ |
| r2418 | r2419 | |
| 2266 | 1105 | COP_LOG(("%05X:COP Read(%04X) = %04X\n", activecpu_get_pc(), offset*2 + 0x400, cop->ram[offset])); |
| 2267 | 1106 | return cop->ram[offset]; |
| 2268 | 1107 | } |
| 1108 | #endif | |
| 2269 | 1109 | |
| 1110 | ||
| 1111 | ||
| 1112 | ||
| 1113 | ||
| 1114 | /* Generic COP functions | |
| 1115 | -- the game specific handlers fall through to these if there | |
| 1116 | isn't a specific case for them. these implement behavior | |
| 1117 | which seems common to all the agmes | |
| 1118 | */ | |
| 1119 | ||
| 1120 | static READ16_HANDLER( generic_cop_r ) | |
| 1121 | { | |
| 1122 | UINT16 retvalue; | |
| 1123 | retvalue = cop_mcu_ram[offset]; | |
| 1124 | ||
| 1125 | ||
| 1126 | switch (offset) | |
| 1127 | { | |
| 1128 | default: | |
| 1129 | seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); | |
| 1130 | return retvalue; | |
| 1131 | break; | |
| 1132 | ||
| 1133 | /* BCD protection reads */ | |
| 1134 | case (0x190/2): { return ((prot_bcd[0] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1135 | case (0x192/2): { return ((prot_bcd[0] & 0xffff0000) >> 16) + 0x3030; } | |
| 1136 | case (0x194/2): { return ((prot_bcd[1] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1137 | case (0x196/2): { return ((prot_bcd[1] & 0xffff0000) >> 16) + 0x3030; } | |
| 1138 | case (0x198/2): { return ((prot_bcd[2] & 0x0000ffff) >> 0 ) + 0x3030; } | |
| 1139 | case (0x19a/2): { return ((prot_bcd[2] & 0xffff0000) >> 16) + 0x3030; } | |
| 1140 | case (0x19c/2): { return 0x3030; } | |
| 1141 | ||
| 1142 | ||
| 1143 | } | |
| 1144 | } | |
| 1145 | ||
| 1146 | static WRITE16_HANDLER( generic_cop_w ) | |
| 1147 | { | |
| 1148 | switch (offset) | |
| 1149 | { | |
| 1150 | default: | |
| 1151 | seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); | |
| 1152 | break; | |
| 1153 | ||
| 1154 | /* BCD Protection */ | |
| 1155 | case (0x020/2): { prot_bcd[0] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1156 | case (0x022/2): { prot_bcd[1] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1157 | case (0x024/2): { prot_bcd[2] = protection_bcd_jsr(cop_mcu_ram[offset]); break; } | |
| 1158 | ||
| 1159 | /* Command tables for 0x500 / 0x502 commands */ | |
| 1160 | case (0x032/2): { copd2_set_tabledata(data, machine); break; } | |
| 1161 | case (0x034/2): { copd2_set_tableoffset(data, machine); break; } | |
| 1162 | case (0x038/2): { cop_438 = data; break; } | |
| 1163 | case (0x03a/2): { cop_43a = data; break; } | |
| 1164 | case (0x03c/2): { cop_43c = data; break; } | |
| 1165 | ||
| 1166 | /* Layer Clearing */ | |
| 1167 | case (0x078/2): /* clear address */ | |
| 1168 | { | |
| 1169 | cop_clearfill_address[cop_clearfill_lasttrigger] = data; // << 6 to get actual address | |
| 1170 | seibu_cop_log("%06x: COPX set layer clear address to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<6); | |
| 1171 | break; | |
| 1172 | } | |
| 1173 | ||
| 1174 | case (0x07a/2): /* clear length */ | |
| 1175 | { | |
| 1176 | cop_clearfill_length[cop_clearfill_lasttrigger] = data; | |
| 1177 | seibu_cop_log("%06x: COPX set layer clear length to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<5); | |
| 1178 | ||
| 1179 | break; | |
| 1180 | } | |
| 1181 | ||
| 1182 | case (0x07c/2): /* clear value? */ | |
| 1183 | { | |
| 1184 | cop_clearfill_value[cop_clearfill_lasttrigger] = data; | |
| 1185 | seibu_cop_log("%06x: COPX set layer clear value to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<6); | |
| 1186 | break; | |
| 1187 | } | |
| 1188 | ||
| 1189 | /* unknown, related to clears? / DMA? */ | |
| 1190 | case (0x07e/2): | |
| 1191 | { | |
| 1192 | cop_clearfill_lasttrigger = data; | |
| 1193 | seibu_cop_log("%06x: COPX set layer clear trigger? to %04x\n", activecpu_get_pc(), data); | |
| 1194 | if (data>=0x1ff) | |
| 1195 | { | |
| 1196 | seibu_cop_log("invalid!, >0x1ff\n"); | |
| 1197 | cop_clearfill_lasttrigger = 0; | |
| 1198 | } | |
| 1199 | ||
| 1200 | break; | |
| 1201 | } | |
| 1202 | ||
| 1203 | /* Registers */ | |
| 1204 | case (0x0a0/2): { cop_register[0] = (cop_register[0]&0x0000ffff)|(cop_mcu_ram[offset]<<16); break; } | |
| 1205 | case (0x0c0/2): { cop_register[0] = (cop_register[0]&0xffff0000)|(cop_mcu_ram[offset]<<0); break; } | |
| 1206 | ||
| 1207 | case (0x0a2/2): { cop_register[1] = (cop_register[1]&0x0000ffff)|(cop_mcu_ram[offset]<<16); break; } | |
| 1208 | case (0x0c2/2): { cop_register[1] = (cop_register[1]&0xffff0000)|(cop_mcu_ram[offset]<<0); break; } | |
| 1209 | ||
| 1210 | case (0x0a4/2): { cop_register[2] = (cop_register[2]&0x0000ffff)|(cop_mcu_ram[offset]<<16); break; } | |
| 1211 | case (0x0c4/2): { cop_register[2] = (cop_register[2]&0xffff0000)|(cop_mcu_ram[offset]<<0); break; } | |
| 1212 | ||
| 1213 | case (0x0a6/2): { cop_register[3] = (cop_register[3]&0x0000ffff)|(cop_mcu_ram[offset]<<16); break; } | |
| 1214 | case (0x0c6/2): { cop_register[3] = (cop_register[3]&0xffff0000)|(cop_mcu_ram[offset]<<0); break; } | |
| 1215 | ||
| 1216 | /* was dma_dst */ | |
| 1217 | case (0x0a8/2): { cop_register[4] = (cop_register[4]&0x0000ffff)|(cop_mcu_ram[offset]<<16); break; } | |
| 1218 | case (0x0c8/2): { cop_register[4] = (cop_register[4]&0xffff0000)|(cop_mcu_ram[offset]<<0); break; } | |
| 1219 | ||
| 1220 | case (0x100/2): | |
| 1221 | { | |
| 1222 | int i; | |
| 1223 | int command; | |
| 1224 | ||
| 1225 | seibu_cop_log("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", activecpu_get_pc(), data, cop_mcu_ram[offset], cop_register[0], cop_register[1], cop_register[2], cop_register[3], cop_register[4]); | |
| 1226 | ||
| 1227 | command = -1; | |
| 1228 | /* search the uploaded 'trigger' table for a matching trigger*/ | |
| 1229 | /* note, I don't know what the 'mask' or 'value' tables are... probably important, might determine what actually gets executed! */ | |
| 1230 | for (i=0;i<32;i++) | |
| 1231 | { | |
| 1232 | if (cop_mcu_ram[offset]==copd2_table_4[i]) | |
| 1233 | { | |
| 1234 | seibu_cop_log(" Cop Command %04x found in slot %02x with other params %04x %04x\n", cop_mcu_ram[offset], i, copd2_table_2[i], copd2_table_3[i]); | |
| 1235 | command = i; | |
| 1236 | } | |
| 1237 | } | |
| 1238 | ||
| 1239 | if (command==-1) | |
| 1240 | { | |
| 1241 | seibu_cop_log(" Cop Command %04x NOT IN TABLE!\n", cop_mcu_ram[offset]); | |
| 1242 | break; | |
| 1243 | } | |
| 1244 | else | |
| 1245 | { | |
| 1246 | int j; | |
| 1247 | command*=0x8; | |
| 1248 | seibu_cop_log(" Sequence: "); | |
| 1249 | for (j=0;j<0x8;j++) | |
| 1250 | { | |
| 1251 | seibu_cop_log("%04x ", copd2_table[command+j]); | |
| 1252 | } | |
| 1253 | seibu_cop_log("\n"); | |
| 1254 | } | |
| 1255 | ||
| 1256 | ||
| 1257 | break; | |
| 1258 | } | |
| 1259 | ||
| 1260 | ||
| 1261 | /* hmm, this would be strange the 6xx range should be video regs?? */ | |
| 1262 | case (0x2fc/2): | |
| 1263 | { | |
| 1264 | seibu_cop_log("%06x: COPX execute current layer clear??? %04x\n", activecpu_get_pc(), data); | |
| 1265 | ||
| 1266 | // I think the value it writes here must match the other value for anything to happen.. maybe */ | |
| 1267 | //if (data!=cop_clearfill_value[cop_clearfill_lasttrigger]) break; | |
| 1268 | if ((cop_clearfill_lasttrigger==0x14) || (cop_clearfill_lasttrigger==0x15)) return; | |
| 1269 | ||
| 1270 | /* do the fill */ | |
| 1271 | if (cop_clearfill_value[cop_clearfill_lasttrigger]==0x0000) | |
| 1272 | { | |
| 1273 | UINT32 length, address; | |
| 1274 | int i; | |
| 1275 | address = cop_clearfill_address[cop_clearfill_lasttrigger] << 6; | |
| 1276 | length = (cop_clearfill_length[cop_clearfill_lasttrigger]+1) << 5; | |
| 1277 | ||
| 1278 | for (i=address;i<address+length;i+=2) | |
| 1279 | { | |
| 1280 | program_write_word(i, 0x0000); | |
| 1281 | } | |
| 1282 | } | |
| 1283 | break; | |
| 1284 | } | |
| 1285 | } | |
| 1286 | } | |
| 1287 | ||
| 1288 | /********************************************************************************************** | |
| 1289 | Heated Barrel | |
| 1290 | **********************************************************************************************/ | |
| 1291 | ||
| 1292 | READ16_HANDLER( heatbrl_mcu_r ) | |
| 1293 | { | |
| 1294 | switch (offset) | |
| 1295 | { | |
| 1296 | default: | |
| 1297 | return generic_cop_r(machine, offset, mem_mask); | |
| 1298 | break; | |
| 1299 | ||
| 1300 | /********************************************************************* | |
| 1301 | 400-5ff - Protection reads | |
| 1302 | *********************************************************************/ | |
| 1303 | ||
| 1304 | case (0x180/2): { return xy_check; } /*hit protection*/ | |
| 1305 | case (0x182/2): { if(input_code_pressed(KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1306 | case (0x184/2): { if(input_code_pressed(KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1307 | ||
| 1308 | case (0x1b0/2): return (0xffff); /* bit 15 is branched on a few times in the $1938 area */ | |
| 1309 | case (0x1b4/2): return (0xffff); /* read at $1932 and stored in ram before +0x5b0 bit 15 tested */ | |
| 1310 | ||
| 1311 | /********************************************************************* | |
| 1312 | 700-7ff - Non-protection reads | |
| 1313 | *********************************************************************/ | |
| 1314 | ||
| 1315 | /* Seibu Sound System */ | |
| 1316 | case (0x3c8/2): return seibu_main_word_r(machine,2,0); | |
| 1317 | case (0x3cc/2): return seibu_main_word_r(machine,3,0); | |
| 1318 | case (0x3d4/2): return seibu_main_word_r(machine,5,0); | |
| 1319 | ||
| 1320 | /* Inputs */ | |
| 1321 | case (0x340/2): return input_port_1_word_r(machine,0,0); | |
| 1322 | case (0x344/2): return input_port_2_word_r(machine,0,0); | |
| 1323 | case (0x348/2): return input_port_4_word_r(machine,0,0); | |
| 1324 | case (0x34c/2): return input_port_3_word_r(machine,0,0); | |
| 1325 | ||
| 1326 | } | |
| 1327 | } | |
| 1328 | ||
| 1329 | WRITE16_HANDLER( heatbrl_mcu_w ) | |
| 1330 | { | |
| 1331 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1332 | ||
| 1333 | switch (offset) | |
| 1334 | { | |
| 1335 | default: | |
| 1336 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1337 | break; | |
| 1338 | ||
| 1339 | /********************************************************************* | |
| 1340 | 400-5ff - Protection writes | |
| 1341 | *********************************************************************/ | |
| 1342 | ||
| 1343 | /* Odd, this is a video register */ | |
| 1344 | case (0x070/2): { heatbrl_setgfxbank( cop_mcu_ram[offset] ); break; } | |
| 1345 | ||
| 1346 | #if 1 // turn off to get the generic sequence logging | |
| 1347 | /* Macros Command Trigger */ | |
| 1348 | case (0x100/2): | |
| 1349 | { | |
| 1350 | switch(cop_mcu_ram[offset]) | |
| 1351 | { | |
| 1352 | case 0x8100: | |
| 1353 | break; | |
| 1354 | case 0x8900: | |
| 1355 | { | |
| 1356 | cop2_move3_prot(); | |
| 1357 | break; | |
| 1358 | } | |
| 1359 | case 0x205: | |
| 1360 | { | |
| 1361 | cop2_move2_prot(); | |
| 1362 | break; | |
| 1363 | } | |
| 1364 | case 0xa100: | |
| 1365 | break; | |
| 1366 | case 0xb080: | |
| 1367 | break; | |
| 1368 | case 0xa900: | |
| 1369 | break; | |
| 1370 | case 0xb880: | |
| 1371 | { | |
| 1372 | xy_check = cop2_hit_prot(); | |
| 1373 | break; | |
| 1374 | } | |
| 1375 | default: | |
| 1376 | seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); | |
| 1377 | } | |
| 1378 | break; | |
| 1379 | } | |
| 1380 | #endif | |
| 1381 | ||
| 1382 | /********************************************************************* | |
| 1383 | 600-6ff - Video Registers | |
| 1384 | *********************************************************************/ | |
| 1385 | ||
| 1386 | // 65a bit 0 is flipscreen | |
| 1387 | case (0x25c/2): { legionna_layer_disable = cop_mcu_ram[offset]; break; } // 65c probably layer disables, like Dcon? Used on screen when you press P1-4 start (values 13, 11, 0 seen) | |
| 1388 | // 660 - 66a scroll control; is there a layer priority switch...? | |
| 1389 | case (0x260/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1390 | case (0x262/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1391 | case (0x264/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1392 | case (0x266/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1393 | case (0x268/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1394 | case (0x26a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1395 | ||
| 1396 | /********************************************************************* | |
| 1397 | 700-7ff - Output (Seibu Sound System) | |
| 1398 | *********************************************************************/ | |
| 1399 | ||
| 1400 | case (0x3c0/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1401 | case (0x3c4/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1402 | case (0x3d0/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1403 | case (0x3d8/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1404 | } | |
| 1405 | } | |
| 1406 | ||
| 1407 | ||
| 1408 | /********************************************************************************************** | |
| 1409 | Seibu Cup Soccer | |
| 1410 | **********************************************************************************************/ | |
| 1411 | ||
| 1412 | READ16_HANDLER( cupsoc_mcu_r ) | |
| 1413 | { | |
| 1414 | switch (offset) | |
| 1415 | { | |
| 1416 | default: | |
| 1417 | return generic_cop_r(machine, offset, mem_mask); | |
| 1418 | break; | |
| 1419 | ||
| 1420 | //case (0x07e/2): | |
| 1421 | //case (0x1b0/2): | |
| 1422 | //case (0x1b4/2): | |
| 1423 | // return cop_mcu_ram[offset]; | |
| 1424 | ||
| 1425 | /* returning 0xffff for some inputs for now, breaks coinage but | |
| 1426 | allows cupsoc to boot */ | |
| 1427 | case (0x300/2): return input_port_1_word_r(machine,0,0); | |
| 1428 | case (0x304/2): return input_port_2_word_r(machine,0,0); | |
| 1429 | case (0x308/2): return input_port_4_word_r(machine,0,0); | |
| 1430 | case (0x30c/2): return input_port_3_word_r(machine,0,0); | |
| 1431 | case (0x314/2): return 0xffff; | |
| 1432 | case (0x31c/2): return input_port_5_word_r(machine,0,0); | |
| 1433 | ||
| 1434 | case (0x340/2): return 0xffff; | |
| 1435 | case (0x344/2): return 0xffff; | |
| 1436 | case (0x348/2): return 0xffff;//seibu_main_word_r(machine,2,0); | |
| 1437 | case (0x34c/2): return 0xffff;//seibu_main_word_r(machine,3,0); | |
| 1438 | case (0x354/2): return 0xffff;//seibu_main_word_r(machine,5,0); | |
| 1439 | case (0x35c/2): return 0xffff; | |
| 1440 | } | |
| 1441 | } | |
| 1442 | ||
| 1443 | WRITE16_HANDLER( cupsoc_mcu_w ) | |
| 1444 | { | |
| 1445 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1446 | ||
| 1447 | switch (offset) | |
| 1448 | { | |
| 1449 | default: | |
| 1450 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1451 | break; | |
| 1452 | ||
| 1453 | /********************************************************************* | |
| 1454 | 400-5ff - Protection writes | |
| 1455 | *********************************************************************/ | |
| 1456 | ||
| 1457 | /* Trigger Macro Command */ | |
| 1458 | case (0x100/2): | |
| 1459 | { | |
| 1460 | switch(cop_mcu_ram[offset]) | |
| 1461 | { | |
| 1462 | /*???*/ | |
| 1463 | case 0x8100: | |
| 1464 | { | |
| 1465 | UINT32 src = cop_register[0]; | |
| 1466 | program_write_word(src+0x36,0xffc0); | |
| 1467 | break; | |
| 1468 | } | |
| 1469 | case 0x8900: | |
| 1470 | { | |
| 1471 | UINT32 src = cop_register[0]; | |
| 1472 | program_write_word(src+0x36,0xff80); | |
| 1473 | break; | |
| 1474 | } | |
| 1475 | /*Right*/ | |
| 1476 | case 0x0205: | |
| 1477 | { | |
| 1478 | UINT32 src = cop_register[0]; | |
| 1479 | INT16 y = program_read_word(src+0x4); | |
| 1480 | INT16 x = program_read_word(src+0x8); | |
| 1481 | INT16 y_rel = program_read_word(src+0x10); | |
| 1482 | INT16 x_rel = program_read_word(src+0x14); | |
| 1483 | program_write_word(src+0x4,(y+y_rel)); | |
| 1484 | program_write_word(src+0x8,(x+x_rel)); | |
| 1485 | /*logerror("%08x %08x %08x %08x %08x\n",cop_register[0], | |
| 1486 | program_read_word(cop_reg[0]+0x4), | |
| 1487 | program_read_word(cop_reg[0]+0x8), | |
| 1488 | program_read_word(cop_reg[0]+0x10), | |
| 1489 | program_read_word(cop_reg[0]+0x14));*/ | |
| 1490 | break; | |
| 1491 | } | |
| 1492 | /*???*/ | |
| 1493 | case 0x3bb0: | |
| 1494 | { | |
| 1495 | //UINT32 dst = cop_register[0]; | |
| 1496 | //UINT32 dst = cop_register[1]; | |
| 1497 | //program_write_word(dst, mame_rand(Machine)/*program_read_word(src)*/); | |
| 1498 | //program_write_word(dst+2,mame_rand(Machine)/*program_read_word(src+2)*/); | |
| 1499 | //program_write_word(dst+4,mame_rand(Machine)/*program_read_word(src+4)*/); | |
| 1500 | //program_write_word(dst+6,mame_rand(Machine)/*program_read_word(src+6)*/); | |
| 1501 | //logerror("%04x\n",cop_register[0]); | |
| 1502 | break; | |
| 1503 | } | |
| 1504 | default: | |
| 1505 | //logerror("%04x\n",data); | |
| 1506 | break; | |
| 1507 | } | |
| 1508 | break; | |
| 1509 | } | |
| 1510 | ||
| 1511 | /* Video Regs */ | |
| 1512 | case (0x204/2): | |
| 1513 | { | |
| 1514 | //C.R.T. Controller | |
| 1515 | /* | |
| 1516 | data = setting | |
| 1517 | 0x01e = 320x256 ---- ---x xxx- | |
| 1518 | 0x0e1 = 320x256 REVERSE ---- xxx- ---x | |
| 1519 | 0x016 = 320x240 ---- ---x -xx- | |
| 1520 | 0x0e9 = 320x240 REVERSE ---- xxx- x--x | |
| 1521 | 0x004 = 320x224 ---- ---- -x-- | |
| 1522 | 0x10b = 320x224 REVERSE ---x ---- x-xx | |
| 1523 | For now we use this by cases and not per bits. | |
| 1524 | */ | |
| 1525 | ||
| 1526 | switch(data) | |
| 1527 | { | |
| 1528 | case 0x0000: | |
| 1529 | case 0x001e: CRT_MODE(320,256,0); break; | |
| 1530 | case 0x00e1: CRT_MODE(320,256,1); break; | |
| 1531 | case 0x0016: CRT_MODE(320,240,0); break; | |
| 1532 | case 0x00e9: CRT_MODE(320,240,1); break; | |
| 1533 | case 0x0004: CRT_MODE(320,224,0); break; | |
| 1534 | case 0x010b: CRT_MODE(320,224,1); break; | |
| 1535 | default: | |
| 1536 | #ifdef MAME_DEBUG | |
| 1537 | popmessage("Warning: Undefined CRT Mode %04x",data); | |
| 1538 | #endif | |
| 1539 | CRT_MODE(320,256,0); | |
| 1540 | } | |
| 1541 | break; | |
| 1542 | } | |
| 1543 | /*TODO: what's going on here,some scroll values aren't sent in these locations | |
| 1544 | but somewhere else?*/ | |
| 1545 | case (0x22c/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1546 | case (0x22e/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1547 | case (0x230/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1548 | case (0x232/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1549 | case (0x234/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1550 | case (0x236/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1551 | case (0x238/2): { legionna_scrollram16[6] = cop_mcu_ram[offset]; break; } | |
| 1552 | case (0x23a/2): { legionna_scrollram16[7] = cop_mcu_ram[offset]; break; } | |
| 1553 | ||
| 1554 | case (0x340/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1555 | case (0x344/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1556 | case (0x350/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1557 | case (0x358/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1558 | } | |
| 1559 | } | |
| 1560 | ||
| 1561 | /********************************************************************************************** | |
| 1562 | Godzilla | |
| 1563 | **********************************************************************************************/ | |
| 1564 | ||
| 1565 | READ16_HANDLER( godzilla_mcu_r ) | |
| 1566 | { | |
| 1567 | switch (offset) | |
| 1568 | { | |
| 1569 | default: | |
| 1570 | return generic_cop_r(machine, offset, mem_mask); | |
| 1571 | break; | |
| 1572 | ||
| 1573 | /* Non-protection reads */ | |
| 1574 | case (0x308/2): return seibu_main_word_r(machine,2,0); | |
| 1575 | case (0x30c/2): return seibu_main_word_r(machine,3,0); | |
| 1576 | case (0x314/2): return seibu_main_word_r(machine,5,0); | |
| 1577 | ||
| 1578 | /* Inputs */ | |
| 1579 | case (0x340/2): return input_port_1_word_r(machine,0,0); | |
| 1580 | case (0x344/2): return input_port_2_word_r(machine,0,0); | |
| 1581 | case (0x348/2): return input_port_4_word_r(machine,0,0); | |
| 1582 | case (0x34c/2): return input_port_3_word_r(machine,0,0); | |
| 1583 | } | |
| 1584 | } | |
| 1585 | ||
| 1586 | WRITE16_HANDLER( godzilla_mcu_w ) | |
| 1587 | { | |
| 1588 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1589 | ||
| 1590 | switch (offset) | |
| 1591 | { | |
| 1592 | default: | |
| 1593 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1594 | break; | |
| 1595 | ||
| 1596 | ||
| 1597 | case (0x220/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1598 | case (0x222/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1599 | case (0x224/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1600 | case (0x226/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1601 | case (0x228/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1602 | case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1603 | ||
| 1604 | case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1605 | case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1606 | case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1607 | case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1608 | } | |
| 1609 | } | |
| 1610 | ||
| 1611 | /********************************************************************************************** | |
| 1612 | Denjin Makai | |
| 1613 | **********************************************************************************************/ | |
| 1614 | ||
| 1615 | READ16_HANDLER( denjinmk_mcu_r ) | |
| 1616 | { | |
| 1617 | switch (offset) | |
| 1618 | { | |
| 1619 | default: | |
| 1620 | return generic_cop_r(machine, offset, mem_mask); | |
| 1621 | break; | |
| 1622 | ||
| 1623 | /* Non-protection reads */ | |
| 1624 | ||
| 1625 | case (0x308/2): return seibu_main_word_r(machine,2,0); | |
| 1626 | case (0x30c/2): return seibu_main_word_r(machine,3,0); | |
| 1627 | case (0x314/2): return seibu_main_word_r(machine,5,0); | |
| 1628 | ||
| 1629 | /* Inputs */ | |
| 1630 | case (0x340/2): return input_port_1_word_r(machine,0,0); | |
| 1631 | case (0x344/2): return input_port_2_word_r(machine,0,0); | |
| 1632 | case (0x348/2): return input_port_4_word_r(machine,0,0); | |
| 1633 | case (0x34c/2): return input_port_3_word_r(machine,0,0); | |
| 1634 | case (0x35c/2): return input_port_5_word_r(machine,0,0); | |
| 1635 | } | |
| 1636 | } | |
| 1637 | ||
| 1638 | WRITE16_HANDLER( denjinmk_mcu_w ) | |
| 1639 | { | |
| 1640 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1641 | ||
| 1642 | switch (offset) | |
| 1643 | { | |
| 1644 | default: | |
| 1645 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1646 | break; | |
| 1647 | ||
| 1648 | case (0x070/2): { denjinmk_setgfxbank(cop_mcu_ram[offset]); break; } | |
| 1649 | ||
| 1650 | case (0x220/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1651 | case (0x222/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1652 | case (0x224/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1653 | case (0x226/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1654 | case (0x228/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1655 | case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1656 | ||
| 1657 | case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1658 | case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1659 | case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1660 | case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1661 | ||
| 1662 | } | |
| 1663 | } | |
| 1664 | ||
| 1665 | /********************************************************************************************** | |
| 1666 | SD Gundam Rainbow Trout | |
| 1667 | **********************************************************************************************/ | |
| 1668 | ||
| 1669 | READ16_HANDLER( sdgndmrb_mcu_r ) | |
| 1670 | { | |
| 1671 | switch (offset) | |
| 1672 | { | |
| 1673 | default: | |
| 1674 | return generic_cop_r(machine, offset, mem_mask); | |
| 1675 | break; | |
| 1676 | ||
| 1677 | /*hit protection*/ | |
| 1678 | case (0x180/2): { return xy_check; } | |
| 1679 | ||
| 1680 | case (0x1b0/2): | |
| 1681 | return 2; | |
| 1682 | /*check if the DMA has been finished*/ | |
| 1683 | if(dma_status == 1) | |
| 1684 | { | |
| 1685 | dma_status = 0; | |
| 1686 | return 2; | |
| 1687 | } | |
| 1688 | return cop_mcu_ram[offset]; | |
| 1689 | ||
| 1690 | /* Non-protection reads */ | |
| 1691 | case (0x308/2): return seibu_main_word_r(machine,2,0); | |
| 1692 | case (0x30c/2): return seibu_main_word_r(machine,3,0); | |
| 1693 | case (0x314/2): return seibu_main_word_r(machine,5,0); | |
| 1694 | ||
| 1695 | /* Inputs */ | |
| 1696 | case (0x340/2): return input_port_1_word_r(machine,0,0); | |
| 1697 | case (0x344/2): return input_port_2_word_r(machine,0,0); | |
| 1698 | case (0x348/2): return input_port_4_word_r(machine,0,0); | |
| 1699 | case (0x34c/2): return input_port_3_word_r(machine,0,0); | |
| 1700 | case (0x35c/2): return input_port_5_word_r(machine,0,0); | |
| 1701 | } | |
| 1702 | } | |
| 1703 | ||
| 1704 | ||
| 1705 | WRITE16_HANDLER( sdgndmrb_mcu_w ) | |
| 1706 | { | |
| 1707 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1708 | ||
| 1709 | switch (offset) | |
| 1710 | { | |
| 1711 | default: | |
| 1712 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1713 | break; | |
| 1714 | ||
| 1715 | /********************************************************************* | |
| 1716 | 400-5ff - Protection writes | |
| 1717 | *********************************************************************/ | |
| 1718 | ||
| 1719 | case (0x00c/2): { dma_size = cop_mcu_ram[offset]; break; } | |
| 1720 | ||
| 1721 | /*DMA source address*/ | |
| 1722 | case (0x012/2): { prot_data[1] = cop_mcu_ram[offset]; dma_src = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1723 | case (0x014/2): { prot_data[0] = cop_mcu_ram[offset]; dma_src = (prot_data[0]&0xffff)|((prot_data[1]&0xffff)<<16); break; } | |
| 1724 | ||
| 1725 | /* Execute Macro Command */ | |
| 1726 | case (0x100/2): | |
| 1727 | { | |
| 1728 | switch(cop_mcu_ram[offset]) | |
| 1729 | { | |
| 1730 | case 0xa180:/*do the job [1]*/ | |
| 1731 | { | |
| 1732 | //popmessage("%08x %08x %04x",dma_src,cop_register[5]+4,dma_size); | |
| 1733 | /*fix the offset for easier reading*/ | |
| 1734 | dma_src+=4; | |
| 1735 | //cop_register[5]+=4; | |
| 1736 | s_i = dma_size; | |
| 1737 | //cop_register[5]+=((program_read_word(0x110000) & 0x000f) * 8); | |
| 1738 | //program_write_word(0x1004c8,cop_register[5] & 0xffff); | |
| 1739 | //dma_status = 1; | |
| 1740 | break; | |
| 1741 | } | |
| 1742 | case 0xb100: | |
| 1743 | break; | |
| 1744 | case 0xa980: | |
| 1745 | break; | |
| 1746 | case 0xb900: | |
| 1747 | { | |
| 1748 | xy_check = hit_check_jsr(); | |
| 1749 | break; | |
| 1750 | } | |
| 1751 | /*bullet movement protection,conflicts with [3],will be worked out*/ | |
| 1752 | case 0x8100: | |
| 1753 | { | |
| 1754 | //move3x_prot_jsr(); | |
| 1755 | break; | |
| 1756 | } | |
| 1757 | case 0x8900: | |
| 1758 | { | |
| 1759 | //move3y_prot_jsr(); | |
| 1760 | break; | |
| 1761 | } | |
| 1762 | case 0x0205:/*do the job [3]*/ | |
| 1763 | { | |
| 1764 | moveprot_jsr(); | |
| 1765 | break; | |
| 1766 | } | |
| 1767 | case 0x138e:/*do the job [4]*/ | |
| 1768 | break; | |
| 1769 | case 0x3bb0: | |
| 1770 | { | |
| 1771 | move2prot_jsr(); | |
| 1772 | break; | |
| 1773 | } | |
| 1774 | default: | |
| 1775 | seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); | |
| 1776 | } | |
| 1777 | break; | |
| 1778 | } | |
| 1779 | ||
| 1780 | case (0x102/2): | |
| 1781 | { | |
| 1782 | if(cop_mcu_ram[offset] == 0xc480) | |
| 1783 | { | |
| 1784 | dma_transfer(); | |
| 1785 | s_i--; | |
| 1786 | if(s_i == 0) | |
| 1787 | dma_status = 1; | |
| 1788 | } | |
| 1789 | break; | |
| 1790 | } | |
| 1791 | ||
| 1792 | /*Layer Enable,bit wise active low*/ | |
| 1793 | case (0x21c/2): | |
| 1794 | { | |
| 1795 | /* | |
| 1796 | ---x ---- (used in test mode) | |
| 1797 | ---- x--- Text Layer | |
| 1798 | ---- -x-- Foreground Layer | |
| 1799 | ---- --x- Midground Layer | |
| 1800 | ---- ---x Background Layer | |
| 1801 | */ | |
| 1802 | sdgndmrb_pri_n = cop_mcu_ram[offset] & 0xf; | |
| 1803 | break; | |
| 1804 | } | |
| 1805 | ||
| 1806 | /* TODO: tilemaps x-axis are offset,we use a temporary kludge for now */ | |
| 1807 | case (0x220/2): { legionna_scrollram16[0] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1808 | case (0x222/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1809 | case (0x224/2): { legionna_scrollram16[2] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1810 | case (0x226/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1811 | case (0x228/2): { legionna_scrollram16[4] = 0x10 + cop_mcu_ram[offset]; break; } | |
| 1812 | case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1813 | ||
| 1814 | /* scroll mirrors? */ | |
| 1815 | case (0x22c/2): | |
| 1816 | case (0x22e/2): | |
| 1817 | case (0x230/2): | |
| 1818 | case (0x232/2): | |
| 1819 | case (0x234/2): | |
| 1820 | case (0x236/2): | |
| 1821 | break; | |
| 1822 | ||
| 1823 | ||
| 1824 | /* Text Layer scroll registers */ | |
| 1825 | case (0x238/2): { legionna_scrollram16[6] = 0x38 + cop_mcu_ram[offset]; break; } | |
| 1826 | case (0x23a/2): { legionna_scrollram16[7] = cop_mcu_ram[offset]; break; } | |
| 1827 | /*C.R.T. Controller (note:game calls it OBJ register)*/ | |
| 1828 | case (0x244/2): | |
| 1829 | { | |
| 1830 | /* | |
| 1831 | data = setting | |
| 1832 | 0x01e = 320x256 | |
| 1833 | 0x0e1 = 320x256 REVERSE | |
| 1834 | 0x016 = 320x240 | |
| 1835 | 0x0e9 = 320x240 REVERSE | |
| 1836 | 0x004 = 320x224 | |
| 1837 | 0x10b = 320x224 REVERSE | |
| 1838 | It is like to be per cases and not per bits. | |
| 1839 | */ | |
| 1840 | switch(data) | |
| 1841 | { | |
| 1842 | case 0x0000: | |
| 1843 | case 0x0003: | |
| 1844 | case 0x001e: CRT_MODE(320,224,0); break; | |
| 1845 | case 0x00e1: CRT_MODE(320,224,1); break; | |
| 1846 | case 0x0016: CRT_MODE(320,256,0); break; | |
| 1847 | case 0x00e9: CRT_MODE(320,256,1); break; | |
| 1848 | case 0x0004: CRT_MODE(320,240,0); break; | |
| 1849 | case 0x00fb: CRT_MODE(320,240,1); break; | |
| 1850 | default: | |
| 1851 | #ifdef MAME_DEBUG | |
| 1852 | popmessage("Warning: Undefined CRT Mode %04x",data); | |
| 1853 | #endif | |
| 1854 | CRT_MODE(320,256,0); | |
| 1855 | } | |
| 1856 | } | |
| 1857 | break; | |
| 1858 | ||
| 1859 | /* Seems a mirror for the choices in the test menu... */ | |
| 1860 | //case (0x27c/2): break; | |
| 1861 | //case (0x280/2): break; | |
| 1862 | //case (0x6fc/2): break; | |
| 1863 | ||
| 1864 | case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1865 | case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1866 | case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1867 | case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1868 | } | |
| 1869 | } | |
| 1870 | ||
| 1871 | /********************************************************************************************** | |
| 1872 | Legionnaire | |
| 1873 | **********************************************************************************************/ | |
| 1874 | ||
| 1875 | ||
| 1876 | READ16_HANDLER( legionna_mcu_r ) | |
| 1877 | { | |
| 1878 | switch (offset) | |
| 1879 | { | |
| 1880 | default: | |
| 1881 | return generic_cop_r(machine, offset, mem_mask); | |
| 1882 | break; | |
| 1883 | ||
| 1884 | /********************************************************************* | |
| 1885 | 400-5ff - Protection reads | |
| 1886 | *********************************************************************/ | |
| 1887 | ||
| 1888 | case (0x070/2): return (mame_rand(machine) &0xffff); /* read PC $110a, could be some sort of control word: sometimes a bit is changed then it's poked back in... */ | |
| 1889 | case (0x182/2): return (0); /* read PC $3594 */ | |
| 1890 | case (0x184/2): return (0); /* read PC $3588 */ | |
| 1891 | case (0x186/2): return (0); /* read PC $35a0 */ | |
| 1892 | case (0x188/2): return hit_check; /* read PC $3580 */ | |
| 1893 | case (0x1b0/2): return (0); /* bit 15 is branched on a few times in the $3300 area */ | |
| 1894 | case (0x1b4/2): return (0); /* read and stored in ram before +0x5b0 bit 15 tested */ | |
| 1895 | ||
| 1896 | ||
| 1897 | /********************************************************************* | |
| 1898 | 700-7ff - Non-protection reads | |
| 1899 | *********************************************************************/ | |
| 1900 | ||
| 1901 | /* Seibu Sound System */ | |
| 1902 | case (0x308/2): return seibu_main_word_r(machine,2,0); | |
| 1903 | case (0x30c/2): return seibu_main_word_r(machine,3,0); | |
| 1904 | case (0x314/2): return seibu_main_word_r(machine,5,0); | |
| 1905 | ||
| 1906 | /* Inputs */ | |
| 1907 | case (0x340/2): return input_port_1_word_r(machine,0,0); | |
| 1908 | case (0x344/2): return input_port_2_word_r(machine,0,0); | |
| 1909 | case (0x348/2): return input_port_0_word_r(machine,0,0); | |
| 1910 | case (0x34c/2): return input_port_3_word_r(machine,0,0); | |
| 1911 | ||
| 1912 | } | |
| 1913 | } | |
| 1914 | ||
| 1915 | ||
| 1916 | WRITE16_HANDLER( legionna_mcu_w ) | |
| 1917 | { | |
| 1918 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 1919 | ||
| 1920 | switch (offset) | |
| 1921 | { | |
| 1922 | default: | |
| 1923 | generic_cop_w(machine, offset, data, mem_mask); | |
| 1924 | break; | |
| 1925 | ||
| 1926 | /* Execute Macro command from table */ | |
| 1927 | case (0x100/2): | |
| 1928 | { | |
| 1929 | /*Movement protection*/ | |
| 1930 | if(cop_mcu_ram[offset] == 0x8900 || cop_mcu_ram[offset] == 0x0205) | |
| 1931 | { | |
| 1932 | static UINT16 xy_data[2]; | |
| 1933 | static UINT8 k; | |
| 1934 | xy_data[0] = program_read_word(cop_register[2]); | |
| 1935 | xy_data[1] = program_read_word(cop_register[3]); | |
| 1936 | k = (cop_mcu_ram[offset] == 0x0205) ? ENEMY : PLAYER; | |
| 1937 | protection_move_jsr(cop_register[0],k); | |
| 1938 | //protection_move_jsr(cop_register[1]); //??? | |
| 1939 | //popmessage("%08x %08x %04x %04x",cop_register[0],cop_register[1],xy_data[0],xy_data[1]); | |
| 1940 | } | |
| 1941 | else if(cop_mcu_ram[offset] == 0x3bb0 || cop_mcu_ram[offset] == 0x138e) | |
| 1942 | { | |
| 1943 | protection_hit_jsr(cop_register[0],cop_register[1]); | |
| 1944 | } | |
| 1945 | break; | |
| 1946 | } | |
| 1947 | ||
| 1948 | /********************************************************************* | |
| 1949 | 600-6ff - Video Registers | |
| 1950 | *********************************************************************/ | |
| 1951 | ||
| 1952 | // 61a bit 0 is flipscreen | |
| 1953 | // 61c probably layer disables, like Dcon | |
| 1954 | ||
| 1955 | case (0x220/2): { legionna_scrollram16[0] = cop_mcu_ram[offset]; break; } | |
| 1956 | case (0x222/2): { legionna_scrollram16[1] = cop_mcu_ram[offset]; break; } | |
| 1957 | case (0x224/2): { legionna_scrollram16[2] = cop_mcu_ram[offset]; break; } | |
| 1958 | case (0x226/2): { legionna_scrollram16[3] = cop_mcu_ram[offset]; break; } | |
| 1959 | case (0x228/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; } | |
| 1960 | case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; } | |
| 1961 | ||
| 1962 | /********************************************************************* | |
| 1963 | 700-7ff - Output (Seibu Sound System) | |
| 1964 | *********************************************************************/ | |
| 1965 | ||
| 1966 | case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 1967 | case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 1968 | case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 1969 | case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 1970 | } | |
| 1971 | } | |
| 1972 | ||
| 1973 | ||
| 1974 | /********************************************************************************************** | |
| 1975 | Raiden 2 / Zero Team | |
| 1976 | **********************************************************************************************/ | |
| 1977 | ||
| 1978 | READ16_HANDLER( raiden2_mcu_r ) | |
| 1979 | { | |
| 1980 | switch (offset) | |
| 1981 | { | |
| 1982 | default: | |
| 1983 | return generic_cop_r(machine, offset, mem_mask); | |
| 1984 | break; | |
| 1985 | ||
| 1986 | case (0x340/2): return input_port_read_indexed(machine, 3) | (input_port_read_indexed(machine, 4) << 8); | |
| 1987 | case (0x344/2): return input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 2) << 8); | |
| 1988 | case (0x34c/2): return input_port_read_indexed(machine, 5) | 0xff00; | |
| 1989 | ||
| 1990 | /* Inputs */ | |
| 1991 | case (0x308/2): return seibu_main_word_r(machine,2,0); | |
| 1992 | case (0x30c/2): return seibu_main_word_r(machine,3,0); | |
| 1993 | case (0x314/2): return seibu_main_word_r(machine,5,0); | |
| 1994 | ||
| 1995 | } | |
| 1996 | } | |
| 1997 | ||
| 1998 | extern WRITE16_HANDLER( sprcpt_val_1_w ); | |
| 1999 | extern WRITE16_HANDLER( sprcpt_val_2_w ); | |
| 2000 | extern WRITE16_HANDLER( sprcpt_data_1_w ); | |
| 2001 | extern WRITE16_HANDLER( sprcpt_data_2_w ); | |
| 2002 | extern WRITE16_HANDLER( sprcpt_data_3_w ); | |
| 2003 | extern WRITE16_HANDLER( sprcpt_data_4_w ); | |
| 2004 | extern WRITE16_HANDLER( sprcpt_adr_w ); | |
| 2005 | extern WRITE16_HANDLER( sprcpt_flags_1_w ); | |
| 2006 | extern WRITE16_HANDLER( sprcpt_flags_2_w ); | |
| 2007 | ||
| 2008 | WRITE16_HANDLER( raiden2_mcu_w ) | |
| 2009 | { | |
| 2010 | COMBINE_DATA(&cop_mcu_ram[offset]); | |
| 2011 | ||
| 2012 | switch (offset) | |
| 2013 | { | |
| 2014 | default: | |
| 2015 | generic_cop_w(machine, offset, data, mem_mask); | |
| 2016 | break; | |
| 2017 | ||
| 2018 | case (0x2a0/2): sprcpt_val_1_w(machine,offset,data,mem_mask); break; | |
| 2019 | case (0x2a2/2): sprcpt_val_1_w(machine,offset,data,mem_mask); break; | |
| 2020 | case (0x2a4/2): sprcpt_data_3_w(machine,offset,data,mem_mask); break; | |
| 2021 | case (0x2a6/2): sprcpt_data_3_w(machine,offset,data,mem_mask); break; | |
| 2022 | case (0x2a8/2): sprcpt_data_4_w(machine,offset,data,mem_mask); break; | |
| 2023 | case (0x2aa/2): sprcpt_data_4_w(machine,offset,data,mem_mask); break; | |
| 2024 | case (0x2ac/2): sprcpt_flags_1_w(machine,offset,data,mem_mask); break; | |
| 2025 | case (0x2ae/2): sprcpt_flags_1_w(machine,offset,data,mem_mask); break; | |
| 2026 | case (0x2b0/2): sprcpt_data_1_w(machine,offset,data,mem_mask); break; | |
| 2027 | case (0x2b2/2): sprcpt_data_1_w(machine,offset,data,mem_mask); break; | |
| 2028 | case (0x2b4/2): sprcpt_data_2_w(machine,offset,data,mem_mask); break; | |
| 2029 | case (0x2b6/2): sprcpt_data_2_w(machine,offset,data,mem_mask); break; | |
| 2030 | case (0x2b8/2): sprcpt_val_2_w(machine,offset,data,mem_mask); break; | |
| 2031 | case (0x2ba/2): sprcpt_val_2_w(machine,offset,data,mem_mask); break; | |
| 2032 | case (0x2bc/2): sprcpt_adr_w(machine,offset,data,mem_mask); break; | |
| 2033 | case (0x2be/2): sprcpt_adr_w(machine,offset,data,mem_mask); break; | |
| 2034 | case (0x2ce/2): sprcpt_flags_2_w(machine,offset,data,mem_mask); break; | |
| 2035 | ||
| 2036 | case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } | |
| 2037 | case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } | |
| 2038 | case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } | |
| 2039 | case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } | |
| 2040 | ||
| 2041 | ||
| 2042 | } | |
| 2043 | } | |
| 2044 | ||
| 2045 |
| r2418 | r2419 | |
|---|---|---|
| 2346 | 2346 | DRIVER( lstduelb ) /* bootleg */ |
| 2347 | 2347 | DRIVER( madgear ) /* 2/1989 (c) 1989 (US) */ |
| 2348 | 2348 | DRIVER( madgearj ) /* 2/1989 (c) 1989 (Japan) */ |
| 2349 | DRIVER( ledstorm ) /* 2/1989 (c) 1989 (US) */ | |
| 2349 | DRIVER( ledstorm ) /* 1988 (c) 1988 (US) */ | |
| 2350 | DRIVER( ledstrm2 ) /* 1988 (c) 1988 (US) */ | |
| 2350 | 2351 | /* 3/1989 Dokaben (baseball) - see below among "Mitchell" games */ |
| 2351 | 2352 | /* 8/1989 Dokaben 2 (baseball) - see below among "Mitchell" games */ |
| 2352 | 2353 | /* 10/1989 Capcom Baseball - see below among "Mitchell" games */ |
| r2418 | r2419 | |
| 3452 | 3453 | DRIVER( sdib ) /* (c) 1987 (FD1089A, decrypted) */ |
| 3453 | 3454 | DRIVER( sdibl ) /* (c) 1987 bootleg */ |
| 3454 | 3455 | DRIVER( defense ) /* (c) 1987 (FD1094, decrypted) */ |
| 3455 | DRIVER( shinobi4 ) /* (c) 1987 */ | |
| 3456 | DRIVER( shinobi3 ) /* (c) 1987 */ | |
| 3456 | DRIVER( shinobi5 ) /* (c) 1987 */ | |
| 3457 | DRIVER( shinobi4 ) /* (c) 1987 (MC-8123B) */ | |
| 3458 | DRIVER( shinobi3 ) /* (c) 1987 (MC-8123B) */ | |
| 3457 | 3459 | DRIVER( shinobi2 ) /* (c) 1987 (FD1094, decrypted) */ |
| 3458 | 3460 | DRIVER( sonicbom ) /* (c) 1987 (FD1094, decrypted) */ |
| 3459 | 3461 | DRIVER( sjryuko ) /* (c) 1988 White Board (FD1094, decrypted) */ |
| r2418 | r2419 | |
| 6341 | 6343 | DRIVER( scudhamm ) /* (c) 1994 Jaleco */ |
| 6342 | 6344 | DRIVER( tetrisp2 ) /* (c) 1997 Jaleco */ |
| 6343 | 6345 | DRIVER( teplus2j ) /* (c) 1997 Jaleco */ |
| 6346 | DRIVER( nndmseal ) /* (c) 1997 I'Max/Jaleco */ | |
| 6344 | 6347 | DRIVER( stepstag ) /* (c) 1999 Jaleco */ |
| 6345 | 6348 | DRIVER( rockn ) /* (c) 1999 Jaleco */ |
| 6346 | 6349 | DRIVER( rockna ) /* (c) 1999 Jaleco */ |
| r2418 | r2419 | |
| 6447 | 6450 | DRIVER( aerofgtc ) /* (c) 1992 Video System Co. */ |
| 6448 | 6451 | DRIVER( sonicwi ) /* (c) 1992 Video System Co. (Japan) */ |
| 6449 | 6452 | DRIVER( aerfboot ) /* bootleg */ |
| 6453 | DRIVER( aerfboo2 ) /* bootleg */ | |
| 6450 | 6454 | DRIVER( wbbc97 ) /* (c) 1997 Comad */ |
| 6451 | 6455 | DRIVER( welltris ) /* (c) 1991 Video System Co. (Japan) */ |
| 6452 | 6456 | DRIVER( welltrij ) /* (c) 1991 Video System Co. (Japan) */ |
| r2418 | r2419 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | /*----------- defined in drivers/cps1.c -----------*/ |
| 5 | 5 | |
| 6 | ADDRESS_MAP_EXTERN(qsound_map, 8); | |
| 6 | ADDRESS_MAP_EXTERN(qsound_sub_map, 8); | |
| 7 | 7 | |
| 8 | 8 | READ16_HANDLER( qsound_sharedram1_r ); |
| 9 | 9 | WRITE16_HANDLER( qsound_sharedram1_w ); |
| r2418 | r2419 | |
| 15 | 15 | |
| 16 | 16 | extern const struct QSound_interface qsound_interface; |
| 17 | 17 | |
| 18 | READ16_HANDLER( cps1_dsw_r ); | |
| 19 | READ16_HANDLER( cps1_in0_r ); | |
| 18 | READ16_HANDLER( cps1_input_r ); | |
| 20 | 19 | READ16_HANDLER( cps1_in1_r ); |
| 21 | 20 | READ16_HANDLER( cps1_in2_r ); |
| 22 | 21 | READ16_HANDLER( cps1_in3_r ); |
| r2418 | r2419 | |
|---|---|---|
| 32 | 32 | void jaguar_dsp_suspend(void); |
| 33 | 33 | void jaguar_dsp_resume(void); |
| 34 | 34 | |
| 35 | void cojag_sound_init( | |
| 35 | void cojag_sound_init(running_machine *machine); | |
| 36 | 36 | void cojag_sound_reset(void); |
| 37 | 37 | |
| 38 | void jaguar_external_int(int state); | |
| 38 | void jaguar_external_int(const device_config *device, int state); | |
| 39 | 39 | |
| 40 | 40 | READ16_HANDLER( jaguar_jerry_regs_r ); |
| 41 | 41 | WRITE16_HANDLER( jaguar_jerry_regs_w ); |
| r2418 | r2419 | |
|---|---|---|
| 83 | 83 | /*----------- defined in machine/neoprot.c -----------*/ |
| 84 | 84 | |
| 85 | 85 | void neogeo_reset_rng(void); |
| 86 | void fatfury2_install_protection( | |
| 86 | void fatfury2_install_protection(running_machine *machine); | |
| 87 | 87 | void mslugx_install_protection(void); |
| 88 | void kof99_install_protection(void); | |
| 89 | void garou_install_protection(void); | |
| 90 | void garouo_install_protection(void); | |
| 91 | void mslug3_install_protection(void); | |
| 92 | void kof2000_install_protection(void); | |
| 93 | void install_kof98_protection(void); | |
| 94 | void install_pvc_protection(void); | |
| 88 | void kof99_install_protection(running_machine *machine); | |
| 89 | void garou_install_protection(running_machine *machine); | |
| 90 | void garouo_install_protection(running_machine *machine); | |
| 91 | void mslug3_install_protection(running_machine *machine); | |
| 92 | void kof2000_install_protection(running_machine *machine); | |
| 93 | void install_kof98_protection(running_machine *machine); | |
| 94 | void install_pvc_protection(running_machine *machine); | |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | /*----------- defined in machine/neoboot.c -----------*/ |
| 98 | 98 | |
| 99 | 99 | void kog_px_decrypt(void); |
| 100 | 100 | void neogeo_bootleg_cx_decrypt(void); |
| 101 | void install_kof10th_protection( | |
| 101 | void install_kof10th_protection(running_machine *machine); | |
| 102 | 102 | void decrypt_kof10th(void); |
| 103 | 103 | void decrypt_kf10thep(void); |
| 104 | 104 | void decrypt_kf2k5uni(void); |
| r2418 | r2419 | |
| 106 | 106 | void kf2k2mp_decrypt(void); |
| 107 | 107 | void kof2km2_px_decrypt(void); |
| 108 | 108 | void decrypt_cthd2003(void); |
| 109 | void patch_cthd2003( | |
| 109 | void patch_cthd2003(running_machine *machine); | |
| 110 | 110 | void decrypt_ct2k3sp(void); |
| 111 | 111 | void decrypt_ct2k3sa(void); |
| 112 | 112 | void patch_ct2k3sa(void); |
| 113 | 113 | void decrypt_kof2k4se_68k(void); |
| 114 | 114 | void lans2004_decrypt_68k(void); |
| 115 | 115 | void lans2004_vx_decrypt(void); |
| 116 | void install_ms5plus_protection( | |
| 116 | void install_ms5plus_protection(running_machine *machine); | |
| 117 | 117 | void svcboot_px_decrypt( void ); |
| 118 | 118 | void svcboot_cx_decrypt( void ); |
| 119 | 119 | void svcplus_px_decrypt( void ); |
| r2418 | r2419 | |
| 122 | 122 | void svcsplus_px_decrypt( void ); |
| 123 | 123 | void svcsplus_px_hack( void ); |
| 124 | 124 | void kof2003b_px_decrypt( void ); |
| 125 | void kof2003b_install_protection( | |
| 125 | void kof2003b_install_protection(running_machine *machine); | |
| 126 | 126 | void kof2k3pl_px_decrypt( void ); |
| 127 | 127 | void kof2k3up_px_decrypt( void ); |
| 128 | void kof2k3up_install_protection(void); | |
| 129 | void kf2k3pl_install_protection(void); | |
| 128 | void kof2k3up_install_protection(running_machine *machine); | |
| 129 | void kf2k3pl_install_protection(running_machine *machine); | |
| 130 | 130 | void samsh5bl_px_decrypt( void ); |
| 131 | 131 | |
| 132 | 132 |
| r2418 | r2419 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | /*----------- defined in drivers/exidy440.c -----------*/ |
| 14 | 14 | |
| 15 | void exidy440_bank_select(UINT8 bank); | |
| 15 | void exidy440_bank_select(running_machine *machine, UINT8 bank); | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /*----------- defined in audio/exidy440.c -----------*/ |
| r2418 | r2419 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | /*----------- defined in drivers/williams.c -----------*/ |
| 11 | 11 | |
| 12 | void defender_install_io_space( | |
| 12 | void defender_install_io_space(running_machine *machine); | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | /*----------- defined in machine/williams.c -----------*/ |
| r2418 | r2419 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | static tilemap *bg1_tilemap,*bg2_tilemap; |
| 16 | 16 | static int sprite_gfx; |
| 17 | static int spikes91_lookup; | |
| 17 | 18 | |
| 18 | 19 | |
| 19 | 20 | /*************************************************************************** |
| r2418 | r2419 | |
| 208 | 209 | setbank(bg1_tilemap,1,(data & 0x0f00) >> 8); |
| 209 | 210 | } |
| 210 | 211 | |
| 212 | WRITE16_HANDLER( spikes91_lookup_w ) | |
| 213 | { | |
| 214 | spikes91_lookup = data & 1; | |
| 215 | } | |
| 216 | ||
| 211 | 217 | WRITE16_HANDLER( karatblz_gfxbank_w ) |
| 212 | 218 | { |
| 213 | 219 | if (ACCESSING_BITS_8_15) |
| r2418 | r2419 | |
| 497 | 503 | flipx = aerofgt_spriteram3[i + 3] & 0x8000; |
| 498 | 504 | color = ((aerofgt_spriteram3[i + 3] & 0x00f0) >> 4); |
| 499 | 505 | |
| 500 | // look-up table | |
| 501 | // RZ notes: | |
| 502 | // in game it's necessary an or with 0x2000; | |
| 503 | // probably a bit switch the table | |
| 504 | // almost sure no line swap in the look-up table | |
| 506 | code |= spikes91_lookup * 0x2000; | |
| 505 | 507 | |
| 506 | code |= 0x2000; | |
| 507 | 508 | realcode = (lookup[code] << 8) + lookup[0x10000 + code]; |
| 508 | 509 | |
| 509 | 510 | drawgfx(bitmap,machine->gfx[sprite_gfx], |
| r2418 | r2419 | |
|---|---|---|
| 99 | 99 | else simpsons_xtraram[offset - 0x1000] = data; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | void simpsons_video_banking(int bank) | |
| 102 | void simpsons_video_banking(running_machine *machine, int bank) | |
| 103 | 103 | { |
| 104 | 104 | if (bank & 1) |
| 105 | 105 | { |
| 106 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 106 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 107 | 107 | memory_set_bankptr(5, paletteram); |
| 108 | 108 | } |
| 109 | 109 | else |
| 110 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r, K052109_w); | |
| 110 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r, K052109_w); | |
| 111 | 111 | |
| 112 | 112 | if (bank & 2) |
| 113 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r, simpsons_K053247_w); | |
| 113 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r, simpsons_K053247_w); | |
| 114 | 114 | else |
| 115 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r, simpsons_K052109_w); | |
| 115 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r, simpsons_K052109_w); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 |
| r2418 | r2419 | |
|---|---|---|
| 818 | 818 | |
| 819 | 819 | state_save_register_item_pointer("PC080SN", i, PC080SN_ram[i], PC080SN_RAM_SIZE/2); |
| 820 | 820 | state_save_register_item_array("PC080SN", i, PC080SN_ctrl[i]); |
| 821 | state_save_register_postload(machine, PC080SN_restore_scroll, (void *)i); | |
| 821 | state_save_register_postload(machine, PC080SN_restore_scroll, (void *)(FPTR)i); | |
| 822 | 822 | |
| 823 | 823 | /* use the given gfx set for bg tiles */ |
| 824 | 824 | PC080SN_bg_gfx[i] = gfxnum; |
| r2418 | r2419 | |
| 2334 | 2334 | state_save_register_item("TC0100SCN", i, TC0100SCN_dblwidth[i]); |
| 2335 | 2335 | } |
| 2336 | 2336 | |
| 2337 | state_save_register_postload(machine, TC0100SCN_postload, (void *)i); | |
| 2337 | state_save_register_postload(machine, TC0100SCN_postload, (void *)(FPTR)i); | |
| 2338 | 2338 | |
| 2339 | 2339 | /* find first empty slot to decode gfx */ |
| 2340 | 2340 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| r2418 | r2419 | |
|---|---|---|
| 25 | 25 | Ghouls 'n Ghosts (World / US) 1988 88620B-2 DM620 LWIO None CPS-B-01 DL-0411-10001 None |
| 26 | 26 | (alt B-board revision - Japan) 88622B-2 DM22A LWIO 88622-C-1 CPS-B-01 DL-0411-10001 None |
| 27 | 27 | Strider 1989 89624B-2 ST24M1 LWIO 88622-C-1 CPS-B-01 DL-0411-10001 None |
| 28 | (alt B-board | |
| 28 | (alt B-board | |
| 29 | 29 | (alt B-board revision) ? ST22B ? |
| 30 | Dynasty Wars 1989 | |
| 30 | Dynasty Wars 1989 88622B-3 TK22B | |
| 31 | 31 | Willow 1989 89624B-3 WL24B LWIO 88622-C-4 CPS-B-03 DL-0411-10003 None |
| 32 | (alt C-board revision) 88622-C-2 | |
| 32 | 33 | UN Squadron / Area 88 1989 89624B-3 AR24B LWIO 88622-C-4 CPS-B-11 DL-0411-10004 None |
| 33 | (alt B-board revision | |
| 34 | (alt B-board revision | |
| 34 | 35 | Final Fight (first rev) 1989 89624B-3 S224B IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None |
| 35 | 36 | Final Fight (US 900112) ? CPS-B-04@ DL-0411-10001 None |
| 36 | 37 | Final Fight (US 900613) ? CPS-B-05 DL-0411-10006 |
| 37 | Final Fight (Japan 900305) | |
| 38 | Final Fight (Japan 900305) (alt B-board revision) ? ? | |
| 38 | 39 | 1941 1990 ? YI24B ? 88622-C-5 CPS-B-05 DL-0411-10006 ? |
| 39 | Mercs (US) 1990 89624B-3 0224B IOB1 90628-C-1 CPS-B-12 DL-0411-10007 C628 | |
| 40 | Magic Sword (US) 1990 89624B-3 MS24B IOB1 88622-C-5 CPS-B-13 DL-0411-10008 None | |
| 40 | Mercs 1990 89624B-3 0224B IOB1 90628-C-1 CPS-B-12 DL-0411-10007 C628 | |
| 41 | (alt C-board revision) 90628-C-2 | |
| 42 | Magic Sword 1990 89624B-3 MS24B IOB1 88622-C-5 CPS-B-13 DL-0411-10008 None | |
| 41 | 43 | Chiki Chiki Boys / Mega Twins 1990 89624B-3 CK24B IOB1 88622-C-5 CPS-B-14 DL-0411-10009 None |
| 42 | 44 | Nemo 1990 89624B-3 NM24B IOB1 88622-C-5 CPS-B-15 DL-0411-10010 None |
| 43 | 45 | Carrier Air Wing / U.S. Navy 1990 89624B-3 CA24B IOB1 88622-C-5 CPS-B-16 DL-0411-10011 None |
| 44 | (alt B-board revision) 89625B-1 CA22B | |
| 45 | Street Fighter II (910214) 1991 ? STF29 IOB1 90632C-1 CPS-B-17 DL-0411-10012 C632 | |
| 46 | (alt B-board revision - Japan) 89625B-1 CA22B | |
| 47 | Street Fighter II (910214) 1991 89622B-3 STF29 IOB1 90632C-1 CPS-B-17 DL-0411-10012 C632 | |
| 46 | 48 | Street Fighter II (US 910206) CPS-B-17 DL-0411-10012 |
| 47 | Street Fighter II (US 910228) | |
| 49 | Street Fighter II (US 910228) ? CPS-B-18 ? | |
| 48 | 50 | Street Fighter II (Japan 910306) CPS-B-12 DL-0411-10007 |
| 49 | 51 | Street Fighter II (US 910318) CPS-B-05 DL-0411-10006 |
| 50 | 52 | Street Fighter II (US 910411) CPS-B-15 DL-0411-10010 |
| r2418 | r2419 | |
| 53 | 55 | Street Fighter II (US 911101) CPS-B-17 DL-0411-10012 |
| 54 | 56 | Street Fighter II (Japan 911210) CPS-B-13 DL-0411-10008 |
| 55 | 57 | Three Wonders* 1991 89624B-3 RT24B IOB1 90630C-4 CPS-B-21 DL-0921-10014 IOC1 |
| 56 | (alt B-board revision | |
| 58 | (alt B-board revision | |
| 57 | 59 | King of Dragons* 1991 90629B-3 KD29B IOB1 90631C-5 CPS-B-21 DL-0921-10014 C632 IOC1 |
| 58 | 60 | Captain Commando* 1991 91635B-2 CC63B CCPRG IOB1 90631C-5 CPS-B-21 DL-0921-10014 C632 IOC1 |
| 59 | 61 | Knights of the Round* 1991 91635B-2 KR63B BPRG1 IOB1 90631C-5 CPS-B-21 DL-0921-10014 C632 IOC1 |
| r2418 | r2419 | |
| 180 | 182 | bit 4: copy page 4 (stars1) |
| 181 | 183 | bit 5: copy page 5 (stars2) |
| 182 | 184 | |
| 183 | An important quirk is that if bit 0 is not set (sprite page is not copied) | |
| 184 | page 0 in gfxram is not skipped but instead is copied to page 1; that is, | |
| 185 | all pages are moved down by one. For the other pages, if the bit is not | |
| 186 | set the gfxram page is skipped. | |
| 185 | An important quirk is that if the first bits are not set, page 0 in | |
| 186 | gfxram is not skipped but instead is copied to the first enabled page. | |
| 187 | For the other pages, if the bit is not set the gfxram page is skipped. | |
| 188 | Example: 0x0a | |
| 189 | bit 0 is not set so palette page 0 (sprites) is not updated | |
| 190 | bit 1 is set so palette page 1 (scroll1) is updated; since bit 0 was | |
| 191 | not set, it is taken from gfxram page 0 | |
| 192 | bit 2 is not set so palette page 2 (scroll2) is not updated; gfxram | |
| 193 | page 1 is skipped | |
| 194 | bit 3 is set so palette page 3 (scroll3) is updated; it is taken from | |
| 195 | gfxram page 2 | |
| 187 | 196 | |
| 188 | bits 0-3 have been verified with reasonable confidence on a msword pcb, | |
| 189 | while bits 4-5 are only supposed. | |
| 197 | bits 0-3 have been verified on a msword pcb, while bits 4-5 are only | |
| 198 | supposed. | |
| 190 | 199 | |
| 191 | 200 | Fixed registers |
| 192 | 201 | 0x80-0x81 Sound command |
| r2418 | r2419 | |
| 266 | 275 | * Sprites are currently lagged by one frame to keep sync with backgrounds. This causes |
| 267 | 276 | sprites to stay on screen one frame longer (visable in VSAV attract mode). |
| 268 | 277 | |
| 269 | * The boot screen of some CPS2 games has a blue background instead of black, | |
| 270 | however that might be the correct behaviour. | |
| 271 | ||
| 272 | 278 | Marvel Vs. Capcom |
| 273 | 279 | * Sometimes currupt gfx are displayed on the 32x32 layer as the screen flashes at the |
| 274 | 280 | start of super combo moves. The problem seems to be due to tiles being fetched before |
| r2418 | r2419 | |
| 360 | 366 | /* but in many cases it is unknown which bit is which. */ |
| 361 | 367 | int layer_enable_mask[5]; |
| 362 | 368 | |
| 363 | int bank_size; | |
| 369 | int bank_sizes[4]; | |
| 364 | 370 | const struct gfx_range *bank_mapper; |
| 365 | 371 | |
| 366 | 372 | int bank_scroll1; |
| r2418 | r2419 | |
| 409 | 415 | #define HACK_B_1 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x54,{0x52,0x50,0x4e,0x4c},0x5c, {0xff,0xff,0xff,0x00,0x00} |
| 410 | 416 | |
| 411 | 417 | |
| 412 | static const struct gfx_range mapper_LWCHR[] = | |
| 418 | ||
| 419 | #define mapper_LWCHR { 0x8000, 0x8000, 0, 0 }, mapper_LWCHR_table | |
| 420 | static const struct gfx_range mapper_LWCHR_table[] = | |
| 413 | 421 | { |
| 414 | 422 | // verified from PAL dump (PAL16P8B @ 3A): |
| 415 | // bank size = 8000 | |
| 416 | // bank 0 = pin 16 | |
| 417 | // bank 1 = pin 19 | |
| 423 | // bank 0 = pin 19 (ROMs 1,5,8,12) | |
| 424 | // bank 1 = pin 16 (ROMs 2,6,9,13) | |
| 418 | 425 | // pin 12 and pin 14 are always enabled (except for stars) |
| 419 | 426 | // note that allowed codes go up to 0x1ffff but physical ROM is half that size |
| 420 | 427 | |
| 421 | 428 | /* type start end bank */ |
| 422 | { GFXTYPE_STARS, 0x00000, 0x1ffff, 0 }, | |
| 423 | { GFXTYPE_SCROLL2, 0x00000, 0x1ffff, 0 }, | |
| 424 | { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 0 }, | |
| 429 | { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, | |
| 430 | { GFXTYPE_SCROLL1, 0x00000, 0x1ffff, 0 }, | |
| 425 | 431 | |
| 426 | { GFXTYPE_SPRITES, 0x00000, 0x07fff, 1 }, | |
| 427 | { GFXTYPE_SCROLL1, 0x00000, 0x1ffff, 1 }, | |
| 432 | { GFXTYPE_STARS, 0x00000, 0x1ffff, 1 }, | |
| 433 | { GFXTYPE_SCROLL2, 0x00000, 0x1ffff, 1 }, | |
| 434 | { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 1 }, | |
| 428 | 435 | { 0 } |
| 429 | 436 | }; |
| 430 | 437 | |
| 431 | static const struct gfx_range mapper_DM620[] = | |
| 438 | ||
| 439 | #define mapper_DM620 { 0x8000, 0x2000, 0x2000, 0 }, mapper_DM620_table | |
| 440 | static const struct gfx_range mapper_DM620_table[] = | |
| 432 | 441 | { |
| 442 | // verified from PAL dump (PAL16P8B @ 2A): | |
| 443 | // bank 0 = pin 19 (ROMs 5,6,7,8) | |
| 444 | // bank 1 = pin 16 (ROMs 9,11,13,15,18,20,22,24) | |
| 445 | // bank 2 = pin 14 (ROMs 10,12,14,16,19,21,23,25) | |
| 446 | // pin 12 is never enabled | |
| 447 | // note that bank 0 is enabled whenever banks 1 or 2 are not enabled, | |
| 448 | // which would make it highly redundant, so I'm relying on the table | |
| 449 | // to be scanned top to bottom and using a catch-all clause at the end. | |
| 450 | ||
| 433 | 451 | /* type start end bank */ |
| 434 | { GFXTYPE_SPRITES, 0x0000, 0x1fff, 0 }, | |
| 435 | { GFXTYPE_SCROLL1, 0x2000, 0x3fff, 0 }, | |
| 436 | { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 0 }, | |
| 452 | { GFXTYPE_SCROLL3, 0x8000, 0xbfff, 1 }, | |
| 437 | 453 | |
| 438 | { GFXTYPE_SCROLL3, 0x8000, 0x9fff, 1 }, | |
| 439 | { GFXTYPE_SPRITES, 0x2000, 0x7fff, 1 }, // a000-ffff physical | |
| 454 | { GFXTYPE_SPRITES, 0x2000, 0x3fff, 2 }, | |
| 455 | ||
| 456 | { GFXTYPE_STARS | GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 0 }, | |
| 440 | 457 | { 0 } |
| 441 | 458 | }; |
| 442 | 459 | |
| 443 | static const struct gfx_range mapper_ST24M1[] = | |
| 460 | ||
| 461 | #define mapper_ST22B { 0x4000, 0x4000, 0x4000, 0x4000 }, mapper_ST22B_table | |
| 462 | static const struct gfx_range mapper_ST22B_table[] = | |
| 444 | 463 | { |
| 445 | // verified from PAL dump: | |
| 446 | // bank size = 4000 | |
| 464 | // verified from PAL dump (PAL # is not certain): | |
| 447 | 465 | // bank 0 = pin 19 |
| 448 | 466 | // bank 1 = pin 16 |
| 449 | 467 | // bank 2 = pin 14 |
| r2418 | r2419 | |
| 463 | 481 | { 0 } |
| 464 | 482 | }; |
| 465 | 483 | |
| 466 | static const struct gfx_range mapper_dynwar[] = // unknown PAL | |
| 484 | ||
| 485 | #define mapper_TK22B { 0x8000, 0x8000, 0, 0 }, mapper_TK22B_table | |
| 486 | static const struct gfx_range mapper_TK22B_table[] = // unknown PAL | |
| 467 | 487 | { |
| 468 | 488 | /* type start end bank */ |
| 469 | 489 | { GFXTYPE_SPRITES, 0x0000, 0x5fff, 0 }, |
| r2418 | r2419 | |
| 474 | 494 | { 0 } |
| 475 | 495 | }; |
| 476 | 496 | |
| 477 | static const struct gfx_range mapper_WL24B[] = | |
| 497 | ||
| 498 | #define mapper_WL24B { 0x8000, 0x8000, 0, 0 }, mapper_WL24B_table | |
| 499 | static const struct gfx_range mapper_WL24B_table[] = | |
| 478 | 500 | { |
| 479 | 501 | // verified from PAL dump: |
| 480 | // bank size = 8000 | |
| 481 | // bank 0 = pin 16 | |
| 482 | // bank 1 = pin 12 | |
| 502 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 503 | // bank 1 = pin 12 (ROMs 10,12,14,16,20,22,24,26) | |
| 483 | 504 | // pin 14 and pin 19 are never enabled |
| 484 | 505 | |
| 485 | 506 | /* type start end bank */ |
| r2418 | r2419 | |
| 491 | 512 | { 0 } |
| 492 | 513 | }; |
| 493 | 514 | |
| 494 | static const struct gfx_range mapper_S224B[] = | |
| 515 | ||
| 516 | #define mapper_S224B { 0x8000, 0, 0, 0 }, mapper_S224B_table | |
| 517 | static const struct gfx_range mapper_S224B_table[] = | |
| 495 | 518 | { |
| 496 | 519 | // verified from PAL dump: |
| 497 | // bank size = 8000 | |
| 498 | // bank 0 = pin 16 | |
| 520 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 499 | 521 | // pin 12 & pin 14 give an alternate half-size mapping which would allow to |
| 500 | 522 | // populate the 8-bit ROM sockets instead of the 16-bit ones: |
| 501 | 523 | // pin 12 |
| r2418 | r2419 | |
| 515 | 537 | { 0 } |
| 516 | 538 | }; |
| 517 | 539 | |
| 518 | static const struct gfx_range mapper_YI24B[] = | |
| 540 | ||
| 541 | #define mapper_YI24B { 0x8000, 0, 0, 0 }, mapper_YI24B_table | |
| 542 | static const struct gfx_range mapper_YI24B_table[] = | |
| 519 | 543 | { |
| 520 | 544 | // verified from JED: |
| 521 | // bank size = 8000 | |
| 522 | // bank 0 = pin 16 | |
| 545 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 523 | 546 | // pin 12 & pin 14 give an alternate half-size mapping which would allow to |
| 524 | 547 | // populate the 8-bit ROM sockets instead of the 16-bit ones: |
| 525 | 548 | // pin 12 |
| r2418 | r2419 | |
| 538 | 561 | { 0 } |
| 539 | 562 | }; |
| 540 | 563 | |
| 541 | static const struct gfx_range mapper_AR24B[] = | |
| 564 | ||
| 565 | #define mapper_AR24B { 0x8000, 0, 0, 0 }, mapper_AR24B_table | |
| 566 | static const struct gfx_range mapper_AR24B_table[] = | |
| 542 | 567 | { |
| 543 | 568 | // verified from JED: |
| 544 | // bank size = 8000 | |
| 545 | // bank 0 = pin 16 | |
| 569 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 546 | 570 | // pin 12 & pin 14 give an alternate half-size mapping which would allow to |
| 547 | 571 | // populate the 8-bit ROM sockets instead of the 16-bit ones: |
| 548 | 572 | // pin 12 |
| r2418 | r2419 | |
| 561 | 585 | { 0 } |
| 562 | 586 | }; |
| 563 | 587 | |
| 564 | static const struct gfx_range mapper_0224B[] = | |
| 588 | ||
| 589 | #define mapper_0224B { 0x8000, 0x8000, 0, 0 }, mapper_0224B_table | |
| 590 | static const struct gfx_range mapper_0224B_table[] = | |
| 565 | 591 | { |
| 566 | 592 | // verified from PAL dump: |
| 567 | // bank size = 8000 | |
| 568 | // bank 0 = pin 19 | |
| 569 | // bank 1 = pin 12 | |
| 593 | // bank 0 = pin 19 (ROMs 2,4,6,8) | |
| 594 | // bank 1 = pin 12 (ROMs 10,12,14,16,20,22,24,26) | |
| 570 | 595 | // pin 16 & pin 14 appear to be an alternate half-size mapping for bank 0 |
| 571 | 596 | // but scroll1 is missing: |
| 572 | 597 | // pin 16 |
| r2418 | r2419 | |
| 588 | 613 | { 0 } |
| 589 | 614 | }; |
| 590 | 615 | |
| 591 | static const struct gfx_range mapper_MS24B[] = | |
| 616 | ||
| 617 | #define mapper_MS24B { 0x8000, 0, 0, 0 }, mapper_MS24B_table | |
| 618 | static const struct gfx_range mapper_MS24B_table[] = | |
| 592 | 619 | { |
| 593 | 620 | // verified from PAL dump: |
| 594 | // bank size = 8000 | |
| 595 | // bank 0 = pin 16 or pin 14 (for 16-bit or 8-bit ROMs) | |
| 596 | // pin 12 is enabled only for sprites, purpose unknown | |
| 621 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 622 | // pin 14 duplicates pin 16 allowing to populate the 8-bit ROM sockets | |
| 623 | // instead of the 16-bit ones. | |
| 624 | // pin 12 is enabled only for sprites: | |
| 597 | 625 | // 0 0000-3fff |
| 598 | 626 | // pin 19 is never enabled |
| 599 | 627 | |
| r2418 | r2419 | |
| 605 | 633 | { 0 } |
| 606 | 634 | }; |
| 607 | 635 | |
| 608 | static const struct gfx_range mapper_CK24B[] = | |
| 636 | ||
| 637 | #define mapper_CK24B { 0x8000, 0, 0, 0 }, mapper_CK24B_table | |
| 638 | static const struct gfx_range mapper_CK24B_table[] = | |
| 609 | 639 | { |
| 610 | 640 | /* type start end bank */ |
| 611 | 641 | { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, |
| r2418 | r2419 | |
| 615 | 645 | { 0 } |
| 616 | 646 | }; |
| 617 | 647 | |
| 618 | static const struct gfx_range mapper_NM24B[] = | |
| 648 | ||
| 649 | #define mapper_NM24B { 0x8000, 0, 0, 0 }, mapper_NM24B_table | |
| 650 | static const struct gfx_range mapper_NM24B_table[] = | |
| 619 | 651 | { |
| 620 | 652 | // verified from PAL dump: |
| 621 | // bank size = 8000 | |
| 622 | // bank 0 = pin 16 | |
| 653 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 623 | 654 | // pin 12 & pin 14 give an alternate half-size mapping which would allow to |
| 624 | 655 | // populate the 8-bit ROM sockets instead of the 16-bit ones: |
| 625 | 656 | // pin 12 |
| r2418 | r2419 | |
| 642 | 673 | { 0 } |
| 643 | 674 | }; |
| 644 | 675 | |
| 645 | static const struct gfx_range mapper_CA24B[] = | |
| 676 | ||
| 677 | #define mapper_CA24B { 0x8000, 0, 0, 0 }, mapper_CA24B_table | |
| 678 | static const struct gfx_range mapper_CA24B_table[] = | |
| 646 | 679 | { |
| 647 | 680 | // verified from PAL dump: |
| 648 | // bank size = 8000 | |
| 649 | // bank 0 = pin 16 | |
| 681 | // bank 0 = pin 16 (ROMs 1,3,5,7) | |
| 650 | 682 | // pin 12 & pin 14 give an alternate half-size mapping which would allow to |
| 651 | 683 | // populate the 8-bit ROM sockets instead of the 16-bit ones: |
| 652 | 684 | // pin 12 |
| r2418 | r2419 | |
| 670 | 702 | { 0 } |
| 671 | 703 | }; |
| 672 | 704 | |
| 673 | static const struct gfx_range mapper_STF29[] = | |
| 705 | ||
| 706 | #define mapper_STF29 { 0x10000, 0x8000, 0, 0 }, mapper_STF29_table | |
| 707 | static const struct gfx_range mapper_STF29_table[] = | |
| 674 | 708 | { |
| 675 | 709 | /* type start end bank */ |
| 676 | { GFXTYPE_SPRITES, 0x00000, 0x0 | |
| 710 | { GFXTYPE_SPRITES, 0x00000, 0x0ffff, 0 }, | |
| 677 | 711 | |
| 678 | { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 }, | |
| 679 | ||
| 680 | { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 }, | |
| 681 | { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 }, // 12000-13fff physical | |
| 682 | { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 }, // 14000-14fff physical | |
| 683 | { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 }, // 15000-17fff physical | |
| 712 | { GFXTYPE_SPRITES, 0x10000, 0x11fff, 1 }, | |
| 713 | { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 1 }, // 12000-13fff physical | |
| 714 | { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 1 }, // 14000-14fff physical | |
| 715 | { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 1 }, // 15000-17fff physical | |
| 684 | 716 | { 0 } |
| 685 | 717 | }; |
| 686 | 718 | |
| 687 | static const struct gfx_range mapper_RT24B[] = | |
| 719 | ||
| 720 | #define mapper_RT22B { 0x4000, 0x4000, 0x4000, 0x4000 }, mapper_RT22B_table | |
| 721 | static const struct gfx_range mapper_RT22B_table[] = | |
| 688 | 722 | { |
| 689 | /* type start end bank */ | |
| 690 | { GFXTYPE_SPRITES, 0x0000, 0x53ff, 0 }, | |
| 691 | { GFXTYPE_SCROLL1, 0x5400, 0x6fff, 0 }, | |
| 692 | { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 0 }, | |
| 723 | // verified from PAL dump: | |
| 724 | // bank 0 = pin 19 | |
| 725 | // bank 1 = pin 16 | |
| 726 | // bank 2 = pin 14 | |
| 727 | // bank 3 = pin 12 | |
| 693 | 728 | |
| 694 | { GFXTYPE_SCROLL3, 0x0000, 0x27ff, 1 }, // 8000-a7ff physical | |
| 695 | { GFXTYPE_SCROLL2, 0x2800, 0x53ff, 1 }, // a800-d3ff physical | |
| 696 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x5400, 0x7fff, 1 }, // d400-ffff physical | |
| 729 | /* type start end bank */ | |
| 730 | { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, | |
| 731 | ||
| 732 | { GFXTYPE_SPRITES, 0x4000, 0x53ff, 1 }, | |
| 733 | { GFXTYPE_SCROLL1, 0x5400, 0x6fff, 1 }, | |
| 734 | { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 1 }, | |
| 735 | ||
| 736 | { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 2 }, | |
| 737 | { GFXTYPE_SCROLL2, 0x2800, 0x3fff, 2 }, | |
| 738 | ||
| 739 | { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 3 }, | |
| 740 | { GFXTYPE_SPRITES, 0x5400, 0x7fff, 3 }, | |
| 697 | 741 | { 0 } |
| 698 | 742 | }; |
| 699 | 743 | |
| 700 | static const struct gfx_range mapper_KD29B[] = | |
| 744 | ||
| 745 | #define mapper_KD29B { 0x8000, 0x8000, 0, 0 }, mapper_KD29B_table | |
| 746 | static const struct gfx_range mapper_KD29B_table[] = | |
| 701 | 747 | { |
| 702 | 748 | /* type start end bank */ |
| 703 | 749 | { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, |
| r2418 | r2419 | |
| 709 | 755 | { 0 } |
| 710 | 756 | }; |
| 711 | 757 | |
| 712 | static const struct gfx_range mapper_CC63B[] = | |
| 758 | ||
| 759 | #define mapper_CC63B { 0x8000, 0x8000, 0, 0 }, mapper_CC63B_table | |
| 760 | static const struct gfx_range mapper_CC63B_table[] = | |
| 713 | 761 | { |
| 714 | 762 | /* type start end bank */ |
| 715 | 763 | { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, |
| r2418 | r2419 | |
| 721 | 769 | { 0 } |
| 722 | 770 | }; |
| 723 | 771 | |
| 724 | static const struct gfx_range mapper_KR63B[] = | |
| 772 | ||
| 773 | #define mapper_KR63B { 0x8000, 0x8000, 0, 0 }, mapper_KR63B_table | |
| 774 | static const struct gfx_range mapper_KR63B_table[] = | |
| 725 | 775 | { |
| 726 | 776 | /* type start end bank */ |
| 727 | 777 | { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, |
| r2418 | r2419 | |
| 733 | 783 | { 0 } |
| 734 | 784 | }; |
| 735 | 785 | |
| 736 | static const struct gfx_range mapper_S9263B[] = | |
| 786 | ||
| 787 | #define mapper_S9263B { 0x10000, 0x8000, 0, 0 }, mapper_S9263B_table | |
| 788 | static const struct gfx_range mapper_S9263B_table[] = | |
| 737 | 789 | { |
| 738 | 790 | /* type start end bank */ |
| 739 | { GFXTYPE_SPRITES, 0x00000, 0x0 | |
| 791 | { GFXTYPE_SPRITES, 0x00000, 0x0ffff, 0 }, | |
| 740 | 792 | |
| 741 | { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 }, | |
| 742 | ||
| 743 | { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 }, | |
| 744 | { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 }, // 12000-13fff physical | |
| 745 | { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 }, // 14000-14fff physical | |
| 746 | { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 }, // 15000-17fff physical | |
| 793 | { GFXTYPE_SPRITES, 0x10000, 0x11fff, 1 }, | |
| 794 | { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 1 }, // 12000-13fff physical | |
| 795 | { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 1 }, // 14000-14fff physical | |
| 796 | { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 1 }, // 15000-17fff physical | |
| 747 | 797 | { 0 } |
| 748 | 798 | }; |
| 749 | 799 | |
| 750 | static const struct gfx_range mapper_VA24B[] = | |
| 800 | ||
| 801 | #define mapper_VA24B { 0x8000, 0, 0, 0 }, mapper_VA24B_table | |
| 802 | static const struct gfx_range mapper_VA24B_table[] = | |
| 751 | 803 | { |
| 752 | 804 | /* type start end bank */ |
| 753 | 805 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0000, 0x57ff, 0 }, |
| r2418 | r2419 | |
| 756 | 808 | { 0 } |
| 757 | 809 | }; |
| 758 | 810 | |
| 759 | static const struct gfx_range mapper_Q522B[] = | |
| 811 | ||
| 812 | #define mapper_Q522B { 0x8000, 0, 0, 0 }, mapper_Q522B_table | |
| 813 | static const struct gfx_range mapper_Q522B_table[] = | |
| 760 | 814 | { |
| 761 | 815 | /* type start end bank */ |
| 762 | 816 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0000, 0x6fff, 0 }, |
| r2418 | r2419 | |
| 765 | 819 | { 0 } |
| 766 | 820 | }; |
| 767 | 821 | |
| 768 | static const struct gfx_range mapper_TK263B[] = | |
| 822 | ||
| 823 | #define mapper_TK263B { 0x8000, 0x8000, 0, 0 }, mapper_TK263B_table | |
| 824 | static const struct gfx_range mapper_TK263B_table[] = | |
| 769 | 825 | { |
| 770 | 826 | /* type start end bank */ |
| 771 | 827 | { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, |
| r2418 | r2419 | |
| 776 | 832 | { 0 } |
| 777 | 833 | }; |
| 778 | 834 | |
| 779 | static const struct gfx_range mapper_CD63B[] = | |
| 835 | ||
| 836 | #define mapper_CD63B { 0x8000, 0x8000, 0, 0 }, mapper_CD63B_table | |
| 837 | static const struct gfx_range mapper_CD63B_table[] = | |
| 780 | 838 | { |
| 781 | 839 | /* type start end bank */ |
| 782 | 840 | { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, |
| r2418 | r2419 | |
| 787 | 845 | { 0 } |
| 788 | 846 | }; |
| 789 | 847 | |
| 790 | static const struct gfx_range mapper_PS63B[] = | |
| 848 | ||
| 849 | #define mapper_PS63B { 0x8000, 0x8000, 0, 0 }, mapper_PS63B_table | |
| 850 | static const struct gfx_range mapper_PS63B_table[] = | |
| 791 | 851 | { |
| 792 | /* type start end bank */ | |
| 793 | { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, | |
| 794 | { GFXTYPE_SPRITES, 0x1000, 0x7fff, 0 }, | |
| 852 | /* type start end bank */ | |
| 853 | { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, | |
| 854 | { GFXTYPE_SPRITES, 0x1000, 0x7fff, 0 }, | |
| 795 | 855 | |
| 796 | { GFXTYPE_SPRITES, 0x8000, 0xa7ff, 1 }, | |
| 797 | { GFXTYPE_SCROLL2, 0xa800, 0xdbff, 1 }, | |
| 798 | { GFXTYPE_SCROLL3, 0xdc00, 0xffff, 1 }, | |
| 856 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x8000, 0xdbff, 1 }, | |
| 857 | { GFXTYPE_SCROLL3, 0xdc00, 0xffff, 1 }, | |
| 799 | 858 | { 0 } |
| 800 | 859 | }; |
| 801 | 860 | |
| 802 | static const struct gfx_range mapper_MB63B[] = | |
| 861 | ||
| 862 | #define mapper_MB63B { 0x10000, 0x8000, 0, 0 }, mapper_MB63B_table | |
| 863 | static const struct gfx_range mapper_MB63B_table[] = | |
| 803 | 864 | { |
| 804 | 865 | /* type start end bank */ |
| 805 | 866 | { GFXTYPE_SCROLL1, 0x00000, 0x00fff, 0 }, |
| 806 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x01000, 0x0 | |
| 867 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x01000, 0x0ffff, 0 }, | |
| 807 | 868 | |
| 808 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x08000, 0x0ffff, 1 }, | |
| 809 | ||
| 810 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x10000, 0x167ff, 2 }, | |
| 811 | { GFXTYPE_SCROLL3, 0x16800, 0x17fff, 2 }, | |
| 869 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x10000, 0x167ff, 1 }, | |
| 870 | { GFXTYPE_SCROLL3, 0x16800, 0x17fff, 1 }, | |
| 812 | 871 | { 0 } |
| 813 | 872 | }; |
| 814 | 873 | |
| 815 | static const struct gfx_range mapper_QD22B[] = | |
| 874 | ||
| 875 | #define mapper_QD22B { 0x4000, 0, 0, 0 }, mapper_QD22B_table | |
| 876 | static const struct gfx_range mapper_QD22B_table[] = | |
| 816 | 877 | { |
| 817 | /* type start end bank */ | |
| 818 | { GFXTYPE_SCROLL1, 0x0000, 0x07ff, 0 }, | |
| 819 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0800, 0x27ff, 0 }, | |
| 820 | { GFXTYPE_SCROLL3, 0x2800, 0x3fff, 0 }, | |
| 878 | // verified from PAL dump: | |
| 879 | // bank 0 = pin 19 | |
| 880 | ||
| 881 | /* type start end bank */ | |
| 882 | { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, | |
| 883 | { GFXTYPE_SCROLL1, 0x0000, 0x3fff, 0 }, | |
| 884 | { GFXTYPE_SCROLL2, 0x0000, 0x3fff, 0 }, | |
| 885 | { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 0 }, | |
| 821 | 886 | { 0 } |
| 822 | 887 | }; |
| 823 | 888 | |
| 824 | static const struct gfx_range mapper_qadj[] = | |
| 889 | ||
| 890 | #define mapper_qadj { 0x8000, 0, 0, 0 }, mapper_qadj_table | |
| 891 | static const struct gfx_range mapper_qadj_table[] = | |
| 825 | 892 | { |
| 826 | 893 | /* type start end bank */ |
| 827 | 894 | { GFXTYPE_SCROLL1, 0x0000, 0x07ff, 0 }, |
| r2418 | r2419 | |
| 830 | 897 | { 0 } |
| 831 | 898 | }; |
| 832 | 899 | |
| 833 | static const struct gfx_range mapper_qtono2[] = | |
| 900 | ||
| 901 | #define mapper_qtono2 { 0x8000, 0x8000, 0, 0 }, mapper_qtono2_table | |
| 902 | static const struct gfx_range mapper_qtono2_table[] = | |
| 834 | 903 | { |
| 835 | 904 | /* type start end bank */ |
| 836 | 905 | { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, |
| r2418 | r2419 | |
| 841 | 910 | { 0 } |
| 842 | 911 | }; |
| 843 | 912 | |
| 844 | static const struct gfx_range mapper_RCM63B[] = | |
| 913 | ||
| 914 | #define mapper_RCM63B { 0x8000, 0x8000, 0x8000, 0x8000 }, mapper_RCM63B_table | |
| 915 | static const struct gfx_range mapper_RCM63B_table[] = | |
| 845 | 916 | { |
| 846 | 917 | /* type start end bank */ |
| 847 | 918 | { GFXTYPE_SCROLL1, 0x00000, 0x017ff, 0 }, |
| r2418 | r2419 | |
| 856 | 927 | { 0 } |
| 857 | 928 | }; |
| 858 | 929 | |
| 859 | static const struct gfx_range mapper_pnickj[] = | |
| 930 | ||
| 931 | #define mapper_pnickj { 0x8000, 0, 0, 0 }, mapper_pnickj_table | |
| 932 | static const struct gfx_range mapper_pnickj_table[] = | |
| 860 | 933 | { |
| 861 | 934 | /* type start end bank */ |
| 862 | 935 | { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, |
| r2418 | r2419 | |
| 865 | 938 | { 0 } |
| 866 | 939 | }; |
| 867 | 940 | |
| 868 | static const struct gfx_range mapper_pang3[] = | |
| 941 | ||
| 942 | #define mapper_pang3 { 0x8000, 0x8000, 0, 0 }, mapper_pang3_table | |
| 943 | static const struct gfx_range mapper_pang3_table[] = | |
| 869 | 944 | { |
| 870 | 945 | /* type start end bank */ |
| 871 | 946 | { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0000, 0x7fff, 0 }, |
| r2418 | r2419 | |
| 884 | 959 | (sprites are not listed here because they are addressed linearly by the CPS2 |
| 885 | 960 | sprite code) |
| 886 | 961 | */ |
| 887 | static const struct gfx_range mapper_cps2[] = | |
| 962 | #define mapper_cps2 { 0x20000, 0x20000, 0, 0 }, mapper_cps2_table | |
| 963 | static const struct gfx_range mapper_cps2_table[] = | |
| 888 | 964 | { |
| 889 | 965 | /* type start end bank */ |
| 890 | { GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x07fff, 4 }, // 20000-27fff physical | |
| 891 | { GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x08000, 0x0ffff, 5 }, // 28000-2ffff physical | |
| 892 | { GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x10000, 0x17fff, 6 }, // 30000-37fff physical | |
| 893 | { GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x18000, 0x1ffff, 7 }, // 38000-3ffff physical | |
| 966 | { GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 1 }, // 20000-3ffff physical | |
| 894 | 967 | { 0 } |
| 895 | 968 | }; |
| 896 | 969 | |
| r2418 | r2419 | |
| 898 | 971 | |
| 899 | 972 | static const struct CPS1config cps1_config_table[]= |
| 900 | 973 | { |
| 901 | /* name CPSB bank size gfx mapper kludge */ | |
| 902 | {"forgottn", CPS_B_01, 0x8000, mapper_LWCHR }, | |
| 903 | {"lostwrld", CPS_B_01, 0x8000, mapper_LWCHR }, | |
| 904 | {"ghouls", CPS_B_01, 0x8000, mapper_DM620 }, | |
| 905 | {"ghoulsu", CPS_B_01, 0x8000, mapper_DM620 }, | |
| 906 | {"daimakai", CPS_B_01, 0x8000, mapper_DM620 }, | |
| 907 | {"strider", CPS_B_01, 0x4000, mapper_ST24M1 }, | |
| 908 | {"stridrua", CPS_B_01, 0x4000, mapper_ST24M1 }, | |
| 909 | {"striderj", CPS_B_01, 0x4000, mapper_ST24M1 }, | |
| 910 | {"stridrja", CPS_B_01, 0x4000, mapper_ST24M1 }, | |
| 911 | {"dynwar", CPS_B_02, 0x8000, mapper_dynwar }, | |
| 912 | {"dynwarj", CPS_B_02, 0x8000, mapper_dynwar }, | |
| 913 | {"willow", CPS_B_03, 0x8000, mapper_WL24B }, | |
| 914 | {"willowj", CPS_B_03, 0x8000, mapper_WL24B }, | |
| 915 | {"willowje", CPS_B_03, 0x8000, mapper_WL24B }, | |
| 916 | {"ffight", CPS_B_04, 0x8000, mapper_S224B }, | |
| 917 | {"ffightu", CPS_B_04, 0x8000, mapper_S224B }, | |
| 918 | {"ffightua", CPS_B_01, 0x8000, mapper_S224B }, | |
| 919 | {"ffightub", CPS_B_05, 0x8000, mapper_S224B }, | |
| 920 | {"ffightj", CPS_B_04, 0x8000, mapper_S224B }, | |
| 921 | {"ffightj1", CPS_B_02, 0x8000, mapper_S224B }, | |
| 922 | {"1941", CPS_B_05, 0x8000, mapper_YI24B }, | |
| 923 | {"1941j", CPS_B_05, 0x8000, mapper_YI24B }, | |
| 924 | {"unsquad", CPS_B_11, 0x8000, mapper_AR24B }, /* CPSB ID not checked, but it's the same as sf2eg */ | |
| 925 | {"area88", CPS_B_11, 0x8000, mapper_AR24B }, /* CPSB ID not checked, but it's the same as sf2eg */ | |
| 926 | {"mercs", CPS_B_12, 0x8000, mapper_0224B }, /* (uses port 74) */ | |
| 927 | {"mercsu", CPS_B_12, 0x8000, mapper_0224B }, /* (uses port 74) */ | |
| 928 | {"mercsua", CPS_B_12, 0x8000, mapper_0224B }, /* (uses port 74) */ | |
| 929 | {"mercsj", CPS_B_12, 0x8000, mapper_0224B }, /* (uses port 74) */ | |
| 930 | {"msword", CPS_B_13, 0x8000, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 931 | {"mswordr1", CPS_B_13, 0x8000, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 932 | {"mswordu", CPS_B_13, 0x8000, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 933 | {"mswordj", CPS_B_13, 0x8000, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 934 | {"mtwins", CPS_B_14, 0x8000, mapper_CK24B }, | |
| 935 | {"chikij", CPS_B_14, 0x8000, mapper_CK24B }, | |
| 936 | {"nemo", CPS_B_15, 0x8000, mapper_NM24B }, | |
| 937 | {"nemoj", CPS_B_15, 0x8000, mapper_NM24B }, | |
| 938 | {"cawing", CPS_B_16, 0x8000, mapper_CA24B }, | |
| 939 | {"cawingr1", CPS_B_16, 0x8000, mapper_CA24B }, | |
| 940 | {"cawingu", CPS_B_16, 0x8000, mapper_CA24B }, | |
| 941 | {"cawingj", CPS_B_16, 0x8000, mapper_CA24B }, | |
| 942 | {"sf2", CPS_B_11, 0x8000, mapper_STF29 }, | |
| 943 | {"sf2eb", CPS_B_17, 0x8000, mapper_STF29 }, | |
| 944 | {"sf2ua", CPS_B_17, 0x8000, mapper_STF29 }, | |
| 945 | {"sf2ub", CPS_B_17, 0x8000, mapper_STF29 }, | |
| 946 | {"sf2ud", CPS_B_05, 0x8000, mapper_STF29 }, | |
| 947 | {"sf2ue", CPS_B_18, 0x8000, mapper_STF29 }, | |
| 948 | {"sf2uf", CPS_B_15, 0x8000, mapper_STF29 }, | |
| 949 | {"sf2ui", CPS_B_14, 0x8000, mapper_STF29 }, | |
| 950 | {"sf2uk", CPS_B_17, 0x8000, mapper_STF29 }, // check CPS_B | |
| 951 | {"sf2j", CPS_B_13, 0x8000, mapper_STF29 }, | |
| 952 | {"sf2ja", CPS_B_17, 0x8000, mapper_STF29 }, | |
| 953 | {"sf2jc", CPS_B_12, 0x8000, mapper_STF29 }, | |
| 974 | /* name CPSB gfx mapper kludge */ | |
| 975 | {"forgottn", CPS_B_01, mapper_LWCHR }, | |
| 976 | {"lostwrld", CPS_B_01, mapper_LWCHR }, | |
| 977 | {"ghouls", CPS_B_01, mapper_DM620 }, | |
| 978 | {"ghoulsu", CPS_B_01, mapper_DM620 }, | |
| 979 | {"daimakai", CPS_B_01, mapper_DM620 }, | |
| 980 | {"strider", CPS_B_01, mapper_ST22B }, | |
| 981 | {"stridrua", CPS_B_01, mapper_ST22B }, | |
| 982 | {"striderj", CPS_B_01, mapper_ST22B }, | |
| 983 | {"stridrja", CPS_B_01, mapper_ST22B }, | |
| 984 | {"dynwar", CPS_B_02, mapper_TK22B }, | |
| 985 | {"dynwarj", CPS_B_02, mapper_TK22B }, | |
| 986 | {"willow", CPS_B_03, mapper_WL24B }, | |
| 987 | {"willowj", CPS_B_03, mapper_WL24B }, | |
| 988 | {"willowje", CPS_B_03, mapper_WL24B }, | |
| 989 | {"ffight", CPS_B_04, mapper_S224B }, | |
| 990 | {"ffightu", CPS_B_04, mapper_S224B }, | |
| 991 | {"ffightua", CPS_B_01, mapper_S224B }, | |
| 992 | {"ffightub", CPS_B_05, mapper_S224B }, | |
| 993 | {"ffightj", CPS_B_04, mapper_S224B }, | |
| 994 | {"ffightj1", CPS_B_02, mapper_S224B }, | |
| 995 | {"1941", CPS_B_05, mapper_YI24B }, | |
| 996 | {"1941j", CPS_B_05, mapper_YI24B }, | |
| 997 | {"unsquad", CPS_B_11, mapper_AR24B }, /* CPSB ID not checked, but it's the same as sf2eg */ | |
| 998 | {"area88", CPS_B_11, mapper_AR24B }, /* CPSB ID not checked, but it's the same as sf2eg */ | |
| 999 | {"mercs", CPS_B_12, mapper_0224B }, /* (uses port 74) */ | |
| 1000 | {"mercsu", CPS_B_12, mapper_0224B }, /* (uses port 74) */ | |
| 1001 | {"mercsua", CPS_B_12, mapper_0224B }, /* (uses port 74) */ | |
| 1002 | {"mercsj", CPS_B_12, mapper_0224B }, /* (uses port 74) */ | |
| 1003 | {"msword", CPS_B_13, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 1004 | {"mswordr1", CPS_B_13, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 1005 | {"mswordu", CPS_B_13, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 1006 | {"mswordj", CPS_B_13, mapper_MS24B }, /* CPSB ID not checked, but it's the same as sf2j */ | |
| 1007 | {"mtwins", CPS_B_14, mapper_CK24B }, | |
| 1008 | {"chikij", CPS_B_14, mapper_CK24B }, | |
| 1009 | {"nemo", CPS_B_15, mapper_NM24B }, | |
| 1010 | {"nemoj", CPS_B_15, mapper_NM24B }, | |
| 1011 | {"cawing", CPS_B_16, mapper_CA24B }, | |
| 1012 | {"cawingr1", CPS_B_16, mapper_CA24B }, | |
| 1013 | {"cawingu", CPS_B_16, mapper_CA24B }, | |
| 1014 | {"cawingj", CPS_B_16, mapper_CA24B }, | |
| 1015 | {"sf2", CPS_B_11, mapper_STF29 }, | |
| 1016 | {"sf2eb", CPS_B_17, mapper_STF29 }, | |
| 1017 | {"sf2ua", CPS_B_17, mapper_STF29 }, | |
| 1018 | {"sf2ub", CPS_B_17, mapper_STF29 }, | |
| 1019 | {"sf2ud", CPS_B_05, mapper_STF29 }, | |
| 1020 | {"sf2ue", CPS_B_18, mapper_STF29 }, | |
| 1021 | {"sf2uf", CPS_B_15, mapper_STF29 }, | |
| 1022 | {"sf2ui", CPS_B_14, mapper_STF29 }, | |
| 1023 | {"sf2uk", CPS_B_17, mapper_STF29 }, // check CPS_B | |
| 1024 | {"sf2j", CPS_B_13, mapper_STF29 }, | |
| 1025 | {"sf2ja", CPS_B_17, mapper_STF29 }, | |
| 1026 | {"sf2jc", CPS_B_12, mapper_STF29 }, | |
| 954 | 1027 | /* from here onwards the CPS-B board has suicide battery and multiply protection */ |
| 955 | {"3wonders", BATTRY_1, 0x8000, mapper_RT24B }, | |
| 956 | {"3wonderu", BATTRY_1, 0x8000, mapper_RT24B }, | |
| 957 | {"wonder3", BATTRY_1, 0x8000, mapper_RT24B }, | |
| 958 | {"kod", BATTRY_2, 0x8000, mapper_KD29B }, | |
| 959 | {"kodu", BATTRY_2, 0x8000, mapper_KD29B }, | |
| 960 | {"kodj", BATTRY_2, 0x8000, mapper_KD29B }, | |
| 961 | {"kodb", BATTRY_2, 0x8000, mapper_KD29B }, /* bootleg, doesn't use multiply protection */ | |
| 962 | {"captcomm", BATTRY_3, 0x8000, mapper_CC63B }, | |
| 963 | {"captcomu", BATTRY_3, 0x8000, mapper_CC63B }, | |
| 964 | {"captcomj", BATTRY_3, 0x8000, mapper_CC63B }, | |
| 965 | {"knights", BATTRY_4, 0x8000, mapper_KR63B }, | |
| 966 | {"knightsu", BATTRY_4, 0x8000, mapper_KR63B }, | |
| 967 | {"knightsj", BATTRY_4, 0x8000, mapper_KR63B }, | |
| 968 | {"sf2ce", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 969 | {"sf2ceua", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 970 | {"sf2ceub", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 971 | {"sf2ceuc", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 972 | {"sf2cej", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 973 | {"sf2rb", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 974 | {"sf2rb2", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 975 | {"sf2red", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 976 | {"sf2v004", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 977 | {"sf2accp2", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 978 | {"sf2m1", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 979 | {"sf2m2", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 980 | {"sf2m3", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 981 | {"sf2m4", HACK_B_1, 0x8000, mapper_S9263B, 1 }, | |
| 982 | {"sf2m5", NOBATTRY, 0x8000, mapper_S9263B, 1 }, | |
| 983 | {"sf2m6", NOBATTRY, 0x8000, mapper_S9263B, 1 }, | |
| 984 | {"sf2m7", NOBATTRY, 0x8000, mapper_S9263B, 1 }, | |
| 985 | {"sf2yyc", NOBATTRY, 0x8000, mapper_S9263B, 1 }, | |
| 986 | {"sf2koryu", NOBATTRY, 0x8000, mapper_S9263B, 1 }, | |
| 987 | {"varth", CPS_B_04, 0x8000, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 988 | {"varthr1", CPS_B_04, 0x8000, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 989 | {"varthu", CPS_B_04, 0x8000, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 990 | {"varthj", BATTRY_5, 0x8000, mapper_VA24B }, /* CPSB test has been patched out (72=0001) */ | |
| 991 | {"cworld2j", BATTRY_6, 0x8000, mapper_Q522B }, /* The 0x76 priority values are incorrect values */ | |
| 992 | {"wof", NOBATTRY, 0x8000, mapper_TK263B }, /* bootleg? */ | |
| 993 | {"wofa", NOBATTRY, 0x8000, mapper_TK263B }, /* bootleg? */ | |
| 994 | {"wofu", QSOUND_1, 0x8000, mapper_TK263B }, | |
| 995 | {"wofj", QSOUND_1, 0x8000, mapper_TK263B }, | |
| 996 | {"dino", QSOUND_2, 0x8000, mapper_CD63B }, /* layer enable never used */ | |
| 997 | {"dinou", QSOUND_2, 0x8000, mapper_CD63B }, /* layer enable never used */ | |
| 998 | {"dinoj", QSOUND_2, 0x8000, mapper_CD63B }, /* layer enable never used */ | |
| 999 | {"punisher", QSOUND_3, 0x8000, mapper_PS63B }, | |
| 1000 | {"punishru", QSOUND_3, 0x8000, mapper_PS63B }, | |
| 1001 | {"punishrj", QSOUND_3, 0x8000, mapper_PS63B }, | |
| 1002 | {"slammast", QSOUND_4, 0x8000, mapper_MB63B }, | |
| 1003 | {"slammasu", QSOUND_4, 0x8000, mapper_MB63B }, | |
| 1004 | {"mbomberj", QSOUND_4, 0x8000, mapper_MB63B }, | |
| 1005 | {"mbombrd", QSOUND_5, 0x8000, mapper_MB63B }, | |
| 1006 | {"mbombrdj", QSOUND_5, 0x8000, mapper_MB63B }, | |
| 1007 | {"sf2hf", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 1008 | {"sf2t", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 1009 | {"sf2tj", NOBATTRY, 0x8000, mapper_S9263B }, | |
| 1010 | {"qad", BATTRY_7, 0x8000, mapper_QD22B }, /* TODO: layer enable */ | |
| 1011 | {"qadj", NOBATTRY, 0x8000, mapper_qadj }, | |
| 1012 | {"qtono2", NOBATTRY, 0x8000, mapper_qtono2 }, | |
| 1013 | {"megaman", NOBATTRY, 0x8000, mapper_RCM63B }, | |
| 1014 | {"rockmanj", NOBATTRY, 0x8000, mapper_RCM63B }, | |
| 1015 | {"pnickj", NOBATTRY, 0x8000, mapper_pnickj }, | |
| 1016 | {"pang3", NOBATTRY, 0x8000, mapper_pang3 }, /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */ | |
| 1017 | {"pang3j", NOBATTRY, 0x8000, mapper_pang3 }, /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */ | |
| 1028 | {"3wonders", BATTRY_1, mapper_RT22B }, | |
| 1029 | {"3wonderu", BATTRY_1, mapper_RT22B }, | |
| 1030 | {"wonder3", BATTRY_1, mapper_RT22B }, | |
| 1031 | {"kod", BATTRY_2, mapper_KD29B }, | |
| 1032 | {"kodu", BATTRY_2, mapper_KD29B }, | |
| 1033 | {"kodj", BATTRY_2, mapper_KD29B }, | |
| 1034 | {"kodb", BATTRY_2, mapper_KD29B }, /* bootleg, doesn't use multiply protection */ | |
| 1035 | {"captcomm", BATTRY_3, mapper_CC63B }, | |
| 1036 | {"captcomu", BATTRY_3, mapper_CC63B }, | |
| 1037 | {"captcomj", BATTRY_3, mapper_CC63B }, | |
| 1038 | {"knights", BATTRY_4, mapper_KR63B }, | |
| 1039 | {"knightsu", BATTRY_4, mapper_KR63B }, | |
| 1040 | {"knightsj", BATTRY_4, mapper_KR63B }, | |
| 1041 | {"sf2ce", NOBATTRY, mapper_S9263B }, | |
| 1042 | {"sf2ceua", NOBATTRY, mapper_S9263B }, | |
| 1043 | {"sf2ceub", NOBATTRY, mapper_S9263B }, | |
| 1044 | {"sf2ceuc", NOBATTRY, mapper_S9263B }, | |
| 1045 | {"sf2cej", NOBATTRY, mapper_S9263B }, | |
| 1046 | {"sf2rb", NOBATTRY, mapper_S9263B }, | |
| 1047 | {"sf2rb2", NOBATTRY, mapper_S9263B }, | |
| 1048 | {"sf2red", NOBATTRY, mapper_S9263B }, | |
| 1049 | {"sf2v004", NOBATTRY, mapper_S9263B }, | |
| 1050 | {"sf2accp2", NOBATTRY, mapper_S9263B }, | |
| 1051 | {"sf2m1", NOBATTRY, mapper_S9263B }, | |
| 1052 | {"sf2m2", NOBATTRY, mapper_S9263B }, | |
| 1053 | {"sf2m3", NOBATTRY, mapper_S9263B }, | |
| 1054 | {"sf2m4", HACK_B_1, mapper_S9263B, 1 }, | |
| 1055 | {"sf2m5", NOBATTRY, mapper_S9263B, 1 }, | |
| 1056 | {"sf2m6", NOBATTRY, mapper_S9263B, 1 }, | |
| 1057 | {"sf2m7", NOBATTRY, mapper_S9263B, 1 }, | |
| 1058 | {"sf2yyc", NOBATTRY, mapper_S9263B, 1 }, | |
| 1059 | {"sf2koryu", NOBATTRY, mapper_S9263B, 1 }, | |
| 1060 | {"varth", CPS_B_04, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 1061 | {"varthr1", CPS_B_04, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 1062 | {"varthu", CPS_B_04, mapper_VA24B }, /* CPSB test has been patched out (60=0008) */ | |
| 1063 | {"varthj", BATTRY_5, mapper_VA24B }, /* CPSB test has been patched out (72=0001) */ | |
| 1064 | {"cworld2j", BATTRY_6, mapper_Q522B }, /* The 0x76 priority values are incorrect values */ | |
| 1065 | {"wof", NOBATTRY, mapper_TK263B }, /* bootleg? */ | |
| 1066 | {"wofa", NOBATTRY, mapper_TK263B }, /* bootleg? */ | |
| 1067 | {"wofu", QSOUND_1, mapper_TK263B }, | |
| 1068 | {"wofj", QSOUND_1, mapper_TK263B }, | |
| 1069 | {"dino", QSOUND_2, mapper_CD63B }, /* layer enable never used */ | |
| 1070 | {"dinou", QSOUND_2, mapper_CD63B }, /* layer enable never used */ | |
| 1071 | {"dinoj", QSOUND_2, mapper_CD63B }, /* layer enable never used */ | |
| 1072 | {"punisher", QSOUND_3, mapper_PS63B }, | |
| 1073 | {"punishru", QSOUND_3, mapper_PS63B }, | |
| 1074 | {"punishrj", QSOUND_3, mapper_PS63B }, | |
| 1075 | {"slammast", QSOUND_4, mapper_MB63B }, | |
| 1076 | {"slammasu", QSOUND_4, mapper_MB63B }, | |
| 1077 | {"mbomberj", QSOUND_4, mapper_MB63B }, | |
| 1078 | {"mbombrd", QSOUND_5, mapper_MB63B }, | |
| 1079 | {"mbombrdj", QSOUND_5, mapper_MB63B }, | |
| 1080 | {"sf2hf", NOBATTRY, mapper_S9263B }, | |
| 1081 | {"sf2t", NOBATTRY, mapper_S9263B }, | |
| 1082 | {"sf2tj", NOBATTRY, mapper_S9263B }, | |
| 1083 | {"qad", BATTRY_7, mapper_QD22B }, /* TODO: layer enable */ | |
| 1084 | {"qadj", NOBATTRY, mapper_qadj }, | |
| 1085 | {"qtono2", NOBATTRY, mapper_qtono2 }, | |
| 1086 | {"megaman", NOBATTRY, mapper_RCM63B }, | |
| 1087 | {"rockmanj", NOBATTRY, mapper_RCM63B }, | |
| 1088 | {"pnickj", NOBATTRY, mapper_pnickj }, | |
| 1089 | {"pang3", NOBATTRY, mapper_pang3 }, /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */ | |
| 1090 | {"pang3j", NOBATTRY, mapper_pang3 }, /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */ | |
| 1018 | 1091 | #ifdef MESS |
| 1019 | {"sfzch", NOBATTRY, | |
| 1092 | {"sfzch", NOBATTRY, | |
| 1020 | 1093 | #endif |
| 1021 | 1094 | |
| 1022 | 1095 | /* CPS2 games */ |
| 1023 | {"cps2", NOBATTRY, | |
| 1096 | {"cps2", NOBATTRY, | |
| 1024 | 1097 | |
| 1025 | 1098 | {0} /* End of table */ |
| 1026 | 1099 | }; |
| r2418 | r2419 | |
| 1527 | 1600 | { |
| 1528 | 1601 | if (range->type & type) |
| 1529 | 1602 | { |
| 1530 | return ((code & (cps1_game_config->bank_size - 1)) + (range->bank * cps1_game_config->bank_size)) >> shift; | |
| 1603 | int base = 0; | |
| 1604 | int i; | |
| 1605 | ||
| 1606 | for (i = 0; i < range->bank; ++i) | |
| 1607 | base += cps1_game_config->bank_sizes[i]; | |
| 1608 | ||
| 1609 | return (base + (code & (cps1_game_config->bank_sizes[range->bank] - 1))) >> shift; | |
| 1531 | 1610 | } |
| 1532 | 1611 | } |
| 1533 | 1612 | |
| r2418 | r2419 | |
| 1735 | 1814 | |
| 1736 | 1815 | /* |
| 1737 | 1816 | The palette is copied only for pages that are enabled in the ctrl |
| 1738 | register. Note that if the sprite palette (page 0) is skipped, the | |
| 1739 | all the following pages are scaled down by one. | |
| 1817 | register. Note that if the first palette pages are skipped, all | |
| 1818 | the following pages are scaled down. | |
| 1740 | 1819 | */ |
| 1741 | 1820 | for (page = 0; page < 6; ++page) |
| 1742 | 1821 | { |
| r2418 | r2419 | |
| 1761 | 1840 | } |
| 1762 | 1841 | else |
| 1763 | 1842 | { |
| 1764 | if (page > 0) | |
| 1843 | // skip page in gfxram, but only if we have already copied at least one page | |
| 1844 | if (palette_ram != palette_base) | |
| 1765 | 1845 | palette_ram += 0x200; |
| 1766 | 1846 | } |
| 1767 | 1847 | } |
| r2418 | r2419 | |
| 2358 | 2438 | |
| 2359 | 2439 | |
| 2360 | 2440 | /* Blank screen */ |
| 2361 | fillbitmap(bitmap,0xbff,cliprect); | |
| 2441 | if (cps_version == 1) | |
| 2442 | { | |
| 2443 | // CPS1 games use pen 0xbff as background color; this is used in 3wonders, | |
| 2444 | // mtwins (explosion during attract), mercs (intermission). | |
| 2445 | fillbitmap(bitmap,0xbff,cliprect); | |
| 2446 | } | |
| 2447 | else | |
| 2448 | { | |
| 2449 | // CPS2 apparently always force the background to black. Several games would | |
| 2450 | // should a blue screen during boot if we used the same code as CPS1. | |
| 2451 | // Maybe Capcom changed the background handling due to the problems that | |
| 2452 | // it caused on several monitors (because the background extended into the | |
| 2453 | // blanking area instead of going black, causing the monitor to clip). | |
| 2454 | fillbitmap(bitmap,get_black_pen(screen->machine),cliprect); | |
| 2455 | } | |
| 2362 | 2456 | |
| 2363 | 2457 | cps1_render_stars(screen, bitmap,cliprect); |
| 2364 | 2458 |
| r2418 | r2419 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | WRITE16_HANDLER( bionicc_paletteram_w ) |
| 133 | 133 | { |
| 134 | /* The bottom bits are 'intensity' here, but level 2 of Top Secret shows that even | |
| 135 | when intensity is zero the colour is not reduced to pure black, (the sky should stay | |
| 136 | at dark blue rather than absolute black) */ | |
| 134 | int r, g, b, bright; | |
| 137 | 135 | data = COMBINE_DATA(&paletteram16[offset]); |
| 138 | paletteram16_RRRRGGGGBBBBIIII_word_w(machine,offset,(data & 0xfff0) | ((data & 0x0007) << 1) | 1, 0); | |
| 136 | ||
| 137 | bright = (data&0x0f); | |
| 138 | ||
| 139 | r = ((data>>12)&0x0f) * 0x11; | |
| 140 | g = ((data>>8 )&0x0f) * 0x11; | |
| 141 | b = ((data>>4 )&0x0f) * 0x11; | |
| 142 | ||
| 143 | if ((bright & 0x08) == 0) | |
| 144 | { | |
| 145 | r = r * (0x07 + bright) / 0x0e; | |
| 146 | g = g * (0x07 + bright) / 0x0e; | |
| 147 | b = b * (0x07 + bright) / 0x0e; | |
| 148 | } | |
| 149 | ||
| 150 | palette_set_color (machine, offset, MAKE_RGB(r, g, b)); | |
| 139 | 151 | } |
| 140 | 152 | |
| 141 | 153 | WRITE16_HANDLER( bionicc_scroll_w ) |
| r2418 | r2419 | |
|---|---|---|
| 372 | 372 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03ff) AM_WRITE(qix_palettebank_w) |
| 373 | 373 | AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x03fe) AM_READWRITE(qix_data_firq_r, qix_data_firq_w) |
| 374 | 374 | AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_video_firq_ack_r, qix_video_firq_ack_w) |
| 375 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 375 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 376 | 376 | AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w) |
| 377 | 377 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| 378 | 378 | AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(SMH_RAM) AM_BASE_MEMBER(qix_state, scanline_latch) |
| r2418 | r2419 | |
| 390 | 390 | AM_RANGE(0x8801, 0x8801) AM_MIRROR(0x03fe) AM_WRITE(zookeep_bankswitch_w) |
| 391 | 391 | AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x03fe) AM_READWRITE(qix_data_firq_r, qix_data_firq_w) |
| 392 | 392 | AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_video_firq_ack_r, qix_video_firq_ack_w) |
| 393 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 393 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 394 | 394 | AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w) |
| 395 | 395 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| 396 | 396 | AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(SMH_RAM) AM_BASE_MEMBER(qix_state, scanline_latch) |
| r2418 | r2419 | |
| 408 | 408 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03ff) AM_WRITE(qix_palettebank_w) |
| 409 | 409 | AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x03fe) AM_READWRITE(qix_data_firq_r, qix_data_firq_w) |
| 410 | 410 | AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_video_firq_ack_r, qix_video_firq_ack_w) |
| 411 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 411 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 412 | 412 | AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, slither_addresslatch_w) |
| 413 | 413 | AM_RANGE(0x9401, 0x9401) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_mask) |
| 414 | 414 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| r2418 | r2419 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | READ16_HANDLER( nndmseal_priority_r ) | |
| 133 | { | |
| 134 | return tetrisp2_priority[offset] | 0xff00; | |
| 135 | } | |
| 132 | 136 | |
| 133 | 137 | |
| 134 | 138 | /*************************************************************************** |
| r2418 | r2419 | |
| 284 | 288 | tilemap_set_transparent_pen(tilemap_rot,0); |
| 285 | 289 | } |
| 286 | 290 | |
| 291 | VIDEO_START( nndmseal ) | |
| 292 | { | |
| 293 | VIDEO_START_CALL( tetrisp2 ); | |
| 294 | tilemap_set_scrolldx(tilemap_bg, -4,-4); | |
| 295 | } | |
| 296 | ||
| 287 | 297 | VIDEO_START( rockntread ) |
| 288 | 298 | { |
| 289 | 299 | tilemap_bg = tilemap_create( get_tile_info_bg,tilemap_scan_rows, |
| r2418 | r2419 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | static tilemap *bg_tilemap,*fg_tilemap,*tx_tilemap; |
| 14 | 14 | |
| 15 | static int sprite_flipy_mask,sprite_pri_mask; | |
| 15 | static int sprite_flipy_mask,sprite_pri_mask,tilemap_priority; | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | |
| r2418 | r2419 | |
| 97 | 97 | |
| 98 | 98 | sprite_flipy_mask = 0x40; |
| 99 | 99 | sprite_pri_mask = 0x00; |
| 100 | tilemap_priority = 0; | |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | 103 | VIDEO_START( madgear ) |
| r2418 | r2419 | |
| 108 | 109 | tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000); |
| 109 | 110 | tilemap_set_transmask(fg_tilemap,1,0x80ff,0xff00); |
| 110 | 111 | tilemap_set_transparent_pen(tx_tilemap,3); |
| 112 | tilemap_set_transparent_pen(bg_tilemap,15); | |
| 111 | 113 | |
| 112 | 114 | sprite_flipy_mask = 0x80; |
| 113 | 115 | sprite_pri_mask = 0x10; |
| 116 | tilemap_priority = 0; | |
| 114 | 117 | } |
| 115 | 118 | |
| 116 | 119 | |
| r2418 | r2419 | |
| 136 | 139 | |
| 137 | 140 | WRITE16_HANDLER( lastduel_scroll_w ) |
| 138 | 141 | { |
| 139 | static UINT16 scroll[ | |
| 142 | static UINT16 scroll[8]; | |
| 140 | 143 | |
| 141 | 144 | data = COMBINE_DATA(&scroll[offset]); |
| 142 | 145 | switch (offset) |
| r2418 | r2419 | |
| 145 | 148 | case 1: tilemap_set_scrollx(fg_tilemap,0,data); break; |
| 146 | 149 | case 2: tilemap_set_scrolly(bg_tilemap,0,data); break; |
| 147 | 150 | case 3: tilemap_set_scrollx(bg_tilemap,0,data); break; |
| 151 | case 7: tilemap_priority=data; break; | |
| 152 | default: | |
| 153 | logerror("Unmapped video write %d %04x\n", offset, data); | |
| 154 | break; | |
| 148 | 155 | } |
| 149 | 156 | } |
| 150 | 157 | |
| r2418 | r2419 | |
| 178 | 185 | tilemap_mark_tile_dirty(bg_tilemap,offset & 0x7ff); |
| 179 | 186 | } |
| 180 | 187 | |
| 188 | WRITE16_HANDLER( lastduel_palette_word_w ) | |
| 189 | { | |
| 190 | int red, green, blue, bright; | |
| 191 | data = COMBINE_DATA(&paletteram16[offset]); | |
| 181 | 192 | |
| 193 | // Brightness parameter interpreted same way as CPS1 | |
| 194 | bright = 0x10 + (data&0x0f); | |
| 182 | 195 | |
| 196 | red = ((data>>12)&0x0f) * bright * 0x11 / 0x1f; | |
| 197 | green = ((data>>8 )&0x0f) * bright * 0x11 / 0x1f; | |
| 198 | blue = ((data>>4 )&0x0f) * bright * 0x11 / 0x1f; | |
| 199 | ||
| 200 | palette_set_color (machine, offset, MAKE_RGB(red, green, blue)); | |
| 201 | } | |
| 202 | ||
| 183 | 203 | /*************************************************************************** |
| 184 | 204 | |
| 185 | 205 | Display refresh |
| r2418 | r2419 | |
| 243 | 263 | return 0; |
| 244 | 264 | } |
| 245 | 265 | |
| 266 | VIDEO_UPDATE( madgear ) | |
| 267 | { | |
| 268 | if (tilemap_priority) | |
| 269 | { | |
| 270 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_OPAQUE,0); | |
| 271 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 272 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 273 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 274 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 275 | } | |
| 276 | else | |
| 277 | { | |
| 278 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0); | |
| 279 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 280 | draw_sprites(screen->machine,bitmap,cliprect,0); | |
| 281 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 282 | draw_sprites(screen->machine,bitmap,cliprect,1); | |
| 283 | } | |
| 284 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); | |
| 285 | return 0; | |
| 286 | } | |
| 246 | 287 | |
| 247 | 288 | VIDEO_EOF( lastduel ) |
| 248 | 289 | { |
| r2418 | r2419 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | static int sprite_overdraw_enabled; |
| 8 | 8 | static int next_sprite_overdraw_enabled; |
| 9 | static int sprites_updated; | |
| 9 | 10 | static bitmap_t *sp_bitmap; |
| 10 | 11 | // in robokid and omegaf big sprites are laid out differently in ROM |
| 11 | 12 | static int robokid_sprites; |
| r2418 | r2419 | |
| 388 | 389 | { |
| 389 | 390 | int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); |
| 390 | 391 | |
| 391 | // sprites with color = 0x0f erase pixels that use palettes C-F | |
| 392 | if (sprite_overdraw_enabled && color == 0x0f) | |
| 393 | { | |
| 394 | const UINT8* const srcgfx = gfx->gfxdata + tile * gfx->char_modulo; | |
| 395 | int xx,yy; | |
| 392 | drawgfx(bitmap, gfx, | |
| 393 | tile, | |
| 394 | color, | |
| 395 | flipx,flipy, | |
| 396 | sx + 16*x, sy + 16*y, | |
| 397 | 0, TRANSPARENCY_PEN, 15); | |
| 396 | 398 | |
| 397 | for (yy = 0; yy < 16; ++yy) | |
| 398 | { | |
| 399 | for (xx = 0; xx < 16; ++xx) | |
| 400 | { | |
| 401 | UINT16* const ptr = BITMAP_ADDR16(bitmap, sy + yy, sx + xx); | |
| 402 | int const offset = (flipx ? (15 - xx) : xx) + (flipy ? (15 - yy) : yy ) * gfx->line_modulo;; | |
| 403 | ||
| 404 | if (srcgfx[offset] != 15 && (*ptr & 0xf0) >= 0xc0) | |
| 405 | *ptr = 15; | |
| 406 | } | |
| 407 | } | |
| 408 | } | |
| 409 | else | |
| 410 | { | |
| 411 | drawgfx(bitmap, gfx, | |
| 412 | tile, | |
| 413 | color, | |
| 414 | flipx,flipy, | |
| 415 | sx + 16*x, sy + 16*y, | |
| 416 | 0, TRANSPARENCY_PEN, 15); | |
| 417 | } | |
| 418 | ||
| 419 | 399 | ++sprites_drawn; |
| 420 | 400 | if (sprites_drawn >= 96) |
| 421 | 401 | return; |
| r2418 | r2419 | |
| 437 | 417 | static void erase_sprites(running_machine* const machine, bitmap_t* const bitmap, const rectangle* const cliprect) |
| 438 | 418 | { |
| 439 | 419 | // if sprite overdraw is disabled, clear the sprite framebuffer |
| 440 | // if sprite overdraw is enabled, only clear palettes 0-B, and leave C- | |
| 420 | // if sprite overdraw is enabled, only clear palettes 0-B and F, and leave C-E on screen | |
| 441 | 421 | if (!sprite_overdraw_enabled) |
| 442 | 422 | fillbitmap(sp_bitmap, 15, cliprect); |
| 443 | 423 | else |
| r2418 | r2419 | |
| 449 | 429 | for (x = 0; x < sp_bitmap->width; ++x) |
| 450 | 430 | { |
| 451 | 431 | UINT16* const ptr = BITMAP_ADDR16(sp_bitmap, y, x); |
| 452 | if ((*ptr & 0xf0) < 0xc0) | |
| 453 | { | |
| 432 | ||
| 433 | int pal = (*ptr & 0xf0) >> 4; | |
| 434 | ||
| 435 | if (pal < 0xc || pal == 0xf) | |
| 454 | 436 | *ptr = 15; |
| 455 | } | |
| 456 | 437 | } |
| 457 | 438 | } |
| 458 | 439 | } |
| 459 | 440 | } |
| 460 | 441 | |
| 461 | 442 | |
| 443 | static void update_sprites(running_machine* const machine) | |
| 444 | { | |
| 445 | erase_sprites(machine, sp_bitmap, 0); | |
| 446 | ||
| 447 | // we want to erase the sprites with the old setting and draw them with the | |
| 448 | // new one. Not doing this causes a glitch in Ninja Kid II when taking the top | |
| 449 | // exit from stage 3. | |
| 450 | sprite_overdraw_enabled = next_sprite_overdraw_enabled; | |
| 451 | ||
| 452 | draw_sprites(machine, sp_bitmap); | |
| 453 | } | |
| 454 | ||
| 455 | ||
| 462 | 456 | VIDEO_UPDATE( ninjakd2 ) |
| 463 | 457 | { |
| 458 | // updating sprites here instead than in video_eof avoids a palette glitch | |
| 459 | // at the end of the "rainbow sky" screens. | |
| 460 | update_sprites(screen->machine); | |
| 461 | sprites_updated = 1; | |
| 462 | ||
| 464 | 463 | fillbitmap(bitmap, 0, cliprect); |
| 465 | 464 | |
| 466 | 465 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| r2418 | r2419 | |
| 474 | 473 | |
| 475 | 474 | VIDEO_UPDATE( robokid ) |
| 476 | 475 | { |
| 476 | update_sprites(screen->machine); | |
| 477 | sprites_updated = 1; | |
| 478 | ||
| 477 | 479 | fillbitmap(bitmap, 0, cliprect); |
| 478 | 480 | |
| 479 | 481 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); |
| r2418 | r2419 | |
| 491 | 493 | |
| 492 | 494 | VIDEO_UPDATE( omegaf ) |
| 493 | 495 | { |
| 496 | update_sprites(screen->machine); | |
| 497 | sprites_updated = 1; | |
| 498 | ||
| 494 | 499 | fillbitmap(bitmap, 0, cliprect); |
| 495 | 500 | |
| 496 | 501 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); |
| r2418 | r2419 | |
| 509 | 514 | |
| 510 | 515 | VIDEO_EOF( ninjakd2 ) |
| 511 | 516 | { |
| 512 | erase_sprites(machine, sp_bitmap, 0); | |
| 517 | if (!sprites_updated) | |
| 518 | update_sprites(machine); | |
| 513 | 519 | |
| 514 | // we want to erase the sprites with the old setting and draw them with the | |
| 515 | // new one. Not doing this causes a glitch in Ninja Kid II when taking the top | |
| 516 | // exit from stage 3. | |
| 517 | sprite_overdraw_enabled = next_sprite_overdraw_enabled; | |
| 518 | ||
| 519 | draw_sprites(machine, sp_bitmap); | |
| 520 | sprites_updated = 0; | |
| 520 | 521 | } |
| r2418 | r2419 | |
|---|---|---|
| 201 | 201 | int oldvis = palettebank_vis; |
| 202 | 202 | |
| 203 | 203 | /* extract the various bits */ |
| 204 | exidy440_bank_select(data >> 4); | |
| 204 | exidy440_bank_select(machine, data >> 4); | |
| 205 | 205 | firq_enable = (data >> 3) & 1; |
| 206 | 206 | firq_select = (data >> 2) & 1; |
| 207 | 207 | palettebank_io = (data >> 1) & 1; |
| r2418 | r2419 | |
|---|---|---|
| 9 | 9 | UINT16 *legionna_back_data,*legionna_fore_data,*legionna_mid_data,*legionna_scrollram16,*legionna_textram; |
| 10 | 10 | |
| 11 | 11 | static tilemap *background_layer,*foreground_layer,*midground_layer,*text_layer; |
| 12 | ||
| 12 | UINT16 | |
| 13 | 13 | |
| 14 | 14 | /******************************************************************************/ |
| 15 | 15 | |
| r2418 | r2419 | |
| 27 | 27 | fore_gfx_bank = (data &0x2000) >> 1;//??? |
| 28 | 28 | back_gfx_bank = (data &0x4000) >> 2; |
| 29 | 29 | mid_gfx_bank = (data &0x8000) >> 3;//??? |
| 30 | ||
| 31 | tilemap_mark_all_tiles_dirty (background_layer); | |
| 32 | tilemap_mark_all_tiles_dirty (foreground_layer); | |
| 33 | tilemap_mark_all_tiles_dirty (midground_layer); | |
| 34 | tilemap_mark_all_tiles_dirty (text_layer); | |
| 30 | 35 | } |
| 31 | 36 | |
| 32 | 37 | #ifdef UNUSED_FUNCTION |
| r2418 | r2419 | |
| 159 | 164 | foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32); |
| 160 | 165 | midground_layer = tilemap_create(get_mid_tile_info, tilemap_scan_rows,16,16,32,32); |
| 161 | 166 | text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8,8,64,32); |
| 167 | legionna_layer_disable = 0x0000; | |
| 162 | 168 | |
| 163 | 169 | legionna_scrollram16 = auto_malloc(0x60); |
| 164 | 170 | |
| r2418 | r2419 | |
| 174 | 180 | foreground_layer = tilemap_create(get_fore_tile_info_denji,tilemap_scan_rows,16,16,32,32); |
| 175 | 181 | midground_layer = tilemap_create(get_mid_tile_info_denji, tilemap_scan_rows,16,16,32,32); |
| 176 | 182 | text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8,8,64,32); |
| 183 | legionna_layer_disable = 0x0000; | |
| 177 | 184 | |
| 178 | 185 | legionna_scrollram16 = auto_malloc(0x60); |
| 179 | 186 | |
| r2418 | r2419 | |
| 189 | 196 | foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32); |
| 190 | 197 | midground_layer = tilemap_create(get_mid_tile_info_cupsoc, tilemap_scan_rows,16,16,32,32); |
| 191 | 198 | text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8,8,64,32); |
| 199 | legionna_layer_disable = 0x0000; | |
| 192 | 200 | |
| 193 | 201 | legionna_scrollram16 = auto_malloc(0x60); |
| 194 | 202 | |
| r2418 | r2419 | |
| 311 | 319 | |
| 312 | 320 | VIDEO_UPDATE( legionna ) |
| 313 | 321 | { |
| 314 | #if LAYER_DB | |
| 315 | static int dislayer[5]; /* Layer toggles to help get the layers correct */ | |
| 316 | #endif | |
| 317 | ||
| 318 | #if LAYER_DB | |
| 319 | if (input_code_pressed_once (KEYCODE_Z)) | |
| 320 | { | |
| 321 | dislayer[0] ^= 1; | |
| 322 | popmessage("bg0: %01x",dislayer[0]); | |
| 323 | } | |
| 324 | ||
| 325 | if (input_code_pressed_once (KEYCODE_X)) | |
| 326 | { | |
| 327 | dislayer[1] ^= 1; | |
| 328 | popmessage("bg1: %01x",dislayer[1]); | |
| 329 | } | |
| 330 | ||
| 331 | if (input_code_pressed_once (KEYCODE_C)) | |
| 332 | { | |
| 333 | dislayer[2] ^= 1; | |
| 334 | popmessage("bg2: %01x",dislayer[2]); | |
| 335 | } | |
| 336 | ||
| 337 | if (input_code_pressed_once (KEYCODE_V)) | |
| 338 | { | |
| 339 | dislayer[3] ^= 1; | |
| 340 | popmessage("sprites: %01x",dislayer[3]); | |
| 341 | } | |
| 342 | ||
| 343 | if (input_code_pressed_once (KEYCODE_B)) | |
| 344 | { | |
| 345 | dislayer[4] ^= 1; | |
| 346 | popmessage("text: %01x",dislayer[4]); | |
| 347 | } | |
| 348 | #endif | |
| 349 | ||
| 350 | 322 | /* Setup the tilemaps */ |
| 351 | 323 | tilemap_set_scrollx( background_layer, 0, legionna_scrollram16[0] ); |
| 352 | 324 | tilemap_set_scrolly( background_layer, 0, legionna_scrollram16[1] ); |
| r2418 | r2419 | |
| 355 | 327 | tilemap_set_scrollx( foreground_layer, 0, legionna_scrollram16[4] ); |
| 356 | 328 | tilemap_set_scrolly( foreground_layer, 0, legionna_scrollram16[5] ); |
| 357 | 329 | |
| 358 | // if ((legionna_enable&1)!=1) | |
| 359 | 330 | |
| 360 | 331 | fillbitmap(bitmap,get_black_pen(screen->machine),cliprect); /* wrong color? */ |
| 361 | 332 | |
| 362 | #if LAYER_DB | |
| 363 | if (dislayer[2]==0) | |
| 364 | #endif | |
| 365 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_DRAW_OPAQUE,0); | |
| 333 | /* legionna_layer_disable is a guess based on 'stage 1' screen in heatbrl */ | |
| 366 | 334 | |
| 367 | #if LAYER_DB | |
| 368 | if (dislayer[1]==0) | |
| 369 | #endif | |
| 370 | tilemap_draw(bitmap,cliprect,midground_layer,0,0); | |
| 335 | if (!(legionna_layer_disable&0x0020)) tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_DRAW_OPAQUE,0); | |
| 371 | 336 | |
| 337 | if (!(legionna_layer_disable&0x0010)) tilemap_draw(bitmap,cliprect,midground_layer,0,0); | |
| 338 | ||
| 372 | 339 | draw_sprites(screen->machine, bitmap,cliprect,3); |
| 373 | #if LAYER_DB | |
| 374 | if (dislayer[0]==0) | |
| 375 | #endif | |
| 376 | tilemap_draw(bitmap,cliprect,background_layer,0,0); | |
| 340 | ||
| 341 | if (!(legionna_layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,background_layer,0,0); | |
| 342 | ||
| 377 | 343 | draw_sprites(screen->machine,bitmap,cliprect,2); |
| 378 | 344 | draw_sprites(screen->machine,bitmap,cliprect,1); |
| 379 | 345 | draw_sprites(screen->machine,bitmap,cliprect,0); |
| 380 | 346 | |
| 381 | #if LAYER_DB | |
| 382 | if (dislayer[4]==0) | |
| 383 | #endif | |
| 384 | tilemap_draw(bitmap,cliprect,text_layer,0,0); | |
| 347 | if (!(legionna_layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,text_layer,0,0); | |
| 385 | 348 | |
| 386 | 349 | return 0; |
| 387 | 350 | } |
| r2418 | r2419 | |
|---|---|---|
| 414 | 414 | if (data == 0x1f) |
| 415 | 415 | { |
| 416 | 416 | memory_set_bankptr(1,page + 0x20000 + 0x4000 * (data & 1)); |
| 417 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4400, 0x4403, 0, 0, combascb_io_r);/* IO RAM & Video Registers */ | |
| 418 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4400, 0x4400, 0, 0, combascb_priority_w); | |
| 419 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, combascb_sh_irqtrigger_w); | |
| 420 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4c00, 0x4c00, 0, 0, combasc_vreg_w); | |
| 417 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4400, 0x4403, 0, 0, combascb_io_r);/* IO RAM & Video Registers */ | |
| 418 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4400, 0x4400, 0, 0, combascb_priority_w); | |
| 419 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, combascb_sh_irqtrigger_w); | |
| 420 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4c00, 0x4c00, 0, 0, combasc_vreg_w); | |
| 421 | 421 | } |
| 422 | 422 | else |
| 423 | 423 | { |
| 424 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP); /* banked ROM */ | |
| 424 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP); /* banked ROM */ | |
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | } |
| r2418 | r2419 | |
|---|---|---|
| 171 | 171 | static ADDRESS_MAP_START( rcasino_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 172 | 172 | AM_RANGE(0x0000, 0x4fff) AM_ROM |
| 173 | 173 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 174 | AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(rcasino_videoram_w) AM_BASE(&videoram) | |
| 175 | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_WRITE(rcasino_colorram_w) AM_BASE(&colorram) | |
| 174 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(rcasino_videoram_w) AM_BASE(&videoram) | |
| 175 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(rcasino_colorram_w) AM_BASE(&colorram) | |
| 176 | 176 | ADDRESS_MAP_END |
| 177 | 177 | |
| 178 | 178 | static ADDRESS_MAP_START( rcasino_io_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 66 | 66 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 67 | 67 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(SMH_BANK1, SMH_ROM) |
| 68 | 68 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(blktiger_bgvideoram_r, blktiger_bgvideoram_w) |
| 69 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(SMH_RAM, blktiger_txvideoram_w) AM_BASE(&blktiger_txvideoram) | |
| 70 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram) | |
| 71 | AM_RANGE(0xdc00, 0xdfff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE(&paletteram_2) | |
| 69 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(blktiger_txvideoram_w) AM_BASE(&blktiger_txvideoram) | |
| 70 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram) | |
| 71 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE(&paletteram_2) | |
| 72 | 72 | AM_RANGE(0xe000, 0xfdff) AM_RAM |
| 73 | 73 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 74 | 74 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 50 | 50 | AM_RANGE(0x0b002, 0x0b003) AM_READ(input_port_2_word_r) |
| 51 | 51 | AM_RANGE(0x0b004, 0x0b005) AM_WRITENOP |
| 52 | 52 | AM_RANGE(0x0b006, 0x0b007) AM_WRITE(dynduke_control_w) |
| 53 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM | |
| 53 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM | |
| 54 | 54 | AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 55 | 55 | AM_RANGE(0xa0000, 0xfffff) AM_ROM |
| 56 | 56 | ADDRESS_MAP_END |
| 57 | 57 | |
| 58 | 58 | static ADDRESS_MAP_START( slave_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 59 | 59 | AM_RANGE(0x00000, 0x05fff) AM_RAM |
| 60 | AM_RANGE(0x06000, 0x067ff) AM_RAM AM_WRITE(dynduke_background_w) AM_BASE(&dynduke_back_data) | |
| 61 | AM_RANGE(0x06800, 0x06fff) AM_RAM AM_WRITE(dynduke_foreground_w) AM_BASE(&dynduke_fore_data) | |
| 62 | AM_RANGE(0x07000, 0x07fff) AM_RAM AM_WRITE(dynduke_paletteram_w) AM_BASE(&paletteram16) | |
| 60 | AM_RANGE(0x06000, 0x067ff) AM_RAM_WRITE(dynduke_background_w) AM_BASE(&dynduke_back_data) | |
| 61 | AM_RANGE(0x06800, 0x06fff) AM_RAM_WRITE(dynduke_foreground_w) AM_BASE(&dynduke_fore_data) | |
| 62 | AM_RANGE(0x07000, 0x07fff) AM_RAM_WRITE(dynduke_paletteram_w) AM_BASE(&paletteram16) | |
| 63 | 63 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE(1) |
| 64 | 64 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE(dynduke_gfxbank_w) |
| 65 | 65 | AM_RANGE(0x0c000, 0x0c001) AM_WRITENOP |
| r2418 | r2419 | |
| 70 | 70 | static ADDRESS_MAP_START( masterj_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 71 | 71 | AM_RANGE(0x00000, 0x06fff) AM_RAM |
| 72 | 72 | AM_RANGE(0x07000, 0x07fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 73 | AM_RANGE(0x08000, 0x087ff) AM_RAM | |
| 73 | AM_RANGE(0x08000, 0x087ff) AM_RAM | |
| 74 | 74 | AM_RANGE(0x09000, 0x0900d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 75 | 75 | AM_RANGE(0x0c000, 0x0c0ff) AM_RAM AM_BASE(&dynduke_scroll_ram) |
| 76 | 76 | AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_SHARE(1) |
| r2418 | r2419 | |
|---|---|---|
| 725 | 725 | static DRIVER_INIT( avengrgs ) |
| 726 | 726 | { |
| 727 | 727 | mainCpuIsArm=0; |
| 728 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r ); | |
| 728 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r ); | |
| 729 | 729 | descramble_sound(); |
| 730 | 730 | } |
| 731 | 731 |
| r2418 | r2419 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | static ADDRESS_MAP_START( pasha2_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 218 | 218 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&wram) |
| 219 | AM_RANGE(0x40000000, 0x4001ffff) AM_RAM AM_WRITE(bitmap_0_w) | |
| 220 | AM_RANGE(0x40020000, 0x4003ffff) AM_RAM AM_WRITE(bitmap_1_w) | |
| 219 | AM_RANGE(0x40000000, 0x4001ffff) AM_RAM_WRITE(bitmap_0_w) | |
| 220 | AM_RANGE(0x40020000, 0x4003ffff) AM_RAM_WRITE(bitmap_1_w) | |
| 221 | 221 | AM_RANGE(0x40060000, 0x40060001) AM_WRITENOP |
| 222 | 222 | AM_RANGE(0x40064000, 0x40064001) AM_WRITENOP |
| 223 | 223 | AM_RANGE(0x40068000, 0x40068001) AM_WRITENOP |
| r2418 | r2419 | |
| 226 | 226 | AM_RANGE(0x40074000, 0x40074001) AM_WRITE(vbuffer_set_w) |
| 227 | 227 | AM_RANGE(0x40078000, 0x40078001) AM_WRITENOP //once at startup -> to disable the eeprom? |
| 228 | 228 | AM_RANGE(0x80000000, 0x803fffff) AM_ROMBANK(1) |
| 229 | AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM | |
| 229 | AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM | |
| 230 | 230 | AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0) |
| 231 | 231 | ADDRESS_MAP_END |
| 232 | 232 | |
| r2418 | r2419 | |
| 457 | 457 | |
| 458 | 458 | static DRIVER_INIT( pasha2 ) |
| 459 | 459 | { |
| 460 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x95744, 0x95747, 0, 0, pasha2_speedup_r ); | |
| 460 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x95744, 0x95747, 0, 0, pasha2_speedup_r ); | |
| 461 | 461 | |
| 462 | 462 | memory_set_bankptr(1, memory_region(REGION_USER2)); |
| 463 | 463 | } |
| r2418 | r2419 | |
|---|---|---|
| 176 | 176 | AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) |
| 177 | 177 | AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) |
| 178 | 178 | AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) |
| 179 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 179 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 180 | 180 | AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) |
| 181 | 181 | AM_RANGE(0x3f2000, 0x3f3fff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) |
| 182 | 182 | AM_RANGE(0x3f4000, 0x3f4f7f) AM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) |
| r2418 | r2419 | |
| 201 | 201 | // AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) |
| 202 | 202 | AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) |
| 203 | 203 | AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) |
| 204 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 204 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 205 | 205 | AM_RANGE(0xff0000, 0xff1fff) AM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) |
| 206 | 206 | AM_RANGE(0xff8000, 0xff9fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) |
| 207 | 207 | AM_RANGE(0xffa000, 0xffbfff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) |
| r2418 | r2419 | |
| 733 | 733 | atarijsa_init(machine, 1, 0x0002); |
| 734 | 734 | |
| 735 | 735 | /* install CPU synchronization handlers */ |
| 736 | sync_data = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r); | |
| 737 | sync_data = memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r); | |
| 738 | sync_data = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_w); | |
| 739 | sync_data = memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_w); | |
| 736 | sync_data = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r, sync_w); | |
| 737 | sync_data = memory_install_readwrite16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r, sync_w); | |
| 740 | 738 | } |
| 741 | 739 | |
| 742 | 740 |
| r2418 | r2419 | |
|---|---|---|
| 336 | 336 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 337 | 337 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE(&bublbobl_objectram) AM_SIZE(&bublbobl_objectram_size) |
| 338 | 338 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1) |
| 339 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 339 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 340 | 340 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(bublbobl_sound_command_w) |
| 341 | 341 | // AM_RANGE(0xfa03, 0xfa03) AM_WRITE(soundcpu_reset_w) // doesn't work for some reason |
| 342 | 342 | AM_RANGE(0xfa80, 0xfa80) AM_WRITE(watchdog_reset_w) |
| r2418 | r2419 | |
| 394 | 394 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 395 | 395 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE(&bublbobl_objectram) AM_SIZE(&bublbobl_objectram_size) |
| 396 | 396 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1) |
| 397 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 397 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 398 | 398 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(bublbobl_sound_command_w) |
| 399 | 399 | AM_RANGE(0xfa03, 0xfa03) AM_WRITENOP // sound cpu reset |
| 400 | 400 | AM_RANGE(0xfa80, 0xfa80) AM_WRITENOP // ??? |
| r2418 | r2419 | |
| 418 | 418 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 419 | 419 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE(&bublbobl_objectram) AM_SIZE(&bublbobl_objectram_size) |
| 420 | 420 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1) |
| 421 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 421 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 422 | 422 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(watchdog_reset_w) |
| 423 | 423 | AM_RANGE(0xfa03, 0xfa03) AM_READ(input_port_0_r) |
| 424 | 424 | AM_RANGE(0xfa04, 0xfa04) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 1336 | 1336 | |
| 1337 | 1337 | static DRIVER_INIT( tokiob ) |
| 1338 | 1338 | { |
| 1339 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); | |
| 1339 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); | |
| 1340 | 1340 | |
| 1341 | 1341 | DRIVER_INIT_CALL(tokio); |
| 1342 | 1342 | } |
| r2418 | r2419 | |
|---|---|---|
| 76 | 76 | WRITE16_HANDLER( aerofgt_bg2videoram_w ); |
| 77 | 77 | WRITE16_HANDLER( pspikes_gfxbank_w ); |
| 78 | 78 | WRITE16_HANDLER( pspikesb_gfxbank_w ); |
| 79 | WRITE16_HANDLER( spikes91_lookup_w ); | |
| 79 | 80 | WRITE16_HANDLER( karatblz_gfxbank_w ); |
| 80 | 81 | WRITE16_HANDLER( spinlbrk_gfxbank_w ); |
| 81 | 82 | WRITE16_HANDLER( turbofrc_gfxbank_w ); |
| r2418 | r2419 | |
| 166 | 167 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 167 | 168 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* work RAM */ |
| 168 | 169 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 169 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 170 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 170 | 171 | AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 171 | 172 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 172 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 173 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 173 | 174 | AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w) |
| 174 | 175 | AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w) |
| 175 | 176 | AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w) |
| r2418 | r2419 | |
| 181 | 182 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* work RAM */ |
| 182 | 183 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 183 | 184 | AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP |
| 184 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 185 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 185 | 186 | AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 186 | 187 | AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w) |
| 187 | 188 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 188 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 189 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 189 | 190 | AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r) |
| 190 | 191 | AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r) |
| 191 | 192 | AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w) |
| r2418 | r2419 | |
| 198 | 199 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* work RAM */ |
| 199 | 200 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 200 | 201 | AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP |
| 201 | AM_RANGE(0xff8000, 0xff8fff) AM_RAM | |
| 202 | AM_RANGE(0xff8000, 0xff8fff) AM_RAM | |
| 202 | 203 | AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 203 | 204 | //AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w) |
| 204 | 205 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 205 | AM_RANGE(0xffe000, 0xffefff) AM_RAM | |
| 206 | AM_RANGE(0xffe000, 0xffefff) AM_RAM | |
| 206 | 207 | AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r) |
| 207 | 208 | AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r) AM_WRITE(pspikes_gfxbank_w) |
| 208 | 209 | AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w) |
| 209 | 210 | AM_RANGE(0xfff006, 0xfff007) AM_NOP |
| 210 | AM_RANGE(0xfff008, 0xfff009) AM_ | |
| 211 | AM_RANGE(0xfff008, 0xfff009) AM_WRITE(spikes91_lookup_w) | |
| 211 | 212 | ADDRESS_MAP_END |
| 212 | 213 | |
| 213 | 214 | static ADDRESS_MAP_START( pspikesc_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 214 | 215 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 215 | 216 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* work RAM */ |
| 216 | 217 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 217 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 218 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 218 | 219 | AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 219 | 220 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 220 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 221 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 221 | 222 | AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w) |
| 222 | 223 | AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w) |
| 223 | 224 | AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 228 | 229 | static ADDRESS_MAP_START( karatblz_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 229 | 230 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 230 | 231 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 231 | AM_RANGE(0x080000, 0x081fff) AM_READWRITE(SMH_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 232 | AM_RANGE(0x082000, 0x083fff) AM_READWRITE(SMH_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 232 | AM_RANGE(0x080000, 0x081fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 233 | AM_RANGE(0x082000, 0x083fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 233 | 234 | AM_RANGE(0x0a0000, 0x0affff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 234 | 235 | AM_RANGE(0x0b0000, 0x0bffff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) |
| 235 | 236 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ |
| 236 | 237 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 237 | 238 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 238 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_R | |
| 239 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_R | |
| 239 | 240 | AM_RANGE(0x0ff000, 0x0ff001) AM_READ(input_port_0_word_r) |
| 240 | 241 | AM_RANGE(0x0ff002, 0x0ff003) AM_READWRITE(input_port_1_word_r, karatblz_gfxbank_w) |
| 241 | 242 | AM_RANGE(0x0ff004, 0x0ff005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 248 | 249 | |
| 249 | 250 | static ADDRESS_MAP_START( spinlbrk_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 250 | 251 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 251 | AM_RANGE(0x080000, 0x080fff) AM_READWRITE(SMH_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 252 | AM_RANGE(0x082000, 0x082fff) AM_READWRITE(SMH_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 252 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 253 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 253 | 254 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* work RAM */ |
| 254 | 255 | AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 255 | 256 | AM_RANGE(0xffd000, 0xffd1ff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 256 | AM_RANGE(0xffe000, 0xffe7ff) AM_R | |
| 257 | AM_RANGE(0xffe000, 0xffe7ff) AM_R | |
| 257 | 258 | AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, spinlbrk_gfxbank_w) |
| 258 | 259 | AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, aerofgt_bg2scrollx_w) |
| 259 | 260 | AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 264 | 265 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 265 | 266 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 266 | 267 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ |
| 267 | AM_RANGE(0x0d0000, 0x0d1fff) AM_READWRITE(SMH_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 268 | AM_RANGE(0x0d2000, 0x0d3fff) AM_READWRITE(SMH_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 268 | AM_RANGE(0x0d0000, 0x0d1fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 269 | AM_RANGE(0x0d2000, 0x0d3fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 269 | 270 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 270 | 271 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) |
| 271 | 272 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 272 | 273 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 273 | 274 | AM_RANGE(0x0fd000, 0x0fdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 274 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_R | |
| 275 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_R | |
| 275 | 276 | AM_RANGE(0x0ff000, 0x0ff001) AM_READ(input_port_0_word_r) |
| 276 | 277 | AM_RANGE(0x0ff002, 0x0ff003) AM_READWRITE(input_port_1_word_r, aerofgt_bg1scrolly_w) |
| 277 | 278 | AM_RANGE(0x0ff004, 0x0ff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg2scrollx_w) |
| r2418 | r2419 | |
| 285 | 286 | static ADDRESS_MAP_START( aerofgtb_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 286 | 287 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 287 | 288 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ |
| 288 | AM_RANGE(0x0d0000, 0x0d1fff) AM_READWRITE(SMH_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 289 | AM_RANGE(0x0d2000, 0x0d3fff) AM_READWRITE(SMH_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 289 | AM_RANGE(0x0d0000, 0x0d1fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 290 | AM_RANGE(0x0d2000, 0x0d3fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 290 | 291 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 291 | 292 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) |
| 292 | 293 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 293 | 294 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 294 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_R | |
| 295 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_R | |
| 295 | 296 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ(input_port_0_word_r) |
| 296 | 297 | AM_RANGE(0x0fe002, 0x0fe003) AM_READWRITE(input_port_1_word_r, aerofgt_bg1scrolly_w) |
| 297 | 298 | AM_RANGE(0x0fe004, 0x0fe005) AM_READWRITE(input_port_2_word_r, aerofgt_bg2scrollx_w) |
| r2418 | r2419 | |
| 304 | 305 | |
| 305 | 306 | static ADDRESS_MAP_START( aerofgt_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 306 | 307 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 307 | AM_RANGE(0x1a0000, 0x1a07ff) AM_R | |
| 308 | AM_RANGE(0x1a0000, 0x1a07ff) AM_R | |
| 308 | 309 | AM_RANGE(0x1b0000, 0x1b07ff) AM_RAM AM_BASE(&aerofgt_rasterram) /* used only for the scroll registers */ |
| 309 | 310 | AM_RANGE(0x1b0800, 0x1b0801) AM_NOP /* ??? */ |
| 310 | 311 | AM_RANGE(0x1b0ff0, 0x1b0fff) AM_RAM /* stack area during boot */ |
| 311 | AM_RANGE(0x1b2000, 0x1b3fff) AM_READWRITE(SMH_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 312 | AM_RANGE(0x1b4000, 0x1b5fff) AM_READWRITE(SMH_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 312 | AM_RANGE(0x1b2000, 0x1b3fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 313 | AM_RANGE(0x1b4000, 0x1b5fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 313 | 314 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 314 | 315 | AM_RANGE(0x1c4000, 0x1c7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) |
| 315 | 316 | AM_RANGE(0x1d0000, 0x1d1fff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| r2418 | r2419 | |
| 330 | 331 | static ADDRESS_MAP_START( aerfboot_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 331 | 332 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 332 | 333 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ |
| 333 | AM_RANGE(0x0d0000, 0x0d1fff) AM_RAM AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 334 | AM_RANGE(0x0d2000, 0x0d3fff) AM_RAM AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 334 | AM_RANGE(0x0d0000, 0x0d1fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 335 | AM_RANGE(0x0d2000, 0x0d3fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 335 | 336 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 336 | 337 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) |
| 337 | 338 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 338 | 339 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM //AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 339 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM | |
| 340 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM | |
| 340 | 341 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ(input_port_0_word_r) |
| 341 | 342 | AM_RANGE(0x0fe002, 0x0fe003) AM_READ(input_port_1_word_r) |
| 342 | 343 | AM_RANGE(0x0fe004, 0x0fe005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 353 | 354 | AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 354 | 355 | ADDRESS_MAP_END |
| 355 | 356 | |
| 357 | static ADDRESS_MAP_START( aerfboo2_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 358 | AM_RANGE(0x000000, 0x07ffff) AM_ROM | |
| 359 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ | |
| 360 | AM_RANGE(0x0d0000, 0x0d1fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram) | |
| 361 | AM_RANGE(0x0d2000, 0x0d3fff) AM_RAM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram) | |
| 362 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) | |
| 363 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size) | |
| 364 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ | |
| 365 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM //AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) | |
| 366 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) | |
| 367 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ(input_port_0_word_r) | |
| 368 | AM_RANGE(0x0fe002, 0x0fe003) AM_READ(input_port_1_word_r) | |
| 369 | AM_RANGE(0x0fe004, 0x0fe005) AM_READ(input_port_2_word_r) | |
| 370 | AM_RANGE(0x0fe008, 0x0fe009) AM_READ(input_port_3_word_r) | |
| 371 | AM_RANGE(0x0fe002, 0x0fe003) AM_WRITE(aerofgt_bg1scrolly_w) | |
| 372 | AM_RANGE(0x0fe004, 0x0fe005) AM_WRITE(aerofgt_bg2scrollx_w) | |
| 373 | AM_RANGE(0x0fe006, 0x0fe007) AM_WRITE(aerofgt_bg2scrolly_w) | |
| 374 | AM_RANGE(0x0fe008, 0x0fe00b) AM_WRITE(turbofrc_gfxbank_w) | |
| 375 | AM_RANGE(0x0fe010, 0x0fe011) AM_WRITENOP | |
| 376 | // AM_RANGE(0x0fe012, 0x0fe013) AM_WRITE(aerfboot_soundlatch_w) | |
| 377 | AM_RANGE(0x0fe400, 0x0fe401) AM_WRITENOP | |
| 378 | AM_RANGE(0x0fe402, 0x0fe403) AM_WRITENOP | |
| 379 | AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(&aerofgt_rasterram) /* used only for the scroll registers */ | |
| 380 | AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) | |
| 381 | ADDRESS_MAP_END | |
| 382 | ||
| 356 | 383 | static ADDRESS_MAP_START( wbbc97_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 357 | 384 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 358 | 385 | AM_RANGE(0x500000, 0x50ffff) AM_RAM /* work RAM */ |
| 359 | 386 | AM_RANGE(0x600000, 0x605fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size) |
| 360 | 387 | AM_RANGE(0xa00000, 0xa3ffff) AM_RAM AM_BASE(&wbbc97_bitmapram) |
| 361 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 388 | AM_RANGE(0xff8000, 0xff8fff) AM_R | |
| 362 | 389 | AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size) |
| 363 | 390 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram) /* bg1 scroll registers */ |
| 364 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 391 | AM_RANGE(0xffe000, 0xffefff) AM_R | |
| 365 | 392 | AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w) |
| 366 | 393 | AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w) |
| 367 | 394 | AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w) |
| r2418 | r2419 | |
| 1099 | 1126 | 8*8 |
| 1100 | 1127 | }; |
| 1101 | 1128 | |
| 1129 | static const gfx_layout aerfboo2_charlayout = | |
| 1130 | { | |
| 1131 | 8,8, | |
| 1132 | RGN_FRAC(1,2), | |
| 1133 | 4, | |
| 1134 | { 0, 1, 2, 3 }, | |
| 1135 | { 1*4, 0*4, RGN_FRAC(1,2)+1*4, RGN_FRAC(1,2)+0*4, 3*4, 2*4, RGN_FRAC(1,2)+3*4, RGN_FRAC(1,2)+2*4 }, | |
| 1136 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, | |
| 1137 | 32*4 | |
| 1138 | }; | |
| 1139 | ||
| 1102 | 1140 | static const gfx_layout pspikes_spritelayout = |
| 1103 | 1141 | { |
| 1104 | 1142 | 16,16, |
| r2418 | r2419 | |
| 1177 | 1215 | 64*8 |
| 1178 | 1216 | }; |
| 1179 | 1217 | |
| 1218 | static const gfx_layout aerfboo2_spritelayout = | |
| 1219 | { | |
| 1220 | 16,16, | |
| 1221 | RGN_FRAC(1,2), | |
| 1222 | 4, | |
| 1223 | { 0,1,2,3 }, | |
| 1224 | { 28,24,20,16,12,8,4,0,60,56,52,48,44,40,36,32 }, | |
| 1225 | { | |
| 1226 | 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64,8*64,9*64,10*64,11*64,12*64,13*64,14*64,15*64 | |
| 1227 | }, | |
| 1228 | 16*64 | |
| 1229 | }; | |
| 1230 | ||
| 1180 | 1231 | static const gfx_layout wbbc97_spritelayout = |
| 1181 | 1232 | { |
| 1182 | 1233 | 16,16, |
| r2418 | r2419 | |
| 1237 | 1288 | GFXDECODE_ENTRY( REGION_GFX3, 0, aerfboot_spritelayout, 768, 16 ) |
| 1238 | 1289 | GFXDECODE_END |
| 1239 | 1290 | |
| 1291 | static GFXDECODE_START( aerfboo2 ) | |
| 1292 | GFXDECODE_ENTRY( REGION_GFX1, 0, aerfboo2_charlayout, 0, 16 ) | |
| 1293 | GFXDECODE_ENTRY( REGION_GFX2, 0, aerfboo2_charlayout, 256, 16 ) | |
| 1294 | GFXDECODE_ENTRY( REGION_GFX3, 0, aerfboo2_spritelayout, 512, 16 ) | |
| 1295 | GFXDECODE_ENTRY( REGION_GFX3, 0x100000,aerfboo2_spritelayout, 768, 16 ) | |
| 1296 | GFXDECODE_END | |
| 1297 | ||
| 1240 | 1298 | static GFXDECODE_START( wbbc97 ) |
| 1241 | 1299 | GFXDECODE_ENTRY( REGION_GFX1, 0, pspikes_charlayout, 0, 64 ) /* colors 0-1023 in 8 banks */ |
| 1242 | 1300 | GFXDECODE_ENTRY( REGION_GFX2, 0, wbbc97_spritelayout, 1024, 64 ) /* colors 1024-2047 in 4 banks */ |
| r2418 | r2419 | |
| 1610 | 1668 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1611 | 1669 | MACHINE_DRIVER_END |
| 1612 | 1670 | |
| 1671 | static MACHINE_DRIVER_START( aerfboo2 ) | |
| 1672 | ||
| 1673 | /* basic machine hardware */ | |
| 1674 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ | |
| 1675 | MDRV_CPU_PROGRAM_MAP(aerfboo2_map,0) | |
| 1676 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) | |
| 1677 | ||
| 1678 | /* video hardware */ | |
| 1679 | MDRV_SCREEN_ADD("main", RASTER) | |
| 1680 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1681 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(500)) | |
| 1682 | /* wrong but improves sprite-background synchronization */ | |
| 1683 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1684 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 1685 | MDRV_SCREEN_VISIBLE_AREA(0*8+12, 40*8-1+12, 0*8, 28*8-1) | |
| 1686 | MDRV_GFXDECODE(aerfboo2) | |
| 1687 | MDRV_PALETTE_LENGTH(1024) | |
| 1688 | ||
| 1689 | MDRV_VIDEO_START(turbofrc) | |
| 1690 | MDRV_VIDEO_UPDATE(aerfboot) | |
| 1691 | ||
| 1692 | /* sound hardware */ | |
| 1693 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1694 | ||
| 1695 | MDRV_SOUND_ADD(OKIM6295, 1056000) | |
| 1696 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified | |
| 1697 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 1698 | MACHINE_DRIVER_END | |
| 1699 | ||
| 1613 | 1700 | static MACHINE_DRIVER_START( wbbc97 ) |
| 1614 | 1701 | |
| 1615 | 1702 | /* basic machine hardware */ |
| r2418 | r2419 | |
| 2298 | 2385 | ROM_CONTINUE( 0x100000, 0x20000 ) |
| 2299 | 2386 | ROM_END |
| 2300 | 2387 | |
| 2388 | ROM_START( aerfboo2 ) | |
| 2389 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 code */ | |
| 2390 | ROM_LOAD16_BYTE( "p2", 0x00000, 0x40000, CRC(6c4ec09b) SHA1(cdfb8c59ddd6360487fee017d5093636aa52c5c2) ) | |
| 2391 | ROM_LOAD16_BYTE( "p1", 0x00001, 0x40000, CRC(841c513a) SHA1(819e634f0aec29b1863c9cf0118cc33154d10037) ) | |
| 2392 | ||
| 2393 | /* No z80 on this bootleg */ | |
| 2394 | ||
| 2395 | ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 2396 | ROM_LOAD( "g5" , 0x000000, 0x80000, CRC(1c2bd86c) SHA1(f16d7eba967d76faaaeae5101db43141ef9e2eed) ) | |
| 2397 | ||
| 2398 | ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 2399 | ROM_LOAD( "g6" , 0x000000, 0x80000, CRC(b9b1b9b0) SHA1(c25e1ef8b5ecb4b630fb850fe483d7efb0544a6c) ) | |
| 2400 | ||
| 2401 | ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 2402 | ROM_LOAD32_BYTE( "g2" , 0x000000, 0x80000, CRC(84774dbd) SHA1(731b08a62446ff9cf36a43d42d217f73b4e2437c) ) | |
| 2403 | ROM_LOAD32_BYTE( "g1" , 0x000001, 0x80000, CRC(4ab31e69) SHA1(1c6bf5bf4a887cf21da76c6a874f8ff5d3540e3a) ) | |
| 2404 | ROM_LOAD32_BYTE( "g4" , 0x000002, 0x80000, CRC(97725694) SHA1(59316e4be043e0b7111c6777b36bcfd39c899e72) ) | |
| 2405 | ROM_LOAD32_BYTE( "g3" , 0x000003, 0x80000, CRC(7be8cef0) SHA1(b227252fd288e8eb06507397f3ad625465dc1b0a) ) | |
| 2406 | ||
| 2407 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* sound samples */ | |
| 2408 | ROM_LOAD( "s2" , 0x00000, 0x80000, CRC(2e316ee8) SHA1(a163dddee6d8cfd1286059ee561e3a01df49381b) ) | |
| 2409 | ROM_LOAD( "s1" , 0x80000, 0x80000, CRC(9e09813d) SHA1(582a36b5a46f4d8eaedca22e583b6949535d24a5) ) | |
| 2410 | ||
| 2411 | ROM_END | |
| 2412 | ||
| 2301 | 2413 | ROM_START( wbbc97 ) |
| 2302 | 2414 | ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* 68000 code */ |
| 2303 | 2415 | ROM_LOAD16_BYTE( "03.27c040.ur4.rom", 0x000001, 0x80000, CRC(fb4e48fc) SHA1(cffc75766a9b867ab73597156142aa7c70bf6f20) ) |
| r2418 | r2419 | |
| 2346 | 2458 | GAME( 1992, aerofgtb, aerofgt, aerofgtb, aerofgtb, 0, ROT270, "Video System Co.", "Aero Fighters (Turbo Force hardware set 1)", GAME_NO_COCKTAIL ) |
| 2347 | 2459 | GAME( 1992, aerofgtc, aerofgt, aerofgtb, aerofgtb, 0, ROT270, "Video System Co.", "Aero Fighters (Turbo Force hardware set 2)", GAME_NO_COCKTAIL ) |
| 2348 | 2460 | GAME( 1992, sonicwi, aerofgt, aerofgtb, aerofgtb, 0, ROT270, "Video System Co.", "Sonic Wings (Japan)", GAME_NO_COCKTAIL ) |
| 2349 | GAME( 1992, aerfboot, aerofgt, aerfboot, aerofgtb, 0, ROT270, "bootleg", "Aero Fighters (bootleg)", GAME_NO_COCKTAIL | GAME_NO_SOUND ) | |
| 2461 | GAME( 1992, aerfboot, aerofgt, aerfboot, aerofgtb, 0, ROT270, "bootleg", "Aero Fighters (bootleg set 1)", GAME_NO_COCKTAIL | GAME_NO_SOUND ) | |
| 2462 | GAME( 1992, aerfboo2, aerofgt, aerfboo2, aerofgtb, 0, ROT270, "bootleg", "Aero Fighters (bootleg set 2)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_NOT_WORKING) | |
| 2350 | 2463 | GAME( 1997, wbbc97, 0, wbbc97, wbbc97, 0, ROT0, "Comad", "Beach Festival World Championship 1997", GAME_NO_COCKTAIL ) |
| r2418 | r2419 | |
|---|---|---|
| 120 | 120 | static ADDRESS_MAP_START( coinmstr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 121 | 121 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 122 | 122 | AM_RANGE(0xc000, 0xdfff) AM_RAM // supnudg2 writes here... |
| 123 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(quizmstr_bg_w) AM_BASE(&videoram) | |
| 124 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(quizmstr_attr1_w) AM_BASE(&attr_ram1) | |
| 125 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_WRITE(quizmstr_attr2_w) AM_BASE(&attr_ram2) | |
| 123 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(quizmstr_bg_w) AM_BASE(&videoram) | |
| 124 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(quizmstr_attr1_w) AM_BASE(&attr_ram1) | |
| 125 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(quizmstr_attr2_w) AM_BASE(&attr_ram2) | |
| 126 | 126 | AM_RANGE(0xf800, 0xffff) AM_RAM // supnudg2 writes here... |
| 127 | 127 | ADDRESS_MAP_END |
| 128 | 128 |
| r2418 | r2419 | |
|---|---|---|
| 211 | 211 | AM_RANGE(0x9800, 0x99ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 212 | 212 | AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w) |
| 213 | 213 | AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w) |
| 214 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_READWRITE(SMH_RAM, docastle_videoram_w) AM_BASE(&videoram) | |
| 215 | AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_READWRITE(SMH_RAM, docastle_colorram_w) AM_BASE(&colorram) | |
| 214 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_BASE(&videoram) | |
| 215 | AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_BASE(&colorram) | |
| 216 | 216 | AM_RANGE(0xe000, 0xe000) AM_WRITE(docastle_nmitrigger_w) |
| 217 | 217 | ADDRESS_MAP_END |
| 218 | 218 | |
| r2418 | r2419 | |
| 255 | 255 | AM_RANGE(0x4000, 0x9fff) AM_ROM |
| 256 | 256 | AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w) |
| 257 | 257 | AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w) |
| 258 | AM_RANGE(0xb000, 0xb3ff) AM_READWRITE(SMH_RAM, docastle_videoram_w) AM_BASE(&videoram) | |
| 259 | AM_RANGE(0xb400, 0xb7ff) AM_READWRITE(SMH_RAM, docastle_colorram_w) AM_BASE(&colorram) | |
| 258 | AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(docastle_videoram_w) AM_BASE(&videoram) | |
| 259 | AM_RANGE(0xb400, 0xb7ff) AM_RAM_WRITE(docastle_colorram_w) AM_BASE(&colorram) | |
| 260 | 260 | AM_RANGE(0xb800, 0xb800) AM_WRITE(docastle_nmitrigger_w) |
| 261 | 261 | ADDRESS_MAP_END |
| 262 | 262 | |
| r2418 | r2419 | |
| 285 | 285 | AM_RANGE(0x6000, 0x9fff) AM_ROM |
| 286 | 286 | AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w) |
| 287 | 287 | AM_RANGE(0xa800, 0xa800) AM_WRITE(watchdog_reset_w) |
| 288 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_READWRITE(SMH_RAM, docastle_videoram_w) AM_BASE(&videoram) | |
| 289 | AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_READWRITE(SMH_RAM, docastle_colorram_w) AM_BASE(&colorram) | |
| 288 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_BASE(&videoram) | |
| 289 | AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_BASE(&colorram) | |
| 290 | 290 | AM_RANGE(0xc000, 0xc000) AM_READWRITE(idsoccer_adpcm_status_r, idsoccer_adpcm_w) |
| 291 | 291 | AM_RANGE(0xe000, 0xe000) AM_WRITE(docastle_nmitrigger_w) |
| 292 | 292 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 667 | 667 | // video hardware |
| 668 | 668 | |
| 669 | 669 | MDRV_SCREEN_ADD("main", RASTER) |
| 670 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 670 | MDRV_SCREEN_REFRESH_RATE(59.60) // measured on pcb | |
| 671 | 671 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 672 | 672 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 673 | 673 | MDRV_SCREEN_SIZE(32*8, 32*8) |
| r2418 | r2419 | |
|---|---|---|
| 92 | 92 | AM_RANGE(0x70000088, 0x7000008f) AM_READ(K056800_host_r) |
| 93 | 93 | AM_RANGE(0x700000e0, 0x700000e3) AM_WRITE(int_ack_w) |
| 94 | 94 | AM_RANGE(0x7f000000, 0x7f01ffff) AM_RAM |
| 95 | AM_RANGE(0x7f700000, 0x7f703fff) AM_R | |
| 95 | AM_RANGE(0x7f700000, 0x7f703fff) AM_R | |
| 96 | 96 | AM_RANGE(0x7fa00000, 0x7fbfffff) AM_ROM AM_SHARE(1) |
| 97 | 97 | AM_RANGE(0x7fc00000, 0x7fdfffff) AM_ROM AM_SHARE(1) |
| 98 | 98 | AM_RANGE(0x7fe00000, 0x7fffffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_SHARE(1) |
| r2418 | r2419 | |
|---|---|---|
| 132 | 132 | AM_RANGE(0xc500, 0xc500) AM_READ(input_port_4_r) |
| 133 | 133 | AM_RANGE(0xc600, 0xc600) AM_WRITE(mainsnk_c600_w) |
| 134 | 134 | AM_RANGE(0xc700, 0xc700) AM_WRITE(sound_command_w) |
| 135 | AM_RANGE(0xd800, 0xdbff) AM_R | |
| 135 | AM_RANGE(0xd800, 0xdbff) AM_R | |
| 136 | 136 | AM_RANGE(0xdc00, 0xe7ff) AM_RAM |
| 137 | 137 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&spriteram) |
| 138 | AM_RANGE(0xf000, 0xf3ff) AM_R | |
| 138 | AM_RANGE(0xf000, 0xf3ff) AM_R | |
| 139 | 139 | AM_RANGE(0xf400, 0xf7ff) AM_RAM |
| 140 | 140 | ADDRESS_MAP_END |
| 141 | 141 | |
| r2418 | r2419 | |
| 458 | 458 | |
| 459 | 459 | static DRIVER_INIT ( canvas ) |
| 460 | 460 | { |
| 461 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_0_r ); | |
| 461 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_0_r ); | |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | ROM_START( canvas ) |
| r2418 | r2419 | |
|---|---|---|
| 196 | 196 | AM_RANGE(0x00000000, 0x001fffff) AM_READWRITE(midyunit_vram_r, midyunit_vram_w) |
| 197 | 197 | AM_RANGE(0x01000000, 0x010fffff) AM_RAM |
| 198 | 198 | AM_RANGE(0x01400000, 0x0140ffff) AM_READWRITE(midyunit_cmos_r, midyunit_cmos_w) |
| 199 | AM_RANGE(0x01800000, 0x0181ffff) AM_R | |
| 199 | AM_RANGE(0x01800000, 0x0181ffff) AM_R | |
| 200 | 200 | AM_RANGE(0x01a80000, 0x01a8009f) AM_MIRROR(0x00080000) AM_READWRITE(midyunit_dma_r, midyunit_dma_w) |
| 201 | 201 | AM_RANGE(0x01c00000, 0x01c0005f) AM_READ(midyunit_input_r) |
| 202 | 202 | AM_RANGE(0x01c00060, 0x01c0007f) AM_READWRITE(midyunit_protection_r, midyunit_cmos_enable_w) |
| r2418 | r2419 | |
|---|---|---|
| 217 | 217 | static ADDRESS_MAP_START( hitme_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 218 | 218 | ADDRESS_MAP_GLOBAL_MASK(0x1fff) |
| 219 | 219 | AM_RANGE(0x0000, 0x07ff) AM_ROM |
| 220 | AM_RANGE(0x0c00, 0x0eff) AM_R | |
| 220 | AM_RANGE(0x0c00, 0x0eff) AM_R | |
| 221 | 221 | AM_RANGE(0x1000, 0x10ff) AM_MIRROR(0x300) AM_RAM |
| 222 | 222 | AM_RANGE(0x1400, 0x14ff) AM_READ(hitme_port_0_r) |
| 223 | 223 | AM_RANGE(0x1500, 0x15ff) AM_READ(hitme_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 176 | 176 | AM_RANGE(0x140000, 0x147fff) AM_MIRROR(0x438000) AM_ROM /* slapstic goes here */ |
| 177 | 177 | AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_BASE(&rampart_bitmap) |
| 178 | 178 | AM_RANGE(0x220000, 0x3bffff) AM_WRITENOP /* the code blasts right through this when initializing */ |
| 179 | AM_RANGE(0x3c0000, 0x3c07ff) AM_MIRROR(0x019800) AM_READWRITE(SMH_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 180 | AM_RANGE(0x3e0000, 0x3e07ff) AM_MIRROR(0x010000) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 179 | AM_RANGE(0x3c0000, 0x3c07ff) AM_MIRROR(0x019800) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 180 | AM_RANGE(0x3e0000, 0x3e07ff) AM_MIRROR(0x010000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 181 | 181 | AM_RANGE(0x3e0800, 0x3e3f3f) AM_MIRROR(0x010000) AM_RAM |
| 182 | AM_RANGE(0x3e3f40, 0x3e3f7f) AM_MIRROR(0x010000) AM_R | |
| 182 | AM_RANGE(0x3e3f40, 0x3e3f7f) AM_MIRROR(0x010000) AM_R | |
| 183 | 183 | AM_RANGE(0x3e3f80, 0x3effff) AM_MIRROR(0x010000) AM_RAM |
| 184 | 184 | AM_RANGE(0x460000, 0x460001) AM_MIRROR(0x019ffe) AM_READWRITE(adpcm_r, adpcm_w) |
| 185 | 185 | AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_WRITE(ym2413_w) |
| r2418 | r2419 | |
|---|---|---|
| 2316 | 2316 | // hyperpac_ram[0xf000/2 + i] = PROTDATA[i]; |
| 2317 | 2317 | |
| 2318 | 2318 | /* explicit check in the code */ |
| 2319 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, moremorp_0a_read ); | |
| 2319 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, moremorp_0a_read ); | |
| 2320 | 2320 | } |
| 2321 | 2321 | |
| 2322 | 2322 | |
| r2418 | r2419 | |
| 2712 | 2712 | memcpy(src,buffer,len); |
| 2713 | 2713 | free(buffer); |
| 2714 | 2714 | } |
| 2715 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _4in1_02_read ); | |
| 2715 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _4in1_02_read ); | |
| 2716 | 2716 | } |
| 2717 | 2717 | |
| 2718 | 2718 | static DRIVER_INIT(snowbro3) |
| r2418 | r2419 | |
| 2739 | 2739 | |
| 2740 | 2740 | static DRIVER_INIT( 3in1semi ) |
| 2741 | 2741 | { |
| 2742 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _3in1_read ); | |
| 2742 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _3in1_read ); | |
| 2743 | 2743 | } |
| 2744 | 2744 | |
| 2745 | 2745 | static READ16_HANDLER( cookbib3_read ) |
| r2418 | r2419 | |
| 2749 | 2749 | |
| 2750 | 2750 | static DRIVER_INIT( cookbib3 ) |
| 2751 | 2751 | { |
| 2752 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, cookbib3_read ); | |
| 2752 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, cookbib3_read ); | |
| 2753 | 2753 | } |
| 2754 | 2754 | |
| 2755 | 2755 |
| r2418 | r2419 | |
|---|---|---|
| 787 | 787 | { |
| 788 | 788 | /* install the speech support that was only optionally stuffed for use */ |
| 789 | 789 | /* in the Return to Vax hack */ |
| 790 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800, 0, 0, mhavoc_port_1_sp_r); | |
| 791 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x5800, 0x5800, 0, 0, speech_data_w); | |
| 792 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x5900, 0x5900, 0, 0, speech_strobe_w); | |
| 790 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800, 0, 0, mhavoc_port_1_sp_r); | |
| 791 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5800, 0x5800, 0, 0, speech_data_w); | |
| 792 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5900, 0x5900, 0, 0, speech_strobe_w); | |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 |
| r2418 | r2419 | |
|---|---|---|
| 813 | 813 | |
| 814 | 814 | static DRIVER_INIT( bradley ) |
| 815 | 815 | { |
| 816 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 816 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 817 | 817 | memory_set_bankptr(1, auto_malloc(0x400)); |
| 818 | 818 | |
| 819 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r); | |
| 820 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r); | |
| 821 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x180a, 0x180a, 0, 0, analog_data_r); | |
| 822 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1848, 0x1850, 0, 0, analog_select_w); | |
| 819 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r); | |
| 820 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r); | |
| 821 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180a, 0x180a, 0, 0, analog_data_r); | |
| 822 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1848, 0x1850, 0, 0, analog_select_w); | |
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 |
| r2418 | r2419 | |
|---|---|---|
| 521 | 521 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 522 | 522 | AM_RANGE(0x080000, 0x083fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE(1) AM_BASE(&backupram1) |
| 523 | 523 | AM_RANGE(0x0a0000, 0x0a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE(2) AM_BASE(&backupram2) |
| 524 | AM_RANGE(0x0c0000, 0x0cffff) AM_READWRITE(SMH_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 525 | AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_READWRITE(SMH_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 524 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM_WRITE(segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 525 | AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_RAM_WRITE(segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 526 | 526 | AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_READWRITE(segaic16_multiply_0_r, segaic16_multiply_0_w) |
| 527 | 527 | AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_divide_0_r, segaic16_divide_0_w) |
| 528 | 528 | AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_compare_timer_0_r, segaic16_compare_timer_0_w) |
| 529 | 529 | AM_RANGE(0x100000, 0x100fff) AM_MIRROR(0x00f000) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 530 | 530 | AM_RANGE(0x110000, 0x11ffff) AM_WRITE(segaic16_sprites_draw_0_w) |
| 531 | AM_RANGE(0x120000, 0x123fff) AM_MIRROR(0x00c000) AM_R | |
| 531 | AM_RANGE(0x120000, 0x123fff) AM_MIRROR(0x00c000) AM_R | |
| 532 | 532 | AM_RANGE(0x130000, 0x13ffff) AM_READWRITE(adc_r, adc_w) |
| 533 | 533 | AM_RANGE(0x140000, 0x14000f) AM_MIRROR(0x00fff0) AM_READWRITE(iochip_0_r, iochip_0_w) |
| 534 | 534 | AM_RANGE(0x150000, 0x15000f) AM_MIRROR(0x00fff0) AM_READWRITE(iochip_1_r, iochip_1_w) |
| r2418 | r2419 | |
| 2427 | 2427 | xboard_generic_init(); |
| 2428 | 2428 | xboard_set_road_priority(0); |
| 2429 | 2429 | |
| 2430 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140006, 0x140007, 0, 0x00fff0, aburner2_iochip_0_D_w); | |
| 2430 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140006, 0x140007, 0, 0x00fff0, aburner2_iochip_0_D_w); | |
| 2431 | 2431 | } |
| 2432 | 2432 | |
| 2433 | 2433 | |
| r2418 | r2419 | |
| 2444 | 2444 | adc_reverse[1] = adc_reverse[3] = 1; |
| 2445 | 2445 | |
| 2446 | 2446 | /* install extra synchronization on core shared memory */ |
| 2447 | loffire_sync = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x29c000, 0x29c011, 0, 0, loffire_sync0_w); | |
| 2447 | loffire_sync = memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x29c000, 0x29c011, 0, 0, loffire_sync0_w); | |
| 2448 | 2448 | } |
| 2449 | 2449 | |
| 2450 | 2450 | |
| 2451 | 2451 | static DRIVER_INIT( smgp ) |
| 2452 | 2452 | { |
| 2453 | 2453 | xboard_generic_init(); |
| 2454 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2f0000, 0x2f3fff, 0, 0, smgp_excs_r, smgp_excs_w); | |
| 2454 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2f0000, 0x2f3fff, 0, 0, smgp_excs_r, smgp_excs_w); | |
| 2455 | 2455 | } |
| 2456 | 2456 | |
| 2457 | 2457 |
| r2418 | r2419 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 83 | 83 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 84 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(sonson_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 85 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_WRITE(sonson_colorram_w) AM_BASE(&colorram) | |
| 84 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(sonson_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 85 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(sonson_colorram_w) AM_BASE(&colorram) | |
| 86 | 86 | AM_RANGE(0x2020, 0x207f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 87 | 87 | AM_RANGE(0x3000, 0x3000) AM_WRITE(sonson_scrollx_w) |
| 88 | 88 | AM_RANGE(0x3002, 0x3002) AM_READ(input_port_0_r) /* IN0 */ |
| r2418 | r2419 | |
|---|---|---|
| 405 | 405 | |
| 406 | 406 | static ADDRESS_MAP_START( sslam_program_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 407 | 407 | AM_RANGE(0x000400, 0x07ffff) AM_RAM |
| 408 | AM_RANGE(0x100000, 0x103fff) AM_READWRITE(SMH_RAM, sslam_bg_tileram_w) AM_BASE(&sslam_bg_tileram) | |
| 409 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(SMH_RAM, sslam_md_tileram_w) AM_BASE(&sslam_md_tileram) | |
| 410 | AM_RANGE(0x108000, 0x10ffff) AM_READWRITE(SMH_RAM, sslam_tx_tileram_w) AM_BASE(&sslam_tx_tileram) | |
| 408 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(sslam_bg_tileram_w) AM_BASE(&sslam_bg_tileram) | |
| 409 | AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(sslam_md_tileram_w) AM_BASE(&sslam_md_tileram) | |
| 410 | AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(sslam_tx_tileram_w) AM_BASE(&sslam_tx_tileram) | |
| 411 | 411 | AM_RANGE(0x110000, 0x11000d) AM_RAM AM_BASE(&sslam_regs) |
| 412 | 412 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP |
| 413 | AM_RANGE(0x280000, 0x280fff) AM_R | |
| 413 | AM_RANGE(0x280000, 0x280fff) AM_R | |
| 414 | 414 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE(&sslam_spriteram) |
| 415 | 415 | AM_RANGE(0x304000, 0x304001) AM_WRITENOP |
| 416 | 416 | AM_RANGE(0x300010, 0x300011) AM_READ_PORT("IN0") |
| r2418 | r2419 | |
| 428 | 428 | |
| 429 | 429 | static ADDRESS_MAP_START( powerbls_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 430 | 430 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 431 | AM_RANGE(0x100000, 0x103fff) AM_R | |
| 431 | AM_RANGE(0x100000, 0x103fff) AM_R | |
| 432 | 432 | AM_RANGE(0x104000, 0x107fff) AM_RAM // not used |
| 433 | 433 | AM_RANGE(0x110000, 0x11000d) AM_RAM AM_BASE(&sslam_regs) |
| 434 | 434 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP |
| 435 | 435 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE(&sslam_spriteram) |
| 436 | AM_RANGE(0x280000, 0x2803ff) AM_R | |
| 436 | AM_RANGE(0x280000, 0x2803ff) AM_R | |
| 437 | 437 | AM_RANGE(0x300010, 0x300011) AM_READ_PORT("IN0") |
| 438 | 438 | AM_RANGE(0x300012, 0x300013) AM_READ_PORT("IN1") |
| 439 | 439 | AM_RANGE(0x300014, 0x300015) AM_READ_PORT("IN2") |
| r2418 | r2419 | |
|---|---|---|
| 323 | 323 | AM_RANGE(0x154000, 0x155fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) |
| 324 | 324 | AM_RANGE(0x160000, 0x161fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 325 | 325 | AM_RANGE(0x164000, 0x165fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 326 | AM_RANGE(0x170000, 0x170003) AM_RAM | |
| 326 | AM_RANGE(0x170000, 0x170003) AM_RAM | |
| 327 | 327 | AM_RANGE(0x180000, 0x180003) AM_READWRITE(oki_r,oki_w) |
| 328 | 328 | AM_RANGE(0x1c0000, 0x1c0003) AM_READWRITE(oki2_r,oki2_w) |
| 329 | 329 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| r2418 | r2419 | |
| 347 | 347 | AM_RANGE(0x454000, 0x455fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) |
| 348 | 348 | AM_RANGE(0x460000, 0x461fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 349 | 349 | AM_RANGE(0x464000, 0x465fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 350 | AM_RANGE(0x470000, 0x470003) AM_RAM | |
| 350 | AM_RANGE(0x470000, 0x470003) AM_RAM | |
| 351 | 351 | AM_RANGE(0x480000, 0x480003) AM_READWRITE(oki_r,oki_w) |
| 352 | 352 | ADDRESS_MAP_END |
| 353 | 353 | |
| r2418 | r2419 | |
| 368 | 368 | AM_RANGE(0x3d4000, 0x3d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) |
| 369 | 369 | AM_RANGE(0x3e0000, 0x3e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 370 | 370 | AM_RANGE(0x3e4000, 0x3e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 371 | AM_RANGE(0x3f0000, 0x3f0003) AM_RAM | |
| 371 | AM_RANGE(0x3f0000, 0x3f0003) AM_RAM | |
| 372 | 372 | AM_RANGE(0x400000, 0x400003) AM_READWRITE(oki_r,oki_w) |
| 373 | 373 | ADDRESS_MAP_END |
| 374 | 374 | |
| r2418 | r2419 | |
| 389 | 389 | AM_RANGE(0x6d4000, 0x6d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) |
| 390 | 390 | AM_RANGE(0x6e0000, 0x6e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 391 | 391 | AM_RANGE(0x6e4000, 0x6e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 392 | AM_RANGE(0x6f0000, 0x6f0003) AM_RAM | |
| 392 | AM_RANGE(0x6f0000, 0x6f0003) AM_RAM | |
| 393 | 393 | AM_RANGE(0x780000, 0x780003) AM_READWRITE(oki_r,oki_w) |
| 394 | 394 | ADDRESS_MAP_END |
| 395 | 395 | |
| r2418 | r2419 | |
| 409 | 409 | AM_RANGE(0x1d4000, 0x1d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w) |
| 410 | 410 | AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 411 | 411 | AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 412 | AM_RANGE(0x1f0000, 0x1f0003) AM_RAM | |
| 412 | AM_RANGE(0x1f0000, 0x1f0003) AM_RAM | |
| 413 | 413 | AM_RANGE(0x200000, 0x200003) AM_READ(simpl156_inputs_read) |
| 414 | 414 | AM_RANGE(0x201000, 0x201fff) AM_RAM AM_BASE(&simpl156_systemram) // work ram (32-bit) |
| 415 | 415 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 1163 | 1163 | |
| 1164 | 1164 | static DRIVER_INIT (joemacr) |
| 1165 | 1165 | { |
| 1166 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r ); | |
| 1166 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r ); | |
| 1167 | 1167 | DRIVER_INIT_CALL(simpl156); |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| r2418 | r2419 | |
| 1175 | 1175 | |
| 1176 | 1176 | static DRIVER_INIT (chainrec) |
| 1177 | 1177 | { |
| 1178 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r ); | |
| 1178 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r ); | |
| 1179 | 1179 | DRIVER_INIT_CALL(simpl156); |
| 1180 | 1180 | simpl156_default_eeprom = chainrec_eeprom; |
| 1181 | 1181 | } |
| r2418 | r2419 | |
| 1188 | 1188 | |
| 1189 | 1189 | static DRIVER_INIT (prtytime) |
| 1190 | 1190 | { |
| 1191 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); | |
| 1191 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); | |
| 1192 | 1192 | DRIVER_INIT_CALL(simpl156); |
| 1193 | 1193 | simpl156_default_eeprom = prtytime_eeprom; |
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | static DRIVER_INIT (gangonta) |
| 1197 | 1197 | { |
| 1198 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); | |
| 1198 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); | |
| 1199 | 1199 | DRIVER_INIT_CALL(simpl156); |
| 1200 | 1200 | simpl156_default_eeprom = gangonta_eeprom; |
| 1201 | 1201 | } |
| r2418 | r2419 | |
| 1209 | 1209 | |
| 1210 | 1210 | static DRIVER_INIT (charlien) |
| 1211 | 1211 | { |
| 1212 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r ); | |
| 1212 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r ); | |
| 1213 | 1213 | DRIVER_INIT_CALL(simpl156); |
| 1214 | 1214 | } |
| 1215 | 1215 | |
| r2418 | r2419 | |
| 1221 | 1221 | |
| 1222 | 1222 | static DRIVER_INIT (osman) |
| 1223 | 1223 | { |
| 1224 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); | |
| 1224 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); | |
| 1225 | 1225 | DRIVER_INIT_CALL(simpl156); |
| 1226 | 1226 | simpl156_default_eeprom = osman_eeprom; |
| 1227 | 1227 | |
| r2418 | r2419 | |
| 1229 | 1229 | |
| 1230 | 1230 | static DRIVER_INIT (candance) |
| 1231 | 1231 | { |
| 1232 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); | |
| 1232 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); | |
| 1233 | 1233 | DRIVER_INIT_CALL(simpl156); |
| 1234 | 1234 | simpl156_default_eeprom = candance_eeprom; |
| 1235 | 1235 | } |
| r2418 | r2419 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 84 | 84 | AM_RANGE(0x00000, 0x037ff) AM_RAM |
| 85 | AM_RANGE(0x03800, 0x03fff) AM_R | |
| 85 | AM_RANGE(0x03800, 0x03fff) AM_R | |
| 86 | 86 | AM_RANGE(0x04000, 0x04fff) AM_RAM AM_SHARE(1) |
| 87 | 87 | AM_RANGE(0x08000, 0x08001) AM_WRITE(deadang_bank_w) |
| 88 | 88 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(watchdog_reset16_w) |
| r2418 | r2419 | |
| 462 | 462 | seibu_sound_decrypt(REGION_CPU3, 0x2000); |
| 463 | 463 | seibu_adpcm_decrypt(REGION_SOUND1); |
| 464 | 464 | |
| 465 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r); | |
| 466 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r); | |
| 465 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r); | |
| 466 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r); | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /* Game Drivers */ |
| r2418 | r2419 | |
|---|---|---|
| 843 | 843 | protection_handler = ultennis_protection; |
| 844 | 844 | |
| 845 | 845 | /* additional (protection?) hack */ |
| 846 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300001, 0, 0, ultennis_hack_r); | |
| 846 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300001, 0, 0, ultennis_hack_r); | |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 |
| r2418 | r2419 | |
|---|---|---|
| 340 | 340 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1) |
| 341 | 341 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_BASE(&spriteram) |
| 342 | 342 | AM_RANGE(0x1200, 0x1fff) AM_RAM |
| 343 | AM_RANGE(0x2000, 0x27ff) AM_R | |
| 343 | AM_RANGE(0x2000, 0x27ff) AM_R | |
| 344 | 344 | AM_RANGE(0x2800, 0x2fff) AM_RAM |
| 345 | 345 | |
| 346 | 346 | // { 0x1b00, 0x1b00, input_port_0_r }, |
| r2418 | r2419 | |
| 356 | 356 | |
| 357 | 357 | static ADDRESS_MAP_START( cntsteer_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 358 | 358 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1) |
| 359 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 359 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 360 | 360 | AM_RANGE(0x3000, 0x3000) AM_READ(input_port_0_r) |
| 361 | 361 | AM_RANGE(0x3001, 0x3001) AM_READ(input_port_1_r) |
| 362 | 362 | AM_RANGE(0x3002, 0x3002) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
| 378 | 378 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1) |
| 379 | 379 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_BASE(&spriteram) |
| 380 | 380 | AM_RANGE(0x1200, 0x1fff) AM_RAM |
| 381 | AM_RANGE(0x2000, 0x27ff) AM_R | |
| 381 | AM_RANGE(0x2000, 0x27ff) AM_R | |
| 382 | 382 | AM_RANGE(0x3000, 0x3003) AM_WRITE(zerotrgt_ctrl_w) |
| 383 | 383 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 384 | 384 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 452 | 452 | |
| 453 | 453 | static ADDRESS_MAP_START( gekitsui_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 454 | 454 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1) |
| 455 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 455 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 456 | 456 | AM_RANGE(0x3000, 0x3000) AM_READ(input_port_0_r) |
| 457 | 457 | AM_RANGE(0x3001, 0x3001) AM_READ(input_port_1_r) |
| 458 | 458 | AM_RANGE(0x3002, 0x3002) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
|---|---|---|
| 204 | 204 | AM_RANGE(0x000000, 0x02ffff) AM_ROM |
| 205 | 205 | AM_RANGE(0x030000, 0x033fff) AM_RAM /* 68K and DSP shared RAM */ |
| 206 | 206 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 207 | AM_RANGE(0x050000, 0x050dff) AM_R | |
| 207 | AM_RANGE(0x050000, 0x050dff) AM_R | |
| 208 | 208 | AM_RANGE(0x060000, 0x060001) AM_WRITE(twincobr_crtc_reg_sel_w) /* 6845 CRT controller */ |
| 209 | 209 | AM_RANGE(0x060002, 0x060003) AM_WRITE(twincobr_crtc_data_w) /* 6845 CRT controller */ |
| 210 | 210 | AM_RANGE(0x070000, 0x070003) AM_WRITE(twincobr_txscroll_w) /* text layer scroll */ |
| r2418 | r2419 | |
|---|---|---|
| 120 | 120 | static ADDRESS_MAP_START( bking_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 121 | 121 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 122 | 122 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 123 | AM_RANGE(0x9000, 0x97ff) AM_RAM | |
| 123 | AM_RANGE(0x9000, 0x97ff) AM_RAM | |
| 124 | 124 | ADDRESS_MAP_END |
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( bking_io_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 223 | 223 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(&galpani2_ram ) // Work RAM |
| 224 | 224 | AM_RANGE(0x300000, 0x301fff) AM_RAM // ? |
| 225 | 225 | AM_RANGE(0x302000, 0x303fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites |
| 226 | AM_RANGE(0x304000, 0x30401f) AM_R | |
| 226 | AM_RANGE(0x304000, 0x30401f) AM_R | |
| 227 | 227 | // AM_RANGE(0x308000, 0x308001) AM_WRITE(SMH_NOP ) // ? 0 at startup |
| 228 | 228 | AM_RANGE(0x30c000, 0x30c001) AM_WRITE(SMH_NOP ) // ? hblank effect ? |
| 229 | AM_RANGE(0x310000, 0x3101ff) AM_R | |
| 229 | AM_RANGE(0x310000, 0x3101ff) AM_R | |
| 230 | 230 | AM_RANGE(0x314000, 0x314001) AM_WRITE(SMH_NOP ) // ? flip backgrounds ? |
| 231 | 231 | AM_RANGE(0x318000, 0x318001) AM_READWRITE(galpani2_eeprom_r, galpani2_eeprom_w ) // EEPROM |
| 232 | 232 | AM_RANGE(0x380000, 0x387fff) AM_RAM // Palette? |
| 233 | AM_RANGE(0x388000, 0x38ffff) AM_READWRITE(SMH_RAM, paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16 ) // Palette | |
| 234 | AM_RANGE(0x400000, 0x43ffff) AM_READWRITE(SMH_RAM, galpani2_bg8_0_w) AM_BASE(&galpani2_bg8_0 ) // Background 0 | |
| 233 | AM_RANGE(0x388000, 0x38ffff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16 ) // Palette | |
| 234 | AM_RANGE(0x400000, 0x43ffff) AM_RAM_WRITE(galpani2_bg8_0_w) AM_BASE(&galpani2_bg8_0 ) // Background 0 | |
| 235 | 235 | AM_RANGE(0x440000, 0x440001) AM_RAM AM_BASE(&galpani2_bg8_0_scrollx ) // Background 0 Scroll X |
| 236 | 236 | AM_RANGE(0x480000, 0x480001) AM_RAM AM_BASE(&galpani2_bg8_0_scrolly ) // Background 0 Scroll Y |
| 237 | 237 | AM_RANGE(0x4c0000, 0x4c0001) AM_WRITE(SMH_NOP ) // ? 0 at startup only |
| 238 | AM_RANGE(0x500000, 0x53ffff) AM_R | |
| 238 | AM_RANGE(0x500000, 0x53ffff) AM_R | |
| 239 | 239 | AM_RANGE(0x540000, 0x540001) AM_RAM AM_BASE(&galpani2_bg8_1_scrollx ) // Background 1 Scroll X |
| 240 | 240 | AM_RANGE(0x580000, 0x580001) AM_RAM AM_BASE(&galpani2_bg8_1_scrolly ) // Background 1 Scroll Y |
| 241 | 241 | AM_RANGE(0x5c0000, 0x5c0001) AM_WRITE(SMH_NOP ) // ? 0 at startup only |
| r2418 | r2419 | |
| 278 | 278 | static ADDRESS_MAP_START( galpani2_mem2, ADDRESS_SPACE_PROGRAM, 16 ) |
| 279 | 279 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 280 | 280 | AM_RANGE(0x100000, 0x13ffff) AM_RAM AM_BASE(&galpani2_ram2) // Work RAM |
| 281 | AM_RANGE(0x400000, 0x4fffff) AM_R | |
| 281 | AM_RANGE(0x400000, 0x4fffff) AM_R | |
| 282 | 282 | AM_RANGE(0x500000, 0x5fffff) AM_RAM // bg15 |
| 283 | 283 | AM_RANGE(0x600000, 0x600001) AM_WRITE(SMH_NOP ) // ? 0 at startup only |
| 284 | 284 | AM_RANGE(0x640000, 0x640001) AM_WRITE(SMH_NOP ) // ? 0 at startup only |
| r2418 | r2419 | |
|---|---|---|
| 422 | 422 | |
| 423 | 423 | static DRIVER_INIT( arabian ) |
| 424 | 424 | { |
| 425 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd34b, 0xd34b, 0, 0, custom_flip_w); | |
| 426 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd401, 0, 0, custom_cocktail_w); | |
| 425 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd34b, 0xd34b, 0, 0, custom_flip_w); | |
| 426 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd401, 0, 0, custom_cocktail_w); | |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 |
| r2418 | r2419 | |
|---|---|---|
| 228 | 228 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 229 | 229 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 230 | 230 | AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1) |
| 231 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 231 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 232 | 232 | AM_RANGE(0xd000, 0xffff) AM_READWRITE(fromance_videoram_r, fromance_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 233 | 233 | ADDRESS_MAP_END |
| 234 | 234 | |
| r2418 | r2419 | |
| 744 | 744 | /* sprite RAM lives at the end of palette RAM */ |
| 745 | 745 | spriteram = &paletteram[0xc00]; |
| 746 | 746 | spriteram_size = 0x400; |
| 747 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3); | |
| 748 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3); | |
| 747 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3, SMH_BANK3); | |
| 749 | 748 | memory_set_bankptr(3, spriteram); |
| 750 | 749 | } |
| 751 | 750 | |
| 752 | 751 | |
| 753 | 752 | static DRIVER_INIT( hatris ) |
| 754 | 753 | { |
| 755 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0, sound_command_nonmi_w); | |
| 756 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x21, 0x21, 0, 0, fromance_gfxreg_w); | |
| 754 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0, sound_command_nonmi_w); | |
| 755 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x21, 0x21, 0, 0, fromance_gfxreg_w); | |
| 757 | 756 | } |
| 758 | 757 | |
| 759 | 758 |
| r2418 | r2419 | |
|---|---|---|
| 342 | 342 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 343 | 343 | AM_RANGE(0x0000, 0x0001) AM_WRITE(ccastles_bitmode_addr_w) |
| 344 | 344 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(ccastles_bitmode_r, ccastles_bitmode_w) |
| 345 | AM_RANGE(0x0000, 0x7fff) AM_R | |
| 345 | AM_RANGE(0x0000, 0x7fff) AM_R | |
| 346 | 346 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 347 | 347 | AM_RANGE(0x8e00, 0x8fff) AM_BASE(&spriteram) |
| 348 | 348 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0300) AM_RAM AM_BASE(&nvram_stage) AM_SIZE(&generic_nvram_size) |
| r2418 | r2419 | |
|---|---|---|
| 325 | 325 | AM_RANGE(0x01500000, 0x0153ffff) AM_MIRROR(0xfc000000) AM_WRITE(exterm_output_port_0_w) |
| 326 | 326 | AM_RANGE(0x01580000, 0x015bffff) AM_MIRROR(0xfc000000) AM_WRITE(sound_latch_w) |
| 327 | 327 | AM_RANGE(0x015c0000, 0x015fffff) AM_MIRROR(0xfc000000) AM_WRITE(watchdog_reset16_w) |
| 328 | AM_RANGE(0x01800000, 0x01807fff) AM_MIRROR(0xfc7f8000) AM_R | |
| 328 | AM_RANGE(0x01800000, 0x01807fff) AM_MIRROR(0xfc7f8000) AM_R | |
| 329 | 329 | AM_RANGE(0x02800000, 0x02807fff) AM_MIRROR(0xfc7f8000) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 330 | 330 | AM_RANGE(0x03000000, 0x03ffffff) AM_MIRROR(0xfc000000) AM_ROM AM_REGION(REGION_USER1, 0) |
| 331 | 331 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "deprecat.h" | |
| 68 | #include "memconv.h" | |
| 69 | 67 | #include "devconv.h" |
| 68 | #include "deprecat.h" | |
| 70 | 69 | #include "machine/8237dma.h" |
| 71 | 70 | #include "machine/pic8259.h" |
| 72 | 71 | #include "machine/pit8253.h" |
| r2418 | r2419 | |
| 157 | 156 | #define DC_CFIFO_DIAG 0x7c/4 |
| 158 | 157 | |
| 159 | 158 | |
| 159 | static void ide_interrupt(const device_config *device, int state); | |
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | |
| r2418 | r2419 | |
| 367 | 367 | dma8237_w(device, offset / 2, data); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | static READ32_DEVICE_HANDLER(at32_dma8237_2_r) | |
| 371 | { | |
| 372 | return read32le_with_read8_device_handler(at_dma8237_2_r, device, offset, mem_mask); | |
| 373 | } | |
| 374 | 370 | |
| 375 | static | |
| 371 | static | |
| 376 | 372 | { |
| 377 | | |
| 373 | | |
| 378 | 374 | } |
| 379 | 375 | |
| 380 | ||
| 381 | ||
| 382 | static READ32_HANDLER( ide0_r ) | |
| 376 | static WRITE32_DEVICE_HANDLER( ide_w ) | |
| 383 | 377 | { |
| 384 | | |
| 378 | | |
| 385 | 379 | } |
| 386 | 380 | |
| 387 | static | |
| 381 | static | |
| 388 | 382 | { |
| 389 | ide_controller32_ | |
| 383 | return ide_controller32_r | |
| 390 | 384 | } |
| 391 | 385 | |
| 392 | static RE | |
| 386 | static WRITE | |
| 393 | 387 | { |
| 394 | | |
| 388 | | |
| 395 | 389 | } |
| 396 | 390 | |
| 397 | static WRITE32_HANDLER( fdc_w ) | |
| 398 | { | |
| 399 | ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask); | |
| 400 | } | |
| 401 | 391 | |
| 402 | 392 | |
| 403 | ||
| 404 | 393 | static READ32_HANDLER( memory_ctrl_r ) |
| 405 | 394 | { |
| 406 | 395 | return memory_ctrl_reg[offset]; |
| r2418 | r2419 | |
| 476 | 465 | // 0x20 - 0x21, PIC |
| 477 | 466 | if (ACCESSING_BITS_0_15) |
| 478 | 467 | { |
| 479 | r |= read32le_with_read8_device_handler( pic8259_r, | |
| 468 | r |= read32le_with_read8_device_handler( pic8259_r, | |
| 480 | 469 | } |
| 481 | 470 | |
| 482 | 471 | // 0x22, 0x23, Cyrix configuration registers |
| r2418 | r2419 | |
| 496 | 485 | // 0x20 - 0x21, PIC |
| 497 | 486 | if (ACCESSING_BITS_0_15) |
| 498 | 487 | { |
| 499 | write32le_with_write8_device_handler( pic8259_w, | |
| 488 | write32le_with_write8_device_handler( pic8259_w, | |
| 500 | 489 | } |
| 501 | 490 | |
| 502 | 491 | // 0x22, 0x23, Cyrix configuration registers |
| r2418 | r2419 | |
| 833 | 822 | NULL |
| 834 | 823 | }; |
| 835 | 824 | |
| 836 | static READ32_HANDLER(at_page32_r) | |
| 837 | { | |
| 838 | return read32le_with_read8_handler(at_page8_r, machine, offset, mem_mask); | |
| 839 | } | |
| 840 | 825 | |
| 841 | ||
| 842 | static WRITE32_HANDLER(at_page32_w) | |
| 843 | { | |
| 844 | write32le_with_write8_handler(at_page8_w, machine, offset, data, mem_mask); | |
| 845 | } | |
| 846 | ||
| 847 | ||
| 848 | DEV_READWRITE8TO32LE( mediagx_pit8254_32le, pit8253_r, pit8253_w ) | |
| 849 | DEV_READWRITE8TO32LE( mediagx_dma8237_32le, dma8237_r, dma8237_w ) | |
| 850 | DEV_READWRITE8TO32LE( mediagx_pic8259_32le, pic8259_r, pic8259_w ) | |
| 851 | ||
| 852 | ||
| 853 | 826 | /*****************************************************************************/ |
| 854 | 827 | |
| 855 | 828 | static ADDRESS_MAP_START( mediagx_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r2418 | r2419 | |
| 866 | 839 | ADDRESS_MAP_END |
| 867 | 840 | |
| 868 | 841 | static ADDRESS_MAP_START(mediagx_io, ADDRESS_SPACE_IO, 32) |
| 869 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", | |
| 842 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8(DMA8237, "dma8237_1", | |
| 870 | 843 | AM_RANGE(0x0020, 0x0023) AM_READWRITE(io20_r, io20_w) |
| 871 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", | |
| 844 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8(PIT8254, "pit8254", | |
| 872 | 845 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 873 | 846 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 874 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) | |
| 875 | AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE(PIC8259, "pic8259_2", mediagx_pic8259_32le_r, mediagx_pic8259_32le_w) | |
| 876 | AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) | |
| 847 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r, at_page8_w, 0xffffffff) | |
| 848 | AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE8(PIC8259, "pic8259_2", pic8259_r, pic8259_w, 0xffffffff) | |
| 849 | AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE8(DMA8237, "dma8237_2", at_dma8237_2_r, at_dma8237_2_w, 0xffffffff) | |
| 877 | 850 | AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port |
| 878 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide | |
| 851 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide | |
| 879 | 852 | AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w) |
| 880 | AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w) | |
| 853 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w) | |
| 881 | 854 | AM_RANGE(0x0400, 0x04ff) AM_READWRITE(ad1847_r, ad1847_w) |
| 882 | 855 | AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w) |
| 883 | 856 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 973 | 946 | return r; |
| 974 | 947 | } |
| 975 | 948 | |
| 949 | static MACHINE_START(mediagx) | |
| 950 | { | |
| 951 | mediagx_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 952 | mediagx_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 953 | mediagx_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 954 | mediagx_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 955 | mediagx_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 956 | } | |
| 957 | ||
| 976 | 958 | static MACHINE_RESET(mediagx) |
| 977 | 959 | { |
| 978 | 960 | UINT8 *rom = memory_region(REGION_USER1); |
| r2418 | r2419 | |
| 988 | 970 | timer_adjust_oneshot(sound_timer, ATTOTIME_IN_MSEC(10), 0); |
| 989 | 971 | |
| 990 | 972 | dmadac_enable(0, 2, 1); |
| 991 | ide_controller_reset(0); | |
| 992 | ||
| 993 | mediagx_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 994 | mediagx_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 995 | mediagx_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 996 | mediagx_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 997 | mediagx_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 973 | devtag_reset(machine, IDE_CONTROLLER, "ide"); | |
| 998 | 974 | } |
| 999 | 975 | |
| 1000 | 976 | /************************************************************* |
| r2418 | r2419 | |
| 1062 | 1038 | MDRV_CPU_PROGRAM_MAP(mediagx_map, 0) |
| 1063 | 1039 | MDRV_CPU_IO_MAP(mediagx_io, 0) |
| 1064 | 1040 | |
| 1041 | MDRV_MACHINE_START(mediagx) | |
| 1065 | 1042 | MDRV_MACHINE_RESET(mediagx) |
| 1066 | 1043 | |
| 1067 | 1044 | MDRV_DEVICE_ADD( "pit8254", PIT8254 ) |
| r2418 | r2419 | |
| 1079 | 1056 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 1080 | 1057 | MDRV_DEVICE_CONFIG( mediagx_pic8259_2_config ) |
| 1081 | 1058 | |
| 1059 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 1060 | ||
| 1082 | 1061 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 1083 | 1062 | |
| 1084 | 1063 | /* video hardware */ |
| r2418 | r2419 | |
| 1114 | 1093 | pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); |
| 1115 | 1094 | } |
| 1116 | 1095 | |
| 1117 | static void ide_interrupt(int state) | |
| 1096 | static void ide_interrupt(const device_config *device, int state) | |
| 1118 | 1097 | { |
| 1119 | 1098 | pic8259_set_irq_line(mediagx_devices.pic8259_2, 6, state); |
| 1120 | 1099 | } |
| r2418 | r2419 | |
| 1128 | 1107 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, mediagx_get_out2 |
| 1129 | 1108 | }; |
| 1130 | 1109 | |
| 1131 | static const struct ide_interface ide_intf = | |
| 1132 | { | |
| 1133 | ide_interrupt | |
| 1134 | }; | |
| 1135 | ||
| 1136 | 1110 | static const struct pci_device_info cx5510 = |
| 1137 | 1111 | { |
| 1138 | 1112 | cx5510_pci_r, |
| r2418 | r2419 | |
| 1152 | 1126 | pci_add_device(0, 18, &cx5510); |
| 1153 | 1127 | |
| 1154 | 1128 | kbdc8042_init(&at8042); |
| 1155 | ||
| 1156 | ide_controller_init(0, &ide_intf); | |
| 1157 | 1129 | } |
| 1158 | 1130 | |
| 1159 | 1131 | #if SPEEDUP_HACKS |
| r2418 | r2419 | |
| 1219 | 1191 | speedup_count = count; |
| 1220 | 1192 | |
| 1221 | 1193 | for (i = 0; i < count; i++) |
| 1222 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, entries[i].offset, entries[i].offset + 3, 0, 0, speedup_handlers[i]); | |
| 1194 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, entries[i].offset, entries[i].offset + 3, 0, 0, speedup_handlers[i]); | |
| 1223 | 1195 | |
| 1224 | 1196 | #ifdef MAME_DEBUG |
| 1225 | 1197 | add_exit_callback(machine, report_speedups); |
| r2418 | r2419 | |
|---|---|---|
| 125 | 125 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x07ff) AM_READ(input_port_2_r) |
| 126 | 126 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x07ff) AM_READ(input_port_3_r) |
| 127 | 127 | AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x07ff) AM_READ(input_port_4_r) |
| 128 | AM_RANGE(0x3000, 0x33bf) AM_MIRROR(0x0400) AM_R | |
| 128 | AM_RANGE(0x3000, 0x33bf) AM_MIRROR(0x0400) AM_R | |
| 129 | 129 | AM_RANGE(0x33c0, 0x33ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&orbit_sprite_ram) |
| 130 | 130 | AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x00ff) AM_WRITE(orbit_note_w) |
| 131 | 131 | AM_RANGE(0x3900, 0x3900) AM_MIRROR(0x00ff) AM_WRITE(orbit_noise_amp_w) |
| r2418 | r2419 | |
|---|---|---|
| 695 | 695 | |
| 696 | 696 | static DRIVER_INIT( policetr ) |
| 697 | 697 | { |
| 698 | speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w); | |
| 698 | speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w); | |
| 699 | 699 | speedup_pc = 0x1fc028ac; |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | static DRIVER_INIT( plctr13b ) |
| 703 | 703 | { |
| 704 | speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w); | |
| 704 | speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w); | |
| 705 | 705 | speedup_pc = 0x1fc028bc; |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | |
| 709 | 709 | static DRIVER_INIT( sshooter ) |
| 710 | 710 | { |
| 711 | speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w); | |
| 711 | speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w); | |
| 712 | 712 | speedup_pc = 0x1fc03470; |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | static DRIVER_INIT( sshoot12 ) |
| 716 | 716 | { |
| 717 | speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w); | |
| 717 | speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w); | |
| 718 | 718 | speedup_pc = 0x1fc033e0; |
| 719 | 719 | } |
| 720 | 720 |
| r2418 | r2419 | |
|---|---|---|
| 1749 | 1749 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE ); |
| 1750 | 1750 | cpunum_set_irq_callback(0, spi_irq_callback); |
| 1751 | 1751 | |
| 1752 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r); | |
| 1753 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w); | |
| 1754 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, z80_enable_w); | |
| 1752 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r); | |
| 1753 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w); | |
| 1754 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, z80_enable_w); | |
| 1755 | 1755 | |
| 1756 | 1756 | z80_rom = auto_malloc(0x40000); |
| 1757 | 1757 | memory_set_bankptr(4, z80_rom); |
| r2418 | r2419 | |
| 1823 | 1823 | |
| 1824 | 1824 | memcpy(z80_rom, rom, 0x40000); |
| 1825 | 1825 | |
| 1826 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, eeprom_w); | |
| 1827 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sb_coin_r); | |
| 1826 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, eeprom_w); | |
| 1827 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sb_coin_r); | |
| 1828 | 1828 | cpunum_set_irq_callback(0, spi_irq_callback); |
| 1829 | 1829 | |
| 1830 | 1830 | sb_coin_latch = 0; |
| r2418 | r2419 | |
| 1995 | 1995 | |
| 1996 | 1996 | static DRIVER_INIT( rdft ) |
| 1997 | 1997 | { |
| 1998 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00298d0, 0x00298d3, 0, 0, rdft_speedup_r ); | |
| 1998 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00298d0, 0x00298d3, 0, 0, rdft_speedup_r ); | |
| 1999 | 1999 | |
| 2000 | 2000 | init_spi(machine); |
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | static DRIVER_INIT( senkyu ) |
| 2004 | 2004 | { |
| 2005 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018cb4, 0x0018cb7, 0, 0, senkyu_speedup_r ); | |
| 2005 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018cb4, 0x0018cb7, 0, 0, senkyu_speedup_r ); | |
| 2006 | 2006 | |
| 2007 | 2007 | init_spi(machine); |
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | 2010 | static DRIVER_INIT( senkyua ) |
| 2011 | 2011 | { |
| 2012 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018c9c, 0x0018c9f, 0, 0, senkyua_speedup_r ); | |
| 2012 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018c9c, 0x0018c9f, 0, 0, senkyua_speedup_r ); | |
| 2013 | 2013 | |
| 2014 | 2014 | init_spi(machine); |
| 2015 | 2015 | } |
| 2016 | 2016 | |
| 2017 | 2017 | static DRIVER_INIT( batlball ) |
| 2018 | 2018 | { |
| 2019 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018db4, 0x0018db7, 0, 0, batlball_speedup_r ); | |
| 2019 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018db4, 0x0018db7, 0, 0, batlball_speedup_r ); | |
| 2020 | 2020 | |
| 2021 | 2021 | init_spi(machine); |
| 2022 | 2022 | } |
| r2418 | r2419 | |
| 2024 | 2024 | static DRIVER_INIT( ejanhs ) |
| 2025 | 2025 | { |
| 2026 | 2026 | // idle skip doesn't work properly? |
| 2027 | // memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002d224, 0x002d227, 0, 0, ejanhs_speedup_r ); | |
| 2027 | // memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002d224, 0x002d227, 0, 0, ejanhs_speedup_r ); | |
| 2028 | 2028 | |
| 2029 | 2029 | init_spi(machine); |
| 2030 | 2030 | } |
| 2031 | 2031 | |
| 2032 | 2032 | static DRIVER_INIT( viprp1 ) |
| 2033 | 2033 | { |
| 2034 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x001e2e0, 0x001e2e3, 0, 0, viprp1_speedup_r ); | |
| 2034 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x001e2e0, 0x001e2e3, 0, 0, viprp1_speedup_r ); | |
| 2035 | 2035 | |
| 2036 | 2036 | init_spi(machine); |
| 2037 | 2037 | } |
| 2038 | 2038 | |
| 2039 | 2039 | static DRIVER_INIT( viprp1o ) |
| 2040 | 2040 | { |
| 2041 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x001d49c, 0x001d49f, 0, 0, viprp1o_speedup_r ); | |
| 2041 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x001d49c, 0x001d49f, 0, 0, viprp1o_speedup_r ); | |
| 2042 | 2042 | |
| 2043 | 2043 | init_spi(machine); |
| 2044 | 2044 | } |
| r2418 | r2419 | |
| 2050 | 2050 | intelflash_init( 0, FLASH_INTEL_E28F008SA, NULL ); |
| 2051 | 2051 | intelflash_init( 1, FLASH_INTEL_E28F008SA, NULL ); |
| 2052 | 2052 | |
| 2053 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0282AC, 0x0282AF, 0, 0, rf2_speedup_r ); | |
| 2053 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0282AC, 0x0282AF, 0, 0, rf2_speedup_r ); | |
| 2054 | 2054 | seibuspi_rise10_text_decrypt(memory_region(REGION_GFX1)); |
| 2055 | 2055 | seibuspi_rise10_bg_decrypt(memory_region(REGION_GFX2), memory_region_length(REGION_GFX2)); |
| 2056 | 2056 | seibuspi_rise10_sprite_decrypt(memory_region(REGION_GFX3), 0x600000); |
| 2057 | 2057 | |
| 2058 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w); | |
| 2058 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w); | |
| 2059 | 2059 | } |
| 2060 | 2060 | |
| 2061 | 2061 | static DRIVER_INIT( rdft2 ) |
| r2418 | r2419 | |
| 2074 | 2074 | intelflash_init( 0, FLASH_INTEL_E28F008SA, NULL ); |
| 2075 | 2075 | intelflash_init( 1, FLASH_INTEL_E28F008SA, NULL ); |
| 2076 | 2076 | |
| 2077 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002894c, 0x002894f, 0, 0, rfjet_speedup_r ); | |
| 2077 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002894c, 0x002894f, 0, 0, rfjet_speedup_r ); | |
| 2078 | 2078 | seibuspi_rise11_text_decrypt(memory_region(REGION_GFX1)); |
| 2079 | 2079 | seibuspi_rise11_bg_decrypt(memory_region(REGION_GFX2), memory_region_length(REGION_GFX2)); |
| 2080 | 2080 | seibuspi_rise11_sprite_decrypt(memory_region(REGION_GFX3), 0x800000); |
| 2081 | 2081 | |
| 2082 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w); | |
| 2082 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w); | |
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | 2085 | /* SYS386 */ |
| r2418 | r2419 | |
|---|---|---|
| 490 | 490 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_BASE(&vram_base) |
| 491 | 491 | AM_RANGE(0x04000000, 0x0400000f) AM_WRITE(amerdart_misc_w) |
| 492 | 492 | AM_RANGE(0x05000000, 0x0500000f) AM_READWRITE(coolpool_iop_r, amerdart_iop_w) |
| 493 | AM_RANGE(0x06000000, 0x06007fff) AM_R | |
| 493 | AM_RANGE(0x06000000, 0x06007fff) AM_R | |
| 494 | 494 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w) |
| 495 | 495 | AM_RANGE(0xffb00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1, 0) |
| 496 | 496 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 502 | 502 | AM_RANGE(0x02000000, 0x020000ff) AM_READWRITE(coolpool_iop_r, coolpool_iop_w) |
| 503 | 503 | AM_RANGE(0x03000000, 0x0300000f) AM_WRITE(coolpool_misc_w) |
| 504 | 504 | AM_RANGE(0x03000000, 0x03ffffff) AM_ROM AM_REGION(REGION_GFX1, 0) |
| 505 | AM_RANGE(0x06000000, 0x06007fff) AM_R | |
| 505 | AM_RANGE(0x06000000, 0x06007fff) AM_R | |
| 506 | 506 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w) |
| 507 | 507 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1, 0) |
| 508 | 508 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 513 | 513 | AM_RANGE(0x02000000, 0x020000ff) AM_READWRITE(coolpool_iop_r, coolpool_iop_w) |
| 514 | 514 | AM_RANGE(0x03000000, 0x0300000f) AM_WRITE(coolpool_misc_w) |
| 515 | 515 | AM_RANGE(0x04000000, 0x040000ff) AM_READWRITE(tlc34076_lsb_r, tlc34076_lsb_w) // IMSG176P-40 |
| 516 | AM_RANGE(0x06000000, 0x0601ffff) AM_MIRROR(0x00020000) AM_R | |
| 516 | AM_RANGE(0x06000000, 0x0601ffff) AM_MIRROR(0x00020000) AM_R | |
| 517 | 517 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w) |
| 518 | 518 | AM_RANGE(0xff000000, 0xff7fffff) AM_ROM AM_REGION(REGION_GFX1, 0) |
| 519 | 519 | AM_RANGE(0xffc00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1, 0) |
| r2418 | r2419 | |
| 935 | 935 | |
| 936 | 936 | static DRIVER_INIT( coolpool ) |
| 937 | 937 | { |
| 938 | memory_install_read16_handler(1, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, coolpool_input_r); | |
| 938 | memory_install_read16_handler(machine, 1, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, coolpool_input_r); | |
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 |
| r2418 | r2419 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | static ADDRESS_MAP_START( mwarr_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 133 | 133 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 134 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 135 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_WRITE(mlow_videoram_w) AM_BASE(&mlow_videoram) | |
| 136 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(mhigh_videoram_w) AM_BASE(&mhigh_videoram) | |
| 137 | AM_RANGE(0x101800, 0x1027ff) AM_RAM AM_WRITE(tx_videoram_w) AM_BASE(&tx_videoram) | |
| 134 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 135 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(mlow_videoram_w) AM_BASE(&mlow_videoram) | |
| 136 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(mhigh_videoram_w) AM_BASE(&mhigh_videoram) | |
| 137 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(tx_videoram_w) AM_BASE(&tx_videoram) | |
| 138 | 138 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_BASE(&bg_scrollram) |
| 139 | 139 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE(&mlow_scrollram) |
| 140 | 140 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE(&mhigh_scrollram) |
| 141 | 141 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE(&vidattrram) |
| 142 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 142 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 143 | 143 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE(&spriteram16) |
| 144 | 144 | AM_RANGE(0x110000, 0x110001) AM_READ(input_port_0_word_r) |
| 145 | 145 | AM_RANGE(0x110002, 0x110003) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 45 | 45 | AM_RANGE(0x01400000, 0x0141ffff) AM_READWRITE(midtunit_cmos_r, midtunit_cmos_w) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 46 | 46 | AM_RANGE(0x01480000, 0x014fffff) AM_WRITE(midtunit_cmos_enable_w) |
| 47 | 47 | AM_RANGE(0x01600000, 0x0160003f) AM_READ(midtunit_input_r) |
| 48 | AM_RANGE(0x01800000, 0x0187ffff) AM_R | |
| 48 | AM_RANGE(0x01800000, 0x0187ffff) AM_R | |
| 49 | 49 | AM_RANGE(0x01a80000, 0x01a800ff) AM_READWRITE(midtunit_dma_r, midtunit_dma_w) |
| 50 | 50 | AM_RANGE(0x01b00000, 0x01b0001f) AM_WRITE(midtunit_control_w) |
| 51 | 51 | /* AM_RANGE(0x01c00060, 0x01c0007f) AM_WRITE(midtunit_cmos_enable_w) */ |
| r2418 | r2419 | |
|---|---|---|
| 105 | 105 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 106 | 106 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 107 | 107 | AM_RANGE(0x8000, 0x8000) AM_NOP |
| 108 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_WRITE(vroulet_videoram_w) AM_BASE(&videoram) | |
| 109 | AM_RANGE(0x9400, 0x97ff) AM_RAM AM_WRITE(vroulet_colorram_w) AM_BASE(&colorram) | |
| 108 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(vroulet_videoram_w) AM_BASE(&videoram) | |
| 109 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(vroulet_colorram_w) AM_BASE(&colorram) | |
| 110 | 110 | AM_RANGE(0xa000, 0xa001) AM_RAM AM_BASE(&vroulet_ball) |
| 111 | 111 | AM_RANGE(0xb000, 0xb0ff) AM_WRITE(vroulet_paletteram_w) AM_BASE(&paletteram) |
| 112 | 112 | AM_RANGE(0xc000, 0xc000) AM_NOP |
| r2418 | r2419 | |
|---|---|---|
| 4821 | 4821 | { |
| 4822 | 4822 | mc8123_decrypt_rom(0, memory_region(REGION_USER1), 1, 4); |
| 4823 | 4823 | |
| 4824 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, dakkochn_port_00_r); | |
| 4825 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, dakkochn_port_03_r); | |
| 4826 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, dakkochn_port_04_r); | |
| 4824 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, dakkochn_port_00_r); | |
| 4825 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, dakkochn_port_03_r); | |
| 4826 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, dakkochn_port_04_r); | |
| 4827 | 4827 | |
| 4828 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0, 0, dakkochn_port_15_w); | |
| 4828 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0, 0, dakkochn_port_15_w); | |
| 4829 | 4829 | |
| 4830 | 4830 | } |
| 4831 | 4831 |
| r2418 | r2419 | |
|---|---|---|
| 146 | 146 | static ADDRESS_MAP_START( cultures_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 147 | 147 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 148 | 148 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1) |
| 149 | AM_RANGE(0x8000, 0xbfff) AM_RAM | |
| 149 | AM_RANGE(0x8000, 0xbfff) AM_RAM | |
| 150 | 150 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 151 | 151 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 152 | 152 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 270 | 270 | |
| 271 | 271 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 272 | 272 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 273 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0300) AM_R | |
| 273 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0300) AM_R | |
| 274 | 274 | AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03fe) AM_READWRITE(input_port_0_r, SMH_NOP) |
| 275 | 275 | AM_RANGE(0x0c01, 0x0c01) AM_MIRROR(0x03fe) AM_READWRITE(input_port_1_r, SMH_NOP) |
| 276 | 276 | AM_RANGE(0x1000, 0x13ff) AM_NOP |
| r2418 | r2419 | |
|---|---|---|
| 1098 | 1098 | |
| 1099 | 1099 | static void init_skns(running_machine *machine) |
| 1100 | 1100 | { |
| 1101 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000028, 0x600002b, 0, 0, bios_skip_r ); | |
| 1101 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000028, 0x600002b, 0, 0, bios_skip_r ); | |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | 1104 | static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine); } // Idle Loop caught by sh-2 core |
| 1105 | 1105 | static DRIVER_INIT( galpanis ) { skns_sprite_kludge(-5,-1); init_skns(machine); } // Idle Loop caught by sh-2 core |
| 1106 | static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); } | |
| 1107 | static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); } | |
| 1108 | static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); } | |
| 1109 | static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); } | |
| 1110 | static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); } | |
| 1111 | static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); } | |
| 1112 | static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); } | |
| 1113 | static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); } | |
| 1114 | static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); } | |
| 1115 | static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); } | |
| 1116 | static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); } | |
| 1117 | static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); } | |
| 1118 | static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); } | |
| 1119 | static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); } | |
| 1106 | static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); } | |
| 1107 | static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); } | |
| 1108 | static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); } | |
| 1109 | static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); } | |
| 1110 | static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); } | |
| 1111 | static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); } | |
| 1112 | static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); } | |
| 1113 | static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); } | |
| 1114 | static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); } | |
| 1115 | static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); } | |
| 1116 | static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); } | |
| 1117 | static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); } | |
| 1118 | static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); } | |
| 1119 | static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); } | |
| 1120 | 1120 | static DRIVER_INIT( sarukani ) { skns_sprite_kludge(-1,-1); init_skns(machine); } // Speedup is in skns_io_w() |
| 1121 | 1121 | |
| 1122 | 1122 |
| r2418 | r2419 | |
|---|---|---|
| 810 | 810 | AM_RANGE( 0x700006, 0x700007 ) AM_READ( watchdog_reset16_r ) // Watchdog? |
| 811 | 811 | |
| 812 | 812 | AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 813 | AM_RANGE( 0x840000, 0x84ffff ) AM_R | |
| 813 | AM_RANGE( 0x840000, 0x84ffff ) AM_R | |
| 814 | 814 | AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_BASE(&seta2_vregs) // Video Registers |
| 815 | 815 | |
| 816 | 816 | AM_RANGE( 0x900000, 0x903fff ) AM_READWRITE( seta_sound_word_r, seta_sound_word_w ) // Sound |
| r2418 | r2419 | |
| 2164 | 2164 | |
| 2165 | 2165 | ROM_START( turkhunt ) /* V1.0 is currently the only known version */ |
| 2166 | 2166 | ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* TMP68301 Code */ |
| 2167 | ROM_LOAD16_BYTE( "asx906e01.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) ) | |
| 2168 | ROM_LOAD16_BYTE( "asx907e01.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) ) | |
| 2167 | ROM_LOAD16_BYTE( "asx906e01.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) ) /* CRC16 E510 printed on label */ | |
| 2168 | ROM_LOAD16_BYTE( "asx907e01.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) ) /* CRC16 AB40 printed on label */ | |
| 2169 | 2169 | |
| 2170 | 2170 | ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE ) /* Sprites */ |
| 2171 | 2171 | ROM_LOAD( "asx901m01.u38", 0x0000000, 0x800000, CRC(eabd3f44) SHA1(5a1ac986d11a8b019e18761cf4ea0a6f49fbdbfc) ) |
| r2418 | r2419 | |
|---|---|---|
| 443 | 443 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_BASE(&gfx1_vram) |
| 444 | 444 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_BASE(&gfx1_cram) |
| 445 | 445 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&sprite_ram) |
| 446 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram) | |
| 447 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 446 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram) | |
| 447 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 448 | 448 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE(1) |
| 449 | 449 | AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 450 | 450 | AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE(2) |
| r2418 | r2419 | |
| 853 | 853 | UINT8 *ROM = (UINT8 *)memory_region(REGION_CPU1); |
| 854 | 854 | memory_set_bankptr(1,&ROM[0x10000+UNBANKED_SIZE]); |
| 855 | 855 | |
| 856 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, prot_read_700x); | |
| 856 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, prot_read_700x); | |
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | GAME( 1992, witch, 0, witch, witch, witch, ROT0, "Sega / Vic Tokai", "Witch", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 197 | 197 | AM_RANGE(0x30284000, 0x3028bfff) AM_RAM AM_BASE(&namcofl_mcuram) /* shared RAM with C75 MCU */ |
| 198 | 198 | AM_RANGE(0x30300000, 0x30303fff) AM_RAM /* COMRAM */ |
| 199 | 199 | AM_RANGE(0x30380000, 0x303800ff) AM_READ( fl_network_r ) /* network registers */ |
| 200 | AM_RANGE(0x30400000, 0x3040ffff) AM_R | |
| 200 | AM_RANGE(0x30400000, 0x3040ffff) AM_R | |
| 201 | 201 | AM_RANGE(0x30800000, 0x3080ffff) AM_READWRITE(namco_tilemapvideoram32_le_r, namco_tilemapvideoram32_le_w ) |
| 202 | 202 | AM_RANGE(0x30a00000, 0x30a0003f) AM_READWRITE(namco_tilemapcontrol32_le_r, namco_tilemapcontrol32_le_w ) |
| 203 | 203 | AM_RANGE(0x30c00000, 0x30c1ffff) AM_READWRITE(namco_rozvideoram32_le_r,namco_rozvideoram32_le_w) |
| r2418 | r2419 | |
|---|---|---|
| 5437 | 5437 | |
| 5438 | 5438 | static DRIVER_INIT( mjreach ) |
| 5439 | 5439 | { |
| 5440 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w); | |
| 5440 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w); | |
| 5441 | 5441 | } |
| 5442 | 5442 | |
| 5443 | 5443 | /*************************************************************************** |
| r2418 | r2419 | |
|---|---|---|
| 627 | 627 | |
| 628 | 628 | static DRIVER_INIT( coh1000c ) |
| 629 | 629 | { |
| 630 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */ | |
| 631 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */ | |
| 632 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh1000c_w ); /* bankswitch */ | |
| 633 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r ); | |
| 634 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r ); | |
| 635 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */ | |
| 636 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w ); | |
| 630 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */ | |
| 631 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */ | |
| 632 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh1000c_w ); /* bankswitch */ | |
| 633 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r ); | |
| 634 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r ); | |
| 635 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */ | |
| 636 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w ); | |
| 637 | 637 | |
| 638 | 638 | zn_driver_init(machine); |
| 639 | 639 | |
| r2418 | r2419 | |
| 859 | 859 | |
| 860 | 860 | static DRIVER_INIT( coh3002c ) |
| 861 | 861 | { |
| 862 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */ | |
| 863 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */ | |
| 864 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r ); | |
| 865 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r ); | |
| 866 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh3002c_w ); /* bankswitch */ | |
| 867 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */ | |
| 868 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w ); | |
| 862 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */ | |
| 863 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */ | |
| 864 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r ); | |
| 865 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r ); | |
| 866 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh3002c_w ); /* bankswitch */ | |
| 867 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */ | |
| 868 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w ); | |
| 869 | 869 | |
| 870 | 870 | zn_driver_init(machine); |
| 871 | 871 | } |
| r2418 | r2419 | |
| 1208 | 1208 | { |
| 1209 | 1209 | taitofx1_eeprom_size1 = 0x200; taitofx1_eeprom1 = auto_malloc( taitofx1_eeprom_size1 ); |
| 1210 | 1210 | |
| 1211 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */ | |
| 1212 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */ | |
| 1213 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_r ); | |
| 1214 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_w ); | |
| 1215 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 ); | |
| 1216 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 ); | |
| 1211 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */ | |
| 1212 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */ | |
| 1213 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_r, taitofx1a_ymsound_w ); | |
| 1214 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1217 | 1215 | |
| 1218 | 1216 | zn_driver_init(machine); |
| 1219 | 1217 | mb3773_init(); |
| r2418 | r2419 | |
| 1325 | 1323 | taitofx1_eeprom_size1 = 0x400; taitofx1_eeprom1 = auto_malloc( taitofx1_eeprom_size1 ); |
| 1326 | 1324 | taitofx1_eeprom_size2 = 0x200; taitofx1_eeprom2 = auto_malloc( taitofx1_eeprom_size2 ); |
| 1327 | 1325 | |
| 1328 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */ | |
| 1329 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 ); | |
| 1330 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 ); | |
| 1331 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */ | |
| 1332 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1b_volume_w ); | |
| 1333 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fba0000, 0x1fba0003, 0, 0, taitofx1b_sound_w ); | |
| 1334 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbc0000, 0x1fbc0003, 0, 0, taitofx1b_sound_r ); | |
| 1335 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3 ); | |
| 1336 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3 ); | |
| 1326 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */ | |
| 1327 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1328 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */ | |
| 1329 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1b_volume_w ); | |
| 1330 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fba0000, 0x1fba0003, 0, 0, taitofx1b_sound_w ); | |
| 1331 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbc0000, 0x1fbc0003, 0, 0, taitofx1b_sound_r ); | |
| 1332 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1337 | 1333 | |
| 1338 | 1334 | zn_driver_init(machine); |
| 1339 | 1335 | mb3773_init(); |
| r2418 | r2419 | |
| 1522 | 1518 | |
| 1523 | 1519 | static DRIVER_INIT( coh3002t ) |
| 1524 | 1520 | { |
| 1525 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 1526 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_w ); | |
| 1527 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_r ); | |
| 1521 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 1522 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_r, coh3002t_unknown_w ); | |
| 1528 | 1523 | |
| 1529 | 1524 | zn_driver_init(machine); |
| 1530 | 1525 | } |
| r2418 | r2419 | |
| 1658 | 1653 | *2 - Unpopulated DIP28 socket |
| 1659 | 1654 | */ |
| 1660 | 1655 | |
| 1661 | static void atpsx_interrupt(int state) | |
| 1656 | static void atpsx_interrupt(const device_config *config, int state) | |
| 1662 | 1657 | { |
| 1663 | 1658 | if (state) |
| 1664 | 1659 | { |
| r2418 | r2419 | |
| 1666 | 1661 | } |
| 1667 | 1662 | } |
| 1668 | 1663 | |
| 1669 | static const struct ide_interface atpsx_intf = | |
| 1670 | { | |
| 1671 | atpsx_interrupt | |
| 1672 | }; | |
| 1673 | ||
| 1674 | 1664 | static void atpsx_dma_read( UINT32 n_address, INT32 n_size ) |
| 1675 | 1665 | { |
| 1666 | const device_config *ide = device_list_find_by_tag(Machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 1667 | ||
| 1676 | 1668 | logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); |
| 1677 | 1669 | |
| 1678 | 1670 | if (n_address < 0xe0000) |
| r2418 | r2419 | |
| 1686 | 1678 | n_size <<= 2; |
| 1687 | 1679 | while( n_size > 0 ) |
| 1688 | 1680 | { |
| 1689 | psxwritebyte( n_address, ide_controller32_ | |
| 1681 | psxwritebyte( n_address, ide_controller32_ | |
| 1690 | 1682 | n_address++; |
| 1691 | 1683 | n_size--; |
| 1692 | 1684 | } |
| r2418 | r2419 | |
| 1699 | 1691 | |
| 1700 | 1692 | static DRIVER_INIT( coh1000w ) |
| 1701 | 1693 | { |
| 1702 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 1703 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f000003, 0, 0, SMH_NOP ); | |
| 1704 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_0_r ); | |
| 1705 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_0_w ); | |
| 1706 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP ); | |
| 1707 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP ); | |
| 1708 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_0_r ); | |
| 1709 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_0_w ); | |
| 1694 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 1710 | 1695 | |
| 1711 | // init hard disk | |
| 1712 | ide_controller_init(0, &atpsx_intf); | |
| 1696 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 1697 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f000003, 0, 0, SMH_NOP ); | |
| 1698 | memory_install_readwrite32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_r, ide_controller32_w ); | |
| 1699 | memory_install_readwrite32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP, SMH_NOP ); | |
| 1700 | memory_install_readwrite32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_r, ide_controller32_w ); | |
| 1713 | 1701 | |
| 1714 | 1702 | zn_driver_init(machine); |
| 1715 | 1703 | } |
| r2418 | r2419 | |
| 1719 | 1707 | memory_set_bankptr( 1, memory_region( REGION_USER2 ) ); /* fixed game rom */ |
| 1720 | 1708 | zn_machine_init(); |
| 1721 | 1709 | |
| 1722 | | |
| 1710 | | |
| 1723 | 1711 | psx_dma_install_read_handler(5, atpsx_dma_read); |
| 1724 | 1712 | psx_dma_install_write_handler(5, atpsx_dma_write); |
| 1725 | 1713 | } |
| r2418 | r2419 | |
| 1729 | 1717 | |
| 1730 | 1718 | MDRV_MACHINE_RESET( coh1000w ) |
| 1731 | 1719 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 1720 | ||
| 1721 | MDRV_IDE_CONTROLLER_ADD("ide", 0, atpsx_interrupt) | |
| 1732 | 1722 | MACHINE_DRIVER_END |
| 1733 | 1723 | |
| 1734 | 1724 | /* |
| r2418 | r2419 | |
| 1895 | 1885 | |
| 1896 | 1886 | static DRIVER_INIT( coh1002e ) |
| 1897 | 1887 | { |
| 1898 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); | |
| 1899 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fa10300, 0x1fa10303, 0, 0, coh1002e_bank_w ); | |
| 1900 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00007, 0, 0, coh1002e_latch_w ); | |
| 1888 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); | |
| 1889 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10300, 0x1fa10303, 0, 0, coh1002e_bank_w ); | |
| 1890 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00007, 0, 0, coh1002e_latch_w ); | |
| 1901 | 1891 | |
| 1902 | 1892 | zn_driver_init(machine); |
| 1903 | 1893 | } |
| r2418 | r2419 | |
| 2123 | 2113 | * - Unpopulated DIP42 socket |
| 2124 | 2114 | */ |
| 2125 | 2115 | |
| 2126 | static void jdredd_ide_interrupt(int state) | |
| 2116 | static void jdredd_ide_interrupt(const device_config *device, int state) | |
| 2127 | 2117 | { |
| 2128 | 2118 | if (state) |
| 2129 | 2119 | { |
| r2418 | r2419 | |
| 2131 | 2121 | } |
| 2132 | 2122 | } |
| 2133 | 2123 | |
| 2134 | static | |
| 2124 | static READ32 | |
| 2135 | 2125 | { |
| 2136 | jdredd_ide_interrupt | |
| 2137 | }; | |
| 2138 | ||
| 2139 | static READ32_HANDLER( jdredd_idestat_r ) | |
| 2140 | { | |
| 2141 | return ide_controller_0_r(0x1f7); | |
| 2126 | return ide_controller_r(device, 0x1f7); | |
| 2142 | 2127 | } |
| 2143 | 2128 | |
| 2144 | static READ32_HANDLER( jdredd_ide_r) | |
| 2129 | static READ32_DEVICE_HANDLER( jdredd_ide_r ) | |
| 2145 | 2130 | { |
| 2146 | 2131 | int reg = offset*2; |
| 2147 | 2132 | int shift = 0; |
| r2418 | r2419 | |
| 2159 | 2144 | logerror("JDREDD IDE: read 16-bit from non-DATA register %d!\n", reg); |
| 2160 | 2145 | } |
| 2161 | 2146 | |
| 2162 | return (ide_controller_ | |
| 2147 | return (ide_controller_ | |
| 2163 | 2148 | } |
| 2164 | 2149 | |
| 2165 | ret = ide_controller_ | |
| 2150 | ret = ide_controller_ | |
| 2166 | 2151 | |
| 2167 | 2152 | return ret; |
| 2168 | 2153 | } |
| 2169 | 2154 | |
| 2170 | static WRITE32_HANDLER( jdredd_ide_w ) | |
| 2155 | static WRITE32_DEVICE_HANDLER( jdredd_ide_w ) | |
| 2171 | 2156 | { |
| 2172 | 2157 | int reg = offset*2; |
| 2173 | 2158 | |
| r2418 | r2419 | |
| 2177 | 2162 | reg++; |
| 2178 | 2163 | } |
| 2179 | 2164 | |
| 2180 | ide_controller_ | |
| 2165 | ide_controller_ | |
| 2181 | 2166 | } |
| 2182 | 2167 | |
| 2183 | 2168 | static size_t nbajamex_eeprom_size; |
| r2418 | r2419 | |
| 2215 | 2200 | |
| 2216 | 2201 | static DRIVER_INIT( coh1000a ) |
| 2217 | 2202 | { |
| 2218 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 2219 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff00, 0x1fbfff03, 0, 0, acpsx_00_w ); | |
| 2220 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff10, 0x1fbfff13, 0, 0, acpsx_10_w ); | |
| 2203 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 ); | |
| 2204 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff00, 0x1fbfff03, 0, 0, acpsx_00_w ); | |
| 2205 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff10, 0x1fbfff13, 0, 0, acpsx_10_w ); | |
| 2221 | 2206 | |
| 2222 | 2207 | if( strcmp( machine->gamedrv->name, "nbajamex" ) == 0 ) |
| 2223 | 2208 | { |
| 2224 | 2209 | nbajamex_eeprom_size = 0x8000; nbajamex_eeprom = auto_malloc( nbajamex_eeprom_size ); |
| 2225 | 2210 | |
| 2226 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f200000 + ( nbajamex_eeprom_size - 1 ), 0, 0, SMH_BANK2 ); | |
| 2227 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f200000 + ( nbajamex_eeprom_size - 1 ), 0, 0, SMH_BANK2 ); | |
| 2228 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff80, 0x1fbfff83, 0, 0, nbajamex_80_w ); | |
| 2229 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff08, 0x1fbfff0b, 0, 0, nbajamex_08_r ); | |
| 2230 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff80, 0x1fbfff83, 0, 0, nbajamex_80_r ); | |
| 2211 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f200000 + ( nbajamex_eeprom_size - 1 ), 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 2212 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff08, 0x1fbfff0b, 0, 0, nbajamex_08_r ); | |
| 2213 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff80, 0x1fbfff83, 0, 0, nbajamex_80_r, nbajamex_80_w ); | |
| 2231 | 2214 | |
| 2232 | 2215 | memory_set_bankptr( 2, nbajamex_eeprom ); /* ram/eeprom/?? */ |
| 2233 | 2216 | } |
| r2418 | r2419 | |
| 2235 | 2218 | if( ( !strcmp( machine->gamedrv->name, "jdredd" ) ) || |
| 2236 | 2219 | ( !strcmp( machine->gamedrv->name, "jdreddb" ) ) ) |
| 2237 | 2220 | { |
| 2238 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff8c, 0x1fbfff8f, 0, 0, jdredd_idestat_r ); | |
| 2239 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff8c, 0x1fbfff8f, 0, 0, SMH_NOP ); | |
| 2240 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff90, 0x1fbfff9f, 0, 0, jdredd_ide_r ); | |
| 2241 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff90, 0x1fbfff9f, 0, 0, jdredd_ide_w ); | |
| 2221 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 2242 | 2222 | |
| 2243 | ide_controller_init( 0, &jdredd_ide_intf ); | |
| 2223 | memory_install_read32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff8c, 0x1fbfff8f, 0, 0, jdredd_idestat_r ); | |
| 2224 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff8c, 0x1fbfff8f, 0, 0, SMH_NOP ); | |
| 2225 | memory_install_readwrite32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1fbfff90, 0x1fbfff9f, 0, 0, jdredd_ide_r, jdredd_ide_w ); | |
| 2244 | 2226 | } |
| 2245 | 2227 | |
| 2246 | 2228 | zn_driver_init(machine); |
| r2418 | r2419 | |
| 2253 | 2235 | if( ( !strcmp( machine->gamedrv->name, "jdredd" ) ) || |
| 2254 | 2236 | ( !strcmp( machine->gamedrv->name, "jdreddb" ) ) ) |
| 2255 | 2237 | { |
| 2256 | | |
| 2238 | | |
| 2257 | 2239 | } |
| 2258 | 2240 | } |
| 2259 | 2241 | |
| r2418 | r2419 | |
| 2264 | 2246 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2265 | 2247 | MACHINE_DRIVER_END |
| 2266 | 2248 | |
| 2249 | static MACHINE_DRIVER_START( coh1000a_ide ) | |
| 2250 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2251 | ||
| 2252 | MDRV_MACHINE_RESET( coh1000a ) | |
| 2253 | MDRV_NVRAM_HANDLER( at28c16_0 ) | |
| 2254 | ||
| 2255 | MDRV_IDE_CONTROLLER_ADD("ide", 0, jdredd_ide_interrupt) | |
| 2256 | MACHINE_DRIVER_END | |
| 2257 | ||
| 2267 | 2258 | /* |
| 2268 | 2259 | |
| 2269 | 2260 | Main board (Standard ZN1 Main Board with Atlus BIOS) |
| r2418 | r2419 | |
| 2387 | 2378 | |
| 2388 | 2379 | static DRIVER_INIT( coh1001l ) |
| 2389 | 2380 | { |
| 2390 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked rom */ | |
| 2391 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, coh1001l_bnk_w ); | |
| 2381 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked rom */ | |
| 2382 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, coh1001l_bnk_w ); | |
| 2392 | 2383 | |
| 2393 | 2384 | zn_driver_init(machine); |
| 2394 | 2385 | } |
| r2418 | r2419 | |
| 2432 | 2423 | |
| 2433 | 2424 | static DRIVER_INIT( coh1002v ) |
| 2434 | 2425 | { |
| 2435 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f27ffff, 0, 0, SMH_BANK1 ); | |
| 2436 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fbfffff, 0, 0, SMH_BANK2 ); | |
| 2437 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, coh1002v_bnk_w ); | |
| 2426 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f27ffff, 0, 0, SMH_BANK1 ); | |
| 2427 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fbfffff, 0, 0, SMH_BANK2 ); | |
| 2428 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, coh1002v_bnk_w ); | |
| 2438 | 2429 | |
| 2439 | 2430 | zn_driver_init(machine); |
| 2440 | 2431 | } |
| r2418 | r2419 | |
| 2656 | 2647 | |
| 2657 | 2648 | static DRIVER_INIT( coh1002m ) |
| 2658 | 2649 | { |
| 2659 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); | |
| 2660 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, cbaj_z80_r ); | |
| 2661 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, cbaj_z80_w ); | |
| 2662 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00004, 0x1fb00007, 0, 0, coh1002m_bank_w ); | |
| 2650 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); | |
| 2651 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, cbaj_z80_r, cbaj_z80_w ); | |
| 2652 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00004, 0x1fb00007, 0, 0, coh1002m_bank_w ); | |
| 2663 | 2653 | |
| 2664 | 2654 | zn_driver_init(machine); |
| 2665 | 2655 | } |
| r2418 | r2419 | |
| 4314 | 4304 | GAME( 1995, acpsx, 0, coh1000a, zn, coh1000a, ROT0, "Acclaim", "Acclaim PSX", GAME_IS_BIOS_ROOT ) |
| 4315 | 4305 | |
| 4316 | 4306 | GAME( 1996, nbajamex, acpsx, coh1000a, zn, coh1000a, ROT0, "Acclaim", "NBA Jam Extreme", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) |
| 4317 | GAME( 1996, jdredd, acpsx, coh1000a, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 4318 | GAME( 1996, jdreddb, jdredd, coh1000a, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 4307 | GAME( 1996, jdredd, acpsx, coh1000a_ide, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 4308 | GAME( 1996, jdreddb, jdredd, coh1000a_ide, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 4319 | 4309 | |
| 4320 | 4310 | /* Tecmo */ |
| 4321 | 4311 |
| r2418 | r2419 | |
|---|---|---|
| 70 | 70 | #define STANDARD_MAP \ |
| 71 | 71 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */ \ |
| 72 | 72 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) /* ROM (banked) */ \ |
| 73 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(paradise_vram_2_w) AM_BASE(¶dise_vram_2 ) /* Background */ \ | |
| 74 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(paradise_vram_1_w) AM_BASE(¶dise_vram_1 ) /* Midground */ \ | |
| 75 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(paradise_vram_0_w) AM_BASE(¶dise_vram_0 ) /* Foreground */ \ | |
| 73 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paradise_vram_2_w) AM_BASE(¶dise_vram_2 ) /* Background */ \ | |
| 74 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paradise_vram_1_w) AM_BASE(¶dise_vram_1 ) /* Midground */ \ | |
| 75 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(paradise_vram_0_w) AM_BASE(¶dise_vram_0 ) /* Foreground */ \ | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | static ADDRESS_MAP_START( paradise_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
| 916 | 916 | static DRIVER_INIT (tgtball) |
| 917 | 917 | { |
| 918 | 918 | paradise_sprite_inc = 4; |
| 919 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x2001, 0x2001, 0, 0, tgtball_flipscreen_w ); | |
| 919 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x2001, 0x2001, 0, 0, tgtball_flipscreen_w ); | |
| 920 | 920 | } |
| 921 | 921 | |
| 922 | 922 | static DRIVER_INIT (torus) |
| 923 | 923 | { |
| 924 | 924 | paradise_sprite_inc = 4; |
| 925 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x2070, 0x2070, 0, 0, torus_coin_counter_w); | |
| 925 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x2070, 0x2070, 0, 0, torus_coin_counter_w); | |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 |
| r2418 | r2419 | |
|---|---|---|
| 74 | 74 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main */ |
| 75 | 75 | AM_RANGE(0x200000, 0x203fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w) |
| 76 | 76 | AM_RANGE(0x400000, 0x47ffff) AM_READWRITE(volfied_video_ram_r, volfied_video_ram_w) |
| 77 | AM_RANGE(0x500000, 0x503fff) AM_RAM | |
| 77 | AM_RANGE(0x500000, 0x503fff) AM_RAM | |
| 78 | 78 | AM_RANGE(0x600000, 0x600001) AM_WRITE(volfied_video_mask_w) |
| 79 | 79 | AM_RANGE(0x700000, 0x700001) AM_WRITE(volfied_sprite_ctrl_w) |
| 80 | 80 | AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(volfied_video_ctrl_r, volfied_video_ctrl_w) |
| r2418 | r2419 | |
|---|---|---|
| 233 | 233 | |
| 234 | 234 | static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 235 | 235 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&spriteram) |
| 236 | AM_RANGE(0x0800, 0x7fff) AM_READWRITE(SMH_RAM, balsente_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 237 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(SMH_RAM, balsente_paletteram_w) AM_BASE(&paletteram) | |
| 236 | AM_RANGE(0x0800, 0x7fff) AM_RAM_WRITE(balsente_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 237 | AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(balsente_paletteram_w) AM_BASE(&paletteram) | |
| 238 | 238 | AM_RANGE(0x9000, 0x9007) AM_WRITE(balsente_adc_select_w) |
| 239 | 239 | AM_RANGE(0x9400, 0x9401) AM_READ(balsente_adc_data_r) |
| 240 | 240 | AM_RANGE(0x9800, 0x987f) AM_WRITE(balsente_misc_output_w) |
| r2418 | r2419 | |
| 1942 | 1942 | static DRIVER_INIT( toggle ) { expand_roms(EXPAND_ALL); balsente_shooter = 0; /* noanalog */ } |
| 1943 | 1943 | static DRIVER_INIT( nametune ) |
| 1944 | 1944 | { |
| 1945 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1945 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1946 | 1946 | expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 0; /* noanalog */ |
| 1947 | 1947 | } |
| 1948 | 1948 | static DRIVER_INIT( nstocker ) |
| 1949 | 1949 | { |
| 1950 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9902, 0x9902, 0, 0, nstocker_port2_r); | |
| 1951 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1950 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9902, 0x9902, 0, 0, nstocker_port2_r); | |
| 1951 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1952 | 1952 | expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; balsente_adc_shift = 1; |
| 1953 | 1953 | } |
| 1954 | 1954 | static DRIVER_INIT( sfootbal ) |
| 1955 | 1955 | { |
| 1956 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1956 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1957 | 1957 | expand_roms(EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 0; |
| 1958 | 1958 | } |
| 1959 | 1959 | static DRIVER_INIT( spiker ) |
| 1960 | 1960 | { |
| 1961 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_w); | |
| 1962 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r); | |
| 1963 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1961 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r, spiker_expand_w); | |
| 1962 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1964 | 1963 | expand_roms(EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 1; |
| 1965 | 1964 | } |
| 1966 | 1965 | static DRIVER_INIT( stompin ) |
| 1967 | 1966 | { |
| 1968 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1967 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); | |
| 1969 | 1968 | expand_roms(0x0c | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 32; |
| 1970 | 1969 | } |
| 1971 | 1970 | static DRIVER_INIT( rescraid ) { expand_roms(EXPAND_NONE); balsente_shooter = 0; /* noanalog */ } |
| 1972 | 1971 | static DRIVER_INIT( grudge ) |
| 1973 | 1972 | { |
| 1974 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x9400, 0, 0, grudge_steering_r); | |
| 1973 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x9400, 0, 0, grudge_steering_r); | |
| 1975 | 1974 | expand_roms(EXPAND_NONE); balsente_shooter = 0; |
| 1976 | 1975 | } |
| 1977 | 1976 | static DRIVER_INIT( shrike ) |
| 1978 | 1977 | { |
| 1979 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r); | |
| 1980 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_w); | |
| 1981 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w ); | |
| 1982 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_r); | |
| 1983 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_w ); | |
| 1978 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r, shrike_shared_6809_w); | |
| 1979 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w ); | |
| 1980 | memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w); | |
| 1984 | 1981 | |
| 1985 | 1982 | expand_roms(EXPAND_ALL); balsente_shooter = 0; balsente_adc_shift = 32; |
| 1986 | 1983 | } |
| r2418 | r2419 | |
|---|---|---|
| 2916 | 2916 | return megadrive_io_read_data_port_3button(portnum); |
| 2917 | 2917 | } |
| 2918 | 2918 | |
| 2919 | static void svp_init( | |
| 2919 | static void svp_init(running_machine *machine) | |
| 2920 | 2920 | { |
| 2921 | 2921 | UINT8 *ROM; |
| 2922 | 2922 | |
| r2418 | r2419 | |
| 2924 | 2924 | |
| 2925 | 2925 | /* SVP stuff */ |
| 2926 | 2926 | svp.dram = auto_malloc(0x20000); |
| 2927 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x31ffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 2927 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x31ffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 2928 | 2928 | memory_set_bankptr( 2, svp.dram ); |
| 2929 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa15000, 0xa150ff, 0, 0, svp_68k_io_r, svp_68k_io_w); | |
| 2929 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa15000, 0xa150ff, 0, 0, svp_68k_io_r, svp_68k_io_w); | |
| 2930 | 2930 | // "cell arrange" 1 and 2 |
| 2931 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r); | |
| 2932 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3a0000, 0x3affff, 0, 0, svp_68k_cell2_r); | |
| 2931 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r); | |
| 2932 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3a0000, 0x3affff, 0, 0, svp_68k_cell2_r); | |
| 2933 | 2933 | |
| 2934 | 2934 | svp.iram = auto_malloc(0x800); |
| 2935 | 2935 | memory_set_bankptr( 3, svp.iram ); |
| r2418 | r2419 | |
| 5186 | 5186 | DRIVER_INIT( megadsvp ) |
| 5187 | 5187 | { |
| 5188 | 5188 | megadriv_init_common(machine); |
| 5189 | svp_init(); | |
| 5189 | svp_init(machine); | |
| 5190 | 5190 | hazemdchoice_megadrive_region_export = 1; |
| 5191 | 5191 | hazemdchoice_megadrive_region_pal = 0; |
| 5192 | 5192 | hazemdchoice_megadriv_framerate = 60; |
| r2418 | r2419 | |
| 5218 | 5218 | |
| 5219 | 5219 | |
| 5220 | 5220 | /* sets the megadrive z80 to it's normal ports / map */ |
| 5221 | void megatech_set_megadrive_z80_as_megadrive_z80( | |
| 5221 | void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine) | |
| 5222 | 5222 | { |
| 5223 | 5223 | /* INIT THE PORTS *********************************************************************************************/ |
| 5224 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r); | |
| 5225 | memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w); | |
| 5224 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); | |
| 5226 | 5225 | |
| 5227 | 5226 | /* catch any addresses that don't get mapped */ |
| 5228 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r); | |
| 5229 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w); | |
| 5227 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w); | |
| 5230 | 5228 | |
| 5231 | 5229 | |
| 5232 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1); | |
| 5233 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1); | |
| 5230 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 5234 | 5231 | memory_set_bankptr( 1, genz80.z80_prgram ); |
| 5235 | 5232 | |
| 5236 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6); | |
| 5237 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6); | |
| 5233 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6, SMH_BANK6); | |
| 5238 | 5234 | memory_set_bankptr( 6, genz80.z80_prgram ); |
| 5239 | 5235 | |
| 5240 | 5236 | |
| 5241 | 5237 | // not allowed?? |
| 5242 | // memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1); | |
| 5243 | // memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1); | |
| 5238 | // memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 5244 | 5239 | |
| 5245 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_read); | |
| 5246 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x6100, 0x7eff, 0, 0, megadriv_z80_unmapped_read); | |
| 5247 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_read); | |
| 5248 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_read_68k_banked_data); | |
| 5249 | ||
| 5250 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_write); | |
| 5251 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_write); | |
| 5252 | ||
| 5253 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, megadriv_z80_z80_bank_w); | |
| 5254 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6001, 0x6001, 0, 0, megadriv_z80_z80_bank_w); | |
| 5255 | ||
| 5256 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_write_68k_banked_data); | |
| 5240 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_read, megadriv_z80_YM2612_write); | |
| 5241 | memory_install_write8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, megadriv_z80_z80_bank_w); | |
| 5242 | memory_install_write8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6001, 0x6001, 0, 0, megadriv_z80_z80_bank_w); | |
| 5243 | memory_install_read8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6100, 0x7eff, 0, 0, megadriv_z80_unmapped_read); | |
| 5244 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_read, megadriv_z80_vdp_write); | |
| 5245 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_read_68k_banked_data, z80_write_68k_banked_data); | |
| 5257 | 5246 | } |
| 5258 | 5247 |
| r2418 | r2419 | |
|---|---|---|
| 316 | 316 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 317 | 317 | |
| 318 | 318 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // area [B] - Work RAM |
| 319 | AM_RANGE(0x280000, 0x287fff) AM_RAM | |
| 319 | AM_RANGE(0x280000, 0x287fff) AM_RAM | |
| 320 | 320 | |
| 321 | 321 | AM_RANGE(0x300000, 0x303fff) AM_RAM AM_BASE(&galpani3_spriteram) AM_WRITE(galpani3_suprnova_sprite32_w) |
| 322 | 322 | AM_RANGE(0x380000, 0x38003f) AM_RAM AM_BASE(&galpani3_sprregs) AM_WRITE(galpani3_suprnova_sprite32regs_w) |
| r2418 | r2419 | |
|---|---|---|
| 858 | 858 | AM_RANGE(0x078000, 0x078001) AM_WRITE(sound_data_w) |
| 859 | 859 | AM_RANGE(0x080000, 0x08007f) AM_READWRITE(itech32_video_r, itech32_video_w) AM_BASE(&itech32_video) |
| 860 | 860 | AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(int1_ack_w) |
| 861 | AM_RANGE(0x0c0000, 0x0c7fff) AM_R | |
| 861 | AM_RANGE(0x0c0000, 0x0c7fff) AM_R | |
| 862 | 862 | AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&main_rom) |
| 863 | 863 | ADDRESS_MAP_END |
| 864 | 864 | |
| r2418 | r2419 | |
| 876 | 876 | AM_RANGE(0x400000, 0x400001) AM_WRITE(watchdog_reset16_w) |
| 877 | 877 | AM_RANGE(0x480000, 0x480001) AM_WRITE(sound_data_w) |
| 878 | 878 | AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(bloodstm_video_r, bloodstm_video_w) AM_BASE(&itech32_video) |
| 879 | AM_RANGE(0x580000, 0x59ffff) AM_R | |
| 879 | AM_RANGE(0x580000, 0x59ffff) AM_R | |
| 880 | 880 | AM_RANGE(0x700000, 0x700001) AM_WRITE(bloodstm_plane_w) |
| 881 | 881 | AM_RANGE(0x780000, 0x780001) AM_READ(input_port_5_word_r) |
| 882 | 882 | AM_RANGE(0x800000, 0x87ffff) AM_MIRROR(0x780000) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&main_rom) |
| r2418 | r2419 | |
| 941 | 941 | AM_RANGE(0x08e000, 0x08e003) AM_READWRITE(input_port_1_msw_r, SMH_NOP) |
| 942 | 942 | AM_RANGE(0x100000, 0x10000f) AM_WRITE(drivedge_zbuf_control_w) AM_BASE(&drivedge_zbuf_control) |
| 943 | 943 | AM_RANGE(0x180000, 0x180003) AM_WRITE(drivedge_color0_w) |
| 944 | AM_RANGE(0x1a0000, 0x1bffff) AM_R | |
| 944 | AM_RANGE(0x1a0000, 0x1bffff) AM_R | |
| 945 | 945 | AM_RANGE(0x1c0000, 0x1c0003) AM_WRITENOP |
| 946 | 946 | AM_RANGE(0x1e0000, 0x1e0113) AM_READWRITE(itech020_video_r, itech020_video_w) AM_BASE((UINT32 **)&itech32_video) |
| 947 | 947 | AM_RANGE(0x1e4000, 0x1e4003) AM_WRITE(tms_reset_assert_w) |
| 948 | 948 | AM_RANGE(0x1ec000, 0x1ec003) AM_WRITE(tms_reset_clear_w) |
| 949 | 949 | AM_RANGE(0x200000, 0x200003) AM_READ(input_port_2_msw_r) |
| 950 | AM_RANGE(0x280000, 0x280fff) AM_READWRITE(SMH_RAM, tms1_68k_ram_w) AM_SHARE(1) | |
| 951 | AM_RANGE(0x300000, 0x300fff) AM_READWRITE(SMH_RAM, tms2_68k_ram_w) AM_SHARE(2) | |
| 950 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(tms1_68k_ram_w) AM_SHARE(1) | |
| 951 | AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(tms2_68k_ram_w) AM_SHARE(2) | |
| 952 | 952 | AM_RANGE(0x380000, 0x380003) AM_WRITENOP // AM_WRITE(watchdog_reset16_w) |
| 953 | 953 | AM_RANGE(0x600000, 0x607fff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE((UINT32 **)&main_rom) |
| 954 | 954 | ADDRESS_MAP_END |
| 955 | 955 | |
| 956 | 956 | static ADDRESS_MAP_START( drivedge_tms1_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 957 | 957 | AM_RANGE(0x000000, 0x001fff) AM_RAM AM_BASE(&tms1_boot) |
| 958 | AM_RANGE(0x008000, 0x0083ff) AM_MIRROR(0x400) AM_R | |
| 958 | AM_RANGE(0x008000, 0x0083ff) AM_MIRROR(0x400) AM_R | |
| 959 | 959 | AM_RANGE(0x080000, 0x0bffff) AM_RAM |
| 960 | 960 | ADDRESS_MAP_END |
| 961 | 961 | |
| 962 | 962 | static ADDRESS_MAP_START( drivedge_tms2_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 963 | AM_RANGE(0x008000, 0x0083ff) AM_MIRROR(0x8400) AM_R | |
| 963 | AM_RANGE(0x008000, 0x0083ff) AM_MIRROR(0x8400) AM_R | |
| 964 | 964 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| 965 | 965 | ADDRESS_MAP_END |
| 966 | 966 | |
| r2418 | r2419 | |
| 979 | 979 | AM_RANGE(0x480000, 0x480003) AM_WRITE(sound_data32_w) |
| 980 | 980 | AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(itech020_video_r, itech020_video_w) AM_BASE((UINT32 **)&itech32_video) |
| 981 | 981 | AM_RANGE(0x578000, 0x57ffff) AM_READNOP /* touched by protection */ |
| 982 | AM_RANGE(0x580000, 0x59ffff) AM_R | |
| 982 | AM_RANGE(0x580000, 0x59ffff) AM_R | |
| 983 | 983 | AM_RANGE(0x600000, 0x603fff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) |
| 984 | 984 | /* ? */ AM_RANGE(0x61ff00, 0x61ffff) AM_WRITENOP /* Unknown Writes */ |
| 985 | 985 | AM_RANGE(0x680000, 0x680003) AM_READWRITE(itech020_prot_result_r, SMH_NOP) |
| 986 | /* ! */ AM_RANGE(0x680800, 0x68083f) AM_R | |
| 986 | /* ! */ AM_RANGE(0x680800, 0x68083f) AM_R | |
| 987 | 987 | AM_RANGE(0x700000, 0x700003) AM_WRITE(itech020_plane_w) |
| 988 | 988 | AM_RANGE(0x800000, 0xbfffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE((UINT32 **)&main_rom) |
| 989 | 989 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 3721 | 3721 | itech32_planes = 1; |
| 3722 | 3722 | is_drivedge = 1; |
| 3723 | 3723 | |
| 3724 | memory_install_read32_handler(2, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms1_speedup_r); | |
| 3725 | memory_install_read32_handler(3, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms2_speedup_r); | |
| 3724 | memory_install_read32_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms1_speedup_r); | |
| 3725 | memory_install_read32_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms2_speedup_r); | |
| 3726 | 3726 | } |
| 3727 | 3727 | |
| 3728 | 3728 | |
| r2418 | r2419 | |
| 3740 | 3740 | itech32_vram_height = 1024; |
| 3741 | 3741 | itech32_planes = 1; |
| 3742 | 3742 | |
| 3743 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680001, 0, 0, trackball_r); | |
| 3743 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680001, 0, 0, trackball_r); | |
| 3744 | 3744 | |
| 3745 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x578000, 0x57ffff, 0, 0, SMH_NOP); | |
| 3746 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, wcbowl_prot_result_r); | |
| 3747 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, SMH_NOP); | |
| 3745 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x578000, 0x57ffff, 0, 0, SMH_NOP); | |
| 3746 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, wcbowl_prot_result_r, SMH_NOP); | |
| 3748 | 3747 | } |
| 3749 | 3748 | |
| 3750 | 3749 | |
| r2418 | r2419 | |
| 3757 | 3756 | |
| 3758 | 3757 | itech020_prot_address = prot_addr; |
| 3759 | 3758 | |
| 3760 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w); | |
| 3761 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w); | |
| 3759 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w); | |
| 3760 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w); | |
| 3762 | 3761 | } |
| 3763 | 3762 | |
| 3764 | 3763 | |
| r2418 | r2419 | |
| 3788 | 3787 | |
| 3789 | 3788 | itech020_prot_address = prot_addr; |
| 3790 | 3789 | |
| 3791 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w); | |
| 3792 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w); | |
| 3793 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r); | |
| 3794 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r); | |
| 3790 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w); | |
| 3791 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w); | |
| 3792 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r); | |
| 3793 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r); | |
| 3795 | 3794 | } |
| 3796 | 3795 | |
| 3797 | 3796 | |
| r2418 | r2419 | |
| 3813 | 3812 | init_shuffle_bowl_common(machine, 0x111a); |
| 3814 | 3813 | |
| 3815 | 3814 | timekeeper_init( 0, TIMEKEEPER_M48T02, NULL ); |
| 3816 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r); | |
| 3817 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w); | |
| 3815 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r, timekeeper_0_32be_w); | |
| 3818 | 3816 | } |
| 3819 | 3817 | |
| 3820 | 3818 | static void init_gt_common(running_machine *machine) |
| r2418 | r2419 | |
| 3837 | 3835 | Hacked versions of this PCB have been found with GT97 |
| 3838 | 3836 | through GTClassic. This is _NOT_ a factory modification |
| 3839 | 3837 | */ |
| 3840 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_8bit_r); | |
| 3838 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_8bit_r); | |
| 3841 | 3839 | init_gt_common(machine); |
| 3842 | 3840 | } |
| 3843 | 3841 | |
| r2418 | r2419 | |
| 3850 | 3848 | board share the same sound CPU code and sample ROMs. |
| 3851 | 3849 | This board has all versions of GT for it, GT3D through GTClassic |
| 3852 | 3850 | */ |
| 3853 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r); | |
| 3854 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r); | |
| 3851 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r); | |
| 3852 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r); | |
| 3855 | 3853 | init_gt_common(machine); |
| 3856 | 3854 | } |
| 3857 | 3855 | |
| r2418 | r2419 | |
| 3863 | 3861 | */ |
| 3864 | 3862 | DRIVER_INIT_CALL(aama); |
| 3865 | 3863 | timekeeper_init( 0, TIMEKEEPER_M48T02, NULL ); |
| 3866 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r); | |
| 3867 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w); | |
| 3864 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r, timekeeper_0_32be_w); | |
| 3868 | 3865 | } |
| 3869 | 3866 | |
| 3870 | 3867 | |
| r2418 | r2419 | |
| 3876 | 3873 | board: GT97 v1.21S, GT98, GT99, GT2K & GT Classic Versions 1.00S |
| 3877 | 3874 | Trackball info is read through 200202 (actually 200203). |
| 3878 | 3875 | */ |
| 3879 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200200, 0x200203, 0, 0, trackball32_4bit_r); | |
| 3876 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200200, 0x200203, 0, 0, trackball32_4bit_r); | |
| 3880 | 3877 | init_gt_common(machine); |
| 3881 | 3878 | } |
| 3882 | 3879 | |
| r2418 | r2419 | |
| 3890 | 3887 | Player 1 trackball read through 200003 |
| 3891 | 3888 | Player 2 trackball read through 200002 |
| 3892 | 3889 | */ |
| 3893 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_4bit_combined_r); | |
| 3890 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_4bit_combined_r); | |
| 3894 | 3891 | init_gt_common(machine); |
| 3895 | 3892 | } |
| 3896 | 3893 | |
| r2418 | r2419 | |
| 3898 | 3895 | static DRIVER_INIT( gtclassp ) |
| 3899 | 3896 | { |
| 3900 | 3897 | /* a little extra protection */ |
| 3901 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r); | |
| 3898 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r); | |
| 3902 | 3899 | DRIVER_INIT_CALL(aama); |
| 3903 | 3900 | |
| 3904 | 3901 | /* The protection code is: |
| r2418 | r2419 | |
|---|---|---|
| 20 | 20 | extern UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl); |
| 21 | 21 | extern void megadriv_stop_scanline_timer(void); |
| 22 | 22 | |
| 23 | void megatech_set_megadrive_z80_as_megadrive_z80( | |
| 23 | void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine); | |
| 24 | 24 | |
| 25 | 25 | extern READ8_HANDLER (megatech_sms_ioport_dc_r); |
| 26 | 26 | extern READ8_HANDLER (megatech_sms_ioport_dd_r); |
| r2418 | r2419 | |
|---|---|---|
| 991 | 991 | { |
| 992 | 992 | // UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); |
| 993 | 993 | // mem16[0x0165B2/2]=0x4e71; // for now so it boots |
| 994 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, fitfight_700000_r); | |
| 994 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, fitfight_700000_r); | |
| 995 | 995 | bbprot_kludge = 0; |
| 996 | 996 | } |
| 997 | 997 | |
| r2418 | r2419 | |
| 999 | 999 | { |
| 1000 | 1000 | // UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); |
| 1001 | 1001 | // mem16[0x017FDC/2]=0x4e71; // for now so it boots |
| 1002 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, histryma_700000_r); | |
| 1002 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, histryma_700000_r); | |
| 1003 | 1003 | bbprot_kludge = 0; |
| 1004 | 1004 | } |
| 1005 | 1005 |
| r2418 | r2419 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | static ADDRESS_MAP_START( ashnojoe_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 119 | 119 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 120 | AM_RANGE(0x040000, 0x041fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram3_w) AM_BASE(&ashnojoetileram16_3) | |
| 121 | AM_RANGE(0x042000, 0x043fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram4_w) AM_BASE(&ashnojoetileram16_4) | |
| 122 | AM_RANGE(0x044000, 0x044fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram5_w) AM_BASE(&ashnojoetileram16_5) | |
| 123 | AM_RANGE(0x045000, 0x045fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram2_w) AM_BASE(&ashnojoetileram16_2) | |
| 124 | AM_RANGE(0x046000, 0x046fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram6_w) AM_BASE(&ashnojoetileram16_6) | |
| 125 | AM_RANGE(0x047000, 0x047fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram7_w) AM_BASE(&ashnojoetileram16_7) | |
| 126 | AM_RANGE(0x048000, 0x048fff) AM_READWRITE(SMH_RAM, ashnojoe_tileram_w) AM_BASE(&ashnojoetileram16) | |
| 127 | AM_RANGE(0x049000, 0x049fff) AM_READWRITE(SMH_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) | |
| 120 | AM_RANGE(0x040000, 0x041fff) AM_RAM_WRITE(ashnojoe_tileram3_w) AM_BASE(&ashnojoetileram16_3) | |
| 121 | AM_RANGE(0x042000, 0x043fff) AM_RAM_WRITE(ashnojoe_tileram4_w) AM_BASE(&ashnojoetileram16_4) | |
| 122 | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(ashnojoe_tileram5_w) AM_BASE(&ashnojoetileram16_5) | |
| 123 | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(ashnojoe_tileram2_w) AM_BASE(&ashnojoetileram16_2) | |
| 124 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(ashnojoe_tileram6_w) AM_BASE(&ashnojoetileram16_6) | |
| 125 | AM_RANGE(0x047000, 0x047fff) AM_RAM_WRITE(ashnojoe_tileram7_w) AM_BASE(&ashnojoetileram16_7) | |
| 126 | AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(ashnojoe_tileram_w) AM_BASE(&ashnojoetileram16) | |
| 127 | AM_RANGE(0x049000, 0x049fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) | |
| 128 | 128 | AM_RANGE(0x04a000, 0x04a001) AM_READ(input_port_0_word_r) // p1 inputs, coins |
| 129 | 129 | AM_RANGE(0x04a002, 0x04a003) AM_READ(input_port_1_word_r) // p2 inputs |
| 130 | 130 | AM_RANGE(0x04a004, 0x04a005) AM_READ(input_port_2_word_r) // dipswitches |
| r2418 | r2419 | |
|---|---|---|
| 1025 | 1025 | static DRIVER_INIT( horekid ) |
| 1026 | 1026 | { |
| 1027 | 1027 | mpProtData = mHoreKidProtData; |
| 1028 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x44004, 0x44005, 0, 0, horekid_IN2_r); | |
| 1028 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x44004, 0x44005, 0, 0, horekid_IN2_r); | |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ |
| r2418 | r2419 | |
|---|---|---|
| 469 | 469 | MEMORY STRUCTURES |
| 470 | 470 | ***********************************************************/ |
| 471 | 471 | |
| 472 | static ADDRESS_MAP_START( undrfire_readmem, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 473 | AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM) | |
| 474 | AM_RANGE(0x200000, 0x21ffff) AM_READ(SMH_RAM) /* main CPUA ram */ | |
| 475 | AM_RANGE(0x300000, 0x303fff) AM_READ(SMH_RAM) /* sprite ram */ | |
| 476 | // AM_RANGE(0x304000, 0x304003) AM_READ(SMH_RAM) // debugging | |
| 477 | // AM_RANGE(0x304400, 0x304403) AM_READ(SMH_RAM) // debugging | |
| 478 | AM_RANGE(0x500000, 0x500007) AM_READ(undrfire_input_r) | |
| 479 | AM_RANGE(0x600000, 0x600007) AM_READ(unknown_hardware_r) /* unknown byte reads at $156e */ | |
| 480 | AM_RANGE(0x700000, 0x7007ff) AM_READ(SMH_RAM) | |
| 481 | AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0480SCP_long_r) /* tilemaps */ | |
| 482 | AM_RANGE(0x830000, 0x83002f) AM_READ(TC0480SCP_ctrl_long_r) // debugging | |
| 483 | AM_RANGE(0x900000, 0x90ffff) AM_READ(TC0100SCN_long_r) /* piv tilemaps */ | |
| 484 | AM_RANGE(0x920000, 0x92000f) AM_READ(TC0100SCN_ctrl_long_r) | |
| 485 | AM_RANGE(0xa00000, 0xa0ffff) AM_READ(SMH_RAM) /* palette ram */ | |
| 486 | AM_RANGE(0xb00000, 0xb003ff) AM_READ(SMH_RAM) // ?? single bytes | |
| 472 | static ADDRESS_MAP_START( undrfire_map, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 473 | AM_RANGE(0x000000, 0x1fffff) AM_ROM | |
| 474 | AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_BASE(&undrfire_ram) | |
| 475 | AM_RANGE(0x300000, 0x303fff) AM_RAM AM_BASE(&spriteram32) AM_SIZE(&spriteram_size) | |
| 476 | // AM_RANGE(0x304000, 0x304003) AM_RAM // debugging - doesn't change ??? | |
| 477 | // AM_RANGE(0x304400, 0x304403) AM_RAM // debugging - doesn't change ??? | |
| 478 | AM_RANGE(0x400000, 0x400003) AM_WRITE(motor_control_w) /* gun vibration */ | |
| 479 | AM_RANGE(0x500000, 0x500007) AM_READWRITE(undrfire_input_r, undrfire_input_w) /* eerom etc. */ | |
| 480 | AM_RANGE(0x600000, 0x600007) AM_READWRITE(unknown_hardware_r, unknown_int_req_w) /* int request for unknown hardware */ | |
| 481 | AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_BASE(&f3_shared_ram) | |
| 482 | AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0480SCP_long_r, TC0480SCP_long_w) /* tilemaps */ | |
| 483 | AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_long_r, TC0480SCP_ctrl_long_w) | |
| 484 | AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0100SCN_long_r, TC0100SCN_long_w) /* piv tilemaps */ | |
| 485 | AM_RANGE(0x920000, 0x92000f) AM_READWRITE(TC0100SCN_ctrl_long_r, TC0100SCN_ctrl_long_w) | |
| 486 | AM_RANGE(0xa00000, 0xa0ffff) AM_RAM_WRITE(color_ram_w) AM_BASE(&paletteram32) | |
| 487 | AM_RANGE(0xb00000, 0xb003ff) AM_RAM /* single bytes, blending ??? */ | |
| 488 | AM_RANGE(0xd00000, 0xd00003) AM_WRITE(rotate_control_w) /* perhaps port based rotate control? */ | |
| 487 | 489 | AM_RANGE(0xf00000, 0xf00007) AM_READ(undrfire_lightgun_r) /* stick coords read at $11b2-bc */ |
| 488 | 490 | ADDRESS_MAP_END |
| 489 | 491 | |
| 490 | static ADDRESS_MAP_START( undrfire_writemem, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 491 | AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM) | |
| 492 | AM_RANGE(0x200000, 0x21ffff) AM_WRITE(SMH_RAM) AM_BASE(&undrfire_ram) | |
| 493 | AM_RANGE(0x300000, 0x303fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram32) AM_SIZE(&spriteram_size) | |
| 494 | // AM_RANGE(0x304000, 0x304003) AM_WRITE(SMH_RAM) // ??? doesn't change | |
| 495 | // AM_RANGE(0x304400, 0x304403) AM_WRITE(SMH_RAM) // ??? doesn't change | |
| 496 | AM_RANGE(0x400000, 0x400003) AM_WRITE(motor_control_w) /* gun vibration */ | |
| 497 | AM_RANGE(0x500000, 0x500007) AM_WRITE(undrfire_input_w) /* eerom etc. */ | |
| 498 | AM_RANGE(0x600000, 0x600007) AM_WRITE(unknown_int_req_w) /* int request for unknown hardware */ | |
| 499 | AM_RANGE(0x700000, 0x7007ff) AM_WRITE(SMH_RAM) AM_BASE(&f3_shared_ram) | |
| 500 | AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0480SCP_long_w) /* tilemaps */ | |
| 501 | AM_RANGE(0x830000, 0x83002f) AM_WRITE(TC0480SCP_ctrl_long_w) | |
| 502 | AM_RANGE(0x900000, 0x90ffff) AM_WRITE(TC0100SCN_long_w) /* piv tilemaps */ | |
| 503 | AM_RANGE(0x920000, 0x92000f) AM_WRITE(TC0100SCN_ctrl_long_w) | |
| 504 | AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(color_ram_w) AM_BASE(&paletteram32) | |
| 505 | AM_RANGE(0xb00000, 0xb003ff) AM_WRITE(SMH_RAM) // single bytes, blending ?? | |
| 506 | AM_RANGE(0xd00000, 0xd00003) AM_WRITE(rotate_control_w) /* perhaps port based rotate control? */ | |
| 507 | ADDRESS_MAP_END | |
| 508 | ||
| 509 | ||
| 510 | ||
| 511 | 492 | static ADDRESS_MAP_START( cbombers_readmem, ADDRESS_SPACE_PROGRAM, 32 ) |
| 512 | 493 | AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM) |
| 513 | 494 | AM_RANGE(0x200000, 0x21ffff) AM_READ(SMH_RAM) /* main CPUA ram */ |
| r2418 | r2419 | |
| 523 | 504 | |
| 524 | 505 | AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM) |
| 525 | 506 | AM_RANGE(0xa00000, 0xa0ffff) AM_READ(SMH_RAM) /* Palette ram */ |
| 526 | AM_RANGE(0xe00000, 0xe0ffff) AM_READ(SMH_RAM) /* Shared ram */ | |
| 527 | ||
| 507 | AM_RANGE(0xe00000, 0xe0ffff) AM_READ(SMH_RAM) /* Shared ram */ | |
| 528 | 508 | ADDRESS_MAP_END |
| 529 | 509 | |
| 530 | 510 | static ADDRESS_MAP_START( cbombers_writemem, ADDRESS_SPACE_PROGRAM, 32 ) |
| r2418 | r2419 | |
| 551 | 531 | AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) |
| 552 | 532 | AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(color_ram_w) AM_BASE(&paletteram32) |
| 553 | 533 | AM_RANGE(0xe00000, 0xe0ffff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram) |
| 554 | ||
| 555 | 534 | ADDRESS_MAP_END |
| 556 | 535 | |
| 557 | 536 | static ADDRESS_MAP_START( cbombers_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r2418 | r2419 | |
| 784 | 763 | |
| 785 | 764 | /* basic machine hardware */ |
| 786 | 765 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz */ |
| 787 | MDRV_CPU_PROGRAM_MAP(undrfire_ | |
| 766 | MDRV_CPU_PROGRAM_MAP(undrfire_ | |
| 788 | 767 | MDRV_CPU_VBLANK_INT("main", undrfire_interrupt) |
| 789 | 768 | |
| 790 | 769 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| r2418 | r2419 | |
| 1036 | 1015 | int data; |
| 1037 | 1016 | |
| 1038 | 1017 | /* Speedup handlers */ |
| 1039 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x2004f8, 0x2004fb, 0, 0, main_cycle_r); | |
| 1018 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2004f8, 0x2004fb, 0, 0, main_cycle_r); | |
| 1040 | 1019 | |
| 1041 | 1020 | /* make piv tile GFX format suitable for gfxdecode */ |
| 1042 | 1021 | offset = size/2; |
| r2418 | r2419 | |
|---|---|---|
| 101 | 101 | AM_RANGE(0x14cb, 0x14cb) AM_MIRROR(0x6000) AM_READ(fake_VRLE_r) |
| 102 | 102 | AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&malzak_s2636_0_ram) |
| 103 | 103 | AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&malzak_s2636_1_ram) |
| 104 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_R | |
| 104 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_R | |
| 105 | 105 | AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM |
| 106 | 106 | AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&saa5050_vidram) |
| 107 | 107 | AM_RANGE(0x2000, 0x2fff) AM_ROM |
| r2418 | r2419 | |
| 122 | 122 | AM_RANGE(0x14cc, 0x14cc) AM_MIRROR(0x6000) AM_READ(s2636_portA_r) |
| 123 | 123 | AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&malzak_s2636_0_ram) |
| 124 | 124 | AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&malzak_s2636_1_ram) |
| 125 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_R | |
| 125 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_R | |
| 126 | 126 | AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 127 | 127 | AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&saa5050_vidram) |
| 128 | 128 | AM_RANGE(0x2000, 0x2fff) AM_ROM |
| r2418 | r2419 | |
|---|---|---|
| 35 | 35 | AM_RANGE(0x004020, 0x00402f) AM_READ(vertigo_coin_r) AM_MIRROR(0x001000) |
| 36 | 36 | AM_RANGE(0x004030, 0x00403f) AM_READ(input_port_3_word_r) AM_MIRROR(0x001000) |
| 37 | 37 | AM_RANGE(0x004040, 0x00404f) AM_READ(vertigo_sio_r) AM_MIRROR(0x001000) |
| 38 | AM_RANGE(0x004050, 0x00405f) AM_R | |
| 38 | AM_RANGE(0x004050, 0x00405f) AM_R | |
| 39 | 39 | AM_RANGE(0x004060, 0x00406f) AM_WRITE(vertigo_motor_w) AM_MIRROR(0x001000) |
| 40 | 40 | AM_RANGE(0x004070, 0x00407f) AM_WRITE(vertigo_wsot_w) AM_MIRROR(0x001000) |
| 41 | 41 | AM_RANGE(0x006000, 0x006007) AM_DEVREADWRITE(PIT8254, "pit8254", vertigo_pit8254_lsb_r, vertigo_pit8254_lsb_w) |
| r2418 | r2419 | |
|---|---|---|
| 1326 | 1326 | |
| 1327 | 1327 | static DRIVER_INIT( mk4 ) |
| 1328 | 1328 | { |
| 1329 | dcs2_init(0, 0); | |
| 1329 | dcs2_init(machine, 0, 0); | |
| 1330 | 1330 | midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 461/* or 474 */, 94, NULL); |
| 1331 | 1331 | midway_ioasic_set_shuffle_state(1); |
| 1332 | 1332 | } |
| r2418 | r2419 | |
| 1334 | 1334 | |
| 1335 | 1335 | static DRIVER_INIT( invasn ) |
| 1336 | 1336 | { |
| 1337 | dcs2_init(0, 0); | |
| 1337 | dcs2_init(machine, 0, 0); | |
| 1338 | 1338 | midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 468/* or 488 */, 94, NULL); |
| 1339 | memory_install_readwrite32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9c0000, 0x9c0000, 0, 0, invasn_gun_r, invasn_gun_w); | |
| 1339 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9c0000, 0x9c0000, 0, 0, invasn_gun_r, invasn_gun_w); | |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | |
| 1343 | 1343 | static DRIVER_INIT( crusnexo ) |
| 1344 | 1344 | { |
| 1345 | dcs2_init(0, 0); | |
| 1345 | dcs2_init(machine, 0, 0); | |
| 1346 | 1346 | midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL); |
| 1347 | 1347 | memory_configure_bank(1, 0, 3, memory_region(REGION_USER2), 0x400000*4); |
| 1348 | 1348 | |
| 1349 | memory_install_readwrite32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9b0004, 0x9b0007, 0, 0, crusnexo_leds_r, crusnexo_leds_w); | |
| 1350 | memory_install_write32_handler (0, ADDRESS_SPACE_PROGRAM, 0x8d0009, 0x8d000a, 0, 0, keypad_select_w); | |
| 1349 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9b0004, 0x9b0007, 0, 0, crusnexo_leds_r, crusnexo_leds_w); | |
| 1350 | memory_install_write32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x8d0009, 0x8d000a, 0, 0, keypad_select_w); | |
| 1351 | 1351 | } |
| 1352 | 1352 | |
| 1353 | 1353 | |
| 1354 | 1354 | static DRIVER_INIT( thegrid ) |
| 1355 | 1355 | { |
| 1356 | dcs2_init(0, 0); | |
| 1356 | dcs2_init(machine, 0, 0); | |
| 1357 | 1357 | midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 474/* or 491 */, 99, NULL); |
| 1358 | 1358 | memory_configure_bank(1, 0, 3, memory_region(REGION_USER2), 0x400000*4); |
| 1359 | 1359 | } |
| r2418 | r2419 | |
|---|---|---|
| 543 | 543 | /* complete memory map derived from schematics */ |
| 544 | 544 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 545 | 545 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 546 | AM_RANGE(0x2000, 0x27ff) AM_READWRITE(SMH_RAM, grchamp_left_w) AM_BASE_MEMBER(grchamp_state, leftram) | |
| 547 | AM_RANGE(0x2800, 0x2fff) AM_READWRITE(SMH_RAM, grchamp_right_w) AM_BASE_MEMBER(grchamp_state, rightram) | |
| 548 | AM_RANGE(0x3000, 0x37ff) AM_READWRITE(SMH_RAM, grchamp_center_w) AM_BASE_MEMBER(grchamp_state, centerram) | |
| 546 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(grchamp_left_w) AM_BASE_MEMBER(grchamp_state, leftram) | |
| 547 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(grchamp_right_w) AM_BASE_MEMBER(grchamp_state, rightram) | |
| 548 | AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(grchamp_center_w) AM_BASE_MEMBER(grchamp_state, centerram) | |
| 549 | 549 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM |
| 550 | 550 | AM_RANGE(0x5000, 0x6fff) AM_ROM |
| 551 | 551 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | ***************************************************************************/ |
| 278 | 278 | |
| 279 | static ADDRESS_MAP_START( argus_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 280 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 281 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) | |
| 279 | static ADDRESS_MAP_START( argus_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 280 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 281 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) | |
| 282 | 282 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r) // Coin |
| 283 | 283 | AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r) // Player 1 |
| 284 | 284 | AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r) // Player 2 |
| 285 | 285 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r) // DSW 1 |
| 286 | 286 | AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r) // DSW 2 |
| 287 | AM_RANGE(0xc400, 0xcfff) AM_READ(argus_paletteram_r) | |
| 288 | AM_RANGE(0xd000, 0xd7ff) AM_READ(argus_txram_r) | |
| 289 | AM_RANGE(0xd800, 0xdfff) AM_READ(argus_bg1ram_r) | |
| 290 | AM_RANGE(0xe000, 0xf1ff) AM_READ(SMH_RAM) | |
| 291 | AM_RANGE(0xf200, 0xf7ff) AM_READ(SMH_RAM) | |
| 292 | AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM) | |
| 293 | ADDRESS_MAP_END | |
| 294 | ||
| 295 | static ADDRESS_MAP_START( argus_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 296 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 297 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1) | |
| 298 | 287 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 299 | 288 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 300 | 289 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| r2418 | r2419 | |
| 303 | 292 | AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx) |
| 304 | 293 | AM_RANGE(0xc30a, 0xc30b) AM_WRITE(argus_bg1_scrolly_w) AM_BASE(&argus_bg1_scrolly) |
| 305 | 294 | AM_RANGE(0xc30c, 0xc30c) AM_WRITE(argus_bg_status_w) |
| 306 | AM_RANGE(0xc400, 0xcfff) AM_WRITE(argus_paletteram_w) AM_BASE(&argus_paletteram) | |
| 307 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(argus_txram_w) AM_BASE(&argus_txram) | |
| 308 | AM_RANGE(0xd800, 0xdfff) AM_WRITE(argus_bg1ram_w) AM_BASE(&argus_bg1ram) | |
| 309 | AM_RANGE(0xe000, 0xf1ff) AM_WRITE(SMH_RAM) | |
| 310 | AM_RANGE(0xf200, 0xf7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 311 | AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM) | |
| 295 | AM_RANGE(0xc400, 0xcfff) AM_READWRITE(argus_paletteram_r, argus_paletteram_w) AM_BASE(&argus_paletteram) | |
| 296 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(argus_txram_r, argus_txram_w) AM_BASE(&argus_txram) | |
| 297 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(argus_bg1ram_r, argus_bg1ram_w) AM_BASE(&argus_bg1ram) | |
| 298 | AM_RANGE(0xe000, 0xf1ff) AM_RAM | |
| 299 | AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 300 | AM_RANGE(0xf800, 0xffff) AM_RAM | |
| 312 | 301 | ADDRESS_MAP_END |
| 313 | 302 | |
| 314 | static ADDRESS_MAP_START( valtric_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 315 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 316 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) | |
| 303 | static ADDRESS_MAP_START( valtric_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 304 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 305 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) | |
| 317 | 306 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r) // Coin |
| 318 | 307 | AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r) // Player 1 |
| 319 | 308 | AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r) // Player 2 |
| 320 | 309 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r) // DSW 1 |
| 321 | 310 | AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r) // DSW 2 |
| 322 | AM_RANGE(0xc400, 0xcfff) AM_READ(argus_paletteram_r) | |
| 323 | AM_RANGE(0xd000, 0xd7ff) AM_READ(argus_txram_r) | |
| 324 | AM_RANGE(0xd800, 0xdfff) AM_READ(argus_bg1ram_r) | |
| 325 | AM_RANGE(0xe000, 0xf1ff) AM_READ(SMH_RAM) | |
| 326 | AM_RANGE(0xf200, 0xf7ff) AM_READ(SMH_RAM) | |
| 327 | AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM) | |
| 328 | ADDRESS_MAP_END | |
| 329 | ||
| 330 | static ADDRESS_MAP_START( valtric_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 331 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 332 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1) | |
| 333 | 311 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 334 | 312 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 335 | 313 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| r2418 | r2419 | |
| 337 | 315 | AM_RANGE(0xc30a, 0xc30b) AM_WRITE(argus_bg1_scrolly_w) AM_BASE(&argus_bg1_scrolly) |
| 338 | 316 | AM_RANGE(0xc30c, 0xc30c) AM_WRITE(valtric_bg_status_w) |
| 339 | 317 | AM_RANGE(0xc30d, 0xc30d) AM_WRITE(valtric_mosaic_w) |
| 340 | AM_RANGE(0xc400, 0xcfff) AM_WRITE(valtric_paletteram_w) AM_BASE(&argus_paletteram) | |
| 341 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(argus_txram_w) AM_BASE(&argus_txram) | |
| 342 | AM_RANGE(0xd800, 0xdfff) AM_WRITE(argus_bg1ram_w) AM_BASE(&argus_bg1ram) | |
| 343 | AM_RANGE(0xe000, 0xf1ff) AM_WRITE(SMH_RAM) | |
| 344 | AM_RANGE(0xf200, 0xf7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 345 | AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM) | |
| 318 | AM_RANGE(0xc400, 0xcfff) AM_READWRITE(argus_paletteram_r, valtric_paletteram_w) AM_BASE(&argus_paletteram) | |
| 319 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(argus_txram_r, argus_txram_w) AM_BASE(&argus_txram) | |
| 320 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(argus_bg1ram_r, argus_bg1ram_w) AM_BASE(&argus_bg1ram) | |
| 321 | AM_RANGE(0xe000, 0xf1ff) AM_RAM | |
| 322 | AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 323 | AM_RANGE(0xf800, 0xffff) AM_RAM | |
| 346 | 324 | ADDRESS_MAP_END |
| 347 | 325 | |
| 348 | static ADDRESS_MAP_START( butasan_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 349 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 350 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) | |
| 326 | static ADDRESS_MAP_START( butasan_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 327 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 328 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) | |
| 351 | 329 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r) // Coin |
| 352 | 330 | AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r) // Player 1 |
| 353 | 331 | AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r) // Player 2 |
| 354 | 332 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r) // DSW 1 |
| 355 | 333 | AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r) // DSW 2 |
| 356 | AM_RANGE(0xc400, 0xc7ff) AM_READ(butasan_bg1ram_r) | |
| 357 | AM_RANGE(0xc800, 0xcfff) AM_READ(argus_paletteram_r) | |
| 358 | AM_RANGE(0xd000, 0xdfff) AM_READ(butasan_pagedram_r) | |
| 359 | AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM) | |
| 360 | AM_RANGE(0xf000, 0xf67f) AM_READ(SMH_RAM) | |
| 361 | AM_RANGE(0xf680, 0xffff) AM_READ(SMH_RAM) | |
| 362 | ADDRESS_MAP_END | |
| 363 | ||
| 364 | static ADDRESS_MAP_START( butasan_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 365 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 366 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1) | |
| 367 | 334 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 368 | 335 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 369 | 336 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| r2418 | r2419 | |
| 374 | 341 | AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx) |
| 375 | 342 | AM_RANGE(0xc30a, 0xc30b) AM_WRITE(argus_bg1_scrolly_w) AM_BASE(&argus_bg1_scrolly) |
| 376 | 343 | AM_RANGE(0xc30c, 0xc30c) AM_WRITE(butasan_bg1_status_w) |
| 377 | AM_RANGE(0xc400, 0xc7ff) AM_WRITE(butasan_bg1ram_w) AM_BASE(&butasan_bg1ram) | |
| 378 | AM_RANGE(0xc800, 0xcfff) AM_WRITE(butasan_paletteram_w) AM_BASE(&argus_paletteram) | |
| 379 | AM_RANGE(0xd000, 0xdfff) AM_WRITE(butasan_pagedram_w) | |
| 380 | AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM) | |
| 381 | AM_RANGE(0xf000, 0xf67f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 382 | AM_RANGE(0xf680, 0xffff) AM_WRITE(SMH_RAM) | |
| 344 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(butasan_bg1ram_r, butasan_bg1ram_w) AM_BASE(&butasan_bg1ram) | |
| 345 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(argus_paletteram_r, butasan_paletteram_w) AM_BASE(&argus_paletteram) | |
| 346 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(butasan_pagedram_r, butasan_pagedram_w) | |
| 347 | AM_RANGE(0xe000, 0xefff) AM_RAM | |
| 348 | AM_RANGE(0xf000, 0xf67f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 349 | AM_RANGE(0xf680, 0xffff) AM_RAM | |
| 383 | 350 | ADDRESS_MAP_END |
| 384 | 351 | |
| 385 | 352 | WRITE8_HANDLER( bombsa_txram_w ); |
| 386 | 353 | READ8_HANDLER( bombsa_txram_r ); |
| 387 | 354 | |
| 388 | static ADDRESS_MAP_START( bombsa_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 389 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 390 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) | |
| 355 | static ADDRESS_MAP_START( bombsa_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 356 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 357 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) | |
| 358 | AM_RANGE(0xc000, 0xcfff) AM_RAM | |
| 391 | 359 | |
| 392 | AM_RANGE(0xc000, 0xcfff) AM_READ(SMH_RAM) | |
| 393 | ||
| 394 | AM_RANGE(0xd000, 0xd1ff) AM_READ(SMH_RAM) | |
| 395 | AM_RANGE(0xd200, 0xd7ff) AM_READ(SMH_RAM) | |
| 396 | AM_RANGE(0xd800, 0xdfff) AM_READ(SMH_RAM) | |
| 397 | /* Input ports */ | |
| 398 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r) // Coin | |
| 399 | AM_RANGE(0xe001, 0xe001) AM_READ(input_port_1_r) // Player 1 | |
| 400 | AM_RANGE(0xe002, 0xe002) AM_READ(input_port_2_r) // Player 2 | |
| 401 | AM_RANGE(0xe003, 0xe003) AM_READ(input_port_3_r) // DSW 1 | |
| 402 | AM_RANGE(0xe004, 0xe004) AM_READ(input_port_4_r) // DSW 2 | |
| 403 | ||
| 404 | AM_RANGE(0xe800, 0xefff) AM_READ(bombsa_txram_r) | |
| 405 | AM_RANGE(0xf000, 0xffff) AM_READ(bombsa_paletteram_r) | |
| 406 | ADDRESS_MAP_END | |
| 407 | ||
| 408 | static ADDRESS_MAP_START( bombsa_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 409 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 410 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1) | |
| 411 | ||
| 412 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(SMH_RAM) | |
| 413 | ||
| 414 | 360 | /* ports look like the other games */ |
| 415 | 361 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed |
| 416 | 362 | // AM_RANGE(0xd001, 0xd001) AM_WRITE(argus_flipscreen_w) |
| 417 | 363 | AM_RANGE(0xd002, 0xd002) AM_WRITE(argus_bankselect_w) |
| 418 | 364 | AM_RANGE(0xd003, 0xd003) AM_WRITE(bombsa_pageselect_w) // 0,1,0,1,0,1 etc. |
| 419 | 365 | |
| 420 | AM_RANGE(0xd000, 0xd1ff) AM_WRITE(SMH_RAM) | |
| 421 | AM_RANGE(0xd200, 0xd7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 422 | AM_RANGE(0xd800, 0xdfff) AM_WRITE(SMH_RAM) | |
| 366 | AM_RANGE(0xd000, 0xd1ff) AM_RAM | |
| 367 | AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 368 | AM_RANGE(0xd800, 0xdfff) AM_RAM | |
| 423 | 369 | |
| 370 | /* Input ports */ | |
| 371 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r) // Coin | |
| 372 | AM_RANGE(0xe001, 0xe001) AM_READ(input_port_1_r) // Player 1 | |
| 373 | AM_RANGE(0xe002, 0xe002) AM_READ(input_port_2_r) // Player 2 | |
| 374 | AM_RANGE(0xe003, 0xe003) AM_READ(input_port_3_r) // DSW 1 | |
| 375 | AM_RANGE(0xe004, 0xe004) AM_READ(input_port_4_r) // DSW 2 | |
| 424 | 376 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM) // ?? |
| 425 | AM_RANGE(0xe800, 0xefff) AM_WRITE(bombsa_txram_w) AM_BASE(&argus_txram) // banked? it gets corrupted at game start, maybe its banked and one layer can be 16x16 or 8x8? | |
| 426 | AM_RANGE(0xf000, 0xffff) AM_WRITE(bombsa_paletteram_w) AM_BASE(&argus_paletteram) // banked? | |
| 377 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(bombsa_txram_r, bombsa_txram_w) AM_BASE(&argus_txram) // banked? it gets corrupted at game start, maybe its banked and one layer can be 16x16 or 8x8? | |
| 378 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(bombsa_paletteram_r, bombsa_paletteram_w) AM_BASE(&argus_paletteram) // banked? | |
| 427 | 379 | ADDRESS_MAP_END |
| 428 | 380 | |
| 429 | static ADDRESS_MAP_START( sound_readmem_a, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 430 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 431 | AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM) | |
| 381 | static ADDRESS_MAP_START( sound_map_a, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 382 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 383 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 432 | 384 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) |
| 433 | 385 | ADDRESS_MAP_END |
| 434 | 386 | |
| 435 | static ADDRESS_MAP_START( sound_writemem_a, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 436 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 437 | AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM) | |
| 387 | static ADDRESS_MAP_START( sound_map_b, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 388 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 389 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 390 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 438 | 391 | ADDRESS_MAP_END |
| 439 | 392 | |
| 440 | static ADDRESS_MAP_START( sound_readmem_b, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 441 | AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM) | |
| 442 | AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM) | |
| 393 | static ADDRESS_MAP_START( sound_map_c, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 394 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 395 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 443 | 396 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 397 | AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort? | |
| 444 | 398 | ADDRESS_MAP_END |
| 445 | 399 | |
| 446 | static ADDRESS_MAP_START( sound_writemem_b, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 447 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 448 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM) | |
| 449 | ADDRESS_MAP_END | |
| 450 | ||
| 451 | static ADDRESS_MAP_START( sound_writemem_c, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 452 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 453 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM) | |
| 454 | AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_RAM) // Is this a confirm of some sort? | |
| 455 | ADDRESS_MAP_END | |
| 456 | ||
| 457 | static ADDRESS_MAP_START( sound_readport_1, ADDRESS_SPACE_IO, 8 ) | |
| 400 | static ADDRESS_MAP_START( sound_portmap_1, ADDRESS_SPACE_IO, 8 ) | |
| 458 | 401 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 459 | AM_RANGE(0x00, 0x00) AM_READ(YM2203_status_port_0_r) | |
| 460 | AM_RANGE(0x01, 0x01) AM_READ(YM2203_read_port_0_r) | |
| 402 | AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w) | |
| 403 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w) | |
| 461 | 404 | ADDRESS_MAP_END |
| 462 | 405 | |
| 463 | static ADDRESS_MAP_START( sound_ | |
| 406 | static ADDRESS_MAP_START( sound_ | |
| 464 | 407 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 465 | AM_RANGE(0x00, 0x00) AM_WRITE(YM2203_control_port_0_w) | |
| 466 | AM_RANGE(0x01, 0x01) AM_WRITE(YM2203_write_port_0_w) | |
| 408 | AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w) | |
| 409 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w) | |
| 410 | AM_RANGE(0x80, 0x80) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w) | |
| 411 | AM_RANGE(0x81, 0x81) AM_READWRITE(YM2203_read_port_1_r, YM2203_write_port_1_w) | |
| 467 | 412 | ADDRESS_MAP_END |
| 468 | 413 | |
| 469 | static ADDRESS_MAP_START( sound_readport_2, ADDRESS_SPACE_IO, 8 ) | |
| 470 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 471 | AM_RANGE(0x00, 0x00) AM_READ(YM2203_status_port_0_r) | |
| 472 | AM_RANGE(0x01, 0x01) AM_READ(YM2203_read_port_0_r) | |
| 473 | AM_RANGE(0x80, 0x80) AM_READ(YM2203_status_port_1_r) | |
| 474 | AM_RANGE(0x81, 0x81) AM_READ(YM2203_read_port_1_r) | |
| 475 | ADDRESS_MAP_END | |
| 476 | 414 | |
| 477 | static ADDRESS_MAP_START( sound_writeport_2, ADDRESS_SPACE_IO, 8 ) | |
| 478 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 479 | AM_RANGE(0x00, 0x00) AM_WRITE(YM2203_control_port_0_w) | |
| 480 | AM_RANGE(0x01, 0x01) AM_WRITE(YM2203_write_port_0_w) | |
| 481 | AM_RANGE(0x80, 0x80) AM_WRITE(YM2203_control_port_1_w) | |
| 482 | AM_RANGE(0x81, 0x81) AM_WRITE(YM2203_write_port_1_w) | |
| 483 | ADDRESS_MAP_END | |
| 484 | ||
| 485 | ||
| 486 | 415 | /*************************************************************************** |
| 487 | 416 | |
| 488 | 417 | Input Port(s) |
| r2418 | r2419 | |
| 772 | 701 | |
| 773 | 702 | /* basic machine hardware */ |
| 774 | 703 | MDRV_CPU_ADD(Z80, 5000000) /* 4 MHz */ |
| 775 | MDRV_CPU_PROGRAM_MAP(argus_ | |
| 704 | MDRV_CPU_PROGRAM_MAP(argus_ | |
| 776 | 705 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) |
| 777 | 706 | |
| 778 | 707 | MDRV_CPU_ADD(Z80, 5000000) |
| 779 | /* audio CPU */ /* 4 MHz */ | |
| 780 | MDRV_CPU_PROGRAM_MAP(sound_readmem_a,sound_writemem_a) | |
| 781 | MDRV_CPU_IO_MAP(sound_readport_1,sound_writeport_1) | |
| 708 | MDRV_CPU_PROGRAM_MAP(sound_map_a,0) | |
| 709 | MDRV_CPU_IO_MAP(sound_portmap_1,0) | |
| 782 | 710 | |
| 783 | 711 | MDRV_INTERLEAVE(10) |
| 784 | 712 | |
| r2418 | r2419 | |
| 810 | 738 | |
| 811 | 739 | /* basic machine hardware */ |
| 812 | 740 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 813 | MDRV_CPU_PROGRAM_MAP(valtric_ | |
| 741 | MDRV_CPU_PROGRAM_MAP(valtric_ | |
| 814 | 742 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) |
| 815 | 743 | |
| 816 | 744 | MDRV_CPU_ADD(Z80, 5000000) |
| 817 | /* audio CPU */ /* 5 MHz */ | |
| 818 | MDRV_CPU_PROGRAM_MAP(sound_readmem_a,sound_writemem_a) | |
| 819 | MDRV_CPU_IO_MAP(sound_readport_2,sound_writeport_2) | |
| 745 | MDRV_CPU_PROGRAM_MAP(sound_map_a,0) | |
| 746 | MDRV_CPU_IO_MAP(sound_portmap_2,0) | |
| 820 | 747 | |
| 821 | 748 | MDRV_INTERLEAVE(10) |
| 822 | 749 | |
| r2418 | r2419 | |
| 854 | 781 | |
| 855 | 782 | /* basic machine hardware */ |
| 856 | 783 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 857 | MDRV_CPU_PROGRAM_MAP(butasan_ | |
| 784 | MDRV_CPU_PROGRAM_MAP(butasan_ | |
| 858 | 785 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) |
| 859 | 786 | |
| 860 | 787 | MDRV_CPU_ADD(Z80, 5000000) |
| 861 | /* audio CPU */ /* 5 MHz */ | |
| 862 | MDRV_CPU_PROGRAM_MAP(sound_readmem_b,sound_writemem_b) | |
| 863 | MDRV_CPU_IO_MAP(sound_readport_2,sound_writeport_2) | |
| 788 | MDRV_CPU_PROGRAM_MAP(sound_map_b,0) | |
| 789 | MDRV_CPU_IO_MAP(sound_portmap_2,0) | |
| 864 | 790 | |
| 865 | 791 | MDRV_INTERLEAVE(10) |
| 866 | 792 | |
| r2418 | r2419 | |
| 898 | 824 | |
| 899 | 825 | /* basic machine hardware */ |
| 900 | 826 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 901 | MDRV_CPU_PROGRAM_MAP(bombsa_ | |
| 827 | MDRV_CPU_PROGRAM_MAP(bombsa_ | |
| 902 | 828 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) |
| 903 | 829 | |
| 904 | MDRV_CPU_ADD(Z80, 12000000 / 2) | |
| 905 | /* audio CPU */ /* 6 MHz */ /* maybe CPU speeds are reversed? Probably not (ajg) */ | |
| 906 | MDRV_CPU_PROGRAM_MAP(sound_readmem_b,sound_writemem_c) | |
| 907 | MDRV_CPU_IO_MAP(sound_readport_2,sound_writeport_2) | |
| 830 | MDRV_CPU_ADD(Z80, 12000000 / 2) /* maybe CPU speeds are reversed? Probably not (ajg) */ | |
| 831 | MDRV_CPU_PROGRAM_MAP(sound_map_c,0) | |
| 832 | MDRV_CPU_IO_MAP(sound_portmap_2,0) | |
| 908 | 833 | |
| 909 | 834 | MDRV_INTERLEAVE(10) |
| 910 | 835 |
| r2418 | r2419 | |
|---|---|---|
| 202 | 202 | AM_RANGE(I8039_t1, I8039_t1) AM_RAM |
| 203 | 203 | AM_RANGE(I8039_p1, I8039_p1) AM_RAM AM_READWRITE(p1_r, p1_w) |
| 204 | 204 | AM_RANGE(I8039_p2, I8039_p2) AM_RAM AM_READWRITE(p2_r, p2_w) |
| 205 | AM_RANGE(I8039_p4, I8039_p4) AM_RAM | |
| 205 | AM_RANGE(I8039_p4, I8039_p4) AM_RAM | |
| 206 | 206 | AM_RANGE(I8039_bus, I8039_bus) AM_RAM AM_READWRITE(bus_r, bus_w) |
| 207 | 207 | ADDRESS_MAP_END |
| 208 | 208 |
| r2418 | r2419 | |
|---|---|---|
| 84 | 84 | static ADDRESS_MAP_START( lkage, ADDRESS_SPACE_PROGRAM, 8 ) |
| 85 | 85 | AM_RANGE(0x0000, 0xdfff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM) |
| 86 | 86 | AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) /* work ram */ |
| 87 | AM_RANGE(0xe800, 0xefff) AM_R | |
| 87 | AM_RANGE(0xe800, 0xefff) AM_R | |
| 88 | 88 | AM_RANGE(0xf000, 0xf003) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&lkage_vreg) /* video registers */ |
| 89 | 89 | AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w) |
| 90 | 90 | AM_RANGE(0xf061, 0xf061) AM_WRITE(SMH_NOP) |
| r2418 | r2419 | |
| 559 | 559 | |
| 560 | 560 | static DRIVER_INIT( lkageb ) |
| 561 | 561 | { |
| 562 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_r); | |
| 563 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf087, 0xf087, 0, 0, fake_status_r); | |
| 564 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_w ); | |
| 562 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_r); | |
| 563 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf087, 0xf087, 0, 0, fake_status_r); | |
| 564 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_w ); | |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | GAME( 1984, lkage, 0, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 217 | 217 | static ADDRESS_MAP_START( superdq_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 218 | 218 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 219 | 219 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 220 | AM_RANGE(0x5c00, 0x5fff) AM_RAM | |
| 220 | AM_RANGE(0x5c00, 0x5fff) AM_RAM | |
| 221 | 221 | ADDRESS_MAP_END |
| 222 | 222 | |
| 223 | 223 | static ADDRESS_MAP_START( superdq_io, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | static ADDRESS_MAP_START( goodejan_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 103 | 103 | AM_RANGE(0x00000, 0x0afff) AM_RAM |
| 104 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_WRITE(goodejan_bgvram_w) AM_BASE(&goodejan_bgvram) | |
| 105 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 106 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM AM_WRITE(goodejan_txvram_w) AM_BASE(&goodejan_txvram) | |
| 104 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(goodejan_bgvram_w) AM_BASE(&goodejan_bgvram) | |
| 105 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 106 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(goodejan_txvram_w) AM_BASE(&goodejan_txvram) | |
| 107 | 107 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_BASE(&spriteram16) |
| 108 | 108 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| 109 | 109 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 187 | 187 | static ADDRESS_MAP_START( bestleag_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 188 | 188 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 189 | 189 | AM_RANGE(0x0d2000, 0x0d3fff) AM_NOP // left over from the original game (only read / written in memory test) |
| 190 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_WRITE(bestleag_bgram_w) AM_BASE(&bestleag_bgram) | |
| 191 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM AM_WRITE(bestleag_fgram_w) AM_BASE(&bestleag_fgram) | |
| 192 | AM_RANGE(0x0f0000, 0x0f3fff) AM_RAM AM_WRITE(bestleag_txram_w) AM_BASE(&bestleag_txram) | |
| 190 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM_WRITE(bestleag_bgram_w) AM_BASE(&bestleag_bgram) | |
| 191 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM_WRITE(bestleag_fgram_w) AM_BASE(&bestleag_fgram) | |
| 192 | AM_RANGE(0x0f0000, 0x0f3fff) AM_RAM_WRITE(bestleag_txram_w) AM_BASE(&bestleag_txram) | |
| 193 | 193 | AM_RANGE(0x0f8000, 0x0f800b) AM_RAM AM_BASE(&bestleag_vregs) |
| 194 | AM_RANGE(0x100000, 0x100fff) AM_RAM | |
| 194 | AM_RANGE(0x100000, 0x100fff) AM_RAM | |
| 195 | 195 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 196 | 196 | AM_RANGE(0x300010, 0x300011) AM_READ(input_port_0_word_r) |
| 197 | 197 | AM_RANGE(0x300012, 0x300013) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 414 | 414 | static ADDRESS_MAP_START( drgnbowl_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 415 | 415 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 416 | 416 | AM_RANGE(0x060000, 0x063fff) AM_RAM |
| 417 | AM_RANGE(0x070000, 0x070fff) AM_READWRITE(SMH_RAM, gaiden_videoram_w) AM_BASE(&gaiden_videoram) | |
| 418 | AM_RANGE(0x072000, 0x073fff) AM_READWRITE(SMH_RAM, gaiden_videoram2_w) AM_BASE(&gaiden_videoram2) | |
| 419 | AM_RANGE(0x074000, 0x075fff) AM_READWRITE(SMH_RAM, gaiden_videoram3_w) AM_BASE(&gaiden_videoram3) | |
| 417 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(gaiden_videoram_w) AM_BASE(&gaiden_videoram) | |
| 418 | AM_RANGE(0x072000, 0x073fff) AM_RAM_WRITE(gaiden_videoram2_w) AM_BASE(&gaiden_videoram2) | |
| 419 | AM_RANGE(0x074000, 0x075fff) AM_RAM_WRITE(gaiden_videoram3_w) AM_BASE(&gaiden_videoram3) | |
| 420 | 420 | AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 421 | AM_RANGE(0x078000, 0x079fff) AM_R | |
| 421 | AM_RANGE(0x078000, 0x079fff) AM_R | |
| 422 | 422 | AM_RANGE(0x07a000, 0x07a001) AM_READ(input_port_0_word_r) |
| 423 | 423 | AM_RANGE(0x07a002, 0x07a003) AM_READ(input_port_1_word_r) |
| 424 | 424 | AM_RANGE(0x07a004, 0x07a005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 1483 | 1483 | /* sprite size Y = sprite size X */ |
| 1484 | 1484 | gaiden_sprite_sizey = 0; |
| 1485 | 1485 | |
| 1486 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, wildfang_protection_r); | |
| 1487 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, wildfang_protection_w); | |
| 1486 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, wildfang_protection_r); | |
| 1487 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, wildfang_protection_w); | |
| 1488 | 1488 | } |
| 1489 | 1489 | |
| 1490 | 1490 | static DRIVER_INIT( raiga ) |
| r2418 | r2419 | |
| 1492 | 1492 | /* sprite size Y independent from sprite size X */ |
| 1493 | 1493 | gaiden_sprite_sizey = 2; |
| 1494 | 1494 | |
| 1495 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, raiga_protection_r); | |
| 1496 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, raiga_protection_w); | |
| 1495 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, raiga_protection_r); | |
| 1496 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, raiga_protection_w); | |
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | 1499 | static DRIVER_INIT( drgnbowl ) |
| r2418 | r2419 | |
|---|---|---|
| 475 | 475 | static ADDRESS_MAP_START( zaxxon_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 476 | 476 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 477 | 477 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 478 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x1c00) AM_RAM | |
| 478 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x1c00) AM_RAM | |
| 479 | 479 | AM_RANGE(0xa000, 0xa0ff) AM_MIRROR(0x1f00) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 480 | 480 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x18fc) AM_READ_PORT("SW00") |
| 481 | 481 | AM_RANGE(0xc001, 0xc001) AM_MIRROR(0x18fc) AM_READ_PORT("SW01") |
| r2418 | r2419 | |
| 498 | 498 | static ADDRESS_MAP_START( congo_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 499 | 499 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 500 | 500 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 501 | AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x1800) AM_RAM AM_WRITE(zaxxon_videoram_w) AM_BASE(&videoram) | |
| 502 | AM_RANGE(0xa400, 0xa7ff) AM_MIRROR(0x1800) AM_RAM AM_WRITE(congo_colorram_w) AM_BASE(&colorram) | |
| 501 | AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x1800) AM_RAM_WRITE(zaxxon_videoram_w) AM_BASE(&videoram) | |
| 502 | AM_RANGE(0xa400, 0xa7ff) AM_MIRROR(0x1800) AM_RAM_WRITE(congo_colorram_w) AM_BASE(&colorram) | |
| 503 | 503 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fc4) AM_READ_PORT("SW00") |
| 504 | 504 | AM_RANGE(0xc001, 0xc001) AM_MIRROR(0x1fc4) AM_READ_PORT("SW01") |
| 505 | 505 | AM_RANGE(0xc002, 0xc002) AM_MIRROR(0x1fc4) AM_READ_PORT("DSW02") |
| r2418 | r2419 | |
| 1457 | 1457 | DRIVER_INIT_CALL(zaxxon); |
| 1458 | 1458 | |
| 1459 | 1459 | /* additional input ports are wired */ |
| 1460 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04")); | |
| 1461 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc008, 0xc008, 0, 0x18f3, port_tag_to_handler8("SW08")); | |
| 1462 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00c, 0xc00c, 0, 0x18f3, port_tag_to_handler8("SW0C")); | |
| 1460 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04")); | |
| 1461 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc008, 0xc008, 0, 0x18f3, port_tag_to_handler8("SW08")); | |
| 1462 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00c, 0xc00c, 0, 0x18f3, port_tag_to_handler8("SW0C")); | |
| 1463 | 1463 | |
| 1464 | 1464 | /* unknown behavior expected here */ |
| 1465 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc80a, 0xc80a, 0, 0, razmataz_counter_r); | |
| 1465 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc80a, 0xc80a, 0, 0, razmataz_counter_r); | |
| 1466 | 1466 | |
| 1467 | 1467 | /* connect the universal sound board */ |
| 1468 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r); | |
| 1469 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_data_w); | |
| 1468 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r, sega_usb_data_w); | |
| 1470 | 1469 | |
| 1471 | 1470 | /* additional state saving */ |
| 1472 | 1471 | state_save_register_global_array(razmataz_dial_pos); |
| r2418 | r2419 | |
| 1480 | 1479 | DRIVER_INIT_CALL(zaxxon); |
| 1481 | 1480 | |
| 1482 | 1481 | /* connect the universal sound board */ |
| 1483 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r); | |
| 1484 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_data_w); | |
| 1482 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r, sega_usb_data_w); | |
| 1485 | 1483 | } |
| 1486 | 1484 | |
| 1487 | 1485 |
| r2418 | r2419 | |
|---|---|---|
| 286 | 286 | AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */ |
| 287 | 287 | AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */ |
| 288 | 288 | AM_RANGE(0xc000, 0xc002) AM_WRITE(SMH_RAM) AM_BASE(&shangkid_videoreg) |
| 289 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 289 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 290 | 290 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2) |
| 291 | 291 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3) |
| 292 | 292 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 307 | 307 | AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */ |
| 308 | 308 | AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */ |
| 309 | 309 | AM_RANGE(0xc000, 0xc002) AM_WRITE(SMH_RAM) AM_BASE(&shangkid_videoreg) |
| 310 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 310 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 311 | 311 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2) |
| 312 | 312 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3) |
| 313 | 313 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 327 | 327 | AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */ |
| 328 | 328 | AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */ |
| 329 | 329 | AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */ |
| 330 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 330 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 331 | 331 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2) |
| 332 | 332 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE(3) |
| 333 | 333 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 346 | 346 | AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */ |
| 347 | 347 | AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */ |
| 348 | 348 | AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */ |
| 349 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 349 | AM_RANGE(0xd000, 0xdfff) AM_R | |
| 350 | 350 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2) |
| 351 | 351 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE(3) |
| 352 | 352 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 1329 | 1329 | for (A = 0x6000;A < size;A++) |
| 1330 | 1330 | decrypt[A] = konami1_decodebyte(rom[A],A); |
| 1331 | 1331 | |
| 1332 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, SMH_NOP ); | |
| 1332 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, SMH_NOP ); | |
| 1333 | 1333 | } |
| 1334 | 1334 | |
| 1335 | 1335 | static DRIVER_INIT( mastkin ) |
| r2418 | r2419 | |
|---|---|---|
| 113 | 113 | static ADDRESS_MAP_START( fastfred_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 114 | 114 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 115 | 115 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 116 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x400) AM_READWRITE(SMH_RAM, fastfred_videoram_w) AM_BASE(&fastfred_videoram) | |
| 117 | AM_RANGE(0xd800, 0xd83f) AM_READWRITE(SMH_RAM, fastfred_attributes_w) AM_BASE(&fastfred_attributesram) | |
| 116 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x400) AM_RAM_WRITE(fastfred_videoram_w) AM_BASE(&fastfred_videoram) | |
| 117 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE(fastfred_attributes_w) AM_BASE(&fastfred_attributesram) | |
| 118 | 118 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(&fastfred_spriteram) AM_SIZE(&fastfred_spriteram_size) |
| 119 | 119 | AM_RANGE(0xd860, 0xdbff) AM_RAM // Unused, but initialized |
| 120 | 120 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(input_port_0_r, SMH_RAM) AM_BASE(&fastfred_background_color) |
| r2418 | r2419 | |
| 136 | 136 | static ADDRESS_MAP_START( jumpcoas_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 137 | 137 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 138 | 138 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 139 | AM_RANGE(0xd000, 0xd03f) AM_R | |
| 139 | AM_RANGE(0xd000, 0xd03f) AM_R | |
| 140 | 140 | AM_RANGE(0xd040, 0xd05f) AM_RAM AM_BASE(&fastfred_spriteram) AM_SIZE(&fastfred_spriteram_size) |
| 141 | 141 | AM_RANGE(0xd060, 0xd3ff) AM_RAM |
| 142 | AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_R | |
| 142 | AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_R | |
| 143 | 143 | AM_RANGE(0xe000, 0xe000) AM_WRITE(SMH_RAM) AM_BASE(&fastfred_background_color) |
| 144 | 144 | AM_RANGE(0xe800, 0xe800) AM_READ(input_port_0_r) |
| 145 | 145 | AM_RANGE(0xe801, 0xe801) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 166 | 166 | AM_RANGE(0x2000, 0x6fff) AM_ROM |
| 167 | 167 | AM_RANGE(0xb000, 0xb3ff) AM_RAM |
| 168 | 168 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 169 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(SMH_RAM, imago_fg_videoram_w) AM_BASE(&imago_fg_videoram) | |
| 170 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(SMH_RAM, fastfred_videoram_w) AM_BASE(&fastfred_videoram) | |
| 171 | AM_RANGE(0xd800, 0xd83f) AM_READWRITE(SMH_RAM, fastfred_attributes_w) AM_BASE(&fastfred_attributesram) | |
| 169 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(imago_fg_videoram_w) AM_BASE(&imago_fg_videoram) | |
| 170 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(fastfred_videoram_w) AM_BASE(&fastfred_videoram) | |
| 171 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE(fastfred_attributes_w) AM_BASE(&fastfred_attributesram) | |
| 172 | 172 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(&fastfred_spriteram) AM_SIZE(&fastfred_spriteram_size) |
| 173 | 173 | AM_RANGE(0xd860, 0xd8ff) AM_RAM // Unused, but initialized |
| 174 | 174 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r) |
| r2418 | r2419 | |
| 861 | 861 | |
| 862 | 862 | static DRIVER_INIT( flyboy ) |
| 863 | 863 | { |
| 864 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc085, 0xc099, 0, 0, flyboy_custom1_io_r); | |
| 865 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc8fb, 0xc900, 0, 0, flyboy_custom2_io_r); | |
| 864 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc085, 0xc099, 0, 0, flyboy_custom1_io_r); | |
| 865 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc8fb, 0xc900, 0, 0, flyboy_custom2_io_r); | |
| 866 | 866 | fastfred_hardware_type = 1; |
| 867 | 867 | } |
| 868 | 868 | |
| r2418 | r2419 | |
| 873 | 873 | |
| 874 | 874 | static DRIVER_INIT( fastfred ) |
| 875 | 875 | { |
| 876 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP ); | |
| 877 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, fastfred_custom_io_r); | |
| 876 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, fastfred_custom_io_r, SMH_NOP); | |
| 878 | 877 | fastfred_hardware_type = 1; |
| 879 | 878 | } |
| 880 | 879 | |
| 881 | 880 | static DRIVER_INIT( jumpcoas ) |
| 882 | 881 | { |
| 883 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP ); | |
| 884 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r); | |
| 882 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r, SMH_NOP); | |
| 885 | 883 | fastfred_hardware_type = 0; |
| 886 | 884 | } |
| 887 | 885 | |
| 888 | 886 | static DRIVER_INIT( boggy84 ) |
| 889 | 887 | { |
| 890 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP ); | |
| 891 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r); | |
| 888 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r, SMH_NOP); | |
| 892 | 889 | fastfred_hardware_type = 2; |
| 893 | 890 | } |
| 894 | 891 |
| r2418 | r2419 | |
|---|---|---|
| 477 | 477 | static ADDRESS_MAP_START( astrof_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 478 | 478 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM |
| 479 | 479 | AM_RANGE(0x2000, 0x3fff) AM_NOP |
| 480 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 480 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 481 | 481 | AM_RANGE(0x6000, 0x7fff) AM_NOP |
| 482 | 482 | AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP |
| 483 | 483 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color) |
| r2418 | r2419 | |
| 496 | 496 | static ADDRESS_MAP_START( spfghmk2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 497 | 497 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM |
| 498 | 498 | AM_RANGE(0x2000, 0x3fff) AM_NOP |
| 499 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 499 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 500 | 500 | AM_RANGE(0x6000, 0x7fff) AM_NOP |
| 501 | 501 | AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP |
| 502 | 502 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color) |
| r2418 | r2419 | |
| 515 | 515 | static ADDRESS_MAP_START( tomahawk_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 516 | 516 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM |
| 517 | 517 | AM_RANGE(0x2000, 0x3fff) AM_NOP |
| 518 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 518 | AM_RANGE(0x4000, 0x5fff) AM_RAM | |
| 519 | 519 | AM_RANGE(0x6000, 0x7fff) AM_NOP |
| 520 | 520 | AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP |
| 521 | 521 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color) |
| r2418 | r2419 | |
| 1178 | 1178 | rom[i] = prom[rom[i]]; |
| 1179 | 1179 | |
| 1180 | 1180 | /* set up protection handlers */ |
| 1181 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1182 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r); | |
| 1181 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1182 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r); | |
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | |
| r2418 | r2419 | |
| 1192 | 1192 | rom[i] = ~rom[i]; |
| 1193 | 1193 | |
| 1194 | 1194 | /* set up protection handlers */ |
| 1195 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1196 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, afire_coin_prot_r); | |
| 1195 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1196 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, afire_coin_prot_r); | |
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | |
| r2418 | r2419 | |
| 1206 | 1206 | rom[i] = ~rom[i]; |
| 1207 | 1207 | |
| 1208 | 1208 | /* set up protection handlers */ |
| 1209 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1210 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r); | |
| 1209 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r); | |
| 1210 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r); | |
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 |
| r2418 | r2419 | |
|---|---|---|
| 405 | 405 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 406 | 406 | AM_RANGE(0xdff0, 0xdff7) AM_RAM AM_BASE(&punchout_bigsprite1) |
| 407 | 407 | AM_RANGE(0xdff8, 0xdffc) AM_RAM AM_BASE(&punchout_bigsprite2) |
| 408 | AM_RANGE(0xdffd, 0xdffd) AM_READWRITE(SMH_RAM, punchout_palettebank_w) AM_BASE(&punchout_palettebank) | |
| 409 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(SMH_RAM, punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram) | |
| 410 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram) | |
| 411 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram) | |
| 408 | AM_RANGE(0xdffd, 0xdffd) AM_RAM_WRITE(punchout_palettebank_w) AM_BASE(&punchout_palettebank) | |
| 409 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram) | |
| 410 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram) | |
| 411 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram) | |
| 412 | 412 | AM_RANGE(0xf000, 0xf03f) AM_RAM AM_BASE(&punchout_botTilemap_scroll_ram) |
| 413 | AM_RANGE(0xf000, 0xffff) AM_R | |
| 413 | AM_RANGE(0xf000, 0xffff) AM_R | |
| 414 | 414 | ADDRESS_MAP_END |
| 415 | 415 | |
| 416 | 416 | |
| r2418 | r2419 | |
| 420 | 420 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 421 | 421 | AM_RANGE(0xdff0, 0xdff7) AM_RAM AM_BASE(&punchout_bigsprite1) |
| 422 | 422 | AM_RANGE(0xdff8, 0xdffc) AM_RAM AM_BASE(&punchout_bigsprite2) |
| 423 | AM_RANGE(0xdffd, 0xdffd) AM_READWRITE(SMH_RAM, punchout_palettebank_w) AM_BASE(&punchout_palettebank) | |
| 424 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(SMH_RAM, armwrest_fgTilemap_ram_w) AM_BASE(&armwrest_fgTilemap_ram) | |
| 425 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram) | |
| 426 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram) | |
| 427 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, punchout_botTilemap_ram_w) AM_BASE(&punchout_botTilemap_ram) | |
| 428 | AM_RANGE(0xf800, 0xffff) AM_READWRITE(SMH_RAM, punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram) | |
| 423 | AM_RANGE(0xdffd, 0xdffd) AM_RAM_WRITE(punchout_palettebank_w) AM_BASE(&punchout_palettebank) | |
| 424 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(armwrest_fgTilemap_ram_w) AM_BASE(&armwrest_fgTilemap_ram) | |
| 425 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram) | |
| 426 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram) | |
| 427 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(punchout_botTilemap_ram_w) AM_BASE(&punchout_botTilemap_ram) | |
| 428 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram) | |
| 429 | 429 | ADDRESS_MAP_END |
| 430 | 430 | |
| 431 | 431 |
| r2418 | r2419 | |
|---|---|---|
| 484 | 484 | { |
| 485 | 485 | offs_t start; |
| 486 | 486 | offs_t end; |
| 487 | read32_machine_func read; | |
| 488 | write32_machine_func write; | |
| 487 | read32_machine_func mread; | |
| 488 | write32_machine_func mwrite; | |
| 489 | read32_device_func dread; | |
| 490 | write32_device_func dwrite; | |
| 491 | const device_config *device; | |
| 489 | 492 | const char * rdname; |
| 490 | 493 | const char * wrname; |
| 491 | 494 | } dynamic[MAX_DYNAMIC_ADDRESSES]; |
| r2418 | r2419 | |
| 501 | 504 | |
| 502 | 505 | static void vblank_assert(int state); |
| 503 | 506 | static TIMER_CALLBACK( nile_timer_callback ); |
| 504 | static void ide_interrupt(int state); | |
| 505 | static void remap_dynamic_addresses(void); | |
| 507 | static void ide_interrupt(const device_config *device, int state); | |
| 508 | static void remap_dynamic_addresses(running_machine *machine); | |
| 506 | 509 | |
| 507 | 510 | |
| 508 | 511 | |
| r2418 | r2419 | |
| 595 | 598 | } |
| 596 | 599 | |
| 597 | 600 | /* reset subsystems */ |
| 598 | | |
| 601 | | |
| 599 | 602 | voodoo_reset(0); |
| 600 | 603 | smc91c94_reset(); |
| 601 | 604 | |
| r2418 | r2419 | |
| 772 | 775 | { |
| 773 | 776 | case 0x04: /* address register */ |
| 774 | 777 | pci_ide_regs[offset] &= 0xfffffff0; |
| 775 | remap_dynamic_addresses(); | |
| 778 | remap_dynamic_addresses(machine); | |
| 776 | 779 | break; |
| 777 | 780 | |
| 778 | 781 | case 0x05: /* address register */ |
| 779 | 782 | pci_ide_regs[offset] &= 0xfffffffc; |
| 780 | remap_dynamic_addresses(); | |
| 783 | remap_dynamic_addresses(machine); | |
| 781 | 784 | break; |
| 782 | 785 | |
| 783 | 786 | case 0x08: /* address register */ |
| 784 | 787 | pci_ide_regs[offset] &= 0xfffffff0; |
| 785 | remap_dynamic_addresses(); | |
| 788 | remap_dynamic_addresses(machine); | |
| 786 | 789 | break; |
| 787 | 790 | |
| 788 | 791 | case 0x14: /* interrupt pending */ |
| 789 | 792 | if (data & 4) |
| 790 | ide_interrupt(0); | |
| 793 | ide_interrupt(device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"), 0); | |
| 791 | 794 | break; |
| 792 | 795 | } |
| 793 | 796 | if (LOG_PCI) |
| r2418 | r2419 | |
| 845 | 848 | pci_3dfx_regs[offset] &= 0xff000000; |
| 846 | 849 | else |
| 847 | 850 | pci_3dfx_regs[offset] &= 0xfe000000; |
| 848 | remap_dynamic_addresses(); | |
| 851 | remap_dynamic_addresses(machine); | |
| 849 | 852 | break; |
| 850 | 853 | |
| 851 | 854 | case 0x05: /* address register */ |
| 852 | 855 | if (voodoo_type >= VOODOO_BANSHEE) |
| 853 | 856 | { |
| 854 | 857 | pci_3dfx_regs[offset] &= 0xfe000000; |
| 855 | remap_dynamic_addresses(); | |
| 858 | remap_dynamic_addresses(machine); | |
| 856 | 859 | } |
| 857 | 860 | break; |
| 858 | 861 | |
| r2418 | r2419 | |
| 860 | 863 | if (voodoo_type >= VOODOO_BANSHEE) |
| 861 | 864 | { |
| 862 | 865 | pci_3dfx_regs[offset] &= 0xffffff00; |
| 863 | remap_dynamic_addresses(); | |
| 866 | remap_dynamic_addresses(machine); | |
| 864 | 867 | } |
| 865 | 868 | break; |
| 866 | 869 | |
| r2418 | r2419 | |
| 868 | 871 | if (voodoo_type >= VOODOO_BANSHEE) |
| 869 | 872 | { |
| 870 | 873 | pci_3dfx_regs[offset] &= 0xffff0000; |
| 871 | remap_dynamic_addresses(); | |
| 874 | remap_dynamic_addresses(machine); | |
| 872 | 875 | } |
| 873 | 876 | break; |
| 874 | 877 | |
| r2418 | r2419 | |
| 1159 | 1162 | |
| 1160 | 1163 | case NREG_PCIINIT1+0: /* PCI master */ |
| 1161 | 1164 | if (((olddata & 0xe) == 0xa) != ((nile_regs[offset] & 0xe) == 0xa)) |
| 1162 | remap_dynamic_addresses(); | |
| 1165 | remap_dynamic_addresses(machine); | |
| 1163 | 1166 | logit = 0; |
| 1164 | 1167 | break; |
| 1165 | 1168 | |
| r2418 | r2419 | |
| 1247 | 1250 | case NREG_DCS8: |
| 1248 | 1251 | case NREG_PCIW0: |
| 1249 | 1252 | case NREG_PCIW1: |
| 1250 | remap_dynamic_addresses(); | |
| 1253 | remap_dynamic_addresses(machine); | |
| 1251 | 1254 | break; |
| 1252 | 1255 | } |
| 1253 | 1256 | |
| r2418 | r2419 | |
| 1263 | 1266 | * |
| 1264 | 1267 | *************************************/ |
| 1265 | 1268 | |
| 1266 | static void ide_interrupt(int state) | |
| 1269 | static void ide_interrupt(const device_config *device, int state) | |
| 1267 | 1270 | { |
| 1268 | 1271 | ide_irq_state = state; |
| 1269 | 1272 | if (state) |
| r2418 | r2419 | |
| 1273 | 1276 | update_nile_irqs(); |
| 1274 | 1277 | } |
| 1275 | 1278 | |
| 1276 | static const struct ide_interface ide_intf = | |
| 1277 | { | |
| 1278 | ide_interrupt | |
| 1279 | }; | |
| 1280 | 1279 | |
| 1281 | 1280 | |
| 1282 | ||
| 1283 | 1281 | /************************************* |
| 1284 | 1282 | * |
| 1285 | 1283 | * SIO interrupts |
| r2418 | r2419 | |
| 1480 | 1478 | } |
| 1481 | 1479 | |
| 1482 | 1480 | |
| 1483 | static READ32_HANDLER( ide_main_r ) | |
| 1481 | static READ32_DEVICE_HANDLER( ide_main_r ) | |
| 1484 | 1482 | { |
| 1485 | return ide_controller32_ | |
| 1483 | return ide_controller32_ | |
| 1486 | 1484 | } |
| 1487 | 1485 | |
| 1488 | 1486 | |
| 1489 | static WRITE32_HANDLER( ide_main_w ) | |
| 1487 | static WRITE32_DEVICE_HANDLER( ide_main_w ) | |
| 1490 | 1488 | { |
| 1491 | ide_controller32_ | |
| 1489 | ide_controller32_ | |
| 1492 | 1490 | } |
| 1493 | 1491 | |
| 1494 | 1492 | |
| 1495 | static READ32_HANDLER( ide_alt_r ) | |
| 1493 | static READ32_DEVICE_HANDLER( ide_alt_r ) | |
| 1496 | 1494 | { |
| 1497 | return ide_controller32_ | |
| 1495 | return ide_controller32_ | |
| 1498 | 1496 | } |
| 1499 | 1497 | |
| 1500 | 1498 | |
| 1501 | static WRITE32_HANDLER( ide_alt_w ) | |
| 1499 | static WRITE32_DEVICE_HANDLER( ide_alt_w ) | |
| 1502 | 1500 | { |
| 1503 | ide_controller32_ | |
| 1501 | ide_controller32_ | |
| 1504 | 1502 | } |
| 1505 | 1503 | |
| 1506 | 1504 | |
| r2418 | r2419 | |
| 1537 | 1535 | * |
| 1538 | 1536 | *************************************/ |
| 1539 | 1537 | |
| 1540 | #define add_dynamic_address(s,e,r,w) _add_dynamic_address(s,e,r,w,#r,#w) | |
| 1538 | #define add_dynamic_address(s,e,r,w) _add_dynamic_address(s,e,r,w,#r,#w) | |
| 1539 | #define add_dynamic_device_address(d,s,e,r,w) _add_dynamic_device_address(d,s,e,r,w,#r,#w) | |
| 1541 | 1540 | |
| 1542 | 1541 | INLINE void _add_dynamic_address(offs_t start, offs_t end, read32_machine_func read, write32_machine_func write, const char *rdname, const char *wrname) |
| 1543 | 1542 | { |
| 1544 | 1543 | dynamic[dynamic_count].start = start; |
| 1545 | 1544 | dynamic[dynamic_count].end = end; |
| 1546 | dynamic[dynamic_count].read = read; | |
| 1547 | dynamic[dynamic_count].write = write; | |
| 1545 | dynamic[dynamic_count].mread = read; | |
| 1546 | dynamic[dynamic_count].mwrite = write; | |
| 1547 | dynamic[dynamic_count].dread = NULL; | |
| 1548 | dynamic[dynamic_count].dwrite = NULL; | |
| 1549 | dynamic[dynamic_count].device = NULL; | |
| 1548 | 1550 | dynamic[dynamic_count].rdname = rdname; |
| 1549 | 1551 | dynamic[dynamic_count].wrname = wrname; |
| 1550 | 1552 | dynamic_count++; |
| 1551 | 1553 | } |
| 1552 | 1554 | |
| 1555 | INLINE void _add_dynamic_device_address(const device_config *device, offs_t start, offs_t end, read32_device_func read, write32_device_func write, const char *rdname, const char *wrname) | |
| 1556 | { | |
| 1557 | dynamic[dynamic_count].start = start; | |
| 1558 | dynamic[dynamic_count].end = end; | |
| 1559 | dynamic[dynamic_count].mread = NULL; | |
| 1560 | dynamic[dynamic_count].mwrite = NULL; | |
| 1561 | dynamic[dynamic_count].dread = read; | |
| 1562 | dynamic[dynamic_count].dwrite = write; | |
| 1563 | dynamic[dynamic_count].device = device; | |
| 1564 | dynamic[dynamic_count].rdname = rdname; | |
| 1565 | dynamic[dynamic_count].wrname = wrname; | |
| 1566 | dynamic_count++; | |
| 1567 | } | |
| 1553 | 1568 | |
| 1554 | static void remap_dynamic_addresses(void) | |
| 1569 | ||
| 1570 | static void remap_dynamic_addresses(running_machine *machine) | |
| 1555 | 1571 | { |
| 1572 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 1556 | 1573 | offs_t base; |
| 1557 | 1574 | int addr; |
| 1558 | 1575 | |
| 1559 | 1576 | /* unmap everything we know about */ |
| 1560 | 1577 | for (addr = 0; addr < dynamic_count; addr++) |
| 1561 | { | |
| 1562 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_NOP); | |
| 1563 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_NOP); | |
| 1564 | } | |
| 1578 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1565 | 1579 | |
| 1566 | 1580 | /* the build the list of stuff */ |
| 1567 | 1581 | dynamic_count = 0; |
| r2418 | r2419 | |
| 1639 | 1653 | /* IDE controller */ |
| 1640 | 1654 | base = pci_ide_regs[0x04] & 0xfffffff0; |
| 1641 | 1655 | if (base >= ramsize && base < 0x20000000) |
| 1642 | add_dynamic_address(base + 0x0000, base + 0x000f, ide_main_r, ide_main_w); | |
| 1656 | add_dynamic_device_address(ide, base + 0x0000, base + 0x000f, ide_main_r, ide_main_w); | |
| 1643 | 1657 | |
| 1644 | 1658 | base = pci_ide_regs[0x05] & 0xfffffffc; |
| 1645 | 1659 | if (base >= ramsize && base < 0x20000000) |
| 1646 | add_dynamic_address(base + 0x0000, base + 0x0003, ide_alt_r, ide_alt_w); | |
| 1660 | add_dynamic_device_address(ide, base + 0x0000, base + 0x0003, ide_alt_r, ide_alt_w); | |
| 1647 | 1661 | |
| 1648 | 1662 | base = pci_ide_regs[0x08] & 0xfffffff0; |
| 1649 | 1663 | if (base >= ramsize && base < 0x20000000) |
| 1650 | add_dynamic_address(base + 0x0000, base + 0x0007, ide_bus_master32_ | |
| 1664 | add_dynamic_device_address(ide, base + 0x0000, base + 0x0007, ide_bus_master32_ | |
| 1651 | 1665 | |
| 1652 | 1666 | /* 3dfx card */ |
| 1653 | 1667 | base = pci_3dfx_regs[0x04] & 0xfffffff0; |
| r2418 | r2419 | |
| 1680 | 1694 | for (addr = 0; addr < dynamic_count; addr++) |
| 1681 | 1695 | { |
| 1682 | 1696 | if (LOG_DYNAMIC) logerror(" installing: %08X-%08X %s,%s\n", dynamic[addr].start, dynamic[addr].end, dynamic[addr].rdname, dynamic[addr].wrname); |
| 1683 | if (dynamic[addr].read) | |
| 1684 | _memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].read, dynamic[addr].wrname); | |
| 1685 | if (dynamic[addr].write) | |
| 1686 | _memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].write, dynamic[addr].wrname); | |
| 1697 | if (dynamic[addr].mread != NULL || dynamic[addr].mwrite != NULL) | |
| 1698 | _memory_install_handler32(machine, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mread, dynamic[addr].mwrite, dynamic[addr].rdname, dynamic[addr].wrname); | |
| 1699 | if (dynamic[addr].dread != NULL || dynamic[addr].dwrite != NULL) | |
| 1700 | _memory_install_device_handler32(dynamic[addr].device, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].dread, dynamic[addr].dwrite, dynamic[addr].rdname, dynamic[addr].wrname); | |
| 1687 | 1701 | } |
| 1688 | 1702 | |
| 1689 | 1703 | if (LOG_DYNAMIC) |
| r2418 | r2419 | |
| 2221 | 2235 | MDRV_MACHINE_RESET(vegas) |
| 2222 | 2236 | MDRV_NVRAM_HANDLER(timekeeper_save) |
| 2223 | 2237 | |
| 2238 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 2239 | ||
| 2224 | 2240 | /* video hardware */ |
| 2225 | 2241 | MDRV_SCREEN_ADD("main", RASTER) |
| 2226 | 2242 | MDRV_SCREEN_REFRESH_RATE(57) |
| r2418 | r2419 | |
| 2438 | 2454 | * |
| 2439 | 2455 | *************************************/ |
| 2440 | 2456 | |
| 2441 | static void init_common(int ioasic, int serialnum) | |
| 2457 | static void init_common(running_machine *machine, int ioasic, int serialnum) | |
| 2442 | 2458 | { |
| 2443 | 2459 | static const struct smc91c9x_interface ethernet_intf = |
| 2444 | 2460 | { |
| r2418 | r2419 | |
| 2446 | 2462 | }; |
| 2447 | 2463 | |
| 2448 | 2464 | /* initialize the subsystems */ |
| 2449 | ide_controller_init(0, &ide_intf); | |
| 2450 | 2465 | midway_ioasic_init(ioasic, serialnum, 80, ioasic_irq); |
| 2451 | 2466 | midway_ioasic_set_auto_ack(1); |
| 2452 | 2467 | smc91c94_init(ðernet_intf); |
| r2418 | r2419 | |
| 2470 | 2485 | |
| 2471 | 2486 | static DRIVER_INIT( gauntleg ) |
| 2472 | 2487 | { |
| 2473 | dcs2_init(4, 0x0b5d); | |
| 2474 | init_common(MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */); | |
| 2488 | dcs2_init(machine, 4, 0x0b5d); | |
| 2489 | init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */); | |
| 2475 | 2490 | |
| 2476 | 2491 | /* speedups */ |
| 2477 | 2492 | add_speedup(0x80015430, 0x8CC38060); /* confirmed */ |
| r2418 | r2419 | |
| 2483 | 2498 | |
| 2484 | 2499 | static DRIVER_INIT( gauntdl ) |
| 2485 | 2500 | { |
| 2486 | dcs2_init(4, 0x0b5d); | |
| 2487 | init_common(MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */); | |
| 2501 | dcs2_init(machine, 4, 0x0b5d); | |
| 2502 | init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */); | |
| 2488 | 2503 | |
| 2489 | 2504 | /* speedups */ |
| 2490 | 2505 | add_speedup(0x800158B8, 0x8CC3CC40); /* confirmed */ |
| r2418 | r2419 | |
| 2496 | 2511 | |
| 2497 | 2512 | static DRIVER_INIT( warfa ) |
| 2498 | 2513 | { |
| 2499 | dcs2_init(4, 0x0b5d); | |
| 2500 | init_common(MIDWAY_IOASIC_MACE, 337/* others? */); | |
| 2514 | dcs2_init(machine, 4, 0x0b5d); | |
| 2515 | init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */); | |
| 2501 | 2516 | |
| 2502 | 2517 | /* speedups */ |
| 2503 | 2518 | add_speedup(0x8009436C, 0x0C031663); /* confirmed */ |
| r2418 | r2419 | |
| 2506 | 2521 | |
| 2507 | 2522 | static DRIVER_INIT( tenthdeg ) |
| 2508 | 2523 | { |
| 2509 | dcs2_init(4, 0x0afb); | |
| 2510 | init_common(MIDWAY_IOASIC_GAUNTDL, 330/* others? */); | |
| 2524 | dcs2_init(machine, 4, 0x0afb); | |
| 2525 | init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */); | |
| 2511 | 2526 | |
| 2512 | 2527 | /* speedups */ |
| 2513 | 2528 | add_speedup(0x80051CD8, 0x0C023C15); /* confirmed */ |
| r2418 | r2419 | |
| 2519 | 2534 | |
| 2520 | 2535 | static DRIVER_INIT( roadburn ) |
| 2521 | 2536 | { |
| 2522 | dcs2_init(4, 0); /* no place to hook :-( */ | |
| 2523 | init_common(MIDWAY_IOASIC_STANDARD, 325/* others? */); | |
| 2537 | dcs2_init(machine, 4, 0); /* no place to hook :-( */ | |
| 2538 | init_common(machine, MIDWAY_IOASIC_STANDARD, 325/* others? */); | |
| 2524 | 2539 | } |
| 2525 | 2540 | |
| 2526 | 2541 | |
| 2527 | 2542 | static DRIVER_INIT( nbashowt ) |
| 2528 | 2543 | { |
| 2529 | dcs2_init(4, 0); | |
| 2530 | init_common(MIDWAY_IOASIC_MACE, 528/* or 478 or 487 */); | |
| 2544 | dcs2_init(machine, 4, 0); | |
| 2545 | init_common(machine, MIDWAY_IOASIC_MACE, 528/* or 478 or 487 */); | |
| 2531 | 2546 | } |
| 2532 | 2547 | |
| 2533 | 2548 | |
| 2534 | 2549 | static DRIVER_INIT( nbanfl ) |
| 2535 | 2550 | { |
| 2536 | dcs2_init(4, 0); | |
| 2537 | init_common(MIDWAY_IOASIC_BLITZ99, 498/* or 478 or 487 */); | |
| 2551 | dcs2_init(machine, 4, 0); | |
| 2552 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 498/* or 478 or 487 */); | |
| 2538 | 2553 | /* NOT: MACE */ |
| 2539 | 2554 | } |
| 2540 | 2555 | |
| 2541 | 2556 | |
| 2542 | 2557 | static DRIVER_INIT( sf2049 ) |
| 2543 | 2558 | { |
| 2544 | dcs2_init(8, 0); | |
| 2545 | init_common(MIDWAY_IOASIC_STANDARD, 336/* others? */); | |
| 2559 | dcs2_init(machine, 8, 0); | |
| 2560 | init_common(machine, MIDWAY_IOASIC_STANDARD, 336/* others? */); | |
| 2546 | 2561 | } |
| 2547 | 2562 | |
| 2548 | 2563 | |
| 2549 | 2564 | static DRIVER_INIT( sf2049se ) |
| 2550 | 2565 | { |
| 2551 | dcs2_init(8, 0); | |
| 2552 | init_common(MIDWAY_IOASIC_SFRUSHRK, 336/* others? */); | |
| 2566 | dcs2_init(machine, 8, 0); | |
| 2567 | init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 336/* others? */); | |
| 2553 | 2568 | } |
| 2554 | 2569 | |
| 2555 | 2570 | |
| 2556 | 2571 | static DRIVER_INIT( sf2049te ) |
| 2557 | 2572 | { |
| 2558 | dcs2_init(8, 0); | |
| 2559 | init_common(MIDWAY_IOASIC_SFRUSHRK, 348/* others? */); | |
| 2573 | dcs2_init(machine, 8, 0); | |
| 2574 | init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 348/* others? */); | |
| 2560 | 2575 | } |
| 2561 | 2576 | |
| 2562 | 2577 | |
| 2563 | 2578 | static DRIVER_INIT( cartfury ) |
| 2564 | 2579 | { |
| 2565 | dcs2_init(4, 0); | |
| 2566 | init_common(MIDWAY_IOASIC_CARNEVIL, 495/* others? */); | |
| 2580 | dcs2_init(machine, 4, 0); | |
| 2581 | init_common(machine, MIDWAY_IOASIC_CARNEVIL, 495/* others? */); | |
| 2567 | 2582 | } |
| 2568 | 2583 | |
| 2569 | 2584 |
| r2418 | r2419 | |
|---|---|---|
| 64 | 64 | static ADDRESS_MAP_START( kopunch_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 65 | 65 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 66 | 66 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 67 | AM_RANGE(0x6000, 0x63ff) AM_RAM AM_WRITE(kopunch_videoram_w) AM_BASE(&videoram) | |
| 68 | AM_RANGE(0x7000, 0x70ff) AM_RAM AM_WRITE(kopunch_videoram2_w) AM_BASE(&kopunch_videoram2) | |
| 67 | AM_RANGE(0x6000, 0x63ff) AM_RAM_WRITE(kopunch_videoram_w) AM_BASE(&videoram) | |
| 68 | AM_RANGE(0x7000, 0x70ff) AM_RAM_WRITE(kopunch_videoram2_w) AM_BASE(&kopunch_videoram2) | |
| 69 | 69 | AM_RANGE(0x7100, 0x7aff) AM_RAM // ??? |
| 70 | 70 | ADDRESS_MAP_END |
| 71 | 71 |
| r2418 | r2419 | |
|---|---|---|
| 429 | 429 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE(1) |
| 430 | 430 | AM_RANGE(0x180000, 0x1807ff) AM_MIRROR(0x007800) AM_RAM AM_BASE(&segaic16_rotateram_0) |
| 431 | 431 | AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 432 | AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_R | |
| 432 | AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_R | |
| 433 | 433 | AM_RANGE(0x198000, 0x19ffff) AM_READ(segaic16_rotate_control_0_r) |
| 434 | 434 | AM_RANGE(0x1f0000, 0x1fffff) AM_RAM |
| 435 | 435 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 166 | 166 | AM_RANGE(0x105002, 0x105003) AM_READ(input_port_1_word_r) |
| 167 | 167 | AM_RANGE(0x106000, 0x106001) AM_READWRITE(adpcm_r, adpcm_w) |
| 168 | 168 | AM_RANGE(0x107000, 0x107007) AM_NOP |
| 169 | AM_RANGE(0x3e0000, 0x3e087f) AM_R | |
| 169 | AM_RANGE(0x3e0000, 0x3e087f) AM_R | |
| 170 | 170 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(shuuz_atarivc_r, shuuz_atarivc_w) AM_BASE(&atarivc_data) |
| 171 | AM_RANGE(0x3f4000, 0x3f5eff) AM_R | |
| 171 | AM_RANGE(0x3f4000, 0x3f5eff) AM_R | |
| 172 | 172 | AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_BASE(&atarivc_eof_data) |
| 173 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE(SMH_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 174 | AM_RANGE(0x3f6000, 0x3f7fff) AM_READWRITE(SMH_RAM, atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 173 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_RAM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 174 | AM_RANGE(0x3f6000, 0x3f7fff) AM_RAM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 175 | 175 | AM_RANGE(0x3f8000, 0x3fcfff) AM_RAM |
| 176 | AM_RANGE(0x3fd000, 0x3fd3ff) AM_R | |
| 176 | AM_RANGE(0x3fd000, 0x3fd3ff) AM_R | |
| 177 | 177 | AM_RANGE(0x3fd400, 0x3fffff) AM_RAM |
| 178 | 178 | ADDRESS_MAP_END |
| 179 | 179 |
| r2418 | r2419 | |
|---|---|---|
| 276 | 276 | AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram) |
| 277 | 277 | AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control) |
| 278 | 278 | AM_RANGE(0x9800, 0x9bff) AM_RAM /* not used, but initialized */ |
| 279 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 279 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 280 | 280 | AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w) |
| 281 | 281 | AM_RANGE(0xa001, 0xa002) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_flip_screen) |
| 282 | 282 | AM_RANGE(0xa003, 0xa003) AM_WRITE(interrupt_enable_w) //used by Crazy Kong Bootleg with alt levels and speed up |
| r2418 | r2419 | |
| 300 | 300 | AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram) |
| 301 | 301 | AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control) |
| 302 | 302 | AM_RANGE(0x9800, 0x9bff) AM_RAM /* not used, but initialized */ |
| 303 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 303 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 304 | 304 | AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w) |
| 305 | 305 | AM_RANGE(0xa001, 0xa002) AM_WRITE(cannonb_flip_screen_w) AM_BASE(&cclimber_flip_screen) |
| 306 | 306 | AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w) |
| r2418 | r2419 | |
| 317 | 317 | AM_RANGE(0x9800, 0x981f) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_column_scroll) |
| 318 | 318 | AM_RANGE(0x9880, 0x989f) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_spriteram) |
| 319 | 319 | AM_RANGE(0x98fc, 0x98ff) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_bigsprite_control) |
| 320 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 320 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 321 | 321 | AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w) |
| 322 | 322 | AM_RANGE(0xa001, 0xa002) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_flip_screen) |
| 323 | 323 | AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&swimmer_side_background_enabled) |
| r2418 | r2419 | |
| 343 | 343 | AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram) |
| 344 | 344 | AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control) |
| 345 | 345 | AM_RANGE(0x9800, 0x9bff) AM_RAM /* not used, but initialized */ |
| 346 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 346 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 347 | 347 | AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w) |
| 348 | 348 | AM_RANGE(0xa001, 0xa002) AM_WRITE(SMH_RAM) AM_BASE(&cclimber_flip_screen) |
| 349 | 349 | AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 108 | 108 | AM_RANGE(0xa00008, 0xa00009) AM_WRITE(eeprom_chip_select_w) |
| 109 | 109 | AM_RANGE(0xa0000a, 0xa0000b) AM_WRITE(eeprom_serial_clock_w) |
| 110 | 110 | AM_RANGE(0xa0000c, 0xa0000d) AM_WRITE(eeprom_data_w) |
| 111 | AM_RANGE(0xffc000, 0xffc7ff) AM_RAM | |
| 111 | AM_RANGE(0xffc000, 0xffc7ff) AM_RAM | |
| 112 | 112 | AM_RANGE(0xffc800, 0xffc87f) AM_RAM AM_BASE(&spriteram16) |
| 113 | 113 | AM_RANGE(0xffc880, 0xffc881) AM_WRITENOP |
| 114 | 114 | AM_RANGE(0xffc882, 0xffc883) AM_WRITENOP |
| r2418 | r2419 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | |
| 144 | static void outrun_generic_init( | |
| 144 | static void outrun_generic_init(running_machine *machine) | |
| 145 | 145 | { |
| 146 | 146 | /* allocate memory for regions not automatically assigned */ |
| 147 | 147 | segaic16_spriteram_0 = auto_malloc(0x01000); |
| r2418 | r2419 | |
| 151 | 151 | workram = auto_malloc(0x08000); |
| 152 | 152 | |
| 153 | 153 | /* init the memory mapper */ |
| 154 | segaic16_memory_mapper_init(0, outrun_info, sound_data_w, NULL); | |
| 154 | segaic16_memory_mapper_init(machine, 0, outrun_info, sound_data_w, NULL); | |
| 155 | 155 | |
| 156 | 156 | /* init the FD1094 */ |
| 157 | 157 | fd1094_driver_init(segaic16_memory_mapper_set_decrypted); |
| r2418 | r2419 | |
| 267 | 267 | fd1094_machine_init(); |
| 268 | 268 | |
| 269 | 269 | /* reset misc components */ |
| 270 | segaic16_memory_mapper_reset(); | |
| 270 | segaic16_memory_mapper_reset(machine); | |
| 271 | 271 | if (custom_map) |
| 272 | segaic16_memory_mapper_config(custom_map); | |
| 272 | segaic16_memory_mapper_config(machine, custom_map); | |
| 273 | 273 | segaic16_tilemap_reset(0); |
| 274 | 274 | |
| 275 | 275 | /* hook the RESET line, which resets CPU #1 */ |
| r2418 | r2419 | |
| 1677 | 1677 | |
| 1678 | 1678 | static DRIVER_INIT( outrun ) |
| 1679 | 1679 | { |
| 1680 | outrun_generic_init(); | |
| 1680 | outrun_generic_init(machine); | |
| 1681 | 1681 | custom_io_r = outrun_custom_io_r; |
| 1682 | 1682 | custom_io_w = outrun_custom_io_w; |
| 1683 | 1683 | } |
| r2418 | r2419 | |
| 1690 | 1690 | UINT8 *byte; |
| 1691 | 1691 | int i, length; |
| 1692 | 1692 | |
| 1693 | outrun_generic_init(); | |
| 1693 | outrun_generic_init(machine); | |
| 1694 | 1694 | custom_map = memory_map; |
| 1695 | 1695 | custom_io_r = outrun_custom_io_r; |
| 1696 | 1696 | custom_io_w = outrun_custom_io_w; |
| r2418 | r2419 | |
| 1728 | 1728 | |
| 1729 | 1729 | static DRIVER_INIT( shangon ) |
| 1730 | 1730 | { |
| 1731 | outrun_generic_init(); | |
| 1731 | outrun_generic_init(machine); | |
| 1732 | 1732 | custom_io_r = shangon_custom_io_r; |
| 1733 | 1733 | custom_io_w = shangon_custom_io_w; |
| 1734 | 1734 | } |
| r2418 | r2419 | |
| 1737 | 1737 | static DRIVER_INIT( shangon3 ) |
| 1738 | 1738 | { |
| 1739 | 1739 | extern void fd1089_decrypt_0034(void); |
| 1740 | outrun_generic_init(); | |
| 1740 | outrun_generic_init(machine); | |
| 1741 | 1741 | fd1089_decrypt_0034(); |
| 1742 | 1742 | custom_io_r = shangon_custom_io_r; |
| 1743 | 1743 | custom_io_w = shangon_custom_io_w; |
| r2418 | r2419 | |
|---|---|---|
| 474 | 474 | static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 475 | 475 | AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram) /* Work RAM */ |
| 476 | 476 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 477 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_R | |
| 477 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_R | |
| 478 | 478 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 479 | 479 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 480 | 480 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) |
| r2418 | r2419 | |
|---|---|---|
| 169 | 169 | |
| 170 | 170 | static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 171 | 171 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 172 | AM_RANGE(0x0400, 0x07ff) AM_R | |
| 172 | AM_RANGE(0x0400, 0x07ff) AM_R | |
| 173 | 173 | AM_RANGE(0x0800, 0x0fff) AM_RAM AM_SHARE(1) |
| 174 | 174 | AM_RANGE(0x1000, 0x100f) AM_READWRITE(pokey1_r, pokey1_w) /* DSW0 also */ |
| 175 | 175 | // AM_RANGE(0x1008, 0x1008) AM_READ(SMH_RAM) |
| r2418 | r2419 | |
|---|---|---|
| 240 | 240 | AM_RANGE(0x014000, 0x014fff) AM_MIRROR(0x3e3000) AM_RAM |
| 241 | 241 | AM_RANGE(0x018000, 0x018fff) AM_MIRROR(0x3e3000) AM_RAM |
| 242 | 242 | AM_RANGE(0x01c000, 0x01c0ff) AM_MIRROR(0x3e3f00) AM_RAM AM_BASE(&spriteram16) |
| 243 | AM_RANGE(0x800000, 0x8007ff) AM_MIRROR(0x03f800) AM_R | |
| 243 | AM_RANGE(0x800000, 0x8007ff) AM_MIRROR(0x03f800) AM_R | |
| 244 | 244 | AM_RANGE(0x900000, 0x9001ff) AM_MIRROR(0x03fe00) AM_READWRITE(nvram_r, SMH_RAM) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 245 | 245 | AM_RANGE(0x940000, 0x940007) AM_MIRROR(0x023ff8) AM_READ(analog_r) |
| 246 | 246 | AM_RANGE(0x944000, 0x944007) AM_MIRROR(0x023ff8) AM_WRITE(analog_w) |
| r2418 | r2419 | |
|---|---|---|
| 87 | 87 | AM_RANGE(0x102c, 0x102d) AM_WRITE(bsktball_noise_reset_w) /* Noise Reset */ |
| 88 | 88 | AM_RANGE(0x102e, 0x102f) AM_WRITE(bsktball_nmion_w) /* NMI On */ |
| 89 | 89 | AM_RANGE(0x1030, 0x1030) AM_WRITE(bsktball_note_w) /* Music Ckt Note Dvsr */ |
| 90 | AM_RANGE(0x1800, 0x1bbf) AM_R | |
| 90 | AM_RANGE(0x1800, 0x1bbf) AM_R | |
| 91 | 91 | AM_RANGE(0x1bc0, 0x1bff) AM_RAM AM_BASE(&bsktball_motion) |
| 92 | 92 | AM_RANGE(0x1c00, 0x1cff) AM_RAM |
| 93 | 93 | AM_RANGE(0x2000, 0x3fff) AM_ROM /* PROGRAM */ |
| r2418 | r2419 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | |
| 250 | static ADDRESS_MAP_START( terraf_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 251 | AM_RANGE(0x000000, 0x04ffff) AM_READ(SMH_ROM) | |
| 252 | AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM) | |
| 253 | AM_RANGE(0x064000, 0x064fff) AM_READ(SMH_RAM) | |
| 254 | AM_RANGE(0x068000, 0x069fff) AM_READ(SMH_RAM) | |
| 255 | AM_RANGE(0x06a000, 0x06a9ff) AM_READ(SMH_RAM) | |
| 256 | AM_RANGE(0x06C000, 0x06C9ff) AM_READ(SMH_RAM) | |
| 257 | AM_RANGE(0x070000, 0x070fff) AM_READ(SMH_RAM) | |
| 258 | AM_RANGE(0x074000, 0x074fff) AM_READ(SMH_RAM) | |
| 250 | static ADDRESS_MAP_START( terraf_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 251 | AM_RANGE(0x000000, 0x04ffff) AM_ROM | |
| 252 | AM_RANGE(0x060000, 0x0603ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 253 | AM_RANGE(0x060400, 0x063fff) AM_RAM | |
| 254 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 255 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 256 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM | |
| 257 | AM_RANGE(0x06c000, 0x06c9ff) AM_RAM | |
| 258 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 259 | AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 259 | 260 | AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) |
| 260 | 261 | AM_RANGE(0x078002, 0x078003) AM_READ(input_port_1_word_r) |
| 261 | 262 | AM_RANGE(0x078004, 0x078005) AM_READ(input_port_2_word_r) |
| 262 | 263 | AM_RANGE(0x078006, 0x078007) AM_READ(input_port_3_word_r) |
| 263 | ADDRESS_MAP_END | |
| 264 | ||
| 265 | static ADDRESS_MAP_START( terraf_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 266 | AM_RANGE(0x000000, 0x04ffff) AM_WRITE(SMH_ROM) | |
| 267 | AM_RANGE(0x060000, 0x0603ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 268 | AM_RANGE(0x060400, 0x063fff) AM_WRITE(SMH_RAM) | |
| 269 | AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 270 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 271 | AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(SMH_RAM) | |
| 272 | AM_RANGE(0x06C000, 0x06C9ff) AM_WRITE(SMH_RAM) | |
| 273 | AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 274 | AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 275 | 264 | AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) |
| 276 | 265 | AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) |
| 277 | 266 | AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 283 | 272 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(terraf_fg_scroll_msb_arm_w) /* written between two consecutive writes to 7c008 */ |
| 284 | 273 | ADDRESS_MAP_END |
| 285 | 274 | |
| 286 | static ADDRESS_MAP_START( kodure_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 287 | AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM) | |
| 288 | AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM) | |
| 289 | AM_RANGE(0x064000, 0x064fff) AM_READ(SMH_RAM) | |
| 290 | AM_RANGE(0x068000, 0x069fff) AM_READ(SMH_RAM) | |
| 291 | AM_RANGE(0x06a000, 0x06a9ff) AM_READ(SMH_RAM) | |
| 292 | AM_RANGE(0x06C000, 0x06C9ff) AM_READ(SMH_RAM) | |
| 293 | AM_RANGE(0x070000, 0x070fff) AM_READ(SMH_RAM) | |
| 294 | AM_RANGE(0x074000, 0x074fff) AM_READ(SMH_RAM) | |
| 275 | static ADDRESS_MAP_START( kodure_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 276 | AM_RANGE(0x000000, 0x05ffff) AM_ROM | |
| 277 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 278 | AM_RANGE(0x061000, 0x063fff) AM_RAM | |
| 279 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 280 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 281 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM | |
| 282 | AM_RANGE(0x06c000, 0x06c9ff) AM_RAM | |
| 283 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 284 | AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 295 | 285 | AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) |
| 296 | 286 | AM_RANGE(0x078002, 0x078003) AM_READ(input_port_1_word_r) |
| 297 | 287 | AM_RANGE(0x078004, 0x078005) AM_READ(input_port_2_word_r) |
| 298 | 288 | AM_RANGE(0x078006, 0x078007) AM_READ(input_port_3_word_r) |
| 299 | ADDRESS_MAP_END | |
| 300 | ||
| 301 | static ADDRESS_MAP_START( kodure_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 302 | AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM) | |
| 303 | AM_RANGE(0x060000, 0x060fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 304 | AM_RANGE(0x061000, 0x063fff) AM_WRITE(SMH_RAM) | |
| 305 | AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 306 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 307 | AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(SMH_RAM) | |
| 308 | AM_RANGE(0x06C000, 0x06C9ff) AM_WRITE(SMH_RAM) | |
| 309 | AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 310 | AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 311 | 289 | AM_RANGE(0x07c000, 0x07c001) AM_WRITE(kodure_io_w) |
| 312 | 290 | AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) |
| 313 | 291 | AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 316 | 294 | AM_RANGE(0xffd000, 0xffd001) AM_WRITE(SMH_NOP) /* ? */ |
| 317 | 295 | ADDRESS_MAP_END |
| 318 | 296 | |
| 319 | static ADDRESS_MAP_START( cclimbr2_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 320 | AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM) | |
| 321 | AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM) | |
| 322 | AM_RANGE(0x064000, 0x064fff) AM_READ(SMH_RAM) | |
| 323 | AM_RANGE(0x068000, 0x069fff) AM_READ(SMH_RAM) | |
| 324 | AM_RANGE(0x06a000, 0x06a9ff) AM_READ(SMH_RAM) | |
| 325 | AM_RANGE(0x06c000, 0x06c9ff) AM_READ(SMH_RAM) | |
| 326 | AM_RANGE(0x070000, 0x070fff) AM_READ(SMH_RAM) | |
| 327 | AM_RANGE(0x074000, 0x074fff) AM_READ(SMH_RAM) | |
| 297 | static ADDRESS_MAP_START( cclimbr2_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 298 | AM_RANGE(0x000000, 0x05ffff) AM_ROM | |
| 299 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 300 | AM_RANGE(0x061000, 0x063fff) AM_RAM | |
| 301 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 302 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 303 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM | |
| 304 | AM_RANGE(0x06c000, 0x06c9ff) AM_RAM | |
| 305 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITEONLY | |
| 306 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 307 | AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 328 | 308 | AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) |
| 329 | 309 | AM_RANGE(0x078002, 0x078003) AM_READ(input_port_1_word_r) |
| 330 | 310 | AM_RANGE(0x078004, 0x078005) AM_READ(input_port_2_word_r) |
| 331 | 311 | AM_RANGE(0x078006, 0x078007) AM_READ(input_port_3_word_r) |
| 332 | ADDRESS_MAP_END | |
| 333 | ||
| 334 | static ADDRESS_MAP_START( cclimbr2_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 335 | AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM) | |
| 336 | AM_RANGE(0x060000, 0x060fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 337 | AM_RANGE(0x061000, 0x063fff) AM_WRITE(SMH_RAM) | |
| 338 | AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 339 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 340 | AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(SMH_RAM) | |
| 341 | AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(SMH_RAM) | |
| 342 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(SMH_RAM) | |
| 343 | AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 344 | AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 345 | 312 | AM_RANGE(0x07c000, 0x07c001) AM_WRITE(io_w) |
| 346 | 313 | AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) |
| 347 | 314 | AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 350 | 317 | AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(SMH_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ |
| 351 | 318 | ADDRESS_MAP_END |
| 352 | 319 | |
| 353 | static ADDRESS_MAP_START( legion_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 354 | AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM) | |
| 355 | AM_RANGE(0x060000, 0x060fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 356 | AM_RANGE(0x061000, 0x063fff) AM_WRITE(SMH_RAM) | |
| 357 | AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 358 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 359 | AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(SMH_RAM) | |
| 360 | AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(SMH_RAM) | |
| 361 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(SMH_RAM) | |
| 362 | AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 363 | AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 320 | static ADDRESS_MAP_START( legion_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 321 | AM_RANGE(0x000000, 0x05ffff) AM_ROM | |
| 322 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 323 | AM_RANGE(0x061000, 0x063fff) AM_RAM | |
| 324 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 325 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 326 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM | |
| 327 | AM_RANGE(0x06c000, 0x06c9ff) AM_RAM | |
| 328 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITEONLY | |
| 329 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 330 | AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 331 | AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) | |
| 332 | AM_RANGE(0x078002, 0x078003) AM_READ(input_port_1_word_r) | |
| 333 | AM_RANGE(0x078004, 0x078005) AM_READ(input_port_2_word_r) | |
| 334 | AM_RANGE(0x078006, 0x078007) AM_READ(input_port_3_word_r) | |
| 364 | 335 | AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) |
| 365 | 336 | AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) |
| 366 | 337 | AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 369 | 340 | AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(SMH_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ |
| 370 | 341 | ADDRESS_MAP_END |
| 371 | 342 | |
| 372 | static ADDRESS_MAP_START( legiono_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 373 | AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM) | |
| 374 | AM_RANGE(0x040000, 0x04003f) AM_WRITE(SMH_RAM) AM_BASE(&legion_cmd) | |
| 375 | AM_RANGE(0x040040, 0x05ffff) AM_WRITE(SMH_ROM) | |
| 376 | AM_RANGE(0x060000, 0x060fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 377 | AM_RANGE(0x061000, 0x063fff) AM_WRITE(SMH_RAM) | |
| 378 | AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 379 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 380 | AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(SMH_RAM) | |
| 381 | AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(SMH_RAM) | |
| 382 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(SMH_RAM) | |
| 383 | AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 384 | AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 343 | static ADDRESS_MAP_START( legiono_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 344 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 345 | AM_RANGE(0x040000, 0x04003f) AM_WRITEONLY AM_BASE(&legion_cmd) | |
| 346 | AM_RANGE(0x040040, 0x05ffff) AM_ROM | |
| 347 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 348 | AM_RANGE(0x061000, 0x063fff) AM_RAM | |
| 349 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 350 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 351 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM | |
| 352 | AM_RANGE(0x06c000, 0x06c9ff) AM_RAM | |
| 353 | AM_RANGE(0x06ca00, 0x06cbff) AM_WRITEONLY | |
| 354 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 355 | AM_RANGE(0x074000, 0x074fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 356 | AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) | |
| 357 | AM_RANGE(0x078002, 0x078003) AM_READ(input_port_1_word_r) | |
| 358 | AM_RANGE(0x078004, 0x078005) AM_READ(input_port_2_word_r) | |
| 359 | AM_RANGE(0x078006, 0x078007) AM_READ(input_port_3_word_r) | |
| 385 | 360 | AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) |
| 386 | 361 | AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) |
| 387 | 362 | AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 390 | 365 | //AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(SMH_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ |
| 391 | 366 | ADDRESS_MAP_END |
| 392 | 367 | |
| 393 | static ADDRESS_MAP_START( armedf_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 394 | AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM) | |
| 395 | AM_RANGE(0x060000, 0x065fff) AM_READ(SMH_RAM) | |
| 396 | AM_RANGE(0x066000, 0x066fff) AM_READ(SMH_RAM) | |
| 397 | AM_RANGE(0x067000, 0x067fff) AM_READ(SMH_RAM) | |
| 398 | AM_RANGE(0x068000, 0x069fff) AM_READ(SMH_RAM) | |
| 399 | AM_RANGE(0x06a000, 0x06afff) AM_READ(SMH_RAM) | |
| 400 | AM_RANGE(0x06b000, 0x06bfff) AM_READ(SMH_RAM) | |
| 368 | static ADDRESS_MAP_START( armedf_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 369 | AM_RANGE(0x000000, 0x05ffff) AM_ROM | |
| 370 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 371 | AM_RANGE(0x061000, 0x065fff) AM_RAM | |
| 372 | AM_RANGE(0x066000, 0x066fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 373 | AM_RANGE(0x067000, 0x067fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 374 | AM_RANGE(0x068000, 0x069fff) AM_RAM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 375 | AM_RANGE(0x06a000, 0x06afff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 376 | AM_RANGE(0x06b000, 0x06bfff) AM_RAM | |
| 401 | 377 | AM_RANGE(0x06c000, 0x06c001) AM_READ(input_port_0_word_r) |
| 402 | 378 | AM_RANGE(0x06c002, 0x06c003) AM_READ(input_port_1_word_r) |
| 403 | 379 | AM_RANGE(0x06c004, 0x06c005) AM_READ(input_port_2_word_r) |
| 404 | 380 | AM_RANGE(0x06c006, 0x06c007) AM_READ(input_port_3_word_r) |
| 405 | AM_RANGE(0x06c008, 0x06c7ff) AM_READ(SMH_RAM) | |
| 406 | ADDRESS_MAP_END | |
| 407 | ||
| 408 | static ADDRESS_MAP_START( armedf_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 409 | AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM) | |
| 410 | AM_RANGE(0x060000, 0x060fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 411 | AM_RANGE(0x061000, 0x065fff) AM_WRITE(SMH_RAM) | |
| 412 | AM_RANGE(0x066000, 0x066fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) | |
| 413 | AM_RANGE(0x067000, 0x067fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) | |
| 414 | AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) | |
| 415 | AM_RANGE(0x06a000, 0x06afff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 416 | AM_RANGE(0x06b000, 0x06bfff) AM_WRITE(SMH_RAM) | |
| 417 | AM_RANGE(0x06c000, 0x06c7ff) AM_WRITE(SMH_RAM) | |
| 381 | AM_RANGE(0x06c000, 0x06c7ff) AM_RAM | |
| 418 | 382 | AM_RANGE(0x06d000, 0x06d001) AM_WRITE(io_w) |
| 419 | 383 | AM_RANGE(0x06d002, 0x06d003) AM_WRITE(armedf_bg_scrollx_w) |
| 420 | 384 | AM_RANGE(0x06d004, 0x06d005) AM_WRITE(armedf_bg_scrolly_w) |
| r2418 | r2419 | |
| 424 | 388 | ADDRESS_MAP_END |
| 425 | 389 | |
| 426 | 390 | |
| 427 | static ADDRESS_MAP_START( soundreadmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 428 | AM_RANGE(0x0000, 0xf7ff) AM_READ(SMH_ROM) | |
| 429 | AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM) | |
| 391 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 392 | AM_RANGE(0x0000, 0xf7ff) AM_ROM | |
| 393 | AM_RANGE(0xf800, 0xffff) AM_RAM | |
| 430 | 394 | ADDRESS_MAP_END |
| 431 | 395 | |
| 432 | static ADDRESS_MAP_START( soundwritemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 433 | AM_RANGE(0x0000, 0xf7ff) AM_WRITE(SMH_ROM) | |
| 434 | AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM) | |
| 396 | static ADDRESS_MAP_START( cclimbr2_soundmap, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 397 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 398 | AM_RANGE(0xc000, 0xffff) AM_RAM | |
| 435 | 399 | ADDRESS_MAP_END |
| 436 | 400 | |
| 437 | static ADDRESS_MAP_START( cclimbr2_soundreadmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 438 | AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM) | |
| 439 | AM_RANGE(0xc000, 0xffff) AM_READ(SMH_RAM) | |
| 440 | ADDRESS_MAP_END | |
| 441 | ||
| 442 | static ADDRESS_MAP_START( cclimbr2_soundwritemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 443 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 444 | AM_RANGE(0xc000, 0xffff) AM_WRITE(SMH_RAM) | |
| 445 | ADDRESS_MAP_END | |
| 446 | ||
| 447 | 401 | static READ8_HANDLER( soundlatch_clear_r ) |
| 448 | 402 | { |
| 449 | 403 | soundlatch_clear_w(machine,0,0); |
| 450 | 404 | return 0; |
| 451 | 405 | } |
| 452 | 406 | |
| 453 | static ADDRESS_MAP_START( | |
| 407 | static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 454 | 408 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 455 | AM_RANGE(0x4, 0x4) AM_READ(soundlatch_clear_r) | |
| 456 | AM_RANGE(0x6, 0x6) AM_READ(soundlatch_r) | |
| 457 | ADDRESS_MAP_END | |
| 458 | ||
| 459 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 460 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 461 | 409 | AM_RANGE(0x0, 0x0) AM_WRITE(YM3812_control_port_0_w) |
| 462 | 410 | AM_RANGE(0x1, 0x1) AM_WRITE(YM3812_write_port_0_w) |
| 463 | 411 | AM_RANGE(0x2, 0x2) AM_WRITE(DAC_0_signed_data_w) |
| 464 | 412 | AM_RANGE(0x3, 0x3) AM_WRITE(DAC_1_signed_data_w) |
| 413 | AM_RANGE(0x4, 0x4) AM_READ(soundlatch_clear_r) | |
| 414 | AM_RANGE(0x6, 0x6) AM_READ(soundlatch_r) | |
| 465 | 415 | ADDRESS_MAP_END |
| 466 | 416 | |
| 467 | 417 | |
| r2418 | r2419 | |
| 761 | 711 | |
| 762 | 712 | /* basic machine hardware */ |
| 763 | 713 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 764 | MDRV_CPU_PROGRAM_MAP(terraf_ | |
| 714 | MDRV_CPU_PROGRAM_MAP(terraf_ | |
| 765 | 715 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 766 | 716 | |
| 767 | MDRV_CPU_ADD(Z80, 3072000) | |
| 768 | /* audio CPU */ /* 3.072 MHz???? */ | |
| 769 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) | |
| 770 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 717 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz???? */ | |
| 718 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 719 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 771 | 720 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 772 | 721 | |
| 773 | 722 | /* video hardware */ |
| r2418 | r2419 | |
| 803 | 752 | |
| 804 | 753 | /* basic machine hardware */ |
| 805 | 754 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 806 | MDRV_CPU_PROGRAM_MAP(kodure_ | |
| 755 | MDRV_CPU_PROGRAM_MAP(kodure_ | |
| 807 | 756 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 808 | 757 | |
| 809 | 758 | MDRV_CPU_ADD(Z80, 3072000) |
| 810 | 759 | /* audio CPU */ /* 3.072 MHz???? */ |
| 811 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) | |
| 812 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 760 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 761 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 813 | 762 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 814 | 763 | |
| 815 | 764 | /* video hardware */ |
| r2418 | r2419 | |
| 845 | 794 | |
| 846 | 795 | /* basic machine hardware */ |
| 847 | 796 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 848 | MDRV_CPU_PROGRAM_MAP(armedf_ | |
| 797 | MDRV_CPU_PROGRAM_MAP(armedf_ | |
| 849 | 798 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 850 | 799 | |
| 851 | 800 | MDRV_CPU_ADD(Z80, 3072000) |
| 852 | 801 | /* audio CPU */ /* 3.072 MHz???? */ |
| 853 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) | |
| 854 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 802 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 803 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 855 | 804 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 856 | 805 | |
| 857 | 806 | /* video hardware */ |
| r2418 | r2419 | |
| 887 | 836 | |
| 888 | 837 | /* basic machine hardware */ |
| 889 | 838 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 890 | MDRV_CPU_PROGRAM_MAP(cclimbr2_ | |
| 839 | MDRV_CPU_PROGRAM_MAP(cclimbr2_ | |
| 891 | 840 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) |
| 892 | 841 | |
| 893 | MDRV_CPU_ADD(Z80, 3072000) | |
| 894 | /* audio CPU */ /* 3.072 MHz???? */ | |
| 895 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) | |
| 896 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 842 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz???? */ | |
| 843 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundmap,0) | |
| 844 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 897 | 845 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 898 | 846 | |
| 899 | 847 | /* video hardware */ |
| r2418 | r2419 | |
| 929 | 877 | |
| 930 | 878 | /* basic machine hardware */ |
| 931 | 879 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 932 | MDRV_CPU_PROGRAM_MAP( | |
| 880 | MDRV_CPU_PROGRAM_MAP( | |
| 933 | 881 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) |
| 934 | 882 | |
| 935 | MDRV_CPU_ADD(Z80, 3072000) | |
| 936 | /* audio CPU */ /* 3.072 MHz???? */ | |
| 937 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) | |
| 938 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 883 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz???? */ | |
| 884 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundmap,0) | |
| 885 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 939 | 886 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 940 | 887 | |
| 941 | 888 | /* video hardware */ |
| r2418 | r2419 | |
| 971 | 918 | |
| 972 | 919 | /* basic machine hardware */ |
| 973 | 920 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 974 | MDRV_CPU_PROGRAM_MAP( | |
| 921 | MDRV_CPU_PROGRAM_MAP( | |
| 975 | 922 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) |
| 976 | 923 | |
| 977 | 924 | MDRV_CPU_ADD(Z80, 3072000) |
| 978 | 925 | /* audio CPU */ /* 3.072 MHz???? */ |
| 979 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) | |
| 980 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 926 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundmap,0) | |
| 927 | MDRV_CPU_IO_MAP(sound_portmap,0) | |
| 981 | 928 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) |
| 982 | 929 | |
| 983 | 930 | /* video hardware */ |
| r2418 | r2419 | |
|---|---|---|
| 255 | 255 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 256 | 256 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 257 | 257 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) |
| 258 | AM_RANGE(0x4400, 0x47ff) AM_R | |
| 258 | AM_RANGE(0x4400, 0x47ff) AM_R | |
| 259 | 259 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r) |
| 260 | 260 | AM_RANGE(0x8001, 0x8001) AM_READ(input_port_1_r) |
| 261 | 261 | AM_RANGE(0x8002, 0x8002) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
|---|---|---|
| 762 | 762 | AM_RANGE(0x6000, 0x6bff) AM_RAM |
| 763 | 763 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram) |
| 764 | 764 | AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */ |
| 765 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 765 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 766 | 766 | AM_BASE_MEMBER(dkong_state, video_ram) |
| 767 | 767 | AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w) /* P8257 control registers */ |
| 768 | 768 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkong_sh_tuneselect_w) /* IN0, sound CPU intf */ |
| r2418 | r2419 | |
| 784 | 784 | AM_RANGE(0x6c00, 0x6fff) AM_RAM /* DK3 bootleg only */ |
| 785 | 785 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram) |
| 786 | 786 | AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */ |
| 787 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 787 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 788 | 788 | AM_BASE_MEMBER(dkong_state, video_ram) |
| 789 | 789 | AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w) /* P8257 control registers */ |
| 790 | 790 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkongjr_sh_tuneselect_w) |
| r2418 | r2419 | |
| 810 | 810 | AM_RANGE(0x6800, 0x6fff) AM_RAM |
| 811 | 811 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram) |
| 812 | 812 | AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */ |
| 813 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 813 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 814 | 814 | AM_BASE_MEMBER(dkong_state, video_ram) |
| 815 | 815 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) |
| 816 | 816 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(soundlatch2_w) |
| r2418 | r2419 | |
| 856 | 856 | AM_RANGE(0x1585, 0x1585) AM_WRITE(p8257_drq_w) /* P8257 ==> /DRQ0 /DRQ1 */ |
| 857 | 857 | AM_RANGE(0x1586, 0x1587) AM_WRITE(dkong_palettebank_w) |
| 858 | 858 | AM_RANGE(0x1600, 0x17ff) AM_RAM /* 0x6400 spriteram location */ |
| 859 | AM_RANGE(0x1800, 0x1bff) AM_R | |
| 859 | AM_RANGE(0x1800, 0x1bff) AM_R | |
| 860 | 860 | AM_BASE_MEMBER(dkong_state, video_ram) /* 0x7400 */ |
| 861 | 861 | AM_RANGE(0x1C00, 0x1f7f) AM_RAM /* 0x6000 */ |
| 862 | 862 | AM_RANGE(0x1f80, 0x1f8f) AM_READWRITE(dma8257_0_r, dma8257_0_w) /* P8257 control registers */ |
| r2418 | r2419 | |
|---|---|---|
| 241 | 241 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 242 | 242 | |
| 243 | 243 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x700) AM_READWRITE(sprint4_wram_r, sprint4_wram_w) |
| 244 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x400) AM_R | |
| 244 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x400) AM_R | |
| 245 | 245 | |
| 246 | 246 | AM_RANGE(0x0000, 0x0007) AM_MIRROR(0x718) AM_READ(sprint4_analog_r) |
| 247 | 247 | AM_RANGE(0x0020, 0x0027) AM_MIRROR(0x718) AM_READ(sprint4_coin_r) |
| r2418 | r2419 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 69 | 69 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 70 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 70 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 71 | 71 | AM_RANGE(0x9000, 0x9000) AM_WRITE(travrusa_scroll_x_low_w) |
| 72 | 72 | AM_RANGE(0xa000, 0xa000) AM_WRITE(travrusa_scroll_x_high_w) |
| 73 | 73 | AM_RANGE(0xc800, 0xc9ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 124 | 124 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&banked_rom) /* banked ROM + palette RAM */ |
| 125 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 125 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 126 | 126 | AM_RANGE(0x2000, 0x2fff) AM_RAM |
| 127 | 127 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 128 | 128 | AM_RANGE(0x3800, 0x3fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(&ram) |
| r2418 | r2419 | |
|---|---|---|
| 7530 | 7530 | version of the game might be a bootleg with the protection |
| 7531 | 7531 | patched. (both sets need this) |
| 7532 | 7532 | */ |
| 7533 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x60d4, 0x60d4, 0, 0, SMH_NOP); | |
| 7533 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60d4, 0x60d4, 0, 0, SMH_NOP); | |
| 7534 | 7534 | } |
| 7535 | 7535 | |
| 7536 | 7536 | /*************************************************************************** |
| r2418 | r2419 | |
|---|---|---|
| 264 | 264 | |
| 265 | 265 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 266 | 266 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE(1) |
| 267 | AM_RANGE(0x2000, 0x27ff) AM_READWRITE(SMH_RAM, ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 268 | AM_RANGE(0x2800, 0x2fff) AM_READWRITE(SMH_RAM, ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 267 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 268 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 269 | 269 | AM_RANGE(0x3000, 0x317f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) |
| 270 | 270 | AM_RANGE(0x3400, 0x357f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) |
| 271 | 271 | AM_RANGE(0x3800, 0x397f) AM_WRITE(SMH_BANK3) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
|---|---|---|
| 369 | 369 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 370 | 370 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // Work RAM |
| 371 | 371 | AM_RANGE(0x30e000, 0x30ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 372 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 372 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 373 | 373 | // AM_RANGE(0x480000, 0x480001) AM_RAM // ? |
| 374 | 374 | AM_RANGE(0x500000, 0x500001) AM_READWRITE(kaneko16_bg15_reg_r, kaneko16_bg15_reg_w) AM_BASE(&kaneko16_bg15_reg) // High Color Background |
| 375 | 375 | AM_RANGE(0x580000, 0x580001) AM_READWRITE(kaneko16_bg15_select_r, kaneko16_bg15_select_w) AM_BASE(&kaneko16_bg15_select) |
| 376 | AM_RANGE(0x600000, 0x60003f) AM_R | |
| 376 | AM_RANGE(0x600000, 0x60003f) AM_R | |
| 377 | 377 | AM_RANGE(0x680000, 0x680001) AM_READ(input_port_0_word_r) // Inputs |
| 378 | 378 | AM_RANGE(0x680002, 0x680003) AM_READ(input_port_1_word_r) |
| 379 | 379 | AM_RANGE(0x680004, 0x680005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 384 | 384 | AM_RANGE(0x800200, 0x80021f) AM_READWRITE(kaneko16_YM2149_1_r, kaneko16_YM2149_1_w) |
| 385 | 385 | AM_RANGE(0x8003fe, 0x8003ff) AM_NOP // for OKI when accessed as .l |
| 386 | 386 | AM_RANGE(0x800400, 0x800401) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| 387 | AM_RANGE(0xc00000, 0xc00fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers | |
| 388 | AM_RANGE(0xc01000, 0xc01fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 387 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers | |
| 388 | AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 389 | 389 | AM_RANGE(0xc02000, 0xc02fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 390 | 390 | AM_RANGE(0xc03000, 0xc03fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 391 | AM_RANGE(0xd00000, 0xd0001f) AM_R | |
| 391 | AM_RANGE(0xd00000, 0xd0001f) AM_R | |
| 392 | 392 | ADDRESS_MAP_END |
| 393 | 393 | |
| 394 | 394 | |
| r2418 | r2419 | |
| 445 | 445 | static ADDRESS_MAP_START( blazeon, ADDRESS_SPACE_PROGRAM, 16 ) |
| 446 | 446 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 447 | 447 | AM_RANGE(0x300000, 0x30ffff) AM_RAM // Work RAM |
| 448 | AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SMH_RAM, paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 449 | AM_RANGE(0x600000, 0x600fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 450 | AM_RANGE(0x601000, 0x601fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 448 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 449 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 450 | AM_RANGE(0x601000, 0x601fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 451 | 451 | AM_RANGE(0x602000, 0x602fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 452 | 452 | AM_RANGE(0x603000, 0x603fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 453 | 453 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 454 | AM_RANGE(0x800000, 0x80001f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 455 | AM_RANGE(0x900000, 0x90001f) AM_READWRITE(SMH_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs #1 | |
| 454 | AM_RANGE(0x800000, 0x80001f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 455 | AM_RANGE(0x900000, 0x90001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs #1 | |
| 456 | 456 | AM_RANGE(0x980000, 0x98001f) AM_RAM // Sprites Regs #2 |
| 457 | 457 | AM_RANGE(0xc00000, 0xc00001) AM_READ(input_port_0_word_r) // Inputs |
| 458 | 458 | AM_RANGE(0xc00002, 0xc00003) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
| 507 | 507 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(toybox_mcu_com1_w) |
| 508 | 508 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 509 | 509 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 510 | AM_RANGE(0x300000, 0x30ffff) AM_R | |
| 510 | AM_RANGE(0x300000, 0x30ffff) AM_R | |
| 511 | 511 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 512 | AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 513 | AM_RANGE(0x501000, 0x501fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 512 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 513 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 514 | 514 | AM_RANGE(0x502000, 0x502fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 515 | 515 | AM_RANGE(0x503000, 0x503fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 516 | AM_RANGE(0x580000, 0x580fff) AM_READWRITE(SMH_RAM, kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 517 | AM_RANGE(0x581000, 0x581fff) AM_READWRITE(SMH_RAM, kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 516 | AM_RANGE(0x580000, 0x580fff) AM_RAM_WRITE(kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 517 | AM_RANGE(0x581000, 0x581fff) AM_RAM_WRITE(kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 518 | 518 | AM_RANGE(0x582000, 0x582fff) AM_RAM AM_BASE(&kaneko16_vscroll_3) // |
| 519 | 519 | AM_RANGE(0x583000, 0x583fff) AM_RAM AM_BASE(&kaneko16_vscroll_2) // |
| 520 | AM_RANGE(0x600000, 0x60001f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 521 | AM_RANGE(0x680000, 0x68001f) AM_READWRITE(SMH_RAM, kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 522 | AM_RANGE(0x700000, 0x70001f) AM_READWRITE(SMH_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 520 | AM_RANGE(0x600000, 0x60001f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 521 | AM_RANGE(0x680000, 0x68001f) AM_RAM_WRITE(kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 522 | AM_RANGE(0x700000, 0x70001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 523 | 523 | AM_RANGE(0x800000, 0x800001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| 524 | 524 | AM_RANGE(0x880000, 0x880001) AM_READWRITE(OKIM6295_status_1_lsb_r, OKIM6295_data_1_lsb_w) |
| 525 | 525 | AM_RANGE(0x900000, 0x900039) AM_READWRITE(bloodwar_calc_r, bloodwar_calc_w) |
| r2418 | r2419 | |
| 567 | 567 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(toybox_mcu_com1_w) |
| 568 | 568 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 569 | 569 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 570 | AM_RANGE(0x300000, 0x30ffff) AM_R | |
| 570 | AM_RANGE(0x300000, 0x30ffff) AM_R | |
| 571 | 571 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 572 | AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 573 | AM_RANGE(0x501000, 0x501fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 572 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 573 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 574 | 574 | AM_RANGE(0x502000, 0x502fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 575 | 575 | AM_RANGE(0x503000, 0x503fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 576 | AM_RANGE(0x580000, 0x580fff) AM_READWRITE(SMH_RAM, kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 577 | AM_RANGE(0x581000, 0x581fff) AM_READWRITE(SMH_RAM, kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 576 | AM_RANGE(0x580000, 0x580fff) AM_RAM_WRITE(kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 577 | AM_RANGE(0x581000, 0x581fff) AM_RAM_WRITE(kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 578 | 578 | AM_RANGE(0x582000, 0x582fff) AM_RAM AM_BASE(&kaneko16_vscroll_3) // |
| 579 | 579 | AM_RANGE(0x583000, 0x583fff) AM_RAM AM_BASE(&kaneko16_vscroll_2) // |
| 580 | AM_RANGE(0x600000, 0x60001f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 581 | AM_RANGE(0x680000, 0x68001f) AM_READWRITE(SMH_RAM, kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 582 | AM_RANGE(0x700000, 0x70001f) AM_READWRITE(SMH_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 580 | AM_RANGE(0x600000, 0x60001f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 581 | AM_RANGE(0x680000, 0x68001f) AM_RAM_WRITE(kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 582 | AM_RANGE(0x700000, 0x70001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 583 | 583 | AM_RANGE(0x800000, 0x800001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| 584 | 584 | AM_RANGE(0x880000, 0x880001) AM_READWRITE(OKIM6295_status_1_lsb_r, OKIM6295_data_1_lsb_w) |
| 585 | 585 | AM_RANGE(0x900000, 0x900015) AM_READWRITE(galpanib_calc_r,galpanib_calc_w) |
| r2418 | r2419 | |
| 767 | 767 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE(kaneko16_YM2149_0_r, kaneko16_YM2149_0_w) // Sound |
| 768 | 768 | AM_RANGE(0x400200, 0x40021f) AM_READWRITE(kaneko16_YM2149_1_r, kaneko16_YM2149_1_w) |
| 769 | 769 | AM_RANGE(0x400400, 0x400401) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| 770 | AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SMH_RAM, paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 771 | AM_RANGE(0x600000, 0x600fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 772 | AM_RANGE(0x601000, 0x601fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 770 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 771 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 772 | AM_RANGE(0x601000, 0x601fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 773 | 773 | AM_RANGE(0x602000, 0x602fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 774 | 774 | AM_RANGE(0x603000, 0x603fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 775 | AM_RANGE(0x680000, 0x680fff) AM_READWRITE(SMH_RAM, kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 776 | AM_RANGE(0x681000, 0x681fff) AM_READWRITE(SMH_RAM, kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 775 | AM_RANGE(0x680000, 0x680fff) AM_RAM_WRITE(kaneko16_vram_3_w) AM_BASE(&kaneko16_vram_3) // Layers 1 | |
| 776 | AM_RANGE(0x681000, 0x681fff) AM_RAM_WRITE(kaneko16_vram_2_w) AM_BASE(&kaneko16_vram_2) // | |
| 777 | 777 | AM_RANGE(0x682000, 0x682fff) AM_RAM AM_BASE(&kaneko16_vscroll_3) // |
| 778 | 778 | AM_RANGE(0x683000, 0x683fff) AM_RAM AM_BASE(&kaneko16_vscroll_2) // |
| 779 | 779 | AM_RANGE(0x700000, 0x701fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 780 | AM_RANGE(0x800000, 0x80001f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 781 | AM_RANGE(0x900000, 0x90001f) AM_READWRITE(SMH_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 782 | AM_RANGE(0xb00000, 0xb0001f) AM_READWRITE(SMH_RAM, kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 780 | AM_RANGE(0x800000, 0x80001f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 781 | AM_RANGE(0x900000, 0x90001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 782 | AM_RANGE(0xb00000, 0xb0001f) AM_RAM_WRITE(kaneko16_layers_1_regs_w) AM_BASE(&kaneko16_layers_1_regs) // Layers 1 Regs | |
| 783 | 783 | AM_RANGE(0xa00000, 0xa00001) AM_READ(watchdog_reset16_r) // Watchdog |
| 784 | 784 | AM_RANGE(0xc00000, 0xc00001) AM_READ(input_port_0_word_r) // Inputs |
| 785 | 785 | AM_RANGE(0xc00002, 0xc00003) AM_READ(input_port_1_word_r) // |
| r2418 | r2419 | |
| 811 | 811 | AM_RANGE(0x290000, 0x290001) AM_WRITE(calc3_mcu_com1_w) |
| 812 | 812 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(calc3_mcu_com2_w) |
| 813 | 813 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(calc3_mcu_com3_w) |
| 814 | AM_RANGE(0x380000, 0x380fff) AM_R | |
| 814 | AM_RANGE(0x380000, 0x380fff) AM_R | |
| 815 | 815 | AM_RANGE(0x400000, 0x400001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) // Samples |
| 816 | 816 | AM_RANGE(0x480000, 0x480001) AM_READWRITE(OKIM6295_status_1_lsb_r, OKIM6295_data_1_lsb_w) |
| 817 | 817 | AM_RANGE(0x580000, 0x581fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // Sprites |
| 818 | AM_RANGE(0x600000, 0x600fff) AM_R | |
| 818 | AM_RANGE(0x600000, 0x600fff) AM_R | |
| 819 | 819 | AM_RANGE(0x601000, 0x601fff) AM_READWRITE(SMH_RAM,kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) |
| 820 | 820 | AM_RANGE(0x602000, 0x602fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) |
| 821 | 821 | AM_RANGE(0x603000, 0x603fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) |
| 822 | AM_RANGE(0x800000, 0x80000f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 823 | AM_RANGE(0x900000, 0x90001f) AM_READWRITE(SMH_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 822 | AM_RANGE(0x800000, 0x80000f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 823 | AM_RANGE(0x900000, 0x90001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs | |
| 824 | 824 | AM_RANGE(0xa00014, 0xa00015) AM_READ(kaneko16_rnd_r) // Random Number ? |
| 825 | 825 | AM_RANGE(0xa80000, 0xa80001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog |
| 826 | 826 | AM_RANGE(0xb80000, 0xb80001) AM_READ(input_port_0_word_r) // Inputs |
| r2418 | r2419 | |
|---|---|---|
| 372 | 372 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 373 | 373 | AM_RANGE(0x080000, 0x087fff) AM_RAM /*Work RAM*/ |
| 374 | 374 | AM_RANGE(0x0a0000, 0x0a0fff) AM_RAM |
| 375 | AM_RANGE(0x0c0000, 0x0c3fff) AM_R | |
| 375 | AM_RANGE(0x0c0000, 0x0c3fff) AM_R | |
| 376 | 376 | AM_RANGE(0x0c4000, 0x0cffff) AM_RAM |
| 377 | 377 | AM_RANGE(0x0e0000, 0x0e0fff) AM_READWRITE(share_r, share_w) AM_BASE(&shared_ram) |
| 378 | AM_RANGE(0x100000, 0x107fff) AM_R | |
| 378 | AM_RANGE(0x100000, 0x107fff) AM_R | |
| 379 | 379 | AM_RANGE(0x110000, 0x1101ff) AM_READWRITE(io_r,io_w) AM_BASE(&io_ram) |
| 380 | 380 | ADDRESS_MAP_END |
| 381 | 381 |
| r2418 | r2419 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | |
| 119 | static ADDRESS_MAP_START( wc90_readmem1, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 120 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 121 | AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM) /* Main RAM */ | |
| 122 | AM_RANGE(0xa000, 0xafff) AM_READ(SMH_RAM) /* fg video ram */ | |
| 123 | AM_RANGE(0xb000, 0xbfff) AM_READ(SMH_RAM) | |
| 124 | AM_RANGE(0xc000, 0xcfff) AM_READ(SMH_RAM) /* bg video ram */ | |
| 125 | AM_RANGE(0xd000, 0xdfff) AM_READ(SMH_RAM) | |
| 126 | AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM) /* tx video ram */ | |
| 127 | AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_BANK1) | |
| 128 | AM_RANGE(0xf800, 0xfbff) AM_READ(wc90_shared_r) | |
| 119 | static ADDRESS_MAP_START( wc90_map_1, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 120 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 121 | AM_RANGE(0x8000, 0x9fff) AM_RAM /* Main RAM */ | |
| 122 | AM_RANGE(0xa000, 0xafff) AM_RAM_WRITE(wc90_fgvideoram_w) AM_BASE(&wc90_fgvideoram) /* fg video ram */ | |
| 123 | AM_RANGE(0xb000, 0xbfff) AM_RAM | |
| 124 | AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(wc90_bgvideoram_w) AM_BASE(&wc90_bgvideoram) | |
| 125 | AM_RANGE(0xd000, 0xdfff) AM_RAM | |
| 126 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(wc90_txvideoram_w) AM_BASE(&wc90_txvideoram) /* tx video ram */ | |
| 127 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_BANK1, SMH_ROM) | |
| 128 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90_shared_r, wc90_shared_w) AM_BASE(&wc90_shared) | |
| 129 | 129 | AM_RANGE(0xfc00, 0xfc00) AM_READ(input_port_0_r) /* Stick 1 */ |
| 130 | 130 | AM_RANGE(0xfc02, 0xfc02) AM_READ(input_port_1_r) /* Stick 2 */ |
| 131 | 131 | AM_RANGE(0xfc05, 0xfc05) AM_READ(input_port_4_r) /* Start & Coin */ |
| 132 | 132 | AM_RANGE(0xfc06, 0xfc06) AM_READ(input_port_2_r) /* DIP Switch A */ |
| 133 | 133 | AM_RANGE(0xfc07, 0xfc07) AM_READ(input_port_3_r) /* DIP Switch B */ |
| 134 | ADDRESS_MAP_END | |
| 135 | ||
| 136 | static ADDRESS_MAP_START( wc90_readmem2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 137 | AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM) | |
| 138 | AM_RANGE(0xc000, 0xcfff) AM_READ(SMH_RAM) | |
| 139 | AM_RANGE(0xd000, 0xd7ff) AM_READ(SMH_RAM) | |
| 140 | AM_RANGE(0xd800, 0xdfff) AM_READ(SMH_RAM) | |
| 141 | AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM) | |
| 142 | AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_BANK2) | |
| 143 | AM_RANGE(0xf800, 0xfbff) AM_READ(wc90_shared_r) | |
| 144 | ADDRESS_MAP_END | |
| 145 | ||
| 146 | static ADDRESS_MAP_START( wc90_writemem1, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 147 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 148 | AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM) | |
| 149 | AM_RANGE(0xa000, 0xafff) AM_WRITE(wc90_fgvideoram_w) AM_BASE(&wc90_fgvideoram) | |
| 150 | AM_RANGE(0xb000, 0xbfff) AM_WRITE(SMH_RAM) | |
| 151 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(wc90_bgvideoram_w) AM_BASE(&wc90_bgvideoram) | |
| 152 | AM_RANGE(0xd000, 0xdfff) AM_WRITE(SMH_RAM) | |
| 153 | AM_RANGE(0xe000, 0xefff) AM_WRITE(wc90_txvideoram_w) AM_BASE(&wc90_txvideoram) | |
| 154 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(SMH_ROM) | |
| 155 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(wc90_shared_w) AM_BASE(&wc90_shared) | |
| 156 | 134 | AM_RANGE(0xfc02, 0xfc02) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0ylo) |
| 157 | 135 | AM_RANGE(0xfc03, 0xfc03) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0yhi) |
| 158 | 136 | AM_RANGE(0xfc06, 0xfc06) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0xlo) |
| r2418 | r2419 | |
| 170 | 148 | AM_RANGE(0xfce0, 0xfce0) AM_WRITE(wc90_bankswitch_w) |
| 171 | 149 | ADDRESS_MAP_END |
| 172 | 150 | |
| 173 | static ADDRESS_MAP_START( wc90_writemem2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 174 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 175 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(SMH_RAM) | |
| 176 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 177 | AM_RANGE(0xd800, 0xdfff) AM_WRITE(SMH_RAM) | |
| 178 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_BASE(&paletteram) | |
| 179 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(SMH_ROM) | |
| 180 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(wc90_shared_w) | |
| 151 | static ADDRESS_MAP_START( wc90_map_2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 152 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 153 | AM_RANGE(0xc000, 0xcfff) AM_RAM | |
| 154 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 155 | AM_RANGE(0xd800, 0xdfff) AM_RAM | |
| 156 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_BASE(&paletteram) | |
| 157 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_BANK2, SMH_ROM) | |
| 158 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90_shared_r, wc90_shared_w) | |
| 181 | 159 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90_bankswitch1_w) |
| 182 | 160 | AM_RANGE(0xfc01, 0xfc01) AM_WRITE(watchdog_reset_w) |
| 183 | 161 | ADDRESS_MAP_END |
| 184 | 162 | |
| 185 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 186 | AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM) | |
| 187 | AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_RAM) | |
| 188 | AM_RANGE(0xf800, 0xf800) AM_READ(YM2608_status_port_0_A_r) | |
| 189 | AM_RANGE(0xf802, 0xf802) AM_READ(YM2608_status_port_0_B_r) | |
| 163 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 164 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 165 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 166 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(YM2608_status_port_0_A_r, YM2608_control_port_0_A_w) | |
| 167 | AM_RANGE(0xf801, 0xf801) AM_WRITE(YM2608_data_port_0_A_w) | |
| 168 | AM_RANGE(0xf802, 0xf802) AM_READWRITE(YM2608_status_port_0_B_r, YM2608_control_port_0_B_w) | |
| 169 | AM_RANGE(0xf803, 0xf803) AM_WRITE(YM2608_data_port_0_B_w) | |
| 190 | 170 | AM_RANGE(0xfc00, 0xfc00) AM_READ(SMH_NOP) /* ??? adpcm ??? */ |
| 191 | 171 | AM_RANGE(0xfc10, 0xfc10) AM_READ(soundlatch_r) |
| 192 | 172 | ADDRESS_MAP_END |
| 193 | 173 | |
| 194 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 195 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 196 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(SMH_RAM) | |
| 197 | AM_RANGE(0xf800, 0xf800) AM_WRITE(YM2608_control_port_0_A_w) | |
| 198 | AM_RANGE(0xf801, 0xf801) AM_WRITE(YM2608_data_port_0_A_w) | |
| 199 | AM_RANGE(0xf802, 0xf802) AM_WRITE(YM2608_control_port_0_B_w) | |
| 200 | AM_RANGE(0xf803, 0xf803) AM_WRITE(YM2608_data_port_0_B_w) | |
| 201 | ADDRESS_MAP_END | |
| 202 | 174 | |
| 203 | ||
| 204 | ||
| 205 | 175 | static INPUT_PORTS_START( wc90 ) |
| 206 | 176 | PORT_START /* IN0 bit 0-5 */ |
| 207 | 177 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| r2418 | r2419 | |
| 347 | 317 | |
| 348 | 318 | /* basic machine hardware */ |
| 349 | 319 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 350 | MDRV_CPU_PROGRAM_MAP(wc90_ | |
| 320 | MDRV_CPU_PROGRAM_MAP(wc90_ | |
| 351 | 321 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 352 | 322 | |
| 353 | 323 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 354 | MDRV_CPU_PROGRAM_MAP(wc90_ | |
| 324 | MDRV_CPU_PROGRAM_MAP(wc90_ | |
| 355 | 325 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 356 | 326 | |
| 357 | MDRV_CPU_ADD(Z80, 4000000) | |
| 358 | 327 | /* audio CPU */ /* 4 MHz ???? */ |
| 359 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 360 | /* NMIs are triggered by the main CPU */ | |
| 328 | MDRV_CPU_ADD(Z80, 4000000) | |
| 329 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 330 | /* NMIs are triggered by the main CPU */ | |
| 361 | 331 | |
| 362 | 332 | /* video hardware */ |
| 363 | 333 | MDRV_SCREEN_ADD("main", RASTER) |
| r2418 | r2419 | |
|---|---|---|
| 334 | 334 | AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE(atarigen_sound_w) |
| 335 | 335 | |
| 336 | 336 | /* VBUS */ |
| 337 | AM_RANGE(0x900000, 0x901fff) AM_MIRROR(0x2c8000) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 338 | AM_RANGE(0x902000, 0x903fff) AM_MIRROR(0x2c8000) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 337 | AM_RANGE(0x900000, 0x901fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 338 | AM_RANGE(0x902000, 0x903fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 339 | 339 | AM_RANGE(0x904000, 0x904fff) AM_MIRROR(0x2c8000) AM_RAM |
| 340 | AM_RANGE(0x905f6e, 0x905f6f) AM_MIRROR(0x2c8000) AM_READWRITE(SMH_RAM, gauntlet_yscroll_w) AM_BASE(&atarigen_yscroll) | |
| 341 | AM_RANGE(0x905000, 0x905f7f) AM_MIRROR(0x2c8000) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 342 | AM_RANGE(0x905f80, 0x905fff) AM_MIRROR(0x2c8000) AM_READWRITE(SMH_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 343 | AM_RANGE(0x910000, 0x9107ff) AM_MIRROR(0x2cf800) AM_READWRITE(SMH_RAM, paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 340 | AM_RANGE(0x905f6e, 0x905f6f) AM_MIRROR(0x2c8000) AM_RAM_WRITE(gauntlet_yscroll_w) AM_BASE(&atarigen_yscroll) | |
| 341 | AM_RANGE(0x905000, 0x905f7f) AM_MIRROR(0x2c8000) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 342 | AM_RANGE(0x905f80, 0x905fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 343 | AM_RANGE(0x910000, 0x9107ff) AM_MIRROR(0x2cf800) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 344 | 344 | AM_RANGE(0x930000, 0x930001) AM_MIRROR(0x2cfffe) AM_WRITE(gauntlet_xscroll_w) AM_BASE(&atarigen_xscroll) |
| 345 | 345 | ADDRESS_MAP_END |
| 346 | 346 |
| r2418 | r2419 | |
|---|---|---|
| 2306 | 2306 | static DRIVER_INIT (kirarast) |
| 2307 | 2307 | { |
| 2308 | 2308 | // { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 } |
| 2309 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2309 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2310 | 2310 | |
| 2311 | 2311 | DRIVER_INIT_CALL(ss92047_01); |
| 2312 | 2312 | } |
| r2418 | r2419 | |
| 2314 | 2314 | static DRIVER_INIT (47pie2) |
| 2315 | 2315 | { |
| 2316 | 2316 | // { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 } |
| 2317 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2317 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2318 | 2318 | |
| 2319 | 2319 | DRIVER_INIT_CALL(ss92048_01); |
| 2320 | 2320 | } |
| r2418 | r2419 | |
| 2331 | 2331 | static DRIVER_INIT (bnstars) |
| 2332 | 2332 | { |
| 2333 | 2333 | // { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 } |
| 2334 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2334 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); | |
| 2335 | 2335 | |
| 2336 | 2336 | DRIVER_INIT_CALL(ss92046_01); |
| 2337 | 2337 | } |
| r2418 | r2419 | |
|---|---|---|
| 120 | 120 | AM_RANGE(0x0000, 0x77ff) AM_ROM |
| 121 | 121 | AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE(1) |
| 122 | 122 | AM_RANGE(0x8820, 0x887f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 123 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 123 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 124 | 124 | AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&seicross_row_scroll) |
| 125 | 125 | AM_RANGE(0x9880, 0x989f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size) |
| 126 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 126 | AM_RANGE(0x9c00, 0x9fff) AM_R | |
| 127 | 127 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) /* IN0 */ |
| 128 | 128 | AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r) /* IN1 */ |
| 129 | 129 | AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r) /* test */ |
| r2418 | r2419 | |
|---|---|---|
| 104 | 104 | static ADDRESS_MAP_START( limenko_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 105 | 105 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&mainram) |
| 106 | 106 | AM_RANGE(0x40000000, 0x403fffff) AM_ROM AM_REGION(REGION_USER2,0) |
| 107 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 108 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM AM_WRITE(md_videoram_w) AM_BASE(&md_videoram) | |
| 109 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 107 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 108 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(&md_videoram) | |
| 109 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 110 | 110 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32) |
| 111 | 111 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(&spriteram32_2) |
| 112 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM | |
| 112 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM | |
| 113 | 113 | AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used |
| 114 | 114 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_BASE(&limenko_videoreg) |
| 115 | 115 | AM_RANGE(0x8003e000, 0x8003e003) AM_WRITENOP // video reg? background pen? |
| r2418 | r2419 | |
| 131 | 131 | static ADDRESS_MAP_START( spotty_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 132 | 132 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&mainram) |
| 133 | 133 | AM_RANGE(0x40002000, 0x400024d3) AM_RAM //? |
| 134 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 135 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM AM_WRITE(md_videoram_w) AM_BASE(&md_videoram) | |
| 136 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 134 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 135 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(&md_videoram) | |
| 136 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 137 | 137 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32) |
| 138 | 138 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(&spriteram32_2) |
| 139 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM | |
| 139 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM | |
| 140 | 140 | AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used |
| 141 | 141 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_BASE(&limenko_videoreg) |
| 142 | 142 | AM_RANGE(0x8003e000, 0x8003e003) AM_WRITENOP // video reg? background pen? |
| r2418 | r2419 | |
| 845 | 845 | |
| 846 | 846 | static DRIVER_INIT( dynabomb ) |
| 847 | 847 | { |
| 848 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xe2784, 0xe2787, 0, 0, dynabomb_speedup_r ); | |
| 848 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe2784, 0xe2787, 0, 0, dynabomb_speedup_r ); | |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | static DRIVER_INIT( legendoh ) |
| 852 | 852 | { |
| 853 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x32ab0, 0x32ab3, 0, 0, legendoh_speedup_r ); | |
| 853 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x32ab0, 0x32ab3, 0, 0, legendoh_speedup_r ); | |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | static DRIVER_INIT( sb2003 ) |
| 857 | 857 | { |
| 858 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x135800, 0x135803, 0, 0, sb2003_speedup_r ); | |
| 858 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x135800, 0x135803, 0, 0, sb2003_speedup_r ); | |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | static DRIVER_INIT( spotty ) |
| r2418 | r2419 | |
| 873 | 873 | dst[x+2] = (src[x+1]&0x0f) >> 0; |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6626c, 0x6626f, 0, 0, spotty_speedup_r ); | |
| 876 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6626c, 0x6626f, 0, 0, spotty_speedup_r ); | |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | GAME( 2000, dynabomb, 0, limenko, sb2003, dynabomb, ROT0, "Limenko", "Dynamite Bomber (Korea, Rev 1.5)", GAME_NO_SOUND ) |
| r2418 | r2419 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static ADDRESS_MAP_START( redalert_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 120 | 120 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 121 | AM_RANGE(0x2000, 0x3fff) AM_R | |
| 121 | AM_RANGE(0x2000, 0x3fff) AM_R | |
| 122 | 122 | AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&redalert_charmap_videoram) |
| 123 | 123 | AM_RANGE(0x5000, 0xbfff) AM_ROM |
| 124 | 124 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| r2418 | r2419 | |
| 135 | 135 | |
| 136 | 136 | static ADDRESS_MAP_START( demoneye_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 137 | 137 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 138 | AM_RANGE(0x2000, 0x3fff) AM_R | |
| 138 | AM_RANGE(0x2000, 0x3fff) AM_R | |
| 139 | 139 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&redalert_charmap_videoram) |
| 140 | 140 | AM_RANGE(0x6000, 0xbfff) AM_ROM |
| 141 | 141 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| r2418 | r2419 | |
|---|---|---|
| 455 | 455 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 456 | 456 | AM_RANGE(0xea00, 0xebff) AM_RAM |
| 457 | 457 | AM_RANGE(0xec00, 0xec7f) AM_MIRROR(0x0380) AM_WRITE(mcr3_paletteram_w) AM_BASE(&paletteram) |
| 458 | AM_RANGE(0xf000, 0xf7ff) AM_R | |
| 458 | AM_RANGE(0xf000, 0xf7ff) AM_R | |
| 459 | 459 | AM_RANGE(0xf800, 0xffff) AM_ROM /* schematics show a 2716 @ 2B here, but nobody used it */ |
| 460 | 460 | ADDRESS_MAP_END |
| 461 | 461 | |
| r2418 | r2419 | |
| 485 | 485 | static ADDRESS_MAP_START( spyhunt_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 486 | 486 | ADDRESS_MAP_UNMAP_HIGH |
| 487 | 487 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 488 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, spyhunt_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 489 | AM_RANGE(0xe800, 0xebff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, spyhunt_alpharam_w) AM_BASE(&spyhunt_alpharam) | |
| 488 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(spyhunt_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 489 | AM_RANGE(0xe800, 0xebff) AM_MIRROR(0x0400) AM_RAM_WRITE(spyhunt_alpharam_w) AM_BASE(&spyhunt_alpharam) | |
| 490 | 490 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 491 | 491 | AM_RANGE(0xf800, 0xf9ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 492 | 492 | AM_RANGE(0xfa00, 0xfa7f) AM_MIRROR(0x0180) AM_WRITE(mcr3_paletteram_w) AM_BASE(&paletteram) |
| r2418 | r2419 | |
| 1468 | 1468 | static DRIVER_INIT( demoderm ) |
| 1469 | 1469 | { |
| 1470 | 1470 | mcr_common_init(MCR_TURBO_CHIP_SQUEAK); |
| 1471 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, demoderm_ip1_r); | |
| 1472 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, demoderm_ip2_r); | |
| 1473 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, demoderm_op6_w); | |
| 1471 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, demoderm_ip1_r); | |
| 1472 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, demoderm_ip2_r); | |
| 1473 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, demoderm_op6_w); | |
| 1474 | 1474 | } |
| 1475 | 1475 | |
| 1476 | 1476 | |
| 1477 | 1477 | static DRIVER_INIT( sarge ) |
| 1478 | 1478 | { |
| 1479 | 1479 | mcr_common_init(MCR_TURBO_CHIP_SQUEAK); |
| 1480 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, turbocs_data_w); | |
| 1480 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, turbocs_data_w); | |
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | 1483 | |
| 1484 | 1484 | static DRIVER_INIT( maxrpm ) |
| 1485 | 1485 | { |
| 1486 | 1486 | mcr_common_init(MCR_TURBO_CHIP_SQUEAK); |
| 1487 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, maxrpm_ip1_r); | |
| 1488 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, maxrpm_ip2_r); | |
| 1489 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, maxrpm_op5_w); | |
| 1490 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, maxrpm_op6_w); | |
| 1487 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, maxrpm_ip1_r); | |
| 1488 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, maxrpm_ip2_r); | |
| 1489 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, maxrpm_op5_w); | |
| 1490 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, maxrpm_op6_w); | |
| 1491 | 1491 | |
| 1492 | 1492 | state_save_register_global(maxrpm_adc_control); |
| 1493 | 1493 | state_save_register_global(maxrpm_adc_select); |
| r2418 | r2419 | |
| 1500 | 1500 | static DRIVER_INIT( rampage ) |
| 1501 | 1501 | { |
| 1502 | 1502 | mcr_common_init(MCR_SOUNDS_GOOD); |
| 1503 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, rampage_ip4_r); | |
| 1504 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, rampage_op6_w); | |
| 1503 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, rampage_ip4_r); | |
| 1504 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, rampage_op6_w); | |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | 1507 | |
| 1508 | 1508 | static DRIVER_INIT( powerdrv ) |
| 1509 | 1509 | { |
| 1510 | 1510 | mcr_common_init(MCR_SOUNDS_GOOD); |
| 1511 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, powerdrv_ip2_r); | |
| 1512 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, powerdrv_op5_w); | |
| 1513 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, powerdrv_op6_w); | |
| 1511 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, powerdrv_ip2_r); | |
| 1512 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, powerdrv_op5_w); | |
| 1513 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, powerdrv_op6_w); | |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | |
| 1517 | 1517 | static DRIVER_INIT( stargrds ) |
| 1518 | 1518 | { |
| 1519 | 1519 | mcr_common_init(MCR_SOUNDS_GOOD); |
| 1520 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, stargrds_ip0_r); | |
| 1521 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, stargrds_op5_w); | |
| 1522 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, stargrds_op6_w); | |
| 1520 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, stargrds_ip0_r); | |
| 1521 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, stargrds_op5_w); | |
| 1522 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, stargrds_op6_w); | |
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | |
| r2418 | r2419 | |
| 1558 | 1558 | cpunum_suspend(1, SUSPEND_REASON_DISABLE, 1); |
| 1559 | 1559 | |
| 1560 | 1560 | /* kludge for bad ROM read */ |
| 1561 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r); | |
| 1561 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r); | |
| 1562 | 1562 | } |
| 1563 | 1563 | |
| 1564 | 1564 |
| r2418 | r2419 | |
|---|---|---|
| 217 | 217 | static ADDRESS_MAP_START( cpu0_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 218 | 218 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 219 | 219 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 220 | AM_RANGE(0x8800, 0x97ff) AM_READWRITE(SMH_RAM, vram1_w) AM_BASE(&vram1) | |
| 221 | AM_RANGE(0x9800, 0xa7ff) AM_READWRITE(SMH_RAM, vram2_w) AM_BASE(&vram2) | |
| 220 | AM_RANGE(0x8800, 0x97ff) AM_RAM_WRITE(vram1_w) AM_BASE(&vram1) | |
| 221 | AM_RANGE(0x9800, 0xa7ff) AM_RAM_WRITE(vram2_w) AM_BASE(&vram2) | |
| 222 | 222 | AM_RANGE(0xb800, 0xb803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 223 | 223 | AM_RANGE(0xb810, 0xb813) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 224 | 224 | AM_RANGE(0xb830, 0xb830) AM_NOP |
| r2418 | r2419 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | static ADDRESS_MAP_START( pengo_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 99 | 99 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 100 | AM_RANGE(0x8000, 0x83ff) AM_READWRITE(SMH_RAM, pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) /* video and color RAM, scratchpad RAM, sprite codes */ | |
| 101 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(SMH_RAM, pacman_colorram_w) AM_BASE(&colorram) | |
| 100 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) /* video and color RAM, scratchpad RAM, sprite codes */ | |
| 101 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pacman_colorram_w) AM_BASE(&colorram) | |
| 102 | 102 | AM_RANGE(0x8800, 0x8fef) AM_RAM |
| 103 | 103 | AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 104 | 104 | AM_RANGE(0x9000, 0x901f) AM_WRITE(pacman_sound_w) AM_BASE(&pacman_soundregs) |
| r2418 | r2419 | |
| 120 | 120 | |
| 121 | 121 | static ADDRESS_MAP_START( jrpacmbl_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 122 | 122 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 123 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 123 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 124 | 124 | AM_RANGE(0x8800, 0x8fef) AM_RAM |
| 125 | 125 | AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 126 | 126 | AM_RANGE(0x9000, 0x901f) AM_WRITE(pacman_sound_w) AM_BASE(&pacman_soundregs) |
| r2418 | r2419 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 68 | 68 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 69 | AM_RANGE(0x200000, 0x2007ff) AM_READWRITE(SMH_RAM, stadhero_pf1_data_w) AM_BASE(&stadhero_pf1_data) | |
| 70 | AM_RANGE(0x240000, 0x240007) AM_READWRITE(SMH_RAM, SMH_RAM) AM_BASE(&stadhero_pf2_control_0) | |
| 69 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(stadhero_pf1_data_w) AM_BASE(&stadhero_pf1_data) | |
| 70 | AM_RANGE(0x240000, 0x240007) AM_RAM_WRITE(SMH_RAM) AM_BASE(&stadhero_pf2_control_0) | |
| 71 | 71 | AM_RANGE(0x240010, 0x240017) AM_WRITE(SMH_RAM) AM_BASE(&stadhero_pf2_control_1) |
| 72 | 72 | AM_RANGE(0x260000, 0x261fff) AM_READWRITE(stadhero_pf2_data_r, stadhero_pf2_data_w) |
| 73 | 73 | AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w) |
| 74 | AM_RANGE(0x310000, 0x3107ff) AM_R | |
| 74 | AM_RANGE(0x310000, 0x3107ff) AM_R | |
| 75 | 75 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */ |
| 76 | 76 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_BASE(&spriteram16) |
| 77 | 77 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 371 | 371 | |
| 372 | 372 | static DRIVER_INIT( prehisle ) |
| 373 | 373 | { |
| 374 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, world_cycle_r); | |
| 374 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, world_cycle_r); | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | static READ16_HANDLER( usa_cycle_r ) |
| r2418 | r2419 | |
| 388 | 388 | |
| 389 | 389 | static DRIVER_INIT( prehislu ) |
| 390 | 390 | { |
| 391 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, usa_cycle_r); | |
| 391 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, usa_cycle_r); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | static READ16_HANDLER( jap_cycle_r ) |
| r2418 | r2419 | |
| 405 | 405 | |
| 406 | 406 | static DRIVER_INIT( gensitou ) |
| 407 | 407 | { |
| 408 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, jap_cycle_r); | |
| 408 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, jap_cycle_r); | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /******************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 178 | 178 | AM_RANGE(0x8600, 0x8600) AM_RAM /* video attribute */ |
| 179 | 179 | AM_RANGE(0x8700, 0x8700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w) |
| 180 | 180 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1) |
| 181 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3) | |
| 182 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(SMH_RAM, marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2) | |
| 183 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(SMH_RAM, marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram) | |
| 181 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3) | |
| 182 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2) | |
| 183 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram) | |
| 184 | 184 | ADDRESS_MAP_END |
| 185 | 185 | |
| 186 | 186 | static ADDRESS_MAP_START( marvins_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 187 | 187 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 188 | 188 | AM_RANGE(0x8700, 0x8700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w) |
| 189 | 189 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE(1) |
| 190 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, marvins_background_ram_w) AM_SHARE(2) | |
| 191 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(SMH_RAM, marvins_foreground_ram_w) AM_SHARE(3) | |
| 192 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(SMH_RAM, marvins_text_ram_w) AM_SHARE(4) | |
| 190 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2) | |
| 191 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) | |
| 192 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) | |
| 193 | 193 | ADDRESS_MAP_END |
| 194 | 194 | |
| 195 | 195 | |
| r2418 | r2419 | |
| 206 | 206 | // AM_RANGE(0xc800, 0xc800) AM_WRITE(marvins_palette_bank_w) // palette bank switch (c8f1 for Vanguard) |
| 207 | 207 | AM_RANGE(0xc800, 0xc8ff) AM_RAM |
| 208 | 208 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1) |
| 209 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3) | |
| 210 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(SMH_RAM, marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2) | |
| 211 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(SMH_RAM, marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram) | |
| 209 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3) | |
| 210 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2) | |
| 211 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram) | |
| 212 | 212 | ADDRESS_MAP_END |
| 213 | 213 | |
| 214 | 214 | static ADDRESS_MAP_START( madcrash_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 215 | 215 | AM_RANGE(0x8700, 0x8700) AM_WRITE(snk_cpuB_nmi_ack_w) /* Vangaurd II */ |
| 216 | 216 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 217 | 217 | AM_RANGE(0xa000, 0xa000) AM_WRITE(snk_cpuB_nmi_ack_w) /* Mad Crasher */ |
| 218 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(SMH_RAM, marvins_foreground_ram_w) AM_SHARE(3) | |
| 219 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, marvins_text_ram_w) AM_SHARE(4) | |
| 218 | AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) | |
| 219 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) | |
| 220 | 220 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE(1) |
| 221 | AM_RANGE(0xf000, 0xffff) AM_R | |
| 221 | AM_RANGE(0xf000, 0xffff) AM_R | |
| 222 | 222 | ADDRESS_MAP_END |
| 223 | 223 | |
| 224 | 224 |
| r2418 | r2419 | |
|---|---|---|
| 156 | 156 | static DRIVER_INIT( aladbl ) |
| 157 | 157 | { |
| 158 | 158 | // 220000 = writes to mcu? 330000 = reads? |
| 159 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w); | |
| 160 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r); | |
| 159 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w); | |
| 160 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r); | |
| 161 | 161 | DRIVER_INIT_CALL(megadrij); |
| 162 | 162 | } |
| 163 | 163 |
| r2418 | r2419 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 82 | 82 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 83 | AM_RANGE(0x080000, 0x080fff) AM_RAM AM_WRITE(wwfsstar_fg0_videoram_w) AM_BASE(&wwfsstar_fg0_videoram) /* FG0 Ram */ | |
| 84 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_WRITE(wwfsstar_bg0_videoram_w) AM_BASE(&wwfsstar_bg0_videoram) /* BG0 Ram */ | |
| 83 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(wwfsstar_fg0_videoram_w) AM_BASE(&wwfsstar_fg0_videoram) /* FG0 Ram */ | |
| 84 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(wwfsstar_bg0_videoram_w) AM_BASE(&wwfsstar_bg0_videoram) /* BG0 Ram */ | |
| 85 | 85 | AM_RANGE(0x100000, 0x1003ff) AM_RAM AM_BASE(&spriteram16) /* SPR Ram */ |
| 86 | 86 | AM_RANGE(0x140000, 0x140fff) AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) |
| 87 | 87 | AM_RANGE(0x180000, 0x180003) AM_WRITE(wwfsstar_irqack_w) |
| r2418 | r2419 | |
|---|---|---|
| 98 | 98 | AM_RANGE(0x072000, 0x0727ff) AM_READWRITE(actfancr_pf2_data_r, actfancr_pf2_data_w) AM_BASE(&actfancr_pf2_data) |
| 99 | 99 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 100 | 100 | AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w) |
| 101 | AM_RANGE(0x120000, 0x1205ff) AM_R | |
| 101 | AM_RANGE(0x120000, 0x1205ff) AM_R | |
| 102 | 102 | AM_RANGE(0x130000, 0x130003) AM_READ(actfan_control_1_r) |
| 103 | 103 | AM_RANGE(0x140000, 0x140001) AM_READ(actfan_control_0_r) |
| 104 | 104 | AM_RANGE(0x150000, 0x150001) AM_WRITE(actfancr_sound_w) |
| r2418 | r2419 | |
| 116 | 116 | AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w) |
| 117 | 117 | AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w) |
| 118 | 118 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 119 | AM_RANGE(0x130000, 0x1305ff) AM_R | |
| 119 | AM_RANGE(0x130000, 0x1305ff) AM_R | |
| 120 | 120 | AM_RANGE(0x140000, 0x140001) AM_READNOP /* Value doesn't matter */ |
| 121 | 121 | AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(&actfancr_ram) /* Main ram */ |
| 122 | 122 | AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(triothep_control_r, triothep_control_select_w) |
| r2418 | r2419 | |
| 637 | 637 | |
| 638 | 638 | static DRIVER_INIT( actfancr ) |
| 639 | 639 | { |
| 640 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cycle_r); | |
| 640 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cycle_r); | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | static DRIVER_INIT( actfancj ) |
| 644 | 644 | { |
| 645 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cyclej_r); | |
| 645 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cyclej_r); | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 |
| r2418 | r2419 | |
|---|---|---|
| 890 | 890 | AM_RANGE(0x100000, 0x1fffff) AM_ROMBANK(1) |
| 891 | 891 | AM_RANGE(0x200000, 0x2fffff) AM_ROM |
| 892 | 892 | |
| 893 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SMH_RAM, mr2_w) AM_BASE(&mr2) | |
| 894 | AM_RANGE(0x500000, 0x53ffff) AM_READWRITE(SMH_RAM, mr_w) AM_BASE(&mr) | |
| 893 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(mr2_w) AM_BASE(&mr2) | |
| 894 | AM_RANGE(0x500000, 0x53ffff) AM_RAM_WRITE(mr_w) AM_BASE(&mr) | |
| 895 | 895 | |
| 896 | AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(SMH_RAM, md0_w) AM_BASE(&model1_display_list0) | |
| 897 | AM_RANGE(0x610000, 0x61ffff) AM_READWRITE(SMH_RAM, md1_w) AM_BASE(&model1_display_list1) | |
| 896 | AM_RANGE(0x600000, 0x60ffff) AM_RAM_WRITE(md0_w) AM_BASE(&model1_display_list0) | |
| 897 | AM_RANGE(0x610000, 0x61ffff) AM_RAM_WRITE(md1_w) AM_BASE(&model1_display_list1) | |
| 898 | 898 | AM_RANGE(0x680000, 0x680003) AM_READWRITE(model1_listctl_r, model1_listctl_w) |
| 899 | 899 | |
| 900 | 900 | AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(sys24_tile_r, sys24_tile_w) |
| r2418 | r2419 | |
| 904 | 904 | AM_RANGE(0x770000, 0x770001) AM_WRITENOP // Video synchronization switch |
| 905 | 905 | AM_RANGE(0x780000, 0x7fffff) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 906 | 906 | |
| 907 | AM_RANGE(0x900000, 0x903fff) AM_R | |
| 907 | AM_RANGE(0x900000, 0x903fff) AM_R | |
| 908 | 908 | AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_BASE(&model1_color_xlat) |
| 909 | 909 | |
| 910 | 910 | AM_RANGE(0xc00000, 0xc0003f) AM_READ(io_r) AM_WRITENOP |
| r2418 | r2419 | |
| 938 | 938 | AM_RANGE(0x100000, 0x1fffff) AM_ROMBANK(1) |
| 939 | 939 | AM_RANGE(0x200000, 0x2fffff) AM_ROM |
| 940 | 940 | |
| 941 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SMH_RAM, mr2_w) AM_BASE(&mr2) | |
| 942 | AM_RANGE(0x500000, 0x53ffff) AM_READWRITE(SMH_RAM, mr_w) AM_BASE(&mr) | |
| 941 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(mr2_w) AM_BASE(&mr2) | |
| 942 | AM_RANGE(0x500000, 0x53ffff) AM_RAM_WRITE(mr_w) AM_BASE(&mr) | |
| 943 | 943 | |
| 944 | AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(SMH_RAM, md0_w) AM_BASE(&model1_display_list0) | |
| 945 | AM_RANGE(0x610000, 0x61ffff) AM_READWRITE(SMH_RAM, md1_w) AM_BASE(&model1_display_list1) | |
| 944 | AM_RANGE(0x600000, 0x60ffff) AM_RAM_WRITE(md0_w) AM_BASE(&model1_display_list0) | |
| 945 | AM_RANGE(0x610000, 0x61ffff) AM_RAM_WRITE(md1_w) AM_BASE(&model1_display_list1) | |
| 946 | 946 | AM_RANGE(0x680000, 0x680003) AM_READWRITE(model1_listctl_r, model1_listctl_w) |
| 947 | 947 | |
| 948 | 948 | AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(sys24_tile_r, sys24_tile_w) |
| r2418 | r2419 | |
| 952 | 952 | AM_RANGE(0x770000, 0x770001) AM_WRITENOP // Video synchronization switch |
| 953 | 953 | AM_RANGE(0x780000, 0x7fffff) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 954 | 954 | |
| 955 | AM_RANGE(0x900000, 0x903fff) AM_R | |
| 955 | AM_RANGE(0x900000, 0x903fff) AM_R | |
| 956 | 956 | AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_BASE(&model1_color_xlat) |
| 957 | 957 | |
| 958 | 958 | AM_RANGE(0xc00000, 0xc0003f) AM_READ(io_r) AM_WRITENOP |
| r2418 | r2419 | |
|---|---|---|
| 1687 | 1687 | polepos_gear_bit = 0x20; |
| 1688 | 1688 | |
| 1689 | 1689 | /* extra direct mapped inputs read */ |
| 1690 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_5_r); | |
| 1691 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_0_r); | |
| 1692 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_1_r); | |
| 1690 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_5_r); | |
| 1691 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_0_r); | |
| 1692 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_1_r); | |
| 1693 | 1693 | |
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | 1696 | static DRIVER_INIT( polepos2 ) |
| 1697 | 1697 | { |
| 1698 | 1698 | /* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */ |
| 1699 | memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r); | |
| 1699 | memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r); | |
| 1700 | 1700 | |
| 1701 | 1701 | DRIVER_INIT_CALL(polepos); |
| 1702 | 1702 | } |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | static ADDRESS_MAP_START( slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 86 | 86 | AM_RANGE(0x2000, 0x2000) AM_WRITE(YM2151_register_port_0_w) |
| 87 | 87 | AM_RANGE(0x2001, 0x2001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) |
| 88 | AM_RANGE(0x4000, 0x43ff) AM_RAM | |
| 88 | AM_RANGE(0x4000, 0x43ff) AM_RAM | |
| 89 | 89 | AM_RANGE(0x6000, 0x605f) AM_RAM // SOUND RAM (Self test check 0x6000-605f, 0x7c00-0x7fff) |
| 90 | 90 | AM_RANGE(0x6060, 0x7fff) AM_RAM AM_SHARE(1) |
| 91 | 91 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r2418 | r2419 | |
|---|---|---|
| 176 | 176 | 0x00, 0x01, 0x00, 0x00, // CCR base (0x00000100) |
| 177 | 177 | }; |
| 178 | 178 | |
| 179 | static READ64_HANDLER(cf_card_data_r) | |
| 179 | static READ64_DEVICE_HANDLER(cf_card_data_r) | |
| 180 | 180 | { |
| 181 | 181 | UINT64 r = 0; |
| 182 | 182 | |
| r2418 | r2419 | |
| 186 | 186 | { |
| 187 | 187 | case 0x8: // Duplicate Even RD Data |
| 188 | 188 | { |
| 189 | r |= ide_bus_ | |
| 189 | r |= ide_bus_ | |
| 190 | 190 | break; |
| 191 | 191 | } |
| 192 | 192 | |
| r2418 | r2419 | |
| 199 | 199 | return r; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | static WRITE64_HANDLER(cf_card_data_w) | |
| 202 | static WRITE64_DEVICE_HANDLER(cf_card_data_w) | |
| 203 | 203 | { |
| 204 | 204 | if (ACCESSING_BITS_16_31) |
| 205 | 205 | { |
| r2418 | r2419 | |
| 207 | 207 | { |
| 208 | 208 | case 0x8: // Duplicate Even RD Data |
| 209 | 209 | { |
| 210 | ide_bus_ | |
| 210 | ide_bus_ | |
| 211 | 211 | break; |
| 212 | 212 | } |
| 213 | 213 | |
| r2418 | r2419 | |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | static READ64_HANDLER(cf_card_r) | |
| 222 | static READ64_DEVICE_HANDLER(cf_card_r) | |
| 223 | 223 | { |
| 224 | 224 | UINT64 r = 0; |
| 225 | 225 | |
| r2418 | r2419 | |
| 238 | 238 | case 0x6: // Select Card/Head |
| 239 | 239 | case 0x7: // Status |
| 240 | 240 | { |
| 241 | r |= ide_bus_ | |
| 241 | r |= ide_bus_ | |
| 242 | 242 | break; |
| 243 | 243 | } |
| 244 | 244 | |
| r2418 | r2419 | |
| 247 | 247 | |
| 248 | 248 | case 0xd: // Duplicate Error |
| 249 | 249 | { |
| 250 | r |= ide_bus_ | |
| 250 | r |= ide_bus_ | |
| 251 | 251 | break; |
| 252 | 252 | } |
| 253 | 253 | case 0xe: // Alt Status |
| 254 | 254 | case 0xf: // Drive Address |
| 255 | 255 | { |
| 256 | r |= ide_bus_ | |
| 256 | r |= ide_bus_ | |
| 257 | 257 | break; |
| 258 | 258 | } |
| 259 | 259 | |
| r2418 | r2419 | |
| 282 | 282 | return r; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | static WRITE64_HANDLER(cf_card_w) | |
| 285 | static WRITE64_DEVICE_HANDLER(cf_card_w) | |
| 286 | 286 | { |
| 287 | 287 | //printf("compact_flash_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), activecpu_get_pc()); |
| 288 | 288 | |
| r2418 | r2419 | |
| 301 | 301 | case 0x6: // Select Card/Head |
| 302 | 302 | case 0x7: // Command |
| 303 | 303 | { |
| 304 | ide_bus_ | |
| 304 | ide_bus_ | |
| 305 | 305 | break; |
| 306 | 306 | } |
| 307 | 307 | |
| r2418 | r2419 | |
| 310 | 310 | |
| 311 | 311 | case 0xd: // Duplicate Features |
| 312 | 312 | { |
| 313 | ide_bus_ | |
| 313 | ide_bus_ | |
| 314 | 314 | break; |
| 315 | 315 | } |
| 316 | 316 | case 0xe: // Device Ctl |
| 317 | 317 | case 0xf: // Reserved |
| 318 | 318 | { |
| 319 | ide_bus_ | |
| 319 | ide_bus_ | |
| 320 | 320 | break; |
| 321 | 321 | } |
| 322 | 322 | |
| r2418 | r2419 | |
| 342 | 342 | // cylinder low register is set to 0x00 |
| 343 | 343 | // cylinder high register is set to 0x00 |
| 344 | 344 | |
| 345 | ide_bus_ | |
| 345 | ide_bus_ | |
| 346 | 346 | } |
| 347 | 347 | break; |
| 348 | 348 | } |
| r2418 | r2419 | |
| 366 | 366 | |
| 367 | 367 | |
| 368 | 368 | |
| 369 | static READ64_HANDLER(ata_r) | |
| 369 | static READ64_DEVICE_HANDLER(ata_r) | |
| 370 | 370 | { |
| 371 | 371 | UINT64 r = 0; |
| 372 | 372 | |
| r2418 | r2419 | |
| 374 | 374 | { |
| 375 | 375 | int reg = (offset >> 4) & 0x7; |
| 376 | 376 | |
| 377 | r |= ide_bus_ | |
| 377 | r |= ide_bus_ | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | return r; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | static WRITE64_HANDLER(ata_w) | |
| 383 | static WRITE64_DEVICE_HANDLER(ata_w) | |
| 384 | 384 | { |
| 385 | 385 | if (ACCESSING_BITS_16_31) |
| 386 | 386 | { |
| 387 | 387 | int reg = (offset >> 4) & 0x7; |
| 388 | 388 | |
| 389 | ide_bus_ | |
| 389 | ide_bus_ | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| r2418 | r2419 | |
| 597 | 597 | AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE(voodoo3_io_r, voodoo3_io_w) |
| 598 | 598 | AM_RANGE(0xfec00000, 0xfedfffff) AM_READWRITE(pci_config_addr_r, pci_config_addr_w) |
| 599 | 599 | AM_RANGE(0xfee00000, 0xfeefffff) AM_READWRITE(pci_config_data_r, pci_config_data_w) |
| 600 | AM_RANGE(0xff300000, 0xff300fff) AM_READWRITE(ata_r, ata_w) | |
| 600 | AM_RANGE(0xff300000, 0xff300fff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ata_r, ata_w) | |
| 601 | 601 | AM_RANGE(0xffe10000, 0xffe10007) AM_READ(unk1_r) |
| 602 | 602 | AM_RANGE(0xffe30000, 0xffe31fff) AM_READWRITE(m48t58_r, m48t58_w) |
| 603 | 603 | AM_RANGE(0xffe40000, 0xffe4000f) AM_NOP |
| r2418 | r2419 | |
| 625 | 625 | { |
| 626 | 626 | |
| 627 | 627 | } |
| 628 | ||
| 629 | static void ide_interrupt(const device_config *device, int state) | |
| 630 | { | |
| 631 | } | |
| 632 | ||
| 628 | 633 | static MACHINE_RESET(viper) |
| 629 | 634 | { |
| 630 | | |
| 635 | | |
| 631 | 636 | } |
| 632 | 637 | |
| 633 | 638 | static MACHINE_DRIVER_START(viper) |
| r2418 | r2419 | |
| 642 | 647 | |
| 643 | 648 | MDRV_NVRAM_HANDLER(timekeeper_0) |
| 644 | 649 | |
| 650 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 651 | ||
| 645 | 652 | /* video hardware */ |
| 646 | 653 | MDRV_SCREEN_ADD("main", RASTER) |
| 647 | 654 | MDRV_SCREEN_REFRESH_RATE(60) |
| r2418 | r2419 | |
| 661 | 668 | |
| 662 | 669 | /*****************************************************************************/ |
| 663 | 670 | |
| 664 | static void ide_interrupt(int state) | |
| 665 | { | |
| 666 | } | |
| 667 | ||
| 668 | 671 | static const struct pci_device_info mpc8240 = |
| 669 | 672 | { |
| 670 | 673 | mpc8240_pci_r, |
| r2418 | r2419 | |
| 677 | 680 | voodoo3_pci_w |
| 678 | 681 | }; |
| 679 | 682 | |
| 680 | static const struct ide_interface ide_intf = | |
| 681 | { | |
| 682 | ide_interrupt | |
| 683 | }; | |
| 684 | ||
| 685 | 683 | static DRIVER_INIT(viper) |
| 686 | 684 | { |
| 687 | 685 | UINT8 *nvram; |
| r2418 | r2419 | |
| 690 | 688 | pci_add_device(0, 0, &mpc8240); |
| 691 | 689 | pci_add_device(0, 12, &voodoo3); |
| 692 | 690 | |
| 693 | ide_controller_init(0, &ide_intf); | |
| 694 | ||
| 695 | 691 | timekeeper_init(0, TIMEKEEPER_M48T58, backup_ram); |
| 696 | 692 | |
| 697 | 693 | nvram = memory_region(REGION_USER2); |
| r2418 | r2419 | |
| 700 | 696 | |
| 701 | 697 | static DRIVER_INIT(vipercf) |
| 702 | 698 | { |
| 699 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 700 | ||
| 703 | 701 | DRIVER_INIT_CALL(viper); |
| 704 | 702 | |
| 705 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r ); | |
| 706 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_w ); | |
| 707 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_r ); | |
| 708 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_w ); | |
| 703 | memory_install_readwrite64_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r, cf_card_data_w ); | |
| 704 | memory_install_readwrite64_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_r, cf_card_w ); | |
| 709 | 705 | } |
| 710 | 706 | |
| 711 | 707 | static DRIVER_INIT(ppp2nd) |
| r2418 | r2419 | |
|---|---|---|
| 56 | 56 | AM_RANGE(0x100000, 0x100003) AM_WRITE(vaportra_priority_w) |
| 57 | 57 | AM_RANGE(0x100006, 0x100007) AM_WRITE(vaportra_sound_w) |
| 58 | 58 | AM_RANGE(0x100000, 0x10000f) AM_READ(vaportra_control_r) |
| 59 | AM_RANGE(0x200000, 0x201fff) AM_RAM AM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data) | |
| 60 | AM_RANGE(0x202000, 0x203fff) AM_RAM AM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data) | |
| 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 | 61 | AM_RANGE(0x240000, 0x24000f) AM_WRITE(SMH_RAM) AM_BASE(&deco16_pf34_control) |
| 62 | AM_RANGE(0x280000, 0x281fff) AM_RAM AM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) | |
| 63 | AM_RANGE(0x282000, 0x283fff) AM_RAM AM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) | |
| 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 | 64 | AM_RANGE(0x2c0000, 0x2c000f) AM_WRITE(SMH_RAM) AM_BASE(&deco16_pf12_control) |
| 65 | AM_RANGE(0x300000, 0x3009ff) AM_RAM AM_WRITE(vaportra_palette_24bit_rg_w) AM_BASE(&paletteram16) | |
| 66 | AM_RANGE(0x304000, 0x3049ff) AM_RAM AM_WRITE(vaportra_palette_24bit_b_w) AM_BASE(&paletteram16_2) | |
| 65 | AM_RANGE(0x300000, 0x3009ff) AM_RAM_WRITE(vaportra_palette_24bit_rg_w) AM_BASE(&paletteram16) | |
| 66 | AM_RANGE(0x304000, 0x3049ff) AM_RAM_WRITE(vaportra_palette_24bit_b_w) AM_BASE(&paletteram16_2) | |
| 67 | 67 | AM_RANGE(0x308000, 0x308001) AM_NOP |
| 68 | 68 | AM_RANGE(0x30c000, 0x30c001) AM_WRITE(buffer_spriteram16_w) |
| 69 | 69 | AM_RANGE(0xff8000, 0xff87ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
|---|---|---|
| 294 | 294 | AM_RANGE(0x0000, 0xffff) AM_WRITE(lnc_w) /* override the following entries to */ |
| 295 | 295 | /* support ROM decryption */ |
| 296 | 296 | AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase) |
| 297 | AM_RANGE(0x3c00, 0x3fff) AM_R | |
| 297 | AM_RANGE(0x3c00, 0x3fff) AM_R | |
| 298 | 298 | AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram) /* this is just here to initialize the pointer */ |
| 299 | 299 | AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w) |
| 300 | 300 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(input_port_3_r, SMH_NOP) /* ??? */ |
| r2418 | r2419 | |
| 311 | 311 | AM_RANGE(0x0000, 0xffff) AM_WRITE(mmonkey_w) /* override the following entries to */ |
| 312 | 312 | /* support ROM decryption */ |
| 313 | 313 | AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase) |
| 314 | AM_RANGE(0x3c00, 0x3fff) AM_R | |
| 314 | AM_RANGE(0x3c00, 0x3fff) AM_R | |
| 315 | 315 | AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram) /* this is just here to initialize the pointer */ |
| 316 | 316 | AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w) |
| 317 | 317 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_3_r) |
| r2418 | r2419 | |
| 346 | 346 | AM_RANGE(0x0000, 0xffff) AM_WRITE(disco_w) /* override the following entries to */ |
| 347 | 347 | /* support ROM decryption */ |
| 348 | 348 | AM_RANGE(0x0000, 0x04ff) AM_RAM AM_BASE(&rambase) |
| 349 | AM_RANGE(0x2000, 0x7fff) AM_R | |
| 349 | AM_RANGE(0x2000, 0x7fff) AM_R | |
| 350 | 350 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) |
| 351 | 351 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&btime_colorram) |
| 352 | 352 | AM_RANGE(0x8800, 0x881f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
| 1753 | 1753 | static DRIVER_INIT( wtennis ) |
| 1754 | 1754 | { |
| 1755 | 1755 | memcpy(&audio_rambase[0x200], memory_region(REGION_CPU2) + 0xf200, 0x200); |
| 1756 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r); | |
| 1756 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r); | |
| 1757 | 1757 | decrypt_C10707_cpu(0, REGION_CPU1); |
| 1758 | 1758 | } |
| 1759 | 1759 |
| r2418 | r2419 | |
|---|---|---|
| 211 | 211 | #define IDE_STD_OFFSET (0x1f0/2) |
| 212 | 212 | #define IDE_ALT_OFFSET (0x3f6/2) |
| 213 | 213 | |
| 214 | static READ16_HANDLER( ide_std_r ) | |
| 214 | static READ16_DEVICE_HANDLER( ide_std_r ) | |
| 215 | 215 | { |
| 216 | 216 | if (offset & 0x01) |
| 217 | return ide_controller16_ | |
| 217 | return ide_controller16_ | |
| 218 | 218 | else |
| 219 | return ide_controller16_ | |
| 219 | return ide_controller16_ | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | static WRITE16_HANDLER( ide_std_w ) | |
| 222 | static WRITE16_DEVICE_HANDLER( ide_std_w ) | |
| 223 | 223 | { |
| 224 | 224 | if (offset & 0x01) |
| 225 | ide_controller16_ | |
| 225 | ide_controller16_ | |
| 226 | 226 | else |
| 227 | ide_controller16_ | |
| 227 | ide_controller16_ | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | static READ16_HANDLER( ide_alt_r ) | |
| 230 | static READ16_DEVICE_HANDLER( ide_alt_r ) | |
| 231 | 231 | { |
| 232 | 232 | if (offset == 0) |
| 233 | return ide_controller16_ | |
| 233 | return ide_controller16_ | |
| 234 | 234 | |
| 235 | 235 | return 0; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | static WRITE16_HANDLER( ide_alt_w ) | |
| 238 | static WRITE16_DEVICE_HANDLER( ide_alt_w ) | |
| 239 | 239 | { |
| 240 | 240 | if (offset == 0) |
| 241 | ide_controller16_ | |
| 241 | ide_controller16_ | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| 245 | static READ16_HANDLER( gp2_ide_std_r ) | |
| 245 | static READ16_DEVICE_HANDLER( gp2_ide_std_r ) | |
| 246 | 246 | { |
| 247 | 247 | if (offset & 0x01) |
| 248 | 248 | { |
| r2418 | r2419 | |
| 260 | 260 | break; |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | return ide_controller16_ | |
| 263 | return ide_controller16_ | |
| 264 | 264 | } else { |
| 265 | return ide_controller16_ | |
| 265 | return ide_controller16_ | |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| r2418 | r2419 | |
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | static void ide_interrupt(int state) | |
| 293 | static void ide_interrupt(const device_config *device, int state) | |
| 294 | 294 | { |
| 295 | 295 | if (control & 0x0008) |
| 296 | 296 | { |
| 297 | 297 | if (state != CLEAR_LINE) |
| 298 | cpunum_set_input_line( | |
| 298 | cpunum_set_input_line(device->machine, 0, 4, HOLD_LINE); | |
| 299 | 299 | else |
| 300 | cpunum_set_input_line( | |
| 300 | cpunum_set_input_line(device->machine, 0, 4, CLEAR_LINE); | |
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
| r2418 | r2419 | |
| 316 | 316 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | static void gp2_ide_interrupt(int state) | |
| 319 | static void gp2_ide_interrupt(const device_config *device, int state) | |
| 320 | 320 | { |
| 321 | 321 | if (control & 0x0010) |
| 322 | 322 | { |
| r2418 | r2419 | |
| 325 | 325 | if (gp2_irq_control) |
| 326 | 326 | gp2_irq_control = 0; |
| 327 | 327 | else |
| 328 | cpunum_set_input_line( | |
| 328 | cpunum_set_input_line(device->machine, 0, 5, HOLD_LINE); | |
| 329 | 329 | } else { |
| 330 | cpunum_set_input_line( | |
| 330 | cpunum_set_input_line(device->machine, 0, 5, CLEAR_LINE); | |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | } |
| r2418 | r2419 | |
| 351 | 351 | AM_RANGE(0x880000, 0x881fff) AM_READ(K056832_ram_word_r) /* vram */ |
| 352 | 352 | AM_RANGE(0x882000, 0x883fff) AM_READ(K056832_ram_word_r) /* vram (mirror) */ |
| 353 | 353 | AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */ |
| 354 | AM_RANGE(0xa00000, 0xa0000f) AM_READ(ide_std_r) /* IDE control regs */ | |
| 355 | AM_RANGE(0xa4000c, 0xa4000f) AM_READ(ide_alt_r) /* IDE status control reg */ | |
| 354 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_std_r) /* IDE control regs */ | |
| 355 | AM_RANGE(0xa4000c, 0xa4000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_alt_r) /* IDE status control reg */ | |
| 356 | 356 | AM_RANGE(0xc00000, 0xcbffff) AM_READ(sndram_r) /* sound ram */ |
| 357 | 357 | ADDRESS_MAP_END |
| 358 | 358 | |
| r2418 | r2419 | |
| 370 | 370 | AM_RANGE(0x800000, 0x80045f) AM_WRITE(k054539_word_w) /* sound regs */ |
| 371 | 371 | AM_RANGE(0x880000, 0x881fff) AM_WRITE(K056832_ram_word_w) /* vram */ |
| 372 | 372 | AM_RANGE(0x882000, 0x883fff) AM_WRITE(K056832_ram_word_w) /* vram (mirror) */ |
| 373 | AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(ide_std_w) /* IDE control regs */ | |
| 374 | AM_RANGE(0xa4000c, 0xa4000f) AM_WRITE(ide_alt_w) /* IDE status control reg */ | |
| 373 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_std_w) /* IDE control regs */ | |
| 374 | AM_RANGE(0xa4000c, 0xa4000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_alt_w) /* IDE status control reg */ | |
| 375 | 375 | AM_RANGE(0xc00000, 0xcbffff) AM_WRITE(sndram_w) /* sound ram */ |
| 376 | 376 | ADDRESS_MAP_END |
| 377 | 377 | |
| r2418 | r2419 | |
| 388 | 388 | AM_RANGE(0x880000, 0x881fff) AM_READ(gp2_vram_r) /* vram */ |
| 389 | 389 | AM_RANGE(0x89f000, 0x8a0fff) AM_READ(gp2_vram_mirror_r) /* vram (mirror) */ |
| 390 | 390 | AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */ |
| 391 | AM_RANGE(0xa00000, 0xa0000f) AM_READ(gp2_ide_std_r) /* IDE control regs */ | |
| 392 | AM_RANGE(0xa4000c, 0xa4000f) AM_READ(ide_alt_r) /* IDE status control reg */ | |
| 391 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVREAD(IDE_CONTROLLER, "ide", gp2_ide_std_r) /* IDE control regs */ | |
| 392 | AM_RANGE(0xa4000c, 0xa4000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_alt_r) /* IDE status control reg */ | |
| 393 | 393 | AM_RANGE(0xc00000, 0xcbffff) AM_READ(sndram_r) /* sound ram */ |
| 394 | 394 | ADDRESS_MAP_END |
| 395 | 395 | |
| r2418 | r2419 | |
| 407 | 407 | AM_RANGE(0x800000, 0x80045f) AM_WRITE(k054539_word_w) /* sound regs */ |
| 408 | 408 | AM_RANGE(0x880000, 0x881fff) AM_WRITE(gp2_vram_w) /* vram */ |
| 409 | 409 | AM_RANGE(0x89f000, 0x8a0fff) AM_WRITE(gp2_vram_mirror_w) /* vram (mirror) */ |
| 410 | AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(ide_std_w) /* IDE control regs */ | |
| 411 | AM_RANGE(0xa4000c, 0xa4000f) AM_WRITE(ide_alt_w) /* IDE status control reg */ | |
| 410 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_std_w) /* IDE control regs */ | |
| 411 | AM_RANGE(0xa4000c, 0xa4000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_alt_w) /* IDE status control reg */ | |
| 412 | 412 | AM_RANGE(0xc00000, 0xcbffff) AM_WRITE(sndram_w) /* sound ram */ |
| 413 | 413 | ADDRESS_MAP_END |
| 414 | 414 | |
| r2418 | r2419 | |
| 589 | 589 | |
| 590 | 590 | /************************************* |
| 591 | 591 | * |
| 592 | * IDE interfaces | |
| 593 | * | |
| 594 | *************************************/ | |
| 595 | ||
| 596 | static const struct ide_interface ide_intf = | |
| 597 | { | |
| 598 | ide_interrupt, | |
| 599 | }; | |
| 600 | ||
| 601 | static const struct ide_interface gp2_ide_intf = | |
| 602 | { | |
| 603 | gp2_ide_interrupt, | |
| 604 | }; | |
| 605 | ||
| 606 | ||
| 607 | /************************************* | |
| 608 | * | |
| 609 | 592 | * Sound interfaces |
| 610 | 593 | * |
| 611 | 594 | *************************************/ |
| r2418 | r2419 | |
| 648 | 631 | |
| 649 | 632 | /* reset the IDE controller */ |
| 650 | 633 | gp2_irq_control = 0; |
| 651 | | |
| 634 | | |
| 652 | 635 | } |
| 653 | 636 | |
| 654 | 637 | static MACHINE_RESET( qdrmfgp2 ) |
| r2418 | r2419 | |
| 660 | 643 | |
| 661 | 644 | /* reset the IDE controller */ |
| 662 | 645 | gp2_irq_control = 0; |
| 663 | | |
| 646 | | |
| 664 | 647 | } |
| 665 | 648 | |
| 666 | 649 | |
| r2418 | r2419 | |
| 681 | 664 | MDRV_MACHINE_RESET(qdrmfgp) |
| 682 | 665 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 683 | 666 | |
| 667 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 668 | ||
| 684 | 669 | /* video hardware */ |
| 685 | 670 | MDRV_SCREEN_ADD("main", RASTER) |
| 686 | 671 | MDRV_SCREEN_REFRESH_RATE(60) |
| r2418 | r2419 | |
| 714 | 699 | MDRV_MACHINE_RESET(qdrmfgp2) |
| 715 | 700 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 716 | 701 | |
| 702 | MDRV_IDE_CONTROLLER_ADD("ide", 0, gp2_ide_interrupt) | |
| 703 | ||
| 717 | 704 | /* video hardware */ |
| 718 | 705 | MDRV_SCREEN_ADD("main", RASTER) |
| 719 | 706 | MDRV_SCREEN_REFRESH_RATE(60) |
| r2418 | r2419 | |
| 780 | 767 | |
| 781 | 768 | /************************************* |
| 782 | 769 | * |
| 783 | * Driver-specific init | |
| 784 | * | |
| 785 | *************************************/ | |
| 786 | ||
| 787 | static DRIVER_INIT( qdrmfgp ) | |
| 788 | { | |
| 789 | /* spin up the hard disk */ | |
| 790 | ide_controller_init(0, &ide_intf); | |
| 791 | } | |
| 792 | ||
| 793 | static DRIVER_INIT( qdrmfgp2 ) | |
| 794 | { | |
| 795 | /* spin up the hard disk */ | |
| 796 | ide_controller_init(0, &gp2_ide_intf); | |
| 797 | } | |
| 798 | ||
| 799 | /************************************* | |
| 800 | * | |
| 801 | 770 | * Game drivers |
| 802 | 771 | * |
| 803 | 772 | *************************************/ |
| 804 | 773 | |
| 805 | 774 | /* year rom clone machine inputs init */ |
| 806 | GAME( 1994, qdrmfgp, 0, qdrmfgp, qdrmfgp, qdrmfgp, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix (Japan)", 0 ) | |
| 807 | GAME( 1995, qdrmfgp2, 0, qdrmfgp2, qdrmfgp2, qdrmfgp2, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix2 - Shin-Kyoku Nyuukadayo (Japan)", 0 ) | |
| 775 | GAME( 1994, qdrmfgp, 0, qdrmfgp, qdrmfgp, 0, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix (Japan)", 0 ) | |
| 776 | GAME( 1995, qdrmfgp2, 0, qdrmfgp2, qdrmfgp2, 0, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix2 - Shin-Kyoku Nyuukadayo (Japan)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | #include "cps1.h" /* External CPS1 definitions */ |
| 163 | 163 | |
| 164 | READ16_HANDLER( cps1_ | |
| 164 | READ16_HANDLER( cps1_input_r ) | |
| 165 | 165 | { |
| 166 | static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" }; | |
| 167 | int control = input_port_read(machine, dswname[offset]); | |
| 168 | return control << 8 | control; | |
| 166 | static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" }; | |
| 167 | int in = input_port_read(machine, dswname[offset]); | |
| 168 | return in << 8; | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | READ16_HANDLER( cps1_in0_r ) | |
| 172 | { | |
| 173 | int buttons = input_port_read(machine, "IN0"); | |
| 174 | return buttons << 8 | buttons; | |
| 175 | } | |
| 176 | ||
| 177 | 171 | READ16_HANDLER( cps1_in1_r ) |
| 178 | 172 | { |
| 179 | 173 | int buttons = input_port_read(machine, "IN1"); |
| r2418 | r2419 | |
| 216 | 210 | } |
| 217 | 211 | |
| 218 | 212 | |
| 219 | static int cps1_sound_fade_timer; | |
| 220 | ||
| 221 | 213 | static WRITE8_HANDLER( cps1_snd_bankswitch_w ) |
| 222 | 214 | { |
| 223 | 215 | UINT8 *RAM = memory_region(REGION_CPU2); |
| r2418 | r2419 | |
| 236 | 228 | OKIM6295_set_pin7(0, (data & 1)); |
| 237 | 229 | } |
| 238 | 230 | |
| 239 | static WRITE16_HANDLER( cps1_sound | |
| 231 | static WRITE16_HANDLER( cps1_soundl | |
| 240 | 232 | { |
| 241 | 233 | if (ACCESSING_BITS_0_7) |
| 242 | | |
| 234 | | |
| 243 | 235 | } |
| 244 | 236 | |
| 245 | static RE | |
| 237 | static WRITE16 | |
| 246 | 238 | { |
| 247 | return cps1_sound_fade_timer; | |
| 248 | } | |
| 249 | ||
| 250 | static WRITE16_HANDLER( cps1_sound_command_w ) | |
| 251 | { | |
| 252 | 239 | if (ACCESSING_BITS_0_7) |
| 253 | soundlatch_w(machine,0,data & 0xff); | |
| 240 | soundlatch2_w(machine,0,data & 0xff); | |
| 254 | 241 | } |
| 255 | 242 | |
| 256 | 243 | WRITE16_HANDLER( cps1_coinctrl_w ) |
| r2418 | r2419 | |
| 263 | 250 | coin_counter_w(1,data & 0x0200); |
| 264 | 251 | coin_lockout_w(0,~data & 0x0400); |
| 265 | 252 | coin_lockout_w(1,~data & 0x0800); |
| 253 | ||
| 254 | // bit 15 = CPS-A custom reset? | |
| 266 | 255 | } |
| 267 | 256 | |
| 257 | // there's no trace of this in the Forgotten Worlds schematics | |
| 268 | 258 | if (ACCESSING_BITS_0_7) |
| 269 | 259 | { |
| 270 | 260 | /* mercs sets bit 0 */ |
| r2418 | r2419 | |
| 282 | 272 | coin_lockout_w(2,~data & 0x02); |
| 283 | 273 | coin_counter_w(3,data & 0x04); |
| 284 | 274 | coin_lockout_w(3,~data & 0x08); |
| 285 | /* | |
| 286 | { | |
| 287 | char baf[40]; | |
| 288 | sprintf(baf,"0xf1c004=%04x", data); | |
| 289 | popmessage(baf); | |
| 290 | } | |
| 291 | */ | |
| 292 | 275 | } |
| 293 | 276 | } |
| 294 | 277 | |
| r2418 | r2419 | |
| 449 | 432 | |
| 450 | 433 | |
| 451 | 434 | |
| 452 | static ADDRESS_MAP_START( cps1_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 453 | AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM) /* 68000 ROM */ | |
| 435 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 436 | AM_RANGE(0x000000, 0x1fffff) AM_ROM | |
| 454 | 437 | AM_RANGE(0x800000, 0x800001) AM_READ(cps1_in1_r) /* Player input ports */ |
| 455 | AM_RANGE(0x800010, 0x800011) AM_READ(cps1_in1_r) /* ?? */ | |
| 456 | AM_RANGE(0x800018, 0x800019) AM_READ(cps1_in0_r) /* System input ports */ | |
| 457 | AM_RANGE(0x80001a, 0x80001f) AM_READ(cps1_dsw_r) /* Dip Switches */ | |
| 458 | AM_RANGE(0x800020, 0x800021) AM_READ(SMH_NOP) /* ? Used by Rockman ? */ | |
| 438 | AM_RANGE(0x800010, 0x800011) AM_READ(cps1_in1_r) /* mirror? */ | |
| 439 | AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_input_r) /* System input ports / Dip Switches */ | |
| 440 | AM_RANGE(0x800020, 0x800021) AM_READNOP /* ? Used by Rockman ? */ | |
| 441 | AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w) | |
| 442 | AM_RANGE(0x800040, 0x800041) AM_WRITE(forgottn_dial_0_reset_w) | |
| 443 | AM_RANGE(0x800048, 0x800049) AM_WRITE(forgottn_dial_1_reset_w) | |
| 459 | 444 | AM_RANGE(0x800052, 0x800055) AM_READ(forgottn_dial_0_r) /* Forgotten Worlds */ |
| 460 | 445 | AM_RANGE(0x80005a, 0x80005d) AM_READ(forgottn_dial_1_r) /* Forgotten Worlds */ |
| 461 | AM_RANGE(0x800176, 0x800177) AM_READ(cps1_in2_r) /* Extra input ports */ | |
| 462 | AM_RANGE(0x800178, 0x800179) AM_READ(cps1_in3_r) /* Player 4 controls ("Captain Commando") */ | |
| 446 | AM_RANGE(0x800176, 0x800177) AM_READ(cps1_in2_r) /* Extra input ports (on C-board) */ | |
| 447 | AM_RANGE(0x800178, 0x800179) AM_READ(cps1_in3_r) /* Player 4 controls (on C-board) ("Captain Commando") */ | |
| 448 | AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w) /* Sound command */ | |
| 449 | AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ | |
| 463 | 450 | AM_RANGE(0x8001fc, 0x8001fd) AM_READ(cps1_in2_r) /* Extra input ports ("SF Rev E") */ |
| 464 | AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r) /* Output ports */ | |
| 465 | AM_RANGE(0x900000, 0x92ffff) AM_READ(SMH_RAM) /* SF2CE executes code from here */ | |
| 466 | AM_RANGE(0xf00000, 0xf0ffff) AM_READ(qsound_rom_r) /* Slammasters protection */ | |
| 467 | AM_RANGE(0xf18000, 0xf19fff) AM_READ(qsound_sharedram1_r) /* Q RAM */ | |
| 468 | AM_RANGE(0xf1c000, 0xf1c001) AM_READ(cps1_in2_r) /* Player 3 controls (later games) */ | |
| 469 | AM_RANGE(0xf1c002, 0xf1c003) AM_READ(cps1_in3_r) /* Player 4 controls ("Muscle Bombers") */ | |
| 470 | AM_RANGE(0xf1c006, 0xf1c007) AM_READ(cps1_eeprom_port_r) | |
| 471 | AM_RANGE(0xf1e000, 0xf1ffff) AM_READ(qsound_sharedram2_r) /* Q RAM */ | |
| 472 | AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM) /* RAM */ | |
| 451 | AM_RANGE(0x800100, 0x8001ff) AM_READWRITE(cps1_output_r, cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size) /* CPS-B custom */ | |
| 452 | AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ | |
| 453 | AM_RANGE(0xff0000, 0xffffff) AM_RAM | |
| 473 | 454 | ADDRESS_MAP_END |
| 474 | 455 | |
| 475 | static ADDRESS_MAP_START( cps1_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 476 | AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM) /* ROM */ | |
| 477 | AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w) | |
| 478 | AM_RANGE(0x800040, 0x800041) AM_WRITE(forgottn_dial_0_reset_w) | |
| 479 | AM_RANGE(0x800048, 0x800049) AM_WRITE(forgottn_dial_1_reset_w) | |
| 480 | AM_RANGE(0x800180, 0x800181) AM_WRITE(cps1_sound_command_w) /* Sound command */ | |
| 481 | AM_RANGE(0x800188, 0x800189) AM_WRITE(cps1_sound_fade_w) | |
| 482 | AM_RANGE(0x800100, 0x8001ff) AM_WRITE(cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size) /* Output ports */ | |
| 483 | AM_RANGE(0x900000, 0x92ffff) AM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) | |
| 484 | AM_RANGE(0xf18000, 0xf19fff) AM_WRITE(qsound_sharedram1_w) /* Q RAM */ | |
| 485 | AM_RANGE(0xf1c004, 0xf1c005) AM_WRITE(cpsq_coinctrl2_w) /* Coin control2 (later games) */ | |
| 486 | AM_RANGE(0xf1c006, 0xf1c007) AM_WRITE(cps1_eeprom_port_w) | |
| 487 | AM_RANGE(0xf1e000, 0xf1ffff) AM_WRITE(qsound_sharedram2_w) /* Q RAM */ | |
| 488 | AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SMH_RAM) /* RAM */ | |
| 489 | ADDRESS_MAP_END | |
| 490 | ||
| 491 | ||
| 492 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 493 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) | |
| 494 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) | |
| 495 | AM_RANGE(0xd000, 0xd7ff) AM_READ(SMH_RAM) | |
| 496 | AM_RANGE(0xf001, 0xf001) AM_READ(YM2151_status_port_0_r) | |
| 497 | AM_RANGE(0xf002, 0xf002) AM_READ(OKIM6295_status_0_r) | |
| 498 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) | |
| 499 | AM_RANGE(0xf00a, 0xf00a) AM_READ(cps1_snd_fade_timer_r) /* Sound timer fade */ | |
| 500 | ADDRESS_MAP_END | |
| 501 | ||
| 502 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 503 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 504 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(SMH_RAM) | |
| 456 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 457 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 458 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) | |
| 459 | AM_RANGE(0xd000, 0xd7ff) AM_RAM | |
| 505 | 460 | AM_RANGE(0xf000, 0xf000) AM_WRITE(YM2151_register_port_0_w) |
| 506 | AM_RANGE(0xf001, 0xf001) AM_WRITE(YM2151_data_port_0_w) | |
| 507 | AM_RANGE(0xf002, 0xf002) AM_WRITE(OKIM6295_data_0_w) | |
| 461 | AM_RANGE(0xf001, 0xf001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 462 | AM_RANGE(0xf002, 0xf002) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 508 | 463 | AM_RANGE(0xf004, 0xf004) AM_WRITE(cps1_snd_bankswitch_w) |
| 509 | 464 | AM_RANGE(0xf006, 0xf006) AM_WRITE(cps1_oki_pin7_w) /* controls pin 7 of OKI chip */ |
| 465 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) /* Sound command */ | |
| 466 | AM_RANGE(0xf00a, 0xf00a) AM_READ(soundlatch2_r) /* Sound timer fade */ | |
| 510 | 467 | ADDRESS_MAP_END |
| 511 | 468 | |
| 512 | ADDRESS_MAP_START( qsound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 469 | ||
| 470 | static ADDRESS_MAP_START( qsound_main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 471 | AM_RANGE(0x000000, 0x1fffff) AM_ROM | |
| 472 | AM_RANGE(0x800000, 0x800001) AM_READ(cps1_in1_r) /* Player input ports */ | |
| 473 | AM_RANGE(0x800010, 0x800011) AM_READ(cps1_in1_r) /* mirror? */ | |
| 474 | AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_input_r) /* System input ports / Dip Switches */ | |
| 475 | AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w) | |
| 476 | AM_RANGE(0x800100, 0x8001ff) AM_READWRITE(cps1_output_r, cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size) /* CPS-B custom */ | |
| 477 | AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ | |
| 478 | AM_RANGE(0xf00000, 0xf0ffff) AM_READ(qsound_rom_r) /* Slammasters protection */ | |
| 479 | AM_RANGE(0xf18000, 0xf19fff) AM_READWRITE(qsound_sharedram1_r, qsound_sharedram1_w) /* Q RAM */ | |
| 480 | AM_RANGE(0xf1c000, 0xf1c001) AM_READ(cps1_in2_r) /* Player 3 controls (later games) */ | |
| 481 | AM_RANGE(0xf1c002, 0xf1c003) AM_READ(cps1_in3_r) /* Player 4 controls ("Muscle Bombers") */ | |
| 482 | AM_RANGE(0xf1c004, 0xf1c005) AM_WRITE(cpsq_coinctrl2_w) /* Coin control2 (later games) */ | |
| 483 | AM_RANGE(0xf1c006, 0xf1c007) AM_READWRITE(cps1_eeprom_port_r, cps1_eeprom_port_w) | |
| 484 | AM_RANGE(0xf1e000, 0xf1ffff) AM_READWRITE(qsound_sharedram2_r, qsound_sharedram2_w) /* Q RAM */ | |
| 485 | AM_RANGE(0xff0000, 0xffffff) AM_RAM | |
| 486 | ADDRESS_MAP_END | |
| 487 | ||
| 488 | ADDRESS_MAP_START( qsound_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) // used by cps2.c too | |
| 513 | 489 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 514 | 490 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) /* banked (contains music data) */ |
| 515 | 491 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&qsound_sharedram1) |
| r2418 | r2419 | |
| 3454 | 3430 | |
| 3455 | 3431 | /* basic machine hardware */ |
| 3456 | 3432 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 3457 | MDRV_CPU_PROGRAM_MAP( | |
| 3433 | MDRV_CPU_PROGRAM_MAP( | |
| 3458 | 3434 | MDRV_CPU_VBLANK_INT("main", cps1_interrupt) |
| 3459 | 3435 | |
| 3460 | 3436 | MDRV_CPU_ADD_TAG("sound", Z80, 3579545) |
| 3461 | 3437 | /* audio CPU */ |
| 3462 | MDRV_CPU_PROGRAM_MAP(s | |
| 3438 | MDRV_CPU_PROGRAM_MAP(s | |
| 3463 | 3439 | |
| 3464 | 3440 | /* video hardware */ |
| 3465 | 3441 | MDRV_SCREEN_ADD("main", RASTER) |
| r2418 | r2419 | |
| 3512 | 3488 | MDRV_IMPORT_FROM(cps1_12MHz) |
| 3513 | 3489 | |
| 3514 | 3490 | MDRV_CPU_REPLACE("main", M68000, 12000000) |
| 3491 | MDRV_CPU_PROGRAM_MAP(qsound_main_map,0) | |
| 3515 | 3492 | MDRV_CPU_VBLANK_INT("main", cps1_qsound_interrupt) /* ??? interrupts per frame */ |
| 3516 | 3493 | |
| 3517 | 3494 | MDRV_CPU_REPLACE("sound", Z80, 8000000) |
| 3518 | MDRV_CPU_PROGRAM_MAP(qsound_map,0) | |
| 3495 | MDRV_CPU_PROGRAM_MAP(qsound_sub_map,0) | |
| 3519 | 3496 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, 250) /* ?? */ |
| 3520 | 3497 | |
| 3521 | 3498 | MDRV_NVRAM_HANDLER(qsound) |
| r2418 | r2419 | |
| 3551 | 3528 | ROM_LOAD16_WORD_SWAP( "lw-07", 0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) ) |
| 3552 | 3529 | |
| 3553 | 3530 | ROM_REGION( 0x400000, REGION_GFX1, 0 ) |
| 3554 | ROMX_LOAD( "lw-02", 0x000000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3555 | ROMX_LOAD( "lw-09", 0x000002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3556 | ROMX_LOAD( "lw-06", 0x000004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3557 | ROMX_LOAD( "lw-13", 0x000006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3558 | ROMX_LOAD( "lw-01", 0x200000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3559 | ROMX_LOAD( "lw-08", 0x200002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3560 | ROMX_LOAD( "lw-05", 0x200004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3561 | ROMX_LOAD( "lw-12", 0x200006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3531 | ROMX_LOAD( "lw-01", 0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3532 | ROMX_LOAD( "lw-08", 0x000002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3533 | ROMX_LOAD( "lw-05", 0x000004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3534 | ROMX_LOAD( "lw-12", 0x000006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3535 | ROMX_LOAD( "lw-02", 0x200000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3536 | ROMX_LOAD( "lw-09", 0x200002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3537 | ROMX_LOAD( "lw-06", 0x200004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3538 | ROMX_LOAD( "lw-13", 0x200006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3562 | 3539 | |
| 3563 | 3540 | ROM_REGION( 0x8000, REGION_GFX2, 0 ) |
| 3564 | ROM_COPY( REGION_GFX1, 0x | |
| 3541 | ROM_COPY( REGION_GFX1, 0x200000, 0x000000, 0x8000 ) /* stars */ | |
| 3565 | 3542 | |
| 3566 | 3543 | ROM_REGION( 0x18000, REGION_CPU2, 0 ) |
| 3567 | 3544 | ROM_LOAD( "lwu00", 0x00000, 0x08000, CRC(59df2a63) SHA1(dfe1fffc7a17179a80a2ae623e93b30a7d6df20d) ) |
| r2418 | r2419 | |
| 3590 | 3567 | ROM_LOAD16_WORD_SWAP( "lw-07", 0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) ) |
| 3591 | 3568 | |
| 3592 | 3569 | ROM_REGION( 0x400000, REGION_GFX1, 0 ) |
| 3593 | ROMX_LOAD( "lw-02", 0x000000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3594 | ROMX_LOAD( "lw-09", 0x000002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3595 | ROMX_LOAD( "lw-06", 0x000004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3596 | ROMX_LOAD( "lw-13", 0x000006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3597 | ROMX_LOAD( "lw-01", 0x200000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3598 | ROMX_LOAD( "lw-08", 0x200002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3599 | ROMX_LOAD( "lw-05", 0x200004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3600 | ROMX_LOAD( "lw-12", 0x200006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3570 | ROMX_LOAD( "lw-01", 0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3571 | ROMX_LOAD( "lw-08", 0x000002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3572 | ROMX_LOAD( "lw-05", 0x000004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3573 | ROMX_LOAD( "lw-12", 0x000006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3574 | ROMX_LOAD( "lw-02", 0x200000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3575 | ROMX_LOAD( "lw-09", 0x200002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3576 | ROMX_LOAD( "lw-06", 0x200004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3577 | ROMX_LOAD( "lw-13", 0x200006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 3601 | 3578 | |
| 3602 | 3579 | ROM_REGION( 0x8000, REGION_GFX2, 0 ) |
| 3603 | ROM_COPY( REGION_GFX1, 0x | |
| 3580 | ROM_COPY( REGION_GFX1, 0x200000, 0x000000, 0x8000 ) /* stars */ | |
| 3604 | 3581 | |
| 3605 | 3582 | ROM_REGION( 0x18000, REGION_CPU2, 0 ) |
| 3606 | 3583 | ROM_LOAD( "lwu00", 0x00000, 0x08000, CRC(59df2a63) SHA1(dfe1fffc7a17179a80a2ae623e93b30a7d6df20d) ) |
| r2418 | r2419 | |
| 7302 | 7279 | static DRIVER_INIT( pang3 ) |
| 7303 | 7280 | { |
| 7304 | 7281 | /* Pang 3 EEPROM interface is at a different address */ |
| 7305 | memory_install_readwrite16_handler (0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w); | |
| 7282 | memory_install_readwrite16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w); | |
| 7306 | 7283 | |
| 7307 | 7284 | DRIVER_INIT_CALL(cps1); |
| 7308 | 7285 | } |
| r2418 | r2419 | |
| 7342 | 7319 | GAME( 1989, stridrua, strider, cps1_10MHz, stridrua, cps1, ROT0, "Capcom", "Strider (US set 2)", 0 ) |
| 7343 | 7320 | GAME( 1989, striderj, strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan set 1)", 0 ) |
| 7344 | 7321 | GAME( 1989, stridrja, strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan set 2)", 0 ) |
| 7345 | GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars ( | |
| 7322 | GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars (US | |
| 7346 | 7323 | GAME( 1989, dynwarj, dynwar, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan)", 0 ) |
| 7347 | 7324 | GAME( 1989, willow, 0, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (US)", 0 ) |
| 7348 | 7325 | GAME( 1989, willowj, willow, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (Japan, Japanese)" , 0) // Japan "warning" |
| r2418 | r2419 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | static ADDRESS_MAP_START( nova2001_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 176 | 176 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 177 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_WRITE(nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram) | |
| 178 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_WRITE(nova2001_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) | |
| 177 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram) | |
| 178 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(nova2001_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) | |
| 179 | 179 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE(&spriteram) |
| 180 | 180 | AM_RANGE(0xb800, 0xbfff) AM_WRITE(nova2001_flipscreen_w) |
| 181 | 181 | AM_RANGE(0xc000, 0xc000) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| r2418 | r2419 | |
| 201 | 201 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) |
| 202 | 202 | AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu1_io_A002_w) |
| 203 | 203 | AM_RANGE(0xa003, 0xa003) AM_WRITE(pkunwar_flipscreen_w) |
| 204 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 204 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 205 | 205 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) AM_SHARE(2) |
| 206 | 206 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3) |
| 207 | AM_RANGE(0xd800, 0xd9ff) AM_R | |
| 207 | AM_RANGE(0xd800, 0xd9ff) AM_R | |
| 208 | 208 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(5) |
| 209 | 209 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(6) |
| 210 | 210 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 220 | 220 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) |
| 221 | 221 | AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu2_io_A002_w) |
| 222 | 222 | AM_RANGE(0xa003, 0xa003) AM_WRITE(nova2001_flipscreen_w) |
| 223 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 223 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 224 | 224 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE(2) |
| 225 | 225 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(3) |
| 226 | AM_RANGE(0xd800, 0xd9ff) AM_R | |
| 226 | AM_RANGE(0xd800, 0xd9ff) AM_R | |
| 227 | 227 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(6) /* swapped wrt CPU1 */ |
| 228 | 228 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(5) /* swapped wrt CPU1 */ |
| 229 | 229 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 232 | 232 | static ADDRESS_MAP_START( pkunwar_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 233 | 233 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 234 | 234 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&spriteram) |
| 235 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 235 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 236 | 236 | AM_RANGE(0xa000, 0xa000) AM_WRITE(&AY8910_control_port_0_w) |
| 237 | 237 | AM_RANGE(0xa001, 0xa001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 238 | 238 | AM_RANGE(0xa002, 0xa002) AM_WRITE(AY8910_control_port_1_w) |
| r2418 | r2419 | |
| 250 | 250 | static ADDRESS_MAP_START( raiders5_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 251 | 251 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 252 | 252 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&spriteram) |
| 253 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 253 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 254 | 254 | AM_RANGE(0x9000, 0x97ff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) |
| 255 | 255 | AM_RANGE(0xa000, 0xa000) AM_WRITE(nova2001_scroll_x_w) |
| 256 | 256 | AM_RANGE(0xa001, 0xa001) AM_WRITE(nova2001_scroll_y_w) |
| r2418 | r2419 | |
| 259 | 259 | AM_RANGE(0xc001, 0xc001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 260 | 260 | AM_RANGE(0xc002, 0xc002) AM_WRITE(AY8910_control_port_1_w) |
| 261 | 261 | AM_RANGE(0xc003, 0xc003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w) |
| 262 | AM_RANGE(0xd000, 0xd1ff) AM_R | |
| 262 | AM_RANGE(0xd000, 0xd1ff) AM_R | |
| 263 | 263 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(1) |
| 264 | 264 | ADDRESS_MAP_END |
| 265 | 265 |
| r2418 | r2419 | |
|---|---|---|
| 140 | 140 | AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w ) // Sound |
| 141 | 141 | AM_RANGE(0x800188, 0x800189) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w ) // Sound |
| 142 | 142 | AM_RANGE(0x8001fe, 0x8001ff) AM_WRITE(SMH_NOP ) // ? 0 (during int) |
| 143 | AM_RANGE(0x900000, 0x903fff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 144 | AM_RANGE(0x908000, 0x90bfff) AM_RAM AM_WRITE(yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1 ) // Layer 1 | |
| 145 | AM_RANGE(0x90c000, 0x90ffff) AM_RAM AM_WRITE(yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0 ) // Layer 0 | |
| 143 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 144 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1 ) // Layer 1 | |
| 145 | AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0 ) // Layer 0 | |
| 146 | 146 | AM_RANGE(0x910000, 0x910fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites |
| 147 | 147 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 148 | 148 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 167 | 167 | static DRIVER_INIT( magicbub ) |
| 168 | 168 | { |
| 169 | 169 | // remove_mem_write16_handler (0, 0x800180, 0x800181 ); |
| 170 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800188, 0x800189, 0, 0, magicbub_sound_command_w); | |
| 170 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800188, 0x800189, 0, 0, magicbub_sound_command_w); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /*************************************************************************** |
| r2418 | r2419 | |
|---|---|---|
| 1046 | 1046 | |
| 1047 | 1047 | static DRIVER_INIT( scion ) |
| 1048 | 1048 | { |
| 1049 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4001, 0, 0, SMH_NOP); | |
| 1049 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4001, 0, 0, SMH_NOP); | |
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | 1052 | |
| 1053 | 1053 | static DRIVER_INIT( wiz ) |
| 1054 | 1054 | { |
| 1055 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd400, 0, 0, wiz_protection_r); | |
| 1055 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd400, 0, 0, wiz_protection_r); | |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | 1058 |
| r2418 | r2419 | |
|---|---|---|
| 126 | 126 | static ADDRESS_MAP_START( mermaid_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 127 | 127 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 128 | 128 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 129 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_WRITE(mermaid_videoram2_w) AM_BASE(&mermaid_videoram2) | |
| 130 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(mermaid_videoram_w) AM_BASE(&videoram) | |
| 131 | AM_RANGE(0xd800, 0xd81f) AM_RAM AM_WRITE(mermaid_bg_scroll_w) AM_BASE(&mermaid_bg_scrollram) | |
| 132 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_WRITE(mermaid_fg_scroll_w) AM_BASE(&mermaid_fg_scrollram) | |
| 129 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(mermaid_videoram2_w) AM_BASE(&mermaid_videoram2) | |
| 130 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(mermaid_videoram_w) AM_BASE(&videoram) | |
| 131 | AM_RANGE(0xd800, 0xd81f) AM_RAM_WRITE(mermaid_bg_scroll_w) AM_BASE(&mermaid_bg_scrollram) | |
| 132 | AM_RANGE(0xd840, 0xd85f) AM_RAM_WRITE(mermaid_fg_scroll_w) AM_BASE(&mermaid_fg_scrollram) | |
| 133 | 133 | AM_RANGE(0xd880, 0xd8bf) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 134 | AM_RANGE(0xdc00, 0xdfff) AM_RAM | |
| 134 | AM_RANGE(0xdc00, 0xdfff) AM_RAM | |
| 135 | 135 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r) |
| 136 | 136 | AM_RANGE(0xe000, 0xe001) AM_RAM AM_BASE(&mermaid_AY8910_enable) |
| 137 | 137 | AM_RANGE(0xe002, 0xe002) AM_WRITENOP // ??? |
| r2418 | r2419 | |
|---|---|---|
| 204 | 204 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 205 | 205 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 206 | 206 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 207 | AM_RANGE(0xd000, 0xd7ff) AM_RAM | |
| 207 | AM_RANGE(0xd000, 0xd7ff) AM_RAM | |
| 208 | 208 | AM_RANGE(0xd800, 0xdbff) AM_RAM AM_BASE(&calorie_sprites) |
| 209 | AM_RANGE(0xdc00, 0xdcff) AM_RAM | |
| 209 | AM_RANGE(0xdc00, 0xdcff) AM_RAM | |
| 210 | 210 | AM_RANGE(0xde00, 0xde00) AM_WRITE(calorie_bg_w) |
| 211 | 211 | AM_RANGE(0xf000, 0xf000) AM_READ(input_port_0_r) |
| 212 | 212 | AM_RANGE(0xf001, 0xf001) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | static ADDRESS_MAP_START( drtomy_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 134 | 134 | AM_RANGE(0x000000, 0x03ffff) AM_ROM /* ROM */ |
| 135 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(drtomy_vram_fg_w) AM_BASE(&drtomy_videoram_fg) /* Video RAM FG */ | |
| 136 | AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(drtomy_vram_bg_w) AM_BASE(&drtomy_videoram_bg) /* Video RAM BG */ | |
| 137 | AM_RANGE(0x200000, 0x2007ff) AM_READWRITE(SMH_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) /* Palette */ | |
| 135 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(drtomy_vram_fg_w) AM_BASE(&drtomy_videoram_fg) /* Video RAM FG */ | |
| 136 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(drtomy_vram_bg_w) AM_BASE(&drtomy_videoram_bg) /* Video RAM BG */ | |
| 137 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) /* Palette */ | |
| 138 | 138 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&drtomy_spriteram) /* Sprite RAM */ |
| 139 | 139 | AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r) /* DIPSW #1 */ |
| 140 | 140 | AM_RANGE(0x700002, 0x700003) AM_READ(input_port_1_word_r) /* DIPSW #2 */ |
| r2418 | r2419 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | #include "driver.h" |
| 146 | 146 | #include "deprecat.h" |
| 147 | #include "memconv.h" | |
| 148 | 147 | #include "gaelco3d.h" |
| 149 | 148 | #include "cpu/tms32031/tms32031.h" |
| 150 | 149 | #include "cpu/adsp2100/adsp2100.h" |
| r2418 | r2419 | |
| 253 | 252 | { |
| 254 | 253 | cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE); |
| 255 | 254 | } |
| 256 | static WRITE32_HANDLER( irq_ack_020_w ) { if (ACCESSING_BITS_16_31) irq_ack_w(machine, offset, data >> 16, mem_mask >> 16); } | |
| 257 | 255 | |
| 258 | 256 | |
| 259 | 257 | |
| r2418 | r2419 | |
| 271 | 269 | logerror("eeprom_data_r(%02X)\n", result); |
| 272 | 270 | return result; |
| 273 | 271 | } |
| 274 | static READ32_HANDLER( eeprom_data_020_r ) { return eeprom_data_r(machine, offset, mem_mask) << 16; } | |
| 275 | 272 | |
| 276 | 273 | |
| 277 | 274 | static WRITE16_HANDLER( eeprom_data_w ) |
| r2418 | r2419 | |
| 279 | 276 | if (ACCESSING_BITS_0_7) |
| 280 | 277 | EEPROM_write_bit(data & 0x01); |
| 281 | 278 | } |
| 282 | static WRITE32_HANDLER( eeprom_data_020_w ) { if (ACCESSING_BITS_0_15) eeprom_data_w(machine, offset, data, mem_mask); } | |
| 283 | 279 | |
| 284 | 280 | |
| 285 | 281 | static WRITE16_HANDLER( eeprom_clock_w ) |
| r2418 | r2419 | |
| 287 | 283 | if (ACCESSING_BITS_0_7) |
| 288 | 284 | EEPROM_set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); |
| 289 | 285 | } |
| 290 | static WRITE32_HANDLER( eeprom_clock_020_w ) { if (ACCESSING_BITS_0_15) eeprom_clock_w(machine, offset, data, mem_mask); } | |
| 291 | 286 | |
| 292 | 287 | |
| 293 | 288 | static WRITE16_HANDLER( eeprom_cs_w ) |
| r2418 | r2419 | |
| 295 | 290 | if (ACCESSING_BITS_0_7) |
| 296 | 291 | EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 297 | 292 | } |
| 298 | static WRITE32_HANDLER( eeprom_cs_020_w ) { if (ACCESSING_BITS_0_15) eeprom_cs_w(machine, offset, data, mem_mask); } | |
| 299 | 293 | |
| 300 | 294 | |
| 301 | 295 | |
| r2418 | r2419 | |
| 319 | 313 | if (ACCESSING_BITS_0_7) |
| 320 | 314 | timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); |
| 321 | 315 | } |
| 322 | static WRITE32_HANDLER( sound_data_020_w ) { if (ACCESSING_BITS_16_31) sound_data_w(machine, offset, data >> 16, mem_mask >> 16); } | |
| 323 | 316 | |
| 324 | 317 | |
| 325 | 318 | static READ16_HANDLER( sound_data_r ) |
| 326 | 319 | { |
| 327 | 320 | logerror("sound_data_r(%02X)\n", sound_data); |
| 328 | cpunum_set_input_line( | |
| 321 | cpunum_set_input_line(machine, 2, ADSP2115_IRQ2, CLEAR_LINE); | |
| 329 | 322 | return sound_data; |
| 330 | 323 | } |
| 331 | 324 | |
| r2418 | r2419 | |
| 337 | 330 | return sound_status; |
| 338 | 331 | return 0xffff; |
| 339 | 332 | } |
| 340 | static READ32_HANDLER( sound_status_020_r ) { if (ACCESSING_BITS_0_15) return sound_status_r(machine, offset, mem_mask); return ~0; } | |
| 341 | 333 | |
| 342 | 334 | |
| 343 | 335 | static WRITE16_HANDLER( sound_status_w ) |
| r2418 | r2419 | |
| 354 | 346 | * |
| 355 | 347 | *************************************/ |
| 356 | 348 | |
| 357 | static READ32_HANDLER( input_port_0_020_r ) { return input_port_read_indexed(machine, 0) << 16; } | |
| 358 | static READ32_HANDLER( input_port_1_020_r ) { return input_port_read_indexed(machine, 1) << 16; } | |
| 359 | static READ32_HANDLER( input_port_2_020_r ) { return input_port_read_indexed(machine, 2) << 16; } | |
| 360 | static READ32_HANDLER( input_port_3_020_r ) { return input_port_read_indexed(machine, 3) << 16; } | |
| 361 | ||
| 362 | ||
| 363 | 349 | static CUSTOM_INPUT( analog_bit_r ) |
| 364 | 350 | { |
| 365 | 351 | int which = (FPTR)param; |
| r2418 | r2419 | |
| 383 | 369 | else |
| 384 | 370 | logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 385 | 371 | } |
| 386 | static WRITE32_HANDLER( analog_port_clock_020_w ) { if (ACCESSING_BITS_0_15) analog_port_clock_w(machine, offset, data, mem_mask); } | |
| 387 | 372 | |
| 388 | 373 | |
| 389 | 374 | static WRITE16_HANDLER( analog_port_latch_w ) |
| r2418 | r2419 | |
| 402 | 387 | else |
| 403 | 388 | logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 404 | 389 | } |
| 405 | static WRITE32_HANDLER( analog_port_latch_020_w ) { if (ACCESSING_BITS_0_15) analog_port_latch_w(machine, offset, data, mem_mask); } | |
| 406 | 390 | |
| 407 | 391 | |
| 408 | 392 | |
| r2418 | r2419 | |
| 444 | 428 | /* this is set to 0 while data is uploaded, then set to $ffff after it is done */ |
| 445 | 429 | /* it does not ever appear to be touched after that */ |
| 446 | 430 | logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 447 | cpunum_set_input_line( | |
| 431 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); | |
| 448 | 432 | } |
| 449 | static WRITE32_HANDLER( tms_reset_020_w ) { if (ACCESSING_BITS_0_15) tms_reset_w(machine, offset, data, mem_mask); } | |
| 450 | 433 | |
| 451 | 434 | |
| 452 | 435 | static WRITE16_HANDLER( tms_irq_w ) |
| r2418 | r2419 | |
| 455 | 438 | /* done after uploading, and after modifying the comm area */ |
| 456 | 439 | logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 457 | 440 | if (ACCESSING_BITS_0_7) |
| 458 | cpunum_set_input_line( | |
| 441 | cpunum_set_input_line(machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 459 | 442 | } |
| 460 | static WRITE32_HANDLER( tms_irq_020_w ) { if (ACCESSING_BITS_0_15) tms_irq_w(machine, offset, data, mem_mask); } | |
| 461 | 443 | |
| 462 | 444 | |
| 463 | 445 | static WRITE16_HANDLER( tms_control3_w ) |
| 464 | 446 | { |
| 465 | 447 | logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 466 | 448 | } |
| 467 | static WRITE32_HANDLER( tms_control3_020_w ) { if (ACCESSING_BITS_0_15) tms_control3_w(machine, offset, data, mem_mask); } | |
| 468 | 449 | |
| 469 | 450 | |
| 470 | 451 | static WRITE16_HANDLER( tms_comm_w ) |
| r2418 | r2419 | |
| 472 | 453 | COMBINE_DATA(&tms_comm_base[offset ^ tms_offset_xor]); |
| 473 | 454 | logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset*2, data, ~mem_mask); |
| 474 | 455 | } |
| 475 | static WRITE32_HANDLER( tms_comm_020_w ) { write32be_with_16be_handler(tms_comm_w, machine, offset, data, mem_mask); } | |
| 476 | 456 | |
| 477 | 457 | |
| 478 | 458 | |
| r2418 | r2419 | |
| 708 | 688 | if (ACCESSING_BITS_0_7) |
| 709 | 689 | set_led_status(0, data != 0); |
| 710 | 690 | } |
| 711 | static WRITE32_HANDLER( led_0_020_w ) { if (ACCESSING_BITS_0_15) led_0_w(machine, offset, data, mem_mask); } | |
| 712 | 691 | |
| 713 | 692 | |
| 714 | 693 | static WRITE16_HANDLER( led_1_w ) |
| r2418 | r2419 | |
| 717 | 696 | if (ACCESSING_BITS_0_7) |
| 718 | 697 | set_led_status(1, data != 0); |
| 719 | 698 | } |
| 720 | static WRITE32_HANDLER( led_1_020_w ) { if (ACCESSING_BITS_0_15) led_1_w(machine, offset, data, mem_mask); } | |
| 721 | 699 | |
| 722 | 700 | |
| 723 | 701 | |
| r2418 | r2419 | |
| 730 | 708 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 731 | 709 | ADDRESS_MAP_UNMAP_HIGH |
| 732 | 710 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 733 | AM_RANGE(0x400000, 0x40ffff) AM_R | |
| 711 | AM_RANGE(0x400000, 0x40ffff) AM_R | |
| 734 | 712 | AM_RANGE(0x51000c, 0x51000d) AM_READ(input_port_0_word_r) |
| 735 | 713 | AM_RANGE(0x51001c, 0x51001d) AM_READ(input_port_1_word_r) |
| 736 | 714 | AM_RANGE(0x51002c, 0x51002d) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 757 | 735 | |
| 758 | 736 | static ADDRESS_MAP_START( main020_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 759 | 737 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 760 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SMH_RAM, gaelco3d_paletteram_020_w) AM_BASE(&paletteram32) | |
| 761 | AM_RANGE(0x51000c, 0x51000f) AM_READ(input_port_0_020_r) | |
| 762 | AM_RANGE(0x51001c, 0x51001f) AM_READ(input_port_1_020_r) | |
| 763 | AM_RANGE(0x51002c, 0x51002f) AM_READ(input_port_2_020_r) | |
| 764 | AM_RANGE(0x51003c, 0x51003f) AM_READ(input_port_3_020_r) | |
| 765 | AM_RANGE(0x510040, 0x510043) AM_READ(sound_status_020_r) | |
| 766 | AM_RANGE(0x510040, 0x510043) AM_WRITE(sound_data_020_w) | |
| 767 | AM_RANGE(0x510100, 0x510103) AM_READ(eeprom_data_020_r) | |
| 768 | AM_RANGE(0x510100, 0x510103) AM_WRITE(irq_ack_020_w) | |
| 738 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(gaelco3d_paletteram_020_w) AM_BASE(&paletteram32) | |
| 739 | AM_RANGE(0x51000c, 0x51000f) AM_READ16(input_port_0_word_r, 0xffff0000) | |
| 740 | AM_RANGE(0x51001c, 0x51001f) AM_READ16(input_port_1_word_r, 0xffff0000) | |
| 741 | AM_RANGE(0x51002c, 0x51002f) AM_READ16(input_port_2_word_r, 0xffff0000) | |
| 742 | AM_RANGE(0x51003c, 0x51003f) AM_READ16(input_port_3_word_r, 0xffff0000) | |
| 743 | AM_RANGE(0x510040, 0x510043) AM_READ16(sound_status_r, 0x0000ffff) | |
| 744 | AM_RANGE(0x510040, 0x510043) AM_WRITE16(sound_data_w, 0xffff0000) | |
| 745 | AM_RANGE(0x510100, 0x510103) AM_READ16(eeprom_data_r, 0xffff0000) | |
| 746 | AM_RANGE(0x510100, 0x510103) AM_WRITE16(irq_ack_w, 0xffff0000) | |
| 769 | 747 | AM_RANGE(0x510104, 0x510107) AM_WRITE(unknown_107_w) |
| 770 | AM_RANGE(0x510110, 0x510113) AM_WRITE(eeprom_data_020_w) | |
| 771 | AM_RANGE(0x510114, 0x510117) AM_WRITE(tms_control3_020_w) | |
| 772 | AM_RANGE(0x510118, 0x51011b) AM_WRITE(eeprom_clock_020_w) | |
| 773 | AM_RANGE(0x510120, 0x510123) AM_WRITE(eeprom_cs_020_w) | |
| 748 | AM_RANGE(0x510110, 0x510113) AM_WRITE16(eeprom_data_w, 0x0000ffff) | |
| 749 | AM_RANGE(0x510114, 0x510117) AM_WRITE16(tms_control3_w, 0x0000ffff) | |
| 750 | AM_RANGE(0x510118, 0x51011b) AM_WRITE16(eeprom_clock_w, 0x0000ffff) | |
| 751 | AM_RANGE(0x510120, 0x510123) AM_WRITE16(eeprom_cs_w, 0x0000ffff) | |
| 774 | 752 | AM_RANGE(0x510124, 0x510127) AM_WRITE(unknown_127_w) |
| 775 | AM_RANGE(0x510128, 0x51012b) AM_WRITE(tms_reset_020_w) | |
| 776 | AM_RANGE(0x510130, 0x510133) AM_WRITE(tms_irq_020_w) | |
| 753 | AM_RANGE(0x510128, 0x51012b) AM_WRITE16(tms_reset_w, 0x0000ffff) | |
| 754 | AM_RANGE(0x510130, 0x510133) AM_WRITE16(tms_irq_w, 0x0000ffff) | |
| 777 | 755 | AM_RANGE(0x510134, 0x510137) AM_WRITE(unknown_137_w) |
| 778 | 756 | AM_RANGE(0x510138, 0x51013b) AM_WRITE(unknown_13a_w) |
| 779 | AM_RANGE(0x510144, 0x510147) AM_WRITE(led_0_020_w) | |
| 780 | AM_RANGE(0x510154, 0x510157) AM_WRITE(analog_port_clock_020_w) | |
| 781 | AM_RANGE(0x510164, 0x510167) AM_WRITE(analog_port_latch_020_w) | |
| 782 | AM_RANGE(0x510174, 0x510177) AM_WRITE(led_1_020_w) | |
| 783 | AM_RANGE(0xfe7f80, 0xfe7fff) AM_WRITE(tms_comm_020_w) AM_BASE((UINT32 **)&tms_comm_base) | |
| 757 | AM_RANGE(0x510144, 0x510147) AM_WRITE16(led_0_w, 0x0000ffff) | |
| 758 | AM_RANGE(0x510154, 0x510157) AM_WRITE16(analog_port_clock_w, 0x0000ffff) | |
| 759 | AM_RANGE(0x510164, 0x510167) AM_WRITE16(analog_port_latch_w, 0x0000ffff) | |
| 760 | AM_RANGE(0x510174, 0x510177) AM_WRITE16(led_1_w, 0x0000ffff) | |
| 761 | AM_RANGE(0xfe7f80, 0xfe7fff) AM_WRITE16(tms_comm_w, 0xffffffff) AM_BASE((UINT32 **)&tms_comm_base) | |
| 784 | 762 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM AM_BASE((UINT32 **)&m68k_ram_base) |
| 785 | 763 | ADDRESS_MAP_END |
| 786 | 764 |
| r2418 | r2419 | |
|---|---|---|
| 811 | 811 | { |
| 812 | 812 | if( namcos11_config_table[ n_game ].keycus_r != NULL ) |
| 813 | 813 | { |
| 814 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa20000, 0x1fa2ffff, 0, 0, namcos11_config_table[ n_game ].keycus_r ); | |
| 814 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa20000, 0x1fa2ffff, 0, 0, namcos11_config_table[ n_game ].keycus_r ); | |
| 815 | 815 | } |
| 816 | 816 | if( namcos11_config_table[ n_game ].n_daughterboard != 0 ) |
| 817 | 817 | { |
| 818 | 818 | int bank; |
| 819 | 819 | |
| 820 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f0fffff, 0, 0, SMH_BANK1 ); | |
| 821 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f100000, 0x1f1fffff, 0, 0, SMH_BANK2 ); | |
| 822 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f2fffff, 0, 0, SMH_BANK3 ); | |
| 823 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f300000, 0x1f3fffff, 0, 0, SMH_BANK4 ); | |
| 824 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f4fffff, 0, 0, SMH_BANK5 ); | |
| 825 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f500000, 0x1f5fffff, 0, 0, SMH_BANK6 ); | |
| 826 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6fffff, 0, 0, SMH_BANK7 ); | |
| 827 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f700000, 0x1f7fffff, 0, 0, SMH_BANK8 ); | |
| 820 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f0fffff, 0, 0, SMH_BANK1 ); | |
| 821 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f100000, 0x1f1fffff, 0, 0, SMH_BANK2 ); | |
| 822 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f2fffff, 0, 0, SMH_BANK3 ); | |
| 823 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f300000, 0x1f3fffff, 0, 0, SMH_BANK4 ); | |
| 824 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f4fffff, 0, 0, SMH_BANK5 ); | |
| 825 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f500000, 0x1f5fffff, 0, 0, SMH_BANK6 ); | |
| 826 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6fffff, 0, 0, SMH_BANK7 ); | |
| 827 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f700000, 0x1f7fffff, 0, 0, SMH_BANK8 ); | |
| 828 | 828 | |
| 829 | 829 | for( bank = 0; bank < 8; bank++ ) |
| 830 | 830 | { |
| r2418 | r2419 | |
| 834 | 834 | |
| 835 | 835 | if( namcos11_config_table[ n_game ].n_daughterboard == 32 ) |
| 836 | 836 | { |
| 837 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom32_w ); | |
| 837 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom32_w ); | |
| 838 | 838 | } |
| 839 | 839 | if( namcos11_config_table[ n_game ].n_daughterboard == 64 ) |
| 840 | 840 | { |
| 841 | 841 | m_n_bankoffset = 0; |
| 842 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w ); | |
| 843 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom64_w ); | |
| 844 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP ); | |
| 842 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w ); | |
| 843 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP, bankswitch_rom64_w ); | |
| 845 | 844 | state_save_register_global( m_n_bankoffset ); |
| 846 | 845 | } |
| 847 | 846 | } |
| 848 | 847 | else |
| 849 | 848 | { |
| 850 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP ); | |
| 849 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP ); | |
| 851 | 850 | } |
| 852 | 851 | break; |
| 853 | 852 | } |
| r2418 | r2419 | |
| 856 | 855 | |
| 857 | 856 | if( strcmp( machine->gamedrv->name, "ptblnk2a" ) == 0 ) |
| 858 | 857 | { |
| 859 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, lightgun_w ); | |
| 860 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, lightgun_r ); | |
| 858 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, lightgun_w ); | |
| 859 | memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, lightgun_r ); | |
| 861 | 860 | } |
| 862 | 861 | |
| 863 | 862 | state_save_register_global( m_n_oldcoin ); |
| r2418 | r2419 | |
|---|---|---|
| 776 | 776 | static DRIVER_INIT( ripribit ) |
| 777 | 777 | { |
| 778 | 778 | ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); |
| 779 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, ripribit_control_w); | |
| 779 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, ripribit_control_w); | |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | |
| 783 | 783 | static DRIVER_INIT( cfarm ) |
| 784 | 784 | { |
| 785 | 785 | ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); |
| 786 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cfarm_control_w); | |
| 786 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cfarm_control_w); | |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | |
| 790 | 790 | static DRIVER_INIT( cclownz ) |
| 791 | 791 | { |
| 792 | 792 | ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); |
| 793 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cclownz_control_w); | |
| 793 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cclownz_control_w); | |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 |
| r2418 | r2419 | |
|---|---|---|
| 504 | 504 | AM_RANGE(0x800004, 0x800005) AM_WRITE(actionhw_snd_w) |
| 505 | 505 | AM_RANGE(0x900000, 0x900005) AM_WRITE(kickgoal_eeprom_w) |
| 506 | 506 | AM_RANGE(0x900006, 0x900007) AM_READ(kickgoal_eeprom_r) |
| 507 | AM_RANGE(0xa00000, 0xa03fff) AM_READWRITE(SMH_RAM, kickgoal_fgram_w) AM_BASE(&kickgoal_fgram) /* FG Layer */ | |
| 508 | AM_RANGE(0xa04000, 0xa07fff) AM_READWRITE(SMH_RAM, kickgoal_bgram_w) AM_BASE(&kickgoal_bgram) /* Higher BG Layer */ | |
| 509 | AM_RANGE(0xa08000, 0xa0bfff) AM_READWRITE(SMH_RAM, kickgoal_bg2ram_w) AM_BASE(&kickgoal_bg2ram) /* Lower BG Layer */ | |
| 510 | AM_RANGE(0xa0c000, 0xa0ffff) AM_READWRITE(SMH_RAM, SMH_RAM) // more tilemap? | |
| 507 | AM_RANGE(0xa00000, 0xa03fff) AM_RAM_WRITE(kickgoal_fgram_w) AM_BASE(&kickgoal_fgram) /* FG Layer */ | |
| 508 | AM_RANGE(0xa04000, 0xa07fff) AM_RAM_WRITE(kickgoal_bgram_w) AM_BASE(&kickgoal_bgram) /* Higher BG Layer */ | |
| 509 | AM_RANGE(0xa08000, 0xa0bfff) AM_RAM_WRITE(kickgoal_bg2ram_w) AM_BASE(&kickgoal_bg2ram) /* Lower BG Layer */ | |
| 510 | AM_RANGE(0xa0c000, 0xa0ffff) AM_RAM_WRITE(SMH_RAM) // more tilemap? | |
| 511 | 511 | AM_RANGE(0xa10000, 0xa1000f) AM_WRITE(SMH_RAM) AM_BASE(&kickgoal_scrram) /* Scroll Registers */ |
| 512 | 512 | AM_RANGE(0xb00000, 0xb007ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) /* Sprites */ |
| 513 | AM_RANGE(0xc00000, 0xc007ff) AM_R | |
| 513 | AM_RANGE(0xc00000, 0xc007ff) AM_R | |
| 514 | 514 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 515 | 515 | ADDRESS_MAP_END |
| 516 | 516 |
| r2418 | r2419 | |
|---|---|---|
| 454 | 454 | |
| 455 | 455 | #include "driver.h" |
| 456 | 456 | #include "deprecat.h" |
| 457 | #include "memconv.h" | |
| 458 | 457 | #include "cpu/m6809/m6809.h" |
| 459 | 458 | #include "machine/6821pia.h" |
| 460 | 459 | #include "machine/6522via.h" |
| r2418 | r2419 | |
| 828 | 827 | |
| 829 | 828 | /************************************* |
| 830 | 829 | * |
| 831 | * 16-bit | |
| 830 | * 16-bit-specific | |
| 832 | 831 | * |
| 833 | 832 | *************************************/ |
| 834 | 833 | |
| 835 | static READ16_HANDLER( blitter16_r ) | |
| 836 | { | |
| 837 | return read16be_with_read8_handler(itech8_blitter_r, machine, offset, mem_mask); | |
| 838 | } | |
| 839 | ||
| 840 | ||
| 841 | static READ16_HANDLER( tms34061_16_r ) | |
| 842 | { | |
| 843 | /* since multiple XY accesses can move the pointer multiple times, we have to */ | |
| 844 | /* be careful to only perform one read per access here; fortunately, the low */ | |
| 845 | /* bit doesn't matter in XY addressing mode */ | |
| 846 | if ((offset & 0x700) == 0x100) | |
| 847 | { | |
| 848 | int result = itech8_tms34061_r(machine, offset * 2); | |
| 849 | return (result << 8) | result; | |
| 850 | } | |
| 851 | else | |
| 852 | return (itech8_tms34061_r(machine, offset * 2 + 0) << 8) + itech8_tms34061_r(machine, offset * 2 + 1); | |
| 853 | } | |
| 854 | ||
| 855 | ||
| 856 | static WRITE16_HANDLER( sound_data16_w ) | |
| 857 | { | |
| 858 | if (ACCESSING_BITS_8_15) | |
| 859 | sound_data_w(machine, 0, data >> 8); | |
| 860 | } | |
| 861 | ||
| 862 | ||
| 863 | 834 | static WRITE16_HANDLER( grom_bank16_w ) |
| 864 | 835 | { |
| 865 | 836 | if (ACCESSING_BITS_8_15) |
| r2418 | r2419 | |
| 874 | 845 | } |
| 875 | 846 | |
| 876 | 847 | |
| 877 | static WRITE16_HANDLER( tms34061_latch16_w ) | |
| 878 | { | |
| 879 | if (ACCESSING_BITS_8_15) | |
| 880 | tms34061_latch_w(machine, 0, data >> 8); | |
| 881 | } | |
| 882 | ||
| 883 | ||
| 884 | static WRITE16_HANDLER( blitter16_w ) | |
| 885 | { | |
| 886 | write16be_with_write8_handler(itech8_blitter_w, machine, offset, data, mem_mask); | |
| 887 | } | |
| 888 | ||
| 889 | ||
| 890 | 848 | static WRITE16_HANDLER( palette16_w ) |
| 891 | 849 | { |
| 892 | 850 | if (ACCESSING_BITS_8_15) |
| r2418 | r2419 | |
| 894 | 852 | } |
| 895 | 853 | |
| 896 | 854 | |
| 897 | static WRITE16_HANDLER( tms34061_16_w ) | |
| 898 | { | |
| 899 | write16be_with_write8_handler(itech8_tms34061_w, machine, offset, data, mem_mask); | |
| 900 | } | |
| 901 | 855 | |
| 902 | ||
| 903 | ||
| 904 | 856 | /************************************* |
| 905 | 857 | * |
| 906 | 858 | * NVRAM read/write |
| r2418 | r2419 | |
| 981 | 933 | AM_RANGE(0x000000, 0x00007f) AM_RAM AM_REGION(REGION_CPU1, 0) |
| 982 | 934 | AM_RANGE(0x000080, 0x003fff) AM_RAM AM_BASE((void *)&main_ram) AM_SIZE(&main_ram_size) |
| 983 | 935 | AM_RANGE(0x004000, 0x07ffff) AM_ROM |
| 984 | AM_RANGE(0x100080, 0x100081) AM_WRITE(sound_data | |
| 936 | AM_RANGE(0x100080, 0x100081) AM_WRITE8(sound_data | |
| 985 | 937 | AM_RANGE(0x100100, 0x100101) AM_READWRITE(input_port_0_word_r, grom_bank16_w) AM_BASE((void *)&itech8_grom_bank) |
| 986 | 938 | AM_RANGE(0x100180, 0x100181) AM_READWRITE(input_port_1_word_r, display_page16_w) |
| 987 | AM_RANGE(0x100240, 0x100241) AM_WRITE(tms34061_latch | |
| 939 | AM_RANGE(0x100240, 0x100241) AM_WRITE8(tms34061_latch | |
| 988 | 940 | AM_RANGE(0x100280, 0x100281) AM_READWRITE(input_port_2_word_r, SMH_NOP) |
| 989 | AM_RANGE(0x100300, 0x10031f) AM_READWRITE(blitter | |
| 941 | AM_RANGE(0x100300, 0x10031f) AM_READWRITE8(itech8_blitter | |
| 990 | 942 | AM_RANGE(0x100380, 0x1003ff) AM_WRITE(palette16_w) |
| 991 | AM_RANGE(0x110000, 0x110fff) AM_READWRITE(tms34061_ | |
| 943 | AM_RANGE(0x110000, 0x110fff) AM_READWRITE8(itech8_tms34061_ | |
| 992 | 944 | ADDRESS_MAP_END |
| 993 | 945 | |
| 994 | 946 | |
| r2418 | r2419 | |
| 2630 | 2582 | |
| 2631 | 2583 | static DRIVER_INIT( slikshot ) |
| 2632 | 2584 | { |
| 2633 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0180, 0x0180, 0, 0, slikshot_z80_r); | |
| 2634 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_r); | |
| 2635 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_w); | |
| 2585 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0180, 0x0180, 0, 0, slikshot_z80_r); | |
| 2586 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_r); | |
| 2587 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_w); | |
| 2636 | 2588 | } |
| 2637 | 2589 | |
| 2638 | 2590 | |
| 2639 | 2591 | static DRIVER_INIT( sstrike ) |
| 2640 | 2592 | { |
| 2641 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1180, 0x1180, 0, 0, slikshot_z80_r); | |
| 2642 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_r); | |
| 2643 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_w); | |
| 2593 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1180, 0x1180, 0, 0, slikshot_z80_r); | |
| 2594 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_r); | |
| 2595 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_w); | |
| 2644 | 2596 | } |
| 2645 | 2597 | |
| 2646 | 2598 | |
| r2418 | r2419 | |
| 2675 | 2627 | static DRIVER_INIT( rimrockn ) |
| 2676 | 2628 | { |
| 2677 | 2629 | /* additional input ports */ |
| 2678 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0160, 0x0160, 0, 0, special_port1_r); | |
| 2679 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0161, 0x0161, 0, 0, input_port_3_r); | |
| 2680 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0162, 0x0162, 0, 0, input_port_4_r); | |
| 2681 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0163, 0x0163, 0, 0, input_port_5_r); | |
| 2682 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0164, 0x0164, 0, 0, input_port_6_r); | |
| 2683 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0165, 0x0165, 0, 0, input_port_7_r); | |
| 2630 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0160, 0x0160, 0, 0, special_port1_r); | |
| 2631 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0161, 0x0161, 0, 0, input_port_3_r); | |
| 2632 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0162, 0x0162, 0, 0, input_port_4_r); | |
| 2633 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0163, 0x0163, 0, 0, input_port_5_r); | |
| 2634 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0164, 0x0164, 0, 0, input_port_6_r); | |
| 2635 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0165, 0x0165, 0, 0, input_port_7_r); | |
| 2684 | 2636 | |
| 2685 | 2637 | /* different banking mechanism (disable the old one) */ |
| 2686 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01a0, 0x01a0, 0, 0, rimrockn_bank_w); | |
| 2687 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01c0, 0x01df, 0, 0, itech8_blitter_w); | |
| 2638 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01a0, 0x01a0, 0, 0, rimrockn_bank_w); | |
| 2639 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c0, 0x01df, 0, 0, itech8_blitter_w); | |
| 2688 | 2640 | } |
| 2689 | 2641 | |
| 2690 | 2642 |
| r2418 | r2419 | |
|---|---|---|
| 1055 | 1055 | ADDRESS_MAP_UNMAP_HIGH |
| 1056 | 1056 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1057 | 1057 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM |
| 1058 | AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1059 | AM_RANGE(0x5800, 0x58ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1058 | AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1059 | AM_RANGE(0x5800, 0x58ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1060 | 1060 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1061 | 1061 | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x07f8) AM_WRITE(start_lamp_w) |
| 1062 | 1062 | AM_RANGE(0x6002, 0x6002) AM_MIRROR(0x07f8) AM_WRITE(coin_lock_w) |
| r2418 | r2419 | |
| 1079 | 1079 | ADDRESS_MAP_UNMAP_HIGH |
| 1080 | 1080 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1081 | 1081 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0400) AM_RAM |
| 1082 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1083 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1082 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1083 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1084 | 1084 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1085 | 1085 | AM_RANGE(0xa000, 0xa002) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w) |
| 1086 | 1086 | AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) |
| r2418 | r2419 | |
| 1105 | 1105 | // AM_RANGE(0x8000, 0x8000) AM_WRITE(dambustr_bg_color_w) |
| 1106 | 1106 | // AM_RANGE(0x8001, 0x8001) AM_WRITE(dambustr_bg_split_line_w) |
| 1107 | 1107 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x0400) AM_RAM |
| 1108 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1109 | AM_RANGE(0xd800, 0xd8ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1108 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1109 | AM_RANGE(0xd800, 0xd8ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1110 | 1110 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1111 | 1111 | AM_RANGE(0xe004, 0xe007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_lfo_freq_w) |
| 1112 | 1112 | AM_RANGE(0xe800, 0xe800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| r2418 | r2419 | |
| 1127 | 1127 | ADDRESS_MAP_UNMAP_HIGH |
| 1128 | 1128 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1129 | 1129 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 1130 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1131 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1130 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1131 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1132 | 1132 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) |
| 1133 | 1133 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) |
| 1134 | 1134 | AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_enable_w) |
| r2418 | r2419 | |
| 1146 | 1146 | ADDRESS_MAP_UNMAP_HIGH |
| 1147 | 1147 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1148 | 1148 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM |
| 1149 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1150 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1149 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1150 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1151 | 1151 | AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 1152 | 1152 | AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 1153 | 1153 | AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w) |
| r2418 | r2419 | |
| 1167 | 1167 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1168 | 1168 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 1169 | 1169 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r) |
| 1170 | AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1171 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1170 | AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1171 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1172 | 1172 | AM_RANGE(0xb808, 0xb808) AM_MIRROR(0x07e3) AM_WRITE(irq_enable_w) |
| 1173 | 1173 | AM_RANGE(0xb80c, 0xb80c) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_y_w) |
| 1174 | 1174 | AM_RANGE(0xb810, 0xb810) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_x_w) |
| r2418 | r2419 | |
| 1183 | 1183 | ADDRESS_MAP_UNMAP_HIGH |
| 1184 | 1184 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1185 | 1185 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM |
| 1186 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x4400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1187 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x4700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1186 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1187 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1188 | 1188 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_red_w) |
| 1189 | 1189 | AM_RANGE(0xa008, 0xa008) AM_MIRROR(0x47c7) AM_WRITE(irq_enable_w) |
| 1190 | 1190 | AM_RANGE(0xa010, 0xa010) AM_MIRROR(0x47c7) AM_WRITE(galaxian_flip_screen_y_w) |
| r2418 | r2419 | |
| 1204 | 1204 | static ADDRESS_MAP_START( sfx_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1205 | 1205 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1206 | 1206 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 1207 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1208 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1207 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1208 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1209 | 1209 | AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_red_w) |
| 1210 | 1210 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) |
| 1211 | 1211 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) |
| r2418 | r2419 | |
| 1233 | 1233 | ADDRESS_MAP_UNMAP_HIGH |
| 1234 | 1234 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1235 | 1235 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 1236 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1237 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1236 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1237 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1238 | 1238 | AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x00ff) AM_WRITE(AY8910_write_port_0_w) |
| 1239 | 1239 | AM_RANGE(0x5900, 0x5900) AM_MIRROR(0x00ff) AM_WRITE(AY8910_control_port_0_w) |
| 1240 | 1240 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| r2418 | r2419 | |
| 1255 | 1255 | ADDRESS_MAP_UNMAP_HIGH |
| 1256 | 1256 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 1257 | 1257 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 1258 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1259 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1258 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1259 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1260 | 1260 | AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_x_w) |
| 1261 | 1261 | AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x07f1) AM_WRITE(irq_enable_w) |
| 1262 | 1262 | AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_y_w) |
| r2418 | r2419 | |
| 1272 | 1272 | ADDRESS_MAP_UNMAP_HIGH |
| 1273 | 1273 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1274 | 1274 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 1275 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram) | |
| 1276 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram) | |
| 1275 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram) | |
| 1276 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram) | |
| 1277 | 1277 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 1278 | 1278 | AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_enable_w) |
| 1279 | 1279 | AM_RANGE(0xa001, 0xa001) AM_WRITE(galaxian_stars_enable_w) |
| r2418 | r2419 | |
| 2097 | 2097 | } |
| 2098 | 2098 | |
| 2099 | 2099 | |
| 2100 | static void unmap_galaxian_sound(offs_t base) | |
| 2100 | static void unmap_galaxian_sound(running_machine *machine, offs_t base) | |
| 2101 | 2101 | { |
| 2102 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP); | |
| 2103 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0800, base + 0x0807, 0, 0x07f8, SMH_UNMAP); | |
| 2104 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x1800, base + 0x1800, 0, 0x07ff, SMH_UNMAP); | |
| 2102 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP); | |
| 2103 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x0800, base + 0x0807, 0, 0x07f8, SMH_UNMAP); | |
| 2104 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x1800, base + 0x1800, 0, 0x07ff, SMH_UNMAP); | |
| 2105 | 2105 | } |
| 2106 | 2106 | |
| 2107 | 2107 | |
| r2418 | r2419 | |
| 2124 | 2124 | DRIVER_INIT_CALL(galaxian); |
| 2125 | 2125 | |
| 2126 | 2126 | /* ...but coin lockout disabled/disconnected */ |
| 2127 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2127 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2128 | 2128 | } |
| 2129 | 2129 | |
| 2130 | 2130 | |
| r2418 | r2419 | |
| 2134 | 2134 | common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 2135 | 2135 | |
| 2136 | 2136 | /* coin lockout disabled */ |
| 2137 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2137 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2138 | 2138 | } |
| 2139 | 2139 | |
| 2140 | 2140 | |
| r2418 | r2419 | |
| 2144 | 2144 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info); |
| 2145 | 2145 | |
| 2146 | 2146 | /* ROM is banked */ |
| 2147 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 2147 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 2148 | 2148 | memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x10000, 0x4000); |
| 2149 | 2149 | |
| 2150 | 2150 | /* callback when the game select is toggled */ |
| r2418 | r2419 | |
| 2159 | 2159 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); |
| 2160 | 2160 | |
| 2161 | 2161 | /* coin lockout replaced by graphics bank */ |
| 2162 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2162 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2163 | 2163 | } |
| 2164 | 2164 | |
| 2165 | 2165 | |
| r2418 | r2419 | |
| 2169 | 2169 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
| 2170 | 2170 | |
| 2171 | 2171 | /* coin lockout replaced by graphics bank */ |
| 2172 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2172 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | |
| r2418 | r2419 | |
| 2179 | 2179 | common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); |
| 2180 | 2180 | |
| 2181 | 2181 | /* ...but needs a full 2k of RAM */ |
| 2182 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2182 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2183 | 2183 | memory_set_bankptr(1, auto_malloc(0x800)); |
| 2184 | 2184 | } |
| 2185 | 2185 | |
| r2418 | r2419 | |
| 2214 | 2214 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
| 2215 | 2215 | |
| 2216 | 2216 | /* LEDs and coin lockout replaced by graphics banking */ |
| 2217 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2217 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2218 | 2218 | } |
| 2219 | 2219 | |
| 2220 | 2220 | |
| r2418 | r2419 | |
| 2237 | 2237 | DRIVER_INIT_CALL(galaxian); |
| 2238 | 2238 | |
| 2239 | 2239 | /* ...but coin lockout disabled/disconnected */ |
| 2240 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2240 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2241 | 2241 | |
| 2242 | 2242 | /* also shift the sprite clip offset */ |
| 2243 | 2243 | galaxian_sprite_clip_start = 7; |
| r2418 | r2419 | |
| 2261 | 2261 | common_init(machine, NULL, galaxian_draw_background, NULL, NULL); |
| 2262 | 2262 | |
| 2263 | 2263 | /* make ROMs 2 & 3 swappable */ |
| 2264 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK1); | |
| 2265 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK2); | |
| 2264 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK1); | |
| 2265 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK2); | |
| 2266 | 2266 | memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000); |
| 2267 | 2267 | memory_configure_bank(2, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000); |
| 2268 | 2268 | |
| 2269 | 2269 | /* handler for doing the swaps */ |
| 2270 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7002, 0x7002, 0, 0x07f8, zigzag_bankswap_w); | |
| 2270 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7002, 0x7002, 0, 0x07f8, zigzag_bankswap_w); | |
| 2271 | 2271 | zigzag_bankswap_w(machine, 0, 0); |
| 2272 | 2272 | |
| 2273 | 2273 | /* coin lockout disabled */ |
| 2274 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2274 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP); | |
| 2275 | 2275 | |
| 2276 | 2276 | /* remove the galaxian sound hardware */ |
| 2277 | unmap_galaxian_sound(0x6000); | |
| 2277 | unmap_galaxian_sound(machine, 0x6000); | |
| 2278 | 2278 | |
| 2279 | 2279 | /* install our AY-8910 handler */ |
| 2280 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, zigzag_ay8910_w); | |
| 2280 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, zigzag_ay8910_w); | |
| 2281 | 2281 | } |
| 2282 | 2282 | |
| 2283 | 2283 | |
| r2418 | r2419 | |
| 2294 | 2294 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
| 2295 | 2295 | |
| 2296 | 2296 | /* move the interrupt enable from $b000 to $b001 */ |
| 2297 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2298 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2297 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2298 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2299 | 2299 | |
| 2300 | 2300 | /* attach the sound command handler */ |
| 2301 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w); | |
| 2301 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w); | |
| 2302 | 2302 | |
| 2303 | 2303 | /* decrypt program code */ |
| 2304 | 2304 | decode_checkman(); |
| r2418 | r2419 | |
| 2311 | 2311 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 2312 | 2312 | |
| 2313 | 2313 | /* attach the sound command handler */ |
| 2314 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w); | |
| 2314 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w); | |
| 2315 | 2315 | |
| 2316 | 2316 | /* for the title screen */ |
| 2317 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r); | |
| 2317 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r); | |
| 2318 | 2318 | } |
| 2319 | 2319 | |
| 2320 | 2320 | |
| r2418 | r2419 | |
| 2324 | 2324 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 2325 | 2325 | |
| 2326 | 2326 | /* attach the sound command handler */ |
| 2327 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w); | |
| 2327 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w); | |
| 2328 | 2328 | |
| 2329 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r); | |
| 2330 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r); | |
| 2329 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r); | |
| 2330 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r); | |
| 2331 | 2331 | } |
| 2332 | 2332 | |
| 2333 | 2333 | |
| r2418 | r2419 | |
| 2337 | 2337 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
| 2338 | 2338 | |
| 2339 | 2339 | /* move the interrupt enable from $b000 to $b001 */ |
| 2340 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2341 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2340 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2341 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2342 | 2342 | |
| 2343 | 2343 | /* attach the sound command handler */ |
| 2344 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w); | |
| 2344 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w); | |
| 2345 | 2345 | |
| 2346 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ | |
| 2346 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ | |
| 2347 | 2347 | |
| 2348 | 2348 | /* decrypt program code */ |
| 2349 | 2349 | decode_dingoe(); |
| r2418 | r2419 | |
| 2356 | 2356 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); |
| 2357 | 2357 | |
| 2358 | 2358 | /* coin lockout replaced by graphics bank */ |
| 2359 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2359 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w); | |
| 2360 | 2360 | |
| 2361 | 2361 | /* needs a full 2k of RAM */ |
| 2362 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2362 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2363 | 2363 | memory_set_bankptr(1, auto_malloc(0x800)); |
| 2364 | 2364 | |
| 2365 | 2365 | /* extend ROM */ |
| 2366 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK2); | |
| 2366 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK2); | |
| 2367 | 2367 | memory_set_bankptr(2, memory_region(REGION_CPU1)); |
| 2368 | 2368 | } |
| 2369 | 2369 | |
| r2418 | r2419 | |
| 2399 | 2399 | /* video extensions */ |
| 2400 | 2400 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 2401 | 2401 | |
| 2402 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, kingball_sound1_w); | |
| 2403 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2404 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0x7f8, kingball_sound2_w); | |
| 2405 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb003, 0xb003, 0, 0x7f8, kingball_speech_dip_w); | |
| 2402 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, kingball_sound1_w); | |
| 2403 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2404 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0x7f8, kingball_sound2_w); | |
| 2405 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb003, 0xb003, 0, 0x7f8, kingball_speech_dip_w); | |
| 2406 | 2406 | |
| 2407 | 2407 | state_save_register_global(kingball_speech_dip); |
| 2408 | 2408 | state_save_register_global(kingball_sound); |
| r2418 | r2419 | |
| 2415 | 2415 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
| 2416 | 2416 | |
| 2417 | 2417 | /* move the interrupt enable from $b000 to $b001 */ |
| 2418 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2419 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2418 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP); | |
| 2419 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w); | |
| 2420 | 2420 | |
| 2421 | 2421 | /* extra ROM */ |
| 2422 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x67ff, 0, 0, SMH_BANK1); | |
| 2422 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x67ff, 0, 0, SMH_BANK1); | |
| 2423 | 2423 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5000); |
| 2424 | 2424 | |
| 2425 | 2425 | /* install RAM at $4000-$4800 */ |
| 2426 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 2426 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 2427 | 2427 | memory_set_bankptr(2, auto_malloc(0x800)); |
| 2428 | 2428 | |
| 2429 | 2429 | /* doesn't appear to use original RAM */ |
| 2430 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 2430 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 2431 | 2431 | } |
| 2432 | 2432 | |
| 2433 | 2433 | |
| r2418 | r2419 | |
| 2444 | 2444 | konami_common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 2445 | 2445 | |
| 2446 | 2446 | /* coin counter on the upper bit of port C */ |
| 2447 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP); | |
| 2447 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP); | |
| 2448 | 2448 | ppi8255_set_portCwrite(0, theend_coin_counter_w); |
| 2449 | 2449 | } |
| 2450 | 2450 | |
| r2418 | r2419 | |
| 2466 | 2466 | konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL); |
| 2467 | 2467 | |
| 2468 | 2468 | /* watchdog works for writes as well? (or is it just disabled?) */ |
| 2469 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w); | |
| 2469 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w); | |
| 2470 | 2470 | |
| 2471 | 2471 | /* I/O appears to be direct, not via PPIs */ |
| 2472 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 2473 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xffc, input_port_0_r); | |
| 2474 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8001, 0x8001, 0, 0xffc, input_port_1_r); | |
| 2475 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8002, 0x8002, 0, 0xffc, input_port_2_r); | |
| 2476 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8003, 0x8003, 0, 0xffc, input_port_3_r); | |
| 2477 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xfff, soundlatch_w); | |
| 2478 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0xfff, explorer_sound_control_w); | |
| 2472 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 2473 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xffc, input_port_0_r); | |
| 2474 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8001, 0x8001, 0, 0xffc, input_port_1_r); | |
| 2475 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8002, 0x8002, 0, 0xffc, input_port_2_r); | |
| 2476 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8003, 0x8003, 0, 0xffc, input_port_3_r); | |
| 2477 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xfff, soundlatch_w); | |
| 2478 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0xfff, explorer_sound_control_w); | |
| 2479 | 2479 | } |
| 2480 | 2480 | |
| 2481 | 2481 | |
| r2418 | r2419 | |
| 2489 | 2489 | ppi8255_init(&sfx_ppi8255_intf); |
| 2490 | 2490 | |
| 2491 | 2491 | /* sound board has space for extra ROM */ |
| 2492 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 2492 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 2493 | 2493 | memory_set_bankptr(1, memory_region(REGION_CPU2)); |
| 2494 | 2494 | } |
| 2495 | 2495 | |
| r2418 | r2419 | |
| 2500 | 2500 | konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL); |
| 2501 | 2501 | |
| 2502 | 2502 | /* watchdog is at $7800? (or is it just disabled?) */ |
| 2503 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP); | |
| 2504 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, watchdog_reset_r); | |
| 2503 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP); | |
| 2504 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, watchdog_reset_r); | |
| 2505 | 2505 | } |
| 2506 | 2506 | |
| 2507 | 2507 | |
| r2418 | r2419 | |
| 2539 | 2539 | /* video extensions */ |
| 2540 | 2540 | common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); |
| 2541 | 2541 | |
| 2542 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0x7ff, soundlatch_w); | |
| 2543 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w); | |
| 2542 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0x7ff, soundlatch_w); | |
| 2543 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w); | |
| 2544 | 2544 | |
| 2545 | 2545 | /* actually needs 2k of RAM */ |
| 2546 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2546 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 2547 | 2547 | memory_set_bankptr(1, auto_malloc(0x800)); |
| 2548 | 2548 | |
| 2549 | 2549 | /* decrypt */ |
| r2418 | r2419 | |
| 2583 | 2583 | konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
| 2584 | 2584 | |
| 2585 | 2585 | /* hook up AY8910 */ |
| 2586 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w); | |
| 2586 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w); | |
| 2587 | 2587 | |
| 2588 | 2588 | /* configure protection */ |
| 2589 | 2589 | ppi8255_set_portCwrite(1, scorpion_protection_w); |
| 2590 | 2590 | ppi8255_set_portCread(1, scorpion_protection_r); |
| 2591 | 2591 | |
| 2592 | 2592 | /* extra ROM */ |
| 2593 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1); | |
| 2593 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1); | |
| 2594 | 2594 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800); |
| 2595 | 2595 | |
| 2596 | 2596 | /* no background related */ |
| 2597 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP); | |
| 2597 | // memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP); | |
| 2598 | 2598 | |
| 2599 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r); | |
| 2599 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r); | |
| 2600 | 2600 | /* |
| 2601 | 2601 | { |
| 2602 | 2602 | const UINT8 *rom = memory_region(REGION_SOUND1); |
| r2418 | r2419 | |
|---|---|---|
| 658 | 658 | |
| 659 | 659 | static DRIVER_INIT( twrldc94 ) |
| 660 | 660 | { |
| 661 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w); | |
| 661 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w); | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /*** GAME DRIVERS ************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 806 | 806 | // ROM[(0x174b9*0x20)+0x1f] |= 0x0e; /* I */ |
| 807 | 807 | // ROM[(0x174e9*0x20)+0x1f] |= 0x0e; |
| 808 | 808 | |
| 809 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w); | |
| 810 | memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w); | |
| 811 | memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0x000000, 0x003fff, 0, 0, hypr_sharedram1_w); | |
| 809 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w); | |
| 810 | memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w); | |
| 811 | memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x000000, 0x003fff, 0, 0, hypr_sharedram1_w); | |
| 812 | 812 | |
| 813 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w); | |
| 814 | memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w); | |
| 813 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w); | |
| 814 | memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w); | |
| 815 | 815 | |
| 816 | 816 | requested_int = 0x00; |
| 817 | 817 | blitter_bit = 2; |
| r2418 | r2419 | |
|---|---|---|
| 172 | 172 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 173 | 173 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 174 | 174 | AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_BASE(&rampart_bitmap) |
| 175 | AM_RANGE(0x3c0000, 0x3c07ff) AM_READWRITE(SMH_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 176 | AM_RANGE(0x3e0000, 0x3e07ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 175 | AM_RANGE(0x3c0000, 0x3c07ff) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 176 | AM_RANGE(0x3e0000, 0x3e07ff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 177 | 177 | AM_RANGE(0x3e0800, 0x3effbf) AM_RAM |
| 178 | AM_RANGE(0x3effc0, 0x3effff) AM_R | |
| 178 | AM_RANGE(0x3effc0, 0x3effff) AM_R | |
| 179 | 179 | AM_RANGE(0x640000, 0x640001) AM_READ(input_port_0_word_r) |
| 180 | 180 | AM_RANGE(0x640002, 0x640003) AM_READ(input_port_1_word_r) |
| 181 | 181 | AM_RANGE(0x640010, 0x640011) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static ADDRESS_MAP_START( flstory_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 113 | 113 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 114 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 114 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 115 | 115 | AM_RANGE(0xc800, 0xcfff) AM_RAM /* unknown */ |
| 116 | 116 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(flstory_mcu_r, flstory_mcu_w) |
| 117 | 117 | AM_RANGE(0xd001, 0xd001) AM_WRITENOP /* watchdog? */ |
| r2418 | r2419 | |
| 128 | 128 | AM_RANGE(0xd806, 0xd806) AM_READ(input_port_5_r) |
| 129 | 129 | // AM_RANGE(0xda00, 0xda00) AM_WRITE(SMH_RAM) |
| 130 | 130 | AM_RANGE(0xdc00, 0xdc9f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 131 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 131 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 132 | 132 | AM_RANGE(0xdcc0, 0xdcff) AM_RAM /* unknown */ |
| 133 | 133 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(flstory_palette_r, flstory_palette_w) |
| 134 | 134 | AM_RANGE(0xdf03, 0xdf03) AM_WRITE(flstory_gfxctrl_w) |
| r2418 | r2419 | |
| 137 | 137 | |
| 138 | 138 | static ADDRESS_MAP_START( onna34ro_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 139 | 139 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 140 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 140 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 141 | 141 | AM_RANGE(0xc800, 0xcfff) AM_RAM /* unknown */ |
| 142 | 142 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(onna34ro_mcu_r, onna34ro_mcu_w) |
| 143 | 143 | AM_RANGE(0xd001, 0xd001) AM_WRITENOP /* watchdog? */ |
| r2418 | r2419 | |
| 154 | 154 | AM_RANGE(0xd806, 0xd806) AM_READ(input_port_5_r) |
| 155 | 155 | // AM_RANGE(0xda00, 0xda00) AM_WRITE(SMH_RAM) |
| 156 | 156 | AM_RANGE(0xdc00, 0xdc9f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 157 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 157 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 158 | 158 | AM_RANGE(0xdcc0, 0xdcff) AM_RAM /* unknown */ |
| 159 | 159 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(flstory_palette_r, flstory_palette_w) |
| 160 | 160 | AM_RANGE(0xdf03, 0xdf03) AM_WRITE(flstory_gfxctrl_w) |
| r2418 | r2419 | |
| 168 | 168 | |
| 169 | 169 | static ADDRESS_MAP_START( victnine_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 170 | 170 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 171 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 171 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 172 | 172 | AM_RANGE(0xc800, 0xcfff) AM_RAM /* unknown */ |
| 173 | 173 | AM_RANGE(0xd000, 0xd000) AM_READWRITE(victnine_mcu_r, victnine_mcu_w) |
| 174 | 174 | AM_RANGE(0xd001, 0xd001) AM_WRITENOP /* watchdog? */ |
| r2418 | r2419 | |
| 186 | 186 | AM_RANGE(0xd807, 0xd807) AM_READ(input_port_7_r) |
| 187 | 187 | // AM_RANGE(0xda00, 0xda00) AM_WRITE(SMH_RAM) |
| 188 | 188 | AM_RANGE(0xdc00, 0xdc9f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 189 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 189 | AM_RANGE(0xdca0, 0xdcbf) AM_RAM | |
| 190 | 190 | AM_RANGE(0xdce0, 0xdce0) AM_READWRITE(victnine_gfxctrl_r, victnine_gfxctrl_w) |
| 191 | 191 | AM_RANGE(0xdce1, 0xdce1) AM_WRITENOP /* unknown */ |
| 192 | 192 | AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(flstory_palette_r, flstory_palette_w) |
| r2418 | r2419 | |
|---|---|---|
| 218 | 218 | static ADDRESS_MAP_START( fcrash_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 219 | 219 | AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM) /* 68000 ROM */ |
| 220 | 220 | AM_RANGE(0x880000, 0x880001) AM_READ(cps1_in1_r) /* Player input ports */ |
| 221 | AM_RANGE(0x880008, 0x880009) AM_READ(cps1_in0_r) /* System input ports */ | |
| 222 | AM_RANGE(0x88000a, 0x88000f) AM_READ(cps1_dsw_r) /* Dip Switches */ | |
| 221 | AM_RANGE(0x880008, 0x88000f) AM_READ(cps1_input_r) /* System input ports / Dip Switches */ | |
| 223 | 222 | AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r) /* Output ports */ |
| 224 | 223 | AM_RANGE(0x900000, 0x92ffff) AM_READ(SMH_RAM) /* SF2CE executes code from here */ |
| 225 | 224 | AM_RANGE(0xf1c000, 0xf1c001) AM_READ(cps1_in2_r) |
| r2418 | r2419 | |
|---|---|---|
| 508 | 508 | AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 509 | 509 | AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w) |
| 510 | 510 | AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w) |
| 511 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram) | |
| 512 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_WRITE(calomega_colorram_w) AM_BASE(&colorram) | |
| 511 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram) | |
| 512 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram) | |
| 513 | 513 | AM_RANGE(0x1800, 0xffff) AM_ROM |
| 514 | 514 | ADDRESS_MAP_END |
| 515 | 515 | |
| r2418 | r2419 | |
| 521 | 521 | AM_RANGE(0x1081, 0x1081) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 522 | 522 | AM_RANGE(0x10c4, 0x10c7) AM_READWRITE(pia_0_r, pia_0_w) |
| 523 | 523 | AM_RANGE(0x10c8, 0x10cb) AM_READWRITE(pia_1_r, pia_1_w) |
| 524 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram) | |
| 525 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_WRITE(calomega_colorram_w) AM_BASE(&colorram) | |
| 524 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram) | |
| 525 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram) | |
| 526 | 526 | AM_RANGE(0x2800, 0xffff) AM_ROM |
| 527 | 527 | ADDRESS_MAP_END |
| 528 | 528 |
| r2418 | r2419 | |
|---|---|---|
| 515 | 515 | // AM_RANGE(0xd806, 0xd806) AM_READ(protection_r) /* protection data read (pettanp) */ |
| 516 | 516 | |
| 517 | 517 | /* Fujitsu MB8841 4-Bit MCU */ |
| 518 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, pettanp_protection_r); | |
| 519 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w); | |
| 518 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, pettanp_protection_r); | |
| 519 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w); | |
| 520 | 520 | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | static DRIVER_INIT( banbam ) |
| 524 | 524 | { |
| 525 | 525 | /* Fujitsu MB8841 4-Bit MCU */ |
| 526 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, banbam_protection_r); | |
| 527 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w); | |
| 526 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, banbam_protection_r); | |
| 527 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w); | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | GAME( 1984, strnskil, 0, strnskil, strnskil, 0, ROT0, "Sun Electronics", "Strength & Skill", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 207 | 207 | /* full address map derived from schematics */ |
| 208 | 208 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 209 | 209 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 210 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(SMH_RAM, atetris_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 211 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_READWRITE(SMH_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram) | |
| 212 | AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_READWRITE(SMH_RAM, nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 210 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 211 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram) | |
| 212 | AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 213 | 213 | AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_READWRITE(pokey1_r, pokey1_w) |
| 214 | 214 | AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_READWRITE(pokey2_r, pokey2_w) |
| 215 | 215 | AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w) |
| r2418 | r2419 | |
| 224 | 224 | |
| 225 | 225 | static ADDRESS_MAP_START( atetrsb2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 226 | 226 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 227 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(SMH_RAM, atetris_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 228 | AM_RANGE(0x2000, 0x20ff) AM_READWRITE(SMH_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram) | |
| 229 | AM_RANGE(0x2400, 0x25ff) AM_READWRITE(SMH_RAM, nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 227 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 228 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram) | |
| 229 | AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 230 | 230 | AM_RANGE(0x2802, 0x2802) AM_WRITE(SN76496_0_w) |
| 231 | 231 | AM_RANGE(0x2804, 0x2804) AM_WRITE(SN76496_1_w) |
| 232 | 232 | AM_RANGE(0x2806, 0x2806) AM_WRITE(SN76496_2_w) |
| r2418 | r2419 | |
|---|---|---|
| 559 | 559 | rom[BYTE4_XOR_BE(0x3aa933)] = 0; |
| 560 | 560 | |
| 561 | 561 | // protection related ? |
| 562 | // memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP ); | |
| 562 | // memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP ); | |
| 563 | 563 | |
| 564 | 564 | flash_roms = 2; |
| 565 | 565 | } |
| r2418 | r2419 | |
| 579 | 579 | rom[BYTE4_XOR_BE(0x3a45c9)] = 0; |
| 580 | 580 | |
| 581 | 581 | // protection related ? |
| 582 | // memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x12341234, 0x12341243, 0, 0, SMH_NOP ); | |
| 582 | // memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12341234, 0x12341243, 0, 0, SMH_NOP ); | |
| 583 | 583 | |
| 584 | 584 | flash_roms = 4; |
| 585 | 585 | } |
| r2418 | r2419 | |
|---|---|---|
| 1478 | 1478 | |
| 1479 | 1479 | static DRIVER_INIT( devzone ) |
| 1480 | 1480 | { |
| 1481 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); | |
| 1481 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); | |
| 1482 | 1482 | } |
| 1483 | 1483 | |
| 1484 | 1484 | |
| 1485 | 1485 | static DRIVER_INIT( nomnlnd ) |
| 1486 | 1486 | { |
| 1487 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r); | |
| 1488 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, SMH_NOP); | |
| 1489 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); | |
| 1490 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, DAC_0_data_w); | |
| 1487 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r); | |
| 1488 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, SMH_NOP); | |
| 1489 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); | |
| 1490 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, DAC_0_data_w); | |
| 1491 | 1491 | } |
| 1492 | 1492 | |
| 1493 | 1493 |
| r2418 | r2419 | |
|---|---|---|
| 1280 | 1280 | AM_RANGE(0x01100000, 0x0110ffff) AM_READWRITE(sys24_tile32_r, sys24_tile32_w) AM_MIRROR(0x10000) |
| 1281 | 1281 | AM_RANGE(0x01180000, 0x011fffff) AM_READWRITE(sys24_char32_r, sys24_char32_w) AM_MIRROR(0x100000) |
| 1282 | 1282 | |
| 1283 | AM_RANGE(0x01800000, 0x01803fff) AM_R | |
| 1283 | AM_RANGE(0x01800000, 0x01803fff) AM_R | |
| 1284 | 1284 | AM_RANGE(0x01810000, 0x0181bfff) AM_RAM AM_BASE(&model2_colorxlat) |
| 1285 | 1285 | AM_RANGE(0x0181c000, 0x0181c003) AM_WRITE(model2_3d_zclip_w) |
| 1286 | 1286 | AM_RANGE(0x01a10000, 0x01a1ffff) AM_READWRITE(network_r, network_w) |
| r2418 | r2419 | |
| 1311 | 1311 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE( geo_ctl1_w ) |
| 1312 | 1312 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2o_serial_w ) |
| 1313 | 1313 | |
| 1314 | AM_RANGE(0x12000000, 0x121fffff) AM_READWRITE(SMH_RAM, model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0) // texture RAM 0 | |
| 1315 | AM_RANGE(0x12400000, 0x125fffff) AM_READWRITE(SMH_RAM, model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1) // texture RAM 1 | |
| 1316 | AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE(SMH_RAM, model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM | |
| 1314 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0) // texture RAM 0 | |
| 1315 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1) // texture RAM 1 | |
| 1316 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE(model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM | |
| 1317 | 1317 | |
| 1318 | 1318 | AM_RANGE(0x01c00000, 0x01c00007) AM_READ(analog_r) |
| 1319 | 1319 | AM_RANGE(0x01c00010, 0x01c00013) AM_READ(ctrl10_r) |
| r2418 | r2419 | |
| 1338 | 1338 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE( geo_ctl1_w ) |
| 1339 | 1339 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2_serial_w ) |
| 1340 | 1340 | |
| 1341 | AM_RANGE(0x12000000, 0x121fffff) AM_READWRITE(SMH_RAM, model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0) // texture RAM 0 | |
| 1342 | AM_RANGE(0x12400000, 0x125fffff) AM_READWRITE(SMH_RAM, model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1) // texture RAM 1 | |
| 1343 | AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE(SMH_RAM, model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM | |
| 1341 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0) // texture RAM 0 | |
| 1342 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1) // texture RAM 1 | |
| 1343 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE(model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM | |
| 1344 | 1344 | |
| 1345 | 1345 | AM_RANGE(0x01c00000, 0x01c00003) AM_READWRITE(ctrl0_r, ctrl0_w) |
| 1346 | 1346 | AM_RANGE(0x01c00004, 0x01c00007) AM_READ(ctrl1_r) |
| r2418 | r2419 | |
| 3911 | 3911 | |
| 3912 | 3912 | static DRIVER_INIT( genprot ) |
| 3913 | 3913 | { |
| 3914 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r); | |
| 3915 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w); | |
| 3914 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w); | |
| 3916 | 3915 | protstate = protpos = 0; |
| 3917 | 3916 | } |
| 3918 | 3917 | |
| r2418 | r2419 | |
| 3920 | 3919 | { |
| 3921 | 3920 | UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1); |
| 3922 | 3921 | |
| 3923 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r); | |
| 3924 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w); | |
| 3922 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w); | |
| 3925 | 3923 | protstate = protpos = 0; |
| 3926 | 3924 | |
| 3927 | 3925 | // fix bug in program: it destroys the interrupt table and never fixes it |
| r2418 | r2419 | |
| 3932 | 3930 | { |
| 3933 | 3931 | UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1); |
| 3934 | 3932 | |
| 3935 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r); | |
| 3936 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w); | |
| 3933 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w); | |
| 3937 | 3934 | protstate = protpos = 0; |
| 3938 | 3935 | |
| 3939 | 3936 | // fix bug in program: it destroys the interrupt table and never fixes it |
| r2418 | r2419 | |
| 3942 | 3939 | |
| 3943 | 3940 | static DRIVER_INIT( daytonam ) |
| 3944 | 3941 | { |
| 3945 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x24ffff, 0, 0, maxx_r ); | |
| 3942 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x24ffff, 0, 0, maxx_r ); | |
| 3946 | 3943 | } |
| 3947 | 3944 | |
| 3948 | 3945 | static DRIVER_INIT( sgt24h ) |
| 3949 | 3946 | { |
| 3950 | 3947 | UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1); |
| 3951 | 3948 | |
| 3952 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r); | |
| 3953 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w); | |
| 3949 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w); | |
| 3954 | 3950 | protstate = protpos = 0; |
| 3955 | 3951 | |
| 3956 | 3952 | ROM[0x56578/4] = 0x08000004; |
| r2418 | r2419 | |
| 3961 | 3957 | { |
| 3962 | 3958 | UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1); |
| 3963 | 3959 | |
| 3964 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r); | |
| 3965 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w); | |
| 3960 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w); | |
| 3966 | 3961 | protstate = protpos = 0; |
| 3967 | 3962 | |
| 3968 | 3963 | ROM[0x630/4] = 0x08000004; |
| r2418 | r2419 | |
|---|---|---|
| 666 | 666 | leland_rotate_memory(1); |
| 667 | 667 | |
| 668 | 668 | /* set up additional input ports */ |
| 669 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r); | |
| 669 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r); | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | |
| r2418 | r2419 | |
| 689 | 689 | leland_rotate_memory(1); |
| 690 | 690 | |
| 691 | 691 | /* set up additional input ports */ |
| 692 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r); | |
| 692 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | |
| r2418 | r2419 | |
| 712 | 712 | leland_rotate_memory(1); |
| 713 | 713 | |
| 714 | 714 | /* set up additional input ports */ |
| 715 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 716 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 717 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 715 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 716 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 717 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | |
| r2418 | r2419 | |
| 737 | 737 | leland_rotate_memory(1); |
| 738 | 738 | |
| 739 | 739 | /* set up additional input ports */ |
| 740 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x02, 0, 0, indyheat_wheel_r); | |
| 741 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_r); | |
| 742 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_9_r); | |
| 743 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_10_r); | |
| 744 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_11_r); | |
| 740 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x02, 0, 0, indyheat_wheel_r); | |
| 741 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_r); | |
| 742 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_9_r); | |
| 743 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_10_r); | |
| 744 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_11_r); | |
| 745 | 745 | |
| 746 | 746 | /* set up additional output ports */ |
| 747 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_w); | |
| 747 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_w); | |
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | |
| r2418 | r2419 | |
| 767 | 767 | leland_rotate_memory(1); |
| 768 | 768 | |
| 769 | 769 | /* set up additional input ports */ |
| 770 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 771 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 772 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 770 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 771 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 772 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | |
| r2418 | r2419 | |
| 792 | 792 | leland_rotate_memory(1); |
| 793 | 793 | |
| 794 | 794 | /* asylum appears to have some extra RAM for the slave CPU */ |
| 795 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 795 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 796 | 796 | memory_set_bankptr(4, auto_malloc(0x1000)); |
| 797 | 797 | |
| 798 | 798 | /* set up additional input ports */ |
| 799 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 800 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 801 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 799 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); | |
| 800 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r); | |
| 801 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r); | |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 |
| r2418 | r2419 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 60 | 60 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 61 | AM_RANGE(0x8000, 0x87ff) AM_READWRITE(SMH_RAM, kyugo_bgvideoram_w) AM_BASE(&kyugo_bgvideoram) | |
| 62 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE(SMH_RAM, kyugo_bgattribram_w) AM_BASE(&kyugo_bgattribram) | |
| 63 | AM_RANGE(0x9000, 0x97ff) AM_READWRITE(SMH_RAM, kyugo_fgvideoram_w) AM_BASE(&kyugo_fgvideoram) | |
| 61 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(kyugo_bgvideoram_w) AM_BASE(&kyugo_bgvideoram) | |
| 62 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(kyugo_bgattribram_w) AM_BASE(&kyugo_bgattribram) | |
| 63 | AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(kyugo_fgvideoram_w) AM_BASE(&kyugo_fgvideoram) | |
| 64 | 64 | AM_RANGE(0x9800, 0x9fff) AM_READWRITE(kyugo_spriteram_2_r, SMH_RAM) AM_BASE(&kyugo_spriteram_2) |
| 65 | 65 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(&kyugo_spriteram_1) |
| 66 | 66 | AM_RANGE(0xa800, 0xa800) AM_WRITE(kyugo_scroll_x_lo_w) |
| r2418 | r2419 | |
| 1236 | 1236 | static DRIVER_INIT( gyrodine ) |
| 1237 | 1237 | { |
| 1238 | 1238 | /* add watchdog */ |
| 1239 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, watchdog_reset_w); | |
| 1239 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, watchdog_reset_w); | |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 | |
| 1243 | 1243 | static DRIVER_INIT( srdmissn ) |
| 1244 | 1244 | { |
| 1245 | 1245 | /* shared RAM is mapped at 0xe000 as well */ |
| 1246 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1); | |
| 1247 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1); | |
| 1246 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1248 | 1247 | memory_set_bankptr(1, shared_ram); |
| 1249 | 1248 | |
| 1250 | 1249 | /* extra RAM on sub CPU */ |
| 1251 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2); | |
| 1252 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2); | |
| 1250 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 1253 | 1251 | memory_set_bankptr(2, auto_malloc(0x800)); |
| 1254 | 1252 | } |
| 1255 | 1253 |
| r2418 | r2419 | |
|---|---|---|
| 1907 | 1907 | } |
| 1908 | 1908 | #endif |
| 1909 | 1909 | |
| 1910 | static void init_master_ports(UINT8 mvram_base, UINT8 io_base) | |
| 1910 | static void init_master_ports(running_machine *machine, UINT8 mvram_base, UINT8 io_base) | |
| 1911 | 1911 | { |
| 1912 | 1912 | /* set up the master CPU VRAM I/O */ |
| 1913 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_r); | |
| 1914 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_w); | |
| 1913 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_r, leland_mvram_port_w); | |
| 1915 | 1914 | |
| 1916 | 1915 | /* set up the master CPU I/O ports */ |
| 1917 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, io_base, io_base + 0x1f, 0, 0, leland_master_input_r); | |
| 1918 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, io_base, io_base + 0x0f, 0, 0, leland_master_output_w); | |
| 1916 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, io_base, io_base + 0x1f, 0, 0, leland_master_input_r); | |
| 1917 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, io_base, io_base + 0x0f, 0, 0, leland_master_output_w); | |
| 1919 | 1918 | } |
| 1920 | 1919 | |
| 1921 | 1920 | |
| r2418 | r2419 | |
| 1947 | 1946 | memory_set_bankptr(3, memory_region(REGION_CPU2) + 0x2000); |
| 1948 | 1947 | |
| 1949 | 1948 | /* set up the master CPU I/O ports */ |
| 1950 | init_master_ports(0x40, 0x80); | |
| 1949 | init_master_ports(machine, 0x40, 0x80); | |
| 1951 | 1950 | |
| 1952 | 1951 | /* set up additional input ports */ |
| 1953 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x80, 0x80, 0, 0, cerberus_dial_1_r); | |
| 1954 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x90, 0x90, 0, 0, cerberus_dial_2_r); | |
| 1952 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x80, 0x80, 0, 0, cerberus_dial_1_r); | |
| 1953 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x90, 0x90, 0, 0, cerberus_dial_2_r); | |
| 1955 | 1954 | } |
| 1956 | 1955 | |
| 1957 | 1956 | |
| r2418 | r2419 | |
| 1992 | 1991 | leland_update_master_bank = mayhem_bankswitch; |
| 1993 | 1992 | |
| 1994 | 1993 | /* set up the master CPU I/O ports */ |
| 1995 | init_master_ports(0x00, 0xc0); | |
| 1994 | init_master_ports(machine, 0x00, 0xc0); | |
| 1996 | 1995 | } |
| 1997 | 1996 | |
| 1998 | 1997 | |
| r2418 | r2419 | |
| 2021 | 2020 | leland_update_master_bank = mayhem_bankswitch; |
| 2022 | 2021 | |
| 2023 | 2022 | /* set up the master CPU I/O ports */ |
| 2024 | init_master_ports(0x40, 0x80); | |
| 2023 | init_master_ports(machine, 0x40, 0x80); | |
| 2025 | 2024 | } |
| 2026 | 2025 | |
| 2027 | 2026 | |
| r2418 | r2419 | |
| 2042 | 2041 | leland_update_master_bank = mayhem_bankswitch; |
| 2043 | 2042 | |
| 2044 | 2043 | /* set up the master CPU I/O ports */ |
| 2045 | init_master_ports(0x40, 0x80); | |
| 2044 | init_master_ports(machine, 0x40, 0x80); | |
| 2046 | 2045 | } |
| 2047 | 2046 | |
| 2048 | 2047 | |
| r2418 | r2419 | |
| 2065 | 2064 | leland_update_master_bank = mayhem_bankswitch; |
| 2066 | 2065 | |
| 2067 | 2066 | /* set up the master CPU I/O ports */ |
| 2068 | init_master_ports(0x00, 0xc0); | |
| 2067 | init_master_ports(machine, 0x00, 0xc0); | |
| 2069 | 2068 | |
| 2070 | 2069 | /* kludge warning: the game uses location E0CA to determine if the joysticks are available */ |
| 2071 | 2070 | /* it gets cleared by the code, but there is no obvious way for the value to be set to a */ |
| 2072 | 2071 | /* non-zero value. If the value is zero, the joystick is never read. */ |
| 2073 | alleymas_kludge_mem = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe0ca, 0xe0ca, 0, 0, alleymas_joystick_kludge); | |
| 2072 | alleymas_kludge_mem = memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0ca, 0xe0ca, 0, 0, alleymas_joystick_kludge); | |
| 2074 | 2073 | } |
| 2075 | 2074 | |
| 2076 | 2075 | |
| r2418 | r2419 | |
| 2095 | 2094 | leland_update_master_bank = mayhem_bankswitch; |
| 2096 | 2095 | |
| 2097 | 2096 | /* set up the master CPU I/O ports */ |
| 2098 | init_master_ports(0x00, 0xc0); | |
| 2097 | init_master_ports(machine, 0x00, 0xc0); | |
| 2099 | 2098 | } |
| 2100 | 2099 | |
| 2101 | 2100 | |
| r2418 | r2419 | |
| 2120 | 2119 | leland_update_master_bank = dangerz_bankswitch; |
| 2121 | 2120 | |
| 2122 | 2121 | /* set up the master CPU I/O ports */ |
| 2123 | init_master_ports(0x40, 0x80); | |
| 2122 | init_master_ports(machine, 0x40, 0x80); | |
| 2124 | 2123 | |
| 2125 | 2124 | /* set up additional input ports */ |
| 2126 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf4, 0xf4, 0, 0, dangerz_input_upper_r); | |
| 2127 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, dangerz_input_y_r); | |
| 2128 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, dangerz_input_x_r); | |
| 2125 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf4, 0xf4, 0, 0, dangerz_input_upper_r); | |
| 2126 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, dangerz_input_y_r); | |
| 2127 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, dangerz_input_x_r); | |
| 2129 | 2128 | } |
| 2130 | 2129 | |
| 2131 | 2130 | |
| r2418 | r2419 | |
| 2146 | 2145 | leland_update_master_bank = basebal2_bankswitch; |
| 2147 | 2146 | |
| 2148 | 2147 | /* set up the master CPU I/O ports */ |
| 2149 | init_master_ports(0x00, 0xc0); | |
| 2148 | init_master_ports(machine, 0x00, 0xc0); | |
| 2150 | 2149 | } |
| 2151 | 2150 | |
| 2152 | 2151 | |
| r2418 | r2419 | |
| 2168 | 2167 | leland_update_master_bank = basebal2_bankswitch; |
| 2169 | 2168 | |
| 2170 | 2169 | /* set up the master CPU I/O ports */ |
| 2171 | init_master_ports(0x80, 0x40); | |
| 2170 | init_master_ports(machine, 0x80, 0x40); | |
| 2172 | 2171 | } |
| 2173 | 2172 | |
| 2174 | 2173 | |
| r2418 | r2419 | |
| 2190 | 2189 | leland_update_master_bank = basebal2_bankswitch; |
| 2191 | 2190 | |
| 2192 | 2191 | /* set up the master CPU I/O ports */ |
| 2193 | init_master_ports(0x00, 0x40); | |
| 2192 | init_master_ports(machine, 0x00, 0x40); | |
| 2194 | 2193 | } |
| 2195 | 2194 | |
| 2196 | 2195 | |
| r2418 | r2419 | |
| 2213 | 2212 | leland_rotate_memory(0); |
| 2214 | 2213 | |
| 2215 | 2214 | /* set up the master CPU I/O ports */ |
| 2216 | init_master_ports(0x00, 0xc0); | |
| 2215 | init_master_ports(machine, 0x00, 0xc0); | |
| 2217 | 2216 | |
| 2218 | 2217 | /* set up additional input ports */ |
| 2219 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, redline_pedal_1_r); | |
| 2220 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xd0, 0xd0, 0, 0, redline_pedal_2_r); | |
| 2221 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, redline_wheel_2_r); | |
| 2222 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, redline_wheel_1_r); | |
| 2218 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, redline_pedal_1_r); | |
| 2219 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xd0, 0xd0, 0, 0, redline_pedal_2_r); | |
| 2220 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, redline_wheel_2_r); | |
| 2221 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, redline_wheel_1_r); | |
| 2223 | 2222 | } |
| 2224 | 2223 | |
| 2225 | 2224 | |
| r2418 | r2419 | |
| 2244 | 2243 | leland_rotate_memory(0); |
| 2245 | 2244 | |
| 2246 | 2245 | /* set up the master CPU I/O ports */ |
| 2247 | init_master_ports(0x40, 0x80); | |
| 2246 | init_master_ports(machine, 0x40, 0x80); | |
| 2248 | 2247 | } |
| 2249 | 2248 | |
| 2250 | 2249 | |
| r2418 | r2419 | |
| 2271 | 2270 | leland_rotate_memory(1); |
| 2272 | 2271 | |
| 2273 | 2272 | /* set up the master CPU I/O ports */ |
| 2274 | init_master_ports(0x00, 0xc0); | |
| 2273 | init_master_ports(machine, 0x00, 0xc0); | |
| 2275 | 2274 | |
| 2276 | 2275 | /* set up additional input ports */ |
| 2277 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xa4, 0xa4, 0, 0, dangerz_input_upper_r); | |
| 2278 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xb8, 0, 0, dangerz_input_y_r); | |
| 2279 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xbc, 0xbc, 0, 0, dangerz_input_x_r); | |
| 2276 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xa4, 0xa4, 0, 0, dangerz_input_upper_r); | |
| 2277 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xb8, 0, 0, dangerz_input_y_r); | |
| 2278 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbc, 0xbc, 0, 0, dangerz_input_x_r); | |
| 2280 | 2279 | } |
| 2281 | 2280 | |
| 2282 | 2281 | |
| r2418 | r2419 | |
| 2302 | 2301 | leland_rotate_memory(1); |
| 2303 | 2302 | |
| 2304 | 2303 | /* set up the master CPU I/O ports */ |
| 2305 | init_master_ports(0x40, 0x80); | |
| 2304 | init_master_ports(machine, 0x40, 0x80); | |
| 2306 | 2305 | |
| 2307 | 2306 | /* set up additional input ports */ |
| 2308 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2309 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2307 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2308 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2310 | 2309 | } |
| 2311 | 2310 | |
| 2312 | 2311 | |
| r2418 | r2419 | |
| 2332 | 2331 | leland_rotate_memory(1); |
| 2333 | 2332 | |
| 2334 | 2333 | /* set up the master CPU I/O ports */ |
| 2335 | init_master_ports(0x00, 0xc0); | |
| 2334 | init_master_ports(machine, 0x00, 0xc0); | |
| 2336 | 2335 | |
| 2337 | 2336 | /* set up additional input ports */ |
| 2338 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2339 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2337 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2338 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2340 | 2339 | } |
| 2341 | 2340 | |
| 2342 | 2341 | |
| r2418 | r2419 | |
| 2362 | 2361 | leland_rotate_memory(1); |
| 2363 | 2362 | |
| 2364 | 2363 | /* set up the master CPU I/O ports */ |
| 2365 | init_master_ports(0x80, 0x40); | |
| 2364 | init_master_ports(machine, 0x80, 0x40); | |
| 2366 | 2365 | |
| 2367 | 2366 | /* set up additional input ports */ |
| 2368 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2369 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2367 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2368 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2370 | 2369 | } |
| 2371 | 2370 | |
| 2372 | 2371 | |
| r2418 | r2419 | |
| 2392 | 2391 | leland_rotate_memory(1); |
| 2393 | 2392 | |
| 2394 | 2393 | /* set up the master CPU I/O ports */ |
| 2395 | init_master_ports(0x00, 0x40); | |
| 2394 | init_master_ports(machine, 0x00, 0x40); | |
| 2396 | 2395 | |
| 2397 | 2396 | /* set up additional input ports */ |
| 2398 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2399 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2397 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r); | |
| 2398 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r); | |
| 2400 | 2399 | } |
| 2401 | 2400 | |
| 2402 | 2401 | |
| r2418 | r2419 | |
| 2427 | 2426 | leland_rotate_memory(1); |
| 2428 | 2427 | |
| 2429 | 2428 | /* set up the master CPU I/O ports */ |
| 2430 | init_master_ports(0x00, 0xc0); | |
| 2431 | init_master_ports(0x40, 0x80); /* yes, this is intentional */ | |
| 2429 | init_master_ports(machine, 0x00, 0xc0); | |
| 2430 | init_master_ports(machine, 0x40, 0x80); /* yes, this is intentional */ | |
| 2432 | 2431 | |
| 2433 | 2432 | /* set up additional input ports */ |
| 2434 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r); | |
| 2435 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r); | |
| 2436 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r); | |
| 2433 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r); | |
| 2434 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r); | |
| 2435 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r); | |
| 2437 | 2436 | } |
| 2438 | 2437 | |
| 2439 | 2438 | |
| r2418 | r2419 | |
| 2464 | 2463 | leland_rotate_memory(1); |
| 2465 | 2464 | |
| 2466 | 2465 | /* set up the master CPU I/O ports */ |
| 2467 | init_master_ports(0x80, 0x40); | |
| 2466 | init_master_ports(machine, 0x80, 0x40); | |
| 2468 | 2467 | |
| 2469 | 2468 | /* set up additional input ports */ |
| 2470 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r); | |
| 2471 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r); | |
| 2472 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r); | |
| 2469 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r); | |
| 2470 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r); | |
| 2471 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r); | |
| 2473 | 2472 | } |
| 2474 | 2473 | |
| 2475 | 2474 | |
| r2418 | r2419 | |
| 2498 | 2497 | leland_rotate_memory(1); |
| 2499 | 2498 | |
| 2500 | 2499 | /* set up the master CPU I/O ports */ |
| 2501 | init_master_ports(0x00, 0x40); | |
| 2500 | init_master_ports(machine, 0x00, 0x40); | |
| 2502 | 2501 | |
| 2503 | 2502 | /* set up additional input ports */ |
| 2504 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_4_r); | |
| 2503 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_4_r); | |
| 2505 | 2504 | } |
| 2506 | 2505 | |
| 2507 | 2506 |
| r2418 | r2419 | |
|---|---|---|
| 153 | 153 | static ADDRESS_MAP_START( gstream_32bit_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 154 | 154 | AM_RANGE(0x00000000, 0x003FFFFF) AM_RAM AM_BASE(&gstream_workram) // work ram |
| 155 | 155 | // AM_RANGE(0x40000000, 0x40FFFFFF) AM_RAM // ?? lots of data gets copied here if present, but game runs without it?? |
| 156 | AM_RANGE(0x80000000, 0x80003FFF) AM_RAM | |
| 156 | AM_RANGE(0x80000000, 0x80003FFF) AM_RAM | |
| 157 | 157 | AM_RANGE(0x4E000000, 0x4E1FFFFF) AM_ROM AM_REGION(REGION_USER2,0) // main game rom |
| 158 | 158 | AM_RANGE(0x4F000000, 0x4F000003) AM_WRITE(gstream_tilemap3_scrollx_w) |
| 159 | 159 | AM_RANGE(0x4F200000, 0x4F200003) AM_WRITE(gstream_tilemap3_scrolly_w) |
| 160 | AM_RANGE(0x4F400000, 0x4F406FFF) AM_RAM | |
| 160 | AM_RANGE(0x4F400000, 0x4F406FFF) AM_RAM | |
| 161 | 161 | AM_RANGE(0x4F800000, 0x4F800003) AM_WRITE(gstream_tilemap1_scrollx_w) |
| 162 | 162 | AM_RANGE(0x4FA00000, 0x4FA00003) AM_WRITE(gstream_tilemap1_scrolly_w) |
| 163 | 163 | AM_RANGE(0x4FC00000, 0x4FC00003) AM_WRITE(gstream_tilemap2_scrollx_w) |
| r2418 | r2419 | |
| 465 | 465 | |
| 466 | 466 | static DRIVER_INIT( gstream ) |
| 467 | 467 | { |
| 468 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd1ee0, 0xd1ee3, 0, 0, gstream_speedup_r ); | |
| 468 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd1ee0, 0xd1ee3, 0, 0, gstream_speedup_r ); | |
| 469 | 469 | |
| 470 | 470 | } |
| 471 | 471 | GAME( 2002, gstream, 0, gstream, gstream, gstream, ROT270, "Oriental Soft Japan", "G-Stream G2020", GAME_IMPERFECT_SOUND ) |
| r2418 | r2419 | |
|---|---|---|
| 1243 | 1243 | MDRV_CPU_VBLANK_INT_HACK(cps2_interrupt,262) // 262 /* ??? interrupts per frame */ |
| 1244 | 1244 | |
| 1245 | 1245 | MDRV_CPU_ADD(Z80, 8000000) |
| 1246 | MDRV_CPU_PROGRAM_MAP(qsound_map,0) | |
| 1246 | MDRV_CPU_PROGRAM_MAP(qsound_sub_map,0) | |
| 1247 | 1247 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, 251) /* 251 is good (see 'mercy mercy mercy'section of sgemf attract mode for accurate sound sync */ |
| 1248 | 1248 | |
| 1249 | 1249 | // MDRV_INTERLEAVE(262) /* 262 scanlines, for raster effects */ |
| r2418 | r2419 | |
| 7155 | 7155 | static DRIVER_INIT ( pzloop2 ) |
| 7156 | 7156 | { |
| 7157 | 7157 | DRIVER_INIT_CALL(cps2); |
| 7158 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r); | |
| 7158 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r); | |
| 7159 | 7159 | } |
| 7160 | 7160 | |
| 7161 | 7161 |
| r2418 | r2419 | |
|---|---|---|
| 176 | 176 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 177 | 177 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 178 | 178 | AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_BASE(&lordgun_priority_ram) // PRIORITY |
| 179 | AM_RANGE(0x300000, 0x30ffff) AM_READWRITE(SMH_RAM, lordgun_vram_0_w) AM_BASE(&lordgun_vram_0) // DISPLAY | |
| 180 | AM_RANGE(0x310000, 0x313fff) AM_READWRITE(SMH_RAM, lordgun_vram_1_w) AM_BASE(&lordgun_vram_1) // DISPLAY | |
| 181 | AM_RANGE(0x314000, 0x317fff) AM_READWRITE(SMH_RAM, lordgun_vram_2_w) AM_BASE(&lordgun_vram_2) // DISPLAY | |
| 182 | AM_RANGE(0x318000, 0x319fff) AM_READWRITE(SMH_RAM, lordgun_vram_3_w) AM_BASE(&lordgun_vram_3) // DISPLAY | |
| 179 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(lordgun_vram_0_w) AM_BASE(&lordgun_vram_0) // DISPLAY | |
| 180 | AM_RANGE(0x310000, 0x313fff) AM_RAM_WRITE(lordgun_vram_1_w) AM_BASE(&lordgun_vram_1) // DISPLAY | |
| 181 | AM_RANGE(0x314000, 0x317fff) AM_RAM_WRITE(lordgun_vram_2_w) AM_BASE(&lordgun_vram_2) // DISPLAY | |
| 182 | AM_RANGE(0x318000, 0x319fff) AM_RAM_WRITE(lordgun_vram_3_w) AM_BASE(&lordgun_vram_3) // DISPLAY | |
| 183 | 183 | AM_RANGE(0x31c000, 0x31c7ff) AM_RAM AM_BASE(&lordgun_scrollram) // LINE |
| 184 | 184 | AM_RANGE(0x400000, 0x4007ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // ANIMATOR |
| 185 | AM_RANGE(0x500000, 0x500fff) AM_R | |
| 185 | AM_RANGE(0x500000, 0x500fff) AM_R | |
| 186 | 186 | AM_RANGE(0x502000, 0x502001) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_0) |
| 187 | 187 | AM_RANGE(0x502200, 0x502201) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_1) |
| 188 | 188 | AM_RANGE(0x502400, 0x502401) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_2) |
| r2418 | r2419 | |
| 207 | 207 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 208 | 208 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 209 | 209 | AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_BASE(&lordgun_priority_ram) // PRIORITY |
| 210 | AM_RANGE(0x300000, 0x30ffff) AM_READWRITE(SMH_RAM, lordgun_vram_0_w) AM_BASE(&lordgun_vram_0) // DISPLAY | |
| 211 | AM_RANGE(0x310000, 0x313fff) AM_READWRITE(SMH_RAM, lordgun_vram_1_w) AM_BASE(&lordgun_vram_1) // DISPLAY | |
| 212 | AM_RANGE(0x314000, 0x317fff) AM_READWRITE(SMH_RAM, lordgun_vram_2_w) AM_BASE(&lordgun_vram_2) // DISPLAY | |
| 213 | AM_RANGE(0x318000, 0x319fff) AM_READWRITE(SMH_RAM, lordgun_vram_3_w) AM_BASE(&lordgun_vram_3) // DISPLAY | |
| 210 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(lordgun_vram_0_w) AM_BASE(&lordgun_vram_0) // DISPLAY | |
| 211 | AM_RANGE(0x310000, 0x313fff) AM_RAM_WRITE(lordgun_vram_1_w) AM_BASE(&lordgun_vram_1) // DISPLAY | |
| 212 | AM_RANGE(0x314000, 0x317fff) AM_RAM_WRITE(lordgun_vram_2_w) AM_BASE(&lordgun_vram_2) // DISPLAY | |
| 213 | AM_RANGE(0x318000, 0x319fff) AM_RAM_WRITE(lordgun_vram_3_w) AM_BASE(&lordgun_vram_3) // DISPLAY | |
| 214 | 214 | AM_RANGE(0x31c000, 0x31c7ff) AM_RAM AM_BASE(&lordgun_scrollram) // LINE |
| 215 | 215 | AM_RANGE(0x400000, 0x4007ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // ANIMATOR |
| 216 | AM_RANGE(0x500000, 0x500fff) AM_R | |
| 216 | AM_RANGE(0x500000, 0x500fff) AM_R | |
| 217 | 217 | AM_RANGE(0x502000, 0x502001) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_0) |
| 218 | 218 | AM_RANGE(0x502200, 0x502201) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_1) |
| 219 | 219 | AM_RANGE(0x502400, 0x502401) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_x_2) |
| r2418 | r2419 | |
|---|---|---|
| 70 | 70 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 71 | 71 | AM_RANGE(0x080000, 0x08000f) AM_READ(zerozone_input_r) |
| 72 | 72 | AM_RANGE(0x084000, 0x084001) AM_WRITE(zerozone_sound_w) |
| 73 | AM_RANGE(0x088000, 0x0881ff) AM_R | |
| 73 | AM_RANGE(0x088000, 0x0881ff) AM_R | |
| 74 | 74 | AM_RANGE(0x098000, 0x098001) AM_RAM /* Watchdog? */ |
| 75 | AM_RANGE(0x09ce00, 0x09ffff) AM_R | |
| 75 | AM_RANGE(0x09ce00, 0x09ffff) AM_R | |
| 76 | 76 | AM_RANGE(0x0b4000, 0x0b4001) AM_WRITE(zerozone_tilebank_w) |
| 77 | 77 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM |
| 78 | 78 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM /* Never read from */ |
| r2418 | r2419 | |
|---|---|---|
| 340 | 340 | AM_RANGE(0x0000, 0x07ff) AM_ROM /* CPU board ROM */ |
| 341 | 341 | AM_RANGE(0x0800, 0x7fff) AM_ROM /* PROM board ROM area */ |
| 342 | 342 | AM_RANGE(0x8000, 0xbfff) AM_ROM /* PROM board ROM area */ |
| 343 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(SMH_RAM, mainram_w) AM_BASE(&mainram) | |
| 344 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(SMH_RAM, vidram_w) AM_BASE(&videoram) | |
| 343 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(mainram_w) AM_BASE(&mainram) | |
| 344 | AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(vidram_w) AM_BASE(&videoram) | |
| 345 | 345 | ADDRESS_MAP_END |
| 346 | 346 | |
| 347 | 347 | |
| r2418 | r2419 | |
| 1399 | 1399 | segag80r_background_pcb = G80_BACKGROUND_NONE; |
| 1400 | 1400 | |
| 1401 | 1401 | /* install speech board */ |
| 1402 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1403 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1402 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1403 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1404 | 1404 | |
| 1405 | 1405 | /* install Astro Blaster sound board */ |
| 1406 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3f, 0, 0, astrob_sound_w); | |
| 1406 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3f, 0, 0, astrob_sound_w); | |
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | 1409 | |
| r2418 | r2419 | |
| 1416 | 1416 | segag80r_background_pcb = G80_BACKGROUND_NONE; |
| 1417 | 1417 | |
| 1418 | 1418 | /* install the 8255 PPI for the sound board */ |
| 1419 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r); | |
| 1420 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w); | |
| 1419 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w); | |
| 1421 | 1420 | } |
| 1422 | 1421 | |
| 1423 | 1422 | |
| r2418 | r2419 | |
| 1430 | 1429 | segag80r_background_pcb = G80_BACKGROUND_SPACEOD; |
| 1431 | 1430 | |
| 1432 | 1431 | /* configure ports for the background board */ |
| 1433 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_r); | |
| 1434 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_w); | |
| 1432 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_r, spaceod_back_port_w); | |
| 1435 | 1433 | |
| 1436 | 1434 | /* install Space Odyssey sound board */ |
| 1437 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, spaceod_sound_w); | |
| 1435 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, spaceod_sound_w); | |
| 1438 | 1436 | |
| 1439 | 1437 | /* install our wacky mangled ports */ |
| 1440 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf8, 0xfb, 0, 0, spaceod_mangled_ports_r); | |
| 1441 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spaceod_port_fc_r); | |
| 1438 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xfb, 0, 0, spaceod_mangled_ports_r); | |
| 1439 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spaceod_port_fc_r); | |
| 1442 | 1440 | } |
| 1443 | 1441 | |
| 1444 | 1442 | |
| r2418 | r2419 | |
| 1452 | 1450 | monsterb_expand_gfx(REGION_GFX1); |
| 1453 | 1451 | |
| 1454 | 1452 | /* install background board handlers */ |
| 1455 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w); | |
| 1456 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, monsterb_vidram_w); | |
| 1453 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w); | |
| 1454 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, monsterb_vidram_w); | |
| 1457 | 1455 | |
| 1458 | 1456 | /* install Monster Bash sound board */ |
| 1459 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r); | |
| 1460 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w); | |
| 1457 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w); | |
| 1461 | 1458 | } |
| 1462 | 1459 | |
| 1463 | 1460 | |
| r2418 | r2419 | |
| 1472 | 1469 | monsterb_expand_gfx(REGION_GFX1); |
| 1473 | 1470 | |
| 1474 | 1471 | /* install background board handlers */ |
| 1475 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w); | |
| 1476 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w); | |
| 1477 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w); | |
| 1472 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w); | |
| 1473 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w); | |
| 1474 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w); | |
| 1478 | 1475 | |
| 1479 | 1476 | /* install Monster Bash sound board */ |
| 1480 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r); | |
| 1481 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w); | |
| 1477 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w); | |
| 1482 | 1478 | } |
| 1483 | 1479 | |
| 1484 | 1480 | |
| r2418 | r2419 | |
| 1492 | 1488 | monsterb_expand_gfx(REGION_GFX1); |
| 1493 | 1489 | |
| 1494 | 1490 | /* install background board handlers */ |
| 1495 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w); | |
| 1496 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w); | |
| 1497 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w); | |
| 1491 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w); | |
| 1492 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w); | |
| 1493 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w); | |
| 1498 | 1494 | |
| 1499 | 1495 | /* install Universal sound board */ |
| 1500 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r); | |
| 1501 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w); | |
| 1502 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r); | |
| 1503 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w); | |
| 1496 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w); | |
| 1497 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w); | |
| 1504 | 1498 | } |
| 1505 | 1499 | |
| 1506 | 1500 | |
| r2418 | r2419 | |
| 1525 | 1519 | segag80r_background_pcb = G80_BACKGROUND_SINDBADM; |
| 1526 | 1520 | |
| 1527 | 1521 | /* install background board handlers */ |
| 1528 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x40, 0x41, 0, 0, sindbadm_back_port_w); | |
| 1529 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, sindbadm_vidram_w); | |
| 1522 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x41, 0, 0, sindbadm_back_port_w); | |
| 1523 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, sindbadm_vidram_w); | |
| 1530 | 1524 | |
| 1531 | 1525 | /* install the 8255 PPI for the sound board */ |
| 1532 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_r); | |
| 1533 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_w); | |
| 1526 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_r, ppi8255_0_w); | |
| 1534 | 1527 | ppi_intf.portBread[0] = port_tag_to_handler8("FC"); |
| 1535 | 1528 | ppi8255_init(&ppi_intf); |
| 1536 | 1529 | } |
| r2418 | r2419 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static ADDRESS_MAP_START( magic10_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 81 | 81 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 82 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 83 | AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 84 | AM_RANGE(0x102000, 0x103fff) AM_RAM AM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 82 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 83 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 84 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 85 | 85 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 86 | AM_RANGE(0x300000, 0x3001ff) AM_RAM | |
| 86 | AM_RANGE(0x300000, 0x3001ff) AM_RAM | |
| 87 | 87 | AM_RANGE(0x400000, 0x400001) AM_READ(input_port_0_word_r) |
| 88 | 88 | AM_RANGE(0x400002, 0x400003) AM_READ(input_port_1_word_r) |
| 89 | 89 | AM_RANGE(0x400008, 0x400009) AM_WRITE(magic10_misc_w) |
| r2418 | r2419 | |
| 95 | 95 | |
| 96 | 96 | static ADDRESS_MAP_START( magic10a_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 97 | 97 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 98 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 99 | AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 100 | AM_RANGE(0x102000, 0x103fff) AM_RAM AM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 98 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 99 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 100 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 101 | 101 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 102 | AM_RANGE(0x300000, 0x3001ff) AM_RAM | |
| 102 | AM_RANGE(0x300000, 0x3001ff) AM_RAM | |
| 103 | 103 | AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r) |
| 104 | 104 | AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r) |
| 105 | 105 | AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_misc_w) |
| r2418 | r2419 | |
| 111 | 111 | |
| 112 | 112 | static ADDRESS_MAP_START( magic102_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 113 | 113 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 114 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 115 | AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 116 | AM_RANGE(0x102000, 0x103fff) AM_RAM AM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 114 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram) | |
| 115 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram) | |
| 116 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram) | |
| 117 | 117 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 118 | AM_RANGE(0x400000, 0x4001ff) AM_RAM | |
| 118 | AM_RANGE(0x400000, 0x4001ff) AM_RAM | |
| 119 | 119 | AM_RANGE(0x500000, 0x500001) AM_READ(magic102_r) |
| 120 | 120 | AM_RANGE(0x500004, 0x500005) AM_READNOP // gives credits |
| 121 | 121 | AM_RANGE(0x500006, 0x500007) AM_READNOP // gives credits |
| r2418 | r2419 | |
|---|---|---|
| 720 | 720 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 721 | 721 | AM_RANGE(0x040000, 0x043fff) AM_RAM /* main RAM */ |
| 722 | 722 | AM_RANGE(0x060000, 0x063fff) AM_RAM /* main RAM */ |
| 723 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 723 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 724 | 724 | AM_RANGE(0x0a0000, 0x0a0001) AM_READWRITE(input_port_0_word_r, tmnt_0a0000_w) |
| 725 | 725 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ(input_port_1_word_r) |
| 726 | 726 | AM_RANGE(0x0a0004, 0x0a0005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 741 | 741 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 742 | 742 | AM_RANGE(0x040000, 0x043fff) AM_RAM /* main RAM */ |
| 743 | 743 | AM_RANGE(0x060000, 0x063fff) AM_RAM /* main RAM */ |
| 744 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 744 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 745 | 745 | AM_RANGE(0x0a0000, 0x0a0001) AM_READWRITE(input_port_0_word_r, tmnt_0a0000_w) |
| 746 | 746 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ(input_port_1_word_r) |
| 747 | 747 | AM_RANGE(0x0a0004, 0x0a0005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 762 | 762 | static ADDRESS_MAP_START( tmnt_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 763 | 763 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 764 | 764 | AM_RANGE(0x060000, 0x063fff) AM_RAM /* main RAM */ |
| 765 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 765 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 766 | 766 | AM_RANGE(0x0a0000, 0x0a0001) AM_READWRITE(input_port_0_word_r, tmnt_0a0000_w) |
| 767 | 767 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ(input_port_1_word_r) |
| 768 | 768 | AM_RANGE(0x0a0004, 0x0a0005) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
| 783 | 783 | static ADDRESS_MAP_START( punkshot_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 784 | 784 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 785 | 785 | AM_RANGE(0x080000, 0x083fff) AM_RAM /* main RAM */ |
| 786 | AM_RANGE(0x090000, 0x090fff) AM_R | |
| 786 | AM_RANGE(0x090000, 0x090fff) AM_R | |
| 787 | 787 | AM_RANGE(0x0a0000, 0x0a0001) AM_READ(input_port_0_word_r) |
| 788 | 788 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ(input_port_1_word_r) |
| 789 | 789 | AM_RANGE(0x0a0004, 0x0a0005) AM_READ(input_port_3_word_r) |
| r2418 | r2419 | |
| 802 | 802 | |
| 803 | 803 | static ADDRESS_MAP_START( lgtnfght_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 804 | 804 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 805 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 805 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 806 | 806 | AM_RANGE(0x090000, 0x093fff) AM_RAM /*main RAM */ |
| 807 | 807 | AM_RANGE(0x0a0000, 0x0a0001) AM_READ(input_port_0_word_r) |
| 808 | 808 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
| 832 | 832 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(K052109_word_r, K052109_word_w) |
| 833 | 833 | AM_RANGE(0x204000, 0x207fff) AM_RAM /* main RAM */ |
| 834 | 834 | AM_RANGE(0x300000, 0x303fff) AM_READWRITE(K053245_scattered_word_r, K053245_scattered_word_w) AM_BASE(&spriteram16) |
| 835 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 835 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 836 | 836 | AM_RANGE(0x500000, 0x50003f) AM_READWRITE(K054000_lsb_r, K054000_lsb_w) |
| 837 | 837 | AM_RANGE(0x680000, 0x68001f) AM_READWRITE(K053244_word_noA1_r, K053244_word_noA1_w) |
| 838 | 838 | AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r) |
| r2418 | r2419 | |
| 853 | 853 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 854 | 854 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 855 | 855 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(K053245_scattered_word_r, K053245_scattered_word_w) AM_BASE(&spriteram16) |
| 856 | AM_RANGE(0x108000, 0x108fff) AM_R | |
| 856 | AM_RANGE(0x108000, 0x108fff) AM_R | |
| 857 | 857 | AM_RANGE(0x10c000, 0x10cfff) AM_RAM AM_BASE(&K053936_0_linectrl) /* 053936? */ |
| 858 | 858 | AM_RANGE(0x110000, 0x11001f) AM_WRITE(K053244_word_noA1_w) /* duplicate! */ |
| 859 | 859 | AM_RANGE(0x114000, 0x11401f) AM_READWRITE(K053244_lsb_r, K053244_lsb_w) /* duplicate! */ |
| r2418 | r2419 | |
| 876 | 876 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 877 | 877 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 878 | 878 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(K053245_scattered_word_r, K053245_scattered_word_w) AM_BASE(&spriteram16) |
| 879 | AM_RANGE(0x108000, 0x108fff) AM_R | |
| 879 | AM_RANGE(0x108000, 0x108fff) AM_R | |
| 880 | 880 | AM_RANGE(0x10c000, 0x10cfff) AM_RAM AM_BASE(&K053936_0_linectrl) |
| 881 | 881 | AM_RANGE(0x110000, 0x11001f) AM_WRITE(K053244_word_noA1_w) /* duplicate! */ |
| 882 | 882 | AM_RANGE(0x114000, 0x11401f) AM_READWRITE(K053244_lsb_r, K053244_lsb_w) /* duplicate! */ |
| r2418 | r2419 | |
| 1128 | 1128 | static ADDRESS_MAP_START( tmnt2_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1129 | 1129 | AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_BASE(&tmnt2_rom) |
| 1130 | 1130 | AM_RANGE(0x104000, 0x107fff) AM_RAM AM_BASE(&sunset_104000) /* main RAM */ |
| 1131 | AM_RANGE(0x140000, 0x140fff) AM_READWRITE(SMH_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 1132 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(SMH_RAM, K053245_scattered_word_w) AM_BASE(&spriteram16) // K053245_scattered_word_r | |
| 1131 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 1132 | AM_RANGE(0x180000, 0x183fff) AM_RAM_WRITE(K053245_scattered_word_w) AM_BASE(&spriteram16) // K053245_scattered_word_r | |
| 1133 | 1133 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ(input_port_0_word_r) |
| 1134 | 1134 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ(input_port_1_word_r) |
| 1135 | 1135 | AM_RANGE(0x1c0004, 0x1c0005) AM_READ(input_port_4_word_r) |
| r2418 | r2419 | |
| 1154 | 1154 | static ADDRESS_MAP_START( ssriders_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1155 | 1155 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 1156 | 1156 | AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */ |
| 1157 | AM_RANGE(0x140000, 0x140fff) AM_R | |
| 1157 | AM_RANGE(0x140000, 0x140fff) AM_R | |
| 1158 | 1158 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(K053245_scattered_word_r, K053245_scattered_word_w) AM_BASE(&spriteram16) |
| 1159 | 1159 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ(input_port_0_word_r) |
| 1160 | 1160 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
| 1180 | 1180 | static ADDRESS_MAP_START( sunsetbl_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1181 | 1181 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 1182 | 1182 | AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */ |
| 1183 | AM_RANGE(0x14c000, 0x14cfff) AM_R | |
| 1183 | AM_RANGE(0x14c000, 0x14cfff) AM_R | |
| 1184 | 1184 | AM_RANGE(0x14e700, 0x14e71f) AM_WRITE(K053251_lsb_w) |
| 1185 | 1185 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(K053245_scattered_word_r, K053245_scattered_word_w) AM_BASE(&spriteram16) |
| 1186 | 1186 | AM_RANGE(0x184000, 0x18ffff) AM_RAM |
| r2418 | r2419 | |
| 1206 | 1206 | static ADDRESS_MAP_START( thndrx2_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1207 | 1207 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1208 | 1208 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 1209 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 1209 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 1210 | 1210 | AM_RANGE(0x300000, 0x30001f) AM_WRITE(K053251_lsb_w) |
| 1211 | 1211 | AM_RANGE(0x400000, 0x400003) AM_READ(punkshot_sound_r) /* K053260 */ |
| 1212 | 1212 | AM_RANGE(0x400000, 0x400001) AM_WRITE(K053260_0_lsb_w) |
| r2418 | r2419 | |
|---|---|---|
| 1161 | 1161 | return data; |
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | static void system11gun_install( | |
| 1164 | static void system11gun_install( running_machine *machine ) | |
| 1165 | 1165 | { |
| 1166 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, system11gun_w ); | |
| 1167 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r ); | |
| 1166 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, system11gun_w ); | |
| 1167 | memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r ); | |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | static UINT8 kcram[ 12 ]; |
| r2418 | r2419 | |
| 1214 | 1214 | strcmp( machine->gamedrv->name, "tektagtb" ) == 0 || |
| 1215 | 1215 | strcmp( machine->gamedrv->name, "tektagtc" ) == 0 ) |
| 1216 | 1216 | { |
| 1217 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r ); | |
| 1218 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_w ); | |
| 1219 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r ); | |
| 1220 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_w ); | |
| 1217 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r, tektagt_protection_1_w ); | |
| 1218 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r, tektagt_protection_2_w ); | |
| 1221 | 1219 | } |
| 1222 | 1220 | |
| 1223 | 1221 | if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 || |
| r2418 | r2419 | |
| 1239 | 1237 | strcmp( machine->gamedrv->name, "ghlpanic" ) == 0 ) |
| 1240 | 1238 | { |
| 1241 | 1239 | /* this is based on guesswork, it might not even be keycus. */ |
| 1242 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 ); | |
| 1243 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f008000, 0x1f008003, 0, 0, kcon_w ); | |
| 1244 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f018000, 0x1f018003, 0, 0, kcoff_w ); | |
| 1240 | memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 ); | |
| 1241 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f008000, 0x1f008003, 0, 0, kcon_w ); | |
| 1242 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f018000, 0x1f018003, 0, 0, kcoff_w ); | |
| 1245 | 1243 | |
| 1246 | 1244 | memset( kcram, 0, sizeof( kcram ) ); |
| 1247 | 1245 | memory_set_bankptr( 2, kcram ); |
| r2418 | r2419 | |
| 1461 | 1459 | /* patch out wait for dma 5 to complete */ |
| 1462 | 1460 | *( (UINT32 *)( memory_region( REGION_USER1 ) + 0x331c4 ) ) = 0; |
| 1463 | 1461 | |
| 1464 | system11gun_install(); | |
| 1462 | system11gun_install(machine); | |
| 1465 | 1463 | } |
| 1466 | 1464 | |
| 1467 | 1465 | static DRIVER_INIT( ghlpanic ) |
| 1468 | 1466 | { |
| 1469 | 1467 | DRIVER_INIT_CALL(namcos12); |
| 1470 | 1468 | |
| 1471 | system11gun_install(); | |
| 1469 | system11gun_install(machine); | |
| 1472 | 1470 | } |
| 1473 | 1471 | |
| 1474 | 1472 | static MACHINE_DRIVER_START( coh700 ) |
| r2418 | r2419 | |
|---|---|---|
| 75 | 75 | /* machine/seicop.c */ |
| 76 | 76 | extern READ16_HANDLER( raiden2_cop2_r ); |
| 77 | 77 | extern WRITE16_HANDLER( raiden2_cop2_w ); |
| 78 | extern void cop_init(void); | |
| 78 | //extern void cop_init(void); | |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | |
| r2418 | r2419 | |
| 482 | 482 | |
| 483 | 483 | static INTERRUPT_GEN( raiden2_interrupt ) |
| 484 | 484 | { |
| 485 | mainram[0x740/2] = input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3) << 8); | |
| 486 | mainram[0x742/2] = 0xffff; | |
| 487 | mainram[0x744/2] = input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1) << 8); | |
| 488 | mainram[0x746/2] = 0xffff; | |
| 489 | mainram[0x748/2] = 0xffff; | |
| 490 | mainram[0x74a/2] = 0xffff; | |
| 491 | mainram[0x74c/2] = input_port_read_indexed(machine, 4) | 0xff00; | |
| 492 | mainram[0x74e/2] = 0xffff; | |
| 493 | 485 | |
| 494 | 486 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc0/4); /* VBL */ |
| 495 | 487 | logerror("VSYNC\n"); |
| r2418 | r2419 | |
| 518 | 510 | } |
| 519 | 511 | |
| 520 | 512 | |
| 521 | ||
| 513 | ||
| 522 | 514 | { |
| 523 | 515 | combine32(&sprcpt_adr, offset, data, mem_mask); |
| 524 | 516 | } |
| 525 | 517 | |
| 526 | ||
| 518 | ||
| 527 | 519 | { |
| 528 | 520 | combine32(sprcpt_data_1+sprcpt_adr, offset, data, mem_mask); |
| 529 | 521 | } |
| 530 | 522 | |
| 531 | ||
| 523 | ||
| 532 | 524 | { |
| 533 | 525 | combine32(sprcpt_data_2+sprcpt_adr, offset, data, mem_mask); |
| 534 | 526 | } |
| 535 | 527 | |
| 536 | ||
| 528 | ||
| 537 | 529 | { |
| 538 | 530 | combine32(sprcpt_data_3+sprcpt_idx, offset, data, mem_mask); |
| 539 | 531 | if(offset == 1) { |
| r2418 | r2419 | |
| 543 | 535 | } |
| 544 | 536 | } |
| 545 | 537 | |
| 546 | ||
| 538 | ||
| 547 | 539 | { |
| 548 | 540 | combine32(sprcpt_data_4+sprcpt_idx, offset, data, mem_mask); |
| 549 | 541 | if(offset == 1) { |
| r2418 | r2419 | |
| 553 | 545 | } |
| 554 | 546 | } |
| 555 | 547 | |
| 556 | ||
| 548 | ||
| 557 | 549 | { |
| 558 | 550 | combine32(sprcpt_val+0, offset, data, mem_mask); |
| 559 | 551 | } |
| 560 | 552 | |
| 561 | ||
| 553 | ||
| 562 | 554 | { |
| 563 | 555 | combine32(sprcpt_val+1, offset, data, mem_mask); |
| 564 | 556 | } |
| 565 | 557 | |
| 566 | ||
| 558 | ||
| 567 | 559 | { |
| 568 | 560 | combine32(&sprcpt_flags1, offset, data, mem_mask); |
| 569 | 561 | if(offset == 1) { |
| r2418 | r2419 | |
| 592 | 584 | } |
| 593 | 585 | } |
| 594 | 586 | |
| 595 | ||
| 587 | ||
| 596 | 588 | { |
| 597 | 589 | COMBINE_DATA(&sprcpt_flags2); |
| 598 | 590 | if(offset == 0) { |
| r2418 | r2419 | |
| 741 | 733 | static MACHINE_RESET(raiden2) |
| 742 | 734 | { |
| 743 | 735 | sprcpt_init(); |
| 744 | cop_init(); | |
| 736 | MACHINE_RESET_CALL(seibu_sound_1); | |
| 737 | ||
| 738 | //cop_init(); | |
| 745 | 739 | } |
| 746 | 740 | |
| 747 | 741 | |
| 748 | 742 | /* MEMORY MAPS */ |
| 749 | 743 | |
| 744 | extern UINT16* cop_mcu_ram; | |
| 745 | extern WRITE16_HANDLER( raiden2_mcu_w ); | |
| 746 | extern READ16_HANDLER( raiden2_mcu_r ); | |
| 747 | ||
| 750 | 748 | static ADDRESS_MAP_START( raiden2_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 751 | AM_RANGE(0x00400, 0x00 | |
| 749 | AM_RANGE(0x00400, 0x007ff) AM_READWRITE(raiden2_mcu | |
| 752 | 750 | |
| 753 | AM_RANGE(0x006a0, 0x006a3) AM_WRITE(sprcpt_val_1_w) | |
| 754 | AM_RANGE(0x006a4, 0x006a7) AM_WRITE(sprcpt_data_3_w) | |
| 755 | AM_RANGE(0x006a8, 0x006ab) AM_WRITE(sprcpt_data_4_w) | |
| 756 | AM_RANGE(0x006ac, 0x006af) AM_WRITE(sprcpt_flags_1_w) | |
| 757 | AM_RANGE(0x006b0, 0x006b3) AM_WRITE(sprcpt_data_1_w) | |
| 758 | AM_RANGE(0x006b4, 0x006b7) AM_WRITE(sprcpt_data_2_w) | |
| 759 | AM_RANGE(0x006b8, 0x006bb) AM_WRITE(sprcpt_val_2_w) | |
| 760 | AM_RANGE(0x006bc, 0x006bf) AM_WRITE(sprcpt_adr_w) | |
| 761 | AM_RANGE(0x006ce, 0x006cf) AM_WRITE(sprcpt_flags_2_w) | |
| 762 | ||
| 763 | 751 | AM_RANGE(0x00000, 0x0bfff) AM_READWRITE(any_r, any_w) AM_BASE(&mainram) |
| 764 | 752 | // AM_RANGE(0x00000, 0x003ff) AM_RAM |
| 765 | 753 | |
| 766 | 754 | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 767 | AM_RANGE(0x0d000, 0x0d7ff) AM_READWRITE(SMH_RAM, raiden2_background_w) AM_BASE(&back_data) | |
| 768 | AM_RANGE(0x0d800, 0x0dfff) AM_READWRITE(SMH_RAM, raiden2_foreground_w) AM_BASE(&fore_data) | |
| 769 | AM_RANGE(0x0e000, 0x0e7ff) AM_READWRITE(SMH_RAM, raiden2_midground_w) AM_BASE(&mid_data) | |
| 770 | AM_RANGE(0x0e800, 0x0f7ff) AM_READWRITE(SMH_RAM, raiden2_text_w) AM_BASE(&videoram16) | |
| 755 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(raiden2_background_w) AM_BASE(&back_data) | |
| 756 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(raiden2_foreground_w) AM_BASE(&fore_data) | |
| 757 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(raiden2_midground_w) AM_BASE(&mid_data) | |
| 758 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(raiden2_text_w) AM_BASE(&videoram16) | |
| 771 | 759 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */ |
| 772 | 760 | |
| 773 | AM_RANGE(0x10000, 0x1efff) AM_READWRITE(SMH_RAM, w1x) AM_BASE(&w1ram) | |
| 774 | AM_RANGE(0x1f000, 0x1ffff) AM_READWRITE(SMH_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 761 | AM_RANGE(0x10000, 0x1efff) AM_RAM_WRITE(w1x) AM_BASE(&w1ram) | |
| 762 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 775 | 763 | |
| 776 | 764 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK(1) |
| 777 | 765 | AM_RANGE(0x40000, 0xfffff) AM_ROMBANK(2) |
| r2418 | r2419 | |
| 780 | 768 | /* INPUT PORTS */ |
| 781 | 769 | |
| 782 | 770 | static INPUT_PORTS_START( raiden2 ) |
| 771 | SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ | |
| 772 | ||
| 783 | 773 | PORT_START /* IN0 */ |
| 784 | 774 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 785 | 775 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| r2418 | r2419 | |
| 853 | 843 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 854 | 844 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 855 | 845 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 856 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_ | |
| 846 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 857 | 847 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 858 | 848 | INPUT_PORTS_END |
| 859 | 849 | |
| 860 | 850 | static INPUT_PORTS_START( raidendx ) |
| 851 | SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ | |
| 852 | ||
| 861 | 853 | PORT_START /* IN0 */ |
| 862 | 854 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 863 | 855 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| r2418 | r2419 | |
| 931 | 923 | PORT_START /* START BUTTONS */ |
| 932 | 924 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 933 | 925 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 926 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 927 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 928 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 934 | 929 | INPUT_PORTS_END |
| 935 | 930 | |
| 936 | 931 | |
| r2418 | r2419 | |
| 998 | 993 | |
| 999 | 994 | MDRV_MACHINE_RESET(raiden2) |
| 1000 | 995 | |
| 996 | SEIBU2_RAIDEN2_SOUND_SYSTEM_CPU(14318180/4) | |
| 997 | ||
| 998 | ||
| 1001 | 999 | /* video hardware */ |
| 1002 | 1000 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| 1003 | 1001 | |
| r2418 | r2419 | |
| 1018 | 1016 | MDRV_VIDEO_START(raiden2) |
| 1019 | 1017 | MDRV_VIDEO_UPDATE(raiden2) |
| 1020 | 1018 | |
| 1019 | /* sound hardware */ | |
| 1020 | SEIBU_SOUND_SYSTEM_YM2151_RAIDEN2_INTERFACE(28636360/8,28636360/28,1,2) | |
| 1021 | ||
| 1022 | ||
| 1021 | 1023 | /* Sound hardware infos: Z80 and YM2151 are clocked at XTAL_28_63636MHz/8 */ |
| 1022 | 1024 | /* The 2 Oki M6295 are clocked at XTAL_28_63636MHz/28 and pin 7 is high for both */ |
| 1023 | 1025 | |
| r2418 | r2419 | |
| 1052 | 1054 | ROM_START( raiden2 ) |
| 1053 | 1055 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1054 | 1056 | ROM_LOAD16_BYTE("prg0", 0x000000, 0x80000, CRC(09475ec4) SHA1(05027f2d8f9e11fcbd485659eda68ada286dae32) ) |
| 1057 | ROM_RELOAD(0x100000, 0x80000) | |
| 1055 | 1058 | ROM_LOAD16_BYTE("prg1", 0x000001, 0x80000, CRC(4609b5f2) SHA1(272d2aa75b8ea4d133daddf42c4fc9089093df2e) ) |
| 1059 | ROM_RELOAD(0x100001, 0x80000) | |
| 1056 | 1060 | |
| 1057 | 1061 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1058 | ROM_LOAD( "snd", 0x000000, 0x10000, CRC(f51a28f9) SHA1(7ae2e2ba0c8159a544a8fd2bb0c2c694ba849302) ) | |
| 1062 | ROM_LOAD( "snd", 0x000000, 0x08000, CRC(f51a28f9) SHA1(7ae2e2ba0c8159a544a8fd2bb0c2c694ba849302) ) | |
| 1063 | ROM_CONTINUE(0x10000,0x8000) | |
| 1064 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1059 | 1065 | |
| 1066 | ||
| 1060 | 1067 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) /* chars */ |
| 1061 | 1068 | ROM_LOAD( "px0", 0x000000, 0x020000, CRC(c9ec9469) SHA1(a29f480a1bee073be7a177096ef58e1887a5af24) ) |
| 1062 | 1069 | |
| r2418 | r2419 | |
| 1070 | 1077 | ROM_LOAD32_WORD( "obj3", 0x400000, 0x200000, CRC(897a0322) SHA1(abb2737a2446da5b364fc2d96524b43d808f4126) ) |
| 1071 | 1078 | ROM_LOAD32_WORD( "obj4", 0x400002, 0x200000, CRC(b676e188) SHA1(19cc838f1ccf9c4203cd0e5365e5d99ff3a4ff0f) ) |
| 1072 | 1079 | |
| 1073 | ROM_REGION( 0x | |
| 1080 | ROM_REGION( 0x | |
| 1074 | 1081 | ROM_LOAD( "voi1", 0x00000, 0x80000, CRC(f340457b) SHA1(8169acb24c82f68d223a31af38ee36eb6cb3adf4) ) |
| 1075 | ROM_LOAD( "voi2", 0x80000, 0x80000, CRC(d321ff54) SHA1(b61e602525f36eb28a1408ffb124abfbb6a08706) ) | |
| 1082 | ||
| 1083 | ROM_REGION( 0x080000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1084 | ROM_LOAD( "voi2", 0x00000, 0x80000, CRC(d321ff54) SHA1(b61e602525f36eb28a1408ffb124abfbb6a08706) ) | |
| 1076 | 1085 | ROM_END |
| 1077 | 1086 | |
| 1078 | 1087 | /* |
| r2418 | r2419 | |
| 1100 | 1109 | ROM_START( raiden2a ) |
| 1101 | 1110 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1102 | 1111 | ROM_LOAD16_BYTE("prg0", 0x000000, 0x80000, CRC(09475ec4) SHA1(05027f2d8f9e11fcbd485659eda68ada286dae32) ) // rom1 |
| 1112 | ROM_RELOAD(0x100000, 0x80000) | |
| 1103 | 1113 | ROM_LOAD16_BYTE("rom2e", 0x000001, 0x80000, CRC(458d619c) SHA1(842bf0eeb5d192a6b188f4560793db8dad697683) ) |
| 1114 | ROM_RELOAD(0x100001, 0x80000) | |
| 1104 | 1115 | |
| 1105 | 1116 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1106 | 1117 | ROM_LOAD( "rom5", 0x000000, 0x10000, CRC(8f130589) SHA1(e58c8beaf9f27f063ffbcb0ab4600123c25ce6f3) ) |
| r2418 | r2419 | |
| 1122 | 1133 | |
| 1123 | 1134 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1124 | 1135 | ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) |
| 1136 | ||
| 1137 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1125 | 1138 | ROM_END |
| 1126 | 1139 | |
| 1127 | 1140 | ROM_START( raiden2b ) |
| 1128 | 1141 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1129 | 1142 | ROM_LOAD16_BYTE("prg0", 0x000000, 0x80000, CRC(09475ec4) SHA1(05027f2d8f9e11fcbd485659eda68ada286dae32) ) // rom1 |
| 1143 | ROM_RELOAD(0x100000, 0x80000) | |
| 1130 | 1144 | ROM_LOAD16_BYTE("rom2j", 0x000001, 0x80000, CRC(e4e4fb4c) SHA1(7ccf33fe9a1cddf0c7e80d7ed66d615a828b3bb9) ) |
| 1145 | ROM_RELOAD(0x100001, 0x80000) | |
| 1131 | 1146 | |
| 1132 | 1147 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1133 | 1148 | ROM_LOAD( "rom5", 0x000000, 0x10000, CRC(8f130589) SHA1(e58c8beaf9f27f063ffbcb0ab4600123c25ce6f3) ) |
| r2418 | r2419 | |
| 1149 | 1164 | |
| 1150 | 1165 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1151 | 1166 | ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) |
| 1167 | ||
| 1168 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1152 | 1169 | ROM_END |
| 1153 | 1170 | |
| 1154 | 1171 | /* |
| r2418 | r2419 | |
| 1193 | 1210 | ROM_START( raiden2c ) |
| 1194 | 1211 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1195 | 1212 | ROM_LOAD16_BYTE("prg0", 0x000000, 0x80000, CRC(09475ec4) SHA1(05027f2d8f9e11fcbd485659eda68ada286dae32) ) // rom1 |
| 1213 | ROM_RELOAD(0x100000, 0x80000) | |
| 1196 | 1214 | ROM_LOAD16_BYTE("rom2j", 0x000001, 0x80000, CRC(e4e4fb4c) SHA1(7ccf33fe9a1cddf0c7e80d7ed66d615a828b3bb9) ) |
| 1215 | ROM_RELOAD(0x100001, 0x80000) | |
| 1197 | 1216 | |
| 1198 | 1217 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1199 | 1218 | ROM_LOAD( "rd2_5.110", 0x000000, 0x10000, CRC(c2028ba2) SHA1(f6a9322b669ff82dea6ecf52ad3bd5d0901cce1b) ) |
| r2418 | r2419 | |
| 1215 | 1234 | |
| 1216 | 1235 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1217 | 1236 | ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) |
| 1218 | ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1237 | ||
| 1238 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1239 | ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1219 | 1240 | ROM_END |
| 1220 | 1241 | |
| 1221 | 1242 | ROM_START( raiden2d ) |
| 1222 | 1243 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1223 | 1244 | ROM_LOAD16_BYTE("seibu1", 0x000000, 0x80000, CRC(c1fc70f5) SHA1(a054f5ae9583972c406d9cf871340d5e072d71a3) ) |
| 1245 | ROM_RELOAD(0x100000, 0x80000) | |
| 1224 | 1246 | ROM_LOAD16_BYTE("seibu2", 0x000001, 0x80000, CRC(28d5365f) SHA1(21efe29c2d373229c2ff302d86e59c2c94fa6d03) ) |
| 1247 | ROM_RELOAD(0x100001, 0x80000) | |
| 1225 | 1248 | |
| 1226 | 1249 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1227 | 1250 | ROM_LOAD( "seibu5", 0x000000, 0x10000, CRC(5db9f922) SHA1(8257aab98657fe44df19d2a48d85fcf65b3d98c6) ) |
| r2418 | r2419 | |
| 1241 | 1264 | |
| 1242 | 1265 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1243 | 1266 | ROM_LOAD( "seibu6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) |
| 1244 | ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1267 | ||
| 1268 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1269 | ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1245 | 1270 | ROM_END |
| 1246 | 1271 | |
| 1247 | 1272 | |
| r2418 | r2419 | |
| 1289 | 1314 | ROM_START( raiden2e ) |
| 1290 | 1315 | ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */ |
| 1291 | 1316 | ROM_LOAD16_BYTE("r2_prg_0.bin", 0x000000, 0x80000, CRC(2abc848c) SHA1(1df4276d0074fcf1267757fa0b525a980a520f3d) ) |
| 1317 | ROM_RELOAD(0x100000, 0x80000) | |
| 1292 | 1318 | ROM_LOAD16_BYTE("r2_prg_1.bin", 0x000001, 0x80000, CRC(509ade43) SHA1(7cdee7bb00a6a1c7899d10b96385d54c261f6f5a) ) |
| 1319 | ROM_RELOAD(0x100001, 0x80000) | |
| 1293 | 1320 | |
| 1294 | 1321 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1295 | 1322 | ROM_LOAD( "r2_snd.bin", 0x000000, 0x10000, CRC(6bad0a3e) SHA1(eb7ae42353e1984cd60b569c26cdbc3b025a7da6) ) |
| r2418 | r2419 | |
| 1309 | 1336 | |
| 1310 | 1337 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1311 | 1338 | ROM_LOAD( "r2_voi1.bin", 0x00000, 0x40000, CRC(488d050f) SHA1(fde2fd64fea6bc39e1a42885d21d362bc6be2ac2) ) |
| 1312 | ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1339 | ||
| 1340 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1341 | ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1313 | 1342 | ROM_END |
| 1314 | 1343 | |
| 1315 | 1344 | |
| r2418 | r2419 | |
| 1388 | 1417 | |
| 1389 | 1418 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1390 | 1419 | ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) |
| 1391 | ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1392 | 1420 | |
| 1421 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1422 | ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1423 | ||
| 1393 | 1424 | ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ |
| 1394 | 1425 | ROM_LOAD( "copx-d2.6s", 0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) ) |
| 1395 | 1426 | ROM_END |
| r2418 | r2419 | |
| 1460 | 1491 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1461 | 1492 | ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) |
| 1462 | 1493 | /* not from this set, assumed to be the same */ |
| 1463 | ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1464 | 1494 | |
| 1495 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1496 | ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1497 | ||
| 1465 | 1498 | ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ |
| 1466 | 1499 | /* not from this set, assumed to be the same */ |
| 1467 | 1500 | ROM_LOAD( "copx-d2.6s", 0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) ) |
| r2418 | r2419 | |
| 1537 | 1570 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1538 | 1571 | ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) |
| 1539 | 1572 | /* not from this set, assumed to be the same */ |
| 1540 | ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1541 | 1573 | |
| 1574 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1575 | ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1576 | ||
| 1542 | 1577 | ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ |
| 1543 | 1578 | /* not from this set, assumed to be the same */ |
| 1544 | 1579 | ROM_LOAD( "copx-d2.6s", 0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) ) |
| r2418 | r2419 | |
| 1572 | 1607 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1573 | 1608 | ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) |
| 1574 | 1609 | /* not from this set, assumed to be the same */ |
| 1575 | ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1576 | 1610 | |
| 1611 | ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ | |
| 1612 | ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) | |
| 1613 | ||
| 1577 | 1614 | ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ |
| 1578 | 1615 | /* not from this set, assumed to be the same */ |
| 1579 | 1616 | ROM_LOAD( "copx-d2.6s", 0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) ) |
| r2418 | r2419 | |
| 1610 | 1647 | |
| 1611 | 1648 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1612 | 1649 | ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a |
| 1650 | ||
| 1651 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1613 | 1652 | ROM_END |
| 1614 | 1653 | |
| 1615 | 1654 | ROM_START( zeroteaa ) |
| r2418 | r2419 | |
| 1639 | 1678 | |
| 1640 | 1679 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1641 | 1680 | ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin |
| 1681 | ||
| 1682 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1642 | 1683 | ROM_END |
| 1643 | 1684 | |
| 1644 | 1685 | ROM_START( zerotsel ) |
| r2418 | r2419 | |
| 1668 | 1709 | |
| 1669 | 1710 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1670 | 1711 | ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin |
| 1712 | ||
| 1713 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1671 | 1714 | ROM_END |
| 1672 | 1715 | |
| 1673 | 1716 | /* set contained only program roms, was marked as 'non-encrytped' but program isn't encrypted anyway?! */ |
| r2418 | r2419 | |
| 1698 | 1741 | |
| 1699 | 1742 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1700 | 1743 | ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a |
| 1744 | ||
| 1745 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1701 | 1746 | ROM_END |
| 1702 | 1747 | |
| 1703 | 1748 | /* Different hardware, uses COPX-D3 for protection */ |
| r2418 | r2419 | |
| 1723 | 1768 | |
| 1724 | 1769 | ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ |
| 1725 | 1770 | ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) |
| 1771 | ||
| 1772 | ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ | |
| 1726 | 1773 | ROM_END |
| 1727 | 1774 | |
| 1728 | 1775 | |
| r2418 | r2419 | |
| 1822 | 1869 | /* wrong , there must be some banking this just stops it crashing */ |
| 1823 | 1870 | UINT8 *RAM = memory_region(REGION_USER1); |
| 1824 | 1871 | |
| 1825 | memory_set_bankptr(1,&RAM[0x | |
| 1872 | memory_set_bankptr(1,&RAM[0x100000]); | |
| 1826 | 1873 | memory_set_bankptr(2,&RAM[0x040000]); |
| 1827 | 1874 | |
| 1828 | 1875 | raiden2_decrypt_sprites(); |
| r2418 | r2419 | |
| 1974 | 2021 | AM_RANGE(0x00880, 0x0bfff) AM_RAM |
| 1975 | 2022 | |
| 1976 | 2023 | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 1977 | AM_RANGE(0x0d000, 0x0d7ff) AM_READWRITE(SMH_RAM, raiden2_background_w) AM_BASE(&back_data) | |
| 1978 | AM_RANGE(0x0d800, 0x0dfff) AM_READWRITE(SMH_RAM, raiden2_foreground_w) AM_BASE(&fore_data) | |
| 1979 | AM_RANGE(0x0e000, 0x0e7ff) AM_READWRITE(SMH_RAM, raiden2_midground_w) AM_BASE(&mid_data) | |
| 1980 | AM_RANGE(0x0e800, 0x0f7ff) AM_READWRITE(SMH_RAM, raiden2_text_w) AM_BASE(&videoram16) | |
| 2024 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(raiden2_background_w) AM_BASE(&back_data) | |
| 2025 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(raiden2_foreground_w) AM_BASE(&fore_data) | |
| 2026 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(raiden2_midground_w) AM_BASE(&mid_data) | |
| 2027 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(raiden2_text_w) AM_BASE(&videoram16) | |
| 1981 | 2028 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */ |
| 1982 | 2029 | AM_RANGE(0x10000, 0x1efff) AM_RAM |
| 1983 | AM_RANGE(0x1f000, 0x1ffff) AM_R | |
| 2030 | AM_RANGE(0x1f000, 0x1ffff) AM_R | |
| 1984 | 2031 | |
| 1985 | 2032 | /* not sure of bank sizes etc. */ |
| 1986 | 2033 | AM_RANGE(0x20000, 0x2ffff) AM_ROMBANK(1) |
| r2418 | r2419 | |
|---|---|---|
| 61 | 61 | AM_RANGE(0x7000, 0x7000) AM_READWRITE(SMH_NOP,watchdog_reset_w) /* NOP??? */ |
| 62 | 62 | AM_RANGE(0x7100, 0x7100) AM_WRITE(zodiac_master_interrupt_enable_w) |
| 63 | 63 | AM_RANGE(0x7200, 0x7200) AM_WRITE(zodiack_flipscreen_w) |
| 64 | AM_RANGE(0x9000, 0x903f) AM_R | |
| 64 | AM_RANGE(0x9000, 0x903f) AM_R | |
| 65 | 65 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 66 | 66 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(&zodiack_bulletsram) AM_SIZE(&zodiack_bulletsram_size) |
| 67 | 67 | AM_RANGE(0x9080, 0x93ff) AM_RAM |
| 68 | AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(SMH_RAM, zodiack_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 69 | AM_RANGE(0xb000, 0xb3ff) AM_READWRITE(SMH_RAM, zodiack_videoram2_w) AM_BASE(&zodiack_videoram2) | |
| 68 | AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(zodiack_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 69 | AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(zodiack_videoram2_w) AM_BASE(&zodiack_videoram2) | |
| 70 | 70 | AM_RANGE(0xc000, 0xcfff) AM_ROM |
| 71 | 71 | ADDRESS_MAP_END |
| 72 | 72 |
| r2418 | r2419 | |
|---|---|---|
| 388 | 388 | static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 389 | 389 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 390 | 390 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 391 | AM_RANGE(0x8800, 0x8bff) AM_RAM AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram) | |
| 392 | AM_RANGE(0x9000, 0x903f) AM_RAM AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram) | |
| 391 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram) | |
| 392 | AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram) | |
| 393 | 393 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 394 | 394 | AM_RANGE(0x9060, 0x90ff) AM_RAM |
| 395 | 395 | AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_flip_screen_x_w) |
| r2418 | r2419 | |
| 406 | 406 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 407 | 407 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 408 | 408 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram) |
| 409 | AM_RANGE(0x5000, 0x503f) AM_RAM | |
| 409 | AM_RANGE(0x5000, 0x503f) AM_RAM | |
| 410 | 410 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 411 | 411 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size) |
| 412 | 412 | AM_RANGE(0x6004, 0x6004) AM_WRITE(hotshock_flip_screen_w) |
| r2418 | r2419 | |
|---|---|---|
| 108 | 108 | AM_RANGE(0x0800, 0x0800) AM_WRITENOP // ??? |
| 109 | 109 | AM_RANGE(0x0820, 0x0820) AM_WRITENOP // ??? |
| 110 | 110 | AM_RANGE(0x5000, 0x7fff) AM_MIRROR(0x8000) AM_ROM |
| 111 | AM_RANGE(0x8000, 0x83ff) AM_RAM | |
| 111 | AM_RANGE(0x8000, 0x83ff) AM_RAM | |
| 112 | 112 | AM_RANGE(0x8400, 0x8400) AM_WRITE(mole_tilebank_w) |
| 113 | 113 | AM_RANGE(0x8c00, 0x8c00) AM_WRITE(AY8910_write_port_0_w) |
| 114 | 114 | AM_RANGE(0x8c01, 0x8c01) AM_WRITE(AY8910_control_port_0_w) |
| r2418 | r2419 | |
|---|---|---|
| 777 | 777 | mem[i] ^= 0xFF; |
| 778 | 778 | |
| 779 | 779 | MACHINE_RESET_CALL(sys16_onetime); |
| 780 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r ); | |
| 780 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r ); | |
| 781 | 781 | |
| 782 | 782 | sys18_splittab_fg_x=&sys16_textram[0x0f80/2]; |
| 783 | 783 | sys18_splittab_bg_x=&sys16_textram[0x0fc0/2]; |
| r2418 | r2419 | |
|---|---|---|
| 157 | 157 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 158 | 158 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE(&bublbobl_objectram) AM_SIZE(&bublbobl_objectram_size) |
| 159 | 159 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1) |
| 160 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 160 | AM_RANGE(0xf800, 0xf9ff) AM_RAM | |
| 161 | 161 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(bublbobl_sound_command_w) |
| 162 | 162 | AM_RANGE(0xfa03, 0xfa03) AM_WRITENOP // sound cpu reset |
| 163 | 163 | AM_RANGE(0xfa80, 0xfa80) AM_WRITENOP |
| r2418 | r2419 | |
| 178 | 178 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 179 | 179 | AM_RANGE(0x9000, 0xafff) AM_ROMBANK(2) // ROM data for the background palette ram |
| 180 | 180 | AM_RANGE(0xb000, 0xb1ff) AM_ROM // banked ??? |
| 181 | AM_RANGE(0xc000, 0xc1ff) AM_RAM | |
| 181 | AM_RANGE(0xc000, 0xc1ff) AM_RAM | |
| 182 | 182 | AM_RANGE(0xc800, 0xcfff) AM_RAM // main ??? |
| 183 | 183 | AM_RANGE(0xd000, 0xd000) AM_WRITE(missb2_bg_bank_w) |
| 184 | 184 | AM_RANGE(0xd002, 0xd002) AM_WRITENOP |
| r2418 | r2419 | |
|---|---|---|
| 250 | 250 | |
| 251 | 251 | static DRIVER_INIT( ddealer ) |
| 252 | 252 | { |
| 253 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r ); | |
| 254 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe01e, 0xfe01f, 0, 0, ddealer_mcu_w ); | |
| 253 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r ); | |
| 254 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe01e, 0xfe01f, 0, 0, ddealer_mcu_w ); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | ROM_START( ddealer ) |
| r2418 | r2419 | |
|---|---|---|
| 211 | 211 | AM_RANGE(0x0000, 0x0000) AM_RAM AM_BASE(&liberatr_x) |
| 212 | 212 | AM_RANGE(0x0001, 0x0001) AM_RAM AM_BASE(&liberatr_y) |
| 213 | 213 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(liberatr_bitmap_xy_r, liberatr_bitmap_xy_w) |
| 214 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 214 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 215 | 215 | AM_RANGE(0x4000, 0x403f) AM_READ(atari_vg_earom_r) |
| 216 | 216 | AM_RANGE(0x5000, 0x5000) AM_READ(liberatr_input_port_0_r) |
| 217 | 217 | AM_RANGE(0x5001, 0x5001) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 244 | 244 | AM_RANGE(0x0000, 0x0000) AM_RAM AM_BASE(&liberatr_x) |
| 245 | 245 | AM_RANGE(0x0001, 0x0001) AM_RAM AM_BASE(&liberatr_y) |
| 246 | 246 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(liberatr_bitmap_xy_r, liberatr_bitmap_xy_w) |
| 247 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 247 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 248 | 248 | AM_RANGE(0x4000, 0x4000) AM_READ(liberatr_input_port_0_r) |
| 249 | 249 | AM_RANGE(0x4001, 0x4001) AM_READ(input_port_1_r) |
| 250 | 250 | AM_RANGE(0x4000, 0x400f) AM_WRITE(SMH_RAM) AM_BASE(&liberatr_base_ram) |
| r2418 | r2419 | |
|---|---|---|
| 559 | 559 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 560 | 560 | AM_RANGE(0x1000, 0x3fff) AM_ROM |
| 561 | 561 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&berzerk_videoram) AM_SIZE(&berzerk_videoram_size) AM_SHARE(1) |
| 562 | AM_RANGE(0x6000, 0x7fff) AM_R | |
| 562 | AM_RANGE(0x6000, 0x7fff) AM_R | |
| 563 | 563 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_BASE(&berzerk_colorram) |
| 564 | 564 | AM_RANGE(0xc000, 0xffff) AM_NOP |
| 565 | 565 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 568 | 568 | static ADDRESS_MAP_START( frenzy_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 569 | 569 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 570 | 570 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&berzerk_videoram) AM_SIZE(&berzerk_videoram_size) AM_SHARE(1) |
| 571 | AM_RANGE(0x6000, 0x7fff) AM_R | |
| 571 | AM_RANGE(0x6000, 0x7fff) AM_R | |
| 572 | 572 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_BASE(&berzerk_colorram) |
| 573 | 573 | AM_RANGE(0xc000, 0xcfff) AM_ROM |
| 574 | 574 | AM_RANGE(0xf800, 0xfbff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| r2418 | r2419 | |
|---|---|---|
| 245 | 245 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE(5) /* unused part of the palette RAM, I think? Gridiron uses it */ |
| 246 | 246 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(6) AM_WRITE(tehkanwc_videoram2_w) AM_BASE(&tehkanwc_videoram2) |
| 247 | 247 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE(7) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */ |
| 248 | AM_RANGE(0xec00, 0xec01) AM_RAM AM_WRITE(tehkanwc_scroll_x_w) | |
| 249 | AM_RANGE(0xec02, 0xec02) AM_RAM AM_WRITE(tehkanwc_scroll_y_w) | |
| 248 | AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w) | |
| 249 | AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w) | |
| 250 | 250 | AM_RANGE(0xf800, 0xf801) AM_READWRITE(tehkanwc_track_0_r, tehkanwc_track_0_reset_w) /* track 0 x/y */ |
| 251 | 251 | AM_RANGE(0xf802, 0xf802) AM_READWRITE(input_port_9_r, gridiron_led0_w) /* Coin & Start */ |
| 252 | 252 | AM_RANGE(0xf803, 0xf803) AM_READ(input_port_5_r) /* joy0 - button */ |
| r2418 | r2419 | |
|---|---|---|
| 164 | 164 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 165 | 165 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 166 | 166 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 167 | AM_RANGE(0x8800, 0x8bff) AM_READWRITE(SMH_RAM, suprridr_bgram_w) AM_BASE(&suprridr_bgram) | |
| 168 | AM_RANGE(0x9000, 0x97ff) AM_READWRITE(SMH_RAM, suprridr_fgram_w) AM_BASE(&suprridr_fgram) | |
| 167 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(suprridr_bgram_w) AM_BASE(&suprridr_bgram) | |
| 168 | AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(suprridr_fgram_w) AM_BASE(&suprridr_fgram) | |
| 169 | 169 | AM_RANGE(0x9800, 0x983f) AM_RAM |
| 170 | 170 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(&spriteram) |
| 171 | 171 | AM_RANGE(0x9880, 0x9bff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 1812 | 1812 | } |
| 1813 | 1813 | |
| 1814 | 1814 | /* input ports */ |
| 1815 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, sngkace_input_r); | |
| 1815 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, sngkace_input_r); | |
| 1816 | 1816 | |
| 1817 | 1817 | /* sound latch */ |
| 1818 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w); | |
| 1818 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w); | |
| 1819 | 1819 | |
| 1820 | 1820 | psikyo_ka302c_banking = 0; // SH201B doesn't have any gfx banking |
| 1821 | 1821 | psikyo_switch_banks(0, 0); // sngkace / samuraia don't use banking |
| r2418 | r2419 | |
| 1984 | 1984 | static DRIVER_INIT( gunbird ) |
| 1985 | 1985 | { |
| 1986 | 1986 | /* input ports */ |
| 1987 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r); | |
| 1987 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r); | |
| 1988 | 1988 | |
| 1989 | 1989 | /* sound latch */ |
| 1990 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w); | |
| 1990 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w); | |
| 1991 | 1991 | |
| 1992 | 1992 | psikyo_ka302c_banking = 1; |
| 1993 | 1993 | } |
| r2418 | r2419 | |
| 2042 | 2042 | static DRIVER_INIT( s1945jn ) |
| 2043 | 2043 | { |
| 2044 | 2044 | /* input ports */ |
| 2045 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r); | |
| 2045 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r); | |
| 2046 | 2046 | |
| 2047 | 2047 | /* sound latch */ |
| 2048 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2048 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2049 | 2049 | |
| 2050 | 2050 | psikyo_ka302c_banking = 1; |
| 2051 | 2051 | } |
| r2418 | r2419 | |
| 2197 | 2197 | static DRIVER_INIT( s1945 ) |
| 2198 | 2198 | { |
| 2199 | 2199 | /* input ports */ |
| 2200 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2200 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2201 | 2201 | |
| 2202 | 2202 | /* sound latch */ |
| 2203 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2203 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2204 | 2204 | |
| 2205 | 2205 | /* protection and tile bank switching */ |
| 2206 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2206 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2207 | 2207 | s1945_mcu_init(s1945_table); |
| 2208 | 2208 | |
| 2209 | 2209 | psikyo_ka302c_banking = 0; // Banking is controlled by mcu |
| r2418 | r2419 | |
| 2212 | 2212 | static DRIVER_INIT( s1945a ) |
| 2213 | 2213 | { |
| 2214 | 2214 | /* input ports */ |
| 2215 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2215 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2216 | 2216 | |
| 2217 | 2217 | /* sound latch */ |
| 2218 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2218 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2219 | 2219 | |
| 2220 | 2220 | /* protection and tile bank switching */ |
| 2221 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2221 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2222 | 2222 | s1945_mcu_init(s1945a_table); |
| 2223 | 2223 | |
| 2224 | 2224 | psikyo_ka302c_banking = 0; // Banking is controlled by mcu |
| r2418 | r2419 | |
| 2227 | 2227 | static DRIVER_INIT( s1945j ) |
| 2228 | 2228 | { |
| 2229 | 2229 | /* input ports*/ |
| 2230 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2230 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2231 | 2231 | |
| 2232 | 2232 | /* sound latch */ |
| 2233 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2233 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2234 | 2234 | |
| 2235 | 2235 | /* protection and tile bank switching */ |
| 2236 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2236 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2237 | 2237 | s1945_mcu_init(s1945j_table); |
| 2238 | 2238 | |
| 2239 | 2239 | psikyo_ka302c_banking = 0; // Banking is controlled by mcu |
| r2418 | r2419 | |
| 2294 | 2294 | static DRIVER_INIT( tengai ) |
| 2295 | 2295 | { |
| 2296 | 2296 | /* input ports */ |
| 2297 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2297 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r); | |
| 2298 | 2298 | |
| 2299 | 2299 | /* sound latch */ |
| 2300 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2300 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w); | |
| 2301 | 2301 | |
| 2302 | 2302 | /* protection */ |
| 2303 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2303 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w); | |
| 2304 | 2304 | s1945_mcu_init(0); |
| 2305 | 2305 | |
| 2306 | 2306 | psikyo_ka302c_banking = 0; // Banking is controlled by mcu |
| r2418 | r2419 | |
|---|---|---|
| 509 | 509 | static ADDRESS_MAP_START( ampoker2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 510 | 510 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 511 | 511 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 512 | AM_RANGE(0xe000, 0xefff) AM_RAM | |
| 512 | AM_RANGE(0xe000, 0xefff) AM_RAM | |
| 513 | 513 | ADDRESS_MAP_END |
| 514 | 514 | |
| 515 | 515 | static ADDRESS_MAP_START( ampoker2_io_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | static ADDRESS_MAP_START( dynadice_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 69 | 69 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 70 | AM_RANGE(0x2000, 0x23ff) AM_R | |
| 70 | AM_RANGE(0x2000, 0x23ff) AM_R | |
| 71 | 71 | AM_RANGE(0x4000, 0x40ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 72 | 72 | ADDRESS_MAP_END |
| 73 | 73 |
| r2418 | r2419 | |
|---|---|---|
| 299 | 299 | static ADDRESS_MAP_START( wbeachvl_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 300 | 300 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 301 | 301 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 302 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(SMH_RAM, wbeachvl_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 303 | AM_RANGE(0x504000, 0x505fff) AM_READWRITE(SMH_RAM, wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 304 | AM_RANGE(0x508000, 0x509fff) AM_READWRITE(SMH_RAM, wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 302 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(wbeachvl_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 303 | AM_RANGE(0x504000, 0x505fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 304 | AM_RANGE(0x508000, 0x509fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 305 | 305 | AM_RANGE(0x50f000, 0x50ffff) AM_RAM AM_BASE(&wbeachvl_rowscroll) |
| 306 | 306 | AM_RANGE(0x510000, 0x51000b) AM_WRITE(wbeachvl_scroll_w) |
| 307 | 307 | AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP /* 2 and 3 */ |
| r2418 | r2419 | |
| 322 | 322 | AM_RANGE(0x000000, 0x2fffff) AM_ROM |
| 323 | 323 | AM_RANGE(0x304000, 0x304001) AM_WRITENOP /* watchdog? irq ack? */ |
| 324 | 324 | AM_RANGE(0x440000, 0x440cff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 325 | AM_RANGE(0x500000, 0x500fff) AM_RAM AM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 326 | AM_RANGE(0x501000, 0x501fff) AM_RAM AM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 325 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 326 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 327 | 327 | AM_RANGE(0x510000, 0x51000b) AM_WRITE(excelsr_scroll_w) |
| 328 | 328 | AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP /* 2 and 3 */ |
| 329 | 329 | AM_RANGE(0x600000, 0x67ffff) AM_RAM AM_BASE(&bigtwin_bgvideoram) |
| r2418 | r2419 | |
| 334 | 334 | AM_RANGE(0x70001a, 0x70001b) AM_READ(input_port_3_word_r) |
| 335 | 335 | AM_RANGE(0x70001c, 0x70001d) AM_READ(input_port_4_word_r) |
| 336 | 336 | AM_RANGE(0x70001e, 0x70001f) AM_WRITE(playmark_snd_command_w) |
| 337 | AM_RANGE(0x780000, 0x7807ff) AM_RAM | |
| 337 | AM_RANGE(0x780000, 0x7807ff) AM_RAM | |
| 338 | 338 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 339 | 339 | ADDRESS_MAP_END |
| 340 | 340 | |
| 341 | 341 | static ADDRESS_MAP_START( hotmind_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 342 | 342 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 343 | AM_RANGE(0x100000, 0x103fff) AM_READWRITE(SMH_RAM, hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 344 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(SMH_RAM, hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 345 | AM_RANGE(0x108000, 0x10ffff) AM_READWRITE(SMH_RAM, hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 343 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 344 | AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 345 | AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 346 | 346 | AM_RANGE(0x110000, 0x11000d) AM_WRITE(hrdtimes_scroll_w) |
| 347 | 347 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 348 | AM_RANGE(0x280000, 0x2807ff) AM_RAM | |
| 348 | AM_RANGE(0x280000, 0x2807ff) AM_RAM | |
| 349 | 349 | AM_RANGE(0x300010, 0x300011) AM_READ(input_port_0_word_r) |
| 350 | 350 | AM_RANGE(0x300012, 0x300013) AM_READ(input_port_1_word_r) |
| 351 | 351 | AM_RANGE(0x300014, 0x300015) AM_WRITE(hotmind_coin_eeprom_w) AM_READ(hotmind_port2_r) |
| r2418 | r2419 | |
| 360 | 360 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 361 | 361 | AM_RANGE(0x080000, 0x0bffff) AM_RAM |
| 362 | 362 | AM_RANGE(0x0c0000, 0x0fffff) AM_ROM AM_REGION(REGION_CPU1, 0x0c0000) |
| 363 | AM_RANGE(0x100000, 0x103fff) AM_READWRITE(SMH_RAM, hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 364 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(SMH_RAM, hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 365 | AM_RANGE(0x108000, 0x10ffff) AM_READWRITE(SMH_RAM, hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 363 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3) | |
| 364 | AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2) | |
| 365 | AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1) | |
| 366 | 366 | AM_RANGE(0x110000, 0x11000d) AM_WRITE(hrdtimes_scroll_w) |
| 367 | 367 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 368 | AM_RANGE(0x280000, 0x2807ff) AM_RAM | |
| 368 | AM_RANGE(0x280000, 0x2807ff) AM_RAM | |
| 369 | 369 | AM_RANGE(0x280800, 0x280fff) AM_RAM // unused |
| 370 | 370 | AM_RANGE(0x300010, 0x300011) AM_READ(input_port_0_word_r) |
| 371 | 371 | AM_RANGE(0x300012, 0x300013) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 62 | 62 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 63 | 63 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 64 | 64 | AM_RANGE(0x8800, 0x97ff) AM_RAM |
| 65 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_WRITE(background_w) AM_BASE(&bgvideoram) | |
| 66 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(foreground_w) AM_BASE(&fgvideoram) | |
| 65 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(background_w) AM_BASE(&bgvideoram) | |
| 66 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(foreground_w) AM_BASE(&fgvideoram) | |
| 67 | 67 | AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 68 | 68 | ADDRESS_MAP_END |
| 69 | 69 |
| r2418 | r2419 | |
|---|---|---|
| 4265 | 4265 | { |
| 4266 | 4266 | interleave_vroms(); |
| 4267 | 4267 | |
| 4268 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_r ); | |
| 4269 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_w ); | |
| 4268 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_r, scsi_w ); | |
| 4270 | 4269 | |
| 4271 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4270 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4272 | 4271 | |
| 4273 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r ); | |
| 4274 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w ); | |
| 4275 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r ); | |
| 4276 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w ); | |
| 4277 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r ); | |
| 4278 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w ); | |
| 4272 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w ); | |
| 4273 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w ); | |
| 4274 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w ); | |
| 4279 | 4275 | } |
| 4280 | 4276 | |
| 4281 | 4277 | static DRIVER_INIT( model3_15 ) |
| 4282 | 4278 | { |
| 4283 | 4279 | interleave_vroms(); |
| 4284 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4280 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4285 | 4281 | |
| 4286 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r ); | |
| 4287 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w ); | |
| 4288 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r ); | |
| 4289 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w ); | |
| 4290 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r ); | |
| 4291 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w ); | |
| 4282 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w ); | |
| 4283 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w ); | |
| 4284 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w ); | |
| 4292 | 4285 | } |
| 4293 | 4286 | |
| 4294 | 4287 | static DRIVER_INIT( model3_20 ) |
| 4295 | 4288 | { |
| 4296 | 4289 | interleave_vroms(); |
| 4297 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4290 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4298 | 4291 | |
| 4299 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_r ); | |
| 4300 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_w ); | |
| 4292 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_r, real3d_dma_w ); | |
| 4301 | 4293 | |
| 4302 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r ); | |
| 4303 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w ); | |
| 4304 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r ); | |
| 4305 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w ); | |
| 4306 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r ); | |
| 4307 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w ); | |
| 4294 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4295 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4296 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w ); | |
| 4308 | 4297 | } |
| 4309 | 4298 | |
| 4310 | 4299 | static DRIVER_INIT( lostwsga ) |
| r2418 | r2419 | |
| 4313 | 4302 | |
| 4314 | 4303 | DRIVER_INIT_CALL(model3_15); |
| 4315 | 4304 | /* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */ |
| 4316 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); | |
| 4317 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); | |
| 4305 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w ); | |
| 4318 | 4306 | |
| 4319 | 4307 | rom[0x7374f0/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
| 4320 | 4308 | } |
| r2418 | r2419 | |
| 4325 | 4313 | |
| 4326 | 4314 | DRIVER_INIT_CALL(model3_15); |
| 4327 | 4315 | /* TODO: network device at 0xC0000000 - FF */ |
| 4328 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); | |
| 4329 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); | |
| 4316 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w ); | |
| 4330 | 4317 | |
| 4331 | 4318 | rom[(0x71275c^4)/4] = 0x60000000; |
| 4332 | 4319 | rom[(0x71277c^4)/4] = 0x60000000; |
| r2418 | r2419 | |
| 4338 | 4325 | |
| 4339 | 4326 | DRIVER_INIT_CALL(model3_15); |
| 4340 | 4327 | /* TODO: network device at 0xC0000000 - FF */ |
| 4341 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); | |
| 4342 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); | |
| 4328 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w ); | |
| 4343 | 4329 | |
| 4344 | 4330 | rom[(0x713724^4)/4] = 0x60000000; |
| 4345 | 4331 | rom[(0x713744^4)/4] = 0x60000000; |
| r2418 | r2419 | |
| 4355 | 4341 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4356 | 4342 | DRIVER_INIT_CALL(model3_15); |
| 4357 | 4343 | |
| 4358 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); | |
| 4359 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); | |
| 4344 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w ); | |
| 4360 | 4345 | |
| 4361 | 4346 | rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
| 4362 | 4347 | |
| r2418 | r2419 | |
| 4387 | 4372 | rom[(0x70e710^4)/4] = 0x60000000; |
| 4388 | 4373 | |
| 4389 | 4374 | interleave_vroms(); |
| 4390 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4375 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4391 | 4376 | |
| 4392 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); | |
| 4393 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); | |
| 4377 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w ); | |
| 4394 | 4378 | |
| 4395 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r ); | |
| 4396 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w ); | |
| 4397 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r ); | |
| 4398 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w ); | |
| 4399 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r ); | |
| 4400 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w ); | |
| 4401 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r ); | |
| 4402 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w ); | |
| 4403 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r ); | |
| 4404 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w ); | |
| 4379 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4380 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4381 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4382 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4383 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w ); | |
| 4405 | 4384 | } |
| 4406 | 4385 | |
| 4407 | 4386 | static DRIVER_INIT( vs29815 ) |
| r2418 | r2419 | |
| 4412 | 4391 | rom[(0x60290c^4)/4] = 0x60000000; |
| 4413 | 4392 | |
| 4414 | 4393 | interleave_vroms(); |
| 4415 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4394 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4416 | 4395 | |
| 4417 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); | |
| 4418 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); | |
| 4396 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w ); | |
| 4419 | 4397 | |
| 4420 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r ); | |
| 4421 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w ); | |
| 4422 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r ); | |
| 4423 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w ); | |
| 4424 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r ); | |
| 4425 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w ); | |
| 4426 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r ); | |
| 4427 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w ); | |
| 4428 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r ); | |
| 4429 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w ); | |
| 4398 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4399 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4400 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4401 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4402 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w ); | |
| 4430 | 4403 | } |
| 4431 | 4404 | |
| 4432 | 4405 | static DRIVER_INIT( bass ) |
| r2418 | r2419 | |
| 4437 | 4410 | rom[(0x7999c8^4)/4] = 0x60000000; |
| 4438 | 4411 | |
| 4439 | 4412 | interleave_vroms(); |
| 4440 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4413 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4441 | 4414 | |
| 4442 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); | |
| 4443 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); | |
| 4415 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w ); | |
| 4444 | 4416 | |
| 4445 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r ); | |
| 4446 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w ); | |
| 4447 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r ); | |
| 4448 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w ); | |
| 4449 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r ); | |
| 4450 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w ); | |
| 4451 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r ); | |
| 4452 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w ); | |
| 4453 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r ); | |
| 4454 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w ); | |
| 4417 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4418 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w ); | |
| 4419 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4420 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w ); | |
| 4421 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w ); | |
| 4455 | 4422 | } |
| 4456 | 4423 | |
| 4457 | 4424 | static DRIVER_INIT( getbass ) |
| 4458 | 4425 | { |
| 4459 | 4426 | interleave_vroms(); |
| 4460 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4427 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 ); | |
| 4461 | 4428 | |
| 4462 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); | |
| 4463 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); | |
| 4429 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w ); | |
| 4464 | 4430 | |
| 4465 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r ); | |
| 4466 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w ); | |
| 4467 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r ); | |
| 4468 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w ); | |
| 4469 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r ); | |
| 4470 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w ); | |
| 4431 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w ); | |
| 4432 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w ); | |
| 4433 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w ); | |
| 4471 | 4434 | } |
| 4472 | 4435 | |
| 4473 | 4436 | static DRIVER_INIT( vs2 ) |
| r2418 | r2419 | |
| 4516 | 4479 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4517 | 4480 | DRIVER_INIT_CALL(model3_20); |
| 4518 | 4481 | |
| 4519 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r ); | |
| 4520 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_w ); | |
| 4482 | memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r, network_w ); | |
| 4521 | 4483 | |
| 4522 | 4484 | rom[(0x50e8d4^4)/4] = 0x60000000; |
| 4523 | 4485 | rom[(0x50e8f4^4)/4] = 0x60000000; |
| r2418 | r2419 | |
| 4585 | 4547 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4586 | 4548 | DRIVER_INIT_CALL(model3_20); |
| 4587 | 4549 | |
| 4588 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); | |
| 4550 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); | |
| 4589 | 4551 | |
| 4590 | 4552 | //rom[(0x68468c^4)/4] = 0x60000000; |
| 4591 | 4553 | rom[(0x6063c4^4)/4] = 0x60000000; |
| r2418 | r2419 | |
| 4598 | 4560 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4599 | 4561 | DRIVER_INIT_CALL(model3_20); |
| 4600 | 4562 | |
| 4601 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); | |
| 4563 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); | |
| 4602 | 4564 | |
| 4603 | 4565 | rom[(0x606784^4)/4] = 0x60000000; |
| 4604 | 4566 | rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code |
| r2418 | r2419 | |
|---|---|---|
| 571 | 571 | |
| 572 | 572 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 573 | 573 | |
| 574 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 575 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 574 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 575 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 576 | 576 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 577 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 577 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 578 | 578 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 579 | 579 | |
| 580 | 580 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 603 | 603 | |
| 604 | 604 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 605 | 605 | |
| 606 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 607 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 606 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 607 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 608 | 608 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 609 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 609 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 610 | 610 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 611 | 611 | |
| 612 | 612 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 635 | 635 | |
| 636 | 636 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 637 | 637 | |
| 638 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 639 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 638 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 639 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 640 | 640 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 641 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 641 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 642 | 642 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 643 | 643 | |
| 644 | 644 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 664 | 664 | |
| 665 | 665 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 666 | 666 | |
| 667 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 668 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 667 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 668 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 669 | 669 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 670 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 670 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 671 | 671 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 672 | 672 | |
| 673 | 673 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 697 | 697 | |
| 698 | 698 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 699 | 699 | |
| 700 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 701 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 700 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 701 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 702 | 702 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 703 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 703 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 704 | 704 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 705 | 705 | |
| 706 | 706 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 798 | 798 | |
| 799 | 799 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE(&pgm_mainram) /* Main Ram */ |
| 800 | 800 | |
| 801 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 802 | AM_RANGE(0x904000, 0x905fff) AM_READWRITE(SMH_RAM, pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 801 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(pgm_bg_videoram_w) AM_BASE(&pgm_bg_videoram) /* Backgrounds */ | |
| 802 | AM_RANGE(0x904000, 0x905fff) AM_RAM_WRITE(pgm_tx_videoram_w) AM_BASE(&pgm_tx_videoram) /* Text Layer */ | |
| 803 | 803 | AM_RANGE(0x907000, 0x9077ff) AM_RAM AM_BASE(&pgm_rowscrollram) |
| 804 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 804 | AM_RANGE(0xa00000, 0xa011ff) AM_R | |
| 805 | 805 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&pgm_videoregs) /* Video Regs inc. Zoom Table */ |
| 806 | 806 | |
| 807 | 807 | AM_RANGE(0xc00002, 0xc00003) AM_READWRITE(soundlatch_word_r, m68k_l1_w) |
| r2418 | r2419 | |
| 1735 | 1735 | { |
| 1736 | 1736 | pgm_basic_init(); |
| 1737 | 1737 | |
| 1738 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_r); | |
| 1739 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC04000, 0xC04001, 0, 0, pgm_asic3_reg_w); | |
| 1740 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_w); | |
| 1738 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_r, pgm_asic3_w); | |
| 1739 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC04000, 0xC04001, 0, 0, pgm_asic3_reg_w); | |
| 1741 | 1740 | } |
| 1742 | 1741 | |
| 1743 | static void drgwld2_common_init( | |
| 1742 | static void drgwld2_common_init(running_machine *machine) | |
| 1744 | 1743 | { |
| 1745 | 1744 | pgm_basic_init(); |
| 1746 | 1745 | pgm_dw2_decrypt(); |
| r2418 | r2419 | |
| 1750 | 1749 | select and after failing in the 2nd stage (probably there are other checks |
| 1751 | 1750 | out there). |
| 1752 | 1751 | */ |
| 1753 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80000, 0xd80003, 0, 0, dw2_d80000_r); | |
| 1752 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80000, 0xd80003, 0, 0, dw2_d80000_r); | |
| 1754 | 1753 | } |
| 1755 | 1754 | |
| 1756 | 1755 | static DRIVER_INIT( drgw2 ) |
| 1757 | 1756 | { /* incomplete? */ |
| 1758 | 1757 | UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); |
| 1759 | drgwld2_common_init(); | |
| 1758 | drgwld2_common_init(machine); | |
| 1760 | 1759 | /* These ROM patches are not hacks, the protection device |
| 1761 | 1760 | overlays the normal ROM code, this has been confirmed on a real PCB |
| 1762 | 1761 | although some addresses may be missing */ |
| r2418 | r2419 | |
| 1768 | 1767 | static DRIVER_INIT( drgw2c ) |
| 1769 | 1768 | { |
| 1770 | 1769 | UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); |
| 1771 | drgwld2_common_init(); | |
| 1770 | drgwld2_common_init(machine); | |
| 1772 | 1771 | /* These ROM patches are not hacks, the protection device |
| 1773 | 1772 | overlays the normal ROM code, this has been confirmed on a real PCB |
| 1774 | 1773 | although some addresses may be missing */ |
| r2418 | r2419 | |
| 1780 | 1779 | static DRIVER_INIT( drgw2j ) |
| 1781 | 1780 | { |
| 1782 | 1781 | UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); |
| 1783 | drgwld2_common_init(); | |
| 1782 | drgwld2_common_init(machine); | |
| 1784 | 1783 | /* These ROM patches are not hacks, the protection device |
| 1785 | 1784 | overlays the normal ROM code, this has been confirmed on a real PCB |
| 1786 | 1785 | although some addresses may be missing */ |
| r2418 | r2419 | |
| 1793 | 1792 | { |
| 1794 | 1793 | pgm_basic_init(); |
| 1795 | 1794 | |
| 1796 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16); | |
| 1797 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16); | |
| 1795 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16); | |
| 1798 | 1796 | |
| 1799 | 1797 | /* 0x4f0000 - ? is actually ram shared with the protection device, |
| 1800 | 1798 | the protection device provides the region code */ |
| 1801 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1799 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1802 | 1800 | |
| 1803 | 1801 | pgm_kov_decrypt(); |
| 1804 | 1802 | } |
| r2418 | r2419 | |
| 1825 | 1823 | pgm_basic_init(); |
| 1826 | 1824 | pgm_pstar_decrypt(); |
| 1827 | 1825 | |
| 1828 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4f0025, 0, 0, PSTARS_protram_r); | |
| 1829 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, PSTARS_r16); | |
| 1830 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500005, 0, 0, PSTARS_w16); | |
| 1826 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4f0025, 0, 0, PSTARS_protram_r); | |
| 1827 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, PSTARS_r16); | |
| 1828 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500005, 0, 0, PSTARS_w16); | |
| 1831 | 1829 | } |
| 1832 | 1830 | |
| 1833 | 1831 | |
| r2418 | r2419 | |
| 1836 | 1834 | { |
| 1837 | 1835 | pgm_basic_init(); |
| 1838 | 1836 | |
| 1839 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16); | |
| 1840 | // memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16); | |
| 1837 | // memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16); | |
| 1841 | 1838 | |
| 1842 | 1839 | /* 0x4f0000 - ? is actually ram shared with the protection device, |
| 1843 | 1840 | the protection device provides the region code */ |
| 1844 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1841 | // memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1845 | 1842 | |
| 1846 | 1843 | pgm_kovsh_decrypt(); |
| 1847 | 1844 | } |
| r2418 | r2419 | |
| 1850 | 1847 | { |
| 1851 | 1848 | pgm_basic_init(); |
| 1852 | 1849 | |
| 1853 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16); | |
| 1854 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16); | |
| 1850 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16); | |
| 1855 | 1851 | |
| 1856 | 1852 | /* 0x4f0000 - ? is actually ram shared with the protection device, |
| 1857 | 1853 | the protection device provides the region code */ |
| 1858 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1854 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 1859 | 1855 | |
| 1860 | 1856 | pgm_djlzz_decrypt(); |
| 1861 | 1857 | } |
| r2418 | r2419 | |
| 1864 | 1860 | { |
| 1865 | 1861 | pgm_basic_init(); |
| 1866 | 1862 | |
| 1867 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_r); | |
| 1868 | // memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_w); | |
| 1863 | // memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_r, dw3_prot_w); | |
| 1869 | 1864 | |
| 1870 | 1865 | pgm_dw3_decrypt(); |
| 1871 | 1866 | } |
| r2418 | r2419 | |
| 2113 | 2108 | mem16[0x108a42/2]=0x5202; |
| 2114 | 2109 | mem16[0x108a44/2]=0x0c02; |
| 2115 | 2110 | |
| 2116 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_r); | |
| 2117 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_w); | |
| 2111 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_r, killbld_prot_w); | |
| 2118 | 2112 | } |
| 2119 | 2113 | |
| 2120 | 2114 | /* ddp2 rubbish */ |
| r2418 | r2419 | |
| 2165 | 2159 | |
| 2166 | 2160 | ddp2_protram = auto_malloc(0x2000); |
| 2167 | 2161 | |
| 2168 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_r); | |
| 2169 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_w); | |
| 2162 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_r, ddp2_asic27_0xd10000_w); | |
| 2170 | 2163 | |
| 2171 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_r); | |
| 2172 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_w); | |
| 2164 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_r, ddp2_protram_w); | |
| 2173 | 2165 | } |
| 2174 | 2166 | |
| 2175 | 2167 | static DRIVER_INIT( puzzli2 ) |
| r2418 | r2419 | |
| 2182 | 2174 | |
| 2183 | 2175 | pgm_basic_init(); |
| 2184 | 2176 | |
| 2185 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16); | |
| 2186 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16); | |
| 2177 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16); | |
| 2187 | 2178 | |
| 2188 | 2179 | /* 0x4f0000 - ? is actually ram shared with the protection device, |
| 2189 | 2180 | the protection device provides the region code */ |
| 2190 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 2181 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r); | |
| 2191 | 2182 | |
| 2192 | 2183 | pgm_puzzli2_decrypt(); |
| 2193 | 2184 | |
| r2418 | r2419 | |
| 2318 | 2309 | |
| 2319 | 2310 | pgm_basic_init(); |
| 2320 | 2311 | |
| 2321 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xDCB400, 0xDCB403, 0, 0, olds_r16); | |
| 2322 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdcb400, 0xdcb403, 0, 0, olds_w16); | |
| 2312 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xdcb400, 0xdcb403, 0, 0, olds_r16, olds_w16); | |
| 2323 | 2313 | |
| 2324 | 2314 | } |
| 2325 | 2315 |
| r2418 | r2419 | |
|---|---|---|
| 523 | 523 | paletteram_2 = rom + 0x12800; |
| 524 | 524 | iqblock_fgvideoram = rom + 0x16800; |
| 525 | 525 | iqblock_bgvideoram = rom + 0x17000; |
| 526 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe26, 0xfe26, 0, 0, iqblock_prot_w); | |
| 526 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe26, 0xfe26, 0, 0, iqblock_prot_w); | |
| 527 | 527 | iqblock_video_type=1; |
| 528 | 528 | } |
| 529 | 529 | |
| r2418 | r2419 | |
| 545 | 545 | paletteram_2 = rom + 0x12800; |
| 546 | 546 | iqblock_fgvideoram = rom + 0x16800; |
| 547 | 547 | iqblock_bgvideoram = rom + 0x17000; |
| 548 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe39, 0xfe39, 0, 0, grndtour_prot_w); | |
| 548 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe39, 0xfe39, 0, 0, grndtour_prot_w); | |
| 549 | 549 | iqblock_video_type=0; |
| 550 | 550 | } |
| 551 | 551 |
| r2418 | r2419 | |
|---|---|---|
| 255 | 255 | AM_RANGE(0xd80000, 0xd80fff) AM_READ(SMH_RAM) /* palette */ |
| 256 | 256 | AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 257 | 257 | AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE(2) |
| 258 | AM_RANGE(0xe08000, 0xe0ffff) AM_R | |
| 258 | AM_RANGE(0xe08000, 0xe0ffff) AM_R | |
| 259 | 259 | AM_RANGE(0xe10000, 0xe10fff) AM_READ(SMH_RAM) /* ??? */ |
| 260 | 260 | ADDRESS_MAP_END |
| 261 | 261 | |
| r2418 | r2419 | |
| 278 | 278 | AM_RANGE(0x040000, 0x04ffff) AM_READ(SMH_RAM) /* local RAM */ |
| 279 | 279 | AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE(1) |
| 280 | 280 | AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE(2) |
| 281 | AM_RANGE(0xe08000, 0xe0ffff) AM_R | |
| 281 | AM_RANGE(0xe08000, 0xe0ffff) AM_R | |
| 282 | 282 | ADDRESS_MAP_END |
| 283 | 283 | |
| 284 | 284 | static ADDRESS_MAP_START( darius_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r2418 | r2419 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | static MACHINE_START( kinst ) |
| 161 | 161 | { |
| 162 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 163 | UINT8 *features = ide_get_features(ide); | |
| 164 | ||
| 165 | if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0) | |
| 166 | { | |
| 167 | /* kinst: tweak the model number so we pass the check */ | |
| 168 | features[27*2+0] = 0x54; | |
| 169 | features[27*2+1] = 0x53; | |
| 170 | features[28*2+0] = 0x31; | |
| 171 | features[28*2+1] = 0x39; | |
| 172 | features[29*2+0] = 0x30; | |
| 173 | features[29*2+1] = 0x35; | |
| 174 | features[30*2+0] = 0x47; | |
| 175 | features[30*2+1] = 0x41; | |
| 176 | features[31*2+0] = 0x20; | |
| 177 | features[31*2+1] = 0x20; | |
| 178 | } | |
| 179 | else | |
| 180 | { | |
| 181 | /* kinst2: tweak the model number so we pass the check */ | |
| 182 | features[10*2+0] = 0x30; | |
| 183 | features[10*2+1] = 0x30; | |
| 184 | features[11*2+0] = 0x54; | |
| 185 | features[11*2+1] = 0x53; | |
| 186 | features[12*2+0] = 0x31; | |
| 187 | features[12*2+1] = 0x39; | |
| 188 | features[13*2+0] = 0x30; | |
| 189 | features[13*2+1] = 0x35; | |
| 190 | features[14*2+0] = 0x47; | |
| 191 | features[14*2+1] = 0x41; | |
| 192 | } | |
| 193 | ||
| 162 | 194 | /* set the fastest DRC options */ |
| 163 | 195 | cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS); |
| 164 | 196 | |
| r2418 | r2419 | |
| 193 | 225 | static MACHINE_RESET( kinst ) |
| 194 | 226 | { |
| 195 | 227 | /* reset the IDE controller */ |
| 196 | | |
| 228 | | |
| 197 | 229 | |
| 198 | 230 | /* set a safe base location for video */ |
| 199 | 231 | video_base = &rambase[0x30000/4]; |
| r2418 | r2419 | |
| 252 | 284 | } |
| 253 | 285 | |
| 254 | 286 | |
| 255 | static void ide_interrupt(int state) | |
| 287 | static void ide_interrupt(const device_config *device, int state) | |
| 256 | 288 | { |
| 257 | cpunum_set_input_line( | |
| 289 | cpunum_set_input_line(device->machine, 0, 1, state); | |
| 258 | 290 | } |
| 259 | 291 | |
| 260 | 292 | |
| 261 | static const struct ide_interface ide_intf = | |
| 262 | { | |
| 263 | ide_interrupt | |
| 264 | }; | |
| 265 | 293 | |
| 266 | ||
| 267 | ||
| 268 | 294 | /************************************* |
| 269 | 295 | * |
| 270 | 296 | * IDE controller access |
| 271 | 297 | * |
| 272 | 298 | *************************************/ |
| 273 | 299 | |
| 274 | static READ32_HANDLER( i | |
| 300 | static READ32_DEVICE_HANDLER( ki | |
| 275 | 301 | { |
| 276 | return midway_ide_asic_r( | |
| 302 | return midway_ide_asic_r(dev | |
| 277 | 303 | } |
| 278 | 304 | |
| 279 | 305 | |
| 280 | static WRITE32_HANDLER( i | |
| 306 | static WRITE32_DEVICE_HANDLER( ki | |
| 281 | 307 | { |
| 282 | midway_ide_asic_w( | |
| 308 | midway_ide_asic_w(dev | |
| 283 | 309 | } |
| 284 | 310 | |
| 285 | 311 | |
| 286 | static READ32_HANDLER( i | |
| 312 | static READ32_DEVICE_HANDLER( ki | |
| 287 | 313 | { |
| 288 | return ide_controller32_ | |
| 314 | return ide_controller32_ | |
| 289 | 315 | } |
| 290 | 316 | |
| 291 | 317 | |
| 292 | static WRITE32_HANDLER( i | |
| 318 | static WRITE32_DEVICE_HANDLER( ki | |
| 293 | 319 | { |
| 294 | ide_controller32_ | |
| 320 | ide_controller32_ | |
| 295 | 321 | } |
| 296 | 322 | |
| 297 | 323 | |
| r2418 | r2419 | |
| 412 | 438 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_BASE(&rambase) |
| 413 | 439 | AM_RANGE(0x08000000, 0x087fffff) AM_RAM AM_BASE(&rambase2) |
| 414 | 440 | AM_RANGE(0x10000080, 0x100000ff) AM_READWRITE(kinst_control_r, kinst_control_w) AM_BASE(&kinst_control) |
| 415 | AM_RANGE(0x10000100, 0x1000013f) AM_READWRITE(ide_controller_r, ide_controller_w) | |
| 416 | AM_RANGE(0x10000170, 0x10000173) AM_READWRITE(ide_controller_extra_r, ide_controller_extra_w) | |
| 441 | AM_RANGE(0x10000100, 0x1000013f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", kinst_ide_r, kinst_ide_w) | |
| 442 | AM_RANGE(0x10000170, 0x10000173) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", kinst_ide_extra_r, kinst_ide_extra_w) | |
| 417 | 443 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&rombase) |
| 418 | 444 | ADDRESS_MAP_END |
| 419 | 445 | |
| r2418 | r2419 | |
| 660 | 686 | MDRV_MACHINE_START(kinst) |
| 661 | 687 | MDRV_MACHINE_RESET(kinst) |
| 662 | 688 | |
| 689 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 690 | ||
| 663 | 691 | /* video hardware */ |
| 664 | 692 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK ) |
| 665 | 693 | |
| r2418 | r2419 | |
| 868 | 896 | static DRIVER_INIT( kinst ) |
| 869 | 897 | { |
| 870 | 898 | static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 }; |
| 871 | UINT8 *features; | |
| 872 | 899 | |
| 873 | 900 | dcs_init(); |
| 874 | 901 | |
| 875 | 902 | /* set up the control register mapping */ |
| 876 | 903 | control_map = kinst_control_map; |
| 877 | 904 | |
| 878 | /* spin up the hard disk */ | |
| 879 | ide_controller_init(0, &ide_intf); | |
| 880 | ||
| 881 | /* tweak the model number so we pass the check */ | |
| 882 | features = ide_get_features(0); | |
| 883 | features[27*2+0] = 0x54; | |
| 884 | features[27*2+1] = 0x53; | |
| 885 | features[28*2+0] = 0x31; | |
| 886 | features[28*2+1] = 0x39; | |
| 887 | features[29*2+0] = 0x30; | |
| 888 | features[29*2+1] = 0x35; | |
| 889 | features[30*2+0] = 0x47; | |
| 890 | features[30*2+1] = 0x41; | |
| 891 | features[31*2+0] = 0x20; | |
| 892 | features[31*2+1] = 0x20; | |
| 893 | ||
| 894 | 905 | /* optimize one of the non-standard loops */ |
| 895 | kinst_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x8808f5bc, 0x8808f5bf, 0, 0, kinst_speedup_r); | |
| 906 | kinst_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8808f5bc, 0x8808f5bf, 0, 0, kinst_speedup_r); | |
| 896 | 907 | } |
| 897 | 908 | |
| 898 | 909 | |
| 899 | 910 | static DRIVER_INIT( kinst2 ) |
| 900 | 911 | { |
| 901 | 912 | static const UINT8 kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 }; |
| 902 | UINT8 *features; | |
| 903 | 913 | |
| 904 | 914 | // read: $80 on ki2 = $90 on ki |
| 905 | 915 | // read: $88 on ki2 = $a0 on ki |
| r2418 | r2419 | |
| 913 | 923 | /* set up the control register mapping */ |
| 914 | 924 | control_map = kinst2_control_map; |
| 915 | 925 | |
| 916 | /* spin up the hard disk */ | |
| 917 | ide_controller_init(0, &ide_intf); | |
| 918 | ||
| 919 | /* tweak the model number so we pass the check */ | |
| 920 | features = ide_get_features(0); | |
| 921 | features[10*2+0] = 0x30; | |
| 922 | features[10*2+1] = 0x30; | |
| 923 | features[11*2+0] = 0x54; | |
| 924 | features[11*2+1] = 0x53; | |
| 925 | features[12*2+0] = 0x31; | |
| 926 | features[12*2+1] = 0x39; | |
| 927 | features[13*2+0] = 0x30; | |
| 928 | features[13*2+1] = 0x35; | |
| 929 | features[14*2+0] = 0x47; | |
| 930 | features[14*2+1] = 0x41; | |
| 931 | ||
| 932 | 926 | /* optimize one of the non-standard loops */ |
| 933 | kinst_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x887ff544, 0x887ff547, 0, 0, kinst_speedup_r); | |
| 927 | kinst_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x887ff544, 0x887ff547, 0, 0, kinst_speedup_r); | |
| 934 | 928 | } |
| 935 | 929 | |
| 936 | 930 |
| r2418 | r2419 | |
|---|---|---|
| 345 | 345 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 346 | 346 | AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_BASE(&ram_base) |
| 347 | 347 | AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&rom_base) |
| 348 | AM_RANGE(0x40000000, 0x400007ff) AM_R | |
| 348 | AM_RANGE(0x40000000, 0x400007ff) AM_R | |
| 349 | 349 | AM_RANGE(0x41000000, 0x41000003) AM_READWRITE(sound_data_r, sound_data_w) |
| 350 | 350 | AM_RANGE(0x41000100, 0x41000103) AM_READ(interrupt_control_r) |
| 351 | 351 | AM_RANGE(0x41000100, 0x4100011f) AM_WRITE(interrupt_control_w) |
| r2418 | r2419 | |
| 359 | 359 | AM_RANGE(0x41000500, 0x41000503) AM_WRITE(eeprom_enable_w) |
| 360 | 360 | AM_RANGE(0x41000600, 0x41000603) AM_WRITE(beathead_finescroll_w) |
| 361 | 361 | AM_RANGE(0x41000700, 0x41000703) AM_WRITE(watchdog_reset32_w) |
| 362 | AM_RANGE(0x42000000, 0x4201ffff) AM_R | |
| 362 | AM_RANGE(0x42000000, 0x4201ffff) AM_R | |
| 363 | 363 | AM_RANGE(0x43000000, 0x43000007) AM_READWRITE(beathead_hsync_ram_r, beathead_hsync_ram_w) |
| 364 | 364 | AM_RANGE(0x8df80000, 0x8df80003) AM_READ(SMH_NOP) /* noisy x4 during scanline int */ |
| 365 | 365 | AM_RANGE(0x8f380000, 0x8f3fffff) AM_WRITE(beathead_vram_latch_w) |
| r2418 | r2419 | |
| 536 | 536 | atarijsa3_init_adpcm(REGION_SOUND1); |
| 537 | 537 | |
| 538 | 538 | /* prepare the speedups */ |
| 539 | speedup_data = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000ae8, 0x00000aeb, 0, 0, speedup_r); | |
| 540 | movie_speedup_data = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000804, 0x00000807, 0, 0, movie_speedup_r); | |
| 539 | speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000ae8, 0x00000aeb, 0, 0, speedup_r); | |
| 540 | movie_speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000804, 0x00000807, 0, 0, movie_speedup_r); | |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 |
| r2418 | r2419 | |
|---|---|---|
| 31 | 31 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 32 | 32 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 33 | 33 | AM_RANGE(0xe800, 0xe87f) AM_RAM /* common ram */ |
| 34 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 34 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 35 | 35 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 36 | 36 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 37 | 37 | AM_RANGE(0xf000, 0xffff) AM_RAM /* work ram */ |
| r2418 | r2419 | |
|---|---|---|
| 118 | 118 | AM_RANGE(0xa806, 0xa806) AM_READ(sound_status_r) |
| 119 | 119 | AM_RANGE(0xa807, 0xa807) AM_READ(SMH_NOP) /* watchdog ? */ |
| 120 | 120 | AM_RANGE(0xa808, 0xa808) AM_WRITE(bank_select_w) |
| 121 | AM_RANGE(0xb000, 0xb7ff) AM_READWRITE(SMH_RAM, ksayakyu_videoram_w) AM_BASE(&videoram) | |
| 122 | AM_RANGE(0xb800, 0xbfff) AM_READWRITE(SMH_RAM, SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 121 | AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(ksayakyu_videoram_w) AM_BASE(&videoram) | |
| 122 | AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 123 | 123 | ADDRESS_MAP_END |
| 124 | 124 | |
| 125 | 125 | static ADDRESS_MAP_START( soundcpu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 1101 | 1101 | |
| 1102 | 1102 | static DRIVER_INIT( slither ) |
| 1103 | 1103 | { |
| 1104 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_r); | |
| 1105 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_w); | |
| 1104 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_r, pia_1_w); | |
| 1106 | 1105 | } |
| 1107 | 1106 | |
| 1108 | 1107 |
| r2418 | r2419 | |
|---|---|---|
| 377 | 377 | AM_RANGE(0x182000, 0x183fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w) |
| 378 | 378 | AM_RANGE(0x190000, 0x191fff) AM_READWRITE(K056832_rom_word_r, SMH_ROM) // Passthrough to tile roms |
| 379 | 379 | AM_RANGE(0x1a0000, 0x1a1fff) AM_READ(K053250_0_rom_r) |
| 380 | AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM | |
| 380 | AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM | |
| 381 | 381 | |
| 382 | 382 | #if XE_DEBUG |
| 383 | 383 | AM_RANGE(0x0c0000, 0x0c003f) AM_READ(K056832_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 59 | 59 | AM_RANGE(0x0000, 0x0002) AM_RAM |
| 60 | AM_RANGE(0x0003, 0x0003) AM_RAM | |
| 60 | AM_RANGE(0x0003, 0x0003) AM_RAM | |
| 61 | 61 | AM_RANGE(0x0004, 0x0004) AM_RAM AM_BASE(&ironhors_interrupt_enable) |
| 62 | 62 | AM_RANGE(0x0005, 0x001f) AM_RAM |
| 63 | 63 | AM_RANGE(0x0020, 0x003f) AM_RAM AM_BASE(&ironhors_scroll) |
| r2418 | r2419 | |
| 73 | 73 | AM_RANGE(0x1800, 0x1800) AM_WRITENOP // ??? |
| 74 | 74 | AM_RANGE(0x1a00, 0x1a01) AM_WRITENOP // ??? |
| 75 | 75 | AM_RANGE(0x1c00, 0x1dff) AM_WRITENOP // ??? |
| 76 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_WRITE(ironhors_colorram_w) AM_BASE(&colorram) | |
| 77 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_WRITE(ironhors_videoram_w) AM_BASE(&videoram) | |
| 76 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(ironhors_colorram_w) AM_BASE(&colorram) | |
| 77 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(ironhors_videoram_w) AM_BASE(&videoram) | |
| 78 | 78 | AM_RANGE(0x2800, 0x2fff) AM_RAM |
| 79 | 79 | AM_RANGE(0x3000, 0x30ff) AM_RAM AM_BASE(&spriteram_2) |
| 80 | 80 | AM_RANGE(0x3100, 0x37ff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 139 | 139 | AM_RANGE(0xff1e80, 0xff1eff) AM_WRITE(skullxbo_xscroll_w) |
| 140 | 140 | AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE(atarigen_scanline_int_ack_w) |
| 141 | 141 | AM_RANGE(0xff1f80, 0xff1fff) AM_WRITE(watchdog_reset16_w) |
| 142 | AM_RANGE(0xff2000, 0xff2fff) AM_R | |
| 142 | AM_RANGE(0xff2000, 0xff2fff) AM_R | |
| 143 | 143 | AM_RANGE(0xff4000, 0xff47ff) AM_WRITE(skullxbo_yscroll_w) AM_BASE(&atarigen_yscroll) |
| 144 | 144 | AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w) |
| 145 | 145 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| r2418 | r2419 | |
| 147 | 147 | AM_RANGE(0xff5800, 0xff5801) AM_READ(input_port_0_word_r) |
| 148 | 148 | AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r) |
| 149 | 149 | AM_RANGE(0xff6000, 0xff6fff) AM_READ(atarigen_eeprom_r) |
| 150 | AM_RANGE(0xff8000, 0xff9fff) AM_READWRITE(SMH_RAM, atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 151 | AM_RANGE(0xffa000, 0xffbfff) AM_READWRITE(SMH_RAM, atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 152 | AM_RANGE(0xffc000, 0xffcf7f) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 153 | AM_RANGE(0xffcf80, 0xffcfff) AM_READWRITE(SMH_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 154 | AM_RANGE(0xffd000, 0xffdfff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 150 | AM_RANGE(0xff8000, 0xff9fff) AM_RAM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 151 | AM_RANGE(0xffa000, 0xffbfff) AM_RAM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 152 | AM_RANGE(0xffc000, 0xffcf7f) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 153 | AM_RANGE(0xffcf80, 0xffcfff) AM_RAM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 154 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 155 | 155 | AM_RANGE(0xffe000, 0xffffff) AM_RAM |
| 156 | 156 | ADDRESS_MAP_END |
| 157 | 157 |
| r2418 | r2419 | |
|---|---|---|
| 2366 | 2366 | AM_RANGE(0x06000000, 0x067fffff) AM_ROM AM_READWRITE( cps3_flash1_r, cps3_flash1_w ) /* Flash ROMs simm 1 */ |
| 2367 | 2367 | AM_RANGE(0x06800000, 0x06ffffff) AM_ROM AM_READWRITE( cps3_flash2_r, cps3_flash2_w ) /* Flash ROMs simm 2 */ |
| 2368 | 2368 | |
| 2369 | AM_RANGE(0xc0000000, 0xc00003ff) AM_RAM | |
| 2369 | AM_RANGE(0xc0000000, 0xc00003ff) AM_RAM | |
| 2370 | 2370 | ADDRESS_MAP_END |
| 2371 | 2371 | |
| 2372 | 2372 | |
| r2418 | r2419 | |
| 3045 | 3045 | |
| 3046 | 3046 | //printf("speedup %08x %08x\n",cps3_speedup_ram_address,cps3_speedup_code_address); |
| 3047 | 3047 | |
| 3048 | if (cps3_speedup_code_address!=0) memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, cps3_speedup_ram_address+0x02000000, cps3_speedup_ram_address+0x02000003, 0, 0, cps3_speedup_r ); | |
| 3048 | if (cps3_speedup_code_address!=0) memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, cps3_speedup_ram_address+0x02000000, cps3_speedup_ram_address+0x02000003, 0, 0, cps3_speedup_r ); | |
| 3049 | 3049 | } |
| 3050 | 3050 | |
| 3051 | 3051 |
| r2418 | r2419 | |
|---|---|---|
| 1441 | 1441 | |
| 1442 | 1442 | static DRIVER_INIT( speedfrk ) |
| 1443 | 1443 | { |
| 1444 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, speedfrk_wheel_r); | |
| 1445 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x06, 0, 0, speedfrk_gear_r); | |
| 1444 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, speedfrk_wheel_r); | |
| 1445 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x06, 0, 0, speedfrk_gear_r); | |
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | |
| 1449 | 1449 | static DRIVER_INIT( sundance ) |
| 1450 | 1450 | { |
| 1451 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x0f, 0, 0, sundance_inputs_r); | |
| 1451 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x0f, 0, 0, sundance_inputs_r); | |
| 1452 | 1452 | } |
| 1453 | 1453 | |
| 1454 | 1454 | |
| 1455 | 1455 | static DRIVER_INIT( tailg ) |
| 1456 | 1456 | { |
| 1457 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w); | |
| 1457 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w); | |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | 1460 | |
| 1461 | 1461 | static DRIVER_INIT( boxingb ) |
| 1462 | 1462 | { |
| 1463 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, boxingb_dial_r); | |
| 1464 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w); | |
| 1463 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, boxingb_dial_r); | |
| 1464 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w); | |
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | 1467 | |
| 1468 | 1468 | static DRIVER_INIT( qb3 ) |
| 1469 | 1469 | { |
| 1470 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, qb3_frame_r); | |
| 1471 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, qb3_ram_bank_w); | |
| 1470 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, qb3_frame_r); | |
| 1471 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, qb3_ram_bank_w); | |
| 1472 | 1472 | |
| 1473 | 1473 | memory_configure_bank(1, 0, 4, rambase, 0x100*2); |
| 1474 | 1474 | } |
| r2418 | r2419 | |
|---|---|---|
| 288 | 288 | |
| 289 | 289 | |
| 290 | 290 | /**************** Machine stuff ******************/ |
| 291 | #define HD64x180 0 /* Define if CPU support is available */ | |
| 292 | #define V25 0 | |
| 291 | #define USE_HD64x180 0 /* Define if CPU support is available */ | |
| 292 | #define USE_V25 0 | |
| 293 | 293 | |
| 294 | 294 | #define CPU_2_NONE 0x00 |
| 295 | 295 | #define CPU_2_Z80 0x5a |
| r2418 | r2419 | |
| 381 | 381 | void fixeight_okisnd_w(running_machine *machine, int data); |
| 382 | 382 | void batsugun_okisnd_w(running_machine *machine, int data); |
| 383 | 383 | |
| 384 | MACHINE_RESET(batsugun); | |
| 385 | #if USE_V25 | |
| 386 | static READ16_HANDLER( batsugun_share_r ); | |
| 387 | static READ16_HANDLER( batsugun_share2_r ); | |
| 388 | static WRITE16_HANDLER( batsugun_share_w ); | |
| 389 | static WRITE16_HANDLER( batsugun_share2_w ); | |
| 390 | #endif | |
| 384 | 391 | |
| 385 | 392 | /*************************************************************************** |
| 386 | 393 | Initialisation handlers |
| r2418 | r2419 | |
| 413 | 420 | |
| 414 | 421 | static MACHINE_RESET( dogyuun ) |
| 415 | 422 | { |
| 416 | MACHINE_RESET_CALL( | |
| 423 | MACHINE_RESET_CALL(b | |
| 417 | 424 | mcu_data = 0xffaa; |
| 418 | 425 | } |
| 419 | 426 | |
| 420 | 427 | static MACHINE_RESET( vfive ) |
| 421 | 428 | { |
| 422 | MACHINE_RESET_CALL( | |
| 429 | MACHINE_RESET_CALL(b | |
| 423 | 430 | mcu_data = 0xffaa; |
| 424 | 431 | } |
| 425 | 432 | |
| r2418 | r2419 | |
| 457 | 464 | |
| 458 | 465 | static DRIVER_INIT( fixeight ) |
| 459 | 466 | { |
| 460 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 467 | #if USE_V25 | |
| 468 | ||
| 469 | #else | |
| 470 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 461 | 471 | memory_set_bankptr(2, fixeight_sec_cpu_mem); |
| 472 | #endif | |
| 462 | 473 | |
| 463 | 474 | toaplan2_sub_cpu = CPU_2_V25; |
| 464 | 475 | } |
| r2418 | r2419 | |
| 663 | 674 | } |
| 664 | 675 | } |
| 665 | 676 | |
| 677 | WRITE16_HANDLER( toaplan2_v25_coin_word_w ) | |
| 678 | { | |
| 679 | // logerror("toaplan2_v25_coin_word_w %04x\n",data); | |
| 680 | ||
| 681 | if (ACCESSING_BITS_0_7) | |
| 682 | { | |
| 683 | toaplan2_coin_w(machine, offset, data & 0x0f); | |
| 684 | ||
| 685 | #if USE_V25 | |
| 686 | /* only the ram-based V25 based games access the following bits */ | |
| 687 | //cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0020) ? CLEAR_LINE : ASSERT_LINE ); | |
| 688 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE); | |
| 689 | #endif | |
| 690 | ||
| 691 | } | |
| 692 | if (ACCESSING_BITS_8_15 && (data & 0xff00) ) | |
| 693 | { | |
| 694 | logerror("Writing unknown upper MSB command (%04x) to coin control\n",data & 0xff00); | |
| 695 | } | |
| 696 | } | |
| 697 | ||
| 698 | ||
| 666 | 699 | static WRITE16_HANDLER( shippumd_coin_word_w ) |
| 667 | 700 | { |
| 668 | 701 | if (ACCESSING_BITS_0_7) |
| r2418 | r2419 | |
| 956 | 989 | /* game keeping service mode. It writes/reads the settings to/from */ |
| 957 | 990 | /* these shared RAM locations. The secondary CPU reads/writes them */ |
| 958 | 991 | /* from/to nvram to store the settings (a 93C45 EEPROM) */ |
| 959 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 992 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 960 | 993 | memory_set_bankptr(2, fixeight_sec_cpu_mem); |
| 961 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, SMH_NOP); /* Dip Switch A - Wrong !!! */ | |
| 962 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, SMH_NOP); /* Dip Switch B - Wrong !!! */ | |
| 963 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, SMH_NOP); /* Territory Jumper block - Wrong !!! */ | |
| 994 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, SMH_NOP); /* Dip Switch A - Wrong !!! */ | |
| 995 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, SMH_NOP); /* Dip Switch B - Wrong !!! */ | |
| 996 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, SMH_NOP); /* Territory Jumper block - Wrong !!! */ | |
| 964 | 997 | |
| 965 | 998 | mcu_data = data; |
| 966 | 999 | } |
| r2418 | r2419 | |
| 1353 | 1386 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 1354 | 1387 | AM_RANGE(0x020000, 0x03ffff) AM_ROM /* extra for Whoopee */ |
| 1355 | 1388 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1356 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1389 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1357 | 1390 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1358 | 1391 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1359 | 1392 | AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| r2418 | r2419 | |
| 1373 | 1406 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1374 | 1407 | AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r) /* Paddle 2 */ |
| 1375 | 1408 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 1376 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1409 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1377 | 1410 | AM_RANGE(0x100000, 0x100001) AM_READ(ghox_p1_h_analog_r) /* Paddle 1 */ |
| 1378 | 1411 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1379 | 1412 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r2418 | r2419 | |
| 1397 | 1430 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("IN1") |
| 1398 | 1431 | AM_RANGE(0x200014, 0x200015) AM_READ_PORT("IN2") |
| 1399 | 1432 | AM_RANGE(0x200018, 0x200019) AM_READ_PORT("SYS") |
| 1400 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) | |
| 1401 | #if V25 | |
| 1402 | AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1403 | AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1433 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) | |
| 1434 | #if USE_V25 | |
| 1435 | // AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1436 | // AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1437 | AM_RANGE(0x210000, 0x21efff) AM_RAM AM_READWRITE( batsugun_share2_r, batsugun_share2_w ) | |
| 1438 | AM_RANGE(0x21f000, 0x21ffff) AM_RAM AM_READWRITE( batsugun_share_r, batsugun_share_w ) | |
| 1404 | 1439 | #else |
| 1405 | 1440 | AM_RANGE(0x21e000, 0x21efff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) |
| 1406 | 1441 | AM_RANGE(0x21f000, 0x21f001) AM_READWRITE(toaplan2_snd_cpu_r, dogyuun_snd_cpu_w) /* V25+ status/command port */ |
| r2418 | r2419 | |
| 1414 | 1449 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1415 | 1450 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1416 | 1451 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1417 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1452 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1418 | 1453 | /***** The following loctions in 0x50000x are for video controller 2 ******/ |
| 1419 | 1454 | AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w) /* VideoRAM selector/offset */ |
| 1420 | 1455 | AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r2418 | r2419 | |
| 1440 | 1475 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1441 | 1476 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1442 | 1477 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1443 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1478 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1444 | 1479 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) /* test bit 8 */ |
| 1445 | 1480 | ADDRESS_MAP_END |
| 1446 | 1481 | |
| r2418 | r2419 | |
| 1465 | 1500 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1466 | 1501 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1467 | 1502 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1468 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1503 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1469 | 1504 | ADDRESS_MAP_END |
| 1470 | 1505 | |
| 1471 | 1506 | |
| r2418 | r2419 | |
| 1476 | 1511 | AM_RANGE(0x200004, 0x200007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) |
| 1477 | 1512 | AM_RANGE(0x200008, 0x200009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1478 | 1513 | AM_RANGE(0x20000c, 0x20000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1479 | AM_RANGE(0x300000, 0x300fff) AM_R | |
| 1514 | AM_RANGE(0x300000, 0x300fff) AM_R | |
| 1480 | 1515 | AM_RANGE(0x400000, 0x401fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1481 | 1516 | AM_RANGE(0x402000, 0x4021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1482 | 1517 | AM_RANGE(0x402200, 0x402fff) AM_RAM |
| r2418 | r2419 | |
| 1500 | 1535 | static ADDRESS_MAP_START( pipibibs_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1501 | 1536 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1502 | 1537 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1503 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1538 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1504 | 1539 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1505 | 1540 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) |
| 1506 | 1541 | AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| r2418 | r2419 | |
| 1521 | 1556 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1522 | 1557 | AM_RANGE(0x083000, 0x0837ff) AM_READWRITE(pipibibi_spriteram16_r, pipibibi_spriteram16_w) /* SpriteRAM */ |
| 1523 | 1558 | AM_RANGE(0x083800, 0x087fff) AM_RAM /* SpriteRAM (unused) */ |
| 1524 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1559 | AM_RANGE(0x0c0000, 0x0c0fff) AM_R | |
| 1525 | 1560 | AM_RANGE(0x120000, 0x120fff) AM_RAM /* Copy of SpriteRAM ? */ |
| 1526 | 1561 | // AM_RANGE(0x13f000, 0x13f001) AM_WRITENOP /* ??? */ |
| 1527 | 1562 | AM_RANGE(0x180000, 0x182fff) AM_READWRITE(pipibibi_videoram16_r, pipibibi_videoram16_w) /* TileRAM */ |
| r2418 | r2419 | |
| 1537 | 1572 | AM_RANGE(0x19c034, 0x19c035) AM_READ_PORT("IN2") |
| 1538 | 1573 | ADDRESS_MAP_END |
| 1539 | 1574 | |
| 1575 | #if USE_V25 | |
| 1576 | // guess, could be wrong | |
| 1577 | WRITE16_HANDLER( fixeight_subcpu_ctrl ) | |
| 1578 | { | |
| 1579 | /* 0x18 used */ | |
| 1580 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE); | |
| 1581 | } | |
| 1582 | #endif | |
| 1540 | 1583 | |
| 1584 | /* this one is rather different to the other v25 based ones, shared ram is moved for example */ | |
| 1541 | 1585 | static ADDRESS_MAP_START( fixeight_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1542 | 1586 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1543 | 1587 | AM_RANGE(0x100000, 0x103fff) AM_RAM |
| r2418 | r2419 | |
| 1546 | 1590 | AM_RANGE(0x200008, 0x200009) AM_READ_PORT("IN3") |
| 1547 | 1591 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("SYS") |
| 1548 | 1592 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) /* Coin count/lock */ |
| 1593 | #if USE_V25 | |
| 1594 | // AM_RANGE(0x28e000, 0x28fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $28f000 status port */ | |
| 1595 | // AM_RANGE(0x28fc00, 0x28ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1596 | AM_RANGE(0x280000, 0x28efff) AM_RAM AM_READWRITE( batsugun_share2_r, batsugun_share2_w ) | |
| 1597 | AM_RANGE(0x28f000, 0x28ffff) AM_RAM AM_READWRITE( batsugun_share_r, batsugun_share_w ) | |
| 1598 | AM_RANGE(0x700000, 0x700001) AM_WRITE(fixeight_subcpu_ctrl) // guess!!! | |
| 1599 | #else | |
| 1549 | 1600 | AM_RANGE(0x280000, 0x28dfff) AM_RAM /* part of shared ram ? */ |
| 1550 | #if V25 | |
| 1551 | AM_RANGE(0x28e000, 0x28fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $28f000 status port */ | |
| 1552 | AM_RANGE(0x28fc00, 0x28ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1553 | #else | |
| 1554 | 1601 | AM_RANGE(0x28e000, 0x28efff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) |
| 1555 | 1602 | AM_RANGE(0x28f000, 0x28f001) AM_READWRITE(fixeight_sec_cpu_r, fixeight_sec_cpu_w) AM_BASE(&fixeight_sec_cpu_mem) /* V25+ Command/Status port */ |
| 1556 | 1603 | // AM_RANGE(0x28f002, 0x28f003) AM_READ(SMH_RAM) /* part of shared ram */ |
| r2418 | r2419 | |
| 1564 | 1611 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1565 | 1612 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1566 | 1613 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1567 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1614 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1568 | 1615 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1569 | 1616 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1570 | 1617 | AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| r2418 | r2419 | |
| 1588 | 1635 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1589 | 1636 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1590 | 1637 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1591 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1638 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1592 | 1639 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1593 | 1640 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1594 | 1641 | AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| r2418 | r2419 | |
| 1604 | 1651 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("IN1") |
| 1605 | 1652 | AM_RANGE(0x200014, 0x200015) AM_READ_PORT("IN2") |
| 1606 | 1653 | AM_RANGE(0x200018, 0x200019) AM_READ_PORT("SYS") |
| 1607 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) /* Coin count/lock */ | |
| 1608 | #if V25 | |
| 1609 | AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1610 | AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1654 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) /* Coin count/lock */ | |
| 1655 | #if USE_V25 | |
| 1656 | // AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1657 | // AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1658 | AM_RANGE(0x210000, 0x21efff) AM_RAM AM_READWRITE( batsugun_share2_r, batsugun_share2_w ) | |
| 1659 | AM_RANGE(0x21f000, 0x21ffff) AM_RAM AM_READWRITE( batsugun_share_r, batsugun_share_w ) | |
| 1611 | 1660 | #else |
| 1612 | 1661 | AM_RANGE(0x21e000, 0x21efff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) |
| 1613 | 1662 | AM_RANGE(0x21f000, 0x21f001) AM_READWRITE(toaplan2_snd_cpu_r, vfive_snd_cpu_w) /* V25+ Command/Status port */ |
| r2418 | r2419 | |
| 1620 | 1669 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1621 | 1670 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1622 | 1671 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1623 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1672 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1624 | 1673 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) |
| 1625 | 1674 | ADDRESS_MAP_END |
| 1626 | 1675 | |
| 1627 | 1676 | |
| 1677 | #if USE_V25 | |
| 1678 | static UINT8* batsugun_share; | |
| 1679 | static UINT8* batsugun_share2; | |
| 1680 | ||
| 1681 | static READ16_HANDLER( batsugun_share_r ) | |
| 1682 | { | |
| 1683 | return batsugun_share[offset] | batsugun_share[offset]<<8; | |
| 1684 | ||
| 1685 | } | |
| 1686 | ||
| 1687 | static WRITE16_HANDLER( batsugun_share_w ) | |
| 1688 | { | |
| 1689 | /* | |
| 1690 | if (ACCESSING_BITS_8_15) | |
| 1691 | { | |
| 1692 | batsugun_share[offset] = data >> 8; | |
| 1693 | } | |
| 1694 | */ | |
| 1695 | if (ACCESSING_BITS_0_7) | |
| 1696 | { | |
| 1697 | batsugun_share[offset] = data; | |
| 1698 | } | |
| 1699 | } | |
| 1700 | ||
| 1701 | ||
| 1702 | static READ16_HANDLER( batsugun_share2_r ) | |
| 1703 | { | |
| 1704 | return batsugun_share2[offset] | batsugun_share2[offset]<<8; | |
| 1705 | } | |
| 1706 | ||
| 1707 | static WRITE16_HANDLER( batsugun_share2_w ) | |
| 1708 | { | |
| 1709 | /* | |
| 1710 | if (ACCESSING_BITS_8_15) | |
| 1711 | { | |
| 1712 | batsugun_share2[offset] = data >> 8; | |
| 1713 | } | |
| 1714 | */ | |
| 1715 | ||
| 1716 | if (ACCESSING_BITS_0_7) | |
| 1717 | { | |
| 1718 | batsugun_share2[offset] = data; | |
| 1719 | } | |
| 1720 | } | |
| 1721 | #endif | |
| 1722 | ||
| 1628 | 1723 | static ADDRESS_MAP_START( batsugun_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1629 | 1724 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1630 | 1725 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 1631 | 1726 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("IN1") |
| 1632 | 1727 | AM_RANGE(0x200014, 0x200015) AM_READ_PORT("IN2") |
| 1633 | 1728 | AM_RANGE(0x200018, 0x200019) AM_READ_PORT("SYS") |
| 1634 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) /* Coin count/lock */ | |
| 1729 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) /* Coin count/lock + v25 reset/hold control lines? */ | |
| 1730 | #if USE_V25 | |
| 1731 | // AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1732 | // AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1733 | AM_RANGE(0x210000, 0x21efff) AM_RAM AM_READWRITE( batsugun_share2_r, batsugun_share2_w ) | |
| 1734 | AM_RANGE(0x21f000, 0x21ffff) AM_RAM AM_READWRITE( batsugun_share_r, batsugun_share_w ) | |
| 1735 | #else | |
| 1635 | 1736 | AM_RANGE(0x210000, 0x21bbff) AM_RAM |
| 1636 | #if V25 | |
| 1637 | AM_RANGE(0x21e000, 0x21fbff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) /* $21f000 status port */ | |
| 1638 | AM_RANGE(0x21fc00, 0x21ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ | |
| 1639 | #else | |
| 1640 | 1737 | AM_RANGE(0x21e000, 0x21efff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) |
| 1641 | 1738 | AM_RANGE(0x21f000, 0x21f001) AM_READWRITE(toaplan2_snd_cpu_r, batsugun_snd_cpu_w) /* V25+ Command/Status port */ |
| 1642 | 1739 | AM_RANGE(0x21f004, 0x21f005) AM_READ_PORT("DSWA") |
| r2418 | r2419 | |
| 1649 | 1746 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1650 | 1747 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1651 | 1748 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1652 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1749 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1653 | 1750 | /***** The following in 0x50000x are for video controller 2 ******/ |
| 1654 | 1751 | AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w) /* VideoRAM selector/offset */ |
| 1655 | 1752 | AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r2418 | r2419 | |
| 1666 | 1763 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1667 | 1764 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1668 | 1765 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1669 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1766 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1670 | 1767 | AM_RANGE(0x500000, 0x500001) AM_WRITE(YM2151_register_port_0_lsb_w) |
| 1671 | 1768 | AM_RANGE(0x500002, 0x500003) AM_READWRITE(YM2151_status_port_0_lsb_r, YM2151_data_port_0_lsb_w) |
| 1672 | 1769 | AM_RANGE(0x600000, 0x600001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| r2418 | r2419 | |
| 1699 | 1796 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1700 | 1797 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1701 | 1798 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1702 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1799 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1703 | 1800 | AM_RANGE(0x401000, 0x4017ff) AM_RAM /* Unused PaletteRAM */ |
| 1704 | 1801 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1705 | 1802 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| r2418 | r2419 | |
| 1726 | 1823 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1727 | 1824 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1728 | 1825 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1729 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1826 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1730 | 1827 | AM_RANGE(0x401000, 0x4017ff) AM_RAM /* Unused PaletteRAM */ |
| 1731 | 1828 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1732 | 1829 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| r2418 | r2419 | |
| 1752 | 1849 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1753 | 1850 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1754 | 1851 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1755 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1852 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 1756 | 1853 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1757 | 1854 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1758 | 1855 | AM_RANGE(0x502200, 0x502fff) AM_RAM |
| r2418 | r2419 | |
| 1765 | 1862 | static ADDRESS_MAP_START( batrider_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1766 | 1863 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1767 | 1864 | AM_RANGE(0x200000, 0x201fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) /* Text VideoRAM */ |
| 1768 | AM_RANGE(0x202000, 0x202fff) AM_R | |
| 1865 | AM_RANGE(0x202000, 0x202fff) AM_R | |
| 1769 | 1866 | AM_RANGE(0x203000, 0x2031ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1770 | 1867 | AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| 1771 | 1868 | AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w) /* Main RAM actually */ |
| r2418 | r2419 | |
| 1796 | 1893 | static ADDRESS_MAP_START( bbakraid_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1797 | 1894 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1798 | 1895 | AM_RANGE(0x200000, 0x201fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) /* Text VideoRAM */ |
| 1799 | AM_RANGE(0x202000, 0x202fff) AM_R | |
| 1896 | AM_RANGE(0x202000, 0x202fff) AM_R | |
| 1800 | 1897 | AM_RANGE(0x203000, 0x2031ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1801 | 1898 | AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| 1802 | 1899 | AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w) /* Main RAM actually */ |
| r2418 | r2419 | |
| 1908 | 2005 | |
| 1909 | 2006 | |
| 1910 | 2007 | |
| 1911 | #if HD64x180 | |
| 2008 | #if USE_HD64x180 | |
| 1912 | 2009 | static ADDRESS_MAP_START( hd647180_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1913 | 2010 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1914 | 2011 | AM_RANGE(0xfe00, 0xffff) AM_RAM /* Internal 512 bytes of RAM */ |
| r2418 | r2419 | |
| 1916 | 2013 | #endif |
| 1917 | 2014 | |
| 1918 | 2015 | |
| 1919 | #if V25 | |
| 2016 | #if USE_V25 | |
| 2017 | ||
| 2018 | /* this seems to be the map for the ROM based game, Knuckle Bash */ | |
| 1920 | 2019 | static ADDRESS_MAP_START( V25_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1921 | 2020 | AM_RANGE(0x00000, 0x03fff) AM_ROM |
| 1922 | 2021 | // AM_RANGE(0x00000, 0x007ff) AM_RAM /* External shared RAM (Banked) */ |
| 1923 | 2022 | AM_RANGE(0x04000, 0x04000) AM_READWRITE(YM2151_status_port_0_r, YM2151_register_port_0_w) |
| 1924 | 2023 | AM_RANGE(0x04001, 0x04001) AM_WRITE(YM2151_data_port_0_w) |
| 1925 | 2024 | AM_RANGE(0x04002, 0x04002) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) |
| 1926 | ||
| 2025 | // AM_RANGE(0x04004, 0x04004) AM_WRITE(oki_bankswitch_w) | |
| 1927 | 2026 | AM_RANGE(0x04008, 0x04008) AM_READ_PORT("IN1") |
| 1928 | 2027 | AM_RANGE(0x0400a, 0x0400a) AM_READ_PORT("IN2") |
| 1929 | 2028 | AM_RANGE(0x0400c, 0x0400c) AM_READ_PORT("SYS") |
| 1930 | 2029 | AM_RANGE(0x0400e, 0x0400e) AM_WRITE(toaplan2_coin_w) |
| 1931 | 2030 | AM_RANGE(0x0fe00, 0x0ffff) AM_RAM /* Internal 512 bytes of RAM */ |
| 1932 | ||
| 2031 | // AM_RANGE(0x80000, 0x87fff) AM_RAM AM_BASE(&V25_sharedram) /* External shared RAM (ROM for KBASH) */ | |
| 1933 | 2032 | ADDRESS_MAP_END |
| 1934 | 2033 | |
| 1935 | 2034 | |
| r2418 | r2419 | |
| 1938 | 2037 | AM_RANGE(0x0061, 0x0061) AM_READ_PORT("DSWA") /* Directly mapped I/O ports */ |
| 1939 | 2038 | AM_RANGE(0x0062, 0x0062) AM_READ_PORT("JMPR") /* Directly mapped I/O ports */ |
| 1940 | 2039 | ADDRESS_MAP_END |
| 2040 | ||
| 2041 | ||
| 2042 | /* the others upload the V25 code into shared RAM and have this map (incomplete) | |
| 2043 | ||
| 2044 | Batsugun code is not encrypted, but requires additional v25 features to be emulated. | |
| 2045 | ||
| 2046 | Others are encrypted | |
| 2047 | */ | |
| 2048 | ||
| 2049 | ||
| 2050 | ||
| 2051 | ||
| 2052 | static ADDRESS_MAP_START( V25_rambased_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 2053 | AM_RANGE(0x00000, 0x00000) AM_WRITE( YM2151_register_port_0_w ) | |
| 2054 | AM_RANGE(0x00001, 0x00001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 2055 | ||
| 2056 | AM_RANGE(0x07800, 0x07fff) AM_RAM AM_SHARE(6) | |
| 2057 | ||
| 2058 | AM_RANGE(0x40000, 0x477ff) AM_RAM AM_SHARE(7) | |
| 2059 | ||
| 2060 | AM_RANGE(0x87800, 0x87fff) AM_RAM AM_SHARE(6) | |
| 2061 | ||
| 2062 | AM_RANGE(0xa0000, 0xa77ff) AM_RAM AM_SHARE(7) AM_BASE(&batsugun_share2) | |
| 2063 | AM_RANGE(0xa7800, 0xa7fff) AM_RAM AM_SHARE(6) | |
| 2064 | ||
| 2065 | AM_RANGE(0xff800, 0xfffff) AM_RAM AM_SHARE(6) AM_BASE(&batsugun_share) | |
| 2066 | ADDRESS_MAP_END | |
| 2067 | ||
| 2068 | ||
| 2069 | ||
| 2070 | ||
| 2071 | ||
| 2072 | ||
| 1941 | 2073 | #endif |
| 1942 | 2074 | |
| 1943 | 2075 | |
| r2418 | r2419 | |
| 3299 | 3431 | MDRV_CPU_PROGRAM_MAP(tekipaki_68k_mem, 0) |
| 3300 | 3432 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3301 | 3433 | |
| 3302 | #if HD64x180 | |
| 3434 | #if USE_HD64x180 | |
| 3303 | 3435 | MDRV_CPU_ADD(Z180, 10000000) /* HD647180 CPU actually */ |
| 3304 | 3436 | MDRV_CPU_PROGRAM_MAP(hd647180_mem, 0) |
| 3305 | 3437 | #endif |
| r2418 | r2419 | |
| 3338 | 3470 | MDRV_CPU_PROGRAM_MAP(ghox_68k_mem, 0) |
| 3339 | 3471 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3340 | 3472 | |
| 3341 | #if HD64x180 | |
| 3473 | #if USE_HD64x180 | |
| 3342 | 3474 | MDRV_CPU_ADD(Z180, XTAL_10MHz) /* HD647180 CPU actually */ |
| 3343 | 3475 | MDRV_CPU_PROGRAM_MAP(hd647180_mem, 0) |
| 3344 | 3476 | #endif |
| r2418 | r2419 | |
| 3376 | 3508 | MDRV_CPU_PROGRAM_MAP(dogyuun_68k_mem, 0) |
| 3377 | 3509 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3378 | 3510 | |
| 3379 | #if V25 | |
| 3380 | MDRV_CPU_ADD(Z180, XTAL_25MHz/2) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3381 | MDRV_CPU_PROGRAM_MAP(V25_mem, 0) | |
| 3382 | MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3511 | #if USE_V25 | |
| 3512 | MDRV_CPU_ADD(V25, XTAL_25MHz/2) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3513 | MDRV_CPU_PROGRAM_MAP(V25_rambased_mem, 0) | |
| 3514 | //MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3383 | 3515 | #endif |
| 3384 | 3516 | |
| 3385 | 3517 | MDRV_MACHINE_RESET(dogyuun) |
| r2418 | r2419 | |
| 3419 | 3551 | MDRV_CPU_PROGRAM_MAP(kbash_68k_mem, 0) |
| 3420 | 3552 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3421 | 3553 | |
| 3422 | #if V25 | |
| 3423 | MDRV_CPU_ADD(Z180, 16000000) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3554 | /* ROM based v25 */ | |
| 3555 | #if USE_V25 | |
| 3556 | MDRV_CPU_ADD(V25, 16000000) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3424 | 3557 | MDRV_CPU_PROGRAM_MAP(V25_mem, 0) |
| 3425 | 3558 | MDRV_CPU_IO_MAP(V25_port, 0) |
| 3426 | 3559 | #endif |
| r2418 | r2419 | |
| 3654 | 3787 | MDRV_CPU_PROGRAM_MAP(fixeight_68k_mem, 0) |
| 3655 | 3788 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3656 | 3789 | |
| 3657 | #if V25 | |
| 3658 | MDRV_CPU_ADD(Z180, XTAL_16MHz) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3659 | MDRV_CPU_PROGRAM_MAP(V25_mem, 0) | |
| 3660 | MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3790 | #if USE_V25 | |
| 3791 | MDRV_CPU_ADD(V25, XTAL_16MHz) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3792 | MDRV_CPU_PROGRAM_MAP(V25_rambased_mem, 0) | |
| 3793 | //MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3661 | 3794 | #endif |
| 3662 | 3795 | |
| 3663 | MDRV_MACHINE_RESET( | |
| 3796 | MDRV_MACHINE_RESET(b | |
| 3664 | 3797 | // MDRV_NVRAM_HANDLER(fixeight) /* See 37B6 code */ |
| 3665 | 3798 | |
| 3666 | 3799 | /* video hardware */ |
| r2418 | r2419 | |
| 3731 | 3864 | MDRV_CPU_PROGRAM_MAP(vfive_68k_mem, 0) |
| 3732 | 3865 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3733 | 3866 | |
| 3734 | #if V25 | |
| 3735 | MDRV_CPU_ADD(Z180, 10000000) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3736 | MDRV_CPU_PROGRAM_MAP(V25_mem, 0) | |
| 3737 | MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3867 | #if USE_V25 | |
| 3868 | MDRV_CPU_ADD(V25, 32000000/2) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3869 | MDRV_CPU_PROGRAM_MAP(V25_rambased_mem, 0) | |
| 3870 | //MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3738 | 3871 | #endif |
| 3739 | 3872 | |
| 3740 | 3873 | MDRV_MACHINE_RESET(vfive) |
| r2418 | r2419 | |
| 3762 | 3895 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3763 | 3896 | MACHINE_DRIVER_END |
| 3764 | 3897 | |
| 3898 | MACHINE_RESET(batsugun) | |
| 3899 | { | |
| 3900 | #if USE_V25 | |
| 3901 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 3902 | #endif | |
| 3903 | } | |
| 3765 | 3904 | |
| 3905 | void batsugun_ym2151_irqhandler(int linestate) | |
| 3906 | { | |
| 3907 | logerror("batsugun_ym2151_irqhandler %02x\n",linestate); | |
| 3908 | // update_irq_lines(Machine, linestate ? assert : clear); | |
| 3909 | } | |
| 3910 | ||
| 3911 | const struct YM2151interface batsugun_ym2151_interface = | |
| 3912 | { | |
| 3913 | batsugun_ym2151_irqhandler | |
| 3914 | }; | |
| 3915 | ||
| 3766 | 3916 | static MACHINE_DRIVER_START( batsugun ) |
| 3767 | 3917 | |
| 3768 | 3918 | /* basic machine hardware */ |
| r2418 | r2419 | |
| 3770 | 3920 | MDRV_CPU_PROGRAM_MAP(batsugun_68k_mem, 0) |
| 3771 | 3921 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4) |
| 3772 | 3922 | |
| 3773 | #if V25 | |
| 3774 | MDRV_CPU_ADD(Z180, 32000000/2) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3775 | MDRV_CPU_PROGRAM_MAP(V25_mem, 0) | |
| 3776 | MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3923 | #if USE_V25 | |
| 3924 | MDRV_CPU_ADD(V25, 32000000/2) /* NEC V25+ type Toaplan marked CPU ??? */ | |
| 3925 | MDRV_CPU_PROGRAM_MAP(V25_rambased_mem, 0) | |
| 3926 | //MDRV_CPU_IO_MAP(V25_port, 0) | |
| 3777 | 3927 | #endif |
| 3778 | 3928 | |
| 3779 | MDRV_MACHINE_RESET( | |
| 3929 | MDRV_MACHINE_RESET(b | |
| 3780 | 3930 | |
| 3781 | 3931 | /* video hardware */ |
| 3782 | 3932 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r2418 | r2419 | |
| 3799 | 3949 | |
| 3800 | 3950 | MDRV_SOUND_ADD(YM2151, 27000000/8) |
| 3801 | 3951 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3952 | MDRV_SOUND_CONFIG(batsugun_ym2151_interface) | |
| 3802 | 3953 | |
| 3803 | 3954 | MDRV_SOUND_ADD(OKIM6295, 32000000/8) |
| 3804 | 3955 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) |
| r2418 | r2419 | |
| 4069 | 4220 | ROM_LOAD16_BYTE( "tp020-1.bin", 0x000000, 0x010000, CRC(d8420bd5) SHA1(30c1ad9e053cd7e79adb42aa428ebee28e144755) ) |
| 4070 | 4221 | ROM_LOAD16_BYTE( "tp020-2.bin", 0x000001, 0x010000, CRC(7222de8e) SHA1(8352ae23efc24a2e20cc24b6d37cb8fc6b1a730c) ) |
| 4071 | 4222 | |
| 4072 | #if HD64x180 | |
| 4223 | #if USE_HD64x180 | |
| 4073 | 4224 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ |
| 4074 | 4225 | /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ |
| 4075 | 4226 | ROM_LOAD( "hd647180.020", 0x00000, 0x08000, NO_DUMP ) |
| r2418 | r2419 | |
| 4086 | 4237 | ROM_LOAD16_BYTE( "tp021-01.u10", 0x000000, 0x020000, CRC(9e56ac67) SHA1(daf241d9e55a6e60fc004ed61f787641595b1e62) ) |
| 4087 | 4238 | ROM_LOAD16_BYTE( "tp021-02.u11", 0x000001, 0x020000, CRC(15cac60f) SHA1(6efa3a50a5dfe6ef4072738d6a7d0d95dca8a675) ) |
| 4088 | 4239 | |
| 4089 | #if HD64x180 | |
| 4240 | #if USE_HD64x180 | |
| 4090 | 4241 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ |
| 4091 | 4242 | /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ |
| 4092 | 4243 | ROM_LOAD( "hd647180.021", 0x00000, 0x08000, NO_DUMP ) |
| r2418 | r2419 | |
| 4104 | 4255 | |
| 4105 | 4256 | /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ |
| 4106 | 4257 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4107 | #if V25 | |
| 4258 | #if USE_V25 | |
| 4108 | 4259 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4109 | 4260 | // ROM_LOAD( "tp022.mcu", 0x00000, 0x08000, NO_DUMP ) |
| 4110 | 4261 | #endif |
| r2418 | r2419 | |
| 4128 | 4279 | |
| 4129 | 4280 | /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */ |
| 4130 | 4281 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4131 | #if V25 | |
| 4282 | #if USE_V25 | |
| 4132 | 4283 | ROM_REGION( 0x88000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4133 | 4284 | ROM_LOAD( "kbash02.bin", 0x80000, 0x08000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) ) |
| 4134 | 4285 | #else |
| r2418 | r2419 | |
| 4235 | 4386 | |
| 4236 | 4387 | /* Secondary CPU is a Toaplan marked chip, (TS-001-Turbo TOA PLAN) */ |
| 4237 | 4388 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4238 | #if V25 | |
| 4389 | #if USE_V25 | |
| 4239 | 4390 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Secondary CPU code */ |
| 4240 | 4391 | // ROM_LOAD( "tp-026.mcu", 0x0000, 0x8000, NO_DUMP ) |
| 4241 | 4392 | #endif |
| r2418 | r2419 | |
| 4280 | 4431 | |
| 4281 | 4432 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4282 | 4433 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4283 | #if V25 | |
| 4434 | #if USE_V25 | |
| 4284 | 4435 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4285 | 4436 | // ROM_LOAD( "tp027.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4286 | 4437 | #endif |
| r2418 | r2419 | |
| 4297 | 4448 | |
| 4298 | 4449 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4299 | 4450 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4300 | #if V25 | |
| 4451 | #if USE_V25 | |
| 4301 | 4452 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4302 | 4453 | // ROM_LOAD( "tp027.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4303 | 4454 | #endif |
| r2418 | r2419 | |
| 4314 | 4465 | |
| 4315 | 4466 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4316 | 4467 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4317 | #if V25 | |
| 4468 | #if USE_V25 | |
| 4318 | 4469 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4319 | 4470 | // ROM_LOAD( "tp027.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4320 | 4471 | #endif |
| r2418 | r2419 | |
| 4331 | 4482 | |
| 4332 | 4483 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4333 | 4484 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4334 | #if V25 | |
| 4485 | #if USE_V25 | |
| 4335 | 4486 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4336 | 4487 | // ROM_LOAD( "tp030.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4337 | 4488 | #endif |
| r2418 | r2419 | |
| 4357 | 4508 | |
| 4358 | 4509 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4359 | 4510 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4360 | #if V25 | |
| 4511 | #if USE_V25 | |
| 4361 | 4512 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4362 | 4513 | // ROM_LOAD( "tp030.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4363 | 4514 | #endif |
| r2418 | r2419 | |
| 4383 | 4534 | |
| 4384 | 4535 | /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ |
| 4385 | 4536 | /* Its likely to be a NEC V25+ (PLCC94). */ |
| 4386 | #if V25 | |
| 4537 | #if USE_V25 | |
| 4387 | 4538 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU code */ |
| 4388 | 4539 | // ROM_LOAD( "tp030.mcu", 0x8000, 0x8000, NO_DUMP ) |
| 4389 | 4540 | #endif |
| r2418 | r2419 | |
|---|---|---|
| 567 | 567 | /* 1st sprite layer */ |
| 568 | 568 | // AM_RANGE(0x500000, 0x5005ff) AM_RAM // grid tested ($924-$97c), cleared ($982-$9a4) until $503fff |
| 569 | 569 | // AM_RANGE(0x500600, 0x503fff) AM_RAM // [B] grid tested, cleared ($b68-$be6) |
| 570 | AM_RANGE(0x500000, 0x503fff) AM_RAM AM_WRITE(jchan_suprnova_sprite32_w) AM_BASE(&jchan_spriteram) | |
| 571 | AM_RANGE(0x600000, 0x60003f) AM_RAM AM_WRITE(jchan_suprnova_sprite32regs_w) AM_BASE(&jchan_sprregs) | |
| 570 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(jchan_suprnova_sprite32_w) AM_BASE(&jchan_spriteram) | |
| 571 | AM_RANGE(0x600000, 0x60003f) AM_RAM_WRITE(jchan_suprnova_sprite32regs_w) AM_BASE(&jchan_sprregs) | |
| 572 | 572 | |
| 573 | 573 | /* (0x700000, 0x707fff) = palette zone - but there seems to be 'sub-zones' used differently */ |
| 574 | 574 | // AM_RANGE(0x700000, 0x707fff) AM_RAM // grid tested, cleared ($dbc-$e3a), $2000 bytes (8Kb) copied from $aae40 ($e40-$e56) |
| 575 | 575 | // AM_RANGE(0x708000, 0x70ffff) AM_RAM // [E] grid tested, cleared ($d1c-$d9a), $8000 bytes (32Kb) copied from $a2e40 ($da0-$db6) |
| 576 | 576 | AM_RANGE(0x700000, 0x707fff) AM_RAM // palette for tilemaps? |
| 577 | AM_RANGE(0x708000, 0x70ffff) AM_RAM AM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // palette for sprites? | |
| 578 | // AM_RANGE(0x700000, 0x70ffff) AM_RAM AM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // palette for sprites? | |
| 577 | AM_RANGE(0x708000, 0x70ffff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // palette for sprites? | |
| 578 | // AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16) // palette for sprites? | |
| 579 | 579 | |
| 580 | 580 | AM_RANGE(0xf00000, 0xf00003) AM_READWRITE(jchan_ctrl_r, jchan_ctrl_w) AM_BASE(&jchan_ctrl) |
| 581 | 581 | AM_RANGE(0xf00004, 0xf00005) AM_READ(input_port_2_word_r) // DSW2 |
| r2418 | r2419 | |
| 594 | 594 | AM_RANGE(0x400002, 0x403fff) AM_RAM |
| 595 | 595 | |
| 596 | 596 | /* VIEW2 Tilemap - [D] grid tested, cleared ($1d84), also cleared at startup ($810-$826) */ |
| 597 | AM_RANGE(0x500000, 0x500fff) AM_RAM // AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 598 | AM_RANGE(0x501000, 0x501fff) AM_RAM // AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 597 | AM_RANGE(0x500000, 0x500fff) AM_RAM // AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 598 | AM_RANGE(0x501000, 0x501fff) AM_RAM // AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 599 | 599 | AM_RANGE(0x502000, 0x502fff) AM_RAM // AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 600 | 600 | AM_RANGE(0x503000, 0x503fff) AM_RAM // AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 601 | AM_RANGE(0x600000, 0x60001f) AM_RAM // AM_R | |
| 601 | AM_RANGE(0x600000, 0x60001f) AM_RAM // AM_R | |
| 602 | 602 | |
| 603 | 603 | /* 2nd sprite layer? - [C] grid tested, cleared ($1e2a), also cleared at startup ($7dc-$80a) */ |
| 604 | 604 | AM_RANGE(0x700000, 0x703fff) AM_RAM // AM_BASE(&jchan_spriteram) AM_WRITE(jchan_suprnova_sprite32_w) |
| r2418 | r2419 | |
|---|---|---|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static ADDRESS_MAP_START( jailbrek_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 76 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_WRITE(jailbrek_colorram_w) AM_BASE(&colorram) | |
| 77 | AM_RANGE(0x0800, 0x0fff) AM_RAM AM_WRITE(jailbrek_videoram_w) AM_BASE(&videoram) | |
| 76 | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(jailbrek_colorram_w) AM_BASE(&colorram) | |
| 77 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(jailbrek_videoram_w) AM_BASE(&videoram) | |
| 78 | 78 | AM_RANGE(0x1000, 0x10bf) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 79 | 79 | AM_RANGE(0x10c0, 0x14ff) AM_RAM /* ??? */ |
| 80 | 80 | AM_RANGE(0x1500, 0x1fff) AM_RAM /* work ram */ |
| r2418 | r2419 | |
|---|---|---|
| 148 | 148 | // AM_RANGE( 0xc00a, 0xc00a ) AM_READ(input_port_1_r) |
| 149 | 149 | AM_RANGE( 0xe000, 0xe000 ) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 150 | 150 | AM_RANGE( 0xe001, 0xe001 ) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 151 | AM_RANGE( 0xe800, 0xefff ) AM_READWRITE(SMH_RAM, couple_vram_hi_w) AM_BASE(&vram_hi) | |
| 152 | AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(SMH_RAM, couple_vram_lo_w) AM_BASE(&vram_lo) | |
| 151 | AM_RANGE( 0xe800, 0xefff ) AM_RAM_WRITE(couple_vram_hi_w) AM_BASE(&vram_hi) | |
| 152 | AM_RANGE( 0xf000, 0xf7ff ) AM_RAM_WRITE(couple_vram_lo_w) AM_BASE(&vram_lo) | |
| 153 | 153 | AM_RANGE( 0xf800, 0xfbff ) AM_RAM /*extra VRAM?*/ |
| 154 | 154 | ADDRESS_MAP_END |
| 155 | 155 |
| r2418 | r2419 | |
|---|---|---|
| 118 | 118 | static ADDRESS_MAP_START( bankp_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 119 | 119 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 120 | 120 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 121 | AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(bankp_videoram_w) AM_BASE(&videoram) | |
| 122 | AM_RANGE(0xf400, 0xf7ff) AM_RAM AM_WRITE(bankp_colorram_w) AM_BASE(&colorram) | |
| 123 | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_WRITE(bankp_videoram2_w) AM_BASE(&bankp_videoram2) | |
| 124 | AM_RANGE(0xfc00, 0xffff) AM_RAM AM_WRITE(bankp_colorram2_w) AM_BASE(&bankp_colorram2) | |
| 121 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(bankp_videoram_w) AM_BASE(&videoram) | |
| 122 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(bankp_colorram_w) AM_BASE(&colorram) | |
| 123 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(bankp_videoram2_w) AM_BASE(&bankp_videoram2) | |
| 124 | AM_RANGE(0xfc00, 0xffff) AM_RAM_WRITE(bankp_colorram2_w) AM_BASE(&bankp_colorram2) | |
| 125 | 125 | ADDRESS_MAP_END |
| 126 | 126 | |
| 127 | 127 | static ADDRESS_MAP_START( bankp_io_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 537 | 537 | AM_RANGE(0x040000, 0x043fff) AM_RAM // RAM |
| 538 | 538 | AM_RANGE(0x060000, 0x060005) AM_WRITE(wecleman_protection_w) AM_BASE(&wecleman_protection_ram) |
| 539 | 539 | AM_RANGE(0x060006, 0x060007) AM_READ(wecleman_protection_r) // MCU read |
| 540 | AM_RANGE(0x080000, 0x080011) AM_READWRITE(SMH_RAM, blitter_w) AM_BASE(&blitter_regs) // Blitter | |
| 541 | AM_RANGE(0x100000, 0x103fff) AM_READWRITE(SMH_RAM, wecleman_pageram_w) AM_BASE(&wecleman_pageram) // Background Layers | |
| 542 | AM_RANGE(0x108000, 0x108fff) AM_READWRITE(SMH_RAM, wecleman_txtram_w) AM_BASE(&wecleman_txtram) // Text Layer | |
| 543 | AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SMH_RAM, wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 540 | AM_RANGE(0x080000, 0x080011) AM_RAM_WRITE(blitter_w) AM_BASE(&blitter_regs) // Blitter | |
| 541 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(wecleman_pageram_w) AM_BASE(&wecleman_pageram) // Background Layers | |
| 542 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(wecleman_txtram_w) AM_BASE(&wecleman_txtram) // Text Layer | |
| 543 | AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 544 | 544 | AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE(1) // Shared with main CPU |
| 545 | 545 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_BASE(&spriteram16) // Sprites |
| 546 | 546 | AM_RANGE(0x140000, 0x140001) AM_WRITE(wecleman_soundlatch_w) // To sound CPU |
| r2418 | r2419 | |
| 596 | 596 | static ADDRESS_MAP_START( hotchase_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 597 | 597 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 598 | 598 | AM_RANGE(0x040000, 0x063fff) AM_RAM // RAM (weird size!?) |
| 599 | AM_RANGE(0x080000, 0x080011) AM_R | |
| 599 | AM_RANGE(0x080000, 0x080011) AM_R | |
| 600 | 600 | AM_RANGE(0x100000, 0x100fff) AM_READWRITE(hotchase_K051316_0_r, hotchase_K051316_0_w) // Background |
| 601 | 601 | AM_RANGE(0x101000, 0x10101f) AM_WRITE(hotchase_K051316_ctrl_0_w) // Background Ctrl |
| 602 | 602 | AM_RANGE(0x102000, 0x102fff) AM_READWRITE(hotchase_K051316_1_r, hotchase_K051316_1_w) // Foreground |
| 603 | 603 | AM_RANGE(0x103000, 0x10301f) AM_WRITE(hotchase_K051316_ctrl_1_w) // Foreground Ctrl |
| 604 | AM_RANGE(0x110000, 0x111fff) AM_R | |
| 604 | AM_RANGE(0x110000, 0x111fff) AM_R | |
| 605 | 605 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE(1) // Shared with sub CPU |
| 606 | 606 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_BASE(&spriteram16) // Sprites |
| 607 | 607 | // Input Ports: |
| r2418 | r2419 | |
|---|---|---|
| 203 | 203 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) /* A15 is not decoded */ |
| 204 | 204 | AM_RANGE(0x0000, 0x3fff) AM_ROM /* not fully populated */ |
| 205 | 205 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM |
| 206 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, crbaloon_videoram_w) AM_BASE(&crbaloon_videoram) | |
| 207 | AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, crbaloon_colorram_w) AM_BASE(&crbaloon_colorram) | |
| 206 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(crbaloon_videoram_w) AM_BASE(&crbaloon_videoram) | |
| 207 | AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_RAM_WRITE(crbaloon_colorram_w) AM_BASE(&crbaloon_colorram) | |
| 208 | 208 | AM_RANGE(0x5800, 0x7fff) AM_NOP |
| 209 | 209 | ADDRESS_MAP_END |
| 210 | 210 |
| r2418 | r2419 | |
|---|---|---|
| 566 | 566 | |
| 567 | 567 | /* reset the other devices */ |
| 568 | 568 | galileo_reset(); |
| 569 | | |
| 569 | | |
| 570 | 570 | voodoo_reset(0); |
| 571 | 571 | if (board_config == SEATTLE_WIDGET_CONFIG) |
| 572 | 572 | widget_reset(); |
| r2418 | r2419 | |
| 582 | 582 | * |
| 583 | 583 | *************************************/ |
| 584 | 584 | |
| 585 | static void ide_interrupt(int state) | |
| 585 | static void ide_interrupt(const device_config *device, int state) | |
| 586 | 586 | { |
| 587 | cpunum_set_input_line( | |
| 587 | cpunum_set_input_line(device->machine, 0, IDE_IRQ_NUM, state); | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
| 591 | static const struct ide_interface ide_intf = | |
| 592 | { | |
| 593 | ide_interrupt | |
| 594 | }; | |
| 595 | 591 | |
| 596 | ||
| 597 | ||
| 598 | 592 | /************************************* |
| 599 | 593 | * |
| 600 | 594 | * Ethernet interrupts |
| r2418 | r2419 | |
| 1728 | 1722 | ADDRESS_MAP_UNMAP_HIGH |
| 1729 | 1723 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(&rambase) // wg3dh only has 4MB; sfrush, blitz99 8MB |
| 1730 | 1724 | AM_RANGE(0x08000000, 0x08ffffff) AM_READWRITE(voodoo_0_r, seattle_voodoo_w) |
| 1731 | AM_RANGE(0x0a000000, 0x0a0003ff) AM_READWRITE(ide_controller32_ | |
| 1725 | AM_RANGE(0x0a000000, 0x0a0003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_ | |
| 1732 | 1726 | AM_RANGE(0x0a00040c, 0x0a00040f) AM_NOP // IDE-related, but annoying |
| 1733 | AM_RANGE(0x0a000f00, 0x0a000f07) AM_READWRITE(ide_bus_master32_ | |
| 1727 | AM_RANGE(0x0a000f00, 0x0a000f07) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_bus_master32_ | |
| 1734 | 1728 | AM_RANGE(0x0c000000, 0x0c000fff) AM_READWRITE(galileo_r, galileo_w) |
| 1735 | 1729 | AM_RANGE(0x13000000, 0x13000003) AM_WRITE(asic_fifo_w) |
| 1736 | 1730 | AM_RANGE(0x16000000, 0x1600003f) AM_READWRITE(midway_ioasic_r, midway_ioasic_w) |
| 1737 | 1731 | AM_RANGE(0x16100000, 0x1611ffff) AM_READWRITE(cmos_r, cmos_w) AM_BASE(&generic_nvram32) AM_SIZE(&generic_nvram_size) |
| 1738 | 1732 | AM_RANGE(0x17000000, 0x17000003) AM_READWRITE(cmos_protect_r, cmos_protect_w) |
| 1739 | 1733 | AM_RANGE(0x17100000, 0x17100003) AM_WRITE(seattle_watchdog_w) |
| 1740 | AM_RANGE(0x17300000, 0x17300003) AM_READWRITE(SMH_RAM, seattle_interrupt_enable_w) AM_BASE(&interrupt_enable) | |
| 1741 | AM_RANGE(0x17400000, 0x17400003) AM_READWRITE(SMH_RAM, interrupt_config_w) AM_BASE(&interrupt_config) | |
| 1734 | AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_BASE(&interrupt_enable) | |
| 1735 | AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_BASE(&interrupt_config) | |
| 1742 | 1736 | AM_RANGE(0x17500000, 0x17500003) AM_READ(interrupt_state_r) |
| 1743 | 1737 | AM_RANGE(0x17600000, 0x17600003) AM_READ(interrupt_state2_r) |
| 1744 | 1738 | AM_RANGE(0x17700000, 0x17700003) AM_WRITE(vblank_clear_w) |
| 1745 | 1739 | AM_RANGE(0x17800000, 0x17800003) AM_NOP |
| 1746 | 1740 | AM_RANGE(0x17900000, 0x17900003) AM_READWRITE(status_leds_r, status_leds_w) |
| 1747 | AM_RANGE(0x17f00000, 0x17f00003) AM_R | |
| 1741 | AM_RANGE(0x17f00000, 0x17f00003) AM_R | |
| 1748 | 1742 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&rombase) |
| 1749 | 1743 | ADDRESS_MAP_END |
| 1750 | 1744 | |
| r2418 | r2419 | |
| 2465 | 2459 | MDRV_MACHINE_RESET(seattle) |
| 2466 | 2460 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 2467 | 2461 | |
| 2462 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 2463 | ||
| 2468 | 2464 | /* video hardware */ |
| 2469 | 2465 | MDRV_SCREEN_ADD("main", RASTER) |
| 2470 | 2466 | MDRV_SCREEN_REFRESH_RATE(57) |
| r2418 | r2419 | |
| 2726 | 2722 | * |
| 2727 | 2723 | *************************************/ |
| 2728 | 2724 | |
| 2729 | static void init_common(int ioasic, int serialnum, int yearoffs, int config) | |
| 2725 | static void init_common(running_machine *machine, int ioasic, int serialnum, int yearoffs, int config) | |
| 2730 | 2726 | { |
| 2731 | 2727 | /* initialize the subsystems */ |
| 2732 | ide_controller_init(0, &ide_intf); | |
| 2733 | 2728 | midway_ioasic_init(ioasic, serialnum, yearoffs, ioasic_irq); |
| 2734 | 2729 | |
| 2735 | 2730 | /* switch off the configuration */ |
| r2418 | r2419 | |
| 2738 | 2733 | { |
| 2739 | 2734 | case PHOENIX_CONFIG: |
| 2740 | 2735 | /* original Phoenix board only has 4MB of RAM */ |
| 2741 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP); | |
| 2742 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP); | |
| 2736 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP, SMH_NOP); | |
| 2743 | 2737 | break; |
| 2744 | 2738 | |
| 2745 | 2739 | case SEATTLE_WIDGET_CONFIG: |
| 2746 | 2740 | /* set up the widget board */ |
| 2747 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_r); | |
| 2748 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_w); | |
| 2741 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_r, widget_w); | |
| 2749 | 2742 | smc91c94_init(ðernet_intf); |
| 2750 | 2743 | break; |
| 2751 | 2744 | |
| 2752 | 2745 | case FLAGSTAFF_CONFIG: |
| 2753 | 2746 | /* set up the analog inputs */ |
| 2754 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_r); | |
| 2755 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_w); | |
| 2747 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_r, analog_port_w); | |
| 2756 | 2748 | |
| 2757 | 2749 | /* set up the ethernet controller */ |
| 2758 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r); | |
| 2759 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_w); | |
| 2750 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r, ethernet_w); | |
| 2760 | 2751 | smc91c94_init(ðernet_intf); |
| 2761 | 2752 | break; |
| 2762 | 2753 | } |
| r2418 | r2419 | |
| 2776 | 2767 | |
| 2777 | 2768 | static DRIVER_INIT( wg3dh ) |
| 2778 | 2769 | { |
| 2779 | dcs2_init(2, 0x3839); | |
| 2780 | init_common(MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG); | |
| 2770 | dcs2_init(machine, 2, 0x3839); | |
| 2771 | init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG); | |
| 2781 | 2772 | |
| 2782 | 2773 | /* speedups */ |
| 2783 | 2774 | add_speedup(0x8004413C, 0x0C0054B4); /* confirmed */ |
| r2418 | r2419 | |
| 2788 | 2779 | |
| 2789 | 2780 | static DRIVER_INIT( mace ) |
| 2790 | 2781 | { |
| 2791 | dcs2_init(2, 0x3839); | |
| 2792 | init_common(MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG); | |
| 2782 | dcs2_init(machine, 2, 0x3839); | |
| 2783 | init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG); | |
| 2793 | 2784 | |
| 2794 | 2785 | /* speedups */ |
| 2795 | 2786 | add_speedup(0x800108F8, 0x8C420000); /* confirmed */ |
| r2418 | r2419 | |
| 2798 | 2789 | |
| 2799 | 2790 | static DRIVER_INIT( sfrush ) |
| 2800 | 2791 | { |
| 2801 | cage_init(REGION_USER2, 0x5236); | |
| 2802 | init_common(MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG); | |
| 2792 | cage_init(machine, REGION_USER2, 0x5236); | |
| 2793 | init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG); | |
| 2803 | 2794 | |
| 2804 | 2795 | /* speedups */ |
| 2805 | 2796 | add_speedup(0x80059F34, 0x3C028012); /* confirmed */ |
| r2418 | r2419 | |
| 2810 | 2801 | |
| 2811 | 2802 | static DRIVER_INIT( sfrushrk ) |
| 2812 | 2803 | { |
| 2813 | cage_init(REGION_USER2, 0x5329); | |
| 2814 | init_common(MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG); | |
| 2804 | cage_init(machine, REGION_USER2, 0x5329); | |
| 2805 | init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG); | |
| 2815 | 2806 | |
| 2816 | 2807 | /* speedups */ |
| 2817 | 2808 | add_speedup(0x800343E8, 0x3C028012); /* confirmed */ |
| r2418 | r2419 | |
| 2823 | 2814 | |
| 2824 | 2815 | static DRIVER_INIT( calspeed ) |
| 2825 | 2816 | { |
| 2826 | dcs2_init(2, 0x39c0); | |
| 2827 | init_common(MIDWAY_IOASIC_CALSPEED, 328/* others? */, 100, SEATTLE_WIDGET_CONFIG); | |
| 2817 | dcs2_init(machine, 2, 0x39c0); | |
| 2818 | init_common(machine, MIDWAY_IOASIC_CALSPEED, 328/* others? */, 100, SEATTLE_WIDGET_CONFIG); | |
| 2828 | 2819 | midway_ioasic_set_auto_ack(1); |
| 2829 | 2820 | |
| 2830 | 2821 | /* speedups */ |
| r2418 | r2419 | |
| 2835 | 2826 | |
| 2836 | 2827 | static DRIVER_INIT( vaportrx ) |
| 2837 | 2828 | { |
| 2838 | dcs2_init(2, 0x39c2); | |
| 2839 | init_common(MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG); | |
| 2829 | dcs2_init(machine, 2, 0x39c2); | |
| 2830 | init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG); | |
| 2840 | 2831 | |
| 2841 | 2832 | /* speedups */ |
| 2842 | 2833 | add_speedup(0x80049F14, 0x3C028020); /* confirmed */ |
| r2418 | r2419 | |
| 2847 | 2838 | |
| 2848 | 2839 | static DRIVER_INIT( biofreak ) |
| 2849 | 2840 | { |
| 2850 | dcs2_init(2, 0x3835); | |
| 2851 | init_common(MIDWAY_IOASIC_STANDARD, 231/* no alternates */, 80, SEATTLE_CONFIG); | |
| 2841 | dcs2_init(machine, 2, 0x3835); | |
| 2842 | init_common(machine, MIDWAY_IOASIC_STANDARD, 231/* no alternates */, 80, SEATTLE_CONFIG); | |
| 2852 | 2843 | |
| 2853 | 2844 | /* speedups */ |
| 2854 | 2845 | } |
| r2418 | r2419 | |
| 2856 | 2847 | |
| 2857 | 2848 | static DRIVER_INIT( blitz ) |
| 2858 | 2849 | { |
| 2859 | dcs2_init(2, 0x39c2); | |
| 2860 | init_common(MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG); | |
| 2850 | dcs2_init(machine, 2, 0x39c2); | |
| 2851 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG); | |
| 2861 | 2852 | |
| 2862 | 2853 | /* for some reason, the code in the ROM appears buggy; this is a small patch to fix it */ |
| 2863 | 2854 | rombase[0x934/4] += 4; |
| r2418 | r2419 | |
| 2870 | 2861 | |
| 2871 | 2862 | static DRIVER_INIT( blitz99 ) |
| 2872 | 2863 | { |
| 2873 | dcs2_init(2, 0x0afb); | |
| 2874 | init_common(MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG); | |
| 2864 | dcs2_init(machine, 2, 0x0afb); | |
| 2865 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG); | |
| 2875 | 2866 | |
| 2876 | 2867 | /* speedups */ |
| 2877 | 2868 | add_speedup(0x8014E41C, 0x3C038025); /* confirmed */ |
| r2418 | r2419 | |
| 2881 | 2872 | |
| 2882 | 2873 | static DRIVER_INIT( blitz2k ) |
| 2883 | 2874 | { |
| 2884 | dcs2_init(2, 0x0b5d); | |
| 2885 | init_common(MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG); | |
| 2875 | dcs2_init(machine, 2, 0x0b5d); | |
| 2876 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG); | |
| 2886 | 2877 | |
| 2887 | 2878 | /* speedups */ |
| 2888 | 2879 | add_speedup(0x8015773C, 0x3C038025); /* confirmed */ |
| r2418 | r2419 | |
| 2892 | 2883 | |
| 2893 | 2884 | static DRIVER_INIT( carnevil ) |
| 2894 | 2885 | { |
| 2895 | dcs2_init(2, 0x0af7); | |
| 2896 | init_common(MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG); | |
| 2886 | dcs2_init(machine, 2, 0x0af7); | |
| 2887 | init_common(machine, MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG); | |
| 2897 | 2888 | |
| 2898 | 2889 | /* set up the gun */ |
| 2899 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r); | |
| 2900 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_w); | |
| 2890 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r, carnevil_gun_w); | |
| 2901 | 2891 | |
| 2902 | 2892 | /* speedups */ |
| 2903 | 2893 | add_speedup(0x8015176C, 0x3C03801A); /* confirmed */ |
| r2418 | r2419 | |
| 2907 | 2897 | |
| 2908 | 2898 | static DRIVER_INIT( hyprdriv ) |
| 2909 | 2899 | { |
| 2910 | dcs2_init(2, 0x0af7); | |
| 2911 | init_common(MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG); | |
| 2900 | dcs2_init(machine, 2, 0x0af7); | |
| 2901 | init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG); | |
| 2912 | 2902 | |
| 2913 | 2903 | /* speedups */ |
| 2914 | 2904 | add_speedup(0x801643BC, 0x3C03801B); /* confirmed */ |
| r2418 | r2419 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( portrait_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 127 | 127 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 128 | AM_RANGE(0x8000, 0x87ff) AM_READWRITE(SMH_RAM, portrait_bgvideo_write) AM_BASE(&portrait_bgvideoram) | |
| 129 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE(SMH_RAM, portrait_fgvideo_write) AM_BASE(&portrait_fgvideoram) | |
| 128 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(portrait_bgvideo_write) AM_BASE(&portrait_bgvideoram) | |
| 129 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(portrait_fgvideo_write) AM_BASE(&portrait_fgvideoram) | |
| 130 | 130 | AM_RANGE(0x9000, 0x91ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 131 | 131 | AM_RANGE(0x9200, 0x97ff) AM_RAM |
| 132 | 132 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_w) |
| r2418 | r2419 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | 37 | #include "deprecat.h" |
| 38 | #include "sound/okim6295.h" | |
| 38 | 39 | #include "sound/ymz280b.h" |
| 39 | 40 | #include "rocknms.lh" |
| 40 | 41 | |
| r2418 | r2419 | |
| 71 | 72 | WRITE16_HANDLER( rockn_priority_w ); |
| 72 | 73 | READ16_HANDLER( rocknms_sub_priority_r ); |
| 73 | 74 | WRITE16_HANDLER( rocknms_sub_priority_w ); |
| 75 | READ16_HANDLER( nndmseal_priority_r ); | |
| 74 | 76 | |
| 75 | 77 | WRITE16_HANDLER( tetrisp2_vram_bg_w ); |
| 76 | 78 | WRITE16_HANDLER( tetrisp2_vram_fg_w ); |
| r2418 | r2419 | |
| 82 | 84 | |
| 83 | 85 | VIDEO_START( tetrisp2 ); |
| 84 | 86 | VIDEO_UPDATE( tetrisp2 ); |
| 87 | ||
| 85 | 88 | VIDEO_START( rockntread ); |
| 86 | 89 | VIDEO_UPDATE( rockntread ); |
| 90 | ||
| 87 | 91 | VIDEO_START( rocknms ); |
| 88 | 92 | VIDEO_UPDATE( rocknms ); |
| 89 | 93 | |
| 94 | VIDEO_START( nndmseal ); | |
| 95 | ||
| 90 | 96 | /*************************************************************************** |
| 91 | 97 | |
| 92 | 98 | |
| 93 | | |
| 99 | | |
| 94 | 100 | |
| 95 | 101 | |
| 96 | 102 | ***************************************************************************/ |
| r2418 | r2419 | |
| 220 | 226 | rockn_soundvolume = data; |
| 221 | 227 | } |
| 222 | 228 | |
| 229 | ||
| 230 | static WRITE16_HANDLER( nndmseal_sound_bank_w ) | |
| 231 | { | |
| 232 | static int bank_lo, bank_hi; | |
| 233 | ||
| 234 | if (ACCESSING_BITS_0_7) | |
| 235 | { | |
| 236 | UINT8 *rom = memory_region(REGION_SOUND2); | |
| 237 | ||
| 238 | if (data & 0x04) | |
| 239 | { | |
| 240 | bank_lo = data & 0x03; | |
| 241 | ||
| 242 | memcpy(memory_region(REGION_SOUND1), rom + (bank_lo * 0x80000), 0x20000); | |
| 243 | ||
| 244 | // logerror("PC:%06X sound bank_lo = %02X\n",activecpu_get_pc(),bank_lo); | |
| 245 | } | |
| 246 | else | |
| 247 | { | |
| 248 | bank_hi = data & 0x03; | |
| 249 | ||
| 250 | memcpy(memory_region(REGION_SOUND1) + 0x20000, rom + (bank_lo * 0x80000) + (bank_hi * 0x20000), 0x20000); | |
| 251 | ||
| 252 | // logerror("PC:%06X sound bank_hi = %02X\n",activecpu_get_pc(),bank_hi); | |
| 253 | } | |
| 254 | } | |
| 255 | } | |
| 256 | ||
| 223 | 257 | /*************************************************************************** |
| 224 | 258 | |
| 225 | 259 | |
| r2418 | r2419 | |
| 380 | 414 | AM_RANGE(0xba001e, 0xba001f) AM_WRITE(SMH_NOP ) // Lev 2 irq ack |
| 381 | 415 | ADDRESS_MAP_END |
| 382 | 416 | |
| 417 | ||
| 418 | static WRITE16_HANDLER( nndmseal_coincounter_w ) | |
| 419 | { | |
| 420 | if (ACCESSING_BITS_0_7) | |
| 421 | { | |
| 422 | coin_counter_w( 0, data & 0x0001 ); | |
| 423 | // data & 0x0004 ? | |
| 424 | coin_lockout_w( 0,(~data) & 0x0008 ); | |
| 425 | } | |
| 426 | if (ACCESSING_BITS_8_15) | |
| 427 | { | |
| 428 | set_led_status( 0, data & 0x1000 ); // + | |
| 429 | set_led_status( 1, data & 0x2000 ); // - | |
| 430 | set_led_status( 2, data & 0x4000 ); // Cancel | |
| 431 | set_led_status( 3, data & 0x8000 ); // OK | |
| 432 | } | |
| 433 | // popmessage("%04x",data); | |
| 434 | } | |
| 435 | ||
| 436 | static WRITE16_HANDLER( nndmseal_b20000_w ) | |
| 437 | { | |
| 438 | // leds? | |
| 439 | // popmessage("%04x",data); | |
| 440 | } | |
| 441 | ||
| 442 | static ADDRESS_MAP_START( nndmseal_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 443 | AM_RANGE(0x000000, 0x07ffff) AM_ROM | |
| 444 | AM_RANGE(0x100000, 0x103fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Object RAM | |
| 445 | AM_RANGE(0x104000, 0x107fff) AM_RAM // Spare Object RAM | |
| 446 | AM_RANGE(0x108000, 0x10ffff) AM_RAM // Work RAM | |
| 447 | AM_RANGE(0x200000, 0x23ffff) AM_READWRITE(nndmseal_priority_r, SMH_RAM) AM_BASE(&tetrisp2_priority ) // Priority | |
| 448 | AM_RANGE(0x300000, 0x31ffff) AM_RAM_WRITE(tetrisp2_palette_w) AM_BASE(&paletteram16 ) // Palette | |
| 449 | AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE(tetrisp2_vram_fg_w) AM_BASE(&tetrisp2_vram_fg ) // Foreground | |
| 450 | AM_RANGE(0x404000, 0x407fff) AM_RAM_WRITE(tetrisp2_vram_bg_w) AM_BASE(&tetrisp2_vram_bg ) // Background | |
| 451 | ||
| 452 | AM_RANGE(0x408000, 0x409fff) AM_RAM // ??? | |
| 453 | AM_RANGE(0x500000, 0x50ffff) AM_RAM // Line | |
| 454 | ||
| 455 | AM_RANGE(0x600000, 0x60ffff) AM_RAM_WRITE(tetrisp2_vram_rot_w) AM_BASE(&tetrisp2_vram_rot ) // Rotation | |
| 456 | AM_RANGE(0x650000, 0x651fff) AM_RAM_WRITE(tetrisp2_vram_rot_w) // Rotation (mirror) | |
| 457 | ||
| 458 | AM_RANGE(0x800000, 0x800003) AM_READWRITE( OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w ) // Sound | |
| 459 | ||
| 460 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(tetrisp2_nvram_r, tetrisp2_nvram_w) AM_BASE(&tetrisp2_nvram) AM_SIZE(&tetrisp2_nvram_size ) // NVRAM | |
| 461 | ||
| 462 | AM_RANGE(0xb00000, 0xb00001) AM_WRITE(nndmseal_coincounter_w) // Coin Counter | |
| 463 | AM_RANGE(0xb20000, 0xb20001) AM_WRITE(nndmseal_b20000_w) // ??? | |
| 464 | ||
| 465 | AM_RANGE(0xb40000, 0xb4000b) AM_WRITE(SMH_RAM) AM_BASE(&tetrisp2_scroll_fg ) // Foreground Scrolling | |
| 466 | AM_RANGE(0xb40010, 0xb4001b) AM_WRITE(SMH_RAM) AM_BASE(&tetrisp2_scroll_bg ) // Background Scrolling | |
| 467 | AM_RANGE(0xb4003e, 0xb4003f) AM_WRITE(SMH_NOP) // scr_size | |
| 468 | ||
| 469 | AM_RANGE(0xb60000, 0xb6002f) AM_WRITE(SMH_RAM) AM_BASE(&tetrisp2_rotregs) // Rotation Registers | |
| 470 | ||
| 471 | AM_RANGE(0xb80000, 0xb80001) AM_WRITE(nndmseal_sound_bank_w) | |
| 472 | ||
| 473 | AM_RANGE(0xba0000, 0xba001f) AM_WRITE(rockn_systemregs_w ) // system param | |
| 474 | AM_RANGE(0xba001a, 0xba001b) AM_WRITE(SMH_NOP ) // Lev 4 irq ack | |
| 475 | AM_RANGE(0xba001e, 0xba001f) AM_WRITE(SMH_NOP ) // Lev 2 irq ack | |
| 476 | ||
| 477 | AM_RANGE(0xbe0000, 0xbe0001) AM_READ (SMH_NOP ) // INT-level1 dummy read | |
| 478 | AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("BUTTONS" ) // Inputs | |
| 479 | AM_RANGE(0xbe0004, 0xbe0005) AM_READ_PORT("COINS" ) // "" | |
| 480 | AM_RANGE(0xbe0006, 0xbe0007) AM_READ_PORT("PRINT" ) // "" | |
| 481 | AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW" ) // "" | |
| 482 | ||
| 483 | AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r ) // Watchdog | |
| 484 | ADDRESS_MAP_END | |
| 485 | ||
| 383 | 486 | static ADDRESS_MAP_START( rockn1_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 384 | 487 | AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM ) // ROM |
| 385 | 488 | AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM ) // Object RAM |
| r2418 | r2419 | |
| 709 | 812 | |
| 710 | 813 | |
| 711 | 814 | /*************************************************************************** |
| 815 | Nandemo Seal Iinkai | |
| 816 | ***************************************************************************/ | |
| 817 | ||
| 818 | static INPUT_PORTS_START( nndmseal ) | |
| 819 | ||
| 820 | PORT_START_TAG("BUTTONS") // be0002.w | |
| 821 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 822 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 823 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 824 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 825 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "OK" ) | |
| 826 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Cancel" ) | |
| 827 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "-" ) | |
| 828 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "+" ) | |
| 829 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 830 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 831 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 832 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 833 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 834 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 835 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 836 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 837 | ||
| 838 | PORT_START_TAG("COINS") // be0004.w | |
| 839 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 840 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 841 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 842 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 843 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 ) // (keep pressed during boot for test mode) | |
| 844 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 845 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 846 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 847 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 848 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 849 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 850 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 851 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 852 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 853 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 854 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 855 | ||
| 856 | PORT_START_TAG("DSW") // be0008.w | |
| 857 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) | |
| 858 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 859 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 860 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) | |
| 861 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 862 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 863 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) | |
| 864 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 865 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 866 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) | |
| 867 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 868 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 869 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) | |
| 870 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 871 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 872 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) | |
| 873 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 874 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 875 | PORT_DIPNAME( 0x0040, 0x0040, "Time?" ) | |
| 876 | PORT_DIPSETTING( 0x0000, "35" ) | |
| 877 | PORT_DIPSETTING( 0x0040, "45" ) | |
| 878 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 879 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 880 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 881 | PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coinage ) ) | |
| 882 | PORT_DIPSETTING( 0x0f00, "0" ) | |
| 883 | PORT_DIPSETTING( 0x0e00, "1" ) | |
| 884 | PORT_DIPSETTING( 0x0d00, "2" ) | |
| 885 | PORT_DIPSETTING( 0x0c00, "3" ) | |
| 886 | PORT_DIPSETTING( 0x0b00, "4" ) | |
| 887 | PORT_DIPSETTING( 0x0a00, "5" ) | |
| 888 | PORT_DIPSETTING( 0x0900, "6" ) | |
| 889 | PORT_DIPSETTING( 0x0800, "7" ) | |
| 890 | PORT_DIPSETTING( 0x0700, "8" ) | |
| 891 | PORT_DIPSETTING( 0x0600, "9" ) | |
| 892 | PORT_DIPSETTING( 0x0500, "a" ) | |
| 893 | PORT_DIPSETTING( 0x0400, "b" ) | |
| 894 | PORT_DIPSETTING( 0x0300, "c" ) | |
| 895 | PORT_DIPSETTING( 0x0200, "d" ) | |
| 896 | PORT_DIPSETTING( 0x0100, "e" ) | |
| 897 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) | |
| 898 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) ) | |
| 899 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 900 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) | |
| 901 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) | |
| 902 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 903 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 904 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) | |
| 905 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 906 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 907 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) | |
| 908 | ||
| 909 | PORT_START_TAG("PRINT") // be0006.w | |
| 910 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Print 1?") // Press both to print (and alternate with ok too). | |
| 911 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Print 2?") // Hold them for some seconds to bring up a "caution" message. | |
| 912 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH,IPT_SPECIAL ) // ? | |
| 913 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 914 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 915 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 916 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 917 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 918 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 919 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 920 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 921 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 922 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 923 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 924 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 925 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 926 | ||
| 927 | INPUT_PORTS_END | |
| 928 | ||
| 929 | ||
| 930 | /*************************************************************************** | |
| 712 | 931 | Rock'n Tread (Japan) |
| 713 | 932 | ***************************************************************************/ |
| 714 | 933 | |
| r2418 | r2419 | |
| 1064 | 1283 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 1065 | 1284 | MACHINE_DRIVER_END |
| 1066 | 1285 | |
| 1286 | ||
| 1287 | static MACHINE_DRIVER_START( nndmseal ) | |
| 1288 | ||
| 1289 | /* basic machine hardware */ | |
| 1290 | MDRV_CPU_ADD(M68000, XTAL_12MHz) | |
| 1291 | MDRV_CPU_PROGRAM_MAP(nndmseal_map,0) | |
| 1292 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) | |
| 1293 | ||
| 1294 | MDRV_NVRAM_HANDLER(tetrisp2) | |
| 1295 | ||
| 1296 | /* video hardware */ | |
| 1297 | MDRV_SCREEN_ADD("main", RASTER) | |
| 1298 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1299 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1300 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1301 | MDRV_SCREEN_SIZE(0x180, 0xf0) | |
| 1302 | MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0xf0-1) | |
| 1303 | ||
| 1304 | MDRV_GFXDECODE(tetrisp2) | |
| 1305 | MDRV_PALETTE_LENGTH(0x8000) | |
| 1306 | ||
| 1307 | MDRV_VIDEO_START(nndmseal) // bg layer offset | |
| 1308 | MDRV_VIDEO_UPDATE(tetrisp2) | |
| 1309 | ||
| 1310 | /* sound hardware */ | |
| 1311 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1312 | ||
| 1313 | MDRV_SOUND_ADD(OKIM6295, XTAL_2MHz) | |
| 1314 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) | |
| 1315 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 1316 | MACHINE_DRIVER_END | |
| 1317 | ||
| 1318 | ||
| 1067 | 1319 | static MACHINE_DRIVER_START( rockn ) |
| 1068 | 1320 | |
| 1069 | 1321 | /* basic machine hardware */ |
| r2418 | r2419 | |
| 1097 | 1349 | MACHINE_DRIVER_END |
| 1098 | 1350 | |
| 1099 | 1351 | |
| 1100 | ||
| 1101 | 1352 | static MACHINE_DRIVER_START( rockn2 ) |
| 1102 | 1353 | |
| 1103 | 1354 | /* basic machine hardware */ |
| r2418 | r2419 | |
| 1279 | 1530 | |
| 1280 | 1531 | /*************************************************************************** |
| 1281 | 1532 | |
| 1533 | Nandemo Seal Iinkai | |
| 1534 | (c)1996 I'max/Jaleco | |
| 1535 | ||
| 1536 | Mainboard: | |
| 1537 | NS-96205 9601 | |
| 1538 | EB-00-20110-0 | |
| 1539 | ||
| 1540 | Daughterboard: | |
| 1541 | NS-96206A | |
| 1542 | 96017 | |
| 1543 | EB-00-20111-1 | |
| 1544 | ||
| 1545 | ||
| 1546 | CPU: TMP68000P-12 | |
| 1547 | ||
| 1548 | Sound: M6295 (on daughterboard) | |
| 1549 | ||
| 1550 | OSC: 12.000MHz (X1) | |
| 1551 | 42.9545MHz(OSC1) | |
| 1552 | 2.000MHz(X1 on daughterboard. silk print says 4MHz) | |
| 1553 | ||
| 1554 | Custom chips: | |
| 1555 | GS91022-04 | |
| 1556 | GS91022-05 | |
| 1557 | SS91022-03 | |
| 1558 | SS91022-05 | |
| 1559 | ||
| 1560 | PLDs: | |
| 1561 | PS96017-01 (XILINX XC7336) | |
| 1562 | 96017-02 (18CV8P) | |
| 1563 | 96017-03 (18CV8P) | |
| 1564 | 96017-04 (18CV8P on daughterboard) | |
| 1565 | ||
| 1566 | Others: | |
| 1567 | CR2032 battery | |
| 1568 | Centronics printer port | |
| 1569 | ||
| 1570 | ROMs:(all ROMs are on daughterboard) | |
| 1571 | 1.1 - Programs (TMS 27C020) | |
| 1572 | 3.3 / | |
| 1573 | (actual label is "Cawaii 1 Ver1.1" & "Cawaii 3 Ver1.1") | |
| 1574 | ||
| 1575 | MR97006-01.2 (42pin mask ROM, read as 32M byte mode) | |
| 1576 | MR97006-02.5 (same as above) | |
| 1577 | MR97001-01.6 (same as above) | |
| 1578 | MR96017-04.9 (same as above, samples) | |
| 1579 | ||
| 1580 | MR97006-04.8 (32pin mask ROM, read as 534000) | |
| 1581 | ||
| 1582 | ||
| 1583 | dumped by sayu | |
| 1584 | --- Team Japump!!! --- | |
| 1585 | ||
| 1586 | ***************************************************************************/ | |
| 1587 | ||
| 1588 | ROM_START( nndmseal ) | |
| 1589 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) // 68000 Code | |
| 1590 | ROM_LOAD16_BYTE( "1.1", 0x00000, 0x40000, CRC(45acea25) SHA1(f2f2e78be261c3d8c0145a639bc3771f0588401d) ) // 1xxxxxxxxxxxxxxxxx = 0xFF | |
| 1591 | ROM_LOAD16_BYTE( "3.3", 0x00001, 0x40000, CRC(0754d96a) SHA1(1da44994e8bcfd8832755e298c0125b38cfdd16e) ) // 1xxxxxxxxxxxxxxxxx = 0xFF | |
| 1592 | ||
| 1593 | ROM_REGION( 0x100, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ | |
| 1594 | // unused | |
| 1595 | ||
| 1596 | ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) // 16x16x8 (Background) | |
| 1597 | ROM_LOAD( "mr97006-02.5", 0x000000, 0x200000, CRC(4793f84e) SHA1(05acba6cc8a527a6050af79a460b08c4676287aa) ) | |
| 1598 | ROM_LOAD( "mr97001-01.6", 0x200000, 0x200000, CRC(dd648e8a) SHA1(7036ab30d0ea179c59d74c1fbe4372968722ec0f) ) | |
| 1599 | ||
| 1600 | ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE ) // 16x16x8 (Rotation) | |
| 1601 | ROM_LOAD( "mr97006-01.2", 0x000000, 0x200000, CRC(32283485) SHA1(14ccd25389b97825d9a727809c3a1de803687c16) ) | |
| 1602 | ||
| 1603 | ROM_REGION( 0x100000, REGION_GFX4, ROMREGION_DISPOSE ) // 8x8x8 (Foreground) | |
| 1604 | ROM_LOAD( "mr97006-04.8", 0x000000, 0x100000, CRC(6726a25b) SHA1(4ea49c014477229eaf9de4a0b9bf83021b82c095) ) | |
| 1605 | ||
| 1606 | ROM_REGION( 0x40000, REGION_SOUND1, ROMREGION_ERASE ) // Samples | |
| 1607 | // filled in from REGION_SOUND2 | |
| 1608 | ||
| 1609 | ROM_REGION( 0x200000, REGION_SOUND2, 0 ) // Samples | |
| 1610 | ROM_LOAD( "mr96017-04.9", 0x000000, 0x200000, CRC(c2e7b444) SHA1(e2b9d3d94720d01beff1108ef3dfbff805ddd1fd) ) | |
| 1611 | ROM_END | |
| 1612 | ||
| 1613 | /*************************************************************************** | |
| 1614 | ||
| 1282 | 1615 | Rock'n Tread 1 (Japan) |
| 1283 | 1616 | Rock'n Tread 2 (Japan) |
| 1284 | 1617 | Rock'n MegaSession (Japan) |
| r2418 | r2419 | |
| 1645 | 1978 | |
| 1646 | 1979 | ***************************************************************************/ |
| 1647 | 1980 | |
| 1648 | GAME( 1997, tetrisp2, 0, tetrisp2, tetrisp2, 0, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World)", GAME_SUPPORTS_SAVE ) | |
| 1649 | GAME( 1997, teplus2j, tetrisp2, tetrisp2, teplus2j, 0, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1981 | GAME( 1997, tetrisp2, 0, tetrisp2, tetrisp2, 0, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World)", GAME_SUPPORTS_SAVE ) | |
| 1982 | GAME( 1997, teplus2j, tetrisp2, tetrisp2, teplus2j, 0, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1650 | 1983 | |
| 1651 | GAME( 1999, rockn, 0, rockn, rockn, rockn, ROT270, "Jaleco", "Rock'n Tread (Japan)", GAME_SUPPORTS_SAVE) | |
| 1652 | GAME( 1999, rockna, rockn, rockn, rockn, rockn1, ROT270, "Jaleco", "Rock'n Tread (Japan, alternate)", GAME_SUPPORTS_SAVE) | |
| 1653 | GAME( 1999, rockn2, 0, rockn2, rockn, rockn2, ROT270, "Jaleco", "Rock'n Tread 2 (Japan)", GAME_SUPPORTS_SAVE) | |
| 1654 | GAME( 1999, rocknms, 0, rocknms, rocknms, rocknms, ROT0, "Jaleco", "Rock'n MegaSession (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1655 | GAME( 1999, rockn3, 0, rockn2, rockn, rockn3, ROT270, "Jaleco", "Rock'n 3 (Japan)", GAME_SUPPORTS_SAVE) | |
| 1656 | GAME( 2000, rockn4, 0, rockn2, rockn, rockn3, ROT270, "Jaleco (PCCWJ)", "Rock'n 4 (Japan, prototype)", GAME_SUPPORTS_SAVE) | |
| 1984 | GAME( 1997, nndmseal, 0, nndmseal, nndmseal, rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max/Jaleco", "Nandemo Seal Iinkai", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) | |
| 1985 | ||
| 1986 | GAME( 1999, rockn, 0, rockn, rockn, rockn, ROT270, "Jaleco", "Rock'n Tread (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1987 | GAME( 1999, rockna, rockn, rockn, rockn, rockn1, ROT270, "Jaleco", "Rock'n Tread (Japan, alternate)", GAME_SUPPORTS_SAVE ) | |
| 1988 | GAME( 1999, rockn2, 0, rockn2, rockn, rockn2, ROT270, "Jaleco", "Rock'n Tread 2 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1989 | GAME( 1999, rocknms, 0, rocknms, rocknms, rocknms, ROT0, "Jaleco", "Rock'n MegaSession (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) | |
| 1990 | GAME( 1999, rockn3, 0, rockn2, rockn, rockn3, ROT270, "Jaleco", "Rock'n 3 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1991 | GAME( 2000, rockn4, 0, rockn2, rockn, rockn3, ROT270, "Jaleco (PCCWJ)", "Rock'n 4 (Japan, prototype)", GAME_SUPPORTS_SAVE ) |
| r2418 | r2419 | |
|---|---|---|
| 28 | 28 | WRITE16_HANDLER( madgear_scroll1_w ); |
| 29 | 29 | WRITE16_HANDLER( madgear_scroll2_w ); |
| 30 | 30 | WRITE16_HANDLER( lastduel_scroll_w ); |
| 31 | WRITE16_HANDLER( lastduel_palette_word_w ); | |
| 31 | 32 | VIDEO_START( lastduel ); |
| 32 | 33 | VIDEO_START( madgear ); |
| 33 | 34 | VIDEO_UPDATE( lastduel ); |
| 35 | VIDEO_UPDATE( madgear ); | |
| 34 | 36 | VIDEO_EOF( lastduel ); |
| 35 | 37 | |
| 36 | 38 | extern UINT16 *lastduel_vram,*lastduel_scroll2,*lastduel_scroll1; |
| r2418 | r2419 | |
| 65 | 67 | AM_RANGE(0xfc0800, 0xfc0fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 66 | 68 | AM_RANGE(0xfc4000, 0xfc4001) AM_WRITE(lastduel_flip_w) |
| 67 | 69 | AM_RANGE(0xfc4002, 0xfc4003) AM_WRITE(lastduel_sound_w) |
| 68 | AM_RANGE(0xfc8000, 0xfc800 | |
| 70 | AM_RANGE(0xfc8000, 0xfc800f) AM_WRITE(lastduel_scroll_w) | |
| 69 | 71 | AM_RANGE(0xfcc000, 0xfcdfff) AM_WRITE(lastduel_vram_w) AM_BASE(&lastduel_vram) |
| 70 | 72 | AM_RANGE(0xfd0000, 0xfd3fff) AM_WRITE(lastduel_scroll1_w) AM_BASE(&lastduel_scroll1) |
| 71 | 73 | AM_RANGE(0xfd4000, 0xfd7fff) AM_WRITE(lastduel_scroll2_w) AM_BASE(&lastduel_scroll2) |
| 72 | AM_RANGE(0xfd8000, 0xfd87ff) AM_WRITE(palette | |
| 74 | AM_RANGE(0xfd8000, 0xfd87ff) AM_WRITE(lastduel_palette | |
| 73 | 75 | AM_RANGE(0xfe0000, 0xffffff) AM_WRITE(SMH_RAM) |
| 74 | 76 | ADDRESS_MAP_END |
| 75 | 77 | |
| r2418 | r2419 | |
| 93 | 95 | AM_RANGE(0xfc4000, 0xfc4001) AM_WRITE(lastduel_flip_w) |
| 94 | 96 | AM_RANGE(0xfc4002, 0xfc4003) AM_WRITE(lastduel_sound_w) |
| 95 | 97 | AM_RANGE(0xfc8000, 0xfc9fff) AM_WRITE(lastduel_vram_w) AM_BASE(&lastduel_vram) |
| 96 | AM_RANGE(0xfcc000, 0xfcc7ff) AM_WRITE(paletteram16_RRRRGGGGBBBBIIII_word_w) AM_BASE(&paletteram16) | |
| 97 | AM_RANGE(0xfd0000, 0xfd0007) AM_WRITE(lastduel_scroll_w) | |
| 98 | AM_RANGE(0xfcc000, 0xfcc7ff) AM_WRITE(lastduel_palette_word_w) AM_BASE(&paletteram16) | |
| 99 | AM_RANGE(0xfd0000, 0xfd000f) AM_WRITE(lastduel_scroll_w) | |
| 98 | 100 | AM_RANGE(0xfd4000, 0xfd7fff) AM_WRITE(madgear_scroll1_w) AM_BASE(&lastduel_scroll1) |
| 99 | 101 | AM_RANGE(0xfd8000, 0xfdffff) AM_WRITE(madgear_scroll2_w) AM_BASE(&lastduel_scroll2) |
| 100 | 102 | AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SMH_RAM) |
| r2418 | r2419 | |
| 322 | 324 | |
| 323 | 325 | MDRV_VIDEO_START(madgear) |
| 324 | 326 | MDRV_VIDEO_EOF(lastduel) |
| 325 | MDRV_VIDEO_UPDATE( | |
| 327 | MDRV_VIDEO_UPDATE(ma | |
| 326 | 328 | |
| 327 | 329 | /* sound hardware */ |
| 328 | 330 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r2418 | r2419 | |
| 803 | 805 | ROM_LOAD( "63s141.14k", 0x0000, 0x0100, CRC(7f862e1e) SHA1(7134c4f741463007a177d55922e1284d132f60e3) ) /* priority (not used) */ |
| 804 | 806 | ROM_END |
| 805 | 807 | |
| 808 | ROM_START( ledstrm2 ) | |
| 809 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 256K for 68000 code */ | |
| 810 | ROM_LOAD16_BYTE( "lsu-04.bin", 0x00000, 0x20000, CRC(56a2f079) SHA1(da581c117d92ac5c1e8e44324f1aed2858a3cdc8) ) | |
| 811 | ROM_LOAD16_BYTE( "lsu-03.bin", 0x00001, 0x20000, CRC(9b6408c0) SHA1(8ef8349f58c62a2d626b1053eae2032d168d602c) ) | |
| 812 | ROM_LOAD16_BYTE( "ls-02.bin", 0x40000, 0x20000, CRC(05c0285e) SHA1(b155d2d0c41f614bd324813c5d3d87a6765ad812) ) | |
| 813 | ROM_LOAD16_BYTE( "ls-01.bin", 0x40001, 0x20000, CRC(8bf934dd) SHA1(f2287a4361af4986eb010dfbfb6de3a3d4124937) ) | |
| 814 | ||
| 815 | ROM_REGION( 0x18000 , REGION_CPU2, 0 ) /* audio CPU */ | |
| 816 | ROM_LOAD( "ls-07.bin", 0x00000, 0x08000, CRC(98af7838) SHA1(a0b87b9ce3c1b0e5d7696ffaab9cea483b9ee928) ) | |
| 817 | ROM_CONTINUE( 0x10000, 0x08000 ) | |
| 818 | ||
| 819 | ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE ) // Sprite roms not dumped from this revision of the game | |
| 820 | ROM_LOAD( "mg_m11.rom", 0x000000, 0x10000, BAD_DUMP CRC(ee319a64) SHA1(ce8d65fdac3ec1009b22764807c03dd96b340660) ) /* Interleaved sprites */ | |
| 821 | ROM_LOAD( "07", 0x010000, 0x10000, BAD_DUMP CRC(7152b212) SHA1(b021496e8b3c22c018907e6e374a7401d3843570) ) | |
| 822 | ROM_LOAD( "mg_m12.rom", 0x020000, 0x10000, BAD_DUMP CRC(887ef120) SHA1(9d57b497334d64df9a4ab7f15824dcc6a333f73d) ) | |
| 823 | ROM_LOAD( "08", 0x030000, 0x10000, BAD_DUMP CRC(72e5d525) SHA1(209def4206e9b66be9879f0105d3f04980f156da) ) | |
| 824 | ROM_LOAD( "mg_m13.rom", 0x040000, 0x10000, BAD_DUMP CRC(eae07db4) SHA1(59c4ff48d906b2bb101fbebe06383940fdff064f) ) | |
| 825 | ROM_LOAD( "09", 0x050000, 0x10000, BAD_DUMP CRC(7b5175cb) SHA1(8d8d4953dd787308bed75345af6789899d2afded) ) | |
| 826 | ROM_LOAD( "mg_m14.rom", 0x060000, 0x10000, BAD_DUMP CRC(21e5424c) SHA1(2f7c5d974c847bb14eaf278545bca653919110ba) ) | |
| 827 | ROM_LOAD( "10", 0x070000, 0x10000, BAD_DUMP CRC(6db7ca64) SHA1(389cc93b9bfe2824a0de9796e79c6d452d09567e) ) | |
| 828 | ||
| 829 | ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 830 | ROM_LOAD( "ls-08.bin", 0x000000, 0x08000, CRC(8803cf49) SHA1(7a01a05f760d8e2472fdbc1d10b53094babe295e) ) /* 8x8 text */ | |
| 831 | ||
| 832 | ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 833 | ROM_LOAD( "ls-12", 0x000000, 0x40000, BAD_DUMP CRC(6c1b2c6c) SHA1(18f22129f13c6bfa7e285f0e09a35644272f6ecb) ) | |
| 834 | ||
| 835 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) | |
| 836 | ROM_LOAD( "ls-11", 0x000000, 0x80000, BAD_DUMP CRC(6bf81c64) SHA1(2289978c6bdb6e4f86e7094e861df147e757e249) ) | |
| 837 | ||
| 838 | ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* ADPCM */ | |
| 839 | ROM_LOAD( "ls-06", 0x00000, 0x20000, CRC(88d39a5b) SHA1(8fb2d1d26e2ffb93dfc9cf8f23bb81eb64496c2b) ) | |
| 840 | ROM_LOAD( "ls-05", 0x20000, 0x20000, CRC(b06e03b5) SHA1(7d17e5cfb57866c60146bea1a4535e961c73327c) ) | |
| 841 | ||
| 842 | ROM_REGION( 0x0100, REGION_PROMS, 0 ) | |
| 843 | ROM_LOAD( "63s141.14k", 0x0000, 0x0100, CRC(7f862e1e) SHA1(7134c4f741463007a177d55922e1284d132f60e3) ) /* priority (not used) */ | |
| 844 | ROM_END | |
| 845 | ||
| 806 | 846 | /******************************************************************************/ |
| 807 | 847 | |
| 808 | 848 | GAME( 1988, lastduel, 0, lastduel, lastduel, 0, ROT270, "Capcom", "Last Duel (US set 1)", 0 ) |
| r2418 | r2419 | |
| 811 | 851 | GAME( 1989, madgear, 0, madgear, madgear, 0, ROT270, "Capcom", "Mad Gear (US)", 0 ) |
| 812 | 852 | GAME( 1989, madgearj, madgear, madgear, madgear, 0, ROT270, "Capcom", "Mad Gear (Japan)", 0 ) |
| 813 | 853 | GAME( 1988, ledstorm, madgear, madgear, madgear, 0, ROT270, "Capcom", "Led Storm (US)", 0 ) |
| 854 | GAME( 1988, ledstrm2, madgear, madgear, madgear, 0, ROT270, "Capcom", "Led Storm Rally 2011 (US)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 719 | 719 | AM_RANGE(0x0d8000, 0x0d8001) AM_READ(SMH_NOP) /* IRQ ack? */ |
| 720 | 720 | AM_RANGE(0x0e0000, 0x0e0001) AM_READ(SMH_NOP) /* IRQ ack? */ |
| 721 | 721 | AM_RANGE(0x0e8000, 0x0e8001) AM_READ(SMH_NOP) /* watchdog? */ |
| 722 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 722 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 723 | 723 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&spriteram16) |
| 724 | 724 | AM_RANGE(0x300000, 0x3001ff) AM_READWRITE(alpha_II_trigger_r, alpha_microcontroller_w) |
| 725 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 725 | AM_RANGE(0x400000, 0x400fff) AM_R | |
| 726 | 726 | AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK(8) |
| 727 | 727 | ADDRESS_MAP_END |
| 728 | 728 | |
| r2418 | r2419 | |
| 735 | 735 | AM_RANGE(0x0d8000, 0x0d8001) AM_READNOP /* IRQ ack? */ |
| 736 | 736 | AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* IRQ ack? */ |
| 737 | 737 | AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* watchdog? */ |
| 738 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 738 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 739 | 739 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&spriteram16) |
| 740 | 740 | AM_RANGE(0x300000, 0x303fff) AM_READ(alpha_V_trigger_r) |
| 741 | 741 | AM_RANGE(0x300000, 0x3001ff) AM_WRITE(alpha_microcontroller_w) |
| 742 | 742 | AM_RANGE(0x303e00, 0x303fff) AM_WRITE(alpha_microcontroller_w) /* Gang Wars mirror */ |
| 743 | AM_RANGE(0x400000, 0x401fff) AM_R | |
| 743 | AM_RANGE(0x400000, 0x401fff) AM_R | |
| 744 | 744 | AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK(8) |
| 745 | 745 | ADDRESS_MAP_END |
| 746 | 746 | |
| r2418 | r2419 | |
| 3167 | 3167 | |
| 3168 | 3168 | alpha68k_video_banking = jongbou_video_banking; |
| 3169 | 3169 | |
| 3170 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r); | |
| 3170 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r); | |
| 3171 | 3171 | } |
| 3172 | 3172 | |
| 3173 | 3173 | static DRIVER_INIT( paddlema ) |
| r2418 | r2419 | |
| 3178 | 3178 | |
| 3179 | 3179 | static DRIVER_INIT( timesold ) |
| 3180 | 3180 | { |
| 3181 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesold_cycle_r); | |
| 3181 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesold_cycle_r); | |
| 3182 | 3182 | invert_controls=0; |
| 3183 | 3183 | microcontroller_id=0; |
| 3184 | 3184 | coin_id=0x22|(0x22<<8); |
| r2418 | r2419 | |
| 3186 | 3186 | |
| 3187 | 3187 | static DRIVER_INIT( timesol1 ) |
| 3188 | 3188 | { |
| 3189 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesol1_cycle_r); | |
| 3189 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesol1_cycle_r); | |
| 3190 | 3190 | invert_controls=1; |
| 3191 | 3191 | microcontroller_id=0; |
| 3192 | 3192 | coin_id=0x22|(0x22<<8); |
| r2418 | r2419 | |
| 3194 | 3194 | |
| 3195 | 3195 | static DRIVER_INIT( btlfield ) |
| 3196 | 3196 | { |
| 3197 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, btlfield_cycle_r); | |
| 3197 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, btlfield_cycle_r); | |
| 3198 | 3198 | invert_controls=1; |
| 3199 | 3199 | microcontroller_id=0; |
| 3200 | 3200 | coin_id=0x22|(0x22<<8); |
| r2418 | r2419 | |
| 3209 | 3209 | |
| 3210 | 3210 | static DRIVER_INIT( skysoldr ) |
| 3211 | 3211 | { |
| 3212 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skysoldr_cycle_r); | |
| 3212 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skysoldr_cycle_r); | |
| 3213 | 3213 | memory_set_bankptr(8, (memory_region(REGION_USER1))+0x40000); |
| 3214 | 3214 | invert_controls=0; |
| 3215 | 3215 | microcontroller_id=0; |
| r2418 | r2419 | |
| 3233 | 3233 | |
| 3234 | 3234 | static DRIVER_INIT( skyadvnt ) |
| 3235 | 3235 | { |
| 3236 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r); | |
| 3236 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r); | |
| 3237 | 3237 | invert_controls=0; |
| 3238 | 3238 | microcontroller_id=0x8814; |
| 3239 | 3239 | coin_id=0x22|(0x22<<8); |
| r2418 | r2419 | |
| 3241 | 3241 | |
| 3242 | 3242 | static DRIVER_INIT( skyadvnu ) |
| 3243 | 3243 | { |
| 3244 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r); | |
| 3244 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r); | |
| 3245 | 3245 | invert_controls=0; |
| 3246 | 3246 | microcontroller_id=0x8814; |
| 3247 | 3247 | coin_id=0x23|(0x24<<8); |
| r2418 | r2419 | |
| 3249 | 3249 | |
| 3250 | 3250 | static DRIVER_INIT( gangwars ) |
| 3251 | 3251 | { |
| 3252 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwars_cycle_r); | |
| 3252 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwars_cycle_r); | |
| 3253 | 3253 | memory_set_bankptr(8, memory_region(REGION_USER1)); |
| 3254 | 3254 | invert_controls=0; |
| 3255 | 3255 | microcontroller_id=0x8512; |
| r2418 | r2419 | |
| 3258 | 3258 | |
| 3259 | 3259 | static DRIVER_INIT( gangwarb ) |
| 3260 | 3260 | { |
| 3261 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwarb_cycle_r); | |
| 3261 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwarb_cycle_r); | |
| 3262 | 3262 | memory_set_bankptr(8, memory_region(REGION_USER1)); |
| 3263 | 3263 | invert_controls=0; |
| 3264 | 3264 | microcontroller_id=0x8512; |
| r2418 | r2419 | |
|---|---|---|
| 186 | 186 | AM_RANGE(0x800180, 0x800181) AM_WRITE(drgnmst_snd_command_w) |
| 187 | 187 | AM_RANGE(0x800188, 0x800189) AM_WRITE(drgnmst_snd_flag_w) |
| 188 | 188 | AM_RANGE(0x8001e0, 0x8001e1) AM_WRITENOP |
| 189 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 190 | AM_RANGE(0x904000, 0x907fff) AM_READWRITE(SMH_RAM, drgnmst_md_videoram_w) AM_BASE(&drgnmst_md_videoram) | |
| 191 | AM_RANGE(0x908000, 0x90bfff) AM_READWRITE(SMH_RAM, drgnmst_bg_videoram_w) AM_BASE(&drgnmst_bg_videoram) | |
| 192 | AM_RANGE(0x90c000, 0x90ffff) AM_READWRITE(SMH_RAM, drgnmst_fg_videoram_w) AM_BASE(&drgnmst_fg_videoram) | |
| 189 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 190 | AM_RANGE(0x904000, 0x907fff) AM_RAM_WRITE(drgnmst_md_videoram_w) AM_BASE(&drgnmst_md_videoram) | |
| 191 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(drgnmst_bg_videoram_w) AM_BASE(&drgnmst_bg_videoram) | |
| 192 | AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(drgnmst_fg_videoram_w) AM_BASE(&drgnmst_fg_videoram) | |
| 193 | 193 | AM_RANGE(0x920000, 0x923fff) AM_RAM AM_BASE(&drgnmst_rowscrollram) // rowscroll ram |
| 194 | 194 | AM_RANGE(0x930000, 0x9307ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites |
| 195 | 195 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 98 | 98 | static ADDRESS_MAP_START( lucky8_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 99 | 99 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 100 | 100 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 101 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 101 | AM_RANGE(0x8800, 0x8fff) AM_RAM | |
| 102 | 102 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(lucky8_colorram_w) AM_BASE(&colorram) |
| 103 | 103 | AM_RANGE(0x9800, 0x99ff) AM_RAM |
| 104 | 104 | AM_RANGE(0xa000, 0xa1ff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 153 | 153 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 154 | 154 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 155 | 155 | AM_RANGE(0x8000, 0x9fff) AM_READWRITE(starfire_scratch_r, starfire_scratch_w) |
| 156 | AM_RANGE(0xa000, 0xbfff) AM_R | |
| 156 | AM_RANGE(0xa000, 0xbfff) AM_R | |
| 157 | 157 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(starfire_videoram_r, starfire_videoram_w) AM_BASE(&starfire_videoram) |
| 158 | 158 | ADDRESS_MAP_END |
| 159 | 159 |
| r2418 | r2419 | |
|---|---|---|
| 987 | 987 | /*************************************************************************** |
| 988 | 988 | |
| 989 | 989 | Touchmaster 7000 |
| 990 | by Midway (c) 199 | |
| 990 | by Midway (c) 1999 | |
| 991 | 991 | touchscreen game |
| 992 | 992 | |
| 993 | 993 | All chips are ST M27C801 |
| r2418 | r2419 | |
|---|---|---|
| 2690 | 2690 | |
| 2691 | 2691 | static DRIVER_INIT( wildplt ) |
| 2692 | 2692 | { |
| 2693 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r ); | |
| 2693 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r ); | |
| 2694 | 2694 | |
| 2695 | 2695 | DRIVER_INIT_CALL(f1gpstar); |
| 2696 | 2696 | } |
| r2418 | r2419 | |
|---|---|---|
| 4233 | 4233 | return su_82; |
| 4234 | 4234 | } |
| 4235 | 4235 | |
| 4236 | static void install_c74_speedup( | |
| 4236 | static void install_c74_speedup(running_machine *machine) | |
| 4237 | 4237 | { |
| 4238 | memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcuc74_speedup_r); | |
| 4239 | memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcu_speedup_w); | |
| 4238 | memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcuc74_speedup_r, mcu_speedup_w); | |
| 4240 | 4239 | } |
| 4241 | 4240 | |
| 4242 | static void install_130_speedup( | |
| 4241 | static void install_130_speedup(running_machine *machine) | |
| 4243 | 4242 | { |
| 4244 | 4243 | // install speedup cheat for 1.30 MCU BIOS |
| 4245 | memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu130_speedup_r); | |
| 4246 | memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu_speedup_w); | |
| 4244 | memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu130_speedup_r, mcu_speedup_w); | |
| 4247 | 4245 | } |
| 4248 | 4246 | |
| 4249 | static void install_141_speedup( | |
| 4247 | static void install_141_speedup(running_machine *machine) | |
| 4250 | 4248 | { |
| 4251 | 4249 | // install speedup cheat for 1.41 MCU BIOS |
| 4252 | memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu141_speedup_r); | |
| 4253 | memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu_speedup_w); | |
| 4250 | memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu141_speedup_r, mcu_speedup_w); | |
| 4254 | 4251 | } |
| 4255 | 4252 | |
| 4256 | 4253 | static void namcos22_init( enum namcos22_gametype game_type ) |
| r2418 | r2419 | |
| 4269 | 4266 | { |
| 4270 | 4267 | namcos22s_init(NAMCOS22_ALPINE_RACER); |
| 4271 | 4268 | |
| 4272 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4269 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4273 | 4270 | |
| 4274 | install_130_speedup(); | |
| 4271 | install_130_speedup(machine); | |
| 4275 | 4272 | } |
| 4276 | 4273 | |
| 4277 | 4274 | static DRIVER_INIT( alpiner2 ) |
| 4278 | 4275 | { |
| 4279 | 4276 | namcos22s_init(NAMCOS22_ALPINE_RACER_2); |
| 4280 | 4277 | |
| 4281 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4278 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4282 | 4279 | |
| 4283 | install_130_speedup(); | |
| 4280 | install_130_speedup(machine); | |
| 4284 | 4281 | } |
| 4285 | 4282 | |
| 4286 | 4283 | static DRIVER_INIT( alpinesa ) |
| 4287 | 4284 | { |
| 4288 | 4285 | namcos22s_init(NAMCOS22_ALPINE_SURFER); |
| 4289 | 4286 | |
| 4290 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4287 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r); | |
| 4291 | 4288 | |
| 4292 | install_141_speedup(); | |
| 4289 | install_141_speedup(machine); | |
| 4293 | 4290 | } |
| 4294 | 4291 | |
| 4295 | 4292 | static DRIVER_INIT( airco22 ) |
| 4296 | 4293 | { |
| 4297 | 4294 | namcos22s_init(NAMCOS22_AIR_COMBAT22); |
| 4298 | 4295 | |
| 4299 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, airco22_mcu_adc_r); | |
| 4296 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, airco22_mcu_adc_r); | |
| 4300 | 4297 | } |
| 4301 | 4298 | |
| 4302 | 4299 | static DRIVER_INIT( propcycl ) |
| r2418 | r2419 | |
| 4320 | 4317 | |
| 4321 | 4318 | namcos22s_init(NAMCOS22_PROP_CYCLE); |
| 4322 | 4319 | |
| 4323 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, propcycle_mcu_adc_r); | |
| 4320 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, propcycle_mcu_adc_r); | |
| 4324 | 4321 | |
| 4325 | install_141_speedup(); | |
| 4322 | install_141_speedup(machine); | |
| 4326 | 4323 | } |
| 4327 | 4324 | |
| 4328 | 4325 | static DRIVER_INIT( ridgeraj ) |
| 4329 | 4326 | { |
| 4330 | 4327 | namcos22_init(NAMCOS22_RIDGE_RACER); |
| 4331 | 4328 | |
| 4332 | install_c74_speedup(); | |
| 4329 | install_c74_speedup(machine); | |
| 4333 | 4330 | |
| 4334 | 4331 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4335 | 4332 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4339 | 4336 | { |
| 4340 | 4337 | namcos22_init(NAMCOS22_RIDGE_RACER2); |
| 4341 | 4338 | |
| 4342 | install_c74_speedup(); | |
| 4339 | install_c74_speedup(machine); | |
| 4343 | 4340 | |
| 4344 | 4341 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4345 | 4342 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4349 | 4346 | { |
| 4350 | 4347 | namcos22_init(NAMCOS22_ACE_DRIVER); |
| 4351 | 4348 | |
| 4352 | install_c74_speedup(); | |
| 4349 | install_c74_speedup(machine); | |
| 4353 | 4350 | |
| 4354 | 4351 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4355 | 4352 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4359 | 4356 | { |
| 4360 | 4357 | namcos22_init(NAMCOS22_VICTORY_LAP); |
| 4361 | 4358 | |
| 4362 | install_c74_speedup(); | |
| 4359 | install_c74_speedup(machine); | |
| 4363 | 4360 | |
| 4364 | 4361 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4365 | 4362 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4369 | 4366 | { |
| 4370 | 4367 | namcos22_init(NAMCOS22_RAVE_RACER); |
| 4371 | 4368 | |
| 4372 | install_c74_speedup(); | |
| 4369 | install_c74_speedup(machine); | |
| 4373 | 4370 | |
| 4374 | 4371 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4375 | 4372 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4386 | 4383 | |
| 4387 | 4384 | namcos22_init(NAMCOS22_CYBER_COMMANDO); |
| 4388 | 4385 | |
| 4389 | install_c74_speedup(); | |
| 4386 | install_c74_speedup(machine); | |
| 4390 | 4387 | |
| 4391 | 4388 | old_coin_state = input_port_read_indexed(machine, 1) & 0x1200; |
| 4392 | 4389 | credits1 = credits2 = 0; |
| r2418 | r2419 | |
| 4401 | 4398 | |
| 4402 | 4399 | namcos22s_init(NAMCOS22_CYBER_CYCLES); |
| 4403 | 4400 | |
| 4404 | memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, cybrcycc_mcu_adc_r); | |
| 4401 | memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, cybrcycc_mcu_adc_r); | |
| 4405 | 4402 | |
| 4406 | install_130_speedup(); | |
| 4403 | install_130_speedup(machine); | |
| 4407 | 4404 | } |
| 4408 | 4405 | |
| 4409 | 4406 | static DRIVER_INIT( timecris ) |
| 4410 | 4407 | { |
| 4411 | 4408 | namcos22s_init(NAMCOS22_TIME_CRISIS); |
| 4412 | 4409 | |
| 4413 | install_130_speedup(); | |
| 4410 | install_130_speedup(machine); | |
| 4414 | 4411 | } |
| 4415 | 4412 | |
| 4416 | 4413 | /************************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 286 | 286 | |
| 287 | 287 | static ADDRESS_MAP_START( depthch_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 288 | 288 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM |
| 289 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 289 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 290 | 290 | AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM |
| 291 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 291 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 292 | 292 | ADDRESS_MAP_END |
| 293 | 293 | |
| 294 | 294 | |
| r2418 | r2419 | |
| 370 | 370 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 371 | 371 | AM_RANGE(0x4000, 0x7fff) AM_NOP /* unused */ |
| 372 | 372 | AM_RANGE(0x8000, 0x8fff) AM_MIRROR(0x3000) AM_RAM |
| 373 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 373 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 374 | 374 | AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 375 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 375 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 376 | 376 | ADDRESS_MAP_END |
| 377 | 377 | |
| 378 | 378 | |
| r2418 | r2419 | |
| 452 | 452 | |
| 453 | 453 | static ADDRESS_MAP_START( frogs_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 454 | 454 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM |
| 455 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 455 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 456 | 456 | AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM |
| 457 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 457 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 458 | 458 | ADDRESS_MAP_END |
| 459 | 459 | |
| 460 | 460 | |
| r2418 | r2419 | |
| 574 | 574 | static ADDRESS_MAP_START( headon_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 575 | 575 | AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM |
| 576 | 576 | AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */ |
| 577 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 577 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 578 | 578 | AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 579 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 579 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 580 | 580 | ADDRESS_MAP_END |
| 581 | 581 | |
| 582 | 582 | |
| r2418 | r2419 | |
| 784 | 784 | static ADDRESS_MAP_START( headon2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 785 | 785 | AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM |
| 786 | 786 | /* AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x3f00) */ /* schematics show this as battery backed RAM, but doesn't appear to be used */ |
| 787 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 787 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 788 | 788 | AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 789 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 789 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 790 | 790 | ADDRESS_MAP_END |
| 791 | 791 | |
| 792 | 792 | |
| r2418 | r2419 | |
| 1055 | 1055 | |
| 1056 | 1056 | static ADDRESS_MAP_START( vicdual_dualgame_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1057 | 1057 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM |
| 1058 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 1058 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 1059 | 1059 | AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM |
| 1060 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 1060 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 1061 | 1061 | ADDRESS_MAP_END |
| 1062 | 1062 | |
| 1063 | 1063 | |
| r2418 | r2419 | |
| 1998 | 1998 | /* dual game hardware */ |
| 1999 | 1999 | static ADDRESS_MAP_START( samurai_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 2000 | 2000 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_READWRITE(SMH_ROM, samurai_protection_w) |
| 2001 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 2001 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_R | |
| 2002 | 2002 | AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM |
| 2003 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 2003 | AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_R | |
| 2004 | 2004 | ADDRESS_MAP_END |
| 2005 | 2005 | |
| 2006 | 2006 | |
| r2418 | r2419 | |
| 2116 | 2116 | static ADDRESS_MAP_START( nsub_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 2117 | 2117 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM |
| 2118 | 2118 | AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */ |
| 2119 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 2119 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 2120 | 2120 | AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 2121 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 2121 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 2122 | 2122 | ADDRESS_MAP_END |
| 2123 | 2123 | |
| 2124 | 2124 | |
| r2418 | r2419 | |
| 2212 | 2212 | static ADDRESS_MAP_START( invinco_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 2213 | 2213 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM |
| 2214 | 2214 | AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */ |
| 2215 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 2215 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_R | |
| 2216 | 2216 | AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 2217 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 2217 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_R | |
| 2218 | 2218 | ADDRESS_MAP_END |
| 2219 | 2219 | |
| 2220 | 2220 |
| r2418 | r2419 | |
|---|---|---|
| 87 | 87 | AM_RANGE(0x000000, 0x007fff) AM_MIRROR(0x7c0000) AM_ROM |
| 88 | 88 | AM_RANGE(0x008000, 0x00ffff) AM_MIRROR(0x7c0000) AM_ROM /* slapstic maps here */ |
| 89 | 89 | AM_RANGE(0x010000, 0x03ffff) AM_MIRROR(0x7c0000) AM_ROM |
| 90 | AM_RANGE(0xff8000, 0xff8fff) AM_MIRROR(0x7f8000) AM_R | |
| 90 | AM_RANGE(0xff8000, 0xff8fff) AM_MIRROR(0x7f8000) AM_R | |
| 91 | 91 | AM_RANGE(0xff9000, 0xffadff) AM_MIRROR(0x7f8000) AM_RAM |
| 92 | AM_RANGE(0xffae00, 0xffafff) AM_MIRROR(0x7f8000) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 93 | AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 94 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_READWRITE(SMH_RAM, paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 92 | AM_RANGE(0xffae00, 0xffafff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 93 | AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 94 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 95 | 95 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 96 | 96 | AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ(atarigen_sound_r) |
| 97 | 97 | AM_RANGE(0xffe100, 0xffe1ff) AM_MIRROR(0x7f8000) AM_READ(input_port_0_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 68 | 68 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 69 | 69 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 70 | 70 | AM_RANGE(0xe800, 0xe87f) AM_RAM |
| 71 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 71 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 72 | 72 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 73 | 73 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 74 | 74 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&shared) |
| r2418 | r2419 | |
|---|---|---|
| 366 | 366 | |
| 367 | 367 | static ADDRESS_MAP_START( sasuke_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 368 | 368 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 369 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 370 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 371 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 372 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 369 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 370 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 371 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 372 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 373 | 373 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 374 | 374 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 375 | 375 | AM_RANGE(0x4000, 0x8fff) AM_ROM |
| r2418 | r2419 | |
| 385 | 385 | |
| 386 | 386 | static ADDRESS_MAP_START( satansat_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 387 | 387 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 388 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 389 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 390 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 391 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 388 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 389 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 390 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 391 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 392 | 392 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 393 | 393 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 394 | 394 | AM_RANGE(0x4000, 0x97ff) AM_ROM |
| r2418 | r2419 | |
| 404 | 404 | |
| 405 | 405 | static ADDRESS_MAP_START( vanguard_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 406 | 406 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 407 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 408 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 409 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 410 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 407 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 408 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 409 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 410 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 411 | 411 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 412 | 412 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 413 | 413 | AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w) |
| r2418 | r2419 | |
| 425 | 425 | |
| 426 | 426 | static ADDRESS_MAP_START( fantasy_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 427 | 427 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 428 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 429 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 430 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 431 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 428 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 429 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 430 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 431 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 432 | 432 | AM_RANGE(0x2000, 0x2000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 433 | 433 | AM_RANGE(0x2001, 0x2001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 434 | 434 | AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w) |
| r2418 | r2419 | |
| 445 | 445 | |
| 446 | 446 | static ADDRESS_MAP_START( pballoon_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 447 | 447 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 448 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 449 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 450 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 451 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 448 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(rockola_videoram2_w) AM_BASE(&rockola_videoram2) | |
| 449 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(rockola_videoram_w) AM_BASE(&videoram) | |
| 450 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(rockola_colorram_w) AM_BASE(&colorram) | |
| 451 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) | |
| 452 | 452 | AM_RANGE(0x3000, 0x9fff) AM_ROM |
| 453 | 453 | AM_RANGE(0xb000, 0xb000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 454 | 454 | AM_RANGE(0xb001, 0xb001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| r2418 | r2419 | |
|---|---|---|
| 467 | 467 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* MK48Z02B NVRAM */ |
| 468 | 468 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 469 | 469 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 470 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(magicfly_videoram_w) AM_BASE(&videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ | |
| 471 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(magicfly_colorram_w) AM_BASE(&colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ | |
| 470 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(magicfly_videoram_w) AM_BASE(&videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ | |
| 471 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(magicfly_colorram_w) AM_BASE(&colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ | |
| 472 | 472 | AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r) /* multiplexed input port */ |
| 473 | 473 | AM_RANGE(0x3000, 0x3000) AM_WRITE(mux_w) /* input selector */ |
| 474 | 474 | AM_RANGE(0xc000, 0xffff) AM_ROM /* ROM space */ |
| r2418 | r2419 | |
|---|---|---|
| 747 | 747 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 748 | 748 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 749 | 749 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(SMH_NOP) // not used |
| 750 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 750 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 751 | 751 | AM_RANGE(0x9400, 0x97ff) AM_WRITE(SMH_NOP) // not used |
| 752 | AM_RANGE(0x9800, 0x983f) AM_R | |
| 752 | AM_RANGE(0x9800, 0x983f) AM_R | |
| 753 | 753 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 754 | 754 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size) |
| 755 | 755 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| r2418 | r2419 | |
| 772 | 772 | |
| 773 | 773 | static ADDRESS_MAP_START( hunchbkg, ADDRESS_SPACE_PROGRAM, 8 ) |
| 774 | 774 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 775 | AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_R | |
| 775 | AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_R | |
| 776 | 776 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 777 | 777 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r) |
| 778 | 778 | AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w) |
| r2418 | r2419 | |
| 835 | 835 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 836 | 836 | AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r) /* mirror */ |
| 837 | 837 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 838 | AM_RANGE(0x8800, 0x883f) AM_R | |
| 838 | AM_RANGE(0x8800, 0x883f) AM_R | |
| 839 | 839 | AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 840 | 840 | AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size) |
| 841 | 841 | AM_RANGE(0x8880, 0x8bff) AM_WRITENOP |
| 842 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 842 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 843 | 843 | AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r) |
| 844 | 844 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 845 | 845 | AM_RANGE(0xa7ff, 0xa7ff) AM_READ(input_port_0_r) /* mirror */ |
| r2418 | r2419 | |
| 857 | 857 | |
| 858 | 858 | static ADDRESS_MAP_START( racknrol, ADDRESS_SPACE_PROGRAM, 8 ) |
| 859 | 859 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 860 | AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_R | |
| 860 | AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_R | |
| 861 | 861 | AM_RANGE(0x1440, 0x14bf) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| 862 | 862 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_RAM |
| 863 | 863 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r) |
| r2418 | r2419 | |
|---|---|---|
| 668 | 668 | static ADDRESS_MAP_START( centiped_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 669 | 669 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 670 | 670 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&rambase) |
| 671 | AM_RANGE(0x0400, 0x07bf) AM_R | |
| 671 | AM_RANGE(0x0400, 0x07bf) AM_R | |
| 672 | 672 | AM_RANGE(0x07c0, 0x07ff) AM_RAM AM_BASE(&spriteram) |
| 673 | 673 | AM_RANGE(0x0800, 0x0800) AM_READ(input_port_4_r) /* DSW1 */ |
| 674 | 674 | AM_RANGE(0x0801, 0x0801) AM_READ(input_port_5_r) /* DSW2 */ |
| r2418 | r2419 | |
| 693 | 693 | static ADDRESS_MAP_START( centipdb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 694 | 694 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 695 | 695 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x4000) AM_RAM |
| 696 | AM_RANGE(0x0400, 0x07bf) AM_MIRROR(0x4000) AM_R | |
| 696 | AM_RANGE(0x0400, 0x07bf) AM_MIRROR(0x4000) AM_R | |
| 697 | 697 | AM_RANGE(0x07c0, 0x07ff) AM_MIRROR(0x4000) AM_RAM AM_BASE(&spriteram) |
| 698 | 698 | AM_RANGE(0x0800, 0x0800) AM_MIRROR(0x4000) AM_READ(input_port_4_r) /* DSW1 */ |
| 699 | 699 | AM_RANGE(0x0801, 0x0801) AM_MIRROR(0x4000) AM_READ(input_port_5_r) /* DSW2 */ |
| r2418 | r2419 | |
| 729 | 729 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 730 | 730 | AM_RANGE(0x0400, 0x040f) AM_READWRITE(pokey1_r, pokey1_w) |
| 731 | 731 | AM_RANGE(0x0800, 0x080f) AM_READWRITE(pokey2_r, pokey2_w) |
| 732 | AM_RANGE(0x1000, 0x13bf) AM_R | |
| 732 | AM_RANGE(0x1000, 0x13bf) AM_R | |
| 733 | 733 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) |
| 734 | 734 | AM_RANGE(0x2000, 0x2000) AM_READ(centiped_IN0_r) |
| 735 | 735 | AM_RANGE(0x2001, 0x2001) AM_READ(milliped_IN1_r) |
| r2418 | r2419 | |
| 760 | 760 | static ADDRESS_MAP_START( warlords_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 761 | 761 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 762 | 762 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 763 | AM_RANGE(0x0400, 0x07bf) AM_R | |
| 763 | AM_RANGE(0x0400, 0x07bf) AM_R | |
| 764 | 764 | AM_RANGE(0x07c0, 0x07ff) AM_RAM AM_BASE(&spriteram) |
| 765 | 765 | AM_RANGE(0x0800, 0x0800) AM_READ(input_port_2_r) /* DSW1 */ |
| 766 | 766 | AM_RANGE(0x0801, 0x0801) AM_READ(input_port_3_r) /* DSW2 */ |
| r2418 | r2419 | |
| 787 | 787 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 788 | 788 | AM_RANGE(0x0400, 0x040f) AM_READWRITE(pokey1_r, pokey1_w) |
| 789 | 789 | AM_RANGE(0x0800, 0x080f) AM_READWRITE(pokey2_r, pokey2_w) |
| 790 | AM_RANGE(0x1000, 0x13bf) AM_R | |
| 790 | AM_RANGE(0x1000, 0x13bf) AM_R | |
| 791 | 791 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) |
| 792 | 792 | AM_RANGE(0x2000, 0x2000) AM_READ(input_port_0_r) |
| 793 | 793 | AM_RANGE(0x2001, 0x2001) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 1971 | 1971 | |
| 1972 | 1972 | static DRIVER_INIT( caterplr ) |
| 1973 | 1973 | { |
| 1974 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_w); | |
| 1975 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r); | |
| 1976 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1780, 0x1780, 0, 0, caterplr_rand_r); | |
| 1974 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w); | |
| 1975 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1780, 0x1780, 0, 0, caterplr_rand_r); | |
| 1977 | 1976 | } |
| 1978 | 1977 | |
| 1979 | 1978 | |
| 1980 | 1979 | static DRIVER_INIT( magworm ) |
| 1981 | 1980 | { |
| 1982 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1001, 0x1001, 0, 0, AY8910_control_port_0_w); | |
| 1983 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_write_port_0_w); | |
| 1984 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_read_port_0_r); | |
| 1981 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1001, 0x1001, 0, 0, AY8910_control_port_0_w); | |
| 1982 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_read_port_0_r, AY8910_write_port_0_w); | |
| 1985 | 1983 | } |
| 1986 | 1984 | |
| 1987 | 1985 |
| r2418 | r2419 | |
|---|---|---|
| 428 | 428 | AM_RANGE(0x8a0000, 0x8a0001) AM_WRITE(atarigen_video_int_ack_w) |
| 429 | 429 | AM_RANGE(0x8c0000, 0x8c0001) AM_WRITE(atarigen_eeprom_enable_w) |
| 430 | 430 | AM_RANGE(0x900000, 0x9fffff) AM_RAM |
| 431 | AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 432 | AM_RANGE(0xa02000, 0xa02fff) AM_READWRITE(SMH_RAM, atarisy1_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 433 | AM_RANGE(0xa03000, 0xa03fff) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 434 | AM_RANGE(0xb00000, 0xb007ff) AM_READWRITE(SMH_RAM, paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 431 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 432 | AM_RANGE(0xa02000, 0xa02fff) AM_RAM_WRITE(atarisy1_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 433 | AM_RANGE(0xa03000, 0xa03fff) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 434 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) | |
| 435 | 435 | AM_RANGE(0xf00000, 0xf00fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 436 | 436 | AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r) |
| 437 | 437 | AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w) |
| r2418 | r2419 | |
|---|---|---|
| 669 | 669 | AM_RANGE(0x502000, 0x517fff) AM_READWRITE(wgp_pivram_word_r,wgp_pivram_word_w) AM_BASE(&wgp_pivram) /* piv tilemaps */ |
| 670 | 670 | AM_RANGE(0x520000, 0x52001f) AM_READWRITE(wgp_piv_ctrl_word_r,wgp_piv_ctrl_word_w) AM_BASE(&wgp_piv_ctrlram) |
| 671 | 671 | AM_RANGE(0x600000, 0x600003) AM_WRITE(rotate_port_w) /* rotation control ? */ |
| 672 | AM_RANGE(0x700000, 0x701fff) AM_RAM | |
| 672 | AM_RANGE(0x700000, 0x701fff) AM_RAM | |
| 673 | 673 | ADDRESS_MAP_END |
| 674 | 674 | |
| 675 | 675 | static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 16 ) /* LAN areas not mapped... */ |
| r2418 | r2419 | |
|---|---|---|
| 368 | 368 | AM_RANGE(0x100000, 0x17ffff) AM_ROM |
| 369 | 369 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_BASE(&welltris_pixelram) /* Graph_1 & 2*/ |
| 370 | 370 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* work */ |
| 371 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM AM_WRITE(welltris_spriteram_w) AM_BASE(&welltris_spriteram) /* Sprite */ | |
| 372 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_WRITE(welltris_charvideoram_w) AM_BASE(&welltris_charvideoram) /* Char */ | |
| 373 | AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) /* Palette */ | |
| 371 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(welltris_spriteram_w) AM_BASE(&welltris_spriteram) /* Sprite */ | |
| 372 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(welltris_charvideoram_w) AM_BASE(&welltris_charvideoram) /* Char */ | |
| 373 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) /* Palette */ | |
| 374 | 374 | AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_1_word_r) /* Bottom Controls */ |
| 375 | 375 | AM_RANGE(0xfff000, 0xfff001) AM_WRITE(welltris_palette_bank_w) |
| 376 | 376 | AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_2_word_r) /* Top Controls */ |
| r2418 | r2419 | |
|---|---|---|
| 279 | 279 | |
| 280 | 280 | AM_RANGE(0xdfe0, 0xdfe0) AM_NOP |
| 281 | 281 | |
| 282 | AM_RANGE(0xe000, 0xe3ff) AM_R | |
| 282 | AM_RANGE(0xe000, 0xe3ff) AM_R | |
| 283 | 283 | AM_RANGE(0xe400, 0xe400) AM_WRITE(fgpalette_w) |
| 284 | 284 | AM_RANGE(0xe800, 0xe800) AM_WRITE(sound_w) |
| 285 | 285 | |
| r2418 | r2419 | |
| 521 | 521 | static DRIVER_INIT(pturn) |
| 522 | 522 | { |
| 523 | 523 | /* |
| 524 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc0dd, 0xc0dd, 0, 0, pturn_protection_r); | |
| 525 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc0db, 0xc0db, 0, 0, pturn_protection2_r); | |
| 524 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0dd, 0xc0dd, 0, 0, pturn_protection_r); | |
| 525 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0db, 0xc0db, 0, 0, pturn_protection2_r); | |
| 526 | 526 | */ |
| 527 | 527 | } |
| 528 | 528 |
| r2418 | r2419 | |
|---|---|---|
| 248 | 248 | AM_RANGE(0x8000, 0x8002) AM_WRITE(SMH_RAM) AM_BASE(&drawctrl) |
| 249 | 249 | AM_RANGE(0x8000, 0x9fff) AM_ROM /* space for diagnostic ROM? */ |
| 250 | 250 | AM_RANGE(0xa000, 0xbfff) AM_ROM |
| 251 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 251 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 252 | 252 | ADDRESS_MAP_END |
| 253 | 253 | |
| 254 | 254 | static ADDRESS_MAP_START( gselect_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
| 262 | 262 | AM_RANGE(0x4800, 0x4803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 263 | 263 | AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 264 | 264 | AM_RANGE(0x8000, 0x8002) AM_WRITE(SMH_RAM) AM_BASE(&drawctrl) |
| 265 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 265 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 266 | 266 | ADDRESS_MAP_END |
| 267 | 267 | |
| 268 | 268 | // TODO: where are mapped the lower 0x2000 bytes of the banks? |
| r2418 | r2419 | |
| 279 | 279 | AM_RANGE(0x607e, 0x607e) AM_WRITE(banksel_1_1_w) |
| 280 | 280 | AM_RANGE(0x8000, 0x8002) AM_WRITE(SMH_RAM) AM_BASE(&drawctrl) |
| 281 | 281 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 282 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 282 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 283 | 283 | ADDRESS_MAP_END |
| 284 | 284 | |
| 285 | 285 | static ADDRESS_MAP_START( gepoker_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
| 296 | 296 | AM_RANGE(0x8000, 0x8002) AM_WRITE(SMH_RAM) AM_BASE(&drawctrl) |
| 297 | 297 | AM_RANGE(0x8000, 0xbfff) AM_ROM /* space for diagnostic ROM? */ |
| 298 | 298 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 299 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 299 | AM_RANGE(0xc000, 0xffff) AM_R | |
| 300 | 300 | ADDRESS_MAP_END |
| 301 | 301 | |
| 302 | 302 |
| r2418 | r2419 | |
|---|---|---|
| 434 | 434 | AM_RANGE(0x21000c, 0x21000d) AM_READ(input_port_4_word_r ) /* Coins */ \ |
| 435 | 435 | AM_RANGE(0x21000e, 0x21000f) AM_READ(SMH_NOP ) /* */ \ |
| 436 | 436 | AM_RANGE(0x300000, 0x30007f) AM_READ(ES5506_data_0_word_r ) /* Sound */ \ |
| 437 | AM_RANGE(0x482000, 0x482fff) AM_R | |
| 437 | AM_RANGE(0x482000, 0x482fff) AM_R | |
| 438 | 438 | AM_RANGE(_ROM, 0xffffff) AM_READ(SMH_BANK1 ) /* ROM */ \ |
| 439 | 439 | //AM_RANGE(0x990000, 0x99007f) AM_READ(fake_r) |
| 440 | 440 |
| r2418 | r2419 | |
|---|---|---|
| 379 | 379 | AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w) /* Pause the TMS32025 */ |
| 380 | 380 | AM_RANGE(0x180000, 0x183fff) AM_RAM /* "gradiation ram (0)" */ |
| 381 | 381 | AM_RANGE(0x184000, 0x187fff) AM_RAM /* "gradiation ram (1)" */ |
| 382 | AM_RANGE(0x188000, 0x18bfff) AM_R | |
| 382 | AM_RANGE(0x188000, 0x18bfff) AM_R | |
| 383 | 383 | AM_RANGE(0x800000, 0x820fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w) /* tilemaps, sprites */ |
| 384 | 384 | AM_RANGE(0x908000, 0x90ffff) AM_RAM AM_BASE(&taitoair_line_ram) /* "line ram" */ |
| 385 | 385 | AM_RANGE(0x910000, 0x91ffff) AM_RAM AM_BASE(&dsp_ram) /* "dsp common ram" (TMS320C25) */ |
| r2418 | r2419 | |
|---|---|---|
| 364 | 364 | AM_RANGE(0xf60000, 0xf60001) AM_READ(asic65_r) |
| 365 | 365 | AM_RANGE(0xf80000, 0xf80003) AM_WRITE(asic65_data_w) |
| 366 | 366 | AM_RANGE(0xfa0000, 0xfa0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 367 | AM_RANGE(0xfc0000, 0xfc0fff) AM_R | |
| 367 | AM_RANGE(0xfc0000, 0xfc0fff) AM_R | |
| 368 | 368 | AM_RANGE(0xff0000, 0xff0fff) AM_WRITE(atarirle_0_spriteram_w) AM_BASE(&atarirle_0_spriteram) |
| 369 | 369 | AM_RANGE(0xff2000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) |
| 370 | 370 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) |
| r2418 | r2419 | |
| 694 | 694 | atarig42_motion_object_base = 0x200; |
| 695 | 695 | atarig42_motion_object_mask = 0x1ff; |
| 696 | 696 | |
| 697 | sloop_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r); | |
| 698 | sloop_base = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_w); | |
| 697 | sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r, roadriot_sloop_data_w); | |
| 699 | 698 | memory_set_opbase_handler(0, sloop_opbase_handler); |
| 700 | 699 | |
| 701 | 700 | asic65_config(ASIC65_ROMBASED); |
| r2418 | r2419 | |
| 749 | 748 | /* put an RTS there so we don't die */ |
| 750 | 749 | *(UINT16 *)&memory_region(REGION_CPU1)[0x80000] = 0x4E75; |
| 751 | 750 | |
| 752 | sloop_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r); | |
| 753 | sloop_base = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_w); | |
| 751 | sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r, guardians_sloop_data_w); | |
| 754 | 752 | memory_set_opbase_handler(0, sloop_opbase_handler); |
| 755 | 753 | |
| 756 | 754 | asic65_config(ASIC65_GUARDIANS); |
| r2418 | r2419 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | static ADDRESS_MAP_START( m6809_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 179 | 179 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 180 | AM_RANGE(0x1800, 0x1bff) AM_READWRITE(SMH_RAM, tceptor_tile_ram_w) AM_BASE(&tceptor_tile_ram) | |
| 181 | AM_RANGE(0x1c00, 0x1fff) AM_READWRITE(SMH_RAM, tceptor_tile_attr_w) AM_BASE(&tceptor_tile_attr) | |
| 182 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(SMH_RAM, tceptor_bg_ram_w) AM_BASE(&tceptor_bg_ram) // background (VIEW RAM) | |
| 180 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(tceptor_tile_ram_w) AM_BASE(&tceptor_tile_ram) | |
| 181 | AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(tceptor_tile_attr_w) AM_BASE(&tceptor_tile_attr) | |
| 182 | AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(tceptor_bg_ram_w) AM_BASE(&tceptor_bg_ram) // background (VIEW RAM) | |
| 183 | 183 | AM_RANGE(0x4000, 0x43ff) AM_READWRITE(namcos1_cus30_r, namcos1_cus30_w) |
| 184 | 184 | AM_RANGE(0x4800, 0x4800) AM_WRITE(SMH_NOP) // 3D scope left/right? |
| 185 | 185 | AM_RANGE(0x4f00, 0x4f00) AM_READ(SMH_NOP) // unknown |
| r2418 | r2419 | |
|---|---|---|
| 94 | 94 | AM_RANGE(0x360010, 0x360011) AM_WRITE(SMH_NOP) |
| 95 | 95 | AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) |
| 96 | 96 | AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) |
| 97 | AM_RANGE(0x3e0000, 0x3e0fff) AM_READWRITE(SMH_RAM, vindictr_paletteram_w) AM_BASE(&paletteram16) | |
| 98 | AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x8000) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 99 | AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x8000) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 100 | AM_RANGE(0x3f4000, 0x3f4f7f) AM_MIRROR(0x8000) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 101 | AM_RANGE(0x3f4f80, 0x3f4fff) AM_MIRROR(0x8000) AM_READWRITE(SMH_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 97 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE(vindictr_paletteram_w) AM_BASE(&paletteram16) | |
| 98 | AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 99 | AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x8000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 100 | AM_RANGE(0x3f4000, 0x3f4f7f) AM_MIRROR(0x8000) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 101 | AM_RANGE(0x3f4f80, 0x3f4fff) AM_MIRROR(0x8000) AM_RAM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 102 | 102 | AM_RANGE(0x3f5000, 0x3f7fff) AM_MIRROR(0x8000) AM_RAM |
| 103 | 103 | ADDRESS_MAP_END |
| 104 | 104 |
| r2418 | r2419 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | |
| 147 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 148 | AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM) | |
| 149 | AM_RANGE(0xc00000, 0xc03fff) AM_READ(SMH_RAM) | |
| 150 | AM_RANGE(0xc80000, 0xc81fff) AM_READ(SMH_RAM) /* sprite ram */ | |
| 151 | AM_RANGE(0xd00000, 0xd00fff) AM_READ(SMH_RAM) | |
| 147 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 148 | AM_RANGE(0x000000, 0x07ffff) AM_ROM | |
| 149 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(aquarium_mid_videoram_w) AM_BASE(&aquarium_mid_videoram) | |
| 150 | AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(aquarium_bak_videoram_w) AM_BASE(&aquarium_bak_videoram) | |
| 151 | AM_RANGE(0xc02000, 0xc03fff) AM_RAM_WRITE(aquarium_txt_videoram_w) AM_BASE(&aquarium_txt_videoram) | |
| 152 | AM_RANGE(0xc80000, 0xc81fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 153 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 154 | AM_RANGE(0xd80014, 0xd8001f) AM_WRITE(SMH_RAM) AM_BASE(&aquarium_scroll) | |
| 155 | AM_RANGE(0xd80068, 0xd80069) AM_WRITENOP /* probably not used */ | |
| 152 | 156 | AM_RANGE(0xd80080, 0xd80081) AM_READ(input_port_0_word_r) |
| 153 | 157 | AM_RANGE(0xd80082, 0xd80083) AM_READ(SMH_NOP) /* stored but not read back ? check code at 0x01f440 */ |
| 154 | 158 | AM_RANGE(0xd80084, 0xd80085) AM_READ(input_port_1_word_r) |
| 155 | 159 | AM_RANGE(0xd80086, 0xd80087) AM_READ(aquarium_coins_r) |
| 156 | AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM) /* RAM */ | |
| 157 | ADDRESS_MAP_END | |
| 158 | ||
| 159 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 160 | AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM) | |
| 161 | AM_RANGE(0xc00000, 0xc00fff) AM_WRITE(aquarium_mid_videoram_w) AM_BASE(&aquarium_mid_videoram) | |
| 162 | AM_RANGE(0xc01000, 0xc01fff) AM_WRITE(aquarium_bak_videoram_w) AM_BASE(&aquarium_bak_videoram) | |
| 163 | AM_RANGE(0xc02000, 0xc03fff) AM_WRITE(aquarium_txt_videoram_w) AM_BASE(&aquarium_txt_videoram) | |
| 164 | AM_RANGE(0xc80000, 0xc81fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 165 | AM_RANGE(0xd00000, 0xd00fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 166 | AM_RANGE(0xd80014, 0xd8001f) AM_WRITE(SMH_RAM) AM_BASE(&aquarium_scroll) | |
| 167 | AM_RANGE(0xd80068, 0xd80069) AM_WRITENOP /* probably not used */ | |
| 168 | 160 | AM_RANGE(0xd80088, 0xd80089) AM_WRITENOP /* ?? video related */ |
| 169 | 161 | AM_RANGE(0xd8008a, 0xd8008b) AM_WRITE(aquarium_sound_w) |
| 170 | AM_RANGE(0xff0000, 0xffffff) AM_ | |
| 162 | AM_RANGE(0xff0000, 0xffffff) AM_ | |
| 171 | 163 | ADDRESS_MAP_END |
| 172 | 164 | |
| 173 | static ADDRESS_MAP_START( snd_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 174 | AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM) | |
| 175 | AM_RANGE(0x7800, 0x7fff) AM_READ(SMH_RAM) | |
| 176 | AM_RANGE(0x8000, 0xffff) AM_READ(SMH_BANK1) | |
| 165 | static ADDRESS_MAP_START( snd_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 166 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 167 | AM_RANGE(0x7800, 0x7fff) AM_RAM | |
| 168 | AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1) | |
| 177 | 169 | ADDRESS_MAP_END |
| 178 | 170 | |
| 179 | static ADDRESS_MAP_START( snd_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 180 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM) | |
| 181 | AM_RANGE(0x7800, 0x7fff) AM_WRITE(SMH_RAM) | |
| 182 | ADDRESS_MAP_END | |
| 183 | ||
| 184 | static ADDRESS_MAP_START( snd_readport, ADDRESS_SPACE_IO, 8 ) | |
| 171 | static ADDRESS_MAP_START( snd_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 185 | 172 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 186 | AM_RANGE(0x01, 0x01) AM_READ(YM2151_status_port_0_r) | |
| 187 | AM_RANGE(0x02, 0x02) AM_READ(aquarium_oki_r) | |
| 188 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 189 | ADDRESS_MAP_END | |
| 190 | ||
| 191 | static ADDRESS_MAP_START( snd_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 192 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 193 | 173 | AM_RANGE(0x00, 0x00) AM_WRITE(YM2151_register_port_0_w) |
| 194 | AM_RANGE(0x01, 0x01) AM_WRITE(YM2151_data_port_0_w) | |
| 195 | AM_RANGE(0x02, 0x02) AM_WRITE(aquarium_oki_w) | |
| 174 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 175 | AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w) | |
| 176 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 196 | 177 | AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w) |
| 197 | 178 | AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w) |
| 198 | 179 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 369 | 350 | |
| 370 | 351 | /* basic machine hardware */ |
| 371 | 352 | MDRV_CPU_ADD(M68000, 32000000/2) |
| 372 | MDRV_CPU_PROGRAM_MAP( | |
| 353 | MDRV_CPU_PROGRAM_MAP( | |
| 373 | 354 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 374 | 355 | |
| 375 | 356 | MDRV_CPU_ADD(Z80, 6000000) |
| 376 | /* audio CPU */ | |
| 377 | MDRV_CPU_PROGRAM_MAP(snd_readmem,snd_writemem) | |
| 378 | MDRV_CPU_IO_MAP(snd_readport,snd_writeport) | |
| 357 | MDRV_CPU_PROGRAM_MAP(snd_map,0) | |
| 358 | MDRV_CPU_IO_MAP(snd_portmap,0) | |
| 379 | 359 | |
| 380 | 360 | #if AQUARIUS_HACK |
| 381 | 361 | MDRV_MACHINE_RESET(aquarium) |
| r2418 | r2419 | |
|---|---|---|
| 217 | 217 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 218 | 218 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 219 | 219 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 220 | AM_RANGE(0xe000, 0xe3ff) AM_READWRITE(SMH_RAM, angelkds_bgtopvideoram_w) AM_BASE(&angelkds_bgtopvideoram) /* Top Half of Screen */ | |
| 221 | AM_RANGE(0xe400, 0xe7ff) AM_READWRITE(SMH_RAM, angelkds_bgbotvideoram_w) AM_BASE(&angelkds_bgbotvideoram) /* Bottom Half of Screen */ | |
| 222 | AM_RANGE(0xe800, 0xebff) AM_READWRITE(SMH_RAM, angelkds_txvideoram_w) AM_BASE(&angelkds_txvideoram) | |
| 220 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(angelkds_bgtopvideoram_w) AM_BASE(&angelkds_bgtopvideoram) /* Top Half of Screen */ | |
| 221 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(angelkds_bgbotvideoram_w) AM_BASE(&angelkds_bgbotvideoram) /* Bottom Half of Screen */ | |
| 222 | AM_RANGE(0xe800, 0xebff) AM_RAM_WRITE(angelkds_txvideoram_w) AM_BASE(&angelkds_txvideoram) | |
| 223 | 223 | AM_RANGE(0xec00, 0xecff) AM_RAM AM_BASE(&spriteram) |
| 224 | AM_RANGE(0xed00, 0xeeff) AM_R | |
| 224 | AM_RANGE(0xed00, 0xeeff) AM_R | |
| 225 | 225 | AM_RANGE(0xef00, 0xefff) AM_RAM |
| 226 | 226 | AM_RANGE(0xf000, 0xf000) AM_WRITE(angelkds_bgtopbank_write) |
| 227 | 227 | AM_RANGE(0xf001, 0xf001) AM_WRITE(angelkds_bgtopscroll_write) |
| r2418 | r2419 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 122 | 122 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 123 | AM_RANGE(0x4000, 0x47ff) AM_R | |
| 123 | AM_RANGE(0x4000, 0x47ff) AM_R | |
| 124 | 124 | AM_RANGE(0x4800, 0x4fef) AM_RAM |
| 125 | 125 | AM_RANGE(0x4ff0, 0x4fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 126 | 126 | AM_RANGE(0x5000, 0x503f) AM_READ(input_port_0_r) /* IN0 */ |
| r2418 | r2419 | |
|---|---|---|
| 207 | 207 | static DRIVER_INIT(genesis) |
| 208 | 208 | { |
| 209 | 209 | /* hack -- fix vdp emulation instead */ |
| 210 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r); | |
| 210 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r); | |
| 211 | 211 | |
| 212 | 212 | memory_set_bankptr(3, memory_region(REGION_CPU1) ); |
| 213 | 213 | memory_set_bankptr(4, genesis_68k_ram ); |
| r2418 | r2419 | |
|---|---|---|
| 80 | 80 | AM_RANGE(0x2501, 0x2501) AM_READ(input_port_5_r) |
| 81 | 81 | AM_RANGE(0x2800, 0x288f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 82 | 82 | AM_RANGE(0x2890, 0x37ff) AM_RAM |
| 83 | AM_RANGE(0x3800, 0x3bff) AM_RAM AM_WRITE(mikie_colorram_w) AM_BASE(&colorram) | |
| 84 | AM_RANGE(0x3c00, 0x3fff) AM_RAM AM_WRITE(mikie_videoram_w) AM_BASE(&videoram) | |
| 83 | AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(mikie_colorram_w) AM_BASE(&colorram) | |
| 84 | AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(mikie_videoram_w) AM_BASE(&videoram) | |
| 85 | 85 | AM_RANGE(0x4000, 0x5fff) AM_ROM // Machine checks for extra rom |
| 86 | 86 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| 87 | 87 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 91 | 91 | timer[0] = timer_alloc(NULL, NULL); |
| 92 | 92 | timer[1] = timer_alloc(NULL, NULL); |
| 93 | 93 | |
| 94 | | |
| 94 | | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| r2418 | r2419 | |
| 513 | 513 | AM_RANGE(0x997000, 0x997000) AM_NOP // communications |
| 514 | 514 | AM_RANGE(0x9a0000, 0x9a0000) AM_WRITE(midvunit_sound_w) |
| 515 | 515 | AM_RANGE(0x9c0000, 0x9c1fff) AM_READWRITE(midvunit_cmos_r, midvunit_cmos_w) AM_BASE(&generic_nvram32) AM_SIZE(&generic_nvram_size) |
| 516 | AM_RANGE(0x9e0000, 0x9e7fff) AM_R | |
| 516 | AM_RANGE(0x9e0000, 0x9e7fff) AM_R | |
| 517 | 517 | AM_RANGE(0xa00000, 0xbfffff) AM_READWRITE(midvunit_textureram_r, midvunit_textureram_w) AM_BASE(&midvunit_textureram) |
| 518 | 518 | AM_RANGE(0xc00000, 0xffffff) AM_ROM AM_REGION(REGION_USER1, 0) |
| 519 | 519 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 537 | 537 | AM_RANGE(0x990000, 0x99000f) AM_READWRITE(midway_ioasic_r, midway_ioasic_w) |
| 538 | 538 | AM_RANGE(0x994000, 0x994000) AM_WRITE(midvunit_control_w) |
| 539 | 539 | AM_RANGE(0x995020, 0x995020) AM_WRITE(midvunit_cmos_protect_w) |
| 540 | AM_RANGE(0x9a0000, 0x9a0007) AM_READWRITE(midway_ide_asic_r, midway_ide_asic_w) | |
| 541 | AM_RANGE(0x9c0000, 0x9c7fff) AM_READWRITE(SMH_RAM, midvunit_paletteram_w) AM_BASE(&paletteram32) | |
| 540 | AM_RANGE(0x9a0000, 0x9a0007) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", midway_ide_asic_r, midway_ide_asic_w) | |
| 541 | AM_RANGE(0x9c0000, 0x9c7fff) AM_RAM_WRITE(midvunit_paletteram_w) AM_BASE(&paletteram32) | |
| 542 | 542 | AM_RANGE(0x9d0000, 0x9d000f) AM_READWRITE(midvplus_misc_r, midvplus_misc_w) AM_BASE(&midvplus_misc) |
| 543 | 543 | AM_RANGE(0xa00000, 0xbfffff) AM_READWRITE(midvunit_textureram_r, midvunit_textureram_w) AM_BASE(&midvunit_textureram) |
| 544 | 544 | AM_RANGE(0xc00000, 0xcfffff) AM_RAM |
| r2418 | r2419 | |
| 1045 | 1045 | MDRV_MACHINE_RESET(midvplus) |
| 1046 | 1046 | MDRV_NVRAM_HANDLER(midway_serial_pic2) |
| 1047 | 1047 | |
| 1048 | MDRV_IDE_CONTROLLER_ADD("ide", 0, NULL) | |
| 1049 | ||
| 1048 | 1050 | /* sound hardware */ |
| 1049 | 1051 | MDRV_IMPORT_FROM(dcs2_audio_2115) |
| 1050 | 1052 | MACHINE_DRIVER_END |
| r2418 | r2419 | |
| 1406 | 1408 | } |
| 1407 | 1409 | |
| 1408 | 1410 | |
| 1409 | static void init_crusnusa_common(offs_t speedup) | |
| 1411 | static void init_crusnusa_common(running_machine *machine, offs_t speedup) | |
| 1410 | 1412 | { |
| 1411 | 1413 | dcs_init(); |
| 1412 | 1414 | adc_shift = 24; |
| 1413 | 1415 | |
| 1414 | 1416 | /* speedups */ |
| 1415 | generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r); | |
| 1417 | generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r); | |
| 1416 | 1418 | } |
| 1417 | static DRIVER_INIT( crusnusa ) { init_crusnusa_common(0xc93e); } | |
| 1418 | static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(0xc957); } | |
| 1419 | static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(0xc051); } | |
| 1419 | static DRIVER_INIT( crusnusa ) { init_crusnusa_common(machine, 0xc93e); } | |
| 1420 | static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(machine, 0xc957); } | |
| 1421 | static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(machine, 0xc051); } | |
| 1420 | 1422 | |
| 1421 | 1423 | |
| 1422 | static void init_crusnwld_common(offs_t speedup) | |
| 1424 | static void init_crusnwld_common(running_machine *machine, offs_t speedup) | |
| 1423 | 1425 | { |
| 1424 | 1426 | dcs_init(); |
| 1425 | 1427 | adc_shift = 16; |
| 1426 | 1428 | |
| 1427 | 1429 | /* control register is different */ |
| 1428 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w); | |
| 1430 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w); | |
| 1429 | 1431 | |
| 1430 | 1432 | /* valid values are 450 or 460 */ |
| 1431 | 1433 | midway_serial_pic_init(450); |
| 1432 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r); | |
| 1433 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r); | |
| 1434 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w); | |
| 1434 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r); | |
| 1435 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r); | |
| 1436 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w); | |
| 1435 | 1437 | |
| 1436 | 1438 | /* install strange protection device */ |
| 1437 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d1fff, 0, 0, bit_data_r); | |
| 1438 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d0000, 0, 0, bit_reset_w); | |
| 1439 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d1fff, 0, 0, bit_data_r); | |
| 1440 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d0000, 0, 0, bit_reset_w); | |
| 1439 | 1441 | |
| 1440 | 1442 | /* speedups */ |
| 1441 | 1443 | if (speedup) |
| 1442 | generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r); | |
| 1444 | generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r); | |
| 1443 | 1445 | } |
| 1444 | static DRIVER_INIT( crusnwld ) { init_crusnwld_common(0xd4c0); } | |
| 1446 | static DRIVER_INIT( crusnwld ) { init_crusnwld_common(machine, 0xd4c0); } | |
| 1445 | 1447 | #if 0 |
| 1446 | static DRIVER_INIT( crusnw20 ) { init_crusnwld_common(0xd49c); } | |
| 1447 | static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(0); } | |
| 1448 | static DRIVER_INIT( crusnw20 ) { init_crusnwld_common(machine, 0xd49c); } | |
| 1449 | static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(machine, 0); } | |
| 1448 | 1450 | #endif |
| 1449 | 1451 | |
| 1450 | 1452 | static DRIVER_INIT( offroadc ) |
| r2418 | r2419 | |
| 1453 | 1455 | adc_shift = 16; |
| 1454 | 1456 | |
| 1455 | 1457 | /* control register is different */ |
| 1456 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w); | |
| 1458 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w); | |
| 1457 | 1459 | |
| 1458 | 1460 | /* valid values are 230 or 234 */ |
| 1459 | 1461 | midway_serial_pic2_init(230, 94); |
| 1460 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r); | |
| 1461 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r); | |
| 1462 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w); | |
| 1462 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r); | |
| 1463 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r, offroadc_serial_data_w); | |
| 1463 | 1464 | |
| 1464 | 1465 | /* speedups */ |
| 1465 | generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x195aa, 0x195aa, 0, 0, generic_speedup_r); | |
| 1466 | generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x195aa, 0x195aa, 0, 0, generic_speedup_r); | |
| 1466 | 1467 | } |
| 1467 | 1468 | |
| 1468 | 1469 | |
| 1469 | static const struct ide_interface ide_intf = | |
| 1470 | { | |
| 1471 | 0 | |
| 1472 | }; | |
| 1473 | ||
| 1474 | 1470 | static DRIVER_INIT( wargods ) |
| 1475 | 1471 | { |
| 1476 | 1472 | UINT8 default_nvram[256]; |
| 1477 | 1473 | |
| 1478 | 1474 | /* initialize the subsystems */ |
| 1479 | dcs2_init(2, 0x3839); | |
| 1480 | ide_controller_init(0, &ide_intf); | |
| 1475 | dcs2_init(machine, 2, 0x3839); | |
| 1481 | 1476 | midway_ioasic_init(0, 452/* no alternates */, 94, NULL); |
| 1482 | 1477 | adc_shift = 16; |
| 1483 | 1478 | |
| r2418 | r2419 | |
| 1493 | 1488 | midway_serial_pic2_set_default_nvram(default_nvram); |
| 1494 | 1489 | |
| 1495 | 1490 | /* speedups */ |
| 1496 | generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x2f4c, 0x2f4c, 0, 0, generic_speedup_r); | |
| 1491 | generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2f4c, 0x2f4c, 0, 0, generic_speedup_r); | |
| 1497 | 1492 | } |
| 1498 | 1493 | |
| 1499 | 1494 |
| r2418 | r2419 | |
|---|---|---|
| 81 | 81 | AM_RANGE(0x2070, 0x2070) AM_READ(input_port_3_r) |
| 82 | 82 | AM_RANGE(0x2400, 0x2400) AM_WRITE(AY8910_control_port_0_w) |
| 83 | 83 | AM_RANGE(0x2401, 0x2401) AM_WRITE(AY8910_write_port_0_w) |
| 84 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram) | |
| 85 | AM_RANGE(0x3000, 0x3fff) AM_RAM AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram) | |
| 84 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram) | |
| 85 | AM_RANGE(0x3000, 0x3fff) AM_RAM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram) | |
| 86 | 86 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK1, SMH_ROM) |
| 87 | 87 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 88 | 88 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 101 | 101 | AM_RANGE(0x2441, 0x2441) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 102 | 102 | AM_RANGE(0x2460, 0x2460) AM_WRITE(usgames_rombank_w) |
| 103 | 103 | AM_RANGE(0x2470, 0x2470) AM_READ(input_port_3_r) |
| 104 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram) | |
| 105 | AM_RANGE(0x3000, 0x3fff) AM_RAM AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram) | |
| 104 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram) | |
| 105 | AM_RANGE(0x3000, 0x3fff) AM_RAM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram) | |
| 106 | 106 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK1, SMH_ROM) |
| 107 | 107 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 108 | 108 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 471 | 471 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 472 | 472 | AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w) |
| 473 | 473 | AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w) |
| 474 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) | |
| 475 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(pmpoker_colorram_w) AM_BASE(&colorram) | |
| 474 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) | |
| 475 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(pmpoker_colorram_w) AM_BASE(&colorram) | |
| 476 | 476 | AM_RANGE(0x4000, 0x7fff) AM_ROM |
| 477 | 477 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 478 | 478 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 483 | 483 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 484 | 484 | AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w) |
| 485 | 485 | AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w) |
| 486 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) | |
| 487 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(pmpoker_colorram_w) AM_BASE(&colorram) | |
| 486 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) | |
| 487 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(pmpoker_colorram_w) AM_BASE(&colorram) | |
| 488 | 488 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 489 | 489 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 490 | 490 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 74 | 74 | static ADDRESS_MAP_START( main_cpu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 75 | 75 | AM_RANGE(0x0000, 0xdbff) AM_ROM |
| 76 | 76 | AM_RANGE(0xdc00, 0xdfff) AM_RAM AM_SHARE(1) // shared with SOUND |
| 77 | AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_WRITE(speedbal_background_videoram_w) AM_BASE(&speedbal_background_videoram) | |
| 78 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(speedbal_foreground_videoram_w) AM_BASE(&speedbal_foreground_videoram) | |
| 79 | AM_RANGE(0xf000, 0xf5ff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 77 | AM_RANGE(0xe000, 0xe1ff) AM_RAM_WRITE(speedbal_background_videoram_w) AM_BASE(&speedbal_background_videoram) | |
| 78 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(speedbal_foreground_videoram_w) AM_BASE(&speedbal_foreground_videoram) | |
| 79 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 80 | 80 | AM_RANGE(0xf600, 0xfeff) AM_RAM |
| 81 | 81 | AM_RANGE(0xff00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 82 | 82 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 204 | 204 | AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w) |
| 205 | 205 | AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE(eeprom_w) |
| 206 | 206 | AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE(&cus_ram) /*260d - 2626*/ |
| 207 | AM_RANGE(0xb000, 0xb0ff) AM_RAM AM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram) /*Wrong format*/ | |
| 208 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_WRITE(yumefuda_vram_w) AM_BASE(&videoram) | |
| 209 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(yumefuda_cram_w) AM_BASE(&colorram) | |
| 207 | AM_RANGE(0xb000, 0xb0ff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram) /*Wrong format*/ | |
| 208 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(yumefuda_vram_w) AM_BASE(&videoram) | |
| 209 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(yumefuda_cram_w) AM_BASE(&colorram) | |
| 210 | 210 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 211 | 211 | ADDRESS_MAP_END |
| 212 | 212 |
| r2418 | r2419 | |
|---|---|---|
| 2239 | 2239 | |
| 2240 | 2240 | /*****************************************************************************/ |
| 2241 | 2241 | |
| 2242 | static void init_lights(write32_machine_func out1, write32_machine_func out2, write32_machine_func out3) | |
| 2242 | static void init_lights(running_machine *machine, write32_machine_func out1, write32_machine_func out2, write32_machine_func out3) | |
| 2243 | 2243 | { |
| 2244 | 2244 | if(!out1) out1 = lamp_output_w; |
| 2245 | 2245 | if(!out2) out1 = lamp_output2_w; |
| 2246 | 2246 | if(!out3) out1 = lamp_output3_w; |
| 2247 | 2247 | |
| 2248 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000804, 0x7d000807, 0, 0, out1); | |
| 2249 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000320, 0x7d000323, 0, 0, out2); | |
| 2250 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000324, 0x7d000327, 0, 0, out3); | |
| 2248 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000804, 0x7d000807, 0, 0, out1); | |
| 2249 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000320, 0x7d000323, 0, 0, out2); | |
| 2250 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000324, 0x7d000327, 0, 0, out3); | |
| 2251 | 2251 | } |
| 2252 | 2252 | |
| 2253 | 2253 | static void init_firebeat(running_machine *machine) |
| r2418 | r2419 | |
| 2273 | 2273 | |
| 2274 | 2274 | set_ibutton(rom); |
| 2275 | 2275 | |
| 2276 | init_lights(NULL, NULL, NULL); | |
| 2276 | init_lights(machine, NULL, NULL, NULL); | |
| 2277 | 2277 | } |
| 2278 | 2278 | |
| 2279 | 2279 | static DRIVER_INIT(ppp) |
| 2280 | 2280 | { |
| 2281 | 2281 | init_firebeat(machine); |
| 2282 | init_lights(lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w); | |
| 2282 | init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w); | |
| 2283 | 2283 | } |
| 2284 | 2284 | |
| 2285 | 2285 | static DRIVER_INIT(ppd) |
| 2286 | 2286 | { |
| 2287 | 2287 | init_firebeat(machine); |
| 2288 | init_lights(lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w); | |
| 2288 | init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w); | |
| 2289 | 2289 | |
| 2290 | 2290 | cur_cab_data = ppd_cab_data; |
| 2291 | 2291 | } |
| r2418 | r2419 | |
| 2300 | 2300 | static DRIVER_INIT(kbm) |
| 2301 | 2301 | { |
| 2302 | 2302 | init_firebeat(machine); |
| 2303 | init_lights(lamp_output_kbm_w, NULL, NULL); | |
| 2303 | init_lights(machine, lamp_output_kbm_w, NULL, NULL); | |
| 2304 | 2304 | |
| 2305 | 2305 | init_keyboard(); |
| 2306 | 2306 |
| r2418 | r2419 | |
|---|---|---|
| 192 | 192 | coin_counter_w(offset,data); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 196 | AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM) | |
| 197 | AM_RANGE(0x6000, 0x67ff) AM_READ(SMH_RAM) | |
| 198 | AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM) | |
| 199 | AM_RANGE(0x9800, 0x9bff) AM_READ(SMH_RAM) | |
| 195 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 196 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 197 | AM_RANGE(0x6000, 0x67ff) AM_RAM | |
| 198 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(bagman_videoram_w) AM_BASE(&videoram) | |
| 199 | AM_RANGE(0x9800, 0x9bff) AM_RAM_WRITE(bagman_colorram_w) AM_BASE(&colorram) | |
| 200 | AM_RANGE(0x9c00, 0x9fff) AM_WRITENOP /* written to, but unused */ | |
| 200 | 201 | AM_RANGE(0xa000, 0xa000) AM_READ(bagman_pal16r6_r) |
| 201 | 202 | //AM_RANGE(0xa800, 0xa805) AM_READ(bagman_ls259_r) /*just for debugging purposes*/ |
| 202 | AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r) /* DSW */ | |
| 203 | AM_RANGE(0xb800, 0xb800) AM_READ(SMH_NOP) | |
| 204 | AM_RANGE(0xc000, 0xffff) AM_READ(SMH_ROM) /* Super Bagman only */ | |
| 205 | ADDRESS_MAP_END | |
| 206 | ||
| 207 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 208 | AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM) | |
| 209 | AM_RANGE(0x6000, 0x67ff) AM_WRITE(SMH_RAM) | |
| 210 | AM_RANGE(0x9000, 0x93ff) AM_WRITE(bagman_videoram_w) AM_BASE(&videoram) | |
| 211 | AM_RANGE(0x9800, 0x9bff) AM_WRITE(bagman_colorram_w) AM_BASE(&colorram) | |
| 212 | 203 | AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) |
| 213 | 204 | AM_RANGE(0xa001, 0xa002) AM_WRITE(bagman_flipscreen_w) |
| 214 | 205 | AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&bagman_video_enable) |
| r2418 | r2419 | |
| 217 | 208 | /* here only to initialize the pointer, */ |
| 218 | 209 | /* writes are handled by bagman_colorram_w */ |
| 219 | 210 | AM_RANGE(0xa800, 0xa805) AM_WRITE(bagman_ls259_w) /* TMS5110 driving state machine */ |
| 220 | AM_RANGE(0x9c00, 0x9fff) AM_WRITE(SMH_NOP) /* written to, but unused */ | |
| 221 | 211 | AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w) |
| 212 | AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r) /* DSW */ | |
| 213 | AM_RANGE(0xb800, 0xb800) AM_READNOP | |
| 214 | AM_RANGE(0xc000, 0xffff) AM_ROM /* Super Bagman only */ | |
| 222 | 215 | |
| 223 | 216 | #if 0 |
| 224 | 217 | AM_RANGE(0xa007, 0xa007) AM_WRITE(SMH_NOP) /* ???? */ |
| r2418 | r2419 | |
| 227 | 220 | #endif |
| 228 | 221 | ADDRESS_MAP_END |
| 229 | 222 | |
| 230 | static ADDRESS_MAP_START( pickin_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 231 | AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM) | |
| 232 | AM_RANGE(0x7000, 0x77ff) AM_READ(SMH_RAM) | |
| 233 | AM_RANGE(0x8800, 0x8bff) AM_READ(SMH_RAM) | |
| 234 | AM_RANGE(0x9800, 0x9bff) AM_READ(SMH_RAM) | |
| 235 | AM_RANGE(0xa800, 0xa800) AM_READ(input_port_2_r) | |
| 236 | AM_RANGE(0xb800, 0xb800) AM_READ(SMH_NOP) | |
| 237 | ADDRESS_MAP_END | |
| 238 | ||
| 239 | static ADDRESS_MAP_START( pickin_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 240 | AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM) | |
| 241 | AM_RANGE(0x7000, 0x77ff) AM_WRITE(SMH_RAM) | |
| 242 | AM_RANGE(0x8800, 0x8bff) AM_WRITE(bagman_videoram_w) AM_BASE(&videoram) | |
| 243 | AM_RANGE(0x9800, 0x9bff) AM_WRITE(bagman_colorram_w) AM_BASE(&colorram) | |
| 244 | AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) | |
| 245 | AM_RANGE(0xa001, 0xa002) AM_WRITE(bagman_flipscreen_w) | |
| 246 | AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&bagman_video_enable) | |
| 223 | static ADDRESS_MAP_START( pickin_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 224 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 225 | AM_RANGE(0x7000, 0x77ff) AM_RAM | |
| 226 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(bagman_videoram_w) AM_BASE(&videoram) | |
| 227 | AM_RANGE(0x9800, 0x9bff) AM_RAM_WRITE(bagman_colorram_w) AM_BASE(&colorram) | |
| 247 | 228 | AM_RANGE(0x9800, 0x981f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* hidden portion of color RAM */ |
| 248 | 229 | /* here only to initialize the pointer, */ |
| 249 | 230 | /* writes are handled by bagman_colorram_w */ |
| 250 | 231 | AM_RANGE(0x9c00, 0x9fff) AM_WRITE(SMH_NOP) /* written to, but unused */ |
| 232 | AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) | |
| 233 | AM_RANGE(0xa001, 0xa002) AM_WRITE(bagman_flipscreen_w) | |
| 234 | AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&bagman_video_enable) | |
| 251 | 235 | AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w) |
| 236 | AM_RANGE(0xa800, 0xa800) AM_READ(input_port_2_r) | |
| 252 | 237 | #if 0 |
| 253 | 238 | AM_RANGE(0xa007, 0xa007) AM_WRITE(SMH_NOP) /* ???? */ |
| 254 | 239 | AM_RANGE(0xb000, 0xb000) AM_WRITE(SMH_NOP) /* ???? */ |
| 240 | AM_RANGE(0xb800, 0xb800) AM_READ(SMH_NOP) | |
| 255 | 241 | AM_RANGE(0xb800, 0xb800) AM_WRITE(SMH_NOP) /* ???? */ |
| 256 | 242 | #endif |
| 257 | 243 | ADDRESS_MAP_END |
| 258 | 244 | |
| 259 | static ADDRESS_MAP_START( | |
| 245 | static ADDRESS_MAP_START( m | |
| 260 | 246 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 261 | AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r) | |
| 262 | ADDRESS_MAP_END | |
| 263 | ||
| 264 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 265 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 266 | 247 | AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_0_w) |
| 267 | 248 | AM_RANGE(0x09, 0x09) AM_WRITE(AY8910_write_port_0_w) |
| 249 | AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r) | |
| 268 | 250 | //AM_RANGE(0x56, 0x56) AM_WRITE(SMH_NOP) |
| 269 | 251 | ADDRESS_MAP_END |
| 270 | 252 | |
| r2418 | r2419 | |
| 428 | 410 | |
| 429 | 411 | /* basic machine hardware */ |
| 430 | 412 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 431 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 432 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 413 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 414 | MDRV_CPU_IO_MAP(main_portmap,0) | |
| 433 | 415 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 434 | 416 | |
| 435 | 417 | MDRV_MACHINE_RESET(bagman) |
| r2418 | r2419 | |
| 464 | 446 | |
| 465 | 447 | /* basic machine hardware */ |
| 466 | 448 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 467 | MDRV_CPU_PROGRAM_MAP(pickin_readmem,pickin_writemem) | |
| 468 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 449 | MDRV_CPU_PROGRAM_MAP(pickin_map,0) | |
| 450 | MDRV_CPU_IO_MAP(main_portmap,0) | |
| 469 | 451 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 470 | 452 | |
| 471 | 453 | MDRV_MACHINE_RESET(bagman) |
| r2418 | r2419 | |
| 514 | 496 | |
| 515 | 497 | /* basic machine hardware */ |
| 516 | 498 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 517 | MDRV_CPU_PROGRAM_MAP(pickin_readmem,pickin_writemem) | |
| 518 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 499 | MDRV_CPU_PROGRAM_MAP(pickin_map,0) | |
| 500 | MDRV_CPU_IO_MAP(main_portmap,0) | |
| 519 | 501 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 520 | 502 | |
| 521 | 503 | MDRV_MACHINE_RESET(bagman) |
| r2418 | r2419 | |
|---|---|---|
| 73 | 73 | AM_RANGE(0xc804, 0xc804) AM_WRITE(commando_c804_w) |
| 74 | 74 | AM_RANGE(0xc808, 0xc809) AM_WRITE(commando_scrollx_w) |
| 75 | 75 | AM_RANGE(0xc80a, 0xc80b) AM_WRITE(commando_scrolly_w) |
| 76 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(commando_videoram2_w) AM_BASE(&commando_videoram2) | |
| 77 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_WRITE(commando_colorram2_w) AM_BASE(&commando_colorram2) | |
| 78 | AM_RANGE(0xd800, 0xdbff) AM_RAM AM_WRITE(commando_videoram_w) AM_BASE(&videoram) | |
| 79 | AM_RANGE(0xdc00, 0xdfff) AM_RAM AM_WRITE(commando_colorram_w) AM_BASE(&colorram) | |
| 76 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(commando_videoram2_w) AM_BASE(&commando_videoram2) | |
| 77 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(commando_colorram2_w) AM_BASE(&commando_colorram2) | |
| 78 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(commando_videoram_w) AM_BASE(&videoram) | |
| 79 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(commando_colorram_w) AM_BASE(&colorram) | |
| 80 | 80 | AM_RANGE(0xe000, 0xfdff) AM_RAM |
| 81 | 81 | AM_RANGE(0xfe00, 0xff7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 82 | 82 | AM_RANGE(0xff80, 0xffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 710 | 710 | /* full memory map derived from schematics */ |
| 711 | 711 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 712 | 712 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 713 | AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_R | |
| 713 | AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_R | |
| 714 | 714 | AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE(adc_r, bankselect_w) AM_BASE(&bankselect) |
| 715 | 715 | AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w) |
| 716 | 716 | AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w) |
| r2418 | r2419 | |
|---|---|---|
| 8 | 8 | sprite framebuffer, therefore overdrawing new sprites on top of the ones drawn |
| 9 | 9 | in the previous frames. |
| 10 | 10 | When sprite overdrawing is enabled, not all sprites leave trails: only the ones |
| 11 | using color codes C, D, and E. Sprites using color code F have the special | |
| 12 | effect of clearing the trails which have been left by other sprites. | |
| 11 | using color codes C, D, and E. | |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | Game Board |
| r2418 | r2419 | |
| 378 | 377 | AM_RANGE(0xc202, 0xc202) AM_WRITE(ninjakd2_bankselect_w) |
| 379 | 378 | AM_RANGE(0xc203, 0xc203) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| 380 | 379 | AM_RANGE(0xc208, 0xc20c) AM_WRITE(ninjakd2_bg_ctrl_w) // scroll + enable |
| 381 | AM_RANGE(0xc800, 0xcdff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 382 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 383 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) | |
| 380 | AM_RANGE(0xc800, 0xcdff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 381 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 382 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) | |
| 384 | 383 | AM_RANGE(0xe000, 0xf9ff) AM_RAM |
| 385 | 384 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) |
| 386 | 385 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 391 | 390 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 392 | 391 | AM_RANGE(0xc000, 0xd9ff) AM_RAM |
| 393 | 392 | AM_RANGE(0xda00, 0xdfff) AM_RAM AM_BASE(&spriteram) |
| 394 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) | |
| 395 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 396 | AM_RANGE(0xf000, 0xf5ff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 393 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) | |
| 394 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 395 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 397 | 396 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("KEYCOIN") |
| 398 | 397 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("PAD1") |
| 399 | 398 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("PAD2") |
| r2418 | r2419 | |
| 410 | 409 | static ADDRESS_MAP_START( robokid_main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 411 | 410 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 412 | 411 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 413 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 414 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 412 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 413 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 415 | 414 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked |
| 416 | 415 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked |
| 417 | 416 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(robokid_bg0_videoram_r, robokid_bg0_videoram_w) // banked |
| r2418 | r2419 | |
| 455 | 454 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(robokid_bg0_videoram_r, robokid_bg0_videoram_w) // banked |
| 456 | 455 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked |
| 457 | 456 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked |
| 458 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 459 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 457 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 458 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 460 | 459 | AM_RANGE(0xe000, 0xf9ff) AM_RAM |
| 461 | 460 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) |
| 462 | 461 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 1473 | 1472 | *************************************/ |
| 1474 | 1473 | |
| 1475 | 1474 | GAME( 1987, ninjakd2, 0, ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)", 0 ) |
| 1476 | GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2)", 0 ) | |
| 1477 | GAME( 1987, ninjak2b, ninjakd2, ninjakd2, rdaction, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3)", 0 ) | |
| 1475 | GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2, bootleg?)", 0 ) | |
| 1476 | GAME( 1987, ninjak2b, ninjakd2, ninjakd2, rdaction, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?)", 0 ) | |
| 1478 | 1477 | GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2, ROT0, "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", 0 ) |
| 1479 | 1478 | GAME( 1987, mnight, 0, mnight, mnight, mnight, ROT0, "UPL (Kawakus license)", "Mutant Night", GAME_IMPERFECT_GRAPHICS ) |
| 1480 | 1479 | GAME( 1987, arkarea, 0, mnight, arkarea, mnight, ROT0, "UPL", "Ark Area", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 184 | 184 | static ADDRESS_MAP_START( skydiver_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 185 | 185 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 186 | 186 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x4300) AM_READWRITE(skydiver_wram_r, skydiver_wram_w) |
| 187 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x4000) AM_READWRITE(SMH_RAM, SMH_RAM) /* RAM B1 */ | |
| 188 | AM_RANGE(0x0400, 0x07ff) AM_MIRROR(0x4000) AM_READWRITE(SMH_RAM, skydiver_videoram_w) AM_BASE(&skydiver_videoram) /* RAMs K1,M1,P1,J1,N1,K/L1,L1,H/J1 */ | |
| 187 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x4000) AM_RAM_WRITE(SMH_RAM) /* RAM B1 */ | |
| 188 | AM_RANGE(0x0400, 0x07ff) AM_MIRROR(0x4000) AM_RAM_WRITE(skydiver_videoram_w) AM_BASE(&skydiver_videoram) /* RAMs K1,M1,P1,J1,N1,K/L1,L1,H/J1 */ | |
| 189 | 189 | AM_RANGE(0x0800, 0x0801) AM_MIRROR(0x47f0) AM_WRITE(skydiver_lamp_s_w) |
| 190 | 190 | AM_RANGE(0x0802, 0x0803) AM_MIRROR(0x47f0) AM_WRITE(skydiver_lamp_k_w) |
| 191 | 191 | AM_RANGE(0x0804, 0x0805) AM_MIRROR(0x47f0) AM_WRITE(skydiver_start_lamp_1_w) |
| r2418 | r2419 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 62 | 62 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 63 | AM_RANGE(0x8000, 0x83ff) AM_READWRITE(SMH_RAM, m52_videoram_w) AM_BASE(&videoram) | |
| 64 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(SMH_RAM, m52_colorram_w) AM_BASE(&colorram) | |
| 63 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(m52_videoram_w) AM_BASE(&videoram) | |
| 64 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(m52_colorram_w) AM_BASE(&colorram) | |
| 65 | 65 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(m52_protection_r) |
| 66 | 66 | AM_RANGE(0xc800, 0xcbff) AM_MIRROR(0x0400) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 67 | 67 | AM_RANGE(0xd000, 0xd000) AM_MIRROR(0x07fc) AM_WRITE(irem_sound_cmd_w) |
| r2418 | r2419 | |
| 77 | 77 | |
| 78 | 78 | static ADDRESS_MAP_START( alpha1v_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 79 | 79 | AM_RANGE(0x0000, 0x6fff) AM_ROM |
| 80 | AM_RANGE(0x8000, 0x83ff) AM_READWRITE(SMH_RAM, m52_videoram_w) AM_BASE(&videoram) | |
| 81 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(SMH_RAM, m52_colorram_w) AM_BASE(&colorram) | |
| 80 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(m52_videoram_w) AM_BASE(&videoram) | |
| 81 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(m52_colorram_w) AM_BASE(&colorram) | |
| 82 | 82 | AM_RANGE(0xc800, 0xc9ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) AM_SHARE(1) // bigger or mirrored? |
| 83 | 83 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("IN0") AM_WRITE(irem_sound_cmd_w) |
| 84 | 84 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("IN1") AM_WRITE(alpha1v_flipscreen_w) |
| r2418 | r2419 | |
|---|---|---|
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | |
| 302 | static ADDRESS_MAP_START( readmem_geebee, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 303 | AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM) | |
| 304 | AM_RANGE(0x2000, 0x23ff) AM_READ(SMH_RAM) | |
| 305 | AM_RANGE(0x3000, 0x37ff) AM_READ(SMH_ROM) /* 3000-33ff in GeeBee */ | |
| 306 | AM_RANGE(0x4000, 0x40ff) AM_READ(SMH_RAM) | |
| 307 | AM_RANGE(0x5000, 0x53ff) AM_READ(geebee_in_r) | |
| 308 | ADDRESS_MAP_END | |
| 309 | ||
| 310 | static ADDRESS_MAP_START( writemem_geebee, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 311 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM) | |
| 312 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(geebee_videoram_w) AM_BASE(&geebee_videoram) | |
| 302 | static ADDRESS_MAP_START( geebee_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 303 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 304 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(geebee_videoram_w) AM_BASE(&geebee_videoram) | |
| 313 | 305 | AM_RANGE(0x2400, 0x27ff) AM_WRITE(geebee_videoram_w) /* mirror used by kaiteik due to a bug */ |
| 314 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(SMH_ROM) | |
| 315 | AM_RANGE(0x4000, 0x40ff) AM_WRITE(SMH_RAM) | |
| 306 | AM_RANGE(0x3000, 0x37ff) AM_ROM /* 3000-33ff in GeeBee */ | |
| 307 | AM_RANGE(0x4000, 0x40ff) AM_RAM | |
| 308 | AM_RANGE(0x5000, 0x53ff) AM_READ(geebee_in_r) | |
| 316 | 309 | AM_RANGE(0x6000, 0x6fff) AM_WRITE(geebee_out6_w) |
| 317 | 310 | AM_RANGE(0x7000, 0x7fff) AM_WRITE(geebee_out7_w) |
| 318 | 311 | ADDRESS_MAP_END |
| 319 | 312 | |
| 320 | static ADDRESS_MAP_START( | |
| 313 | static ADDRESS_MAP_START( | |
| 321 | 314 | AM_RANGE(0x50, 0x53) AM_READ(geebee_in_r) |
| 322 | ADDRESS_MAP_END | |
| 323 | ||
| 324 | static ADDRESS_MAP_START( writeport_geebee, ADDRESS_SPACE_IO, 8 ) | |
| 325 | 315 | AM_RANGE(0x60, 0x6f) AM_WRITE(geebee_out6_w) |
| 326 | 316 | AM_RANGE(0x70, 0x7f) AM_WRITE(geebee_out7_w) |
| 327 | 317 | ADDRESS_MAP_END |
| 328 | 318 | |
| 329 | 319 | |
| 330 | static ADDRESS_MAP_START( readmem_bombbee, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 331 | AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM) | |
| 332 | AM_RANGE(0x2000, 0x23ff) AM_READ(SMH_RAM) | |
| 333 | AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM) | |
| 334 | AM_RANGE(0x4800, 0x4fff) AM_READ(SMH_ROM) | |
| 335 | AM_RANGE(0x6000, 0x600f) AM_READ(warpwarp_sw_r) | |
| 336 | AM_RANGE(0x6010, 0x601f) AM_READ(warpwarp_vol_r) | |
| 337 | AM_RANGE(0x6020, 0x602f) AM_READ(warpwarp_dsw1_r) | |
| 338 | ADDRESS_MAP_END | |
| 339 | ||
| 340 | static ADDRESS_MAP_START( readmem_warpwarp, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 341 | AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM) | |
| 342 | AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM) | |
| 343 | AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM) | |
| 344 | AM_RANGE(0x4800, 0x4fff) AM_READ(SMH_ROM) | |
| 345 | AM_RANGE(0xc000, 0xc00f) AM_READ(warpwarp_sw_r) | |
| 346 | AM_RANGE(0xc010, 0xc01f) AM_READ(warpwarp_vol_r) | |
| 347 | AM_RANGE(0xc020, 0xc02f) AM_READ(warpwarp_dsw1_r) | |
| 348 | ADDRESS_MAP_END | |
| 349 | ||
| 350 | static ADDRESS_MAP_START( writemem_bombbee, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 351 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM) | |
| 352 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(SMH_RAM) | |
| 353 | AM_RANGE(0x4000, 0x47ff) AM_WRITE(warpwarp_videoram_w) AM_BASE(&warpwarp_videoram) | |
| 354 | AM_RANGE(0x4800, 0x4fff) AM_WRITE(SMH_ROM) | |
| 355 | AM_RANGE(0x6000, 0x600f) AM_WRITE(warpwarp_out0_w) | |
| 356 | AM_RANGE(0x6010, 0x601f) AM_WRITE(warpwarp_music1_w) | |
| 357 | AM_RANGE(0x6020, 0x602f) AM_WRITE(warpwarp_music2_w) | |
| 320 | static ADDRESS_MAP_START( bombbee_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 321 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 322 | AM_RANGE(0x2000, 0x23ff) AM_RAM | |
| 323 | AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_BASE(&warpwarp_videoram) | |
| 324 | AM_RANGE(0x4800, 0x4fff) AM_ROM | |
| 325 | AM_RANGE(0x6000, 0x600f) AM_READWRITE(warpwarp_sw_r, warpwarp_out0_w) | |
| 326 | AM_RANGE(0x6010, 0x601f) AM_READWRITE(warpwarp_vol_r, warpwarp_music1_w) | |
| 327 | AM_RANGE(0x6020, 0x602f) AM_READWRITE(warpwarp_dsw1_r, warpwarp_music2_w) | |
| 358 | 328 | AM_RANGE(0x6030, 0x603f) AM_WRITE(warpwarp_out3_w) |
| 359 | 329 | ADDRESS_MAP_END |
| 360 | 330 | |
| 361 | static ADDRESS_MAP_START( writemem_warpwarp, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 362 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM) | |
| 363 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM) | |
| 364 | AM_RANGE(0x4000, 0x47ff) AM_WRITE(warpwarp_videoram_w) AM_BASE(&warpwarp_videoram) | |
| 365 | AM_RANGE(0x4800, 0x4fff) AM_WRITE(SMH_ROM) | |
| 366 | AM_RANGE(0xc000, 0xc00f) AM_WRITE(warpwarp_out0_w) | |
| 367 | AM_RANGE(0xc010, 0xc01f) AM_WRITE(warpwarp_music1_w) | |
| 368 | AM_RANGE(0xc020, 0xc02f) AM_WRITE(warpwarp_music2_w) | |
| 331 | static ADDRESS_MAP_START( warpwarp_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 332 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 333 | AM_RANGE(0x8000, 0x83ff) AM_RAM | |
| 334 | AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_BASE(&warpwarp_videoram) | |
| 335 | AM_RANGE(0x4800, 0x4fff) AM_ROM | |
| 336 | AM_RANGE(0xc000, 0xc00f) AM_READWRITE(warpwarp_sw_r, warpwarp_out0_w) | |
| 337 | AM_RANGE(0xc010, 0xc01f) AM_READWRITE(warpwarp_vol_r, warpwarp_music1_w) | |
| 338 | AM_RANGE(0xc020, 0xc02f) AM_READWRITE(warpwarp_dsw1_r, warpwarp_music2_w) | |
| 369 | 339 | AM_RANGE(0xc030, 0xc03f) AM_WRITE(warpwarp_out3_w) |
| 370 | 340 | ADDRESS_MAP_END |
| 371 | 341 | |
| 372 | 342 | |
| 373 | ||
| 374 | 343 | static INPUT_PORTS_START( geebee ) |
| 375 | 344 | PORT_START_TAG("SW0") |
| 376 | 345 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r2418 | r2419 | |
| 835 | 804 | |
| 836 | 805 | /* basic machine hardware */ |
| 837 | 806 | MDRV_CPU_ADD_TAG("main", 8080,XTAL_18_432MHz/9) /* verified on pcb */ |
| 838 | MDRV_CPU_PROGRAM_MAP(readmem_geebee,writemem_geebee) | |
| 839 | MDRV_CPU_IO_MAP(readport_geebee,writeport_geebee) | |
| 807 | MDRV_CPU_PROGRAM_MAP(geebee_map,0) | |
| 808 | MDRV_CPU_IO_MAP(geebee_port_map,0) | |
| 840 | 809 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse) |
| 841 | 810 | |
| 842 | 811 | /* video hardware */ |
| r2418 | r2419 | |
| 879 | 848 | |
| 880 | 849 | /* basic machine hardware */ |
| 881 | 850 | MDRV_CPU_ADD_TAG("main", 8080,18432000/9) /* 18.432 MHz / 9 */ |
| 882 | MDRV_CPU_PROGRAM_MAP( | |
| 851 | MDRV_CPU_PROGRAM_MAP( | |
| 883 | 852 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 884 | 853 | |
| 885 | 854 | /* video hardware */ |
| r2418 | r2419 | |
| 910 | 879 | /* basic machine hardware */ |
| 911 | 880 | MDRV_IMPORT_FROM(bombbee) |
| 912 | 881 | MDRV_CPU_MODIFY("main") |
| 913 | MDRV_CPU_PROGRAM_MAP( | |
| 882 | MDRV_CPU_PROGRAM_MAP( | |
| 914 | 883 | MACHINE_DRIVER_END |
| 915 | 884 | |
| 916 | 885 |
| r2418 | r2419 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | 48 | #include "deprecat.h" |
| 49 | #include "memconv.h" | |
| 50 | 49 | #include "sound/custom.h" |
| 51 | 50 | #include "includes/amiga.h" |
| 52 | 51 | #include "includes/cubocd32.h" |
| 53 | 52 | |
| 54 | static READ32_HANDLER( amiga_cia32_r ) | |
| 55 | { | |
| 56 | return read32be_with_16be_handler(amiga_cia_r, machine, offset, mem_mask); | |
| 57 | } | |
| 58 | ||
| 59 | static WRITE32_HANDLER( amiga_cia32_w ) | |
| 60 | { | |
| 61 | write32be_with_16be_handler(amiga_cia_w, machine, offset, data, mem_mask); | |
| 62 | } | |
| 63 | ||
| 64 | static READ32_HANDLER( amiga_custom32_r ) | |
| 65 | { | |
| 66 | return read32be_with_16be_handler(amiga_custom_r, machine, offset, mem_mask); | |
| 67 | } | |
| 68 | ||
| 69 | static WRITE32_HANDLER( amiga_custom32_w ) | |
| 70 | { | |
| 71 | write32be_with_16be_handler(amiga_custom_w, machine, offset, data, mem_mask); | |
| 72 | } | |
| 73 | ||
| 74 | 53 | static WRITE32_HANDLER( aga_overlay_w ) |
| 75 | 54 | { |
| 76 | 55 | if (ACCESSING_BITS_16_23) |
| r2418 | r2419 | |
| 83 | 62 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 84 | 63 | if ((data & 1) == 0) |
| 85 | 64 | /* overlay disabled, map RAM on 0x000000 */ |
| 86 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_BANK1); | |
| 65 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_BANK1); | |
| 87 | 66 | else |
| 88 | 67 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 89 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP); | |
| 68 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP); | |
| 90 | 69 | } |
| 91 | 70 | } |
| 92 | 71 | |
| r2418 | r2419 | |
| 158 | 137 | AM_RANGE(0x800000, 0x800003) AM_READ( dipswitch_r ) |
| 159 | 138 | AM_RANGE(0xb80000, 0xb8003f) AM_READWRITE(amiga_akiko32_r, amiga_akiko32_w) |
| 160 | 139 | AM_RANGE(0xbfa000, 0xbfa003) AM_WRITE(aga_overlay_w) |
| 161 | AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE(amiga_cia32_r, amiga_cia32_w) | |
| 162 | AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE(amiga_custom32_r, amiga_custom32_w) AM_BASE((UINT32**)&amiga_custom_regs) | |
| 140 | AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE16(amiga_cia_r, amiga_cia_w, 0xffffffff) | |
| 141 | AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE16(amiga_custom_r, amiga_custom_w, 0xffffffff) AM_BASE((UINT32**)&amiga_custom_regs) | |
| 163 | 142 | AM_RANGE(0xe00000, 0xe7ffff) AM_ROM AM_REGION(REGION_USER1, 0x80000) /* CD32 Extended ROM */ |
| 164 | 143 | AM_RANGE(0xa00000, 0xf7ffff) AM_NOP |
| 165 | 144 | AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION(REGION_USER1, 0x0) /* Kickstart */ |
| r2418 | r2419 | |
|---|---|---|
| 666 | 666 | |
| 667 | 667 | static DRIVER_INIT( diamond ) |
| 668 | 668 | { |
| 669 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, diamond_hack_r); | |
| 669 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, diamond_hack_r); | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 |
| r2418 | r2419 | |
|---|---|---|
| 105 | 105 | static ADDRESS_MAP_START( main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 106 | 106 | AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION(REGION_CPU1, 0x10000) |
| 107 | 107 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 108 | AM_RANGE(0xc800, 0xc87f) AM_READWRITE(SMH_RAM, palette1_w) AM_BASE(&paletteram) | |
| 109 | AM_RANGE(0xc900, 0xc97f) AM_READWRITE(SMH_RAM, palette2_w) AM_BASE(&paletteram_2) | |
| 110 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, onetwo_fgram_w) AM_BASE(&fgram) | |
| 108 | AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_BASE(&paletteram) | |
| 109 | AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_BASE(&paletteram_2) | |
| 110 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_BASE(&fgram) | |
| 111 | 111 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 112 | 112 | ADDRESS_MAP_END |
| 113 | 113 |
| r2418 | r2419 | |
|---|---|---|
| 166 | 166 | static ADDRESS_MAP_START( wc90b_map1, ADDRESS_SPACE_PROGRAM, 8 ) |
| 167 | 167 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 168 | 168 | AM_RANGE(0x8000, 0x9fff) AM_RAM /* Main RAM */ |
| 169 | AM_RANGE(0xa000, 0xafff) AM_RAM AM_WRITE(wc90b_fgvideoram_w) AM_BASE(&wc90b_fgvideoram) | |
| 170 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_WRITE(wc90b_bgvideoram_w) AM_BASE(&wc90b_bgvideoram) | |
| 171 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_WRITE(wc90b_txvideoram_w) AM_BASE(&wc90b_txvideoram) | |
| 169 | AM_RANGE(0xa000, 0xafff) AM_RAM_WRITE(wc90b_fgvideoram_w) AM_BASE(&wc90b_fgvideoram) | |
| 170 | AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(wc90b_bgvideoram_w) AM_BASE(&wc90b_bgvideoram) | |
| 171 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(wc90b_txvideoram_w) AM_BASE(&wc90b_txvideoram) | |
| 172 | 172 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(1) |
| 173 | 173 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90b_shared_r, wc90b_shared_w) AM_BASE(&wc90b_shared) |
| 174 | 174 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90b_bankswitch_w) |
| r2418 | r2419 | |
| 188 | 188 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 189 | 189 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 190 | 190 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 191 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 191 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 192 | 192 | AM_RANGE(0xe800, 0xefff) AM_ROM |
| 193 | 193 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(2) |
| 194 | 194 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90b_shared_r, wc90b_shared_w) |
| r2418 | r2419 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 57 | 57 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 58 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 58 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 59 | 59 | AM_RANGE(0xd000, 0xd001) AM_WRITE(kncljoe_scroll_w) AM_BASE(&kncljoe_scrollregs) |
| 60 | 60 | AM_RANGE(0xd800, 0xd800) AM_READ(input_port_0_r) /* IN 0 */ |
| 61 | 61 | AM_RANGE(0xd801, 0xd801) AM_READ(input_port_1_r) /* IN 1 */ |
| r2418 | r2419 | |
|---|---|---|
| 928 | 928 | { |
| 929 | 929 | DRIVER_INIT_CALL(prosport); |
| 930 | 930 | |
| 931 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r); | |
| 931 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r); | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | static DRIVER_INIT( liberate ) |
| r2418 | r2419 | |
|---|---|---|
| 120 | 120 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) |
| 121 | 121 | AM_RANGE(0xc804, 0xc804) AM_WRITE(gunsmoke_c804_w) // ROM bank switch, screen flip |
| 122 | 122 | AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w) |
| 123 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(gunsmoke_videoram_w) AM_BASE(&videoram) | |
| 124 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_WRITE(gunsmoke_colorram_w) AM_BASE(&colorram) | |
| 123 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(gunsmoke_videoram_w) AM_BASE(&videoram) | |
| 124 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(gunsmoke_colorram_w) AM_BASE(&colorram) | |
| 125 | 125 | AM_RANGE(0xd800, 0xd801) AM_RAM AM_BASE(&gunsmoke_scrollx) |
| 126 | 126 | AM_RANGE(0xd802, 0xd802) AM_RAM AM_BASE(&gunsmoke_scrolly) |
| 127 | 127 | AM_RANGE(0xd806, 0xd806) AM_WRITE(gunsmoke_d806_w) // sprites and bg enable |
| r2418 | r2419 | |
|---|---|---|
| 663 | 663 | AM_RANGE(0xa800, 0xa807) AM_MIRROR(0x07f8) AM_WRITE(turbo_coin_and_lamp_w) |
| 664 | 664 | AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(turbo_state, sprite_position) |
| 665 | 665 | AM_RANGE(0xb800, 0xbfff) AM_WRITE(turbo_analog_reset_w) |
| 666 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 666 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 667 | 667 | AM_RANGE(0xe800, 0xefff) AM_WRITE(turbo_collision_clear_w) |
| 668 | 668 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 669 | 669 | AM_RANGE(0xf800, 0xf803) AM_MIRROR(0x00fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| r2418 | r2419 | |
| 693 | 693 | AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x07fc) AM_READ(input_port_3_r) // INPUT 253 |
| 694 | 694 | AM_RANGE(0xb000, 0xb7ff) AM_RAM // SCRATCH |
| 695 | 695 | AM_RANGE(0xb800, 0xbfff) // HANDLE CL |
| 696 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 696 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 697 | 697 | AM_RANGE(0xe800, 0xe803) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 698 | 698 | AM_RANGE(0xf000, 0xf003) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 699 | 699 | AM_RANGE(0xf800, 0xf801) AM_MIRROR(0x07fe) AM_READWRITE(turbo_8279_r, turbo_8279_w) |
| r2418 | r2419 | |
| 710 | 710 | static ADDRESS_MAP_START( buckrog_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 711 | 711 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 712 | 712 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 713 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 713 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 714 | 714 | AM_RANGE(0xc800, 0xc803) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_0_r, buckrog_ppi8255_0_w) // 8255 |
| 715 | 715 | AM_RANGE(0xd000, 0xd003) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) // 8255 |
| 716 | 716 | AM_RANGE(0xd800, 0xd801) AM_MIRROR(0x07fe) AM_READWRITE(turbo_8279_r, turbo_8279_w) // 8279 |
| r2418 | r2419 | |
|---|---|---|
| 9285 | 9285 | static DRIVER_INIT( twineagl ) |
| 9286 | 9286 | { |
| 9287 | 9287 | /* debug? */ |
| 9288 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x8000ff, 0, 0, twineagl_debug_r); | |
| 9288 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x8000ff, 0, 0, twineagl_debug_r); | |
| 9289 | 9289 | |
| 9290 | 9290 | /* This allows 2 simultaneous players and the use of the "Copyright" Dip Switch. */ |
| 9291 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_r); | |
| 9292 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_w); | |
| 9291 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_r, twineagl_200100_w); | |
| 9293 | 9292 | } |
| 9294 | 9293 | |
| 9295 | 9294 | |
| r2418 | r2419 | |
| 9319 | 9318 | |
| 9320 | 9319 | static DRIVER_INIT( downtown ) |
| 9321 | 9320 | { |
| 9322 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_r); | |
| 9323 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_w); | |
| 9321 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_r, downtown_protection_w); | |
| 9324 | 9322 | } |
| 9325 | 9323 | |
| 9326 | 9324 | |
| r2418 | r2419 | |
| 9340 | 9338 | |
| 9341 | 9339 | static DRIVER_INIT( arbalest ) |
| 9342 | 9340 | { |
| 9343 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x8000f, 0, 0, arbalest_debug_r); | |
| 9341 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x8000f, 0, 0, arbalest_debug_r); | |
| 9344 | 9342 | } |
| 9345 | 9343 | |
| 9346 | 9344 | |
| r2418 | r2419 | |
| 9349 | 9347 | UINT16 *RAM = (UINT16 *) memory_region(REGION_CPU1); |
| 9350 | 9348 | |
| 9351 | 9349 | /* This game uses the 21c000-21ffff area for protection? */ |
| 9352 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP); | |
| 9353 | // memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP); | |
| 9350 | // memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP, SMH_NOP); | |
| 9354 | 9351 | |
| 9355 | 9352 | RAM[0x8ab1c/2] = 0x4e71; // patch protection test: "cp error" |
| 9356 | 9353 | RAM[0x8ab1e/2] = 0x4e71; |
| r2418 | r2419 | |
| 9394 | 9391 | |
| 9395 | 9392 | static DRIVER_INIT( eightfrc ) |
| 9396 | 9393 | { |
| 9397 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500004, 0x500005, 0, 0, SMH_NOP); // watchdog?? | |
| 9394 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500004, 0x500005, 0, 0, SMH_NOP); // watchdog?? | |
| 9398 | 9395 | } |
| 9399 | 9396 | |
| 9400 | 9397 | |
| 9401 | 9398 | static DRIVER_INIT( zombraid ) |
| 9402 | 9399 | { |
| 9403 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00002, 0xf00003, 0, 0, zombraid_gun_r); | |
| 9404 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf00001, 0, 0, zombraid_gun_w); | |
| 9400 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00002, 0xf00003, 0, 0, zombraid_gun_r); | |
| 9401 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf00001, 0, 0, zombraid_gun_w); | |
| 9405 | 9402 | } |
| 9406 | 9403 | |
| 9407 | 9404 | |
| r2418 | r2419 | |
| 9419 | 9416 | |
| 9420 | 9417 | static DRIVER_INIT( rezon ) |
| 9421 | 9418 | { |
| 9422 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500006, 0x500007, 0, 0, SMH_NOP); // irq ack? | |
| 9419 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500006, 0x500007, 0, 0, SMH_NOP); // irq ack? | |
| 9423 | 9420 | } |
| 9424 | 9421 | |
| 9425 | 9422 | static DRIVER_INIT(wiggie) |
| r2418 | r2419 | |
| 9451 | 9448 | } |
| 9452 | 9449 | |
| 9453 | 9450 | /* X1_010 is not used. */ |
| 9454 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP); | |
| 9455 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP); | |
| 9451 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP, SMH_NOP); | |
| 9456 | 9452 | |
| 9457 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xB00008, 0xB00009, 0, 0, wiggie_soundlatch_w); | |
| 9453 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xB00008, 0xB00009, 0, 0, wiggie_soundlatch_w); | |
| 9458 | 9454 | |
| 9459 | 9455 | } |
| 9460 | 9456 |
| r2418 | r2419 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | static DRIVER_INIT( ssf2ghw ) |
| 20 | 20 | { |
| 21 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, SMH_NOP); // custom banking is disabled (!) | |
| 22 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_BANK5); | |
| 23 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_UNMAP); | |
| 21 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, SMH_NOP); // custom banking is disabled (!) | |
| 22 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_BANK5, SMH_UNMAP); | |
| 24 | 23 | |
| 25 | 24 | memory_set_bankptr( 5, memory_region( REGION_CPU1 )+0x400000 ); |
| 26 | 25 | |
| 27 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r ); | |
| 26 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r ); | |
| 28 | 27 | |
| 29 | 28 | DRIVER_INIT_CALL(megadrij); |
| 30 | 29 |
| r2418 | r2419 | |
|---|---|---|
| 182 | 182 | AM_RANGE(0x2000, 0x2000) AM_READ(tp84_scanline_r) /* beam position */ |
| 183 | 183 | AM_RANGE(0x4000, 0x4000) AM_WRITE(interrupt_enable_w) |
| 184 | 184 | AM_RANGE(0x6000, 0x679f) AM_RAM |
| 185 | AM_RANGE(0x67a0, 0x67ff) AM_R | |
| 185 | AM_RANGE(0x67a0, 0x67ff) AM_R | |
| 186 | 186 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE(1) |
| 187 | 187 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 188 | 188 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 149 | 149 | AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w) |
| 150 | 150 | AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE(atarigen_eeprom_enable_w) |
| 151 | 151 | AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w) |
| 152 | AM_RANGE(0x3e0000, 0x3e0fff) AM_MIRROR(0x100000) AM_R | |
| 152 | AM_RANGE(0x3e0000, 0x3e0fff) AM_MIRROR(0x100000) AM_R | |
| 153 | 153 | AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_READWRITE(batman_atarivc_r, batman_atarivc_w) AM_BASE(&atarivc_data) |
| 154 | 154 | AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield2_latched_msb_w) AM_BASE(&atarigen_playfield2) |
| 155 | 155 | AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) |
| r2418 | r2419 | |
|---|---|---|
| 801 | 801 | AM_RANGE(0x000000, 0x00ffff) AM_ROM |
| 802 | 802 | AM_RANGE(0x040000, 0x05ffff) AM_ROM |
| 803 | 803 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 804 | AM_RANGE(0x090000, 0x091fff) AM_RAM | |
| 804 | AM_RANGE(0x090000, 0x091fff) AM_RAM | |
| 805 | 805 | AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(nemesis_irq_enable_word_w) /* irq enable */ |
| 806 | 806 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(salamand_soundlatch_word_w) |
| 807 | 807 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ(input_port_4_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 869 | 869 | |
| 870 | 870 | static DRIVER_INIT( asteroib ) |
| 871 | 871 | { |
| 872 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, asteroib_IN0_r); | |
| 873 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_3_r); | |
| 872 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, asteroib_IN0_r); | |
| 873 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_3_r); | |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | |
| 877 | 877 | static DRIVER_INIT( asterock ) |
| 878 | 878 | { |
| 879 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2007, 0, 0, asterock_IN0_r); | |
| 879 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2007, 0, 0, asterock_IN0_r); | |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 |
| r2418 | r2419 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | static ADDRESS_MAP_START( magicstk_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 108 | 108 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 109 | AM_RANGE(0x088000, 0x0883ff) AM_RAM | |
| 109 | AM_RANGE(0x088000, 0x0883ff) AM_RAM | |
| 110 | 110 | AM_RANGE(0x094000, 0x094001) AM_WRITENOP |
| 111 | 111 | AM_RANGE(0x094002, 0x094003) AM_WRITENOP |
| 112 | 112 | AM_RANGE(0x094004, 0x094005) AM_WRITE(tile_banking_w) |
| 113 | AM_RANGE(0x098180, 0x09917f) AM_R | |
| 113 | AM_RANGE(0x098180, 0x09917f) AM_R | |
| 114 | 114 | AM_RANGE(0x0c2010, 0x0c2011) AM_READ(input_port_0_word_r) |
| 115 | 115 | AM_RANGE(0x0c2012, 0x0c2013) AM_READ(input_port_1_word_r) |
| 116 | 116 | AM_RANGE(0x0c2014, 0x0c2015) AM_READWRITE(magicstk_port2_r, magicstk_coin_eeprom_w) |
| r2418 | r2419 | |
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( powerbal_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 127 | 127 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 128 | AM_RANGE(0x088000, 0x0883ff) AM_RAM | |
| 128 | AM_RANGE(0x088000, 0x0883ff) AM_RAM | |
| 129 | 129 | AM_RANGE(0x094000, 0x094001) AM_WRITENOP |
| 130 | 130 | AM_RANGE(0x094002, 0x094003) AM_WRITENOP |
| 131 | 131 | AM_RANGE(0x094004, 0x094005) AM_WRITE(tile_banking_w) |
| 132 | AM_RANGE(0x098000, 0x098fff) AM_R | |
| 132 | AM_RANGE(0x098000, 0x098fff) AM_R | |
| 133 | 133 | AM_RANGE(0x099000, 0x09bfff) AM_RAM // not used |
| 134 | 134 | AM_RANGE(0x0c2010, 0x0c2011) AM_READ(input_port_0_word_r) |
| 135 | 135 | AM_RANGE(0x0c2012, 0x0c2013) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 203 | 203 | /* stvinit.c */ |
| 204 | 204 | DRIVER_INIT( ic13 ); |
| 205 | 205 | NVRAM_HANDLER( stv ); |
| 206 | void install_stvbios_speedups( | |
| 206 | void install_stvbios_speedups(running_machine *machine); | |
| 207 | 207 | DRIVER_INIT(bakubaku); |
| 208 | 208 | DRIVER_INIT(mausuke); |
| 209 | 209 | DRIVER_INIT(puyosun); |
| r2418 | r2419 | |
| 2505 | 2505 | stv_scu = auto_malloc (0x100); |
| 2506 | 2506 | scsp_regs = auto_malloc (0x1000); |
| 2507 | 2507 | |
| 2508 | install_stvbios_speedups(); | |
| 2508 | install_stvbios_speedups(machine); | |
| 2509 | 2509 | |
| 2510 | 2510 | /* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */ |
| 2511 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); | |
| 2512 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write ); | |
| 2513 | memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); | |
| 2514 | memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write ); | |
| 2511 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); | |
| 2512 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write ); | |
| 2513 | memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); | |
| 2514 | memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write ); | |
| 2515 | 2515 | |
| 2516 | 2516 | smpc_ram[0x23] = DectoBCD(systime.local_time.year /100); |
| 2517 | 2517 | smpc_ram[0x25] = DectoBCD(systime.local_time.year %100); |
| r2418 | r2419 | |
|---|---|---|
| 286 | 286 | { |
| 287 | 287 | case 0: |
| 288 | 288 | logerror("bank w %02x %02x\n", offset, data); |
| 289 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5); | |
| 290 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 289 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5, SMH_UNMAP); | |
| 291 | 290 | |
| 292 | 291 | //printf("bank ram??\n"); |
| 293 | 292 | break; |
| r2418 | r2419 | |
| 318 | 317 | |
| 319 | 318 | |
| 320 | 319 | |
| 321 | static void megatech_set_genz80_as_sms_standard_ports( | |
| 320 | static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine) | |
| 322 | 321 | { |
| 323 | 322 | /* INIT THE PORTS *********************************************************************************************/ |
| 324 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r); | |
| 325 | memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w); | |
| 323 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); | |
| 326 | 324 | |
| 327 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, md_sms_vdp_vcounter_r); | |
| 328 | memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_sn76496_w); | |
| 325 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, md_sms_vdp_vcounter_r, sms_sn76496_w); | |
| 326 | memory_install_write8_handler (machine, 1, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w); | |
| 327 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_r, md_sms_vdp_data_w); | |
| 328 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_r, md_sms_vdp_ctrl_w); | |
| 329 | 329 | |
| 330 | memory_install_ | |
| 330 | memory_install_ | |
| 331 | 331 | |
| 332 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_r); | |
| 333 | memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_w); | |
| 334 | ||
| 335 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_r); | |
| 336 | memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_w); | |
| 337 | ||
| 338 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x10, 0x10, 0, 0, megatech_sms_ioport_dd_r); // super tetris | |
| 339 | ||
| 340 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdc, 0xdc, 0, 0, megatech_sms_ioport_dc_r); | |
| 341 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdd, 0xdd, 0, 0, megatech_sms_ioport_dd_r); | |
| 342 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xde, 0xde, 0, 0, megatech_sms_ioport_dd_r); | |
| 343 | memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdf, 0xdf, 0, 0, megatech_sms_ioport_dd_r); // adams family | |
| 332 | memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdc, 0xdc, 0, 0, megatech_sms_ioport_dc_r); | |
| 333 | memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdd, 0xdd, 0, 0, megatech_sms_ioport_dd_r); | |
| 334 | memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xde, 0xde, 0, 0, megatech_sms_ioport_dd_r); | |
| 335 | memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdf, 0xdf, 0, 0, megatech_sms_ioport_dd_r); // adams family | |
| 344 | 336 | } |
| 345 | 337 | |
| 346 | static void megatech_set_genz80_as_sms_standard_map( | |
| 338 | static void megatech_set_genz80_as_sms_standard_map(running_machine *machine) | |
| 347 | 339 | { |
| 348 | 340 | /* INIT THE MEMMAP / BANKING *********************************************************************************/ |
| 349 | 341 | |
| 350 | 342 | /* catch any addresses that don't get mapped */ |
| 351 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r); | |
| 352 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w); | |
| 343 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w); | |
| 353 | 344 | |
| 354 | 345 | /* fixed rom bank area */ |
| 355 | 346 | sms_rom = auto_malloc(0x400000); |
| 356 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5); | |
| 357 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 347 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5, SMH_UNMAP); | |
| 358 | 348 | memory_set_bankptr( 5, sms_rom ); |
| 359 | 349 | |
| 360 | 350 | memcpy(sms_rom, memory_region(REGION_CPU1), 0x400000); |
| 361 | 351 | |
| 362 | 352 | /* main ram area */ |
| 363 | 353 | sms_mainram = auto_malloc(0x2000); // 8kb of main ram |
| 364 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6); | |
| 365 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6); | |
| 354 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6, SMH_BANK6); | |
| 366 | 355 | memory_set_bankptr( 6, sms_mainram ); |
| 367 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7); | |
| 368 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7); | |
| 356 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7, SMH_BANK7); | |
| 369 | 357 | memory_set_bankptr( 7, sms_mainram ); |
| 370 | 358 | memset(sms_mainram,0x00,0x2000); |
| 371 | 359 | |
| 372 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfffc, 0xffff, 0, 0, mt_sms_standard_rom_bank_w); | |
| 360 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfffc, 0xffff, 0, 0, mt_sms_standard_rom_bank_w); | |
| 373 | 361 | |
| 374 | megatech_set_genz80_as_sms_standard_ports(); | |
| 362 | megatech_set_genz80_as_sms_standard_ports(machine); | |
| 375 | 363 | // smsgg_backupram = NULL; |
| 376 | 364 | |
| 377 | 365 | } |
| r2418 | r2419 | |
| 409 | 397 | { |
| 410 | 398 | printf("SMS cart!!, CPU not running\n"); |
| 411 | 399 | current_game_is_sms = 1; |
| 412 | megatech_set_genz80_as_sms_standard_map(); | |
| 400 | megatech_set_genz80_as_sms_standard_map(machine); | |
| 413 | 401 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE); |
| 414 | 402 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); |
| 415 | 403 | |
| r2418 | r2419 | |
| 419 | 407 | { |
| 420 | 408 | printf("Genesis Cart, CPU0 running\n"); |
| 421 | 409 | current_game_is_sms = 0; |
| 422 | megatech_set_megadrive_z80_as_megadrive_z80(); | |
| 410 | megatech_set_megadrive_z80_as_megadrive_z80(machine); | |
| 423 | 411 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); |
| 424 | 412 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE); |
| 425 | 413 | } |
| r2418 | r2419 | |
|---|---|---|
| 212 | 212 | MEMORY STRUCTURES |
| 213 | 213 | ***********************************************************/ |
| 214 | 214 | |
| 215 | static ADDRESS_MAP_START( darius2d_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 216 | AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) | |
| 217 | AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM) /* main ram */ | |
| 218 | AM_RANGE(0x200000, 0x213fff) AM_READ(TC0100SCN_word_0_r) /* tilemaps (1st screen) */ | |
| 219 | AM_RANGE(0x220000, 0x22000f) AM_READ(TC0100SCN_ctrl_word_0_r) | |
| 220 | AM_RANGE(0x240000, 0x253fff) AM_READ(TC0100SCN_word_1_r) /* tilemaps (2nd screen) */ | |
| 221 | AM_RANGE(0x260000, 0x26000f) AM_READ(TC0100SCN_ctrl_word_1_r) | |
| 222 | AM_RANGE(0x400000, 0x400007) AM_READ(TC0110PCR_word_r) /* palette (1st screen) */ | |
| 223 | AM_RANGE(0x420000, 0x420007) AM_READ(TC0110PCR_word_1_r) /* palette (2nd screen) */ | |
| 224 | AM_RANGE(0x600000, 0x6013ff) AM_READ(SMH_RAM) /* sprite ram */ | |
| 225 | AM_RANGE(0x800000, 0x80000f) AM_READ(TC0220IOC_halfword_r) | |
| 226 | AM_RANGE(0x830000, 0x830003) AM_READ(warriorb_sound_r) | |
| 227 | ADDRESS_MAP_END | |
| 228 | ||
| 229 | static ADDRESS_MAP_START( darius2d_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 230 | AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM) | |
| 231 | AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM) | |
| 232 | AM_RANGE(0x200000, 0x213fff) AM_WRITE(TC0100SCN_dual_screen_w) /* tilemaps (all screens) */ | |
| 233 | AM_RANGE(0x214000, 0x2141ff) AM_WRITE(SMH_NOP) /* error in screen clearing code ? */ | |
| 234 | AM_RANGE(0x220000, 0x22000f) AM_WRITE(TC0100SCN_ctrl_word_0_w) | |
| 235 | AM_RANGE(0x240000, 0x253fff) AM_WRITE(TC0100SCN_word_1_w) /* tilemaps (2nd screen) */ | |
| 236 | AM_RANGE(0x260000, 0x26000f) AM_WRITE(TC0100SCN_ctrl_word_1_w) | |
| 237 | AM_RANGE(0x400000, 0x400007) AM_WRITE(TC0110PCR_step1_word_w) /* palette (1st screen) */ | |
| 238 | AM_RANGE(0x420000, 0x420007) AM_WRITE(TC0110PCR_step1_word_1_w) /* palette (2nd screen) */ | |
| 239 | AM_RANGE(0x600000, 0x6013ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 240 | AM_RANGE(0x800000, 0x80000f) AM_WRITE(TC0220IOC_halfword_w) | |
| 215 | static ADDRESS_MAP_START( darius2d_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 216 | AM_RANGE(0x000000, 0x0fffff) AM_ROM | |
| 217 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* main ram */ | |
| 218 | AM_RANGE(0x200000, 0x213fff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_dual_screen_w) /* tilemaps (all screens) */ | |
| 219 | AM_RANGE(0x214000, 0x2141ff) AM_WRITE(SMH_NOP) /* error in screen clearing code ? */ | |
| 220 | AM_RANGE(0x220000, 0x22000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) | |
| 221 | AM_RANGE(0x240000, 0x253fff) AM_READWRITE(TC0100SCN_word_1_r, TC0100SCN_word_1_w) /* tilemaps (2nd screen) */ | |
| 222 | AM_RANGE(0x260000, 0x26000f) AM_READWRITE(TC0100SCN_ctrl_word_1_r, TC0100SCN_ctrl_word_1_w) | |
| 223 | AM_RANGE(0x400000, 0x400007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w) /* palette (1st screen) */ | |
| 224 | AM_RANGE(0x420000, 0x420007) AM_READWRITE(TC0110PCR_word_1_r, TC0110PCR_step1_word_1_w) /* palette (2nd screen) */ | |
| 225 | AM_RANGE(0x600000, 0x6013ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 226 | AM_RANGE(0x800000, 0x80000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w) | |
| 241 | 227 | // AM_RANGE(0x820000, 0x820001) AM_WRITE(SMH_NOP) // ??? |
| 242 | AM_RANGE(0x830000, 0x830003) AM_WRITE(warriorb_sound_w) | |
| 228 | AM_RANGE(0x830000, 0x830003) AM_READWRITE(warriorb_sound_r, warriorb_sound_w) | |
| 243 | 229 | ADDRESS_MAP_END |
| 244 | 230 | |
| 245 | ||
| 246 | static ADDRESS_MAP_START( warriorb_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 247 | AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM) | |
| 248 | AM_RANGE(0x200000, 0x213fff) AM_READ(SMH_RAM) /* main ram */ | |
| 249 | AM_RANGE(0x300000, 0x313fff) AM_READ(TC0100SCN_word_0_r) /* tilemaps (1st screen) */ | |
| 250 | AM_RANGE(0x320000, 0x32000f) AM_READ(TC0100SCN_ctrl_word_0_r) | |
| 251 | AM_RANGE(0x340000, 0x353fff) AM_READ(TC0100SCN_word_1_r) /* tilemaps (2nd screen) */ | |
| 252 | AM_RANGE(0x360000, 0x36000f) AM_READ(TC0100SCN_ctrl_word_1_r) | |
| 253 | AM_RANGE(0x400000, 0x400007) AM_READ(TC0110PCR_word_r) /* palette (1st screen) */ | |
| 254 | AM_RANGE(0x420000, 0x420007) AM_READ(TC0110PCR_word_1_r) /* palette (2nd screen) */ | |
| 255 | AM_RANGE(0x600000, 0x6013ff) AM_READ(SMH_RAM) /* sprite ram */ | |
| 256 | AM_RANGE(0x800000, 0x80000f) AM_READ(TC0510NIO_halfword_r) | |
| 257 | AM_RANGE(0x830000, 0x830003) AM_READ(warriorb_sound_r) | |
| 258 | ADDRESS_MAP_END | |
| 259 | ||
| 260 | static ADDRESS_MAP_START( warriorb_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 261 | AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM) | |
| 262 | AM_RANGE(0x200000, 0x213fff) AM_WRITE(SMH_RAM) | |
| 263 | AM_RANGE(0x300000, 0x313fff) AM_WRITE(TC0100SCN_dual_screen_w) /* tilemaps (all screens) */ | |
| 264 | AM_RANGE(0x320000, 0x32000f) AM_WRITE(TC0100SCN_ctrl_word_0_w) | |
| 265 | AM_RANGE(0x340000, 0x353fff) AM_WRITE(TC0100SCN_word_1_w) /* tilemaps (2nd screen) */ | |
| 266 | AM_RANGE(0x360000, 0x36000f) AM_WRITE(TC0100SCN_ctrl_word_1_w) | |
| 267 | AM_RANGE(0x400000, 0x400007) AM_WRITE(TC0110PCR_step1_word_w) /* palette (1st screen) */ | |
| 268 | AM_RANGE(0x420000, 0x420007) AM_WRITE(TC0110PCR_step1_word_1_w) /* palette (2nd screen) */ | |
| 269 | AM_RANGE(0x600000, 0x6013ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 270 | AM_RANGE(0x800000, 0x80000f) AM_WRITE(TC0510NIO_halfword_w) | |
| 231 | static ADDRESS_MAP_START( warriorb_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 232 | AM_RANGE(0x000000, 0x1fffff) AM_ROM | |
| 233 | AM_RANGE(0x200000, 0x213fff) AM_RAM | |
| 234 | AM_RANGE(0x300000, 0x313fff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_dual_screen_w) /* tilemaps (all screens) */ | |
| 235 | AM_RANGE(0x320000, 0x32000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) | |
| 236 | AM_RANGE(0x340000, 0x353fff) AM_READWRITE(TC0100SCN_word_1_r, TC0100SCN_word_1_w) /* tilemaps (2nd screen) */ | |
| 237 | AM_RANGE(0x360000, 0x36000f) AM_READWRITE(TC0100SCN_ctrl_word_1_r, TC0100SCN_ctrl_word_1_w) | |
| 238 | AM_RANGE(0x400000, 0x400007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w) /* palette (1st screen) */ | |
| 239 | AM_RANGE(0x420000, 0x420007) AM_READWRITE(TC0110PCR_word_1_r, TC0110PCR_step1_word_1_w) /* palette (2nd screen) */ | |
| 240 | AM_RANGE(0x600000, 0x6013ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 241 | AM_RANGE(0x800000, 0x80000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w) | |
| 271 | 242 | // AM_RANGE(0x820000, 0x820001) AM_WRITE(SMH_NOP) // ? uses bits 0,2,3 |
| 272 | AM_RANGE(0x830000, 0x830003) AM_WRITE(warriorb_sound_w) | |
| 243 | AM_RANGE(0x830000, 0x830003) AM_READWRITE(warriorb_sound_r, warriorb_sound_w) | |
| 273 | 244 | ADDRESS_MAP_END |
| 274 | 245 | |
| 275 | ||
| 276 | 246 | /***************************************************************************/ |
| 277 | 247 | |
| 278 | static ADDRESS_MAP_START( z80_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 279 | AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM) | |
| 280 | AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK10) | |
| 281 | AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM) | |
| 282 | AM_RANGE(0xe000, 0xe000) AM_READ(YM2610_status_port_0_A_r) | |
| 283 | AM_RANGE(0xe001, 0xe001) AM_READ(YM2610_read_port_0_r) | |
| 284 | AM_RANGE(0xe002, 0xe002) AM_READ(YM2610_status_port_0_B_r) | |
| 285 | AM_RANGE(0xe200, 0xe200) AM_READ(SMH_NOP) | |
| 286 | AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r) | |
| 287 | AM_RANGE(0xea00, 0xea00) AM_READ(SMH_NOP) | |
| 288 | ADDRESS_MAP_END | |
| 289 | ||
| 290 | static ADDRESS_MAP_START( z80_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 291 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) | |
| 292 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM) | |
| 293 | AM_RANGE(0xe000, 0xe000) AM_WRITE(YM2610_control_port_0_A_w) | |
| 294 | AM_RANGE(0xe001, 0xe001) AM_WRITE(YM2610_data_port_0_A_w) | |
| 295 | AM_RANGE(0xe002, 0xe002) AM_WRITE(YM2610_control_port_0_B_w) | |
| 248 | static ADDRESS_MAP_START( z80_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 249 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 250 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK10, SMH_ROM) | |
| 251 | AM_RANGE(0xc000, 0xdfff) AM_RAM | |
| 252 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(YM2610_status_port_0_A_r, YM2610_control_port_0_A_w) | |
| 253 | AM_RANGE(0xe001, 0xe001) AM_READWRITE(YM2610_read_port_0_r, YM2610_data_port_0_A_w) | |
| 254 | AM_RANGE(0xe002, 0xe002) AM_READWRITE(YM2610_status_port_0_B_r, YM2610_control_port_0_B_w) | |
| 296 | 255 | AM_RANGE(0xe003, 0xe003) AM_WRITE(YM2610_data_port_0_B_w) |
| 297 | AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w) | |
| 298 | AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w) | |
| 256 | AM_RANGE(0xe200, 0xe200) AM_READWRITE(SMH_NOP, taitosound_slave_port_w) | |
| 257 | AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w) | |
| 299 | 258 | AM_RANGE(0xe400, 0xe403) AM_WRITE(warriorb_pancontrol) /* pan */ |
| 259 | AM_RANGE(0xea00, 0xea00) AM_READ(SMH_NOP) | |
| 300 | 260 | AM_RANGE(0xee00, 0xee00) AM_WRITE(SMH_NOP) /* ? */ |
| 301 | 261 | AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP) /* ? */ |
| 302 | 262 | AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w) |
| r2418 | r2419 | |
| 487 | 447 | |
| 488 | 448 | /* basic machine hardware */ |
| 489 | 449 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? (Might well be 16!) */ |
| 490 | MDRV_CPU_PROGRAM_MAP(darius2d_ | |
| 450 | MDRV_CPU_PROGRAM_MAP(darius2d_ | |
| 491 | 451 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold) |
| 492 | 452 | |
| 493 | MDRV_CPU_ADD(Z80,16000000/4) | |
| 494 | 453 | /* audio CPU */ /* 4 MHz ? */ |
| 495 | MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem) | |
| 454 | MDRV_CPU_ADD(Z80,16000000/4) | |
| 455 | MDRV_CPU_PROGRAM_MAP(z80_sound_map,0) | |
| 496 | 456 | |
| 497 | 457 | MDRV_MACHINE_START( warriorb ) |
| 498 | 458 | MDRV_MACHINE_RESET( taito_dualscreen ) |
| r2418 | r2419 | |
| 546 | 506 | |
| 547 | 507 | /* basic machine hardware */ |
| 548 | 508 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ? */ |
| 549 | MDRV_CPU_PROGRAM_MAP(warriorb_ | |
| 509 | MDRV_CPU_PROGRAM_MAP(warriorb_ | |
| 550 | 510 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold) |
| 551 | 511 | |
| 552 | MDRV_CPU_ADD(Z80,16000000/4) | |
| 553 | 512 | /* audio CPU */ /* 4 MHz ? */ |
| 554 | MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem) | |
| 513 | MDRV_CPU_ADD(Z80,16000000/4) | |
| 514 | MDRV_CPU_PROGRAM_MAP(z80_sound_map,0) | |
| 555 | 515 | |
| 556 | 516 | MDRV_MACHINE_START( warriorb ) |
| 557 | 517 | MDRV_MACHINE_RESET( taito_dualscreen ) |
| r2418 | r2419 | |
|---|---|---|
| 252 | 252 | static ADDRESS_MAP_START( common_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 253 | 253 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&wram) |
| 254 | 254 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(&tiles) |
| 255 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM | |
| 255 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM | |
| 256 | 256 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0) |
| 257 | 257 | ADDRESS_MAP_END |
| 258 | 258 | |
| 259 | 259 | static ADDRESS_MAP_START( common_32bit_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 260 | 260 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&wram32) |
| 261 | 261 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(&tiles32) |
| 262 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM | |
| 262 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM | |
| 263 | 263 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0) |
| 264 | 264 | ADDRESS_MAP_END |
| 265 | 265 | |
| r2418 | r2419 | |
| 1290 | 1290 | |
| 1291 | 1291 | static DRIVER_INIT( vamphalf ) |
| 1292 | 1292 | { |
| 1293 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0004a6d0, 0x0004a6d3, 0, 0, vamphalf_speedup_r ); | |
| 1293 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0004a6d0, 0x0004a6d3, 0, 0, vamphalf_speedup_r ); | |
| 1294 | 1294 | |
| 1295 | 1295 | palshift = 0; |
| 1296 | 1296 | flip_bit = 0x80; |
| r2418 | r2419 | |
| 1298 | 1298 | |
| 1299 | 1299 | static DRIVER_INIT( misncrft ) |
| 1300 | 1300 | { |
| 1301 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00072eb4, 0x00072eb7, 0, 0, misncrft_speedup_r ); | |
| 1301 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00072eb4, 0x00072eb7, 0, 0, misncrft_speedup_r ); | |
| 1302 | 1302 | |
| 1303 | 1303 | palshift = 0; |
| 1304 | 1304 | flip_bit = 1; |
| r2418 | r2419 | |
| 1306 | 1306 | |
| 1307 | 1307 | static DRIVER_INIT( coolmini ) |
| 1308 | 1308 | { |
| 1309 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000d2e80, 0x000d2e83, 0, 0, coolmini_speedup_r ); | |
| 1309 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000d2e80, 0x000d2e83, 0, 0, coolmini_speedup_r ); | |
| 1310 | 1310 | |
| 1311 | 1311 | palshift = 0; |
| 1312 | 1312 | flip_bit = 1; |
| r2418 | r2419 | |
| 1314 | 1314 | |
| 1315 | 1315 | static DRIVER_INIT( suplup ) |
| 1316 | 1316 | { |
| 1317 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0011605c, 0x0011605f, 0, 0, suplup_speedup_r ); | |
| 1317 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0011605c, 0x0011605f, 0, 0, suplup_speedup_r ); | |
| 1318 | 1318 | |
| 1319 | 1319 | palshift = 8; |
| 1320 | 1320 | /* no flipscreen */ |
| r2418 | r2419 | |
| 1322 | 1322 | |
| 1323 | 1323 | static DRIVER_INIT( luplup ) |
| 1324 | 1324 | { |
| 1325 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00115e84, 0x00115e87, 0, 0, luplup_speedup_r ); | |
| 1325 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00115e84, 0x00115e87, 0, 0, luplup_speedup_r ); | |
| 1326 | 1326 | |
| 1327 | 1327 | palshift = 8; |
| 1328 | 1328 | /* no flipscreen */ |
| r2418 | r2419 | |
| 1330 | 1330 | |
| 1331 | 1331 | static DRIVER_INIT( luplup29 ) |
| 1332 | 1332 | { |
| 1333 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00113f08, 0x00113f0b, 0, 0, luplup29_speedup_r ); | |
| 1333 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00113f08, 0x00113f0b, 0, 0, luplup29_speedup_r ); | |
| 1334 | 1334 | |
| 1335 | 1335 | palshift = 8; |
| 1336 | 1336 | /* no flipscreen */ |
| r2418 | r2419 | |
| 1338 | 1338 | |
| 1339 | 1339 | static DRIVER_INIT( puzlbang ) |
| 1340 | 1340 | { |
| 1341 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00113ecc, 0x00113ecf, 0, 0, puzlbang_speedup_r ); | |
| 1341 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00113ecc, 0x00113ecf, 0, 0, puzlbang_speedup_r ); | |
| 1342 | 1342 | |
| 1343 | 1343 | palshift = 8; |
| 1344 | 1344 | /* no flipscreen */ |
| r2418 | r2419 | |
| 1346 | 1346 | |
| 1347 | 1347 | static DRIVER_INIT( wyvernwg ) |
| 1348 | 1348 | { |
| 1349 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00b56fc, 0x00b56ff, 0, 0, wyvernwg_speedup_r ); | |
| 1349 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00b56fc, 0x00b56ff, 0, 0, wyvernwg_speedup_r ); | |
| 1350 | 1350 | |
| 1351 | 1351 | palshift = 0; |
| 1352 | 1352 | flip_bit = 1; |
| r2418 | r2419 | |
| 1358 | 1358 | static DRIVER_INIT( finalgdr ) |
| 1359 | 1359 | { |
| 1360 | 1360 | finalgdr_backupram = auto_malloc(0x80*0x100); |
| 1361 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x005e874, 0x005e877, 0, 0, finalgdr_speedup_r ); | |
| 1361 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x005e874, 0x005e877, 0, 0, finalgdr_speedup_r ); | |
| 1362 | 1362 | |
| 1363 | 1363 | palshift = 0; |
| 1364 | 1364 | flip_bit = 1; //? |
| r2418 | r2419 | |
| 1369 | 1369 | |
| 1370 | 1370 | static DRIVER_INIT( dquizgo2 ) |
| 1371 | 1371 | { |
| 1372 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00cde70, 0x00cde73, 0, 0, dquizgo2_speedup_r ); | |
| 1372 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00cde70, 0x00cde73, 0, 0, dquizgo2_speedup_r ); | |
| 1373 | 1373 | |
| 1374 | 1374 | palshift = 0; |
| 1375 | 1375 | flip_bit = 1; |
| r2418 | r2419 | |
|---|---|---|
| 124 | 124 | AM_RANGE(0xc805, 0xc805) AM_WRITE(c1942_palette_bank_w) |
| 125 | 125 | AM_RANGE(0xc806, 0xc806) AM_WRITE(c1942_bankswitch_w) |
| 126 | 126 | AM_RANGE(0xcc00, 0xcc7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 127 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(c1942_fgvideoram_w) AM_BASE(&c1942_fgvideoram) | |
| 128 | AM_RANGE(0xd800, 0xdbff) AM_RAM AM_WRITE(c1942_bgvideoram_w) AM_BASE(&c1942_bgvideoram) | |
| 127 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(c1942_fgvideoram_w) AM_BASE(&c1942_fgvideoram) | |
| 128 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(c1942_bgvideoram_w) AM_BASE(&c1942_bgvideoram) | |
| 129 | 129 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 130 | 130 | ADDRESS_MAP_END |
| 131 | 131 |
| r2418 | r2419 | |
|---|---|---|
| 133 | 133 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 134 | 134 | AM_RANGE(0x080000, 0x08afff) AM_RAM |
| 135 | 135 | AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 136 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM | |
| 136 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM | |
| 137 | 137 | AM_RANGE(0x08c400, 0x08cfff) AM_RAM |
| 138 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM | |
| 138 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM | |
| 139 | 139 | AM_RANGE(0x08d400, 0x08d7ff) AM_RAM |
| 140 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM | |
| 140 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM | |
| 141 | 141 | AM_RANGE(0x08e000, 0x08e7ff) AM_RAM |
| 142 | AM_RANGE(0x08e800, 0x08f7ff) AM_RAM | |
| 142 | AM_RANGE(0x08e800, 0x08f7ff) AM_RAM | |
| 143 | 143 | AM_RANGE(0x08f800, 0x08ffff) AM_RAM |
| 144 | 144 | AM_RANGE(0x0a0000, 0x0a000d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 145 | 145 | AM_RANGE(0x0c0000, 0x0c007f) AM_RAM AM_BASE(&bloodbro_scroll) |
| r2418 | r2419 | |
| 155 | 155 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 156 | 156 | AM_RANGE(0x080000, 0x08afff) AM_RAM |
| 157 | 157 | AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 158 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM | |
| 158 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM | |
| 159 | 159 | AM_RANGE(0x08c400, 0x08cfff) AM_RAM |
| 160 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM | |
| 160 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM | |
| 161 | 161 | AM_RANGE(0x08d400, 0x08d7ff) AM_RAM |
| 162 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM | |
| 162 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM | |
| 163 | 163 | AM_RANGE(0x08e000, 0x08ffff) AM_RAM |
| 164 | 164 | AM_RANGE(0x0c1000, 0x0c1001) AM_READ_PORT("DSW") |
| 165 | 165 | AM_RANGE(0x0c1002, 0x0c1003) AM_READ_PORT("IN0") |
| 166 | 166 | AM_RANGE(0x0c1004, 0x0c1005) AM_READ_PORT("IN1") |
| 167 | 167 | AM_RANGE(0x0c1000, 0x0c17ff) AM_RAM |
| 168 | AM_RANGE(0x128000, 0x1287ff) AM_RAM | |
| 168 | AM_RANGE(0x128000, 0x1287ff) AM_RAM | |
| 169 | 169 | AM_RANGE(0x120000, 0x128fff) AM_RAM |
| 170 | 170 | ADDRESS_MAP_END |
| 171 | 171 |
| r2418 | r2419 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 73 | 73 | AM_RANGE(0x00000, 0x01fff) AM_RAM |
| 74 | AM_RANGE(0x02000, 0x027ff) AM_READWRITE(SMH_RAM, raiden_background_w) AM_BASE(&raiden_back_data) | |
| 75 | AM_RANGE(0x02800, 0x02fff) AM_READWRITE(SMH_RAM, raiden_foreground_w) AM_BASE(&raiden_fore_data) | |
| 76 | AM_RANGE(0x03000, 0x03fff) AM_READWRITE(SMH_RAM, paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 74 | AM_RANGE(0x02000, 0x027ff) AM_RAM_WRITE(raiden_background_w) AM_BASE(&raiden_back_data) | |
| 75 | AM_RANGE(0x02800, 0x02fff) AM_RAM_WRITE(raiden_foreground_w) AM_BASE(&raiden_fore_data) | |
| 76 | AM_RANGE(0x03000, 0x03fff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 77 | 77 | AM_RANGE(0x04000, 0x04fff) AM_RAM AM_SHARE(1) |
| 78 | 78 | AM_RANGE(0x07ffe, 0x0afff) AM_WRITE(SMH_NOP) |
| 79 | 79 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| r2418 | r2419 | |
| 473 | 473 | |
| 474 | 474 | static DRIVER_INIT( raiden ) |
| 475 | 475 | { |
| 476 | memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spin_r); | |
| 476 | memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spin_r); | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | static void memory_patcha( | |
| 479 | static void memory_patcha(running_machine *machine) | |
| 480 | 480 | { |
| 481 | memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spina_r); | |
| 481 | memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spina_r); | |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | /* This is based on code by Niclas Karlsson Mate, who figured out the |
| r2418 | r2419 | |
| 512 | 512 | |
| 513 | 513 | static DRIVER_INIT( raidenk ) |
| 514 | 514 | { |
| 515 | memory_patcha(); | |
| 515 | memory_patcha(machine); | |
| 516 | 516 | common_decrypt(); |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | static DRIVER_INIT( raidena ) |
| 520 | 520 | { |
| 521 | memory_patcha(); | |
| 521 | memory_patcha(machine); | |
| 522 | 522 | common_decrypt(); |
| 523 | 523 | seibu_sound_decrypt(REGION_CPU3,0x20000); |
| 524 | 524 | } |
| r2418 | r2419 | |
|---|---|---|
| 278 | 278 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 279 | 279 | if ((data & 1) == 0) |
| 280 | 280 | /* overlay disabled, map RAM on 0x000000 */ |
| 281 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 281 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 282 | 282 | |
| 283 | 283 | else |
| 284 | 284 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 285 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 285 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 |
| r2418 | r2419 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM |
| 84 | 84 | AM_RANGE(0x80000000, 0x80013fff) AM_READWRITE(vega_vram_r, vega_vram_w) |
| 85 | 85 | AM_RANGE(0xfc000000, 0xfc0000ff) AM_READWRITE(at28c16_32le_0_r, at28c16_32le_0_w) |
| 86 | AM_RANGE(0xfc200000, 0xfc2003ff) AM_RAM | |
| 86 | AM_RANGE(0xfc200000, 0xfc2003ff) AM_RAM | |
| 87 | 87 | AM_RANGE(0xfc400000, 0xfc40005b) AM_WRITENOP // crt registers ? |
| 88 | 88 | AM_RANGE(0xfc600000, 0xfc600003) AM_WRITENOP // soundlatch |
| 89 | 89 | AM_RANGE(0xfca00000, 0xfca00003) AM_WRITE(vega_misc_w) |
| r2418 | r2419 | |
|---|---|---|
| 311 | 311 | |
| 312 | 312 | static ADDRESS_MAP_START( rallyx_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 313 | 313 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 314 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 314 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 315 | 315 | AM_RANGE(0x9800, 0x9fff) AM_RAM |
| 316 | 316 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 317 | 317 | AM_RANGE(0xa080, 0xa080) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 333 | 333 | |
| 334 | 334 | static ADDRESS_MAP_START( jungler_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 335 | 335 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 336 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 336 | AM_RANGE(0x8000, 0x8fff) AM_R | |
| 337 | 337 | AM_RANGE(0x9800, 0x9fff) AM_RAM |
| 338 | 338 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 339 | 339 | AM_RANGE(0xa080, 0xa080) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 1257 | 1257 | /* wrote together */ |
| 1258 | 1258 | AM_RANGE(0xfd040000, 0xfd047fff) AM_RAM // priority ram |
| 1259 | 1259 | AM_RANGE(0xfd080000, 0xfd087fff) AM_RAM |
| 1260 | AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM AM_WRITE(ms32_pal1_ram_w) AM_BASE(&ms32_pal_ram[1]) | |
| 1261 | AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM AM_WRITE(ms32_pal0_ram_w) AM_BASE(&ms32_pal_ram[0]) | |
| 1262 | AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM AM_WRITE(ms32_roz1_ram_w) AM_BASE(&ms32_roz1_ram) | |
| 1263 | AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM AM_WRITE(ms32_roz0_ram_w) AM_BASE(&ms32_roz0_ram) | |
| 1264 | AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM AM_WRITE(ms32_spramx_w) AM_BASE(&ms32_spram) | |
| 1265 | AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM AM_WRITE(ms32_tx1_ram_w) AM_BASE(&ms32_tx1_ram) | |
| 1266 | AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM AM_WRITE(ms32_bg1_ram_w) AM_BASE(&ms32_bg1_ram) | |
| 1267 | AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM AM_WRITE(ms32_tx0_ram_w) AM_BASE(&ms32_tx0_ram) | |
| 1268 | AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM AM_WRITE(ms32_bg0_ram_w) AM_BASE(&ms32_bg0_ram) | |
| 1260 | AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM_WRITE(ms32_pal1_ram_w) AM_BASE(&ms32_pal_ram[1]) | |
| 1261 | AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM_WRITE(ms32_pal0_ram_w) AM_BASE(&ms32_pal_ram[0]) | |
| 1262 | AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM_WRITE(ms32_roz1_ram_w) AM_BASE(&ms32_roz1_ram) | |
| 1263 | AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM_WRITE(ms32_roz0_ram_w) AM_BASE(&ms32_roz0_ram) | |
| 1264 | AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM_WRITE(ms32_spramx_w) AM_BASE(&ms32_spram) | |
| 1265 | AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM_WRITE(ms32_tx1_ram_w) AM_BASE(&ms32_tx1_ram) | |
| 1266 | AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM_WRITE(ms32_bg1_ram_w) AM_BASE(&ms32_bg1_ram) | |
| 1267 | AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM_WRITE(ms32_tx0_ram_w) AM_BASE(&ms32_tx0_ram) | |
| 1268 | AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_BASE(&ms32_bg0_ram) | |
| 1269 | 1269 | |
| 1270 | 1270 | AM_RANGE(0xfee00000, 0xfee1ffff) AM_RAM |
| 1271 | 1271 | AM_RANGE(0xffe00000, 0xffffffff) AM_READWRITE(SMH_BANK1, SMH_ROM) |
| r2418 | r2419 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | static WRITE16_HANDLER( arcadia_multibios_change_game ) |
| 74 | 74 | { |
| 75 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP); | |
| 75 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r2418 | r2419 | |
| 105 | 105 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 106 | 106 | if ((data & 1) == 0) |
| 107 | 107 | /* overlay disabled, map RAM on 0x000000 */ |
| 108 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 108 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 109 | 109 | |
| 110 | 110 | else |
| 111 | 111 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 112 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 112 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 113 | 113 | |
| 114 | 114 | /* bit 2 = Power Led on Amiga */ |
| 115 | 115 | set_led_status(0, (data & 2) ? 0 : 1); |
| r2418 | r2419 | |
|---|---|---|
| 400 | 400 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 401 | 401 | AM_RANGE(0x0000, 0x07ff) AM_ROM /* CPU board ROM */ |
| 402 | 402 | AM_RANGE(0x0800, 0xbfff) AM_ROM /* PROM board ROM area */ |
| 403 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(SMH_RAM, mainram_w) AM_BASE(&mainram) | |
| 404 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(SMH_RAM, vectorram_w) AM_BASE(&vectorram) AM_SIZE(&vectorram_size) | |
| 403 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(mainram_w) AM_BASE(&mainram) | |
| 404 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vectorram_w) AM_BASE(&vectorram) AM_SIZE(&vectorram_size) | |
| 405 | 405 | ADDRESS_MAP_END |
| 406 | 406 | |
| 407 | 407 | |
| r2418 | r2419 | |
| 1315 | 1315 | |
| 1316 | 1316 | /* configure sound */ |
| 1317 | 1317 | has_usb = FALSE; |
| 1318 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w); | |
| 1319 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w); | |
| 1318 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w); | |
| 1319 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w); | |
| 1320 | 1320 | } |
| 1321 | 1321 | |
| 1322 | 1322 | |
| r2418 | r2419 | |
| 1327 | 1327 | |
| 1328 | 1328 | /* configure sound */ |
| 1329 | 1329 | has_usb = FALSE; |
| 1330 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w); | |
| 1331 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w); | |
| 1330 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w); | |
| 1331 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w); | |
| 1332 | 1332 | |
| 1333 | 1333 | /* configure inputs */ |
| 1334 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1335 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, elim4_input_r); | |
| 1334 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1335 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, elim4_input_r); | |
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | |
| r2418 | r2419 | |
| 1343 | 1343 | |
| 1344 | 1344 | /* configure sound */ |
| 1345 | 1345 | has_usb = FALSE; |
| 1346 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1347 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1348 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, spacfury1_sh_w); | |
| 1349 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, spacfury2_sh_w); | |
| 1346 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1347 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1348 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, spacfury1_sh_w); | |
| 1349 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, spacfury2_sh_w); | |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | |
| r2418 | r2419 | |
| 1357 | 1357 | |
| 1358 | 1358 | /* configure sound */ |
| 1359 | 1359 | has_usb = FALSE; |
| 1360 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1361 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1362 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3c, 0x3c, 0, 0, AY8910_control_port_0_w); | |
| 1363 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3d, 0x3d, 0, 0, AY8910_write_port_0_w); | |
| 1364 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, zektor1_sh_w); | |
| 1365 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, zektor2_sh_w); | |
| 1360 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1361 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1362 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c, 0x3c, 0, 0, AY8910_control_port_0_w); | |
| 1363 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d, 0x3d, 0, 0, AY8910_write_port_0_w); | |
| 1364 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, zektor1_sh_w); | |
| 1365 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, zektor2_sh_w); | |
| 1366 | 1366 | |
| 1367 | 1367 | /* configure inputs */ |
| 1368 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1369 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1368 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1369 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | 1372 | |
| r2418 | r2419 | |
| 1377 | 1377 | |
| 1378 | 1378 | /* configure sound */ |
| 1379 | 1379 | has_usb = TRUE; |
| 1380 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r); | |
| 1381 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w); | |
| 1382 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r); | |
| 1383 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w); | |
| 1380 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w); | |
| 1381 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w); | |
| 1384 | 1382 | |
| 1385 | 1383 | /* configure inputs */ |
| 1386 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1387 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1384 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1385 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1388 | 1386 | } |
| 1389 | 1387 | |
| 1390 | 1388 | |
| r2418 | r2419 | |
| 1395 | 1393 | |
| 1396 | 1394 | /* configure sound */ |
| 1397 | 1395 | has_usb = TRUE; |
| 1398 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1399 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1396 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w); | |
| 1397 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w); | |
| 1400 | 1398 | |
| 1401 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r); | |
| 1402 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w); | |
| 1403 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r); | |
| 1404 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w); | |
| 1399 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w); | |
| 1400 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w); | |
| 1405 | 1401 | |
| 1406 | 1402 | /* configure inputs */ |
| 1407 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1408 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1403 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w); | |
| 1404 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r); | |
| 1409 | 1405 | } |
| 1410 | 1406 | |
| 1411 | 1407 |
| r2418 | r2419 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | static ADDRESS_MAP_START( varia_program_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 217 | 217 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 218 | AM_RANGE(0x100000, 0x11ffff) AM_READWRITE(SMH_RAM, vmetal_texttileram_w) AM_BASE(&vmetal_texttileram) | |
| 219 | AM_RANGE(0x120000, 0x13ffff) AM_READWRITE(SMH_RAM, vmetal_mid1tileram_w) AM_BASE(&vmetal_mid1tileram) | |
| 220 | AM_RANGE(0x140000, 0x15ffff) AM_READWRITE(SMH_RAM, vmetal_mid2tileram_w) AM_BASE(&vmetal_mid2tileram) | |
| 218 | AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(vmetal_texttileram_w) AM_BASE(&vmetal_texttileram) | |
| 219 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(vmetal_mid1tileram_w) AM_BASE(&vmetal_mid1tileram) | |
| 220 | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(vmetal_mid2tileram_w) AM_BASE(&vmetal_mid2tileram) | |
| 221 | 221 | |
| 222 | 222 | AM_RANGE(0x160000, 0x16ffff) AM_READ(varia_crom_read) // cgrom read window .. |
| 223 | 223 |
| r2418 | r2419 | |
|---|---|---|
| 505 | 505 | static DRIVER_INIT( superchs ) |
| 506 | 506 | { |
| 507 | 507 | /* Speedup handlers */ |
| 508 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100003, 0, 0, main_cycle_r); | |
| 509 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, 0x80000a, 0x80000b, 0, 0, sub_cycle_r); | |
| 508 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100003, 0, 0, main_cycle_r); | |
| 509 | memory_install_read16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x80000a, 0x80000b, 0, 0, sub_cycle_r); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | GAME( 1992, superchs, 0, superchs, superchs, superchs, ROT0, "Taito America Corporation", "Super Chase - Criminal Termination (US)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 95 | 95 | AM_RANGE(0xa103, 0xa103) AM_READ(input_port_1_r) |
| 96 | 96 | AM_RANGE(0xc000, 0xddff) AM_RAM AM_SHARE(1) |
| 97 | 97 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE(2) AM_BASE(&spriteram) |
| 98 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 98 | AM_RANGE(0xe000, 0xe7ff) AM_R | |
| 99 | 99 | AM_RANGE(0xe000, 0xefff) AM_RAM //only cleared? |
| 100 | AM_RANGE(0xf000, 0xf1ff) AM_R | |
| 100 | AM_RANGE(0xf000, 0xf1ff) AM_R | |
| 101 | 101 | AM_RANGE(0xf200, 0xf200) AM_RAM AM_SHARE(5) AM_BASE(&flower_bg0_scroll) |
| 102 | AM_RANGE(0xf800, 0xf9ff) AM_R | |
| 102 | AM_RANGE(0xf800, 0xf9ff) AM_R | |
| 103 | 103 | AM_RANGE(0xfa00, 0xfa00) AM_RAM AM_SHARE(7) AM_BASE(&flower_bg1_scroll) |
| 104 | 104 | ADDRESS_MAP_END |
| 105 | 105 | |
| r2418 | r2419 | |
| 112 | 112 | AM_RANGE(0xa400, 0xa400) AM_WRITE(sound_command_w) |
| 113 | 113 | AM_RANGE(0xc000, 0xddff) AM_RAM AM_SHARE(1) |
| 114 | 114 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE(2) |
| 115 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, flower_textram_w) AM_SHARE(3) | |
| 116 | AM_RANGE(0xf000, 0xf1ff) AM_READWRITE(SMH_RAM, flower_bg0ram_w) AM_SHARE(4) | |
| 115 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(flower_textram_w) AM_SHARE(3) | |
| 116 | AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(flower_bg0ram_w) AM_SHARE(4) | |
| 117 | 117 | AM_RANGE(0xf200, 0xf200) AM_RAM AM_SHARE(5) |
| 118 | AM_RANGE(0xf800, 0xf9ff) AM_R | |
| 118 | AM_RANGE(0xf800, 0xf9ff) AM_R | |
| 119 | 119 | AM_RANGE(0xfa00, 0xfa00) AM_RAM AM_SHARE(7) |
| 120 | 120 | ADDRESS_MAP_END |
| 121 | 121 |
| r2418 | r2419 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | /******************************************************************************/ |
| 76 | 76 | |
| 77 | static ADDRESS_MAP_START( battlera_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 78 | AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) | |
| 79 | AM_RANGE(0x100000, 0x10ffff) AM_READ(HuC6270_debug_r) /* Cheat to view vram data */ | |
| 80 | AM_RANGE(0x1f0000, 0x1f1fff) AM_READ(SMH_BANK8) | |
| 81 | AM_RANGE(0x1fe000, 0x1fe001) AM_READ(HuC6270_register_r) | |
| 82 | AM_RANGE(0x1ff000, 0x1ff001) AM_READ(control_data_r) | |
| 83 | ADDRESS_MAP_END | |
| 84 | ||
| 85 | static ADDRESS_MAP_START( battlera_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 86 | AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM) | |
| 87 | AM_RANGE(0x100000, 0x10ffff) AM_WRITE(HuC6270_debug_w) /* Cheat to edit vram data */ | |
| 77 | static ADDRESS_MAP_START( battlera_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 78 | AM_RANGE(0x000000, 0x0fffff) AM_ROM | |
| 79 | AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(HuC6270_debug_r, HuC6270_debug_w) /* Cheat to edit vram data */ | |
| 88 | 80 | AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE(battlera_sound_w) |
| 89 | 81 | AM_RANGE(0x1e1000, 0x1e13ff) AM_WRITE(battlera_palette_w) AM_BASE(&paletteram) |
| 90 | AM_RANGE(0x1f0000, 0x1f1fff) AM_WRITE(SMH_BANK8) /* Main ram */ | |
| 91 | AM_RANGE(0x1fe000, 0x1fe001) AM_WRITE(HuC6270_register_w) | |
| 82 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK(8) /* Main ram */ | |
| 83 | AM_RANGE(0x1fe000, 0x1fe001) AM_READWRITE(HuC6270_register_r, HuC6270_register_w) | |
| 92 | 84 | AM_RANGE(0x1fe002, 0x1fe003) AM_WRITE(HuC6270_data_w) |
| 93 | AM_RANGE(0x1ff000, 0x1ff001) AM_WRITE(control_data_w) | |
| 85 | AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(control_data_r, control_data_w) | |
| 94 | 86 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(H6280_irq_status_w) |
| 95 | 87 | ADDRESS_MAP_END |
| 96 | 88 | |
| 97 | static ADDRESS_MAP_START( battlera_port | |
| 89 | static ADDRESS_MAP_START( battlera_portmap | |
| 98 | 90 | AM_RANGE(0x00, 0x01) AM_WRITE(HuC6270_register_w) |
| 99 | 91 | AM_RANGE(0x02, 0x03) AM_WRITE(HuC6270_data_w) |
| 100 | 92 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 133 | 125 | MSM5205_reset_w(0,0); |
| 134 | 126 | } |
| 135 | 127 | |
| 136 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 137 | AM_RANGE(0x000000, 0x00ffff) AM_READ(SMH_ROM) | |
| 138 | AM_RANGE(0x1f0000, 0x1f1fff) AM_READ(SMH_BANK7) /* Main ram */ | |
| 139 | AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_r) | |
| 140 | ADDRESS_MAP_END | |
| 141 | ||
| 142 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 143 | AM_RANGE(0x000000, 0x00ffff) AM_WRITE(SMH_ROM) | |
| 128 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 129 | AM_RANGE(0x000000, 0x00ffff) AM_ROM | |
| 144 | 130 | AM_RANGE(0x040000, 0x040001) AM_WRITE(YM2203_w) |
| 145 | 131 | AM_RANGE(0x080000, 0x080001) AM_WRITE(battlera_adpcm_data_w) |
| 146 | 132 | AM_RANGE(0x1fe800, 0x1fe80f) AM_WRITE(C6280_0_w) |
| 147 | AM_RANGE(0x1f0000, 0x1f1fff) AM_WRITE(SMH_BANK7) /* Main ram */ | |
| 148 | AM_RANGE(0x1ff000, 0x1ff001) AM_WRITE(battlera_adpcm_reset_w) | |
| 133 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK(7) /* Main ram */ | |
| 134 | AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(soundlatch_r, battlera_adpcm_reset_w) | |
| 149 | 135 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(H6280_irq_status_w) |
| 150 | 136 | ADDRESS_MAP_END |
| 151 | 137 | |
| r2418 | r2419 | |
| 260 | 246 | |
| 261 | 247 | /* basic machine hardware */ |
| 262 | 248 | MDRV_CPU_ADD(H6280,21477200/3) |
| 263 | MDRV_CPU_PROGRAM_MAP(battlera_readmem,battlera_writemem) | |
| 264 | MDRV_CPU_IO_MAP(0,battlera_portwrite) | |
| 249 | MDRV_CPU_PROGRAM_MAP(battlera_map,0) | |
| 250 | MDRV_CPU_IO_MAP(battlera_portmap,0) | |
| 265 | 251 | MDRV_CPU_VBLANK_INT_HACK(battlera_interrupt,256) /* 8 prelines, 232 lines, 16 vblank? */ |
| 266 | 252 | |
| 267 | 253 | MDRV_CPU_ADD(H6280,21477200/3) |
| 268 | /* audio CPU */ | |
| 269 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 254 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 270 | 255 | |
| 271 | 256 | /* video hardware */ |
| 272 | 257 | MDRV_SCREEN_ADD("main", RASTER) |
| r2418 | r2419 | |
|---|---|---|
| 291 | 291 | AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_WRITE(SMH_NOP) |
| 292 | 292 | |
| 293 | 293 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE( &spriteram32 ) |
| 294 | AM_RANGE(0x600000, 0x601fff) AM_RAM AM_WRITE(dreamwld_palette_w) AM_BASE(&paletteram32) // real palette? | |
| 295 | AM_RANGE(0x800000, 0x801fff) AM_READWRITE(SMH_RAM, dreamwld_bg_videoram_w ) AM_BASE( &dreamwld_bg_videoram ) | |
| 296 | AM_RANGE(0x802000, 0x803fff) AM_READWRITE(SMH_RAM, dreamwld_bg2_videoram_w ) AM_BASE( &dreamwld_bg2_videoram ) | |
| 294 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(dreamwld_palette_w) AM_BASE(&paletteram32) // real palette? | |
| 295 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(dreamwld_bg_videoram_w ) AM_BASE( &dreamwld_bg_videoram ) | |
| 296 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(dreamwld_bg2_videoram_w ) AM_BASE( &dreamwld_bg2_videoram ) | |
| 297 | 297 | AM_RANGE(0x804000, 0x805fff) AM_RAM AM_BASE( &dreamwld_bg_scroll ) // scroll regs etc. |
| 298 | 298 | |
| 299 | 299 | AM_RANGE(0xc00000, 0xc00003) AM_READ(dreamwld_inputs_r) |
| r2418 | r2419 | |
|---|---|---|
| 167 | 167 | AM_RANGE(0xc014, 0xc014) AM_WRITE(gundealr_flipscreen_w) |
| 168 | 168 | AM_RANGE(0xc016, 0xc016) AM_WRITE(yamyam_bankswitch_w) |
| 169 | 169 | AM_RANGE(0xc020, 0xc023) AM_WRITE(gundealr_fg_scroll_w) /* Gun Dealer only */ |
| 170 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(SMH_RAM, gundealr_paletteram_w) AM_BASE(&paletteram) | |
| 171 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(SMH_RAM, gundealr_bg_videoram_w) AM_BASE(&gundealr_bg_videoram) | |
| 172 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(SMH_RAM, gundealr_fg_videoram_w) AM_BASE(&gundealr_fg_videoram) | |
| 170 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(gundealr_paletteram_w) AM_BASE(&paletteram) | |
| 171 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(gundealr_bg_videoram_w) AM_BASE(&gundealr_bg_videoram) | |
| 172 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(gundealr_fg_videoram_w) AM_BASE(&gundealr_fg_videoram) | |
| 173 | 173 | AM_RANGE(0xe000, 0xffff) AM_RAM AM_BASE(&rambase) |
| 174 | 174 | ADDRESS_MAP_END |
| 175 | 175 | |
| r2418 | r2419 | |
| 567 | 567 | static DRIVER_INIT( yamyam ) |
| 568 | 568 | { |
| 569 | 569 | input_ports_hack = 1; |
| 570 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, yamyam_protection_w); | |
| 570 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, yamyam_protection_w); | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 |
| r2418 | r2419 | |
|---|---|---|
| 422 | 422 | profpac_bank = data; |
| 423 | 423 | |
| 424 | 424 | /* set the main banking */ |
| 425 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xbfff, 0, 0, SMH_BANK1); | |
| 425 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xbfff, 0, 0, SMH_BANK1); | |
| 426 | 426 | memory_set_bankptr(1, memory_region(REGION_USER1) + 0x8000 * bank); |
| 427 | 427 | |
| 428 | 428 | /* bank 0 reads video RAM in the 4000-7FFF range */ |
| 429 | 429 | if (bank == 0) |
| 430 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, profpac_videoram_r); | |
| 430 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, profpac_videoram_r); | |
| 431 | 431 | |
| 432 | 432 | /* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */ |
| 433 | 433 | if ((data & 0x80) && memory_region(REGION_USER2) != NULL) |
| r2418 | r2419 | |
| 438 | 438 | /* if the bank is in range, map the appropriate bank */ |
| 439 | 439 | if (bank < 0x28) |
| 440 | 440 | { |
| 441 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2); | |
| 441 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2); | |
| 442 | 442 | memory_set_bankptr(2, memory_region(REGION_USER2) + 0x4000 * bank); |
| 443 | 443 | } |
| 444 | 444 | else |
| 445 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 445 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
| r2418 | r2419 | |
| 1674 | 1674 | static DRIVER_INIT( seawolf2 ) |
| 1675 | 1675 | { |
| 1676 | 1676 | astrocade_video_config = 0x00; |
| 1677 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w); | |
| 1678 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w); | |
| 1679 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w); | |
| 1677 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w); | |
| 1678 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w); | |
| 1679 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w); | |
| 1680 | 1680 | } |
| 1681 | 1681 | |
| 1682 | 1682 | |
| 1683 | 1683 | static DRIVER_INIT( ebases ) |
| 1684 | 1684 | { |
| 1685 | 1685 | astrocade_video_config = AC_SOUND_PRESENT; |
| 1686 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0xff07, ebases_coin_w); | |
| 1687 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w); | |
| 1686 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0xff07, ebases_coin_w); | |
| 1687 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w); | |
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | 1690 | |
| 1691 | 1691 | static DRIVER_INIT( spacezap ) |
| 1692 | 1692 | { |
| 1693 | 1693 | astrocade_video_config = AC_SOUND_PRESENT; |
| 1694 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r); | |
| 1694 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r); | |
| 1695 | 1695 | } |
| 1696 | 1696 | |
| 1697 | 1697 | |
| 1698 | 1698 | static DRIVER_INIT( wow ) |
| 1699 | 1699 | { |
| 1700 | 1700 | astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; |
| 1701 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, wow_io_r); | |
| 1702 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, wow_speech_r); | |
| 1701 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, wow_io_r); | |
| 1702 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, wow_speech_r); | |
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | |
| 1706 | 1706 | static DRIVER_INIT( gorf ) |
| 1707 | 1707 | { |
| 1708 | 1708 | astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; |
| 1709 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r); | |
| 1710 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r); | |
| 1711 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r); | |
| 1709 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r); | |
| 1710 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r); | |
| 1711 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r); | |
| 1712 | 1712 | } |
| 1713 | 1713 | |
| 1714 | 1714 | |
| 1715 | 1715 | static DRIVER_INIT( robby ) |
| 1716 | 1716 | { |
| 1717 | 1717 | astrocade_video_config = AC_SOUND_PRESENT; |
| 1718 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, robby_io_r); | |
| 1718 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, robby_io_r); | |
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | |
| 1722 | 1722 | static DRIVER_INIT( profpac ) |
| 1723 | 1723 | { |
| 1724 | 1724 | astrocade_video_config = AC_SOUND_PRESENT; |
| 1725 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r); | |
| 1726 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r); | |
| 1725 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r); | |
| 1726 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r); | |
| 1727 | 1727 | |
| 1728 | 1728 | /* reset banking */ |
| 1729 | 1729 | profpac_banksw_w(machine, 0, 0); |
| r2418 | r2419 | |
| 1734 | 1734 | static DRIVER_INIT( demndrgn ) |
| 1735 | 1735 | { |
| 1736 | 1736 | astrocade_video_config = 0x00; |
| 1737 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r); | |
| 1738 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x1c, 0x1c, 0x0000, 0xff00, port_tag_to_handler8("FIREX")); | |
| 1739 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x1d, 0x1d, 0x0000, 0xff00, port_tag_to_handler8("FIREY")); | |
| 1740 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w); | |
| 1737 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r); | |
| 1738 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1c, 0x1c, 0x0000, 0xff00, port_tag_to_handler8("FIREX")); | |
| 1739 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1d, 0x1d, 0x0000, 0xff00, port_tag_to_handler8("FIREY")); | |
| 1740 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w); | |
| 1741 | 1741 | |
| 1742 | 1742 | /* reset banking */ |
| 1743 | 1743 | profpac_banksw_w(machine, 0, 0); |
| r2418 | r2419 | |
| 1748 | 1748 | static DRIVER_INIT( tenpindx ) |
| 1749 | 1749 | { |
| 1750 | 1750 | astrocade_video_config = 0x00; |
| 1751 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x60, 0x60, 0x0000, 0xff00, port_tag_to_handler8("P60")); | |
| 1752 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x61, 0x61, 0x0000, 0xff00, port_tag_to_handler8("P61")); | |
| 1753 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x62, 0x62, 0x0000, 0xff00, port_tag_to_handler8("P62")); | |
| 1754 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x63, 0x63, 0x0000, 0xff00, port_tag_to_handler8("P63")); | |
| 1755 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x64, 0x64, 0x0000, 0xff00, port_tag_to_handler8("P64")); | |
| 1756 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w); | |
| 1757 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w); | |
| 1758 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w); | |
| 1759 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w); | |
| 1751 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x60, 0x60, 0x0000, 0xff00, port_tag_to_handler8("P60")); | |
| 1752 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x61, 0x61, 0x0000, 0xff00, port_tag_to_handler8("P61")); | |
| 1753 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x62, 0x62, 0x0000, 0xff00, port_tag_to_handler8("P62")); | |
| 1754 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x63, 0x63, 0x0000, 0xff00, port_tag_to_handler8("P63")); | |
| 1755 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x64, 0x64, 0x0000, 0xff00, port_tag_to_handler8("P64")); | |
| 1756 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w); | |
| 1757 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w); | |
| 1758 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w); | |
| 1759 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w); | |
| 1760 | 1760 | |
| 1761 | 1761 | /* reset banking */ |
| 1762 | 1762 | profpac_banksw_w(machine, 0, 0); |
| r2418 | r2419 | |
|---|---|---|
| 110 | 110 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 111 | 111 | AM_RANGE(0x060000, 0x06d7ff) AM_RAM |
| 112 | 112 | AM_RANGE(0x06d800, 0x06dfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 113 | AM_RANGE(0x06e000, 0x06e7ff) AM_READWRITE(SMH_RAM, paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 114 | AM_RANGE(0x06e800, 0x06efff) AM_READWRITE(SMH_RAM, toki_background1_videoram16_w) AM_BASE(&toki_background1_videoram16) | |
| 115 | AM_RANGE(0x06f000, 0x06f7ff) AM_READWRITE(SMH_RAM, toki_background2_videoram16_w) AM_BASE(&toki_background2_videoram16) | |
| 116 | AM_RANGE(0x06f800, 0x06ffff) AM_READWRITE(SMH_RAM, toki_foreground_videoram16_w) AM_BASE(&videoram16) | |
| 113 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 114 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_BASE(&toki_background1_videoram16) | |
| 115 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_BASE(&toki_background2_videoram16) | |
| 116 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_BASE(&videoram16) | |
| 117 | 117 | AM_RANGE(0x080000, 0x08000d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 118 | 118 | AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_BASE(&toki_scrollram16) |
| 119 | 119 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
| 125 | 125 | static ADDRESS_MAP_START( tokib_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 126 | 126 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 127 | 127 | AM_RANGE(0x060000, 0x06dfff) AM_RAM |
| 128 | AM_RANGE(0x06e000, 0x06e7ff) AM_READWRITE(SMH_RAM, paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 129 | AM_RANGE(0x06e800, 0x06efff) AM_READWRITE(SMH_RAM, toki_background1_videoram16_w) AM_BASE(&toki_background1_videoram16) | |
| 130 | AM_RANGE(0x06f000, 0x06f7ff) AM_READWRITE(SMH_RAM, toki_background2_videoram16_w) AM_BASE(&toki_background2_videoram16) | |
| 131 | AM_RANGE(0x06f800, 0x06ffff) AM_READWRITE(SMH_RAM, toki_foreground_videoram16_w) AM_BASE(&videoram16) | |
| 128 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 129 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_BASE(&toki_background1_videoram16) | |
| 130 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_BASE(&toki_background2_videoram16) | |
| 131 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_BASE(&videoram16) | |
| 132 | 132 | AM_RANGE(0x071000, 0x071001) AM_WRITE(SMH_NOP) /* sprite related? seems another scroll register */ |
| 133 | 133 | /* gets written the same value as 75000a (bg2 scrollx) */ |
| 134 | 134 | AM_RANGE(0x071804, 0x071807) AM_WRITE(SMH_NOP) /* sprite related, always 01be0100 */ |
| r2418 | r2419 | |
|---|---|---|
| 3068 | 3068 | DRIVER_INIT_CALL(galaga); |
| 3069 | 3069 | |
| 3070 | 3070 | /* Gatsbee has a larger character ROM, we need a handler for banking */ |
| 3071 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w); | |
| 3071 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w); | |
| 3072 | 3072 | } |
| 3073 | 3073 | |
| 3074 | 3074 | |
| r2418 | r2419 | |
| 3110 | 3110 | static DRIVER_INIT( battles ) |
| 3111 | 3111 | { |
| 3112 | 3112 | /* replace the Namco I/O handlers with interface to the 4th CPU */ |
| 3113 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_r ); | |
| 3114 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_r ); | |
| 3115 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_w ); | |
| 3116 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_w ); | |
| 3113 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w ); | |
| 3114 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w ); | |
| 3117 | 3115 | |
| 3118 | 3116 | DRIVER_INIT_CALL(xevious); |
| 3119 | 3117 | } |
| r2418 | r2419 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static ADDRESS_MAP_START( lasso_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 82 | 82 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 83 | AM_RANGE(0x0400, 0x07ff) AM_READWRITE(SMH_RAM, lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 84 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE(SMH_RAM, lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 83 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 84 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 85 | 85 | AM_RANGE(0x0c00, 0x0c7f) AM_RAM AM_BASE(&lasso_spriteram) AM_SIZE(&lasso_spriteram_size) |
| 86 | 86 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE(1) |
| 87 | 87 | AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_command_w) |
| r2418 | r2419 | |
| 115 | 115 | |
| 116 | 116 | static ADDRESS_MAP_START( chameleo_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 117 | 117 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 118 | AM_RANGE(0x0400, 0x07ff) AM_READWRITE(SMH_RAM, lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 119 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE(SMH_RAM, lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 118 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 119 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 120 | 120 | AM_RANGE(0x0c00, 0x0fff) AM_RAM |
| 121 | 121 | AM_RANGE(0x1000, 0x107f) AM_RAM AM_BASE(&lasso_spriteram) AM_SIZE(&lasso_spriteram_size) |
| 122 | 122 | AM_RANGE(0x1080, 0x10ff) AM_RAM |
| r2418 | r2419 | |
| 146 | 146 | |
| 147 | 147 | static ADDRESS_MAP_START( wwjgtin_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 148 | 148 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 149 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE(SMH_RAM, lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 150 | AM_RANGE(0x0c00, 0x0fff) AM_READWRITE(SMH_RAM, lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 149 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 150 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 151 | 151 | AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE(&lasso_spriteram) AM_SIZE(&lasso_spriteram_size) |
| 152 | 152 | AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_command_w) |
| 153 | 153 | AM_RANGE(0x1801, 0x1801) AM_WRITE(SMH_RAM) AM_BASE(&lasso_back_color) |
| r2418 | r2419 | |
| 176 | 176 | |
| 177 | 177 | static ADDRESS_MAP_START( pinbo_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 178 | 178 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 179 | AM_RANGE(0x0400, 0x07ff) AM_READWRITE(SMH_RAM, lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 180 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE(SMH_RAM, lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 179 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(lasso_videoram_w) AM_BASE(&lasso_videoram) | |
| 180 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(lasso_colorram_w) AM_BASE(&lasso_colorram) | |
| 181 | 181 | AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE(&lasso_spriteram) AM_SIZE(&lasso_spriteram_size) |
| 182 | 182 | AM_RANGE(0x1800, 0x1800) AM_WRITE(pinbo_sound_command_w) |
| 183 | 183 | AM_RANGE(0x1802, 0x1802) AM_WRITE(pinbo_video_control_w) |
| r2418 | r2419 | |
|---|---|---|
| 74 | 74 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 75 | 75 | AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram ? */ |
| 76 | 76 | AM_RANGE(0xe800, 0xe87f) AM_RAM AM_BASE(&macs_ram2) |
| 77 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 77 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 78 | 78 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 79 | 79 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 80 | 80 | AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK(3) /* common /backup ram ?*/ |
| r2418 | r2419 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 186 | 186 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 187 | AM_RANGE(0x8000, 0xbfff) AM_R | |
| 187 | AM_RANGE(0x8000, 0xbfff) AM_R | |
| 188 | 188 | AM_RANGE(0xf800, 0xf800) AM_WRITE(AY8910_control_port_0_w) |
| 189 | 189 | AM_RANGE(0xf801, 0xf801) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 190 | 190 | AM_RANGE(0xfc00, 0xffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 91 | 91 | AM_RANGE(0x280002, 0x280003) AM_READ( input_port_1_word_r ) |
| 92 | 92 | AM_RANGE(0x280004, 0x280005) AM_READ( input_port_2_word_r ) |
| 93 | 93 | |
| 94 | AM_RANGE(0x800000, 0x8007ff) AM_R | |
| 94 | AM_RANGE(0x800000, 0x8007ff) AM_R | |
| 95 | 95 | |
| 96 | AM_RANGE(0x820000, 0x820fff) AM_READWRITE(SMH_RAM, fg_tilemapram_w) AM_BASE(&fg_tilemapram) | |
| 97 | AM_RANGE(0x822000, 0x822fff) AM_READWRITE(SMH_RAM, bg_tilemapram_w) AM_BASE(&bg_tilemapram) | |
| 96 | AM_RANGE(0x820000, 0x820fff) AM_RAM_WRITE(fg_tilemapram_w) AM_BASE(&fg_tilemapram) | |
| 97 | AM_RANGE(0x822000, 0x822fff) AM_RAM_WRITE(bg_tilemapram_w) AM_BASE(&bg_tilemapram) | |
| 98 | 98 | |
| 99 | 99 | AM_RANGE(0xff0000, 0xffefff) AM_RAM |
| 100 | 100 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 127 | 127 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 128 | AM_RANGE(0x4000, 0x5fff) AM_R | |
| 128 | AM_RANGE(0x4000, 0x5fff) AM_R | |
| 129 | 129 | AM_RANGE(0x6000, 0x63ff) AM_RAM /* ?? */ |
| 130 | 130 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(input_port_0_r, sound_w) /* sound_w listed twice?? */ |
| 131 | 131 | AM_RANGE(0x8001, 0x8001) AM_WRITE(SMH_RAM) AM_BASE(&mask) |
| r2418 | r2419 | |
|---|---|---|
| 1403 | 1403 | |
| 1404 | 1404 | ds1204_init(0, megat4te_ds1204_nvram); |
| 1405 | 1405 | |
| 1406 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_w ); | |
| 1407 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_r ); | |
| 1406 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w ); | |
| 1408 | 1407 | |
| 1409 | 1408 | }; |
| 1410 | 1409 |
| r2418 | r2419 | |
|---|---|---|
| 152 | 152 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 153 | 153 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 154 | 154 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 155 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 155 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 156 | 156 | ADDRESS_MAP_END |
| 157 | 157 | |
| 158 | 158 | static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 67 | 67 | AM_RANGE(0xc804, 0xc804) AM_WRITE(c1943_c804_w) // ROM bank switch, screen flip |
| 68 | 68 | AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w) |
| 69 | 69 | AM_RANGE(0xc807, 0xc807) AM_WRITENOP // ??? |
| 70 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(c1943_videoram_w) AM_BASE(&videoram) | |
| 71 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_WRITE(c1943_colorram_w) AM_BASE(&colorram) | |
| 70 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(c1943_videoram_w) AM_BASE(&videoram) | |
| 71 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(c1943_colorram_w) AM_BASE(&colorram) | |
| 72 | 72 | AM_RANGE(0xd800, 0xd801) AM_RAM AM_BASE(&c1943_scrollx) |
| 73 | 73 | AM_RANGE(0xd802, 0xd802) AM_RAM AM_BASE(&c1943_scrolly) |
| 74 | 74 | AM_RANGE(0xd803, 0xd804) AM_RAM AM_BASE(&c1943_bgscrollx) |
| r2418 | r2419 | |
|---|---|---|
| 1778 | 1778 | |
| 1779 | 1779 | static DRIVER_INIT( cninja ) |
| 1780 | 1780 | { |
| 1781 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w); | |
| 1781 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w); | |
| 1782 | 1782 | cninja_patch(); |
| 1783 | 1783 | } |
| 1784 | 1784 | |
| 1785 | 1785 | static DRIVER_INIT( stoneage ) |
| 1786 | 1786 | { |
| 1787 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w); | |
| 1787 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w); | |
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | 1790 | static DRIVER_INIT( mutantf ) |
| r2418 | r2419 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 250 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(SMH_RAM, pacland_videoram_w) AM_BASE(&pacland_videoram) | |
| 251 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(SMH_RAM, pacland_videoram2_w) AM_BASE(&pacland_videoram2) | |
| 250 | AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(pacland_videoram_w) AM_BASE(&pacland_videoram) | |
| 251 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(pacland_videoram2_w) AM_BASE(&pacland_videoram2) | |
| 252 | 252 | AM_RANGE(0x2000, 0x37ff) AM_RAM AM_BASE(&pacland_spriteram) |
| 253 | 253 | AM_RANGE(0x3800, 0x3801) AM_WRITE(pacland_scroll0_w) |
| 254 | 254 | AM_RANGE(0x3a00, 0x3a01) AM_WRITE(pacland_scroll1_w) |
| r2418 | r2419 | |
|---|---|---|
| 1084 | 1084 | set_hotgmck_pcm_bank(0); |
| 1085 | 1085 | set_hotgmck_pcm_bank(1); |
| 1086 | 1086 | |
| 1087 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800008, 0x580000b, 0, 0, hotgmck_pcm_bank_w ); | |
| 1087 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800008, 0x580000b, 0, 0, hotgmck_pcm_bank_w ); | |
| 1088 | 1088 | state_save_register_postload(machine, hotgmck_pcm_bank_postload, (void *)0); |
| 1089 | 1089 | state_save_register_postload(machine, hotgmck_pcm_bank_postload, (void *)1); |
| 1090 | 1090 | } |
| r2418 | r2419 | |
| 1093 | 1093 | { |
| 1094 | 1094 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 1095 | 1095 | memory_set_bankptr(1,&RAM[0x100000]); |
| 1096 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800000, 0x5800007, 0, 0, hotgmck_io32_r ); // Different Inputs | |
| 1096 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800000, 0x5800007, 0, 0, hotgmck_io32_r ); // Different Inputs | |
| 1097 | 1097 | install_hotgmck_pcm_bank(machine); // Banked PCM ROM |
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | static DRIVER_INIT( loderndf ) |
| 1101 | 1101 | { |
| 1102 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderndf_speedup_r ); | |
| 1102 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderndf_speedup_r ); | |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | static DRIVER_INIT( loderdfa ) |
| 1106 | 1106 | { |
| 1107 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderdfa_speedup_r ); | |
| 1107 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderdfa_speedup_r ); | |
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | 1110 | static DRIVER_INIT( hotdebut ) |
| 1111 | 1111 | { |
| 1112 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600001c, 0x600001f, 0, 0, hotdebut_speedup_r ); | |
| 1112 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600001c, 0x600001f, 0, 0, hotdebut_speedup_r ); | |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | 1115 |
| r2418 | r2419 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | if (data) |
| 146 | 146 | { |
| 147 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_BANK1); | |
| 147 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_BANK1); | |
| 148 | 148 | switch (data) |
| 149 | 149 | { |
| 150 | 150 | case 2: bankaddress = 0x10000; break; |
| r2418 | r2419 | |
| 160 | 160 | } |
| 161 | 161 | else |
| 162 | 162 | { |
| 163 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r); | |
| 164 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, SMH_BANK4); | |
| 165 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, SMH_BANK2); | |
| 166 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, SMH_BANK3); | |
| 163 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r); | |
| 164 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, SMH_BANK4); | |
| 165 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, SMH_BANK2); | |
| 166 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, SMH_BANK3); | |
| 167 | 167 | memory_set_bankptr(1, &RAM[0x0000]); |
| 168 | 168 | memory_set_bankptr(2, rambase_ae00); |
| 169 | 169 | memory_set_bankptr(3, rambase_c000); |
| r2418 | r2419 | |
|---|---|---|
| 116 | 116 | AM_RANGE(0xd600, 0xd600) AM_WRITE(jcross_vregs3_w) |
| 117 | 117 | AM_RANGE(0xd700, 0xd700) AM_WRITE(jcross_vregs4_w) |
| 118 | 118 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram) |
| 119 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(SMH_RAM, jcross_background_ram_w) AM_SHARE(2) AM_BASE(&videoram) | |
| 120 | AM_RANGE(0xf000, 0xf3ff) AM_READWRITE(SMH_RAM, jcross_text_ram_w) AM_BASE(&jcr_textram) | |
| 119 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(jcross_background_ram_w) AM_SHARE(2) AM_BASE(&videoram) | |
| 120 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(jcross_text_ram_w) AM_BASE(&jcr_textram) | |
| 121 | 121 | AM_RANGE(0xf400, 0xffff) AM_RAM |
| 122 | 122 | ADDRESS_MAP_END |
| 123 | 123 |
| r2418 | r2419 | |
|---|---|---|
| 1355 | 1355 | |
| 1356 | 1356 | static DRIVER_INIT( kyustrkr ) |
| 1357 | 1357 | { |
| 1358 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90000f, 0, 0, kyustrkr_input_w); | |
| 1358 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90000f, 0, 0, kyustrkr_input_w); | |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 |
| r2418 | r2419 | |
|---|---|---|
| 177 | 177 | AM_RANGE(0xb504, 0xb504) AM_READ(input_port_4_r) |
| 178 | 178 | AM_RANGE(0xb506, 0xb507) AM_READWRITE(jack_flipscreen_r, jack_flipscreen_w) |
| 179 | 179 | AM_RANGE(0xb700, 0xb700) AM_WRITE(joinem_misc_w) |
| 180 | AM_RANGE(0xb800, 0xbbff) AM_RAM AM_WRITE(jack_videoram_w) AM_BASE(&videoram) | |
| 181 | AM_RANGE(0xbc00, 0xbfff) AM_RAM AM_WRITE(jack_colorram_w) AM_BASE(&colorram) | |
| 180 | AM_RANGE(0xb800, 0xbbff) AM_RAM_WRITE(jack_videoram_w) AM_BASE(&videoram) | |
| 181 | AM_RANGE(0xbc00, 0xbfff) AM_RAM_WRITE(jack_colorram_w) AM_BASE(&colorram) | |
| 182 | 182 | ADDRESS_MAP_END |
| 183 | 183 | |
| 184 | 184 | |
| r2418 | r2419 | |
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | // Set-up the weirdest questions read ever done |
| 1458 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, striv_question_r); | |
| 1458 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, striv_question_r); | |
| 1459 | 1459 | |
| 1460 | 1460 | // Nop out unused sprites writes |
| 1461 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb0ff, 0, 0, SMH_NOP); | |
| 1461 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb0ff, 0, 0, SMH_NOP); | |
| 1462 | 1462 | |
| 1463 | 1463 | timer_rate = 128; |
| 1464 | 1464 | } |
| r2418 | r2419 | |
|---|---|---|
| 2608 | 2608 | static DRIVER_INIT( spacecr ) |
| 2609 | 2609 | { |
| 2610 | 2610 | /* install protection handler */ |
| 2611 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd48b, 0xd48b, 0, 0, spacecr_prot_r); | |
| 2611 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd48b, 0xd48b, 0, 0, spacecr_prot_r); | |
| 2612 | 2612 | } |
| 2613 | 2613 | |
| 2614 | 2614 | static DRIVER_INIT( alpine ) |
| 2615 | 2615 | { |
| 2616 | 2616 | /* install protection handlers */ |
| 2617 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r); | |
| 2618 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd50f, 0xd50f, 0, 0, alpine_protection_w); | |
| 2617 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r); | |
| 2618 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50f, 0xd50f, 0, 0, alpine_protection_w); | |
| 2619 | 2619 | } |
| 2620 | 2620 | |
| 2621 | 2621 | static DRIVER_INIT( alpinea ) |
| 2622 | 2622 | { |
| 2623 | 2623 | /* install protection handlers */ |
| 2624 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r); | |
| 2625 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd50e, 0xd50e, 0, 0, alpinea_bankswitch_w); | |
| 2624 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r); | |
| 2625 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50e, 0xd50e, 0, 0, alpinea_bankswitch_w); | |
| 2626 | 2626 | } |
| 2627 | 2627 | |
| 2628 | 2628 | static DRIVER_INIT( junglhbr ) |
| 2629 | 2629 | { |
| 2630 | 2630 | /* inverter on bits 0 and 1 */ |
| 2631 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, junglhbr_characterram_w); | |
| 2631 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, junglhbr_characterram_w); | |
| 2632 | 2632 | } |
| 2633 | 2633 | |
| 2634 | 2634 | static DRIVER_INIT( kikstart ) |
| r2418 | r2419 | |
|---|---|---|
| 73 | 73 | static ADDRESS_MAP_START( vigilant_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 74 | 74 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) /* Fallthrough */ |
| 75 | 75 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 76 | AM_RANGE(0xc020, 0xc0df) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 77 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram) | |
| 76 | AM_RANGE(0xc020, 0xc0df) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 77 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram) | |
| 78 | 78 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 79 | 79 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 80 | 80 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 95 | 95 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) /* Fallthrough */ |
| 96 | 96 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 97 | 97 | AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 98 | AM_RANGE(0xc800, 0xcaff) AM_RAM AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram) | |
| 99 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 98 | AM_RANGE(0xc800, 0xcaff) AM_RAM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram) | |
| 99 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 100 | 100 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 101 | 101 | ADDRESS_MAP_END |
| 102 | 102 |
| r2418 | r2419 | |
|---|---|---|
| 1038 | 1038 | |
| 1039 | 1039 | static DRIVER_INIT( youmab ) |
| 1040 | 1040 | { |
| 1041 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there | |
| 1042 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 1041 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there | |
| 1042 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 1043 | 1043 | memory_set_bankptr( 2, memory_region(REGION_USER2) ); |
| 1044 | 1044 | |
| 1045 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values | |
| 1046 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence.. | |
| 1045 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values | |
| 1046 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence.. | |
| 1047 | 1047 | |
| 1048 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xd81f, 0, 0, SMH_NOP); // scrolling isn't here.. | |
| 1048 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xd81f, 0, 0, SMH_NOP); // scrolling isn't here.. | |
| 1049 | 1049 | |
| 1050 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x8a, 0x8a, 0, 0, youmab_8a_r); // ??? | |
| 1050 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x8a, 0x8a, 0, 0, youmab_8a_r); // ??? | |
| 1051 | 1051 | |
| 1052 | 1052 | } |
| 1053 | 1053 |
| r2418 | r2419 | |
|---|---|---|
| 173 | 173 | AM_RANGE(0x10000000, 0x100003ff) AM_RAM AM_BASE(&igs_mainram)// main ram for asic? |
| 174 | 174 | AM_RANGE(0x18000000, 0x18007fff) AM_RAM |
| 175 | 175 | |
| 176 | AM_RANGE(0x38001000, 0x380017ff) AM_READWRITE(SMH_RAM, igs_cg_videoram_w) AM_BASE(&igs_cg_videoram) //0x200 * 1 CG PALLETE? | |
| 177 | AM_RANGE(0x38001800, 0x38001fff) AM_READWRITE(SMH_RAM, igs_pallete32_w) AM_BASE(&igs_pallete32) //0x200 * 1 | |
| 176 | AM_RANGE(0x38001000, 0x380017ff) AM_RAM_WRITE(igs_cg_videoram_w) AM_BASE(&igs_cg_videoram) //0x200 * 1 CG PALLETE? | |
| 177 | AM_RANGE(0x38001800, 0x38001fff) AM_RAM_WRITE(igs_pallete32_w) AM_BASE(&igs_pallete32) //0x200 * 1 | |
| 178 | 178 | |
| 179 | AM_RANGE(0x38004000, 0x38005FFF) AM_READWRITE(SMH_RAM, igs_tx_videoram_w) AM_BASE(&igs_tx_videoram) /* Text Layer */ | |
| 180 | AM_RANGE(0x38006000, 0x38007FFF) AM_READWRITE(SMH_RAM, igs_bg_videoram_w) AM_BASE(&igs_bg_videoram) /* CG Layer */ | |
| 179 | AM_RANGE(0x38004000, 0x38005FFF) AM_RAM_WRITE(igs_tx_videoram_w) AM_BASE(&igs_tx_videoram) /* Text Layer */ | |
| 180 | AM_RANGE(0x38006000, 0x38007FFF) AM_RAM_WRITE(igs_bg_videoram_w) AM_BASE(&igs_bg_videoram) /* CG Layer */ | |
| 181 | 181 | |
| 182 | 182 | |
| 183 | 183 | AM_RANGE(0x38002010, 0x38002017) AM_RAM //?????????????? |
| r2418 | r2419 | |
|---|---|---|
| 114 | 114 | AM_RANGE(0x0600, 0x0603) AM_WRITE(canyon_whistle_w) |
| 115 | 115 | AM_RANGE(0x0680, 0x0683) AM_WRITE(canyon_led_w) |
| 116 | 116 | AM_RANGE(0x0700, 0x0703) AM_WRITE(canyon_attract_w) |
| 117 | AM_RANGE(0x0800, 0x0bff) AM_R | |
| 117 | AM_RANGE(0x0800, 0x0bff) AM_R | |
| 118 | 118 | AM_RANGE(0x1000, 0x17ff) AM_READWRITE(canyon_switches_r, SMH_NOP) /* sloppy code writes here */ |
| 119 | 119 | AM_RANGE(0x1800, 0x1fff) AM_READ(canyon_options_r) |
| 120 | 120 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| r2418 | r2419 | |
|---|---|---|
| 123 | 123 | AM_RANGE(0xa000, 0xa000) AM_WRITENOP |
| 124 | 124 | AM_RANGE(0xb000, 0xb000) AM_READ(b000_r) AM_WRITE(b000_w) |
| 125 | 125 | AM_RANGE(0xb800, 0xb800) AM_WRITE(b800_w) |
| 126 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(ettrivia_fg_w) AM_BASE(&fg_videoram) | |
| 127 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(ettrivia_bg_w) AM_BASE(&bg_videoram) | |
| 126 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ettrivia_fg_w) AM_BASE(&fg_videoram) | |
| 127 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ettrivia_bg_w) AM_BASE(&bg_videoram) | |
| 128 | 128 | ADDRESS_MAP_END |
| 129 | 129 | |
| 130 | 130 | static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 536 | 536 | /**/AM_RANGE(0x080020, 0x08003f) AM_READ(SMH_RAM) AM_WRITE(jalmah_scroll_w) |
| 537 | 537 | AM_RANGE(0x080040, 0x080041) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| 538 | 538 | // 0x084000, 0x084001 ? |
| 539 | AM_RANGE(0x088000, 0x0887ff) AM_READWRITE(SMH_RAM, paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) /* Palette RAM */ | |
| 540 | AM_RANGE(0x090000, 0x093fff) AM_READWRITE(SMH_RAM, sc0_vram_w) AM_BASE(&sc0_vram) | |
| 541 | AM_RANGE(0x094000, 0x097fff) AM_READWRITE(SMH_RAM, sc1_vram_w) AM_BASE(&sc1_vram) | |
| 542 | AM_RANGE(0x098000, 0x09bfff) AM_READWRITE(SMH_RAM, sc2_vram_w) AM_BASE(&sc2_vram) | |
| 543 | AM_RANGE(0x09c000, 0x09ffff) AM_READWRITE(SMH_RAM, sc3_vram_w) AM_BASE(&sc3_vram) | |
| 544 | AM_RANGE(0x0a0000, 0x0a3fff) AM_READWRITE(SMH_RAM, sc3_vram_w) /*urashima mirror*/ | |
| 539 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) /* Palette RAM */ | |
| 540 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(&sc0_vram) | |
| 541 | AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE(sc1_vram_w) AM_BASE(&sc1_vram) | |
| 542 | AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE(sc2_vram_w) AM_BASE(&sc2_vram) | |
| 543 | AM_RANGE(0x09c000, 0x09ffff) AM_RAM_WRITE(sc3_vram_w) AM_BASE(&sc3_vram) | |
| 544 | AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(sc3_vram_w) /*urashima mirror*/ | |
| 545 | 545 | AM_RANGE(0x0f0000, 0x0f0fff) AM_RAM AM_BASE(&jm_regs)/*shared with MCU*/ |
| 546 | 546 | AM_RANGE(0x0f1000, 0x0fffff) AM_RAM AM_BASE(&jm_ram) |
| 547 | 547 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(&jm_mcu_code)/*extra RAM for MCU code prg (NOT ON REAL HW!!!)*/ |
| r2418 | r2419 | |
| 1885 | 1885 | |
| 1886 | 1886 | static DRIVER_INIT( urashima ) |
| 1887 | 1887 | { |
| 1888 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r ); | |
| 1889 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, urashima_mcu_w ); | |
| 1890 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1888 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r ); | |
| 1889 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, urashima_mcu_w ); | |
| 1890 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1891 | 1891 | memory_set_bankptr(1, auto_malloc(0xf0322 - 0xf0320)); |
| 1892 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1892 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1893 | 1893 | memory_set_bankptr(2, auto_malloc(0xf03c6 - 0xf03c0)); |
| 1894 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1894 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1895 | 1895 | memory_set_bankptr(3, auto_malloc(0xf03e6 - 0xf03c6)); |
| 1896 | 1896 | mcu_prg = 0x12; |
| 1897 | 1897 | } |
| 1898 | 1898 | |
| 1899 | 1899 | static DRIVER_INIT( daireika ) |
| 1900 | 1900 | { |
| 1901 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r ); | |
| 1902 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, daireika_mcu_w ); | |
| 1903 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1901 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r ); | |
| 1902 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, daireika_mcu_w ); | |
| 1903 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1904 | 1904 | memory_set_bankptr(1, auto_malloc(0xf0142 - 0xf0140)); |
| 1905 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1905 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1906 | 1906 | memory_set_bankptr(2, auto_malloc(0xf0026 - 0xf0020)); |
| 1907 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1907 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1908 | 1908 | memory_set_bankptr(3, auto_malloc(0xf00d6 - 0xf00c0)); |
| 1909 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf0130, 0, 0, SMH_BANK4, SMH_BANK4 ); | |
| 1909 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf0130, 0, 0, SMH_BANK4, SMH_BANK4 ); | |
| 1910 | 1910 | memory_set_bankptr(4, auto_malloc(0xf0130 - 0xf0100)); |
| 1911 | 1911 | mcu_prg = 0x11; |
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | 1914 | static DRIVER_INIT( mjzoomin ) |
| 1915 | 1915 | { |
| 1916 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r ); | |
| 1917 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, mjzoomin_mcu_w ); | |
| 1918 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1916 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r ); | |
| 1917 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, mjzoomin_mcu_w ); | |
| 1918 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, SMH_BANK1, SMH_BANK1 ); | |
| 1919 | 1919 | memory_set_bankptr(1, auto_malloc(0xf00c6 - 0xf00c0)); |
| 1920 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1920 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, SMH_BANK2, SMH_BANK2 ); | |
| 1921 | 1921 | memory_set_bankptr(2, auto_malloc(0xf00d2 - 0xf00c6)); |
| 1922 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1922 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, SMH_BANK3, SMH_BANK3 ); | |
| 1923 | 1923 | memory_set_bankptr(3, auto_malloc(0xf0030 - 0xf0020)); |
| 1924 | 1924 | mcu_prg = 0x13; |
| 1925 | 1925 | } |
| 1926 | 1926 | |
| 1927 | 1927 | static DRIVER_INIT( kakumei ) |
| 1928 | 1928 | { |
| 1929 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r ); | |
| 1929 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r ); | |
| 1930 | 1930 | mcu_prg = 0x21; |
| 1931 | 1931 | } |
| 1932 | 1932 | |
| 1933 | 1933 | static DRIVER_INIT( kakumei2 ) |
| 1934 | 1934 | { |
| 1935 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r ); | |
| 1935 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r ); | |
| 1936 | 1936 | mcu_prg = 0x22; |
| 1937 | 1937 | } |
| 1938 | 1938 | |
| 1939 | 1939 | static DRIVER_INIT( suchipi ) |
| 1940 | 1940 | { |
| 1941 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, suchipi_mcu_r ); | |
| 1941 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, suchipi_mcu_r ); | |
| 1942 | 1942 | mcu_prg = 0x23; |
| 1943 | 1943 | } |
| 1944 | 1944 |
| r2418 | r2419 | |
|---|---|---|
| 251 | 251 | AM_RANGE(0xf10000, 0xf103ff) AM_RAM //unused |
| 252 | 252 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM |
| 253 | 253 | AM_RANGE(0xffc000, 0xffcfff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&sharedram) |
| 254 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_WRITE(f1gp_fgvideoram_w) AM_BASE(&f1gp_fgvideoram) | |
| 255 | AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) | |
| 254 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(f1gp_fgvideoram_w) AM_BASE(&f1gp_fgvideoram) | |
| 255 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) | |
| 256 | 256 | AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r) |
| 257 | 257 | AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_1_word_r) |
| 258 | 258 | AM_RANGE(0xfff006, 0xfff007) AM_READ(input_port_2_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 156 | 156 | static ADDRESS_MAP_START( ponttehk_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 157 | 157 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 158 | 158 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 159 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 160 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 159 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 160 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 161 | 161 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 162 | 162 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) AM_WRITENOP // lamps |
| 163 | 163 | AM_RANGE(0xa002, 0xa002) AM_READ(payout_r) AM_WRITE(control_port_2a_w)//AM_WRITENOP // ??? |
| r2418 | r2419 | |
| 166 | 166 | static ADDRESS_MAP_START( lvcards_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 167 | 167 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 168 | 168 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 169 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 170 | AM_RANGE(0x9400, 0x97ff) AM_RAM AM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 169 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 170 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 171 | 171 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 172 | 172 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) AM_WRITENOP |
| 173 | 173 | AM_RANGE(0xa002, 0xa002) AM_READ(input_port_2_r) AM_WRITENOP |
| r2418 | r2419 | |
| 183 | 183 | static ADDRESS_MAP_START( lvpoker_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 184 | 184 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 185 | 185 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 186 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 187 | AM_RANGE(0x9400, 0x97ff) AM_RAM AM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 186 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(lvcards_videoram_w) AM_BASE(&videoram) | |
| 187 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(lvcards_colorram_w) AM_BASE(&colorram) | |
| 188 | 188 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 189 | 189 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) AM_WRITENOP // lamps |
| 190 | 190 | AM_RANGE(0xa002, 0xa002) AM_READ(payout_r) AM_WRITE(control_port_2_w) |
| r2418 | r2419 | |
|---|---|---|
| 108 | 108 | AM_RANGE(0x01600000, 0x0160001f) AM_READWRITE(midwunit_security_r, midwunit_security_w) |
| 109 | 109 | AM_RANGE(0x01680000, 0x0168001f) AM_READWRITE(midwunit_sound_r, midwunit_sound_w) |
| 110 | 110 | AM_RANGE(0x01800000, 0x0187ffff) AM_READWRITE(midwunit_io_r, midwunit_io_w) |
| 111 | AM_RANGE(0x01880000, 0x018fffff) AM_R | |
| 111 | AM_RANGE(0x01880000, 0x018fffff) AM_R | |
| 112 | 112 | AM_RANGE(0x01a00000, 0x01a000ff) AM_MIRROR(0x00080000) AM_READWRITE(midtunit_dma_r, midtunit_dma_w) |
| 113 | 113 | AM_RANGE(0x01b00000, 0x01b0001f) AM_READWRITE(midwunit_control_r, midwunit_control_w) |
| 114 | 114 | AM_RANGE(0x02000000, 0x06ffffff) AM_READ(midwunit_gfxrom_r) AM_BASE((UINT16 **)&midwunit_decode_memory) |
| r2418 | r2419 | |
|---|---|---|
| 166 | 166 | AM_RANGE(0x0c00, 0x0fff) AM_RAM |
| 167 | 167 | AM_RANGE(0x1000, 0x8fff) AM_ROM |
| 168 | 168 | AM_RANGE(0xe800, 0xebff) AM_ROM |
| 169 | AM_RANGE(0xec00, 0xf7ff) AM_R | |
| 169 | AM_RANGE(0xec00, 0xf7ff) AM_R | |
| 170 | 170 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 171 | 171 | ADDRESS_MAP_END |
| 172 | 172 |
| r2418 | r2419 | |
|---|---|---|
| 302 | 302 | * |
| 303 | 303 | *************************************/ |
| 304 | 304 | |
| 305 | void exidy440_bank_select(UINT8 bank) | |
| 305 | void exidy440_bank_select(running_machine *machine, UINT8 bank) | |
| 306 | 306 | { |
| 307 | 307 | /* for the showdown case, bank 0 is a PLD */ |
| 308 | 308 | if (showdown_bank_data[0] != NULL) |
| 309 | 309 | { |
| 310 | 310 | if (bank == 0 && exidy440_bank != 0) |
| 311 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, showdown_bank0_r); | |
| 311 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, showdown_bank0_r); | |
| 312 | 312 | else if (bank != 0 && exidy440_bank == 0) |
| 313 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1); | |
| 313 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /* select the bank and update the bank pointer */ |
| r2418 | r2419 | |
| 454 | 454 | static MACHINE_RESET( exidy440 ) |
| 455 | 455 | { |
| 456 | 456 | exidy440_bank = 0xff; |
| 457 | exidy440_bank_select(0); | |
| 457 | exidy440_bank_select(machine, 0); | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | |
| r2418 | r2419 | |
| 467 | 467 | |
| 468 | 468 | static ADDRESS_MAP_START( exidy440_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 469 | 469 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&exidy440_imageram) |
| 470 | AM_RANGE(0x2000, 0x209f) AM_R | |
| 470 | AM_RANGE(0x2000, 0x209f) AM_R | |
| 471 | 471 | AM_RANGE(0x20a0, 0x29ff) AM_RAM |
| 472 | 472 | AM_RANGE(0x2a00, 0x2aff) AM_READWRITE(exidy440_videoram_r, exidy440_videoram_w) |
| 473 | 473 | AM_RANGE(0x2b00, 0x2b00) AM_READ(exidy440_vertical_pos_r) |
| r2418 | r2419 | |
| 475 | 475 | AM_RANGE(0x2b02, 0x2b02) AM_RAM AM_BASE(&exidy440_scanline) |
| 476 | 476 | AM_RANGE(0x2b03, 0x2b03) AM_READWRITE(input_port_0_r, exidy440_control_w) |
| 477 | 477 | AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(exidy440_paletteram_r, exidy440_paletteram_w) |
| 478 | AM_RANGE(0x2e00, 0x2e1f) AM_R | |
| 478 | AM_RANGE(0x2e00, 0x2e1f) AM_R | |
| 479 | 479 | AM_RANGE(0x2e20, 0x2e3f) AM_READWRITE(exidy440_input_port_3_r, exidy440_input_port_3_w) |
| 480 | 480 | AM_RANGE(0x2e40, 0x2e5f) AM_READWRITE(SMH_NOP, exidy440_coin_counter_w) /* read: clear coin counters I/O2 */ |
| 481 | 481 | AM_RANGE(0x2e60, 0x2e7f) AM_READWRITE(input_port_1_r, SMH_NOP) |
| r2418 | r2419 | |
| 1934 | 1934 | { |
| 1935 | 1935 | DRIVER_INIT_CALL(exidy440); |
| 1936 | 1936 | |
| 1937 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec0, 0x2ec3, 0, 0, claypign_protection_r); | |
| 1937 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec0, 0x2ec3, 0, 0, claypign_protection_r); | |
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | 1940 | |
| r2418 | r2419 | |
| 1943 | 1943 | DRIVER_INIT_CALL(exidy440); |
| 1944 | 1944 | |
| 1945 | 1945 | /* extra input ports and scrolling */ |
| 1946 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec5, 0x2ec5, 0, 0, topsecex_input_port_5_r); | |
| 1947 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec6, 0x2ec6, 0, 0, input_port_4_r); | |
| 1948 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec7, 0x2ec7, 0, 0, input_port_6_r); | |
| 1946 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec5, 0x2ec5, 0, 0, topsecex_input_port_5_r); | |
| 1947 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec6, 0x2ec6, 0, 0, input_port_4_r); | |
| 1948 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec7, 0x2ec7, 0, 0, input_port_6_r); | |
| 1949 | 1949 | |
| 1950 | topsecex_yscroll = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w); | |
| 1950 | topsecex_yscroll = memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w); | |
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 |
| r2418 | r2419 | |
|---|---|---|
| 419 | 419 | AM_RANGE(0x02000, 0x02fff) AM_MIRROR(0x1000) AM_RAM |
| 420 | 420 | AM_RANGE(0x04000, 0x04fff) AM_MIRROR(0x1000) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 421 | 421 | AM_RANGE(0x06000, 0x06fff) AM_READWRITE(tx1_crtc_r, tx1_crtc_w) |
| 422 | AM_RANGE(0x08000, 0x09fff) AM_R | |
| 422 | AM_RANGE(0x08000, 0x09fff) AM_R | |
| 423 | 423 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&tx1_rcram) |
| 424 | 424 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE(dipswitches_r, z80_busreq_w) |
| 425 | 425 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(tx1_scolst_w) |
| r2418 | r2419 | |
| 488 | 488 | static ADDRESS_MAP_START( buggyboy_main, ADDRESS_SPACE_PROGRAM, 16 ) |
| 489 | 489 | AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 490 | 490 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(tx1_crtc_r, tx1_crtc_w) |
| 491 | AM_RANGE(0x08000, 0x09fff) AM_R | |
| 491 | AM_RANGE(0x08000, 0x09fff) AM_R | |
| 492 | 492 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&buggyboy_rcram) AM_SIZE(&buggyboy_rcram_size) |
| 493 | 493 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE(dipswitches_r, z80_busreq_w) |
| 494 | 494 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w) |
| r2418 | r2419 | |
|---|---|---|
| 303 | 303 | static DRIVER_INIT(topshoot) |
| 304 | 304 | { |
| 305 | 305 | /* hack -- fix vdp emulation instead */ |
| 306 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r); | |
| 306 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r); | |
| 307 | 307 | |
| 308 | 308 | memory_set_bankptr(3, memory_region(REGION_CPU1) ); |
| 309 | 309 | memory_set_bankptr(4, genesis_68k_ram ); |
| r2418 | r2419 | |
|---|---|---|
| 183 | 183 | AM_RANGE(0xa002, 0xa002) AM_NOP //dips ? |
| 184 | 184 | // AM_RANGE(0xc000, 0xc002) AM_NOP |
| 185 | 185 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 186 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 187 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 186 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 187 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 188 | 188 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 189 | 189 | ADDRESS_MAP_END |
| 190 | 190 | |
| r2418 | r2419 | |
| 194 | 194 | AM_RANGE(0xc004, 0xc007) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 195 | 195 | AM_RANGE(0xc008, 0xc00b) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 196 | 196 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 197 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 198 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 197 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 198 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 199 | 199 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| r2418 | r2419 | |
| 209 | 209 | AM_RANGE(0xa000, 0xa003) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 210 | 210 | AM_RANGE(0xc000, 0xc003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w) |
| 211 | 211 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 212 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 213 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 212 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 213 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 214 | 214 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 215 | 215 | ADDRESS_MAP_END |
| 216 | 216 | |
| r2418 | r2419 | |
| 229 | 229 | AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w) |
| 230 | 230 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 231 | 231 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 232 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 233 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 232 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 233 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 234 | 234 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 235 | 235 | ADDRESS_MAP_END |
| 236 | 236 | |
| r2418 | r2419 | |
| 249 | 249 | AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w) |
| 250 | 250 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 251 | 251 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 252 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 253 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 252 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 253 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 254 | 254 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 255 | 255 | ADDRESS_MAP_END |
| 256 | 256 | |
| r2418 | r2419 | |
| 269 | 269 | AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w) |
| 270 | 270 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 271 | 271 | AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt |
| 272 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 273 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_RAM, phrcraze_bg_w) AM_BASE(&videoram) | |
| 272 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr) | |
| 273 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram) | |
| 274 | 274 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram) |
| 275 | 275 | ADDRESS_MAP_END |
| 276 | 276 |
| r2418 | r2419 | |
|---|---|---|
| 846 | 846 | free(tmp); |
| 847 | 847 | |
| 848 | 848 | /* Save time waiting on vblank bit */ |
| 849 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip); | |
| 849 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip); | |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | static DRIVER_INIT( thndzone ) |
| r2418 | r2419 | |
| 866 | 866 | free(tmp); |
| 867 | 867 | |
| 868 | 868 | /* Save time waiting on vblank bit */ |
| 869 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip); | |
| 869 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip); | |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | /**********************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 113 | 113 | AM_RANGE(0x5400, 0x57ff) AM_RAM |
| 114 | 114 | AM_RANGE(0x6000, 0x6007) AM_WRITENOP /* solenoid writes */ |
| 115 | 115 | AM_RANGE(0x7000, 0x7000) AM_READ(input_port_4_r) |
| 116 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(pingpong_colorram_w) AM_BASE(&colorram) | |
| 117 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(pingpong_videoram_w) AM_BASE(&videoram) | |
| 116 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE(&colorram) | |
| 117 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE(&videoram) | |
| 118 | 118 | AM_RANGE(0x9000, 0x9002) AM_RAM |
| 119 | 119 | AM_RANGE(0x9003, 0x9052) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 120 | 120 | AM_RANGE(0x9053, 0x97ff) AM_RAM |
| r2418 | r2419 | |
| 593 | 593 | ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7); |
| 594 | 594 | |
| 595 | 595 | /* questions banking handlers */ |
| 596 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, cashquiz_question_bank_high_w); | |
| 597 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4001, 0x4001, 0, 0, cashquiz_question_bank_low_w); | |
| 596 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, cashquiz_question_bank_high_w); | |
| 597 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4001, 0x4001, 0, 0, cashquiz_question_bank_low_w); | |
| 598 | 598 | |
| 599 | 599 | // 8 independents banks for questions |
| 600 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x50ff, 0, 0, SMH_BANK1); | |
| 601 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5100, 0x51ff, 0, 0, SMH_BANK2); | |
| 602 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5200, 0x52ff, 0, 0, SMH_BANK3); | |
| 603 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x53ff, 0, 0, SMH_BANK4); | |
| 604 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5400, 0x54ff, 0, 0, SMH_BANK5); | |
| 605 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5500, 0x55ff, 0, 0, SMH_BANK6); | |
| 606 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5600, 0x56ff, 0, 0, SMH_BANK7); | |
| 607 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5700, 0x57ff, 0, 0, SMH_BANK8); | |
| 600 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x50ff, 0, 0, SMH_BANK1); | |
| 601 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5100, 0x51ff, 0, 0, SMH_BANK2); | |
| 602 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5200, 0x52ff, 0, 0, SMH_BANK3); | |
| 603 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x53ff, 0, 0, SMH_BANK4); | |
| 604 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5400, 0x54ff, 0, 0, SMH_BANK5); | |
| 605 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5500, 0x55ff, 0, 0, SMH_BANK6); | |
| 606 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5600, 0x56ff, 0, 0, SMH_BANK7); | |
| 607 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5700, 0x57ff, 0, 0, SMH_BANK8); | |
| 608 | 608 | |
| 609 | 609 | // setup default banks |
| 610 | 610 | for(i = 0; i < 8; i++) |
| r2418 | r2419 | |
|---|---|---|
| 102 | 102 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ(input_port_0_word_r) |
| 103 | 103 | AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ(input_port_1_word_r) |
| 104 | 104 | AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r) |
| 105 | AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_R | |
| 105 | AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_R | |
| 106 | 106 | AM_RANGE(0xffb000, 0xffb3ff) AM_MIRROR(0x7f8c00) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 107 | AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 108 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 107 | AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 108 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 109 | 109 | AM_RANGE(0xffe000, 0xffffff) AM_MIRROR(0x7f8000) AM_RAM |
| 110 | 110 | ADDRESS_MAP_END |
| 111 | 111 |
| r2418 | r2419 | |
|---|---|---|
| 178 | 178 | |
| 179 | 179 | static ADDRESS_MAP_START( apache3_v30_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 180 | 180 | AM_RANGE(0x00000, 0x07fff) AM_RAM |
| 181 | AM_RANGE(0x08000, 0x08fff) AM_READWRITE(SMH_RAM, apache3_palette_w) AM_BASE(&paletteram16) | |
| 182 | AM_RANGE(0x0c000, 0x0dfff) AM_READWRITE(SMH_RAM, roundup5_text_w) AM_BASE(&videoram16) | |
| 181 | AM_RANGE(0x08000, 0x08fff) AM_RAM_WRITE(apache3_palette_w) AM_BASE(&paletteram16) | |
| 182 | AM_RANGE(0x0c000, 0x0dfff) AM_RAM_WRITE(roundup5_text_w) AM_BASE(&videoram16) | |
| 183 | 183 | AM_RANGE(0x0e800, 0x0e803) AM_WRITE(SMH_NOP) // CRT |
| 184 | 184 | AM_RANGE(0x0f000, 0x0f001) AM_READ(input_port_3_word_r) // Dip 1+2 |
| 185 | 185 | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(SMH_NOP) // todo |
| r2418 | r2419 | |
| 221 | 221 | |
| 222 | 222 | static ADDRESS_MAP_START( roundup5_v30_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 223 | 223 | AM_RANGE(0x00000, 0x07fff) AM_RAM |
| 224 | AM_RANGE(0x08000, 0x0bfff) AM_R | |
| 224 | AM_RANGE(0x08000, 0x0bfff) AM_R | |
| 225 | 225 | AM_RANGE(0x0c000, 0x0c003) AM_WRITE(roundup5_crt_w) |
| 226 | 226 | AM_RANGE(0x0d000, 0x0d001) AM_READ(input_port_3_word_r) /* Dip 1+2 */ |
| 227 | 227 | AM_RANGE(0x0d400, 0x0d40f) AM_WRITE(SMH_RAM) AM_BASE(&roundup5_unknown0) |
| 228 | 228 | AM_RANGE(0x0d800, 0x0d801) AM_WRITE(SMH_RAM) AM_BASE(&roundup5_unknown1) // VRAM2 X scroll (todo) |
| 229 | 229 | AM_RANGE(0x0dc00, 0x0dc01) AM_WRITE(SMH_RAM) AM_BASE(&roundup5_unknown2) // VRAM2 Y scroll (todo) |
| 230 | 230 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(roundup5_control_w) |
| 231 | AM_RANGE(0x0f000, 0x0ffff) AM_R | |
| 231 | AM_RANGE(0x0f000, 0x0ffff) AM_R | |
| 232 | 232 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(roundup_v30_z80_r, roundup_v30_z80_w) |
| 233 | 233 | AM_RANGE(0x20000, 0x2ffff) AM_READWRITE(tatsumi_v30_68000_r, tatsumi_v30_68000_w) |
| 234 | 234 | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(roundup5_vram_r, roundup5_vram_w) |
| r2418 | r2419 | |
|---|---|---|
| 131 | 131 | AM_RANGE(0x7fff, 0x7fff) AM_WRITE(coincounter_w) |
| 132 | 132 | AM_RANGE(0x7b00, 0x7bff) AM_ROM /* space for diagnostic ROM? The code looks */ |
| 133 | 133 | /* for a string here, and jumps if it's present */ |
| 134 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 134 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 135 | 135 | AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE(1) AM_BASE(&retofinv_sharedram) |
| 136 | AM_RANGE(0xa000, 0xa7ff) AM_R | |
| 136 | AM_RANGE(0xa000, 0xa7ff) AM_R | |
| 137 | 137 | AM_RANGE(0xb800, 0xb802) AM_WRITE(retofinv_gfx_ctrl_w) |
| 138 | 138 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_1_r) |
| 139 | 139 | AM_RANGE(0xc001, 0xc001) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
| 158 | 158 | |
| 159 | 159 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 160 | 160 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 161 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 161 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 162 | 162 | AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE(1) |
| 163 | AM_RANGE(0xa000, 0xa7ff) AM_R | |
| 163 | AM_RANGE(0xa000, 0xa7ff) AM_R | |
| 164 | 164 | AM_RANGE(0xc804, 0xc804) AM_WRITE(irq1_ack_w) |
| 165 | 165 | ADDRESS_MAP_END |
| 166 | 166 |
| r2418 | r2419 | |
|---|---|---|
| 995 | 995 | megplay_stat(); |
| 996 | 996 | |
| 997 | 997 | /* for now ... */ |
| 998 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r); | |
| 999 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_w); | |
| 998 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r, OLD_megaplay_genesis_io_w); | |
| 1000 | 999 | |
| 1001 | 1000 | /* megaplay has ram shared with the bios cpu here */ |
| 1002 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7); | |
| 1003 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7); | |
| 1001 | memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7, SMH_BANK7); | |
| 1004 | 1002 | memory_set_bankptr(7, &ic36_ram[0]); |
| 1005 | 1003 | |
| 1006 | 1004 | /* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */ |
| 1007 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram); | |
| 1008 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_write_z80_extra_ram); | |
| 1005 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram, megadriv_68k_write_z80_extra_ram); | |
| 1009 | 1006 | } |
| 1010 | 1007 | |
| 1011 | 1008 | /* |
| r2418 | r2419 | |
|---|---|---|
| 353 | 353 | AM_RANGE(0x0d00, 0x0d0f) AM_WRITE(meadows_spriteram_w) AM_BASE(&spriteram) |
| 354 | 354 | AM_RANGE(0x0e00, 0x0eff) AM_RAM |
| 355 | 355 | AM_RANGE(0x1000, 0x1bff) AM_ROM |
| 356 | AM_RANGE(0x1c00, 0x1fff) AM_R | |
| 356 | AM_RANGE(0x1c00, 0x1fff) AM_R | |
| 357 | 357 | ADDRESS_MAP_END |
| 358 | 358 | |
| 359 | 359 | |
| 360 | 360 | static ADDRESS_MAP_START( minferno_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 361 | 361 | AM_RANGE(0x0000, 0x0bff) AM_ROM |
| 362 | AM_RANGE(0x1c00, 0x1eff) AM_R | |
| 362 | AM_RANGE(0x1c00, 0x1eff) AM_R | |
| 363 | 363 | AM_RANGE(0x1f00, 0x1f00) AM_READ(input_port_0_r) |
| 364 | 364 | AM_RANGE(0x1f01, 0x1f01) AM_READ(input_port_1_r) |
| 365 | 365 | AM_RANGE(0x1f02, 0x1f02) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | static ADDRESS_MAP_START( bogeyman_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 71 | 71 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 72 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(bogeyman_videoram2_w) AM_BASE(&bogeyman_videoram2) | |
| 73 | AM_RANGE(0x1c00, 0x1fff) AM_RAM AM_WRITE(bogeyman_colorram2_w) AM_BASE(&bogeyman_colorram2) | |
| 74 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_WRITE(bogeyman_videoram_w) AM_BASE(&videoram) | |
| 75 | AM_RANGE(0x2100, 0x21ff) AM_RAM AM_WRITE(bogeyman_colorram_w) AM_BASE(&colorram) | |
| 72 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(bogeyman_videoram2_w) AM_BASE(&bogeyman_videoram2) | |
| 73 | AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(bogeyman_colorram2_w) AM_BASE(&bogeyman_colorram2) | |
| 74 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(bogeyman_videoram_w) AM_BASE(&videoram) | |
| 75 | AM_RANGE(0x2100, 0x21ff) AM_RAM_WRITE(bogeyman_colorram_w) AM_BASE(&colorram) | |
| 76 | 76 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 77 | AM_RANGE(0x3000, 0x300f) AM_RAM | |
| 77 | AM_RANGE(0x3000, 0x300f) AM_RAM | |
| 78 | 78 | AM_RANGE(0x3800, 0x3800) AM_READWRITE(input_port_0_r, bogeyman_8910_control_w) |
| 79 | 79 | AM_RANGE(0x3801, 0x3801) AM_READWRITE(input_port_1_r, bogeyman_8910_latch_w) |
| 80 | 80 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
|---|---|---|
| 3372 | 3372 | /* install handlers for the compact driving games' inputs */ |
| 3373 | 3373 | if (compact_inputs) |
| 3374 | 3374 | { |
| 3375 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, hdc68k_wheel_r); | |
| 3376 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x408000, 0x408001, 0, 0, hdc68k_wheel_edge_reset_w); | |
| 3377 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hdc68k_port1_r); | |
| 3375 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, hdc68k_wheel_r); | |
| 3376 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x408000, 0x408001, 0, 0, hdc68k_wheel_edge_reset_w); | |
| 3377 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hdc68k_port1_r); | |
| 3378 | 3378 | } |
| 3379 | 3379 | } |
| 3380 | 3380 | |
| 3381 | 3381 | |
| 3382 | 3382 | /* COMMON INIT: initialize the ADSP/ADSP2 board */ |
| 3383 | static void init_adsp( | |
| 3383 | static void init_adsp(running_machine *machine) | |
| 3384 | 3384 | { |
| 3385 | 3385 | /* install ADSP program RAM */ |
| 3386 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_r); | |
| 3387 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_w); | |
| 3386 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_r, hd68k_adsp_program_w); | |
| 3388 | 3387 | |
| 3389 | 3388 | /* install ADSP data RAM */ |
| 3390 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r); | |
| 3391 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_w); | |
| 3389 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r, hd68k_adsp_data_w); | |
| 3392 | 3390 | |
| 3393 | 3391 | /* install ADSP serial buffer RAM */ |
| 3394 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_r); | |
| 3395 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_w); | |
| 3392 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_r, hd68k_adsp_buffer_w); | |
| 3396 | 3393 | |
| 3397 | 3394 | /* install ADSP control locations */ |
| 3398 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818000, 0x81801f, 0, 0, hd68k_adsp_control_w); | |
| 3399 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818060, 0x81807f, 0, 0, hd68k_adsp_irq_clear_w); | |
| 3400 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x838000, 0x83ffff, 0, 0, hd68k_adsp_irq_state_r); | |
| 3395 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818000, 0x81801f, 0, 0, hd68k_adsp_control_w); | |
| 3396 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818060, 0x81807f, 0, 0, hd68k_adsp_irq_clear_w); | |
| 3397 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x838000, 0x83ffff, 0, 0, hd68k_adsp_irq_state_r); | |
| 3401 | 3398 | } |
| 3402 | 3399 | |
| 3403 | 3400 | |
| r2418 | r2419 | |
| 3405 | 3402 | static void init_ds3(running_machine *machine) |
| 3406 | 3403 | { |
| 3407 | 3404 | /* install ADSP program RAM */ |
| 3408 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_r); | |
| 3409 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_w); | |
| 3405 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_r, hd68k_ds3_program_w); | |
| 3410 | 3406 | |
| 3411 | 3407 | /* install ADSP data RAM */ |
| 3412 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r); | |
| 3413 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_w); | |
| 3414 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_r); | |
| 3415 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_w); | |
| 3408 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r, hd68k_adsp_data_w); | |
| 3409 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_r, hdds3_special_w); | |
| 3416 | 3410 | |
| 3417 | 3411 | /* install ADSP control locations */ |
| 3418 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_r); | |
| 3419 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820800, 0x820fff, 0, 0, hd68k_ds3_girq_state_r); | |
| 3420 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_w); | |
| 3421 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x821000, 0x8217ff, 0, 0, hd68k_adsp_irq_clear_w); | |
| 3422 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_r); | |
| 3423 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822800, 0x822fff, 0, 0, hd68k_ds3_sirq_state_r); | |
| 3424 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_w); | |
| 3425 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w); | |
| 3412 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_r); | |
| 3413 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820800, 0x820fff, 0, 0, hd68k_ds3_girq_state_r); | |
| 3414 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_w); | |
| 3415 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x821000, 0x8217ff, 0, 0, hd68k_adsp_irq_clear_w); | |
| 3416 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_r); | |
| 3417 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822800, 0x822fff, 0, 0, hd68k_ds3_sirq_state_r); | |
| 3418 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_w); | |
| 3419 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w); | |
| 3426 | 3420 | |
| 3427 | 3421 | /* if we have a sound DSP, boot it */ |
| 3428 | 3422 | if (hdcpu_sound != -1 && machine->config->cpu[hdcpu_sound].type == CPU_ADSP2105) |
| r2418 | r2419 | |
| 3502 | 3496 | |
| 3503 | 3497 | |
| 3504 | 3498 | /* COMMON INIT: initialize the DSK add-on board */ |
| 3505 | static void init_dsk( | |
| 3499 | static void init_dsk(running_machine *machine) | |
| 3506 | 3500 | { |
| 3507 | 3501 | /* install ASIC61 */ |
| 3508 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_w); | |
| 3509 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_r); | |
| 3502 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_r, hd68k_dsk_dsp32_w); | |
| 3510 | 3503 | |
| 3511 | 3504 | /* install control registers */ |
| 3512 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c800, 0x85c81f, 0, 0, hd68k_dsk_control_w); | |
| 3505 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c800, 0x85c81f, 0, 0, hd68k_dsk_control_w); | |
| 3513 | 3506 | |
| 3514 | 3507 | /* install extra RAM */ |
| 3515 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_r); | |
| 3516 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_w); | |
| 3508 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_r, hd68k_dsk_ram_w); | |
| 3517 | 3509 | hddsk_ram = (UINT16 *)(memory_region(REGION_USER3) + 0x40000); |
| 3518 | 3510 | |
| 3519 | 3511 | /* install extra ZRAM */ |
| 3520 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_r); | |
| 3521 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_w); | |
| 3512 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_r, hd68k_dsk_zram_w); | |
| 3522 | 3513 | hddsk_zram = (UINT16 *)(memory_region(REGION_USER3) + 0x50000); |
| 3523 | 3514 | |
| 3524 | 3515 | /* install ASIC65 */ |
| 3525 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_data_w); | |
| 3526 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_r); | |
| 3527 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x918000, 0x91bfff, 0, 0, asic65_io_r); | |
| 3516 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_data_w); | |
| 3517 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_r); | |
| 3518 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x918000, 0x91bfff, 0, 0, asic65_io_r); | |
| 3528 | 3519 | |
| 3529 | 3520 | /* install extra ROM */ |
| 3530 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x940000, 0x9fffff, 0, 0, hd68k_dsk_small_rom_r); | |
| 3521 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x940000, 0x9fffff, 0, 0, hd68k_dsk_small_rom_r); | |
| 3531 | 3522 | hddsk_rom = (UINT16 *)(memory_region(REGION_USER3) + 0x00000); |
| 3532 | 3523 | |
| 3533 | 3524 | /* set up the ASIC65 */ |
| r2418 | r2419 | |
| 3536 | 3527 | |
| 3537 | 3528 | |
| 3538 | 3529 | /* COMMON INIT: initialize the DSK II add-on board */ |
| 3539 | static void init_dsk2( | |
| 3530 | static void init_dsk2(running_machine *machine) | |
| 3540 | 3531 | { |
| 3541 | 3532 | /* install ASIC65 */ |
| 3542 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_data_w); | |
| 3543 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_r); | |
| 3544 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x825000, 0x825001, 0, 0, asic65_io_r); | |
| 3533 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_data_w); | |
| 3534 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_r); | |
| 3535 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x825000, 0x825001, 0, 0, asic65_io_r); | |
| 3545 | 3536 | |
| 3546 | 3537 | /* install ASIC61 */ |
| 3547 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_w); | |
| 3548 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_r); | |
| 3538 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_r, hd68k_dsk_dsp32_w); | |
| 3549 | 3539 | |
| 3550 | 3540 | /* install control registers */ |
| 3551 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827800, 0x82781f, 0, 0, hd68k_dsk_control_w); | |
| 3541 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827800, 0x82781f, 0, 0, hd68k_dsk_control_w); | |
| 3552 | 3542 | |
| 3553 | 3543 | /* install extra RAM */ |
| 3554 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_r); | |
| 3555 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_w); | |
| 3544 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_r, hd68k_dsk_ram_w); | |
| 3556 | 3545 | hddsk_ram = (UINT16 *)(memory_region(REGION_USER3) + 0x100000); |
| 3557 | 3546 | |
| 3558 | 3547 | /* install extra ROM */ |
| 3559 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x9fffff, 0, 0, hd68k_dsk_rom_r); | |
| 3548 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x9fffff, 0, 0, hd68k_dsk_rom_r); | |
| 3560 | 3549 | hddsk_rom = (UINT16 *)(memory_region(REGION_USER3) + 0x000000); |
| 3561 | 3550 | |
| 3562 | 3551 | /* set up the ASIC65 */ |
| r2418 | r2419 | |
| 3565 | 3554 | |
| 3566 | 3555 | |
| 3567 | 3556 | /* COMMON INIT: initialize the DSPCOM add-on board */ |
| 3568 | static void init_dspcom( | |
| 3557 | static void init_dspcom(running_machine *machine) | |
| 3569 | 3558 | { |
| 3570 | 3559 | /* install ASIC65 */ |
| 3571 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_data_w); | |
| 3572 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_r); | |
| 3573 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x901000, 0x910001, 0, 0, asic65_io_r); | |
| 3560 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_data_w); | |
| 3561 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_r); | |
| 3562 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x901000, 0x910001, 0, 0, asic65_io_r); | |
| 3574 | 3563 | |
| 3575 | 3564 | /* set up the ASIC65 */ |
| 3576 | 3565 | asic65_config(ASIC65_STEELTAL); |
| 3577 | 3566 | |
| 3578 | 3567 | /* install DSPCOM control */ |
| 3579 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x904000, 0x90401f, 0, 0, hddspcom_control_w); | |
| 3568 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x904000, 0x90401f, 0, 0, hddspcom_control_w); | |
| 3580 | 3569 | } |
| 3581 | 3570 | |
| 3582 | 3571 | |
| 3583 | 3572 | /* COMMON INIT: initialize the original "driver" sound board */ |
| 3584 | static void init_driver_sound( | |
| 3573 | static void init_driver_sound(running_machine *machine) | |
| 3585 | 3574 | { |
| 3586 | 3575 | hdsnd_init(); |
| 3587 | 3576 | |
| 3588 | 3577 | /* install sound handlers */ |
| 3589 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_w); | |
| 3590 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_r); | |
| 3591 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x844000, 0x844001, 0, 0, hd68k_snd_status_r); | |
| 3592 | memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x84c000, 0x84c001, 0, 0, hd68k_snd_reset_w); | |
| 3578 | memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_r, hd68k_snd_data_w); | |
| 3579 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x844000, 0x844001, 0, 0, hd68k_snd_status_r); | |
| 3580 | memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x84c000, 0x84c001, 0, 0, hd68k_snd_reset_w); | |
| 3593 | 3581 | } |
| 3594 | 3582 | |
| 3595 | 3583 | |
| r2418 | r2419 | |
| 3605 | 3593 | { |
| 3606 | 3594 | /* initialize the boards */ |
| 3607 | 3595 | init_driver(machine); |
| 3608 | init_adsp(); | |
| 3609 | init_driver_sound(); | |
| 3596 | init_adsp(machine); | |
| 3597 | init_driver_sound(machine); | |
| 3610 | 3598 | |
| 3611 | 3599 | /* set up gsp speedup handler */ |
| 3612 | hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3613 | hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3614 | memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3600 | hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3601 | hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3602 | memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3615 | 3603 | hdgsp_speedup_pc = 0xffc00f10; |
| 3616 | 3604 | |
| 3617 | 3605 | /* set up msp speedup handler */ |
| 3618 | hdmsp_speedup_addr = memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w); | |
| 3619 | memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r); | |
| 3606 | hdmsp_speedup_addr = memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w); | |
| 3607 | memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r); | |
| 3620 | 3608 | hdmsp_speedup_pc = 0x00723b00; |
| 3621 | 3609 | |
| 3622 | 3610 | /* set up adsp speedup handlers */ |
| 3623 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3611 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3624 | 3612 | } |
| 3625 | 3613 | |
| 3626 | 3614 | |
| r2418 | r2419 | |
| 3628 | 3616 | { |
| 3629 | 3617 | /* initialize the boards */ |
| 3630 | 3618 | init_multisync(machine, 1); |
| 3631 | init_adsp(); | |
| 3632 | init_driver_sound(); | |
| 3619 | init_adsp(machine); | |
| 3620 | init_driver_sound(machine); | |
| 3633 | 3621 | |
| 3634 | 3622 | /* set up gsp speedup handler */ |
| 3635 | hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3636 | hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3637 | memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3623 | hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3624 | hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3625 | memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3638 | 3626 | hdgsp_speedup_pc = 0xfff40ff0; |
| 3639 | 3627 | |
| 3640 | 3628 | /* set up msp speedup handler */ |
| 3641 | hdmsp_speedup_addr = memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w); | |
| 3642 | memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r); | |
| 3629 | hdmsp_speedup_addr = memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w); | |
| 3630 | memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r); | |
| 3643 | 3631 | hdmsp_speedup_pc = 0x00723b00; |
| 3644 | 3632 | |
| 3645 | 3633 | /* set up adsp speedup handlers */ |
| 3646 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3634 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3647 | 3635 | } |
| 3648 | 3636 | |
| 3649 | 3637 | |
| r2418 | r2419 | |
| 3651 | 3639 | { |
| 3652 | 3640 | /* initialize the boards */ |
| 3653 | 3641 | init_multisync(machine, 0); |
| 3654 | init_adsp(); | |
| 3642 | init_adsp(machine); | |
| 3655 | 3643 | atarijsa_init(machine, 0, 0x0020); |
| 3656 | 3644 | |
| 3657 | 3645 | /* set up gsp speedup handler */ |
| 3658 | hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3659 | hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3660 | memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3646 | hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w); | |
| 3647 | hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w); | |
| 3648 | memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r); | |
| 3661 | 3649 | hdgsp_speedup_pc = 0xfff41070; |
| 3662 | 3650 | |
| 3663 | 3651 | /* set up adsp speedup handlers */ |
| 3664 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3652 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3665 | 3653 | } |
| 3666 | 3654 | |
| 3667 | 3655 | |
| r2418 | r2419 | |
| 3692 | 3680 | { |
| 3693 | 3681 | /* initialize the boards */ |
| 3694 | 3682 | init_driver(machine); |
| 3695 | init_adsp(); | |
| 3696 | init_dsk(); | |
| 3697 | init_driver_sound(); | |
| 3683 | init_adsp(machine); | |
| 3684 | init_dsk(machine); | |
| 3685 | init_driver_sound(machine); | |
| 3698 | 3686 | |
| 3699 | 3687 | /* set up the slapstic */ |
| 3700 | 3688 | slapstic_init(117); |
| 3701 | hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r); | |
| 3702 | hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w); | |
| 3689 | hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w); | |
| 3703 | 3690 | |
| 3704 | 3691 | /* synchronization */ |
| 3705 | rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3706 | rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3692 | rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3693 | rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3707 | 3694 | |
| 3708 | 3695 | /* set up adsp speedup handlers */ |
| 3709 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3696 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3710 | 3697 | |
| 3711 | 3698 | /* set up dsp32 speedup handlers */ |
| 3712 | rddsp32_speedup = memory_install_read32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r); | |
| 3699 | rddsp32_speedup = memory_install_read32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r); | |
| 3713 | 3700 | rddsp32_speedup_pc = 0x6054b0; |
| 3714 | 3701 | } |
| 3715 | 3702 | |
| r2418 | r2419 | |
| 3718 | 3705 | { |
| 3719 | 3706 | /* initialize the boards */ |
| 3720 | 3707 | init_multisync(machine, 1); |
| 3721 | init_adsp(); | |
| 3722 | init_dsk(); | |
| 3723 | init_driver_sound(); | |
| 3708 | init_adsp(machine); | |
| 3709 | init_dsk(machine); | |
| 3710 | init_driver_sound(machine); | |
| 3724 | 3711 | |
| 3725 | 3712 | /* set up the slapstic */ |
| 3726 | 3713 | slapstic_init(117); |
| 3727 | hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r); | |
| 3728 | hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w); | |
| 3714 | hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w); | |
| 3729 | 3715 | |
| 3730 | 3716 | /* synchronization */ |
| 3731 | rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3732 | rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3717 | rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3718 | rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3733 | 3719 | |
| 3734 | 3720 | /* set up protection hacks */ |
| 3735 | hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, TOBYTE(gsp_protection), TOBYTE(gsp_protection + 0x0f), 0, 0, hdgsp_protection_w); | |
| 3721 | hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, TOBYTE(gsp_protection), TOBYTE(gsp_protection + 0x0f), 0, 0, hdgsp_protection_w); | |
| 3736 | 3722 | |
| 3737 | 3723 | /* set up gsp speedup handler */ |
| 3738 | hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_w); | |
| 3739 | memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_r); | |
| 3724 | hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_w); | |
| 3725 | memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_r); | |
| 3740 | 3726 | hdgsp_speedup_pc = 0xfff43a00; |
| 3741 | 3727 | |
| 3742 | 3728 | /* set up adsp speedup handlers */ |
| 3743 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3729 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3744 | 3730 | |
| 3745 | 3731 | /* set up dsp32 speedup handlers */ |
| 3746 | rddsp32_speedup = memory_install_read32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r); | |
| 3732 | rddsp32_speedup = memory_install_read32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r); | |
| 3747 | 3733 | rddsp32_speedup_pc = 0x6054b0; |
| 3748 | 3734 | } |
| 3749 | 3735 | |
| r2418 | r2419 | |
| 3763 | 3749 | /* initialize the boards */ |
| 3764 | 3750 | init_multisync(machine, 0); |
| 3765 | 3751 | init_ds3(machine); |
| 3766 | init_dspcom(); | |
| 3752 | init_dspcom(machine); | |
| 3767 | 3753 | atarijsa3_init_adpcm(REGION_SOUND1); |
| 3768 | 3754 | atarijsa_init(machine, 0, 0x0020); |
| 3769 | 3755 | |
| 3770 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x908000, 0x908001, 0, 0, steeltal_dummy_r); | |
| 3756 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x908000, 0x908001, 0, 0, steeltal_dummy_r); | |
| 3771 | 3757 | |
| 3772 | 3758 | /* set up the SLOOP */ |
| 3773 | 3759 | if (!proto_sloop) |
| 3774 | 3760 | { |
| 3775 | hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_r); | |
| 3776 | hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_w); | |
| 3777 | st68k_sloop_alt_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x4e000, 0x4ffff, 0, 0, st68k_sloop_alt_r); | |
| 3761 | hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_r, st68k_sloop_w); | |
| 3762 | st68k_sloop_alt_base = memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x4e000, 0x4ffff, 0, 0, st68k_sloop_alt_r); | |
| 3778 | 3763 | } |
| 3779 | 3764 | else |
| 3780 | { | |
| 3781 | hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_r); | |
| 3782 | hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_w); | |
| 3783 | } | |
| 3765 | hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_r, st68k_protosloop_w); | |
| 3784 | 3766 | |
| 3785 | 3767 | /* synchronization */ |
| 3786 | 3768 | stmsp_sync[0] = &hdmsp_ram[TOWORD(0x80010)]; |
| 3787 | memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80010, 0x8007f, 0, 0, stmsp_sync0_w); | |
| 3769 | memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80010, 0x8007f, 0, 0, stmsp_sync0_w); | |
| 3788 | 3770 | stmsp_sync[1] = &hdmsp_ram[TOWORD(0x99680)]; |
| 3789 | memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99680, 0x9968f, 0, 0, stmsp_sync1_w); | |
| 3771 | memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99680, 0x9968f, 0, 0, stmsp_sync1_w); | |
| 3790 | 3772 | stmsp_sync[2] = &hdmsp_ram[TOWORD(0x99d30)]; |
| 3791 | memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99d30, 0x99d50, 0, 0, stmsp_sync2_w); | |
| 3773 | memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99d30, 0x99d50, 0, 0, stmsp_sync2_w); | |
| 3792 | 3774 | |
| 3793 | 3775 | /* set up protection hacks */ |
| 3794 | hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff965d0, 0xfff965df, 0, 0, hdgsp_protection_w); | |
| 3776 | hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff965d0, 0xfff965df, 0, 0, hdgsp_protection_w); | |
| 3795 | 3777 | |
| 3796 | 3778 | /* set up msp speedup handlers */ |
| 3797 | memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80020, 0x8002f, 0, 0, stmsp_speedup_r); | |
| 3779 | memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80020, 0x8002f, 0, 0, stmsp_speedup_r); | |
| 3798 | 3780 | |
| 3799 | 3781 | /* set up adsp speedup handlers */ |
| 3800 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3801 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3782 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3783 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3802 | 3784 | hdds3_speedup_addr = &hdadsp_data_memory[0x1f99]; |
| 3803 | 3785 | hdds3_speedup_pc = 0xff; |
| 3804 | 3786 | hdds3_transfer_pc = ds3_transfer_pc; |
| r2418 | r2419 | |
| 3815 | 3797 | /* initialize the boards */ |
| 3816 | 3798 | init_multisync(machine, 1); |
| 3817 | 3799 | init_ds3(machine); |
| 3818 | init_dsk(); | |
| 3800 | init_dsk(machine); | |
| 3819 | 3801 | |
| 3820 | 3802 | /* set up the slapstic */ |
| 3821 | 3803 | slapstic_init(117); |
| 3822 | hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r); | |
| 3823 | hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w); | |
| 3804 | hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w); | |
| 3824 | 3805 | |
| 3825 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3806 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3826 | 3807 | |
| 3827 | 3808 | /* synchronization */ |
| 3828 | rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3829 | rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3809 | rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w); | |
| 3810 | rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w); | |
| 3830 | 3811 | |
| 3831 | 3812 | /* set up protection hacks */ |
| 3832 | hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff960a0, 0xfff960af, 0, 0, hdgsp_protection_w); | |
| 3813 | hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff960a0, 0xfff960af, 0, 0, hdgsp_protection_w); | |
| 3833 | 3814 | |
| 3834 | 3815 | /* set up adsp speedup handlers */ |
| 3835 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3836 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3816 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3817 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3837 | 3818 | hdds3_speedup_addr = &hdadsp_data_memory[0x1f99]; |
| 3838 | 3819 | hdds3_speedup_pc = 0xff; |
| 3839 | 3820 | hdds3_transfer_pc = 0x43672; |
| r2418 | r2419 | |
| 3845 | 3826 | /* initialize the boards */ |
| 3846 | 3827 | init_multisync(machine, 1); |
| 3847 | 3828 | init_ds3(machine); |
| 3848 | init_dsk2(); | |
| 3829 | init_dsk2(machine); | |
| 3849 | 3830 | |
| 3850 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3831 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3851 | 3832 | |
| 3852 | 3833 | /* synchronization */ |
| 3853 | rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w); | |
| 3854 | rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w); | |
| 3834 | rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w); | |
| 3835 | rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w); | |
| 3855 | 3836 | |
| 3856 | 3837 | /* set up protection hacks */ |
| 3857 | hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff943f0, 0xfff943ff, 0, 0, hdgsp_protection_w); | |
| 3838 | hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff943f0, 0xfff943ff, 0, 0, hdgsp_protection_w); | |
| 3858 | 3839 | |
| 3859 | 3840 | /* set up adsp speedup handlers */ |
| 3860 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3861 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3841 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3842 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r); | |
| 3862 | 3843 | hdds3_speedup_addr = &hdadsp_data_memory[0x1f99]; |
| 3863 | 3844 | hdds3_speedup_pc = 0x2da; |
| 3864 | 3845 | hdds3_transfer_pc = 0x407b8; |
| r2418 | r2419 | |
| 3870 | 3851 | /* initialize the boards */ |
| 3871 | 3852 | init_multisync(machine, 1); |
| 3872 | 3853 | init_ds3(machine); |
| 3873 | init_dsk2(); | |
| 3854 | init_dsk2(machine); | |
| 3874 | 3855 | |
| 3875 | memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3856 | memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r); | |
| 3876 | 3857 | |
| 3877 | 3858 | /* synchronization */ |
| 3878 | rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w); | |
| 3879 | rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w); | |
| 3859 | rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w); | |
| 3860 | rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w); | |
| 3880 | 3861 | |
| 3881 | 3862 | /* set up protection hacks */ |
| 3882 | hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff916c0, 0xfff916cf, 0, 0, hdgsp_protection_w); | |
| 3863 | hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff916c0, 0xfff916cf, 0, 0, hdgsp_protection_w); | |
| 3883 | 3864 | |
| 3884 | 3865 | /* set up adsp speedup handlers */ |
| 3885 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3886 | memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f9a, 0x1f9a, 0, 0, hdds3_speedup_r); | |
| 3866 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r); | |
| 3867 | memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f9a, 0x1f9a, 0, 0, hdds3_speedup_r); | |
| 3887 | 3868 | hdds3_speedup_addr = &hdadsp_data_memory[0x1f9a]; |
| 3888 | 3869 | hdds3_speedup_pc = 0x2d9; |
| 3889 | 3870 | hdds3_transfer_pc = 0X407da; |
| r2418 | r2419 | |
|---|---|---|
| 475 | 475 | copy_le(&protection_ram[0x0fe0],protection_crc,CRC_LEN); |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | static void install_protection_handler(const UINT8 *code,const UINT8 *crc) | |
| 478 | static void install_protection_handler(running_machine *machine, const UINT8 *code,const UINT8 *crc) | |
| 479 | 479 | { |
| 480 | 480 | protection_ram = auto_malloc(0x1000); |
| 481 | 481 | protection_code = code; |
| 482 | 482 | protection_crc = crc; |
| 483 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, SMH_BANK1); | |
| 484 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0ffa, 0xb0ffb, 0, 0, protection_r); | |
| 485 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w); | |
| 483 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, SMH_BANK1); | |
| 484 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0ffa, 0xb0ffb, 0, 0, protection_r); | |
| 485 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w); | |
| 486 | 486 | memory_set_bankptr(1, protection_ram); |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | static DRIVER_INIT( bchopper ) |
| 490 | 490 | { |
| 491 | install_protection_handler(bchopper_code,bchopper_crc); | |
| 491 | install_protection_handler(machine, bchopper_code,bchopper_crc); | |
| 492 | 492 | |
| 493 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); | |
| 493 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | static DRIVER_INIT( mrheli ) |
| 497 | 497 | { |
| 498 | install_protection_handler(bchopper_code,mrheli_crc); | |
| 498 | install_protection_handler(machine, bchopper_code,mrheli_crc); | |
| 499 | 499 | |
| 500 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); | |
| 500 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | static DRIVER_INIT( nspirit ) |
| 504 | 504 | { |
| 505 | install_protection_handler(nspirit_code,nspirit_crc); | |
| 505 | install_protection_handler(machine, nspirit_code,nspirit_crc); | |
| 506 | 506 | |
| 507 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); | |
| 507 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); | |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | static DRIVER_INIT( nspiritj ) |
| 511 | 511 | { |
| 512 | install_protection_handler(nspirit_code,nspiritj_crc); | |
| 512 | install_protection_handler(machine, nspirit_code,nspiritj_crc); | |
| 513 | 513 | |
| 514 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); | |
| 514 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | static DRIVER_INIT( imgfight ) |
| 518 | 518 | { |
| 519 | install_protection_handler(imgfight_code,imgfight_crc); | |
| 519 | install_protection_handler(machine, imgfight_code,imgfight_crc); | |
| 520 | 520 | |
| 521 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, imgfight_sample_trigger_w); | |
| 521 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, imgfight_sample_trigger_w); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | static DRIVER_INIT( loht ) |
| 525 | 525 | { |
| 526 | install_protection_handler(loht_code,loht_crc); | |
| 526 | install_protection_handler(machine, loht_code,loht_crc); | |
| 527 | 527 | |
| 528 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w); | |
| 528 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w); | |
| 529 | 529 | |
| 530 | 530 | /* since we skip the startup tests, clear video RAM to prevent garbage on title screen */ |
| 531 | 531 | memset(m72_videoram2,0,0x4000); |
| r2418 | r2419 | |
| 546 | 546 | |
| 547 | 547 | protection_ram = auto_malloc(0x10000); |
| 548 | 548 | |
| 549 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_r); | |
| 550 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_w); | |
| 549 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_r, m72_main_mcu_w); | |
| 551 | 550 | |
| 552 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w); | |
| 551 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w); | |
| 553 | 552 | |
| 554 | 553 | } |
| 555 | 554 | |
| 556 | 555 | |
| 557 | 556 | static DRIVER_INIT( xmultipl ) |
| 558 | 557 | { |
| 559 | install_protection_handler(xmultipl_code,xmultipl_crc); | |
| 558 | install_protection_handler(machine, xmultipl_code,xmultipl_crc); | |
| 560 | 559 | |
| 561 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, xmultipl_sample_trigger_w); | |
| 560 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, xmultipl_sample_trigger_w); | |
| 562 | 561 | } |
| 563 | 562 | |
| 564 | 563 | static DRIVER_INIT( dbreed72 ) |
| 565 | 564 | { |
| 566 | install_protection_handler(dbreed72_code,dbreed72_crc); | |
| 565 | install_protection_handler(machine, dbreed72_code,dbreed72_crc); | |
| 567 | 566 | |
| 568 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dbreed72_sample_trigger_w); | |
| 567 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dbreed72_sample_trigger_w); | |
| 569 | 568 | } |
| 570 | 569 | |
| 571 | 570 | static DRIVER_INIT( airduel ) |
| 572 | 571 | { |
| 573 | install_protection_handler(airduel_code,airduel_crc); | |
| 572 | install_protection_handler(machine, airduel_code,airduel_crc); | |
| 574 | 573 | |
| 575 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, airduel_sample_trigger_w); | |
| 574 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, airduel_sample_trigger_w); | |
| 576 | 575 | } |
| 577 | 576 | |
| 578 | 577 | static DRIVER_INIT( dkgenm72 ) |
| 579 | 578 | { |
| 580 | install_protection_handler(dkgenm72_code,dkgenm72_crc); | |
| 579 | install_protection_handler(machine, dkgenm72_code,dkgenm72_crc); | |
| 581 | 580 | |
| 582 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dkgenm72_sample_trigger_w); | |
| 581 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dkgenm72_sample_trigger_w); | |
| 583 | 582 | } |
| 584 | 583 | |
| 585 | 584 | static DRIVER_INIT( gallop ) |
| 586 | 585 | { |
| 587 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, gallop_sample_trigger_w); | |
| 586 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, gallop_sample_trigger_w); | |
| 588 | 587 | } |
| 589 | 588 | |
| 590 | 589 | |
| r2418 | r2419 | |
| 645 | 644 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) \ |
| 646 | 645 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) \ |
| 647 | 646 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) \ |
| 648 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) \ | |
| 649 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) \ | |
| 647 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) \ | |
| 648 | AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) \ | |
| 650 | 649 | AM_RANGE(0xe0000, 0xeffff) AM_READWRITE(soundram_r, soundram_w) \ |
| 651 | 650 | AM_RANGE(0xffff0, 0xfffff) AM_ROM \ |
| 652 | 651 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 665 | 664 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 666 | 665 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 667 | 666 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 668 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 669 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 667 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 668 | AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 670 | 669 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 671 | 670 | ADDRESS_MAP_END |
| 672 | 671 | |
| r2418 | r2419 | |
| 676 | 675 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 677 | 676 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 678 | 677 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 679 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 680 | AM_RANGE(0xd4000, 0xd7fff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 678 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 679 | AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 681 | 680 | AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 682 | 681 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 683 | 682 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| r2418 | r2419 | |
| 687 | 686 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 688 | 687 | AM_RANGE(0xa0000, 0xa03ff) AM_RAM AM_BASE(&majtitle_rowscrollram) |
| 689 | 688 | AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 690 | AM_RANGE(0xac000, 0xaffff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 691 | AM_RANGE(0xb0000, 0xbffff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) /* larger than the other games */ | |
| 689 | AM_RANGE(0xac000, 0xaffff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 690 | AM_RANGE(0xb0000, 0xbffff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) /* larger than the other games */ | |
| 692 | 691 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 693 | 692 | AM_RANGE(0xc8000, 0xc83ff) AM_RAM AM_BASE(&spriteram16_2) |
| 694 | 693 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| r2418 | r2419 | |
| 706 | 705 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 707 | 706 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 708 | 707 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 709 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 710 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 708 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 709 | AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 711 | 710 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 712 | 711 | ADDRESS_MAP_END |
| 713 | 712 | |
| r2418 | r2419 | |
| 719 | 718 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 720 | 719 | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(SMH_RAM) /* leftover from protection?? */ |
| 721 | 720 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 722 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 723 | AM_RANGE(0xd4000, 0xd7fff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 721 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 722 | AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 724 | 723 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 725 | 724 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 726 | 725 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 733 | 732 | AM_RANGE(0xb4000, 0xb4001) AM_WRITE(SMH_NOP) /* ??? */ |
| 734 | 733 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 735 | 734 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 736 | AM_RANGE(0x80000, 0x83fff) AM_READWRITE(SMH_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 737 | AM_RANGE(0x84000, 0x87fff) AM_READWRITE(SMH_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 735 | AM_RANGE(0x80000, 0x83fff) AM_RAM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) | |
| 736 | AM_RANGE(0x84000, 0x87fff) AM_RAM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) | |
| 738 | 737 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 739 | 738 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 740 | 739 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 78 | 78 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&aeroboto_mainram) // main RAM |
| 79 | 79 | AM_RANGE(0x0800, 0x08ff) AM_RAM // tile color buffer; copied to 0x2000 |
| 80 | 80 | AM_RANGE(0x0900, 0x09ff) AM_WRITE(SMH_RAM) // a backup of default tile colors |
| 81 | AM_RANGE(0x1000, 0x17ff) AM_R | |
| 81 | AM_RANGE(0x1000, 0x17ff) AM_R | |
| 82 | 82 | AM_RANGE(0x1800, 0x183f) AM_RAM AM_BASE(&aeroboto_hscroll) // horizontal scroll regs |
| 83 | AM_RANGE(0x2000, 0x20ff) AM_R | |
| 83 | AM_RANGE(0x2000, 0x20ff) AM_R | |
| 84 | 84 | AM_RANGE(0x1840, 0x27ff) AM_WRITE(SMH_NOP) // cleared during custom LSI test |
| 85 | 85 | AM_RANGE(0x2800, 0x28ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) // sprite RAM |
| 86 | 86 | AM_RANGE(0x2900, 0x2fff) AM_WRITE(SMH_NOP) // cleared along with sprite RAM |
| r2418 | r2419 | |
|---|---|---|
| 546 | 546 | intelflash_init( 2, FLASH_FUJITSU_29F016A, NULL ); |
| 547 | 547 | intelflash_init( 3, FLASH_FUJITSU_29F016A, NULL ); |
| 548 | 548 | |
| 549 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_r ); | |
| 550 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_w ); | |
| 551 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r ); | |
| 552 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */ | |
| 549 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_r, flash_w ); | |
| 550 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r ); | |
| 551 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */ | |
| 553 | 552 | |
| 554 | 553 | DRIVER_INIT_CALL(konamigv); |
| 555 | 554 | } |
| r2418 | r2419 | |
| 634 | 633 | { |
| 635 | 634 | intelflash_init( 0, FLASH_SHARP_LH28F400, NULL ); |
| 636 | 635 | |
| 637 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_r ); | |
| 638 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_w ); | |
| 639 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, SMH_NOP ); | |
| 640 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r ); | |
| 641 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w ); | |
| 636 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_r, btc_trackball_w ); | |
| 637 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, SMH_NOP ); | |
| 638 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r, btcflash_w ); | |
| 642 | 639 | |
| 643 | 640 | DRIVER_INIT_CALL(konamigv); |
| 644 | 641 | } |
| r2418 | r2419 | |
| 692 | 689 | |
| 693 | 690 | static DRIVER_INIT( tokimosh ) |
| 694 | 691 | { |
| 695 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r ); | |
| 696 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w ); | |
| 692 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r ); | |
| 693 | memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w ); | |
| 697 | 694 | |
| 698 | 695 | DRIVER_INIT_CALL(konamigv); |
| 699 | 696 | } |
| r2418 | r2419 | |
| 723 | 720 | { |
| 724 | 721 | intelflash_init( 0, FLASH_SHARP_LH28F400, NULL ); |
| 725 | 722 | |
| 726 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, input_port_3_dword_r ); | |
| 727 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, input_port_4_dword_r ); | |
| 728 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800a0, 0x1f6800a3, 0, 0, input_port_5_dword_r ); | |
| 729 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800b0, 0x1f6800b3, 0, 0, input_port_6_dword_r ); | |
| 730 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c3, 0, 0, input_port_7_dword_r ); | |
| 731 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, kdeadeye_0_w ); | |
| 732 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r ); | |
| 733 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w ); | |
| 723 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, input_port_3_dword_r ); | |
| 724 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, input_port_4_dword_r ); | |
| 725 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800a0, 0x1f6800a3, 0, 0, input_port_5_dword_r ); | |
| 726 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800b0, 0x1f6800b3, 0, 0, input_port_6_dword_r ); | |
| 727 | memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c3, 0, 0, input_port_7_dword_r ); | |
| 728 | memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, kdeadeye_0_w ); | |
| 729 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r, btcflash_w ); | |
| 734 | 730 | |
| 735 | 731 | DRIVER_INIT_CALL(konamigv); |
| 736 | 732 | } |
| r2418 | r2419 | |
|---|---|---|
| 576 | 576 | |
| 577 | 577 | static DRIVER_INIT( crgolfhi ) |
| 578 | 578 | { |
| 579 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w); | |
| 579 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w); | |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 |
| r2418 | r2419 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | static ADDRESS_MAP_START( stlforce_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 108 | 108 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 109 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_WRITE(stlforce_bg_videoram_w) AM_BASE(&stlforce_bg_videoram) | |
| 110 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_WRITE(stlforce_mlow_videoram_w) AM_BASE(&stlforce_mlow_videoram) | |
| 111 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(stlforce_mhigh_videoram_w) AM_BASE(&stlforce_mhigh_videoram) | |
| 112 | AM_RANGE(0x101800, 0x1027ff) AM_RAM AM_WRITE(stlforce_tx_videoram_w) AM_BASE(&stlforce_tx_videoram) | |
| 109 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(stlforce_bg_videoram_w) AM_BASE(&stlforce_bg_videoram) | |
| 110 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(stlforce_mlow_videoram_w) AM_BASE(&stlforce_mlow_videoram) | |
| 111 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(stlforce_mhigh_videoram_w) AM_BASE(&stlforce_mhigh_videoram) | |
| 112 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(stlforce_tx_videoram_w) AM_BASE(&stlforce_tx_videoram) | |
| 113 | 113 | AM_RANGE(0x102800, 0x102fff) AM_RAM /* unknown / ram */ |
| 114 | 114 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_BASE(&stlforce_bg_scrollram) |
| 115 | 115 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE(&stlforce_mlow_scrollram) |
| 116 | 116 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE(&stlforce_mhigh_scrollram) |
| 117 | 117 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE(&stlforce_vidattrram) |
| 118 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 118 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 119 | 119 | AM_RANGE(0x105000, 0x107fff) AM_RAM /* unknown / ram */ |
| 120 | 120 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE(&stlforce_spriteram) |
| 121 | 121 | AM_RANGE(0x109000, 0x11ffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 305 | 305 | AM_RANGE(0x74000000, 0x74003fff) AM_MIRROR(0x80000000) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) |
| 306 | 306 | AM_RANGE(0x74020000, 0x7402003f) AM_MIRROR(0x80000000) AM_READWRITE(K056832_long_r, K056832_long_w) |
| 307 | 307 | AM_RANGE(0x74060000, 0x7406003f) AM_MIRROR(0x80000000) AM_READWRITE(ccu_r, ccu_w) |
| 308 | AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_R | |
| 308 | AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_R | |
| 309 | 309 | AM_RANGE(0x740a0000, 0x740a3fff) AM_MIRROR(0x80000000) AM_READ(K056832_rom_long_r) |
| 310 | 310 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) /* 21N 21K 23N 23K */ |
| 311 | 311 | AM_RANGE(0x78010000, 0x7801ffff) AM_MIRROR(0x80000000) AM_WRITE(cgboard_dsp_shared_w_ppc) |
| r2418 | r2419 | |
| 331 | 331 | static ADDRESS_MAP_START( jetwave_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 332 | 332 | AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM /* Work RAM */ |
| 333 | 333 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 334 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_R | |
| 334 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_R | |
| 335 | 335 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 336 | 336 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 337 | 337 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) /* 21N 21K 23N 23K */ |
| r2418 | r2419 | |
|---|---|---|
| 75 | 75 | static ADDRESS_MAP_START( amspdwy_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 76 | 76 | AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM |
| 77 | 77 | AM_RANGE(0x8000, 0x801f) AM_WRITE(amspdwy_paletteram_w) AM_BASE(&paletteram)// Palette |
| 78 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, amspdwy_videoram_w) AM_BASE(&videoram) // Layer, mirrored? | |
| 79 | AM_RANGE(0x9800, 0x9bff) AM_READWRITE(SMH_RAM, amspdwy_colorram_w) AM_BASE(&colorram) // Layer | |
| 78 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(amspdwy_videoram_w) AM_BASE(&videoram) // Layer, mirrored? | |
| 79 | AM_RANGE(0x9800, 0x9bff) AM_RAM_WRITE(amspdwy_colorram_w) AM_BASE(&colorram) // Layer | |
| 80 | 80 | AM_RANGE(0x9c00, 0x9fff) AM_RAM // Unused? |
| 81 | 81 | // AM_RANGE(0xa000, 0xa000) AM_WRITENOP // ? |
| 82 | 82 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) // DSW 1 |
| r2418 | r2419 | |
|---|---|---|
| 2156 | 2156 | SN76496_1_w(machine, 0, data & 0xff); |
| 2157 | 2157 | } |
| 2158 | 2158 | |
| 2159 | static void init_ports_systeme( | |
| 2159 | static void init_ports_systeme(running_machine *machine) | |
| 2160 | 2160 | { |
| 2161 | 2161 | /* INIT THE PORTS *********************************************************************************************/ |
| 2162 | 2162 | |
| 2163 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_vcounter_r); | |
| 2164 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_sn76496_w); | |
| 2163 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0x7b, 0x7b, 0, 0, sms_sn76496_2_w); | |
| 2164 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_vcounter_r, sms_sn76496_w); | |
| 2165 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w); | |
| 2165 | 2166 | |
| 2167 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_r, sms_vdp_data_w); | |
| 2168 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_r, sms_vdp_ctrl_w); | |
| 2166 | 2169 | |
| 2167 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7b, 0x7b, 0, 0, sms_sn76496_2_w); | |
| 2170 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_r, sms_vdp_2_data_w); | |
| 2171 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_r, sms_vdp_2_ctrl_w); | |
| 2168 | 2172 | |
| 2169 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w); | |
| 2173 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_2_r); | |
| 2174 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_3_r); | |
| 2175 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_4_r); | |
| 2176 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_0_r); | |
| 2177 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_1_r); | |
| 2170 | 2178 | |
| 2171 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_r); | |
| 2172 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_w); | |
| 2173 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_r); | |
| 2174 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_w); | |
| 2175 | ||
| 2176 | ||
| 2177 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_r); | |
| 2178 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_w); | |
| 2179 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_r); | |
| 2180 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_w); | |
| 2181 | ||
| 2182 | ||
| 2183 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_2_r); | |
| 2184 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_3_r); | |
| 2185 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_4_r); | |
| 2186 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_0_r); | |
| 2187 | memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_1_r); | |
| 2188 | ||
| 2189 | ||
| 2190 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf7, 0xf7, 0, 0, systeme_bank_w ); | |
| 2191 | ||
| 2179 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf7, 0xf7, 0, 0, systeme_bank_w ); | |
| 2192 | 2180 | } |
| 2193 | 2181 | |
| 2194 | 2182 | |
| 2195 | 2183 | |
| 2196 | static void init_systeme_map( | |
| 2184 | static void init_systeme_map(running_machine *machine) | |
| 2197 | 2185 | { |
| 2198 | 2186 | /* INIT THE MEMMAP / BANKING *********************************************************************************/ |
| 2199 | 2187 | |
| 2200 | 2188 | /* catch any addresses that don't get mapped */ |
| 2201 | // memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r); | |
| 2202 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w); | |
| 2189 | // memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w); | |
| 2203 | 2190 | |
| 2204 | 2191 | /* fixed rom bank area */ |
| 2205 | 2192 | // sms_rom = auto_malloc(0xc000); |
| 2206 | // memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK1); | |
| 2207 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 2193 | // memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 2208 | 2194 | // memory_set_bankptr( 1, sms_rom ); |
| 2209 | 2195 | |
| 2210 | 2196 | memory_configure_bank(1, 0, 16, memory_region(REGION_CPU1) + 0x10000, 0x4000); |
| 2211 | 2197 | |
| 2212 | 2198 | /* alternate way of accessing video ram */ |
| 2213 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, segasyse_videoram_w); | |
| 2199 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, segasyse_videoram_w); | |
| 2214 | 2200 | |
| 2215 | 2201 | |
| 2216 | 2202 | // memcpy(sms_rom, memory_region(REGION_USER1), 0x8000); |
| 2217 | 2203 | |
| 2218 | 2204 | /* main ram area */ |
| 2219 | 2205 | sms_mainram = auto_malloc(0x4000); |
| 2220 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 2221 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 2206 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 2222 | 2207 | memory_set_bankptr( 2, sms_mainram ); |
| 2223 | 2208 | memset(sms_mainram,0x00,0x4000); |
| 2224 | 2209 | |
| 2225 | init_ports_systeme(); | |
| 2210 | init_ports_systeme(machine); | |
| 2226 | 2211 | } |
| 2227 | 2212 | |
| 2228 | 2213 | void init_for_megadrive(void) |
| r2418 | r2419 | |
| 2239 | 2224 | |
| 2240 | 2225 | DRIVER_INIT( megatech_bios ) |
| 2241 | 2226 | { |
| 2242 | // init_systeme_map(); | |
| 2227 | // init_systeme_map(machine); | |
| 2243 | 2228 | |
| 2244 | 2229 | vdp1 = start_vdp(machine, SMS2_VDP); |
| 2245 | 2230 | vdp1->set_irq = sms_vdp_cpu2_irq_callback; |
| r2418 | r2419 | |
| 2254 | 2239 | |
| 2255 | 2240 | static DRIVER_INIT( segasyse ) |
| 2256 | 2241 | { |
| 2257 | init_systeme_map(); | |
| 2242 | init_systeme_map(machine); | |
| 2258 | 2243 | |
| 2259 | 2244 | vdp1 = start_vdp(machine, SMS2_VDP); |
| 2260 | 2245 | // vdp1->set_irq = sms_vdp_cpu0_irq_callback; |
| r2418 | r2419 | |
| 2343 | 2328 | { |
| 2344 | 2329 | DRIVER_INIT_CALL(segasyse); |
| 2345 | 2330 | |
| 2346 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r); | |
| 2347 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w); | |
| 2331 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r); | |
| 2332 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w); | |
| 2348 | 2333 | } |
| 2349 | 2334 | |
| 2350 | 2335 | |
| r2418 | r2419 | |
| 2352 | 2337 | { |
| 2353 | 2338 | DRIVER_INIT_CALL(segasyse); |
| 2354 | 2339 | |
| 2355 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r); | |
| 2356 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w); | |
| 2340 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r); | |
| 2341 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w); | |
| 2357 | 2342 | } |
| 2358 | 2343 | |
| 2359 | 2344 | static DRIVER_INIT( opaopa ) |
| r2418 | r2419 | |
|---|---|---|
| 248 | 248 | AM_RANGE(0x30000, 0x3ffff) AM_ROM |
| 249 | 249 | AM_RANGE(0x70000, 0x7ffff) AM_ROM |
| 250 | 250 | |
| 251 | AM_RANGE(0x52000, 0x521ff) AM_R | |
| 251 | AM_RANGE(0x52000, 0x521ff) AM_R | |
| 252 | 252 | |
| 253 | 253 | AM_RANGE(0x53000, 0x53000) AM_READWRITE( input_port_0_r, borntofi_nmi_enable_w ) |
| 254 | 254 | AM_RANGE(0x53001, 0x53001) AM_READ( input_port_1_r ) |
| r2418 | r2419 | |
|---|---|---|
| 1678 | 1678 | |
| 1679 | 1679 | uPD4701_init( 0 ); |
| 1680 | 1680 | |
| 1681 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_r ); | |
| 1682 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_w ); | |
| 1681 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_r, ge765pwbba_w ); | |
| 1683 | 1682 | } |
| 1684 | 1683 | |
| 1685 | 1684 | /* |
| r2418 | r2419 | |
| 1784 | 1783 | } |
| 1785 | 1784 | } |
| 1786 | 1785 | |
| 1787 | static void gx700pwfbf_init( void (*output_callback_func)( int offset, int data ) ) | |
| 1786 | static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) ) | |
| 1788 | 1787 | { |
| 1789 | 1788 | memset( gx700pwbf_output_data, 0, sizeof( gx700pwbf_output_data ) ); |
| 1790 | 1789 | |
| 1791 | 1790 | gx700pwfbf_output_callback = output_callback_func; |
| 1792 | 1791 | |
| 1793 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_r ); | |
| 1794 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_w ); | |
| 1792 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_r, gx700pwbf_io_w ); | |
| 1795 | 1793 | |
| 1796 | 1794 | state_save_register_global_array( gx700pwbf_output_data ); |
| 1797 | 1795 | } |
| r2418 | r2419 | |
| 1976 | 1974 | { |
| 1977 | 1975 | DRIVER_INIT_CALL(konami573); |
| 1978 | 1976 | |
| 1979 | gx700pwfbf_init( gn845pwbb_output_callback ); | |
| 1977 | gx700pwfbf_init( machine, gn845pwbb_output_callback ); | |
| 1980 | 1978 | |
| 1981 | 1979 | state_save_register_global( stage_mask ); |
| 1982 | 1980 | } |
| r2418 | r2419 | |
| 2034 | 2032 | { |
| 2035 | 2033 | DRIVER_INIT_CALL(konami573); |
| 2036 | 2034 | |
| 2037 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r ); | |
| 2038 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w ); | |
| 2035 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r, gtrfrks_io_w ); | |
| 2039 | 2036 | } |
| 2040 | 2037 | |
| 2041 | 2038 | /* GX894 digital i/o */ |
| r2418 | r2419 | |
| 2319 | 2316 | } |
| 2320 | 2317 | } |
| 2321 | 2318 | |
| 2322 | static void gx894pwbba_init( void (*output_callback_func)( int offset, int data ) ) | |
| 2319 | static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) ) | |
| 2323 | 2320 | { |
| 2324 | 2321 | int gx894_ram_size = 24 * 1024 * 1024; |
| 2325 | 2322 | |
| 2326 | 2323 | gx894pwbba_output_callback = output_callback_func; |
| 2327 | 2324 | |
| 2328 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_r ); | |
| 2329 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_w ); | |
| 2325 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_r, gx894pwbba_w ); | |
| 2330 | 2326 | |
| 2331 | 2327 | gx894_ram_write_offset = 0; |
| 2332 | 2328 | gx894_ram_read_offset = 0; |
| r2418 | r2419 | |
| 2344 | 2340 | { |
| 2345 | 2341 | DRIVER_INIT_CALL(konami573); |
| 2346 | 2342 | |
| 2347 | gx894pwbba_init( gn845pwbb_output_callback ); | |
| 2343 | gx894pwbba_init( machine, gn845pwbb_output_callback ); | |
| 2348 | 2344 | } |
| 2349 | 2345 | |
| 2350 | 2346 | /* guitar freaks digital */ |
| r2418 | r2419 | |
| 2353 | 2349 | { |
| 2354 | 2350 | DRIVER_INIT_CALL(konami573); |
| 2355 | 2351 | |
| 2356 | gx894pwbba_init( NULL ); | |
| 2352 | gx894pwbba_init( machine, NULL ); | |
| 2357 | 2353 | |
| 2358 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r ); | |
| 2359 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w ); | |
| 2354 | memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r, gtrfrks_io_w ); | |
| 2360 | 2355 | } |
| 2361 | 2356 | |
| 2362 | 2357 | /* ddr solo */ |
| r2418 | r2419 | |
| 2418 | 2413 | { |
| 2419 | 2414 | DRIVER_INIT_CALL(konami573); |
| 2420 | 2415 | |
| 2421 | gx894pwbba_init( ddrsolo_output_callback ); | |
| 2416 | gx894pwbba_init( machine, ddrsolo_output_callback ); | |
| 2422 | 2417 | } |
| 2423 | 2418 | |
| 2424 | 2419 | /* drummania */ |
| r2418 | r2419 | |
| 2491 | 2486 | { |
| 2492 | 2487 | DRIVER_INIT_CALL(konami573); |
| 2493 | 2488 | |
| 2494 | gx700pwfbf_init( drmn_output_callback ); | |
| 2489 | gx700pwfbf_init( machine, drmn_output_callback ); | |
| 2495 | 2490 | } |
| 2496 | 2491 | |
| 2497 | 2492 | static DRIVER_INIT( drmndigital ) |
| 2498 | 2493 | { |
| 2499 | 2494 | DRIVER_INIT_CALL(konami573); |
| 2500 | 2495 | |
| 2501 | gx894pwbba_init( drmn_output_callback ); | |
| 2496 | gx894pwbba_init( machine, drmn_output_callback ); | |
| 2502 | 2497 | } |
| 2503 | 2498 | |
| 2504 | 2499 | /* dance maniax */ |
| r2418 | r2419 | |
| 2647 | 2642 | { |
| 2648 | 2643 | DRIVER_INIT_CALL(konami573); |
| 2649 | 2644 | |
| 2650 | gx894pwbba_init( dmx_output_callback ); | |
| 2645 | gx894pwbba_init( machine, dmx_output_callback ); | |
| 2651 | 2646 | |
| 2652 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, dmx_io_w ); | |
| 2647 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, dmx_io_w ); | |
| 2653 | 2648 | } |
| 2654 | 2649 | |
| 2655 | 2650 | /* salary man champ */ |
| r2418 | r2419 | |
|---|---|---|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
| 199 | static void pitfighb_cheap_slapstic_init( | |
| 199 | static void pitfighb_cheap_slapstic_init(running_machine *machine) | |
| 200 | 200 | { |
| 201 | 201 | /* install a read handler */ |
| 202 | bslapstic_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r); | |
| 202 | bslapstic_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r); | |
| 203 | 203 | |
| 204 | 204 | /* allocate memory for a copy of bank 0 */ |
| 205 | 205 | bslapstic_bank0 = auto_malloc(0x2000); |
| r2418 | r2419 | |
| 233 | 233 | AM_RANGE(0xfd0000, 0xfd0001) AM_READ(atarigen_sound_upper_r) |
| 234 | 234 | AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 235 | 235 | /* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ(from_r)*/ |
| 236 | AM_RANGE(0xfe8000, 0xfe89ff) AM_R | |
| 236 | AM_RANGE(0xfe8000, 0xfe89ff) AM_R | |
| 237 | 237 | AM_RANGE(0xff0000, 0xff0fff) AM_WRITE(atarirle_0_spriteram_w) AM_BASE(&atarirle_0_spriteram) |
| 238 | 238 | AM_RANGE(0xff2000, 0xff2001) AM_WRITE(mo_command_w) AM_BASE(&mo_command) |
| 239 | 239 | AM_RANGE(0xff4000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) |
| r2418 | r2419 | |
| 961 | 961 | atarigen_eeprom_default = NULL; |
| 962 | 962 | if (slapstic == -1) |
| 963 | 963 | { |
| 964 | pitfighb_cheap_slapstic_init(); | |
| 964 | pitfighb_cheap_slapstic_init(machine); | |
| 965 | 965 | state_save_register_global(bslapstic_bank); |
| 966 | 966 | state_save_register_global(bslapstic_primed); |
| 967 | 967 | state_save_register_postload(machine, pitfighb_state_postload, NULL); |
| r2418 | r2419 | |
|---|---|---|
| 333 | 333 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 334 | 334 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 335 | 335 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x380) AM_RAMBANK(1) |
| 336 | AM_RANGE(0x0400, 0x07ff) AM_R | |
| 336 | AM_RANGE(0x0400, 0x07ff) AM_R | |
| 337 | 337 | AM_RANGE(0x0800, 0x083f) AM_READ(switches_r) |
| 338 | 338 | AM_RANGE(0x0840, 0x0840) AM_MIRROR(0x003f) AM_READ_PORT("COIN") |
| 339 | 339 | AM_RANGE(0x0880, 0x0880) AM_MIRROR(0x003f) AM_READ_PORT("START") |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | extern WRITE16_HANDLER( legionna_mcu_w ); |
| 86 | 86 | extern READ16_HANDLER( heatbrl_mcu_r ); |
| 87 | 87 | extern WRITE16_HANDLER( heatbrl_mcu_w ); |
| 88 | extern READ16_HANDLER( godzilla_cop_mcu_r ); | |
| 89 | extern WRITE16_HANDLER( godzilla_cop_mcu_w ); | |
| 90 | extern READ16_HANDLER( denjinmk_cop_mcu_r ); | |
| 91 | extern WRITE16_HANDLER( denjinmk_cop_mcu_w ); | |
| 92 | extern READ16_HANDLER( sdgndmrb_cop_mcu_r ); | |
| 93 | extern WRITE16_HANDLER( sdgndmrb_cop_mcu_w ); | |
| 94 | extern READ16_HANDLER( copdx_0_r ); | |
| 95 | extern WRITE16_HANDLER( copdx_0_w ); | |
| 88 | extern READ16_HANDLER( godzilla_mcu_r ); | |
| 89 | extern WRITE16_HANDLER( godzilla_mcu_w ); | |
| 90 | extern READ16_HANDLER( denjinmk_mcu_r ); | |
| 91 | extern WRITE16_HANDLER( denjinmk_mcu_w ); | |
| 92 | extern READ16_HANDLER( sdgndmrb_mcu_r ); | |
| 93 | extern WRITE16_HANDLER( sdgndmrb_mcu_w ); | |
| 94 | extern READ16_HANDLER( cupsoc_mcu_r ); | |
| 95 | extern WRITE16_HANDLER( cupsoc_mcu_w ); | |
| 96 | 96 | extern READ16_HANDLER( copdxbl_0_r ); |
| 97 | 97 | extern WRITE16_HANDLER( copdxbl_0_w ); |
| 98 | 98 | |
| r2418 | r2419 | |
| 117 | 117 | extern UINT16 *legionna_back_data,*legionna_fore_data,*legionna_mid_data,*legionna_scrollram16,*legionna_textram; |
| 118 | 118 | |
| 119 | 119 | |
| 120 | static WRITE16_HANDLER( legionna_paletteram16_w ) /* xBBBBxRRRRxGGGGx */ | |
| 121 | { | |
| 122 | int a; | |
| 123 | COMBINE_DATA(&paletteram16[offset]); | |
| 124 | a = paletteram16[offset]; | |
| 125 | palette_set_color_rgb(Machine,offset,pal4bit(a >> 1),pal4bit(a >> 6),pal4bit(a >> 11)); | |
| 126 | } | |
| 127 | ||
| 128 | 120 | /*****************************************************************************/ |
| 129 | 121 | |
| 130 | 122 | |
| 131 | 123 | static ADDRESS_MAP_START( legionna_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 132 | 124 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 133 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 134 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(legionna_mcu_r, legionna_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 135 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 136 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 137 | AM_RANGE(0x102000, 0x1027ff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 138 | AM_RANGE(0x102800, 0x1037ff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 125 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 126 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(legionna_mcu_r, legionna_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 127 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 128 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 129 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 130 | AM_RANGE(0x102800, 0x1037ff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 139 | 131 | AM_RANGE(0x104000, 0x104fff) AM_RAM /* The 4000-4fff area contains PALETTE words and may be extra paletteram? */ |
| 140 | 132 | AM_RANGE(0x105000, 0x105fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 141 | 133 | AM_RANGE(0x106000, 0x106fff) AM_RAM /* is this used outside inits ?? */ |
| 142 | AM_RANGE(0x107000, 0x107fff) AM_RAM | |
| 134 | AM_RANGE(0x107000, 0x107fff) AM_RAM | |
| 143 | 135 | AM_RANGE(0x108000, 0x11ffff) AM_RAM /* main ram */ |
| 144 | 136 | ADDRESS_MAP_END |
| 145 | 137 | |
| 146 | 138 | |
| 147 | 139 | static ADDRESS_MAP_START( heatbrl_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 148 | 140 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 149 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 150 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(heatbrl_mcu_r, heatbrl_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 151 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 152 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 153 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 154 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 141 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 142 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(heatbrl_mcu_r, heatbrl_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 143 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 144 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 145 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 146 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 155 | 147 | AM_RANGE(0x103000, 0x103fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 156 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 148 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 157 | 149 | AM_RANGE(0x108000, 0x11ffff) AM_RAM |
| 158 | 150 | ADDRESS_MAP_END |
| 159 | 151 | |
| 160 | 152 | static ADDRESS_MAP_START( godzilla_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 161 | 153 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 162 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 163 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(godzilla_cop_mcu_r, godzilla_cop_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 154 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 155 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(godzilla_mcu_r, godzilla_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 164 | 156 | AM_RANGE(0x100800, 0x100fff) AM_RAM |
| 165 | AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 166 | AM_RANGE(0x102000, 0x1027ff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 167 | AM_RANGE(0x102800, 0x1037ff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 168 | AM_RANGE(0x103800, 0x103fff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 169 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 157 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 158 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 159 | AM_RANGE(0x102800, 0x1037ff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 160 | AM_RANGE(0x103800, 0x103fff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 161 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 170 | 162 | AM_RANGE(0x105000, 0x105fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 171 | 163 | AM_RANGE(0x106000, 0x1067ff) AM_RAM |
| 172 | 164 | AM_RANGE(0x106800, 0x106fff) AM_RAM |
| r2418 | r2419 | |
| 174 | 166 | AM_RANGE(0x108000, 0x11ffff) AM_RAM |
| 175 | 167 | ADDRESS_MAP_END |
| 176 | 168 | |
| 169 | /* did they swap the lines, or does the protection device swap the words during the DMA?? */ | |
| 170 | WRITE16_HANDLER( denjin_paletteram16_xBBBBBGGGGGRRRRR_word_w ) | |
| 171 | { | |
| 172 | offset^=1; | |
| 173 | COMBINE_DATA(&paletteram16[offset]); | |
| 174 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine,offset,data,mem_mask); | |
| 175 | } | |
| 176 | ||
| 177 | 177 | static ADDRESS_MAP_START( denjinmk_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 178 | 178 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 179 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 180 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(denjinmk_cop_mcu_r, denjinmk_cop_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 179 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 180 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(denjinmk_mcu_r, denjinmk_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 181 | 181 | AM_RANGE(0x100800, 0x100fff) AM_RAM |
| 182 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 183 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 184 | AM_RANGE(0x102000, 0x1027ff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 185 | AM_RANGE(0x102800, 0x103fff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 182 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 183 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 184 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 185 | AM_RANGE(0x102800, 0x103fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 186 | 186 | AM_RANGE(0x104000, 0x104fff) AM_RAM |
| 187 | 187 | AM_RANGE(0x105000, 0x105fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 188 | 188 | AM_RANGE(0x106000, 0x107fff) AM_RAM |
| 189 | 189 | AM_RANGE(0x108000, 0x11dfff) AM_RAM |
| 190 | AM_RANGE(0x11e000, 0x11efff) AM_RAM | |
| 190 | AM_RANGE(0x11e000, 0x11efff) AM_RAM | |
| 191 | 191 | AM_RANGE(0x11f000, 0x11ffff) AM_RAM |
| 192 | 192 | ADDRESS_MAP_END |
| 193 | 193 | |
| 194 | 194 | static ADDRESS_MAP_START( sdgndmrb_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 195 | 195 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 196 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 197 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(sdgndmrb_cop_mcu_r, sdgndmrb_cop_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 198 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 199 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 200 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 201 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 202 | AM_RANGE(0x103000, 0x103fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 203 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) | |
| 196 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 197 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(sdgndmrb_mcu_r, sdgndmrb_mcu_w) AM_BASE(&cop_mcu_ram) /* COP mcu */ | |
| 198 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 199 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 200 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 201 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 202 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 203 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) | |
| 204 | 204 | AM_RANGE(0x105000, 0x105fff) AM_RAM |
| 205 | 205 | AM_RANGE(0x106000, 0x106fff) AM_RAM |
| 206 | 206 | AM_RANGE(0x107000, 0x107fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
| 209 | 209 | |
| 210 | 210 | static ADDRESS_MAP_START( cupsoc_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 211 | 211 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 212 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 213 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(copdx_0_r,copdx_0_w) AM_BASE(&cop_mcu_ram) | |
| 212 | AM_RANGE(0x100000, 0x1003ff) AM_RAM | |
| 213 | AM_RANGE(0x100400, 0x1007ff) AM_RAM AM_READWRITE(cupsoc_mcu_r,cupsoc_mcu_w) AM_BASE(&cop_mcu_ram) | |
| 214 | 214 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_READWRITE(SMH_RAM,legionna_background_w) AM_BASE(&legionna_back_data) |
| 215 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 216 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 217 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 218 | AM_RANGE(0x103000, 0x103fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 219 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) /*<according to the debug mode,there is a DMA that copies from here to the paletteram>*/ | |
| 215 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 216 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 217 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 218 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 219 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) /*<according to the debug mode,there is a DMA that copies from here to the paletteram>*/ | |
| 220 | 220 | AM_RANGE(0x105000, 0x106fff) AM_RAM |
| 221 | 221 | AM_RANGE(0x107000, 0x1077ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 222 | 222 | AM_RANGE(0x107800, 0x107fff) AM_RAM /*Ani Dsp(?) Ram*/ |
| r2418 | r2419 | |
| 230 | 230 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 231 | 231 | //AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 232 | 232 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_READWRITE(copdxbl_0_r,copdxbl_0_w) AM_BASE(&cop_mcu_ram) |
| 233 | AM_RANGE(0x100800, 0x100fff) AM_RAM AM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 234 | AM_RANGE(0x101000, 0x1017ff) AM_RAM AM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 235 | AM_RANGE(0x101800, 0x101fff) AM_RAM AM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 236 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 237 | AM_RANGE(0x103000, 0x103fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 238 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) /*<according to the debug mode,there is a DMA that copies from here to the paletteram>*/ | |
| 233 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_BASE(&legionna_back_data) | |
| 234 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(&legionna_fore_data) | |
| 235 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(&legionna_mid_data) | |
| 236 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(&legionna_textram) | |
| 237 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 238 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) /*<according to the debug mode,there is a DMA that copies from here to the paletteram>*/ | |
| 239 | 239 | AM_RANGE(0x105000, 0x106fff) AM_RAM |
| 240 | 240 | AM_RANGE(0x107000, 0x1077ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 241 | 241 | AM_RANGE(0x107800, 0x107fff) AM_RAM /*Ani Dsp(?) Ram*/ |
| r2418 | r2419 | |
| 1290 | 1290 | ROM_LOAD32_BYTE( "3", 0x00002, 0x20000, CRC(553fc7c0) SHA1(b12a2eea6b2c9bd76c0c74ddf2765d58510f586a) ) |
| 1291 | 1291 | ROM_LOAD32_BYTE( "legion4.bin", 0x00003, 0x20000, CRC(2cc36c98) SHA1(484fc6eeeed89386ec69df0f92919b742cfdd89f) ) |
| 1292 | 1292 | |
| 1293 | ROM_REGION( 0x20000 | |
| 1293 | ROM_REGION( 0x20000 | |
| 1294 | 1294 | ROM_LOAD( "6", 0x00000, 0x08000, CRC(fe7b8d06) SHA1(1e5b52ea4b4042940e2ee2db75c7c0f24973422a) ) |
| 1295 | 1295 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ |
| 1296 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1296 | 1297 | |
| 1297 | 1298 | ROM_REGION( 0x020000, REGION_USER1, ROMREGION_DISPOSE ) /* load the tiles here so we can split them up into the required regions by hand */ |
| 1298 | 1299 | ROM_LOAD16_BYTE( "7", 0x000000, 0x10000, CRC(88e26809) SHA1(40ee55d3b5329b6f657e0621d93c4caf6a035fdf) ) |
| r2418 | r2419 | |
| 1331 | 1332 | ROM_LOAD32_BYTE( "3", 0x00002, 0x20000, CRC(553fc7c0) SHA1(b12a2eea6b2c9bd76c0c74ddf2765d58510f586a) ) |
| 1332 | 1333 | ROM_LOAD32_BYTE( "4", 0x00003, 0x20000, CRC(91fd4648) SHA1(8ad6d0512996b88d3c0c7a96912eebaae2333424) ) |
| 1333 | 1334 | |
| 1334 | ROM_REGION( 0x20000 | |
| 1335 | ROM_REGION( 0x20000 | |
| 1335 | 1336 | ROM_LOAD( "6", 0x00000, 0x08000, CRC(fe7b8d06) SHA1(1e5b52ea4b4042940e2ee2db75c7c0f24973422a) ) |
| 1336 | 1337 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ |
| 1338 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1337 | 1339 | |
| 1338 | 1340 | ROM_REGION( 0x020000, REGION_USER1, ROMREGION_DISPOSE ) /* load the tiles here so we can split them up into the required regions by hand */ |
| 1339 | 1341 | ROM_LOAD16_BYTE( "7", 0x000000, 0x10000, CRC(88e26809) SHA1(40ee55d3b5329b6f657e0621d93c4caf6a035fdf) ) /* chars, some BK3 tiles too */ |
| r2418 | r2419 | |
| 1372 | 1374 | ROM_LOAD32_BYTE( "3e_ver2.9f", 0x00002, 0x20000, CRC(a2c41715) SHA1(a15b7a35ae0792ed00c47426d2e07c445acd8b8d) ) |
| 1373 | 1375 | ROM_LOAD32_BYTE( "4e_ver2.9h", 0x00003, 0x20000, CRC(a50f4f08) SHA1(f468e4a016a53803b8404bacdef5712311c6f0ac) ) |
| 1374 | 1376 | |
| 1375 | ROM_REGION( 0x20000 | |
| 1377 | ROM_REGION( 0x20000 | |
| 1376 | 1378 | ROM_LOAD( "barrel.7", 0x00000, 0x08000, CRC(0784dbd8) SHA1(bdf7f8a3a3eb346eb2aeaf4f9bfc49af059d04c9) ) |
| 1377 | 1379 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ |
| 1380 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1378 | 1381 | |
| 1379 | 1382 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1380 | 1383 | ROM_LOAD16_BYTE( "barrel.6", 0x000000, 0x10000, CRC(bea3c581) SHA1(7f7f0a74bf106acaf57c182d47f0c707da2011bd) ) /* chars */ |
| r2418 | r2419 | |
| 1407 | 1410 | ROM_LOAD32_BYTE( "barrel.3h", 0x00002, 0x20000, CRC(823373a0) SHA1(1bb7f811df4f85db8ca10e59fe22137a09470def) ) |
| 1408 | 1411 | ROM_LOAD32_BYTE( "barrel.4h", 0x00003, 0x20000, CRC(19a8606b) SHA1(6e950212c532e46bb6645c3c1f8205c2a4ea2c87) ) |
| 1409 | 1412 | |
| 1410 | ROM_REGION( 0x20000 | |
| 1413 | ROM_REGION( 0x20000 | |
| 1411 | 1414 | ROM_LOAD( "barrel.7", 0x00000, 0x08000, CRC(0784dbd8) SHA1(bdf7f8a3a3eb346eb2aeaf4f9bfc49af059d04c9) ) |
| 1412 | 1415 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ |
| 1416 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1413 | 1417 | |
| 1414 | 1418 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1415 | 1419 | ROM_LOAD16_BYTE( "barrel.6", 0x000000, 0x10000, CRC(bea3c581) SHA1(7f7f0a74bf106acaf57c182d47f0c707da2011bd) ) /* chars */ |
| r2418 | r2419 | |
| 1446 | 1450 | ROM_LOAD32_BYTE( "3e_ver2.9f", 0x00002, 0x20000, CRC(a2c41715) SHA1(a15b7a35ae0792ed00c47426d2e07c445acd8b8d) ) |
| 1447 | 1451 | ROM_LOAD32_BYTE( "4e_ver2.9h", 0x00003, 0x20000, CRC(a50f4f08) SHA1(f468e4a016a53803b8404bacdef5712311c6f0ac) ) |
| 1448 | 1452 | |
| 1449 | ROM_REGION( 0x20000 | |
| 1453 | ROM_REGION( 0x20000 | |
| 1450 | 1454 | ROM_LOAD( "barrel.7", 0x00000, 0x08000, CRC(0784dbd8) SHA1(bdf7f8a3a3eb346eb2aeaf4f9bfc49af059d04c9) ) |
| 1451 | 1455 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ |
| 1456 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1452 | 1457 | |
| 1453 | 1458 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1454 | 1459 | ROM_LOAD16_BYTE( "barrel.6", 0x000000, 0x10000, CRC(bea3c581) SHA1(7f7f0a74bf106acaf57c182d47f0c707da2011bd) ) /* chars */ |
| r2418 | r2419 | |
| 1530 | 1535 | ROM_LOAD32_BYTE( "4.026", 0x000002, 0x020000, CRC(bb8c0132) SHA1(fa8b049f590be710b3cf82f27deade63656db730) ) |
| 1531 | 1536 | ROM_LOAD32_BYTE( "3.023", 0x000003, 0x020000, CRC(bb16e5d0) SHA1(31d8941e6e297b1f410944f0063a4c9219d23f23) ) |
| 1532 | 1537 | |
| 1533 | ROM_REGION( 0x20000 | |
| 1538 | ROM_REGION( 0x20000 | |
| 1534 | 1539 | ROM_LOAD( "8.016", 0x000000, 0x08000, CRC(4ab76e43) SHA1(40c34fade03161c4b50f9f6a2ae61078b8d8ea6d) ) |
| 1535 | 1540 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1541 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1536 | 1542 | |
| 1537 | 1543 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1538 | 1544 | ROM_LOAD16_BYTE( "11.620", 0x000000, 0x010000, CRC(58e0e41f) SHA1(563c633eb3d4df41e467c93957c74b540a0ae43c) ) |
| r2418 | r2419 | |
| 1647 | 1653 | ROM_LOAD32_BYTE( "rom3.026", 0x000002, 0x040000, CRC(781b942e) SHA1(f1f4ddc332de3dc29b716a1b82c2ecc2045efb3a) ) |
| 1648 | 1654 | ROM_LOAD32_BYTE( "rom4.023", 0x000003, 0x040000, CRC(502a588b) SHA1(9055b631240fe52d33b572e34275d31a9f3d290f) ) |
| 1649 | 1655 | |
| 1650 | ROM_REGION( 0x20000 | |
| 1656 | ROM_REGION( 0x20000 | |
| 1651 | 1657 | ROM_LOAD( "rom5.016", 0x000000, 0x08000, CRC(7fe7e352) SHA1(1ceae22186751ca91dfffab7bd11f275e693451f) ) |
| 1652 | 1658 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1659 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1653 | 1660 | |
| 1654 | 1661 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1655 | 1662 | ROM_LOAD16_BYTE( "rom7.620", 0x000000, 0x010000, CRC(e1f759b1) SHA1(ddc60e78e7791a59c59403dd4089b3f6e1ecf8cb) ) |
| 1656 | 1663 | ROM_LOAD16_BYTE( "rom8.615", 0x000001, 0x010000, CRC(cc36af0d) SHA1(69c2ae38f03be79be4d138fcc73a6a86407eb285) ) |
| 1657 | 1664 | |
| 1658 | 1665 | ROM_REGION( 0x500000, REGION_GFX2, ROMREGION_DISPOSE ) |
| 1659 | ROM_LOAD( "obj-0-3.748", 0x000000, 0x100000, BAD_DUMP CRC(3dcc7b04) SHA1(3c3ad5ddc18a42046348dcb54e65f6173c003d72) ) /* half size?# 0,1 */ | |
| 1660 | /* the graphics for this region are missing, the previous rom should probably be twice the size, note the filename 0-3 */ | |
| 1666 | ROM_LOAD( "obj-0-3.748", 0x000000, 0x200000, CRC(67c26a67) SHA1(20543ca9dcf3fed0884968b5249b34b59a14b791) ) /* banks 0,1,2,3 */ | |
| 1661 | 1667 | ROM_LOAD( "obj-4-5.756", 0x200000, 0x100000, CRC(01f8d4e6) SHA1(25b69da693be8c3404f750b419c330a7a56e88ec) ) /* 4,5 */ |
| 1662 | 1668 | ROM_LOAD( "obj-6-7.743", 0x300000, 0x100000, CRC(e5805757) SHA1(9d392c27eef7c1fcda560dac17ba9d7ae2287ac8) ) /* 6,7 */ |
| 1663 | 1669 | ROM_LOAD( "obj-8-9.757", 0x400000, 0x100000, CRC(c8f7e1c9) SHA1(a746d187b50a0ecdd5a7f687a2601e5dc8bfe272) ) /* 8,9 */ |
| r2418 | r2419 | |
| 1746 | 1752 | ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ |
| 1747 | 1753 | ROM_LOAD( "rb-s.016", 0x000000, 0x08000, CRC(8439bf5b) SHA1(089009b91768d64edef6639e7694723d2d1c46ff) ) |
| 1748 | 1754 | ROM_CONTINUE( 0x010000, 0x08000 ) |
| 1755 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1749 | 1756 | |
| 1750 | 1757 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1751 | 1758 | ROM_LOAD16_BYTE( "rb-f1.620", 0x000000, 0x010000, CRC(792c403d) SHA1(3c606af696fe8f3d6edefdab3940bd5eb341bca9) ) |
| r2418 | r2419 | |
| 1782 | 1789 | ROM_LOAD32_BYTE( "scc_03.bin", 0x000002, 0x040000, CRC(2d23d78f) SHA1(c479ded8782f2d23e123b7d00ec57c18a8f80578) ) |
| 1783 | 1790 | ROM_LOAD32_BYTE( "scc_04.bin", 0x000003, 0x040000, CRC(e8877461) SHA1(3be44459699fd455b0daaac10e8a37d1b7985607) ) |
| 1784 | 1791 | |
| 1785 | ROM_REGION( 0x20000 | |
| 1792 | ROM_REGION( 0x20000 | |
| 1786 | 1793 | ROM_LOAD( "seibu7.8a", 0x000000, 0x08000, CRC(f63329f9) SHA1(51736de48efc14415cfdf169b43623d4c95fde2b) ) |
| 1787 | 1794 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1795 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1788 | 1796 | |
| 1789 | 1797 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1790 | 1798 | ROM_LOAD16_BYTE( "scc_06.bin", 0x000000, 0x010000, CRC(f1a18ec6) SHA1(43f8ec3fc541b8dc2a17533329dd3448afadcb3b) ) |
| r2418 | r2419 | |
| 1818 | 1826 | ROM_LOAD32_BYTE( "3_10f.bin", 0x000002, 0x040000, CRC(c0333f0c) SHA1(ed02897724de4cf981aa8c6ce98551b9e79efff3) ) |
| 1819 | 1827 | ROM_LOAD32_BYTE( "4_10k.bin", 0x000003, 0x040000, CRC(288f11d4) SHA1(424cb3d1428f7195decce2ba6eebc1e24d9bb207) ) |
| 1820 | 1828 | |
| 1821 | ROM_REGION( 0x20000 | |
| 1829 | ROM_REGION( 0x20000 | |
| 1822 | 1830 | ROM_LOAD( "7_8a.bin", 0x000000, 0x08000, CRC(f63329f9) SHA1(51736de48efc14415cfdf169b43623d4c95fde2b) ) |
| 1823 | 1831 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1832 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1824 | 1833 | |
| 1825 | 1834 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1826 | 1835 | ROM_LOAD16_BYTE( "6_7x.bin", 0x000000, 0x010000, CRC(7981366e) SHA1(b859bf23c5ae466f4020958a06935192fa68ee8d) ) |
| r2418 | r2419 | |
| 1854 | 1863 | ROM_LOAD32_BYTE( "seibu3.10f", 0x000002, 0x040000, CRC(3be8a330) SHA1(f821080acd29c5801abc36da3341aabaea82ceb0) ) |
| 1855 | 1864 | ROM_LOAD32_BYTE( "seibu4.10k", 0x000003, 0x040000, CRC(f30167ea) SHA1(5431296e3245631c90362373027c54166f8fba16) ) |
| 1856 | 1865 | |
| 1857 | ROM_REGION( 0x20000 | |
| 1866 | ROM_REGION( 0x20000 | |
| 1858 | 1867 | ROM_LOAD( "seibu7.8a", 0x000000, 0x08000, CRC(f63329f9) SHA1(51736de48efc14415cfdf169b43623d4c95fde2b) ) |
| 1859 | 1868 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1869 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1860 | 1870 | |
| 1861 | 1871 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1862 | 1872 | ROM_LOAD16_BYTE( "seibu6.7x", 0x000000, 0x010000, CRC(21c1e1b8) SHA1(30928c8ef98bf32ba0bf795ddadba1c95fcffe9d) ) |
| r2418 | r2419 | |
| 1888 | 1898 | ROM_LOAD32_BYTE( "u026.3", 0x000002, 0x040000, CRC(f71cc626) SHA1(7f66031509063d5fac33a3b5873b616c7ad0c25b) ) |
| 1889 | 1899 | ROM_LOAD32_BYTE( "u023.4", 0x000003, 0x040000, CRC(2ba10e6c) SHA1(d682d97426a749cfdbaf728edb219dbf84e9eef8) ) |
| 1890 | 1900 | |
| 1891 | ROM_REGION( 0x20000 | |
| 1901 | ROM_REGION( 0x20000 | |
| 1892 | 1902 | ROM_LOAD( "seibu7.8a", 0x000000, 0x08000, CRC(f63329f9) SHA1(51736de48efc14415cfdf169b43623d4c95fde2b) ) |
| 1893 | 1903 | ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ |
| 1904 | ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) | |
| 1894 | 1905 | |
| 1895 | 1906 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1896 | 1907 | ROM_LOAD16_BYTE( "seibu6.7x", 0x000000, 0x010000, CRC(21c1e1b8) SHA1(30928c8ef98bf32ba0bf795ddadba1c95fcffe9d) ) |
| r2418 | r2419 | |
|---|---|---|
| 306 | 306 | ADDRESS_MAP_GLOBAL_MASK(0x1fffff) |
| 307 | 307 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 308 | 308 | AM_RANGE(0x060000, 0x063fff) AM_RAM |
| 309 | AM_RANGE(0x070000, 0x070fff) AM_R | |
| 309 | AM_RANGE(0x070000, 0x070fff) AM_R | |
| 310 | 310 | AM_RANGE(0x071000, 0x071fff) AM_RAM |
| 311 | 311 | AM_RANGE(0x080000, 0x080fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 312 | 312 | AM_RANGE(0x090000, 0x09007f) AM_WRITE(mcr68_paletteram_w) AM_BASE(&paletteram16) |
| r2418 | r2419 | |
| 331 | 331 | AM_RANGE(0x080000, 0x080fff) AM_RAM |
| 332 | 332 | AM_RANGE(0x084000, 0x084fff) AM_RAM |
| 333 | 333 | AM_RANGE(0x100000, 0x10000f) AM_READWRITE(zwackery_6840_r, mcr68_6840_upper_w) |
| 334 | AM_RANGE(0x104000, 0x104007) AM_READWRITE(pia_2_msb_r, pia_2_msb_w) | |
| 335 | AM_RANGE(0x108000, 0x108007) AM_READWRITE(pia_3_lsb_r, pia_3_lsb_w) | |
| 336 | AM_RANGE(0x10c000, 0x10c007) AM_READWRITE(pia_4_lsb_r, pia_4_lsb_w) | |
| 337 | AM_RANGE(0x800000, 0x800fff) AM_READWRITE(SMH_RAM, zwackery_videoram_w) AM_BASE(&videoram16) AM_SIZE(&videoram_size) | |
| 338 | AM_RANGE(0x802000, 0x803fff) AM_READWRITE(SMH_RAM, zwackery_paletteram_w) AM_BASE(&paletteram16) | |
| 339 | AM_RANGE(0xc00000, 0xc00fff) AM_READWRITE(SMH_RAM, zwackery_spriteram_w) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 334 | AM_RANGE(0x104000, 0x104007) AM_READWRITE8(pia_2_r, pia_2_w, 0xff00) | |
| 335 | AM_RANGE(0x108000, 0x108007) AM_READWRITE8(pia_3_r, pia_3_w, 0x00ff) | |
| 336 | AM_RANGE(0x10c000, 0x10c007) AM_READWRITE8(pia_4_r, pia_4_w, 0x00ff) | |
| 337 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(zwackery_videoram_w) AM_BASE(&videoram16) AM_SIZE(&videoram_size) | |
| 338 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(zwackery_paletteram_w) AM_BASE(&paletteram16) | |
| 339 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(zwackery_spriteram_w) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 340 | 340 | ADDRESS_MAP_END |
| 341 | 341 | |
| 342 | 342 | |
| r2418 | r2419 | |
| 355 | 355 | AM_RANGE(0x0a0000, 0x0affff) AM_READ(pigskin_port_2_r) |
| 356 | 356 | AM_RANGE(0x0c0000, 0x0c007f) AM_WRITE(mcr68_paletteram_w) AM_BASE(&paletteram16) |
| 357 | 357 | AM_RANGE(0x0e0000, 0x0effff) AM_WRITE(watchdog_reset16_w) |
| 358 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 358 | AM_RANGE(0x100000, 0x100fff) AM_R | |
| 359 | 359 | AM_RANGE(0x120000, 0x120001) AM_READWRITE(pigskin_protection_r, pigskin_protection_w) |
| 360 | 360 | AM_RANGE(0x140000, 0x143fff) AM_RAM |
| 361 | 361 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| r2418 | r2419 | |
| 381 | 381 | AM_RANGE(0x100000, 0x103fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 382 | 382 | AM_RANGE(0x120000, 0x12007f) AM_WRITE(mcr68_paletteram_w) AM_BASE(&paletteram16) |
| 383 | 383 | AM_RANGE(0x140000, 0x1407ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 384 | AM_RANGE(0x160000, 0x160fff) AM_R | |
| 384 | AM_RANGE(0x160000, 0x160fff) AM_R | |
| 385 | 385 | AM_RANGE(0x180000, 0x18000f) AM_READWRITE(mcr68_6840_upper_r, mcr68_6840_upper_w) |
| 386 | 386 | AM_RANGE(0x1a0000, 0x1affff) AM_WRITE(archrivl_control_w) |
| 387 | 387 | AM_RANGE(0x1c0000, 0x1cffff) AM_WRITE(watchdog_reset16_w) |
| r2418 | r2419 | |
| 1397 | 1397 | mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16)); |
| 1398 | 1398 | |
| 1399 | 1399 | /* install control port handler */ |
| 1400 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w); | |
| 1400 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w); | |
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | 1403 | |
| r2418 | r2419 | |
| 1409 | 1409 | mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16)); |
| 1410 | 1410 | |
| 1411 | 1411 | /* analog port handling is a bit tricky */ |
| 1412 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w); | |
| 1413 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r); | |
| 1414 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r); | |
| 1412 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w); | |
| 1413 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r); | |
| 1414 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r); | |
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | |
| r2418 | r2419 | |
| 1425 | 1425 | mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16)); |
| 1426 | 1426 | |
| 1427 | 1427 | /* handle control writes */ |
| 1428 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, blasted_control_w); | |
| 1428 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, blasted_control_w); | |
| 1429 | 1429 | |
| 1430 | 1430 | /* 6840 is mapped to the lower 8 bits */ |
| 1431 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_w); | |
| 1432 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r); | |
| 1431 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w); | |
| 1433 | 1432 | } |
| 1434 | 1433 | |
| 1435 | 1434 | |
| r2418 | r2419 | |
| 1441 | 1440 | mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16)); |
| 1442 | 1441 | |
| 1443 | 1442 | /* handle control writes */ |
| 1444 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w); | |
| 1443 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w); | |
| 1445 | 1444 | |
| 1446 | 1445 | /* 49-way joystick handling is a bit tricky */ |
| 1447 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r); | |
| 1446 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r); | |
| 1448 | 1447 | |
| 1449 | 1448 | /* 6840 is mapped to the lower 8 bits */ |
| 1450 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_w); | |
| 1451 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r); | |
| 1449 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w); | |
| 1452 | 1450 | } |
| 1453 | 1451 | |
| 1454 | 1452 |
| r2418 | r2419 | |
|---|---|---|
| 418 | 418 | pbaction_decode(); |
| 419 | 419 | |
| 420 | 420 | /* install a protection (?) workaround */ |
| 421 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, pbactio3_prot_kludge_r ); | |
| 421 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, pbactio3_prot_kludge_r ); | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 |
| r2418 | r2419 | |
|---|---|---|
| 900 | 900 | AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w) |
| 901 | 901 | AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 902 | 902 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 903 | AM_RANGE(0x2000, 0x2fff) AM_RAM | |
| 903 | AM_RANGE(0x2000, 0x2fff) AM_RAM | |
| 904 | 904 | AM_RANGE(0x3000, 0x3fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 905 | 905 | AM_RANGE(0x4000, 0x4000) AM_READNOP |
| 906 | 906 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| r2418 | r2419 | |
| 916 | 916 | AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 917 | 917 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 918 | 918 | AM_RANGE(0x3600, 0x36ff) AM_RAM // some games use $3603-05 range for protection. |
| 919 | AM_RANGE(0x4000, 0x4fff) AM_RAM | |
| 919 | AM_RANGE(0x4000, 0x4fff) AM_RAM | |
| 920 | 920 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 921 | 921 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| 922 | 922 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 931 | 931 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 932 | 932 | AM_RANGE(0x2000, 0x2000) AM_READNOP // some unknown reads |
| 933 | 933 | AM_RANGE(0x3e00, 0x3fff) AM_RAM // some games use $3e03-05 range for protection. |
| 934 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 934 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 935 | 935 | AM_RANGE(0x7000, 0x7fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 936 | 936 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 937 | 937 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 944 | 944 | AM_RANGE(0x2c01, 0x2c01) AM_WRITE(AY8910_write_port_0_w) |
| 945 | 945 | AM_RANGE(0x2e00, 0x2e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 946 | 946 | AM_RANGE(0x2e01, 0x2e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) |
| 947 | AM_RANGE(0x4000, 0x4fff) AM_RAM | |
| 947 | AM_RANGE(0x4000, 0x4fff) AM_RAM | |
| 948 | 948 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 949 | 949 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| 950 | 950 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 954 | 954 | AM_RANGE(0x1000, 0x1000) AM_READNOP // input port? |
| 955 | 955 | AM_RANGE(0x3000, 0x3004) AM_READNOP // input port? |
| 956 | 956 | AM_RANGE(0x5000, 0x5001) AM_READNOP // input port? |
| 957 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 957 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 958 | 958 | AM_RANGE(0x7000, 0x7fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 959 | 959 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 960 | 960 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 937 | 937 | #endif |
| 938 | 938 | #if 1 |
| 939 | 939 | /* hack for sound protection or time out function */ |
| 940 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r); | |
| 940 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r); | |
| 941 | 941 | #endif |
| 942 | 942 | } |
| 943 | 943 | |
| r2418 | r2419 | |
| 952 | 952 | #endif |
| 953 | 953 | #if 1 |
| 954 | 954 | /* hack for sound protection or time out function */ |
| 955 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r); | |
| 955 | memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r); | |
| 956 | 956 | #endif |
| 957 | 957 | } |
| 958 | 958 |
| r2418 | r2419 | |
|---|---|---|
| 291 | 291 | static ADDRESS_MAP_START( nmg5_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 292 | 292 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 293 | 293 | AM_RANGE(0x120000, 0x12ffff) AM_RAM |
| 294 | AM_RANGE(0x140000, 0x1407ff) AM_RAM | |
| 294 | AM_RANGE(0x140000, 0x1407ff) AM_RAM | |
| 295 | 295 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 296 | 296 | AM_RANGE(0x180000, 0x180001) AM_WRITE(nmg5_soundlatch_w) |
| 297 | 297 | AM_RANGE(0x180002, 0x180003) AM_WRITENOP |
| r2418 | r2419 | |
| 303 | 303 | AM_RANGE(0x18000e, 0x18000f) AM_WRITE(priority_reg_w) |
| 304 | 304 | AM_RANGE(0x300002, 0x300009) AM_WRITE(SMH_RAM) AM_BASE(&scroll_ram) |
| 305 | 305 | AM_RANGE(0x30000a, 0x30000f) AM_WRITENOP |
| 306 | AM_RANGE(0x320000, 0x321fff) AM_RAM AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 307 | AM_RANGE(0x322000, 0x323fff) AM_RAM AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 306 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 307 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 308 | 308 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&nmg5_bitmap) |
| 309 | 309 | ADDRESS_MAP_END |
| 310 | 310 | |
| 311 | 311 | static ADDRESS_MAP_START( pclubys_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 312 | 312 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 313 | 313 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 314 | AM_RANGE(0x440000, 0x4407ff) AM_RAM | |
| 314 | AM_RANGE(0x440000, 0x4407ff) AM_RAM | |
| 315 | 315 | AM_RANGE(0x460000, 0x4607ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 316 | 316 | AM_RANGE(0x480000, 0x480001) AM_WRITE(nmg5_soundlatch_w) |
| 317 | 317 | AM_RANGE(0x480002, 0x480003) AM_WRITENOP |
| r2418 | r2419 | |
| 322 | 322 | AM_RANGE(0x48000c, 0x48000d) AM_READ(input_port_2_word_r) |
| 323 | 323 | AM_RANGE(0x48000e, 0x48000f) AM_WRITE(priority_reg_w) |
| 324 | 324 | AM_RANGE(0x500002, 0x500009) AM_WRITE(SMH_RAM) AM_BASE(&scroll_ram) |
| 325 | AM_RANGE(0x520000, 0x521fff) AM_RAM AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 326 | AM_RANGE(0x522000, 0x523fff) AM_RAM AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 325 | AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram) | |
| 326 | AM_RANGE(0x522000, 0x523fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram) | |
| 327 | 327 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&nmg5_bitmap) |
| 328 | 328 | ADDRESS_MAP_END |
| 329 | 329 |
| r2418 | r2419 | |
|---|---|---|
| 153 | 153 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 154 | 154 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 155 | 155 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(mario_state, spriteram) AM_SIZE_MEMBER(mario_state, spriteram_size) /* physical sprite ram */ |
| 156 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 156 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 157 | 157 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */ |
| 158 | 158 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */ |
| 159 | 159 | AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w) |
| r2418 | r2419 | |
| 172 | 172 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 173 | 173 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 174 | 174 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(mario_state, spriteram) AM_SIZE_MEMBER(mario_state, spriteram_size) /* physical sprite ram */ |
| 175 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 175 | AM_RANGE(0x7400, 0x77ff) AM_R | |
| 176 | 176 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") |
| 177 | 177 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") |
| 178 | 178 | AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w) |
| r2418 | r2419 | |
|---|---|---|
| 175 | 175 | AM_RANGE(0x080000, 0x0fffff) AM_ROM |
| 176 | 176 | AM_RANGE(0x100000, 0x100fff) AM_READWRITE(K053247_word_r, K053247_word_w) |
| 177 | 177 | AM_RANGE(0x101000, 0x101fff) AM_RAM |
| 178 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 178 | AM_RANGE(0x104000, 0x104fff) AM_RAM | |
| 179 | 179 | AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w) |
| 180 | 180 | AM_RANGE(0x108020, 0x108027) AM_WRITE(K053246_word_w) |
| 181 | 181 | AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w) |
| r2418 | r2419 | |
|---|---|---|
| 151 | 151 | static ADDRESS_MAP_START( atarifb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 152 | 152 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 153 | 153 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 154 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 154 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 155 | 155 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 156 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(SMH_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 157 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(SMH_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 156 | AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 157 | AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 158 | 158 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 159 | 159 | AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 160 | 160 | AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb_out1_w) /* OUT 1 */ |
| r2418 | r2419 | |
| 172 | 172 | static ADDRESS_MAP_START( atarifb4_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 173 | 173 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 174 | 174 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 175 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 175 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 176 | 176 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 177 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(SMH_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 178 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(SMH_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 177 | AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 178 | AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 179 | 179 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 180 | 180 | AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 181 | 181 | AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb4_out1_w) /* OUT 1 */ |
| r2418 | r2419 | |
| 194 | 194 | static ADDRESS_MAP_START( abaseb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 195 | 195 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 196 | 196 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 197 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 197 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 198 | 198 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 199 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(SMH_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 200 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(SMH_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 199 | AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 200 | AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 201 | 201 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 202 | 202 | AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 203 | 203 | AM_RANGE(0x2001, 0x2001) AM_WRITE(abaseb_out1_w) /* OUT 1 */ |
| r2418 | r2419 | |
| 215 | 215 | static ADDRESS_MAP_START( soccer_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 216 | 216 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 217 | 217 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 218 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 218 | AM_RANGE(0x0200, 0x025f) AM_R | |
| 219 | 219 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 220 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(SMH_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 221 | AM_RANGE(0x0800, 0x0bbf) AM_READWRITE(SMH_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 220 | AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 221 | AM_RANGE(0x0800, 0x0bbf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 222 | 222 | AM_RANGE(0x0bc0, 0x0bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 223 | 223 | AM_RANGE(0x1000, 0x1000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 224 | 224 | AM_RANGE(0x1001, 0x1001) AM_WRITE(soccer_out1_w) /* OUT 1 */ |
| r2418 | r2419 | |
|---|---|---|
| 65 | 65 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 66 | 66 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 67 | 67 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 68 | AM_RANGE(0xa000, 0xa3ff) AM_RAM | |
| 68 | AM_RANGE(0xa000, 0xa3ff) AM_RAM | |
| 69 | 69 | ADDRESS_MAP_END |
| 70 | 70 | |
| 71 | 71 |
| r2418 | r2419 | |
|---|---|---|
| 194 | 194 | |
| 195 | 195 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 196 | 196 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 197 | AM_RANGE(0x0200, 0x07ff) AM_RAM | |
| 197 | AM_RANGE(0x0200, 0x07ff) AM_RAM | |
| 198 | 198 | AM_RANGE(0x0800, 0x0800) AM_READWRITE(videopin_misc_r, videopin_note_dvsr_w) |
| 199 | 199 | AM_RANGE(0x0801, 0x0801) AM_WRITE(videopin_led_w) |
| 200 | 200 | AM_RANGE(0x0802, 0x0802) AM_WRITE(watchdog_reset_w) |
| r2418 | r2419 | |
|---|---|---|
| 112 | 112 | AM_RANGE(0x00ff, 0x00ff) AM_READ(vblank_r) /* HACK!!!! see init_exprraid below */ |
| 113 | 113 | AM_RANGE(0x0000, 0x05ff) AM_RAM AM_BASE(&main_ram) |
| 114 | 114 | AM_RANGE(0x0600, 0x07ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 115 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(exprraid_videoram_w) AM_BASE(&videoram) | |
| 116 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(exprraid_colorram_w) AM_BASE(&colorram) | |
| 115 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(exprraid_videoram_w) AM_BASE(&videoram) | |
| 116 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(exprraid_colorram_w) AM_BASE(&colorram) | |
| 117 | 117 | AM_RANGE(0x1317, 0x1317) AM_READNOP // ??? |
| 118 | 118 | AM_RANGE(0x1700, 0x1700) AM_READNOP // ??? |
| 119 | 119 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_1_r) /* DSW 0 */ |
| r2418 | r2419 | |
| 598 | 598 | |
| 599 | 599 | static DRIVER_INIT( wexpresb ) |
| 600 | 600 | { |
| 601 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, vblank_r); | |
| 601 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, vblank_r); | |
| 602 | 602 | exprraid_gfx_expand(); |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | static DRIVER_INIT( wexpresc ) |
| 606 | 606 | { |
| 607 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFC0, 0xFFC0, 0, 0, vblank_r); | |
| 607 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFC0, 0xFFC0, 0, 0, vblank_r); | |
| 608 | 608 | exprraid_gfx_expand(); |
| 609 | 609 | } |
| 610 | 610 |
| r2418 | r2419 | |
|---|---|---|
| 133 | 133 | AM_RANGE(0x41c000, 0x41dfff) AM_RAM AM_BASE(&textram) |
| 134 | 134 | AM_RANGE(0x41e000, 0x41ffff) AM_RAM AM_BASE(&charram) |
| 135 | 135 | AM_RANGE(0x400000, 0x4fffff) AM_RAM AM_BASE(&unkram)// video stuff, 460000 - video regs ? |
| 136 | AM_RANGE(0x500000, 0x501fff) AM_RAM | |
| 136 | AM_RANGE(0x500000, 0x501fff) AM_RAM | |
| 137 | 137 | AM_RANGE(0x502000, 0x503fff) AM_RAM |
| 138 | 138 | AM_RANGE(0x700000, 0x70000f) AM_READ(drill_unk_r) AM_WRITE(SMH_NOP) // i/o |
| 139 | 139 | AM_RANGE(0x600000, 0x600001) AM_READ(YM2610_status_port_0_A_lsb_r) AM_WRITE(YM2610_control_port_0_A_lsb_w) |
| r2418 | r2419 | |
|---|---|---|
| 770 | 770 | static DRIVER_INIT( popflame ) |
| 771 | 771 | { |
| 772 | 772 | /* install a handler to catch protection checks */ |
| 773 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0, popflame_protection_r); | |
| 773 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0, popflame_protection_r); | |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | static int question_offset = 0; |
| r2418 | r2419 | |
| 799 | 799 | static DRIVER_INIT( trvmstr ) |
| 800 | 800 | { |
| 801 | 801 | /* install questions' handlers */ |
| 802 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, trvmstr_questions_r); | |
| 803 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc002, 0, 0, trvmstr_questions_w); | |
| 802 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc002, 0, 0, trvmstr_questions_r, trvmstr_questions_w); | |
| 804 | 803 | } |
| 805 | 804 | |
| 806 | 805 |
| r2418 | r2419 | |
|---|---|---|
| 18 | 18 | #include "machine/idectrl.h" |
| 19 | 19 | #include "cpu/i386/i386.h" |
| 20 | 20 | |
| 21 | static void ide_interrupt(const device_config *device, int state); | |
| 22 | ||
| 21 | 23 | static UINT32 *cga_ram; |
| 22 | 24 | static UINT32 *bios_ram; |
| 23 | 25 | |
| r2418 | r2419 | |
| 277 | 279 | |
| 278 | 280 | |
| 279 | 281 | |
| 280 | static READ32_HANDLER( ide | |
| 282 | static READ32_DEVICE_HANDLER( ide | |
| 281 | 283 | { |
| 282 | return ide_controller32_ | |
| 284 | return ide_controller32_ | |
| 283 | 285 | } |
| 284 | 286 | |
| 285 | static WRITE32_HANDLER( ide | |
| 287 | static WRITE32_DEVICE_HANDLER( ide | |
| 286 | 288 | { |
| 287 | ide_controller32_ | |
| 289 | ide_controller32_ | |
| 288 | 290 | } |
| 289 | 291 | |
| 290 | static READ32_HANDLER( fdc_r ) | |
| 292 | static READ32_DEVICE_HANDLER( fdc_r ) | |
| 291 | 293 | { |
| 292 | return ide_controller32_ | |
| 294 | return ide_controller32_ | |
| 293 | 295 | } |
| 294 | 296 | |
| 295 | static WRITE32_HANDLER( fdc_w ) | |
| 297 | static WRITE32_DEVICE_HANDLER( fdc_w ) | |
| 296 | 298 | { |
| 297 | 299 | //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask); |
| 298 | ide_controller32_ | |
| 300 | ide_controller32_ | |
| 299 | 301 | } |
| 300 | 302 | |
| 301 | 303 | |
| r2418 | r2419 | |
| 454 | 456 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", taitowlf_pic8259_32le_r, taitowlf_pic8259_32le_w) |
| 455 | 457 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 456 | 458 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| 457 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide | |
| 459 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide | |
| 458 | 460 | AM_RANGE(0x0300, 0x03af) AM_NOP |
| 459 | 461 | AM_RANGE(0x03b0, 0x03df) AM_NOP |
| 460 | 462 | AM_RANGE(0x0278, 0x027b) AM_WRITE(pnp_config_w) |
| 461 | AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w) | |
| 463 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w) | |
| 462 | 464 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE(pnp_data_w) |
| 463 | 465 | AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w) |
| 464 | 466 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 538 | 540 | |
| 539 | 541 | cpunum_set_irq_callback(0, irq_callback); |
| 540 | 542 | |
| 541 | taitowlf_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 542 | taitowlf_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 543 | taitowlf_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 544 | taitowlf_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 545 | taitowlf_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 543 | taitowlf_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 544 | taitowlf_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 545 | taitowlf_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 546 | taitowlf_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 547 | taitowlf_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 546 | 548 | } |
| 547 | 549 | |
| 548 | 550 | |
| r2418 | r2419 | |
| 626 | 628 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 627 | 629 | MDRV_DEVICE_CONFIG( taitowlf_pic8259_2_config ) |
| 628 | 630 | |
| 631 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 632 | ||
| 629 | 633 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 630 | 634 | |
| 631 | 635 | /* video hardware */ |
| r2418 | r2419 | |
| 666 | 670 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 667 | 671 | } |
| 668 | 672 | |
| 669 | static void ide_interrupt(int state) | |
| 673 | static void ide_interrupt(const device_config *device, int state) | |
| 670 | 674 | { |
| 671 | 675 | pic8259_set_irq_line(taitowlf_devices.pic8259_2, 6, state); |
| 672 | 676 | } |
| r2418 | r2419 | |
| 680 | 684 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, taitowlf_get_out2 |
| 681 | 685 | }; |
| 682 | 686 | |
| 683 | static const struct ide_interface ide_intf = | |
| 684 | { | |
| 685 | ide_interrupt | |
| 686 | }; | |
| 687 | ||
| 688 | 687 | static void taitowlf_set_keyb_int(int state) { |
| 689 | 688 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 690 | 689 | } |
| r2418 | r2419 | |
| 703 | 702 | pci_add_device(0, 7, &intel82371ab); |
| 704 | 703 | |
| 705 | 704 | kbdc8042_init(&at8042); |
| 706 | ||
| 707 | ide_controller_init(0, &ide_intf); | |
| 708 | 705 | } |
| 709 | 706 | |
| 710 | 707 | /*****************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 793 | 793 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 794 | 794 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 795 | 795 | AM_RANGE(0xa00000, 0xa0000f) AM_RAM AM_BASE(&suprtrio_control) |
| 796 | AM_RANGE(0xa20000, 0xa20fff) AM_RAM AM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 797 | AM_RANGE(0xa22000, 0xa22fff) AM_RAM AM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 798 | AM_RANGE(0xcf0000, 0xcf05ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 796 | AM_RANGE(0xa20000, 0xa20fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE(&tumblepb_pf1_data) | |
| 797 | AM_RANGE(0xa22000, 0xa22fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE(&tumblepb_pf2_data) | |
| 798 | AM_RANGE(0xcf0000, 0xcf05ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 799 | 799 | |
| 800 | 800 | AM_RANGE(0xe00000, 0xe00001) AM_READ(input_port_0_word_r) AM_WRITE(suprtrio_tilebank_w) |
| 801 | 801 | |
| r2418 | r2419 | |
| 3329 | 3329 | tumblepb_patch_code(0x000132); |
| 3330 | 3330 | #endif |
| 3331 | 3331 | |
| 3332 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w ); | |
| 3332 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w ); | |
| 3333 | 3333 | |
| 3334 | 3334 | } |
| 3335 | 3335 | |
| r2418 | r2419 | |
| 3366 | 3366 | static DRIVER_INIT ( bcstory ) |
| 3367 | 3367 | { |
| 3368 | 3368 | tumblepb_gfx1_rearrange(); |
| 3369 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here?? | |
| 3369 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here?? | |
| 3370 | 3370 | } |
| 3371 | 3371 | |
| 3372 | 3372 | |
| r2418 | r2419 | |
| 3608 | 3608 | |
| 3609 | 3609 | HCROM[0x1e228/2] = 0x4e75; |
| 3610 | 3610 | |
| 3611 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x1407ff, 0, 0, SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them | |
| 3611 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x1407ff, 0, 0, SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them | |
| 3612 | 3612 | |
| 3613 | 3613 | |
| 3614 | 3614 | { |
| r2418 | r2419 | |
| 3674 | 3674 | DRIVER_INIT_CALL(htchctch); |
| 3675 | 3675 | |
| 3676 | 3676 | /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */ |
| 3677 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w); | |
| 3677 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w); | |
| 3678 | 3678 | |
| 3679 | 3679 | /* slightly different banking */ |
| 3680 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, chokchok_tilebank_w); | |
| 3680 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, chokchok_tilebank_w); | |
| 3681 | 3681 | } |
| 3682 | 3682 | |
| 3683 | 3683 | static DRIVER_INIT( wlstar ) |
| r2418 | r2419 | |
| 3685 | 3685 | DRIVER_INIT_CALL(htchctch); |
| 3686 | 3686 | |
| 3687 | 3687 | /* slightly different banking */ |
| 3688 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w); | |
| 3688 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w); | |
| 3689 | 3689 | } |
| 3690 | 3690 | |
| 3691 | 3691 | static DRIVER_INIT ( dquizgo ) |
| r2418 | r2419 | |
|---|---|---|
| 749 | 749 | AM_RANGE(0x980000, 0x980001) AM_RAM /* ADC0844 */ |
| 750 | 750 | AM_RANGE(0x9a0000, 0x9a0007) AM_READWRITE(tms_host_r, tms_host_w) /* TMS34010 Interface */ |
| 751 | 751 | AM_RANGE(0x9c0000, 0x9c0001) AM_RAM /* ????? Write: 80, A0 and 00 (8-bit high byte) */ |
| 752 | AM_RANGE(0x9e0000, 0x9e00cf) AM_R | |
| 752 | AM_RANGE(0x9e0000, 0x9e00cf) AM_R | |
| 753 | 753 | AM_RANGE(0xa00000, 0xa000cf) AM_READWRITE(m68681_r, m68681_w) AM_BASE(&m68681_base) /* 68681 UART */ |
| 754 | 754 | AM_RANGE(0xa20000, 0xa20001) AM_RAM /* XY joystick input - sign? */ |
| 755 | 755 | AM_RANGE(0xa40002, 0xa40003) AM_RAM /* XY joystick input - actual values */ |
| r2418 | r2419 | |
| 762 | 762 | AM_RANGE(0x00800000, 0x00bfffff) AM_RAM /* 512kB Main DRAM */ |
| 763 | 763 | AM_RANGE(0x00c00000, 0x00c0000f) AM_READ(input_port_2_word_r) /* TI Monitor Mode switch */ |
| 764 | 764 | AM_RANGE(0x00e00000, 0x00e0000f) AM_RAM //WRITE(mystery2_w) /* CREGCLK ??? byte write here. */ |
| 765 | AM_RANGE(0x02000000, 0x0200ffff) AM_R | |
| 765 | AM_RANGE(0x02000000, 0x0200ffff) AM_R | |
| 766 | 766 | AM_RANGE(0x02600000, 0x0260000f) AM_RAM // XFER3dk???? 16-bit write |
| 767 | 767 | AM_RANGE(0x02c00000, 0x02c0003f) AM_READ(ti_uart_r) /* SCN UART */ |
| 768 | 768 | AM_RANGE(0x02e00000, 0x02e0003f) AM_WRITE(ti_uart_w) |
| r2418 | r2419 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x700) AM_RAM |
| 153 | 153 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x700) AM_READWRITE(ultratnk_wram_r, ultratnk_wram_w) |
| 154 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x400) AM_R | |
| 154 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x400) AM_R | |
| 155 | 155 | |
| 156 | 156 | AM_RANGE(0x1000, 0x17ff) AM_READ(input_port_0_r) |
| 157 | 157 | AM_RANGE(0x1800, 0x1fff) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 84 | 84 | AM_RANGE(0x80000, 0x8ffff) AM_ROMBANK(1) /* Quiz F1 only */ |
| 85 | 85 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 86 | AM_RANGE(0xd0000, 0xdffff) AM_RAM AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) | |
| 87 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 86 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE(&m90_video_data) | |
| 87 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 88 | 88 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 89 | 89 | ADDRESS_MAP_END |
| 90 | 90 | |
| r2418 | r2419 | |
| 92 | 92 | AM_RANGE(0x00000, 0x3ffff) AM_ROM |
| 93 | 93 | AM_RANGE(0x6000e, 0x60fff) AM_RAM AM_BASE(&spriteram16) |
| 94 | 94 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 95 | AM_RANGE(0xd0000, 0xdffff) AM_RAM AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) | |
| 96 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 95 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE(&m90_video_data) | |
| 96 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 97 | 97 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 98 | 98 | ADDRESS_MAP_END |
| 99 | 99 |
| r2418 | r2419 | |
|---|---|---|
| 446 | 446 | static DRIVER_INIT( gunbustr ) |
| 447 | 447 | { |
| 448 | 448 | /* Speedup handler */ |
| 449 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x203acc, 0x203acf, 0, 0, main_cycle_r); | |
| 449 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x203acc, 0x203acf, 0, 0, main_cycle_r); | |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | GAME( 1992, gunbustr, 0, gunbustr, gunbustr, gunbustr, ORIENTATION_FLIP_X, "Taito Corporation", "Gunbuster (Japan)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static ADDRESS_MAP_START( scotrsht_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 45 | AM_RANGE(0x0000, 0x07ff) AM_READWRITE(SMH_RAM, scotrsht_colorram_w) AM_BASE(&colorram) | |
| 46 | AM_RANGE(0x0800, 0x0fff) AM_READWRITE(SMH_RAM, scotrsht_videoram_w) AM_BASE(&videoram) | |
| 45 | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(scotrsht_colorram_w) AM_BASE(&colorram) | |
| 46 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(scotrsht_videoram_w) AM_BASE(&videoram) | |
| 47 | 47 | AM_RANGE(0x1000, 0x10bf) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */ |
| 48 | 48 | AM_RANGE(0x10c0, 0x1fff) AM_RAM /* work ram */ |
| 49 | 49 | AM_RANGE(0x2000, 0x201f) AM_RAM AM_BASE(&scotrsht_scroll) /* scroll registers */ |
| r2418 | r2419 | |
|---|---|---|
| 1018 | 1018 | static DRIVER_INIT( condor ) |
| 1019 | 1019 | { |
| 1020 | 1020 | /* additional inputs for coinage */ |
| 1021 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, port_tag_to_handler8("DSW1") ); | |
| 1021 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, port_tag_to_handler8("DSW1") ); | |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | static DRIVER_INIT( survival ) |
| r2418 | r2419 | |
|---|---|---|
| 529 | 529 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 530 | 530 | AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 531 | 531 | AM_RANGE(0xe100, 0xe7ff) AM_RAM |
| 532 | AM_RANGE(0xe800, 0xefff) AM_R | |
| 532 | AM_RANGE(0xe800, 0xefff) AM_R | |
| 533 | 533 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 534 | 534 | ADDRESS_MAP_END |
| 535 | 535 | |
| 536 | 536 | static ADDRESS_MAP_START( pbillian_port_map, ADDRESS_SPACE_IO, 8 ) |
| 537 | AM_RANGE(0x0000, 0x01ff) AM_R | |
| 537 | AM_RANGE(0x0000, 0x01ff) AM_R | |
| 538 | 538 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 539 | 539 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 540 | 540 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r2418 | r2419 | |
| 548 | 548 | ADDRESS_MAP_END |
| 549 | 549 | |
| 550 | 550 | static ADDRESS_MAP_START( hotsmash_port_map, ADDRESS_SPACE_IO, 8 ) |
| 551 | AM_RANGE(0x0000, 0x01ff) AM_R | |
| 551 | AM_RANGE(0x0000, 0x01ff) AM_R | |
| 552 | 552 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 553 | 553 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 554 | 554 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r2418 | r2419 | |
| 562 | 562 | ADDRESS_MAP_END |
| 563 | 563 | |
| 564 | 564 | static ADDRESS_MAP_START( sqix_port_map, ADDRESS_SPACE_IO, 8 ) |
| 565 | AM_RANGE(0x0000, 0x00ff) AM_R | |
| 565 | AM_RANGE(0x0000, 0x00ff) AM_R | |
| 566 | 566 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 567 | 567 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 568 | 568 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r2418 | r2419 | |
| 572 | 572 | AM_RANGE(0x0408, 0x0408) AM_READ(mcu_acknowledge_r) |
| 573 | 573 | AM_RANGE(0x0410, 0x0410) AM_WRITE(superqix_0410_w) /* ROM bank, NMI enable, tile bank */ |
| 574 | 574 | AM_RANGE(0x0418, 0x0418) AM_READ(nmi_ack_r) |
| 575 | AM_RANGE(0x0800, 0x77ff) AM_READWRITE(SMH_RAM, superqix_bitmapram_w) AM_BASE(&superqix_bitmapram) | |
| 576 | AM_RANGE(0x8800, 0xf7ff) AM_READWRITE(SMH_RAM, superqix_bitmapram2_w) AM_BASE(&superqix_bitmapram2) | |
| 575 | AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE(&superqix_bitmapram) | |
| 576 | AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE(&superqix_bitmapram2) | |
| 577 | 577 | ADDRESS_MAP_END |
| 578 | 578 | |
| 579 | 579 | static ADDRESS_MAP_START( bootleg_port_map, ADDRESS_SPACE_IO, 8 ) |
| 580 | AM_RANGE(0x0000, 0x00ff) AM_R | |
| 580 | AM_RANGE(0x0000, 0x00ff) AM_R | |
| 581 | 581 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 582 | 582 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 583 | 583 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r2418 | r2419 | |
| 587 | 587 | AM_RANGE(0x0408, 0x0408) AM_WRITE(bootleg_flipscreen_w) |
| 588 | 588 | AM_RANGE(0x0410, 0x0410) AM_WRITE(superqix_0410_w) /* ROM bank, NMI enable, tile bank */ |
| 589 | 589 | AM_RANGE(0x0418, 0x0418) AM_READ(input_port_2_r) |
| 590 | AM_RANGE(0x0800, 0x77ff) AM_READWRITE(SMH_RAM, superqix_bitmapram_w) AM_BASE(&superqix_bitmapram) | |
| 591 | AM_RANGE(0x8800, 0xf7ff) AM_READWRITE(SMH_RAM, superqix_bitmapram2_w) AM_BASE(&superqix_bitmapram2) | |
| 590 | AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE(&superqix_bitmapram) | |
| 591 | AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE(&superqix_bitmapram2) | |
| 592 | 592 | ADDRESS_MAP_END |
| 593 | 593 | |
| 594 | 594 |
| r2418 | r2419 | |
|---|---|---|
| 429 | 429 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 430 | 430 | AM_RANGE(0x8000, 0x87ff) AM_RAM // 8V |
| 431 | 431 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE(ram_8w_r, ram_8w_w) AM_BASE(&ram_8w) // 8W |
| 432 | AM_RANGE(0x9000, 0x97ff) AM_RAM | |
| 432 | AM_RANGE(0x9000, 0x97ff) AM_RAM | |
| 433 | 433 | AM_RANGE(0xc000, 0xdfff) AM_ROM |
| 434 | 434 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(pc10_prot_r, pc10_prot_w) |
| 435 | 435 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | static UINT32 *rom_base; |
| 211 | 211 | |
| 212 | static const struct ide_interface ide_intf = | |
| 213 | { | |
| 214 | jaguar_external_int | |
| 215 | }; | |
| 216 | 212 | |
| 217 | 213 | |
| 218 | ||
| 219 | 214 | /************************************* |
| 220 | 215 | * |
| 221 | 216 | * Machine init |
| r2418 | r2419 | |
| 259 | 254 | cojag_sound_reset(); |
| 260 | 255 | |
| 261 | 256 | /* reset the IDE controller */ |
| 262 | | |
| 257 | | |
| 263 | 258 | } |
| 264 | 259 | |
| 265 | 260 | |
| r2418 | r2419 | |
| 360 | 355 | return jaguar_wave_rom[offset]; |
| 361 | 356 | } |
| 362 | 357 | |
| 358 | ||
| 359 | ||
| 363 | 360 | /************************************* |
| 364 | 361 | * |
| 365 | 362 | * Input ports |
| r2418 | r2419 | |
| 692 | 689 | AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1) |
| 693 | 690 | AM_RANGE(0x04800000, 0x04bfffff) AM_ROMBANK(1) |
| 694 | 691 | AM_RANGE(0x04c00000, 0x04dfffff) AM_ROMBANK(2) |
| 695 | AM_RANGE(0x04e00000, 0x04e003ff) AM_READWRITE(ide_controller32_ | |
| 692 | AM_RANGE(0x04e00000, 0x04e003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_ | |
| 696 | 693 | AM_RANGE(0x04f00000, 0x04f003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 697 | 694 | AM_RANGE(0x04f00400, 0x04f007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2) |
| 698 | 695 | AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| r2418 | r2419 | |
| 726 | 723 | AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w) |
| 727 | 724 | AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w) |
| 728 | 725 | AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK(2) |
| 729 | AM_RANGE(0xe00000, 0xe003ff) AM_READWRITE(ide_controller32_ | |
| 726 | AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_ | |
| 730 | 727 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 731 | 728 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2) |
| 732 | 729 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| r2418 | r2419 | |
| 754 | 751 | AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE(1) |
| 755 | 752 | AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK(8) |
| 756 | 753 | AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK(9) |
| 757 | AM_RANGE(0xe00000, 0xe003ff) AM_READWRITE(ide_controller32_ | |
| 754 | AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_ | |
| 758 | 755 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 759 | 756 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE(2) |
| 760 | 757 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| r2418 | r2419 | |
| 1007 | 1004 | MDRV_MACHINE_RESET(cojag) |
| 1008 | 1005 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 1009 | 1006 | |
| 1007 | MDRV_IDE_CONTROLLER_ADD("ide", 0, jaguar_external_int) | |
| 1008 | ||
| 1010 | 1009 | /* video hardware */ |
| 1011 | 1010 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 1012 | 1011 | |
| r2418 | r2419 | |
| 1391 | 1390 | |
| 1392 | 1391 | /* install synchronization hooks for GPU */ |
| 1393 | 1392 | if (cojag_is_r3000) |
| 1394 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w); | |
| 1393 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w); | |
| 1395 | 1394 | else |
| 1396 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w); | |
| 1397 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r); | |
| 1395 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w); | |
| 1396 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r); | |
| 1398 | 1397 | gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4]; |
| 1399 | 1398 | gpu_spin_pc = 0xf03000 + spin_pc; |
| 1400 | 1399 | |
| 1401 | 1400 | /* init the sound system and install DSP speedups */ |
| 1402 | cojag_sound_init(); | |
| 1403 | ||
| 1404 | /* spin up the hard disk */ | |
| 1405 | ide_controller_init(0, &ide_intf); | |
| 1401 | cojag_sound_init(machine); | |
| 1406 | 1402 | } |
| 1407 | 1403 | |
| 1408 | 1404 | |
| r2418 | r2419 | |
| 1412 | 1408 | |
| 1413 | 1409 | #if ENABLE_SPEEDUP_HACKS |
| 1414 | 1410 | /* install speedup for main CPU */ |
| 1415 | main_speedup = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w); | |
| 1411 | main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w); | |
| 1416 | 1412 | #endif |
| 1417 | 1413 | } |
| 1418 | 1414 | |
| r2418 | r2419 | |
| 1424 | 1420 | #if ENABLE_SPEEDUP_HACKS |
| 1425 | 1421 | /* install speedup for main CPU */ |
| 1426 | 1422 | main_speedup_max_cycles = 120; |
| 1427 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r); | |
| 1423 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r); | |
| 1428 | 1424 | #endif |
| 1429 | 1425 | } |
| 1430 | 1426 | |
| r2418 | r2419 | |
| 1438 | 1434 | #if ENABLE_SPEEDUP_HACKS |
| 1439 | 1435 | /* install speedup for main CPU */ |
| 1440 | 1436 | main_speedup_max_cycles = 120; |
| 1441 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r); | |
| 1437 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r); | |
| 1442 | 1438 | #endif |
| 1443 | 1439 | } |
| 1444 | 1440 | |
| r2418 | r2419 | |
| 1452 | 1448 | |
| 1453 | 1449 | #if ENABLE_SPEEDUP_HACKS |
| 1454 | 1450 | /* install speedup for main CPU */ |
| 1455 | main_speedup = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w); | |
| 1451 | main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w); | |
| 1456 | 1452 | #endif |
| 1457 | 1453 | } |
| 1458 | 1454 | |
| r2418 | r2419 | |
| 1467 | 1463 | #if ENABLE_SPEEDUP_HACKS |
| 1468 | 1464 | /* install speedup for main CPU */ |
| 1469 | 1465 | main_speedup_max_cycles = 120; |
| 1470 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r); | |
| 1466 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r); | |
| 1471 | 1467 | #endif |
| 1472 | 1468 | } |
| 1473 | 1469 | |
| r2418 | r2419 | |
| 1479 | 1475 | #if ENABLE_SPEEDUP_HACKS |
| 1480 | 1476 | /* install speedup for main CPU */ |
| 1481 | 1477 | main_speedup_max_cycles = 200; |
| 1482 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r); | |
| 1478 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r); | |
| 1483 | 1479 | #endif |
| 1484 | 1480 | } |
| 1485 | 1481 | |
| r2418 | r2419 | |
| 1492 | 1488 | /* install speedup for main CPU */ |
| 1493 | 1489 | main_speedup_max_cycles = 200; |
| 1494 | 1490 | if (main_speedup_addr != 0) |
| 1495 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r); | |
| 1496 | main_gpu_wait = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r); | |
| 1491 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r); | |
| 1492 | main_gpu_wait = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r); | |
| 1497 | 1493 | #endif |
| 1498 | 1494 | } |
| 1499 | 1495 | |
| r2418 | r2419 | |
| 1512 | 1508 | #if ENABLE_SPEEDUP_HACKS |
| 1513 | 1509 | /* install speedup for main CPU */ |
| 1514 | 1510 | main_speedup_max_cycles = 50; |
| 1515 | main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r); | |
| 1511 | main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r); | |
| 1516 | 1512 | #endif |
| 1517 | 1513 | } |
| 1518 | 1514 |
| r2418 | r2419 | |
|---|---|---|
| 158 | 158 | AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE(atarigen_sound_upper_w) |
| 159 | 159 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r) |
| 160 | 160 | AM_RANGE(0xfe1000, 0xfe1fff) AM_READ(input_port_1_word_r) |
| 161 | AM_RANGE(0xfe8000, 0xfe8fff) AM_READWRITE(SMH_RAM, cyberbal_paletteram_1_w) AM_SHARE(1) AM_BASE(&cyberbal_paletteram_1) | |
| 162 | AM_RANGE(0xfec000, 0xfecfff) AM_READWRITE(SMH_RAM, cyberbal_paletteram_0_w) AM_SHARE(2) AM_BASE(&cyberbal_paletteram_0) | |
| 163 | AM_RANGE(0xff0000, 0xff1fff) AM_READWRITE(SMH_RAM, atarigen_playfield2_w) AM_SHARE(3) AM_BASE(&atarigen_playfield2) | |
| 164 | AM_RANGE(0xff2000, 0xff2fff) AM_READWRITE(SMH_RAM, atarigen_alpha2_w) AM_SHARE(4) AM_BASE(&atarigen_alpha2) | |
| 165 | AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE(SMH_RAM, atarimo_1_spriteram_w) AM_SHARE(5) AM_BASE(&atarimo_1_spriteram) | |
| 161 | AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(cyberbal_paletteram_1_w) AM_SHARE(1) AM_BASE(&cyberbal_paletteram_1) | |
| 162 | AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(cyberbal_paletteram_0_w) AM_SHARE(2) AM_BASE(&cyberbal_paletteram_0) | |
| 163 | AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(atarigen_playfield2_w) AM_SHARE(3) AM_BASE(&atarigen_playfield2) | |
| 164 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(atarigen_alpha2_w) AM_SHARE(4) AM_BASE(&atarigen_alpha2) | |
| 165 | AM_RANGE(0xff3000, 0xff37ff) AM_RAM_WRITE(atarimo_1_spriteram_w) AM_SHARE(5) AM_BASE(&atarimo_1_spriteram) | |
| 166 | 166 | AM_RANGE(0xff3800, 0xff3fff) AM_RAM AM_SHARE(6) |
| 167 | AM_RANGE(0xff4000, 0xff5fff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_SHARE(7) AM_BASE(&atarigen_playfield) | |
| 168 | AM_RANGE(0xff6000, 0xff6fff) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_SHARE(8) AM_BASE(&atarigen_alpha) | |
| 169 | AM_RANGE(0xff7000, 0xff77ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_SHARE(9) AM_BASE(&atarimo_0_spriteram) | |
| 167 | AM_RANGE(0xff4000, 0xff5fff) AM_RAM_WRITE(atarigen_playfield_w) AM_SHARE(7) AM_BASE(&atarigen_playfield) | |
| 168 | AM_RANGE(0xff6000, 0xff6fff) AM_RAM_WRITE(atarigen_alpha_w) AM_SHARE(8) AM_BASE(&atarigen_alpha) | |
| 169 | AM_RANGE(0xff7000, 0xff77ff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_SHARE(9) AM_BASE(&atarimo_0_spriteram) | |
| 170 | 170 | AM_RANGE(0xff7800, 0xff9fff) AM_RAM AM_SHARE(10) |
| 171 | AM_RANGE(0xffa000, 0xffbfff) AM_R | |
| 171 | AM_RANGE(0xffa000, 0xffbfff) AM_R | |
| 172 | 172 | AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE(12) |
| 173 | 173 | ADDRESS_MAP_END |
| 174 | 174 | |
| r2418 | r2419 | |
| 185 | 185 | AM_RANGE(0xfc0000, 0xfdffff) AM_WRITE(atarigen_video_int_ack_w) |
| 186 | 186 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r) |
| 187 | 187 | AM_RANGE(0xfe1000, 0xfe1fff) AM_READ(input_port_1_word_r) |
| 188 | AM_RANGE(0xfe8000, 0xfe8fff) AM_READWRITE(SMH_RAM, cyberbal_paletteram_1_w) AM_SHARE(1) | |
| 189 | AM_RANGE(0xfec000, 0xfecfff) AM_READWRITE(SMH_RAM, cyberbal_paletteram_0_w) AM_SHARE(2) | |
| 190 | AM_RANGE(0xff0000, 0xff1fff) AM_READWRITE(SMH_RAM, atarigen_playfield2_w) AM_SHARE(3) | |
| 191 | AM_RANGE(0xff2000, 0xff2fff) AM_READWRITE(SMH_RAM, atarigen_alpha2_w) AM_SHARE(4) | |
| 192 | AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE(SMH_RAM, atarimo_1_spriteram_w) AM_SHARE(5) | |
| 188 | AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(cyberbal_paletteram_1_w) AM_SHARE(1) | |
| 189 | AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(cyberbal_paletteram_0_w) AM_SHARE(2) | |
| 190 | AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(atarigen_playfield2_w) AM_SHARE(3) | |
| 191 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(atarigen_alpha2_w) AM_SHARE(4) | |
| 192 | AM_RANGE(0xff3000, 0xff37ff) AM_RAM_WRITE(atarimo_1_spriteram_w) AM_SHARE(5) | |
| 193 | 193 | AM_RANGE(0xff3800, 0xff3fff) AM_RAM AM_SHARE(6) |
| 194 | AM_RANGE(0xff4000, 0xff5fff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_SHARE(7) | |
| 195 | AM_RANGE(0xff6000, 0xff6fff) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_SHARE(8) | |
| 196 | AM_RANGE(0xff7000, 0xff77ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_SHARE(9) | |
| 194 | AM_RANGE(0xff4000, 0xff5fff) AM_RAM_WRITE(atarigen_playfield_w) AM_SHARE(7) | |
| 195 | AM_RANGE(0xff6000, 0xff6fff) AM_RAM_WRITE(atarigen_alpha_w) AM_SHARE(8) | |
| 196 | AM_RANGE(0xff7000, 0xff77ff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_SHARE(9) | |
| 197 | 197 | AM_RANGE(0xff7800, 0xff9fff) AM_RAM AM_SHARE(10) |
| 198 | 198 | AM_RANGE(0xffa000, 0xffbfff) AM_RAM AM_SHARE(11) |
| 199 | AM_RANGE(0xffc000, 0xffffff) AM_R | |
| 199 | AM_RANGE(0xffc000, 0xffffff) AM_R | |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| 202 | 202 | |
| r2418 | r2419 | |
| 255 | 255 | AM_RANGE(0xfc4000, 0xfc4003) AM_READ(special_port2_r) |
| 256 | 256 | AM_RANGE(0xfc6000, 0xfc6003) AM_READ(atarigen_sound_upper_r) |
| 257 | 257 | AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 258 | AM_RANGE(0xfca000, 0xfcafff) AM_R | |
| 258 | AM_RANGE(0xfca000, 0xfcafff) AM_R | |
| 259 | 259 | AM_RANGE(0xfd0000, 0xfd0003) AM_WRITE(atarigen_eeprom_enable_w) |
| 260 | 260 | AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE(atarigen_sound_reset_w) |
| 261 | 261 | AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w) |
| 262 | 262 | AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE(atarigen_video_int_ack_w) |
| 263 | 263 | AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE(atarigen_sound_upper_w) |
| 264 | 264 | AM_RANGE(0xfe0000, 0xfe0003) AM_READ(sound_state_r) |
| 265 | AM_RANGE(0xff0000, 0xff1fff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 266 | AM_RANGE(0xff2000, 0xff2fff) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 267 | AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 265 | AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 266 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 267 | AM_RANGE(0xff3000, 0xff37ff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 268 | 268 | AM_RANGE(0xff3800, 0xffffff) AM_RAM |
| 269 | 269 | ADDRESS_MAP_END |
| 270 | 270 |
| r2418 | r2419 | |
|---|---|---|
| 178 | 178 | AM_RANGE(0x04000, 0x04003) AM_READWRITE(lockon_crtc_r, lockon_crtc_w) |
| 179 | 179 | AM_RANGE(0x06000, 0x06001) AM_READ(input_port_0_word_r) |
| 180 | 180 | AM_RANGE(0x08000, 0x081ff) AM_RAM AM_BASE(&lockon_hud_ram) AM_SIZE(&lockon_hudram_size) |
| 181 | AM_RANGE(0x09000, 0x09fff) AM_R | |
| 181 | AM_RANGE(0x09000, 0x09fff) AM_R | |
| 182 | 182 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w) |
| 183 | 183 | AM_RANGE(0x0b000, 0x0bfff) AM_WRITE(lockon_rotate_w) |
| 184 | 184 | AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(lockon_fb_clut_w) |
| r2418 | r2419 | |
|---|---|---|
| 866 | 866 | |
| 867 | 867 | |
| 868 | 868 | static ADDRESS_MAP_START( superpac_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 869 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 869 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 870 | 870 | AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE(&mappy_spriteram) /* work RAM with embedded sprite RAM */ |
| 871 | 871 | AM_RANGE(0x2000, 0x2000) AM_READWRITE(superpac_flipscreen_r, superpac_flipscreen_w) |
| 872 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 872 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 873 | 873 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(namcoio_r, namcoio_w) /* custom I/O chips interface */ |
| 874 | 874 | AM_RANGE(0x5000, 0x500f) AM_WRITE(superpac_latch_w) /* various control bits */ |
| 875 | 875 | AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w) |
| r2418 | r2419 | |
| 877 | 877 | ADDRESS_MAP_END |
| 878 | 878 | |
| 879 | 879 | static ADDRESS_MAP_START( phozon_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 880 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 880 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 881 | 881 | AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE(&mappy_spriteram) AM_SHARE(3) /* shared RAM with CPU #2/sprite RAM*/ |
| 882 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 882 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 883 | 883 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(namcoio_r, namcoio_w) /* custom I/O chips interface */ |
| 884 | 884 | AM_RANGE(0x5000, 0x500f) AM_WRITE(phozon_latch_w) /* various control bits */ |
| 885 | 885 | AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w) /* watchdog reset */ |
| r2418 | r2419 | |
| 887 | 887 | ADDRESS_MAP_END |
| 888 | 888 | |
| 889 | 889 | static ADDRESS_MAP_START( mappy_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 890 | AM_RANGE(0x0000, 0x0fff) AM_R | |
| 890 | AM_RANGE(0x0000, 0x0fff) AM_R | |
| 891 | 891 | AM_RANGE(0x1000, 0x27ff) AM_RAM AM_BASE(&mappy_spriteram) /* work RAM with embedded sprite RAM */ |
| 892 | 892 | AM_RANGE(0x3800, 0x3fff) AM_WRITE(mappy_scroll_w) /* scroll */ |
| 893 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 893 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 894 | 894 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(namcoio_r, namcoio_w) /* custom I/O chips interface */ |
| 895 | 895 | AM_RANGE(0x5000, 0x500f) AM_WRITE(mappy_latch_w) /* various control bits */ |
| 896 | 896 | AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w) /* watchdog reset */ |
| r2418 | r2419 | |
| 899 | 899 | |
| 900 | 900 | |
| 901 | 901 | static ADDRESS_MAP_START( superpac_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 902 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 902 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 903 | 903 | AM_RANGE(0x2000, 0x200f) AM_WRITE(superpac_latch_w) /* various control bits */ |
| 904 | 904 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 905 | 905 | ADDRESS_MAP_END |
| 906 | 906 | |
| 907 | 907 | static ADDRESS_MAP_START( phozon_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 908 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 908 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 909 | 909 | AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */ |
| 910 | 910 | ADDRESS_MAP_END |
| 911 | 911 | |
| 912 | 912 | static ADDRESS_MAP_START( mappy_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 913 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 913 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 914 | 914 | AM_RANGE(0x2000, 0x200f) AM_WRITE(mappy_latch_w) /* various control bits */ |
| 915 | 915 | AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM code */ |
| 916 | 916 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 918 | 918 | |
| 919 | 919 | /* extra CPU only present in Phozon */ |
| 920 | 920 | static ADDRESS_MAP_START( phozon_cpu3_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 921 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 921 | AM_RANGE(0x0000, 0x07ff) AM_R | |
| 922 | 922 | AM_RANGE(0x0800, 0x1fff) AM_RAM AM_SHARE(3) /* shared RAM with CPU #2/sprite RAM*/ |
| 923 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 923 | AM_RANGE(0x4000, 0x43ff) AM_R | |
| 924 | 924 | AM_RANGE(0xa000, 0xa7ff) AM_RAM /* RAM */ |
| 925 | 925 | AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */ |
| 926 | 926 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 2128 | 2128 | However, removing the 15XX from the board causes sound to disappear completely, so |
| 2129 | 2129 | the DAC might be built-in after all. |
| 2130 | 2130 | */ |
| 2131 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w ); | |
| 2131 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w ); | |
| 2132 | 2132 | |
| 2133 | 2133 | DRIVER_INIT_CALL(58_56); |
| 2134 | 2134 | } |
| r2418 | r2419 | |
| 2136 | 2136 | static DRIVER_INIT( digdug2 ) |
| 2137 | 2137 | { |
| 2138 | 2138 | /* appears to not use the watchdog */ |
| 2139 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, SMH_NOP); | |
| 2139 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, SMH_NOP); | |
| 2140 | 2140 | DRIVER_INIT_CALL(58_56); |
| 2141 | 2141 | } |
| 2142 | 2142 |
| r2418 | r2419 | |
|---|---|---|
| 225 | 225 | static ADDRESS_MAP_START( rastan_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 226 | 226 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 227 | 227 | AM_RANGE(0x10c000, 0x10ffff) AM_RAM |
| 228 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 228 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 229 | 229 | AM_RANGE(0x350008, 0x350009) AM_WRITE(SMH_NOP) /* 0 only (often) ? */ |
| 230 | 230 | AM_RANGE(0x380000, 0x380001) AM_WRITE(rastan_spritectrl_w) /* sprite palette bank, coin counters & lockout */ |
| 231 | 231 | AM_RANGE(0x390000, 0x390001) AM_READ(input_port_0_word_r) |
| r2418 | r2419 | |
|---|---|---|
| 793 | 793 | |
| 794 | 794 | static DRIVER_INIT( tigeroad ) |
| 795 | 795 | { |
| 796 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, tigeroad_soundcmd_w); | |
| 796 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, tigeroad_soundcmd_w); | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | static DRIVER_INIT( f1dream ) |
| 800 | 800 | { |
| 801 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, f1dream_control_w); | |
| 801 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, f1dream_control_w); | |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 |
| r2418 | r2419 | |
|---|---|---|
| 261 | 261 | AM_RANGE(0xe000, 0xe1ff) AM_RAM |
| 262 | 262 | AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 263 | 263 | AM_RANGE(0xe300, 0xe3ff) AM_RAM AM_BASE(&wilytowr_scrollram) |
| 264 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_WRITE(wilytowr_videoram2_w) AM_BASE(&wilytowr_videoram2) | |
| 265 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_WRITE(wilytowr_videoram_w) AM_BASE(&videoram) | |
| 266 | AM_RANGE(0xec00, 0xefff) AM_RAM AM_WRITE(wilytowr_colorram_w) AM_BASE(&colorram) | |
| 264 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(wilytowr_videoram2_w) AM_BASE(&wilytowr_videoram2) | |
| 265 | AM_RANGE(0xe800, 0xebff) AM_RAM_WRITE(wilytowr_videoram_w) AM_BASE(&videoram) | |
| 266 | AM_RANGE(0xec00, 0xefff) AM_RAM_WRITE(wilytowr_colorram_w) AM_BASE(&colorram) | |
| 267 | 267 | AM_RANGE(0xf000, 0xf000) AM_WRITE(interrupt_enable_w) /* NMI enable */ |
| 268 | 268 | AM_RANGE(0xf002, 0xf002) AM_WRITE(wilytwr_flipscreen_w) |
| 269 | 269 | AM_RANGE(0xf003, 0xf003) AM_WRITE(wilytwr_palbank_w) |
| r2418 | r2419 | |
| 282 | 282 | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 283 | 283 | AM_RANGE(0xd200, 0xd2ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 284 | 284 | AM_RANGE(0xd300, 0xd3ff) AM_RAM AM_BASE(&wilytowr_scrollram) |
| 285 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(SMH_RAM, wilytowr_videoram2_w) AM_BASE(&wilytowr_videoram2) | |
| 286 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, wilytowr_videoram_w) AM_BASE(&videoram) | |
| 287 | AM_RANGE(0xdc00, 0xdfff) AM_READWRITE(SMH_RAM, wilytowr_colorram_w) AM_BASE(&colorram) | |
| 285 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(wilytowr_videoram2_w) AM_BASE(&wilytowr_videoram2) | |
| 286 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(wilytowr_videoram_w) AM_BASE(&videoram) | |
| 287 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(wilytowr_colorram_w) AM_BASE(&colorram) | |
| 288 | 288 | AM_RANGE(0xf000, 0xf000) AM_READNOP //sound status |
| 289 | 289 | AM_RANGE(0xf001, 0xf001) AM_READ(input_port_0_r) |
| 290 | 290 | AM_RANGE(0xf002, 0xf002) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 306 | 306 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 307 | 307 | AM_RANGE(0x3000, 0x3fff) AM_ROM |
| 308 | 308 | AM_RANGE(0x7000, 0x77ff) AM_RAM |
| 309 | AM_RANGE(0xc000, 0xdfff) AM_R | |
| 309 | AM_RANGE(0xc000, 0xdfff) AM_R | |
| 310 | 310 | AM_RANGE(0xa000, 0xbfff) AM_READWRITE(spaceg_colorram_r, SMH_RAM) AM_BASE(&unkram) |
| 311 | 311 | |
| 312 | 312 |
| r2418 | r2419 | |
|---|---|---|
| 461 | 461 | static ADDRESS_MAP_START( looping_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 462 | 462 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 463 | 463 | |
| 464 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 464 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 465 | 465 | |
| 466 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_R | |
| 466 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_R | |
| 467 | 467 | AM_RANGE(0x9840, 0x987f) AM_MIRROR(0x0700) AM_RAM AM_BASE_MEMBER(looping_state, spriteram) |
| 468 | 468 | AM_RANGE(0x9880, 0x98ff) AM_MIRROR(0x0700) AM_RAM |
| 469 | 469 | |
| r2418 | r2419 | |
| 781 | 781 | rom[i] = BITSWAP8(rom[i], 0,1,2,3,4,5,6,7); |
| 782 | 782 | |
| 783 | 783 | /* install protection handlers */ |
| 784 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7007, 0, 0, protection_r); | |
| 784 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7007, 0, 0, protection_r); | |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 |
| r2418 | r2419 | |
|---|---|---|
| 3823 | 3823 | static DRIVER_INIT( arescue ) |
| 3824 | 3824 | { |
| 3825 | 3825 | segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL); |
| 3826 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_r); | |
| 3827 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_w); | |
| 3826 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_r, arescue_dsp_w); | |
| 3828 | 3827 | |
| 3829 | 3828 | dual_pcb_comms = auto_malloc(0x1000); |
| 3830 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r); | |
| 3831 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_w); | |
| 3832 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave); | |
| 3829 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r, dual_pcb_comms_w); | |
| 3830 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave); | |
| 3833 | 3831 | |
| 3834 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810001, 0x810001, 0, 0, arescue_handshake_r); | |
| 3835 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x81000f, 0x81000f, 0, 0, arescue_slavebusy_r); | |
| 3832 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810001, 0x810001, 0, 0, arescue_handshake_r); | |
| 3833 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x81000f, 0x81000f, 0, 0, arescue_slavebusy_r); | |
| 3836 | 3834 | |
| 3837 | 3835 | } |
| 3838 | 3836 | |
| r2418 | r2419 | |
| 3842 | 3840 | segas32_common_init(extra_custom_io_r, NULL, NULL); |
| 3843 | 3841 | |
| 3844 | 3842 | /* install protection handlers */ |
| 3845 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa000ff, 0, 0, arabfgt_protection_r); | |
| 3846 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00100, 0xa0011f, 0, 0, arf_wakeup_protection_r); | |
| 3847 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, arabfgt_protection_w); | |
| 3843 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00100, 0xa0011f, 0, 0, arf_wakeup_protection_r); | |
| 3844 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, arabfgt_protection_r, arabfgt_protection_w); | |
| 3848 | 3845 | } |
| 3849 | 3846 | |
| 3850 | 3847 | |
| r2418 | r2419 | |
| 3854 | 3851 | |
| 3855 | 3852 | /* install protection handlers */ |
| 3856 | 3853 | system32_protram = auto_malloc (0x1000); |
| 3857 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20ba00, 0x20ba07, 0, 0, brival_protection_r); | |
| 3858 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, brival_protection_w); | |
| 3854 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20ba00, 0x20ba07, 0, 0, brival_protection_r); | |
| 3855 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, brival_protection_w); | |
| 3859 | 3856 | } |
| 3860 | 3857 | |
| 3861 | 3858 | |
| r2418 | r2419 | |
| 3864 | 3861 | segas32_common_init(extra_custom_io_r, NULL, NULL); |
| 3865 | 3862 | |
| 3866 | 3863 | /* install protection handlers */ |
| 3867 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_r); | |
| 3868 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_w); | |
| 3864 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_r, darkedge_protection_w); | |
| 3869 | 3865 | system32_prot_vblank = darkedge_fd1149_vblank; |
| 3870 | 3866 | } |
| 3871 | 3867 | |
| r2418 | r2419 | |
| 3874 | 3870 | segas32_common_init(NULL, NULL, NULL); |
| 3875 | 3871 | |
| 3876 | 3872 | /* install protection handlers */ |
| 3877 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_r); | |
| 3878 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_w); | |
| 3873 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_r, dbzvrvs_protection_w); | |
| 3879 | 3874 | } |
| 3880 | 3875 | |
| 3881 | 3876 | static WRITE16_HANDLER( f1en_comms_echo_w ) |
| r2418 | r2419 | |
| 3889 | 3884 | segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL); |
| 3890 | 3885 | |
| 3891 | 3886 | dual_pcb_comms = auto_malloc(0x1000); |
| 3892 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r); | |
| 3893 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_w); | |
| 3894 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave); | |
| 3887 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r, dual_pcb_comms_w); | |
| 3888 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave); | |
| 3895 | 3889 | |
| 3896 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810048, 0x810048, 0, 0, f1en_comms_echo_w); | |
| 3890 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810048, 0x810048, 0, 0, f1en_comms_echo_w); | |
| 3897 | 3891 | } |
| 3898 | 3892 | |
| 3899 | 3893 | |
| r2418 | r2419 | |
| 3908 | 3902 | segas32_common_init(extra_custom_io_r, NULL, NULL); |
| 3909 | 3903 | |
| 3910 | 3904 | decrypt_ga2_protrom(); |
| 3911 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_w); | |
| 3912 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_r); | |
| 3905 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_r, ga2_dpram_w); | |
| 3913 | 3906 | } |
| 3914 | 3907 | |
| 3915 | 3908 | |
| r2418 | r2419 | |
| 3984 | 3977 | static DRIVER_INIT( scross ) |
| 3985 | 3978 | { |
| 3986 | 3979 | segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL); |
| 3987 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xb0, 0xbf, 0, 0, scross_bank_w); | |
| 3980 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xb0, 0xbf, 0, 0, scross_bank_w); | |
| 3988 | 3981 | } |
| 3989 | 3982 | |
| 3990 | 3983 | |
| r2418 | r2419 | |
| 3999 | 3992 | segas32_common_init(sonic_custom_io_r, sonic_custom_io_w, NULL); |
| 4000 | 3993 | |
| 4001 | 3994 | /* install protection handlers */ |
| 4002 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20E5C4, 0x20E5C5, 0, 0, sonic_level_load_protection); | |
| 3995 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20E5C4, 0x20E5C5, 0, 0, sonic_level_load_protection); | |
| 4003 | 3996 | } |
| 4004 | 3997 | |
| 4005 | 3998 | |
| r2418 | r2419 | |
| 4024 | 4017 | static DRIVER_INIT( jleague ) |
| 4025 | 4018 | { |
| 4026 | 4019 | segas32_common_init(NULL, NULL, NULL); |
| 4027 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20F700, 0x20F705, 0, 0, jleague_protection_w); | |
| 4020 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20F700, 0x20F705, 0, 0, jleague_protection_w); | |
| 4028 | 4021 | } |
| 4029 | 4022 | |
| 4030 | 4023 |
| r2418 | r2419 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM |
| 137 | 137 | AM_RANGE(0x100000, 0x10ffff) AM_RAM // Main Ram |
| 138 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 138 | AM_RANGE(0x200000, 0x200fff) AM_R | |
| 139 | 139 | AM_RANGE(0x240000, 0x240fff) AM_RAM AM_BASE(&k3_spriteram_1) |
| 140 | 140 | AM_RANGE(0x280000, 0x280fff) AM_RAM AM_BASE(&k3_spriteram_2) |
| 141 | AM_RANGE(0x2c0000, 0x2c0fff) AM_R | |
| 141 | AM_RANGE(0x2c0000, 0x2c0fff) AM_R | |
| 142 | 142 | AM_RANGE(0x340000, 0x340001) AM_WRITE(k3_scrollx_w) |
| 143 | 143 | AM_RANGE(0x380000, 0x380001) AM_WRITE(k3_scrolly_w) |
| 144 | 144 | AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(k3_soundbanks_w) |
| r2418 | r2419 | |
|---|---|---|
| 325 | 325 | AM_RANGE(0xfea000, 0xfebfff) AM_READ(atarigen_sound_upper_r) |
| 326 | 326 | AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w) |
| 327 | 327 | AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(atarigen_eeprom_enable_w) |
| 328 | AM_RANGE(0xffc000, 0xffc3ff) AM_READWRITE(SMH_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 329 | AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 330 | AM_RANGE(0xfff000, 0xfff1ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram) | |
| 328 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 329 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 330 | AM_RANGE(0xfff000, 0xfff1ff) AM_RAM_WRITE(atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram) | |
| 331 | 331 | AM_RANGE(0xfff200, 0xffffff) AM_RAM |
| 332 | 332 | ADDRESS_MAP_END |
| 333 | 333 | |
| r2418 | r2419 | |
| 589 | 589 | |
| 590 | 590 | AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w) |
| 591 | 591 | AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(atarigen_eeprom_enable_w) |
| 592 | AM_RANGE(0xffc000, 0xffc3ff) AM_READWRITE(SMH_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 593 | AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 594 | AM_RANGE(0xfff000, 0xfff1ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram) | |
| 592 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16) | |
| 593 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) | |
| 594 | AM_RANGE(0xfff000, 0xfff1ff) AM_RAM_WRITE(atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram) | |
| 595 | 595 | AM_RANGE(0xfff200, 0xffffff) AM_RAM |
| 596 | 596 | ADDRESS_MAP_END |
| 597 | 597 |
| r2418 | r2419 | |
|---|---|---|
| 1595 | 1595 | |
| 1596 | 1596 | static DRIVER_INIT( tigerh ) |
| 1597 | 1597 | { |
| 1598 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_r ); | |
| 1599 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_w ); | |
| 1598 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_r, tigerh_mcu_w ); | |
| 1600 | 1599 | |
| 1601 | 1600 | } |
| 1602 | 1601 | |
| r2418 | r2419 | |
| 1608 | 1607 | |
| 1609 | 1608 | static DRIVER_INIT( getstar ) |
| 1610 | 1609 | { |
| 1611 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_r ); | |
| 1612 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w ); | |
| 1610 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_r ); | |
| 1611 | // memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w ); | |
| 1613 | 1612 | } |
| 1614 | 1613 | |
| 1615 | 1614 | static DRIVER_INIT( getstarb ) |
| 1616 | 1615 | { |
| 1617 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_e803_r ); | |
| 1616 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_e803_r ); | |
| 1618 | 1617 | } |
| 1619 | 1618 | |
| 1620 | 1619 | static READ8_HANDLER( gtstarba_port_0_read ) |
| r2418 | r2419 | |
| 1642 | 1641 | |
| 1643 | 1642 | static DRIVER_INIT( gtstarba ) |
| 1644 | 1643 | { |
| 1645 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0, 0x0, 0, 0, gtstarba_port_0_read ); | |
| 1646 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc80f, 0, 0, gtstarba_dpram_r ); | |
| 1644 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0, 0x0, 0, 0, gtstarba_port_0_read ); | |
| 1645 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc80f, 0, 0, gtstarba_dpram_r ); | |
| 1647 | 1646 | } |
| 1648 | 1647 | |
| 1649 | 1648 | |
| r2418 | r2419 | |
| 1674 | 1673 | static DRIVER_INIT( slapfigh ) |
| 1675 | 1674 | { |
| 1676 | 1675 | slapfigh_prot_pos = 0; |
| 1677 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, slapfigh_mcu_r ); | |
| 1678 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w ); | |
| 1676 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, slapfigh_mcu_r ); | |
| 1677 | // memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w ); | |
| 1679 | 1678 | } |
| 1680 | 1679 | |
| 1681 | 1680 |
| r2418 | r2419 | |
|---|---|---|
| 325 | 325 | static ADDRESS_MAP_START( spaceint_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 326 | 326 | AM_RANGE(0x0000, 0x17ff) AM_ROM |
| 327 | 327 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 328 | AM_RANGE(0x4000, 0x5fff) AM_R | |
| 328 | AM_RANGE(0x4000, 0x5fff) AM_R | |
| 329 | 329 | ADDRESS_MAP_END |
| 330 | 330 | |
| 331 | 331 |
| r2418 | r2419 | |
|---|---|---|
| 1230 | 1230 | |
| 1231 | 1231 | static DRIVER_INIT( soldivid ) |
| 1232 | 1232 | { |
| 1233 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, soldivid_speedup_r ); | |
| 1233 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, soldivid_speedup_r ); | |
| 1234 | 1234 | use_factory_eeprom=EEPROM_0; |
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | 1237 | static DRIVER_INIT( s1945ii ) |
| 1238 | 1238 | { |
| 1239 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, s1945ii_speedup_r ); | |
| 1239 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, s1945ii_speedup_r ); | |
| 1240 | 1240 | use_factory_eeprom=EEPROM_DEFAULT; |
| 1241 | 1241 | } |
| 1242 | 1242 | |
| r2418 | r2419 | |
| 1244 | 1244 | { |
| 1245 | 1245 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 1246 | 1246 | memory_set_bankptr(1,&RAM[0x100000]); |
| 1247 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, daraku_speedup_r ); | |
| 1247 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, daraku_speedup_r ); | |
| 1248 | 1248 | use_factory_eeprom=EEPROM_DARAKU; |
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | static DRIVER_INIT( sbomberb ) |
| 1252 | 1252 | { |
| 1253 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, sbomberb_speedup_r ); | |
| 1253 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, sbomberb_speedup_r ); | |
| 1254 | 1254 | use_factory_eeprom=EEPROM_DEFAULT; |
| 1255 | 1255 | } |
| 1256 | 1256 | |
| r2418 | r2419 | |
| 1258 | 1258 | { |
| 1259 | 1259 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 1260 | 1260 | memory_set_bankptr(1,&RAM[0x100000]); |
| 1261 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x604000c, 0x604000f, 0, 0, gunbird2_speedup_r ); | |
| 1261 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604000c, 0x604000f, 0, 0, gunbird2_speedup_r ); | |
| 1262 | 1262 | use_factory_eeprom=EEPROM_DEFAULT; |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| r2418 | r2419 | |
| 1266 | 1266 | { |
| 1267 | 1267 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 1268 | 1268 | memory_set_bankptr(1,&RAM[0x100000]); |
| 1269 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, s1945iii_speedup_r ); | |
| 1269 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, s1945iii_speedup_r ); | |
| 1270 | 1270 | use_factory_eeprom=EEPROM_S1945III; |
| 1271 | 1271 | } |
| 1272 | 1272 | |
| 1273 | 1273 | static DRIVER_INIT( dragnblz ) |
| 1274 | 1274 | { |
| 1275 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, dragnblz_speedup_r ); | |
| 1275 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, dragnblz_speedup_r ); | |
| 1276 | 1276 | use_factory_eeprom=EEPROM_DRAGNBLZ; |
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | static DRIVER_INIT( gnbarich ) |
| 1280 | 1280 | { |
| 1281 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, gnbarich_speedup_r ); | |
| 1281 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, gnbarich_speedup_r ); | |
| 1282 | 1282 | use_factory_eeprom=EEPROM_GNBARICH; |
| 1283 | 1283 | } |
| 1284 | 1284 | |
| 1285 | 1285 | static DRIVER_INIT( mjgtaste ) |
| 1286 | 1286 | { |
| 1287 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, mjgtaste_speedup_r ); | |
| 1287 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, mjgtaste_speedup_r ); | |
| 1288 | 1288 | use_factory_eeprom=EEPROM_MJGTASTE; |
| 1289 | 1289 | /* needs to install mahjong controls too (can select joystick in test mode tho) */ |
| 1290 | 1290 | } |
| r2418 | r2419 | |
|---|---|---|
| 290 | 290 | AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w) |
| 291 | 291 | AM_RANGE(0x260060, 0x260061) AM_WRITE(atarigen_eeprom_enable_w) |
| 292 | 292 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w) |
| 293 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 293 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 294 | 294 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(offtwall_atarivc_r, offtwall_atarivc_w) AM_BASE(&atarivc_data) |
| 295 | AM_RANGE(0x3f4000, 0x3f5eff) AM_R | |
| 295 | AM_RANGE(0x3f4000, 0x3f5eff) AM_R | |
| 296 | 296 | AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_BASE(&atarivc_eof_data) |
| 297 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE(SMH_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 298 | AM_RANGE(0x3f6000, 0x3f7fff) AM_READWRITE(SMH_RAM, atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 297 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_RAM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram) | |
| 298 | AM_RANGE(0x3f6000, 0x3f7fff) AM_RAM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 299 | 299 | AM_RANGE(0x3f8000, 0x3fcfff) AM_RAM |
| 300 | AM_RANGE(0x3fd000, 0x3fd7ff) AM_R | |
| 300 | AM_RANGE(0x3fd000, 0x3fd7ff) AM_R | |
| 301 | 301 | AM_RANGE(0x3fd800, 0x3fffff) AM_RAM |
| 302 | 302 | ADDRESS_MAP_END |
| 303 | 303 | |
| r2418 | r2419 | |
| 506 | 506 | atarijsa_init(machine, 3, 0x0040); |
| 507 | 507 | |
| 508 | 508 | /* install son-of-slapstic workarounds */ |
| 509 | spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r); | |
| 510 | bankswitch_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x037ec2, 0x037f39, 0, 0, bankswitch_r); | |
| 511 | unknown_verify_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fdf1e, 0x3fdf1f, 0, 0, unknown_verify_r); | |
| 509 | spritecache_count = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r); | |
| 510 | bankswitch_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x037ec2, 0x037f39, 0, 0, bankswitch_r); | |
| 511 | unknown_verify_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fdf1e, 0x3fdf1f, 0, 0, unknown_verify_r); | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| r2418 | r2419 | |
| 518 | 518 | atarijsa_init(machine, 3, 0x0040); |
| 519 | 519 | |
| 520 | 520 | /* install son-of-slapstic workarounds */ |
| 521 | spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r); | |
| 522 | bankswitch_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x037eca, 0x037f43, 0, 0, bankswitch_r); | |
| 523 | unknown_verify_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fdf24, 0x3fdf25, 0, 0, unknown_verify_r); | |
| 521 | spritecache_count = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r); | |
| 522 | bankswitch_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x037eca, 0x037f43, 0, 0, bankswitch_r); | |
| 523 | unknown_verify_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fdf24, 0x3fdf25, 0, 0, unknown_verify_r); | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 |
| r2418 | r2419 | |
|---|---|---|
| 88 | 88 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 89 | 89 | if ((data & 1) == 0) |
| 90 | 90 | /* overlay disabled, map RAM on 0x000000 */ |
| 91 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 91 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 92 | 92 | |
| 93 | 93 | else |
| 94 | 94 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 95 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 95 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 |
| r2418 | r2419 | |
|---|---|---|
| 705 | 705 | AM_RANGE(0x000000, 0x00ffff) AM_ROM // ROM area is written several times (dev system?) |
| 706 | 706 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) // nvram is for gekisou only |
| 707 | 707 | AM_RANGE(0x080000, 0x080fff) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit |
| 708 | AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM | |
| 708 | AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM | |
| 709 | 709 | AM_RANGE(0x0c0200, 0x0c0fff) AM_RAM |
| 710 | 710 | AM_RANGE(0x100000, 0x100001) AM_READ(equites_spriteram_kludge_r) |
| 711 | 711 | AM_RANGE(0x100000, 0x1001ff) AM_RAM AM_BASE(&spriteram16) |
| r2418 | r2419 | |
| 741 | 741 | AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(splndrbt_bg_scrolly_w) |
| 742 | 742 | AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(mcu_r, mcu_w) // 8-bit |
| 743 | 743 | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit |
| 744 | AM_RANGE(0x400000, 0x4007ff) AM_RAM | |
| 744 | AM_RANGE(0x400000, 0x4007ff) AM_RAM | |
| 745 | 745 | AM_RANGE(0x400800, 0x400fff) AM_RAM |
| 746 | 746 | AM_RANGE(0x600000, 0x6000ff) AM_RAM AM_BASE(&spriteram16) // sprite RAM 0,1 |
| 747 | 747 | AM_RANGE(0x600100, 0x6001ff) AM_RAM AM_BASE(&spriteram16_2) // sprite RAM 2 (8-bit) |
| r2418 | r2419 | |
| 1822 | 1822 | unpack_region(REGION_GFX3); |
| 1823 | 1823 | |
| 1824 | 1824 | // install special handlers for unknown device (protection?) |
| 1825 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x580000, 0x580001, 0, 0, gekisou_unknown_0_w); | |
| 1826 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x5a0000, 0x5a0001, 0, 0, gekisou_unknown_1_w); | |
| 1825 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x580000, 0x580001, 0, 0, gekisou_unknown_0_w); | |
| 1826 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5a0000, 0x5a0001, 0, 0, gekisou_unknown_1_w); | |
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | 1829 | static DRIVER_INIT( splndrbt ) |
| r2418 | r2419 | |
| 1836 | 1836 | unpack_region(REGION_GFX3); |
| 1837 | 1837 | |
| 1838 | 1838 | #if HVOLTAGE_DEBUG |
| 1839 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r); | |
| 1839 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r); | |
| 1840 | 1840 | #endif |
| 1841 | 1841 | } |
| 1842 | 1842 |
| r2418 | r2419 | |
|---|---|---|
| 6790 | 6790 | { |
| 6791 | 6791 | DRIVER_INIT_CALL(neogeo); |
| 6792 | 6792 | |
| 6793 | fatfury2_install_protection(); | |
| 6793 | fatfury2_install_protection(machine); | |
| 6794 | 6794 | } |
| 6795 | 6795 | |
| 6796 | 6796 | static DRIVER_INIT( mslugx ) |
| r2418 | r2419 | |
| 6805 | 6805 | neogeo_fixed_layer_bank_type = 1; |
| 6806 | 6806 | kof99_neogeo_gfx_decrypt(0x00); |
| 6807 | 6807 | DRIVER_INIT_CALL(neogeo); |
| 6808 | kof99_install_protection(); | |
| 6808 | kof99_install_protection(machine); | |
| 6809 | 6809 | } |
| 6810 | 6810 | |
| 6811 | 6811 | static DRIVER_INIT( garou ) |
| r2418 | r2419 | |
| 6814 | 6814 | neogeo_fixed_layer_bank_type = 1; |
| 6815 | 6815 | kof99_neogeo_gfx_decrypt(0x06); |
| 6816 | 6816 | DRIVER_INIT_CALL(neogeo); |
| 6817 | garou_install_protection(); | |
| 6817 | garou_install_protection(machine); | |
| 6818 | 6818 | } |
| 6819 | 6819 | |
| 6820 | 6820 | static DRIVER_INIT( garouo ) |
| r2418 | r2419 | |
| 6823 | 6823 | neogeo_fixed_layer_bank_type = 1; |
| 6824 | 6824 | kof99_neogeo_gfx_decrypt(0x06); |
| 6825 | 6825 | DRIVER_INIT_CALL(neogeo); |
| 6826 | garouo_install_protection(); | |
| 6826 | garouo_install_protection(machine); | |
| 6827 | 6827 | } |
| 6828 | 6828 | |
| 6829 | 6829 | static DRIVER_INIT( garoubl ) |
| r2418 | r2419 | |
| 6839 | 6839 | neogeo_fixed_layer_bank_type = 1; |
| 6840 | 6840 | kof99_neogeo_gfx_decrypt(0xad); |
| 6841 | 6841 | DRIVER_INIT_CALL(neogeo); |
| 6842 | mslug3_install_protection(); | |
| 6842 | mslug3_install_protection(machine); | |
| 6843 | 6843 | } |
| 6844 | 6844 | |
| 6845 | 6845 | static DRIVER_INIT( kof2000 ) |
| r2418 | r2419 | |
| 6848 | 6848 | neogeo_fixed_layer_bank_type = 2; |
| 6849 | 6849 | kof2000_neogeo_gfx_decrypt(0x00); |
| 6850 | 6850 | DRIVER_INIT_CALL(neogeo); |
| 6851 | kof2000_install_protection(); | |
| 6851 | kof2000_install_protection(machine); | |
| 6852 | 6852 | } |
| 6853 | 6853 | |
| 6854 | 6854 | static DRIVER_INIT( kof2001 ) |
| r2418 | r2419 | |
| 6939 | 6939 | { |
| 6940 | 6940 | kof98_decrypt_68k(); |
| 6941 | 6941 | DRIVER_INIT_CALL(neogeo); |
| 6942 | install_kof98_protection(); | |
| 6942 | install_kof98_protection(machine); | |
| 6943 | 6943 | } |
| 6944 | 6944 | |
| 6945 | 6945 | static DRIVER_INIT( rotd ) |
| r2418 | r2419 | |
| 7009 | 7009 | neogeo_fixed_layer_bank_type = 1; |
| 7010 | 7010 | kof2000_neogeo_gfx_decrypt(0x19); |
| 7011 | 7011 | DRIVER_INIT_CALL(neogeo); |
| 7012 | install_pvc_protection(); | |
| 7012 | install_pvc_protection(machine); | |
| 7013 | 7013 | } |
| 7014 | 7014 | |
| 7015 | 7015 | static DRIVER_INIT( ms5pcb ) |
| r2418 | r2419 | |
| 7021 | 7021 | svcpcb_s1data_decrypt(); |
| 7022 | 7022 | neo_pcm2_swap(2); |
| 7023 | 7023 | DRIVER_INIT_CALL(neogeo); |
| 7024 | install_pvc_protection(); | |
| 7024 | install_pvc_protection(machine); | |
| 7025 | 7025 | } |
| 7026 | 7026 | |
| 7027 | 7027 | static DRIVER_INIT( ms5plus ) |
| r2418 | r2419 | |
| 7032 | 7032 | neogeo_bootleg_sx_decrypt(1); |
| 7033 | 7033 | neogeo_fixed_layer_bank_type = 1; |
| 7034 | 7034 | DRIVER_INIT_CALL(neogeo); |
| 7035 | install_ms5plus_protection(); | |
| 7035 | install_ms5plus_protection(machine); | |
| 7036 | 7036 | } |
| 7037 | 7037 | |
| 7038 | 7038 | |
| r2418 | r2419 | |
| 7055 | 7055 | neo_pcm2_swap(3); |
| 7056 | 7056 | neogeo_fixed_layer_bank_type = 2; |
| 7057 | 7057 | DRIVER_INIT_CALL(neogeo); |
| 7058 | install_pvc_protection(); | |
| 7058 | install_pvc_protection(machine); | |
| 7059 | 7059 | } |
| 7060 | 7060 | |
| 7061 | 7061 | static DRIVER_INIT( svc ) |
| r2418 | r2419 | |
| 7065 | 7065 | neogeo_fixed_layer_bank_type = 2; |
| 7066 | 7066 | kof2000_neogeo_gfx_decrypt(0x57); |
| 7067 | 7067 | DRIVER_INIT_CALL(neogeo); |
| 7068 | install_pvc_protection(); | |
| 7068 | install_pvc_protection(machine); | |
| 7069 | 7069 | } |
| 7070 | 7070 | |
| 7071 | 7071 | static DRIVER_INIT( svcboot ) |
| r2418 | r2419 | |
| 7073 | 7073 | svcboot_px_decrypt(); |
| 7074 | 7074 | svcboot_cx_decrypt(); |
| 7075 | 7075 | DRIVER_INIT_CALL(neogeo); |
| 7076 | install_pvc_protection(); | |
| 7076 | install_pvc_protection(machine); | |
| 7077 | 7077 | } |
| 7078 | 7078 | |
| 7079 | 7079 | static DRIVER_INIT( svcplus ) |
| r2418 | r2419 | |
| 7102 | 7102 | svcboot_cx_decrypt(); |
| 7103 | 7103 | svcsplus_px_hack(); |
| 7104 | 7104 | DRIVER_INIT_CALL(neogeo); |
| 7105 | install_pvc_protection(); | |
| 7105 | install_pvc_protection(machine); | |
| 7106 | 7106 | } |
| 7107 | 7107 | |
| 7108 | 7108 | static DRIVER_INIT( samsho5 ) |
| r2418 | r2419 | |
| 7134 | 7134 | neo_pcm2_swap(5); |
| 7135 | 7135 | neogeo_fixed_layer_bank_type = 2; |
| 7136 | 7136 | DRIVER_INIT_CALL(neogeo); |
| 7137 | install_pvc_protection(); | |
| 7138 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, SMH_BANK6 ); // 512k bios | |
| 7137 | install_pvc_protection(machine); | |
| 7138 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, SMH_BANK6 ); // 512k bios | |
| 7139 | 7139 | } |
| 7140 | 7140 | |
| 7141 | 7141 | |
| r2418 | r2419 | |
| 7146 | 7146 | neogeo_fixed_layer_bank_type = 2; |
| 7147 | 7147 | kof2000_neogeo_gfx_decrypt(0x9d); |
| 7148 | 7148 | DRIVER_INIT_CALL(neogeo); |
| 7149 | install_pvc_protection(); | |
| 7149 | install_pvc_protection(machine); | |
| 7150 | 7150 | } |
| 7151 | 7151 | |
| 7152 | 7152 | static DRIVER_INIT( kof2003b ) |
| r2418 | r2419 | |
| 7154 | 7154 | // kof2003b_sx_decrypt(); |
| 7155 | 7155 | neogeo_bootleg_sx_decrypt(1); |
| 7156 | 7156 | DRIVER_INIT_CALL(neogeo); |
| 7157 | kof2003b_install_protection(); | |
| 7157 | kof2003b_install_protection(machine); | |
| 7158 | 7158 | } |
| 7159 | 7159 | |
| 7160 | 7160 | static DRIVER_INIT( kof2k3pl ) |
| r2418 | r2419 | |
| 7163 | 7163 | //decrypt_ms5plus_s1(); |
| 7164 | 7164 | neogeo_bootleg_sx_decrypt(1); |
| 7165 | 7165 | DRIVER_INIT_CALL(neogeo); |
| 7166 | kf2k3pl_install_protection(); | |
| 7166 | kf2k3pl_install_protection(machine); | |
| 7167 | 7167 | } |
| 7168 | 7168 | |
| 7169 | 7169 | |
| r2418 | r2419 | |
| 7173 | 7173 | // kof2k3up_sx_decrypt(); |
| 7174 | 7174 | neogeo_bootleg_sx_decrypt(2); |
| 7175 | 7175 | DRIVER_INIT_CALL(neogeo); |
| 7176 | kof2k3up_install_protection(); | |
| 7176 | kof2k3up_install_protection(machine); | |
| 7177 | 7177 | } |
| 7178 | 7178 | |
| 7179 | 7179 | |
| r2418 | r2419 | |
| 7199 | 7199 | extra_ram = auto_malloc(0x2000); |
| 7200 | 7200 | state_save_register_global_pointer(extra_ram, 0x2000 / 2); |
| 7201 | 7201 | |
| 7202 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 7202 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 7203 | 7203 | memory_set_bankptr(NEOGEO_BANK_EXTRA_RAM, extra_ram); |
| 7204 | 7204 | |
| 7205 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); | |
| 7206 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); | |
| 7205 | // memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); | |
| 7206 | // memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); | |
| 7207 | 7207 | |
| 7208 | 7208 | DRIVER_INIT_CALL(neogeo); |
| 7209 | 7209 | } |
| r2418 | r2419 | |
| 7216 | 7216 | extra_ram = auto_malloc(0x2000); |
| 7217 | 7217 | state_save_register_global_pointer(extra_ram, 0x2000 / 2); |
| 7218 | 7218 | |
| 7219 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 7219 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 7220 | 7220 | memory_set_bankptr(NEOGEO_BANK_EXTRA_RAM, extra_ram); |
| 7221 | 7221 | |
| 7222 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); | |
| 7223 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); | |
| 7222 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); | |
| 7223 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); | |
| 7224 | 7224 | |
| 7225 | 7225 | DRIVER_INIT_CALL(neogeo); |
| 7226 | 7226 | } |
| r2418 | r2419 | |
| 7229 | 7229 | static DRIVER_INIT( kog ) |
| 7230 | 7230 | { |
| 7231 | 7231 | /* overlay cartridge ROM */ |
| 7232 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0ffffe, 0x0fffff, 0, 0, port_tag_to_handler16("JUMPER") ); | |
| 7232 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0ffffe, 0x0fffff, 0, 0, port_tag_to_handler16("JUMPER") ); | |
| 7233 | 7233 | |
| 7234 | 7234 | kog_px_decrypt(); |
| 7235 | 7235 | neogeo_bootleg_sx_decrypt(1); |
| r2418 | r2419 | |
| 7242 | 7242 | { |
| 7243 | 7243 | decrypt_kof10th(); |
| 7244 | 7244 | DRIVER_INIT_CALL(neogeo); |
| 7245 | install_kof10th_protection(); | |
| 7245 | install_kof10th_protection(machine); | |
| 7246 | 7246 | } |
| 7247 | 7247 | |
| 7248 | 7248 | static DRIVER_INIT( kf10thep ) |
| r2418 | r2419 | |
| 7262 | 7262 | { |
| 7263 | 7263 | decrypt_cthd2003(); |
| 7264 | 7264 | DRIVER_INIT_CALL(neogeo); |
| 7265 | patch_cthd2003(); | |
| 7265 | patch_cthd2003(machine); | |
| 7266 | 7266 | } |
| 7267 | 7267 | |
| 7268 | 7268 | static DRIVER_INIT ( ct2k3sp ) |
| 7269 | 7269 | { |
| 7270 | 7270 | decrypt_ct2k3sp(); |
| 7271 | 7271 | DRIVER_INIT_CALL(neogeo); |
| 7272 | patch_cthd2003(); | |
| 7272 | patch_cthd2003(machine); | |
| 7273 | 7273 | } |
| 7274 | 7274 | |
| 7275 | 7275 | static DRIVER_INIT ( ct2k3sa ) |
| r2418 | r2419 | |
|---|---|---|
| 171 | 171 | static ADDRESS_MAP_START( gradius3_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 172 | 172 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 173 | 173 | AM_RANGE(0x040000, 0x043fff) AM_RAM |
| 174 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 174 | AM_RANGE(0x080000, 0x080fff) AM_R | |
| 175 | 175 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(cpuA_ctrl_w) /* halt cpu B, irq enable, priority, coin counters, other? */ |
| 176 | 176 | AM_RANGE(0x0c8000, 0x0c8001) AM_READ(input_port_0_word_r) |
| 177 | 177 | AM_RANGE(0x0c8002, 0x0c8003) AM_READ(input_port_1_word_r) |
| r2418 | r2419 | |
| 185 | 185 | AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE(sound_irq_w) |
| 186 | 186 | AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE(1) |
| 187 | 187 | AM_RANGE(0x14c000, 0x153fff) AM_READWRITE(K052109_halfword_r, K052109_halfword_w) |
| 188 | AM_RANGE(0x180000, 0x19ffff) AM_R | |
| 188 | AM_RANGE(0x180000, 0x19ffff) AM_R | |
| 189 | 189 | ADDRESS_MAP_END |
| 190 | 190 | |
| 191 | 191 | |
| r2418 | r2419 | |
| 195 | 195 | AM_RANGE(0x140000, 0x140001) AM_WRITE(cpuB_irqenable_w) |
| 196 | 196 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE(1) |
| 197 | 197 | AM_RANGE(0x24c000, 0x253fff) AM_READWRITE(K052109_halfword_r, K052109_halfword_w) |
| 198 | AM_RANGE(0x280000, 0x29ffff) AM_R | |
| 198 | AM_RANGE(0x280000, 0x29ffff) AM_R | |
| 199 | 199 | AM_RANGE(0x2c0000, 0x2c000f) AM_READWRITE(K051937_halfword_r, K051937_halfword_w) |
| 200 | 200 | AM_RANGE(0x2c0800, 0x2c0fff) AM_READWRITE(K051960_halfword_r, K051960_halfword_w) |
| 201 | 201 | AM_RANGE(0x400000, 0x5fffff) AM_READ(gradius3_gfxrom_r) /* gfx ROMs are mapped here, and copied to RAM */ |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | static ADDRESS_MAP_START( decocass_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 88 | AM_RANGE(0x0000, 0x5fff) AM_READWRITE(SMH_RAM, ram_w) AM_BASE(&decocass_rambase) | |
| 89 | AM_RANGE(0x6000, 0xbfff) AM_READWRITE(SMH_RAM, charram_w) AM_BASE(&decocass_charram) /* still RMS3 RAM */ | |
| 90 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(SMH_RAM, fgvideoram_w) AM_BASE(&decocass_fgvideoram) AM_SIZE(&decocass_fgvideoram_size) /* DSP3 RAM */ | |
| 91 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(SMH_RAM, fgcolorram_w) AM_BASE(&decocass_colorram) AM_SIZE(&decocass_colorram_size) | |
| 88 | AM_RANGE(0x0000, 0x5fff) AM_RAM_WRITE(ram_w) AM_BASE(&decocass_rambase) | |
| 89 | AM_RANGE(0x6000, 0xbfff) AM_RAM_WRITE(charram_w) AM_BASE(&decocass_charram) /* still RMS3 RAM */ | |
| 90 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(fgvideoram_w) AM_BASE(&decocass_fgvideoram) AM_SIZE(&decocass_fgvideoram_size) /* DSP3 RAM */ | |
| 91 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(fgcolorram_w) AM_BASE(&decocass_colorram) AM_SIZE(&decocass_colorram_size) | |
| 92 | 92 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(mirrorvideoram_r, mirrorvideoram_w) |
| 93 | 93 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(mirrorcolorram_r, mirrorcolorram_w) |
| 94 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(SMH_RAM, tileram_w) AM_BASE(&decocass_tileram) AM_SIZE(&decocass_tileram_size) | |
| 95 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, objectram_w) AM_BASE(&decocass_objectram) AM_SIZE(&decocass_objectram_size) | |
| 96 | AM_RANGE(0xe000, 0xe0ff) AM_READWRITE(SMH_RAM, decocass_paletteram_w) AM_BASE(&paletteram) | |
| 94 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(tileram_w) AM_BASE(&decocass_tileram) AM_SIZE(&decocass_tileram_size) | |
| 95 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(objectram_w) AM_BASE(&decocass_objectram) AM_SIZE(&decocass_objectram_size) | |
| 96 | AM_RANGE(0xe000, 0xe0ff) AM_RAM_WRITE(decocass_paletteram_w) AM_BASE(&paletteram) | |
| 97 | 97 | AM_RANGE(0xe300, 0xe300) AM_READWRITE(input_port_7_r, decocass_watchdog_count_w) |
| 98 | 98 | AM_RANGE(0xe301, 0xe301) AM_READWRITE(input_port_8_r, decocass_watchdog_flip_w) |
| 99 | 99 | AM_RANGE(0xe302, 0xe302) AM_WRITE(decocass_color_missiles_w) |
| r2418 | r2419 | |
| 1138 | 1138 | decrypted2[i] = swap_bits_5_6(rom[i]); |
| 1139 | 1139 | |
| 1140 | 1140 | /* convert charram to a banked ROM */ |
| 1141 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, SMH_BANK1); | |
| 1142 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, decocass_de0091_w); | |
| 1141 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, SMH_BANK1, decocass_de0091_w); | |
| 1143 | 1142 | memory_configure_bank(1, 0, 1, decocass_charram, 0); |
| 1144 | 1143 | memory_configure_bank(1, 1, 1, memory_region(REGION_USER3), 0); |
| 1145 | 1144 | memory_configure_bank_decrypted(1, 0, 1, &decrypted[0x6000], 0); |
| r2418 | r2419 | |
| 1147 | 1146 | memory_set_bank(1, 0); |
| 1148 | 1147 | |
| 1149 | 1148 | /* install the bank selector */ |
| 1150 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe900, 0xe900, 0, 0, decocass_e900_w); | |
| 1149 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe900, 0xe900, 0, 0, decocass_e900_w); | |
| 1151 | 1150 | } |
| 1152 | 1151 | |
| 1153 | 1152 |
| r2418 | r2419 | |
|---|---|---|
| 155 | 155 | AM_RANGE(0x8fff, 0x8fff) AM_READ(input_port_3_r) |
| 156 | 156 | AM_RANGE(0x8ffc, 0x8ffc) AM_WRITE(jollyjgr_misc_w) |
| 157 | 157 | AM_RANGE(0x8ffd, 0x8ffd) AM_WRITE(jollyjgr_coin_lookout_w) |
| 158 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_WRITE(jollyjgr_videoram_w) AM_BASE(&videoram) | |
| 159 | AM_RANGE(0x9800, 0x983f) AM_RAM AM_WRITE(jollyjgr_attrram_w) AM_BASE(&colorram) | |
| 158 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(jollyjgr_videoram_w) AM_BASE(&videoram) | |
| 159 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(jollyjgr_attrram_w) AM_BASE(&colorram) | |
| 160 | 160 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(&spriteram) |
| 161 | 161 | AM_RANGE(0x9880, 0x9bff) AM_RAM |
| 162 | 162 | AM_RANGE(0xa000, 0xffff) AM_RAM AM_BASE(&jollyjgr_bitmap) |
| r2418 | r2419 | |
|---|---|---|
| 62 | 62 | static UINT16 v_ctrl; |
| 63 | 63 | static UINT32 obj_regs[0xa0/4]; |
| 64 | 64 | |
| 65 | static const UINT8 *ide_user_password; | |
| 66 | static const UINT8 *ide_master_password; | |
| 67 | ||
| 65 | 68 | #define DISABLE_VB_INT (!(v_ctrl & 0x8000)) |
| 66 | 69 | |
| 67 | 70 | |
| r2418 | r2419 | |
| 304 | 307 | #define IDE_STD_OFFSET (0x1f0/2) |
| 305 | 308 | #define IDE_ALT_OFFSET (0x3f6/2) |
| 306 | 309 | |
| 307 | static READ32_HANDLER( ide_std_r ) | |
| 310 | static READ32_DEVICE_HANDLER( ide_std_r ) | |
| 308 | 311 | { |
| 309 | 312 | if (ACCESSING_BITS_0_7) |
| 310 | return ide_controller16_ | |
| 313 | return ide_controller16_ | |
| 311 | 314 | else |
| 312 | return ide_controller16_ | |
| 315 | return ide_controller16_ | |
| 313 | 316 | } |
| 314 | 317 | |
| 315 | static WRITE32_HANDLER( ide_std_w ) | |
| 318 | static WRITE32_DEVICE_HANDLER( ide_std_w ) | |
| 316 | 319 | { |
| 317 | 320 | if (ACCESSING_BITS_0_7) |
| 318 | ide_controller16_ | |
| 321 | ide_controller16_ | |
| 319 | 322 | else |
| 320 | ide_controller16_ | |
| 323 | ide_controller16_ | |
| 321 | 324 | } |
| 322 | 325 | |
| 323 | 326 | |
| 324 | static READ32_HANDLER( ide_alt_r ) | |
| 327 | static READ32_DEVICE_HANDLER( ide_alt_r ) | |
| 325 | 328 | { |
| 326 | 329 | if (offset == 0) |
| 327 | return ide_controller16_ | |
| 330 | return ide_controller16_ | |
| 328 | 331 | |
| 329 | 332 | return 0; |
| 330 | 333 | } |
| 331 | 334 | |
| 332 | static WRITE32_HANDLER( ide_alt_w ) | |
| 335 | static WRITE32_DEVICE_HANDLER( ide_alt_w ) | |
| 333 | 336 | { |
| 334 | 337 | if (offset == 0 && ACCESSING_BITS_16_23) |
| 335 | ide_controller16_ | |
| 338 | ide_controller16_ | |
| 336 | 339 | } |
| 337 | 340 | |
| 338 | 341 | |
| r2418 | r2419 | |
| 435 | 438 | } |
| 436 | 439 | |
| 437 | 440 | |
| 438 | static void ide_interrupt(int state) | |
| 441 | static void ide_interrupt(const device_config *device, int state) | |
| 439 | 442 | { |
| 440 | 443 | if (state != CLEAR_LINE) |
| 441 | 444 | { |
| 442 | 445 | //logerror("IDE interrupt asserted\n"); |
| 443 | cpunum_set_input_line( | |
| 446 | cpunum_set_input_line(device->machine, 0, MC68000_IRQ_1, HOLD_LINE); | |
| 444 | 447 | } |
| 445 | 448 | else |
| 446 | 449 | { |
| 447 | 450 | //logerror("IDE interrupt cleared\n"); |
| 448 | cpunum_set_input_line( | |
| 451 | cpunum_set_input_line(device->machine, 0, MC68000_IRQ_1, CLEAR_LINE); | |
| 449 | 452 | } |
| 450 | 453 | } |
| 451 | 454 | |
| r2418 | r2419 | |
| 461 | 464 | static ADDRESS_MAP_START( memory_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 462 | 465 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // PRG ROM |
| 463 | 466 | AM_RANGE(0x400000, 0x40ffff) AM_RAM // WORK RAM |
| 464 | AM_RANGE(0x480000, 0x48443f) AM_R | |
| 467 | AM_RANGE(0x480000, 0x48443f) AM_R | |
| 465 | 468 | AM_BASE(&paletteram32) |
| 466 | 469 | AM_RANGE(0x500000, 0x57ffff) AM_READWRITE(sndram_r, sndram_w) // SOUND RAM |
| 467 | 470 | AM_RANGE(0x580000, 0x58003f) AM_READWRITE(K056832_long_r, K056832_long_w) // VIDEO REG (tilemap) |
| r2418 | r2419 | |
| 482 | 485 | AM_RANGE(0x803800, 0x803fff) AM_READ(obj_rom_r) // OBJECT ROM readthrough (for POST) |
| 483 | 486 | AM_RANGE(0xc00000, 0xc01fff) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) // VIDEO RAM (tilemap) (beatmania) |
| 484 | 487 | AM_RANGE(0xc02000, 0xc02047) AM_WRITE(unknownc02000_w) // ?? |
| 485 | AM_RANGE(0xd00000, 0xd0000f) AM_READWRITE(ide_std_r, ide_std_w) // IDE control regs (hiphopmania) | |
| 486 | AM_RANGE(0xd4000c, 0xd4000f) AM_READWRITE(ide_alt_r, ide_alt_w) // IDE status control reg (hiphopmania) | |
| 488 | AM_RANGE(0xd00000, 0xd0000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_std_r, ide_std_w) // IDE control regs (hiphopmania) | |
| 489 | AM_RANGE(0xd4000c, 0xd4000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_alt_r, ide_alt_w) // IDE status control reg (hiphopmania) | |
| 487 | 490 | AM_RANGE(0xe00000, 0xe01fff) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) // VIDEO RAM (tilemap) (hiphopmania) |
| 488 | AM_RANGE(0xf00000, 0xf0000f) AM_READWRITE(ide_std_r, ide_std_w) // IDE control regs (beatmania) | |
| 489 | AM_RANGE(0xf4000c, 0xf4000f) AM_READWRITE(ide_alt_r, ide_alt_w) // IDE status control reg (beatmania) | |
| 491 | AM_RANGE(0xf00000, 0xf0000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_std_r, ide_std_w) // IDE control regs (beatmania) | |
| 492 | AM_RANGE(0xf4000c, 0xf4000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_alt_r, ide_alt_w) // IDE status control reg (beatmania) | |
| 490 | 493 | ADDRESS_MAP_END |
| 491 | 494 | |
| 492 | 495 | |
| r2418 | r2419 | |
| 1153 | 1156 | |
| 1154 | 1157 | /************************************* |
| 1155 | 1158 | * |
| 1156 | * IDE interfaces | |
| 1157 | * | |
| 1158 | *************************************/ | |
| 1159 | ||
| 1160 | static const struct ide_interface ide_intf = | |
| 1161 | { | |
| 1162 | ide_interrupt, | |
| 1163 | }; | |
| 1164 | ||
| 1165 | ||
| 1166 | ||
| 1167 | /************************************* | |
| 1168 | * | |
| 1169 | 1159 | * Sound interfaces |
| 1170 | 1160 | * |
| 1171 | 1161 | *************************************/ |
| r2418 | r2419 | |
| 1190 | 1180 | |
| 1191 | 1181 | static MACHINE_START( djmain ) |
| 1192 | 1182 | { |
| 1183 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 1193 | 1184 | UINT8 *region = memory_region(REGION_SOUND1); |
| 1194 | 1185 | |
| 1186 | if (ide != NULL && ide_master_password != NULL) | |
| 1187 | ide_set_master_password(ide, ide_master_password); | |
| 1188 | if (ide != NULL && ide_user_password != NULL) | |
| 1189 | ide_set_user_password(ide, ide_user_password); | |
| 1190 | ||
| 1195 | 1191 | state_save_register_global(sndram_bank); |
| 1196 | 1192 | state_save_register_global_pointer(region, 0x80000 * 32); |
| 1197 | 1193 | state_save_register_global(pending_vb_int); |
| r2418 | r2419 | |
| 1209 | 1205 | sndram_set_bank(); |
| 1210 | 1206 | |
| 1211 | 1207 | /* reset the IDE controller */ |
| 1212 | | |
| 1208 | | |
| 1213 | 1209 | |
| 1214 | 1210 | /* reset LEDs */ |
| 1215 | 1211 | set_led_status(0, 1); |
| r2418 | r2419 | |
| 1237 | 1233 | MDRV_MACHINE_START(djmain) |
| 1238 | 1234 | MDRV_MACHINE_RESET(djmain) |
| 1239 | 1235 | |
| 1236 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 1237 | ||
| 1240 | 1238 | /* video hardware */ |
| 1241 | 1239 | MDRV_SCREEN_ADD("main", RASTER) |
| 1242 | 1240 | MDRV_SCREEN_REFRESH_RATE(58) |
| r2418 | r2419 | |
| 1733 | 1731 | |
| 1734 | 1732 | static DRIVER_INIT( beatmania ) |
| 1735 | 1733 | { |
| 1736 | | |
| 1734 | new_memory_region(machine, REGION_SOUND1, 0x80000 * 32, 0); | |
| 1737 | 1735 | |
| 1738 | region = new_memory_region(machine, REGION_SOUND1, 0x80000 * 32, 0); | |
| 1739 | ||
| 1740 | /* spin up the hard disk */ | |
| 1741 | ide_controller_init(0, &ide_intf); | |
| 1736 | ide_master_password = NULL; | |
| 1737 | ide_user_password = NULL; | |
| 1742 | 1738 | } |
| 1743 | 1739 | |
| 1744 | 1740 | static const UINT8 beatmania_master_password[2 + 32] = |
| r2418 | r2419 | |
| 1763 | 1759 | |
| 1764 | 1760 | DRIVER_INIT_CALL(beatmania); |
| 1765 | 1761 | |
| 1766 | ide_set_master_password(0, beatmania_master_password); | |
| 1767 | ide_set_user_password(0, hmcompmx_user_password); | |
| 1762 | ide_master_password = beatmania_master_password; | |
| 1763 | ide_user_password = hmcompmx_user_password; | |
| 1768 | 1764 | } |
| 1769 | 1765 | |
| 1770 | 1766 | static DRIVER_INIT( bm4thmix ) |
| r2418 | r2419 | |
| 1780 | 1776 | |
| 1781 | 1777 | DRIVER_INIT_CALL(beatmania); |
| 1782 | 1778 | |
| 1783 | ide_ | |
| 1779 | ide_ | |
| 1784 | 1780 | } |
| 1785 | 1781 | |
| 1786 | 1782 | static DRIVER_INIT( bm5thmix ) |
| r2418 | r2419 | |
| 1796 | 1792 | |
| 1797 | 1793 | DRIVER_INIT_CALL(beatmania); |
| 1798 | 1794 | |
| 1799 | ide_set_master_password(0, beatmania_master_password); | |
| 1800 | ide_set_user_password(0, bm5thmix_user_password); | |
| 1795 | ide_master_password = beatmania_master_password; | |
| 1796 | ide_user_password = bm5thmix_user_password; | |
| 1801 | 1797 | } |
| 1802 | 1798 | |
| 1803 | 1799 | static DRIVER_INIT( bmclubmx ) |
| r2418 | r2419 | |
| 1813 | 1809 | |
| 1814 | 1810 | DRIVER_INIT_CALL(beatmania); |
| 1815 | 1811 | |
| 1816 | ide_set_master_password(0, beatmania_master_password); | |
| 1817 | ide_set_user_password(0, bmclubmx_user_password); | |
| 1812 | ide_master_password = beatmania_master_password; | |
| 1813 | ide_user_password = bmclubmx_user_password; | |
| 1818 | 1814 | } |
| 1819 | 1815 | |
| 1820 | 1816 | |
| r2418 | r2419 | |
| 1831 | 1827 | |
| 1832 | 1828 | DRIVER_INIT_CALL(beatmania); |
| 1833 | 1829 | |
| 1834 | ide_set_master_password(0, beatmania_master_password); | |
| 1835 | ide_set_user_password(0, bmcompm2_user_password); | |
| 1830 | ide_master_password = beatmania_master_password; | |
| 1831 | ide_user_password = bmcompm2_user_password; | |
| 1836 | 1832 | } |
| 1837 | 1833 | |
| 1838 | 1834 | static DRIVER_INIT( hmcompm2 ) |
| r2418 | r2419 | |
| 1848 | 1844 | |
| 1849 | 1845 | DRIVER_INIT_CALL(beatmania); |
| 1850 | 1846 | |
| 1851 | ide_set_master_password(0, beatmania_master_password); | |
| 1852 | ide_set_user_password(0, hmcompm2_user_password); | |
| 1847 | ide_master_password = beatmania_master_password; | |
| 1848 | ide_user_password = hmcompm2_user_password; | |
| 1853 | 1849 | } |
| 1854 | 1850 | |
| 1855 | 1851 | static DRIVER_INIT( bmdct ) |
| r2418 | r2419 | |
| 1865 | 1861 | |
| 1866 | 1862 | DRIVER_INIT_CALL(beatmania); |
| 1867 | 1863 | |
| 1868 | ide_set_master_password(0, beatmania_master_password); | |
| 1869 | ide_set_user_password(0, bmdct_user_password); | |
| 1864 | ide_master_password = beatmania_master_password; | |
| 1865 | ide_user_password = bmdct_user_password; | |
| 1870 | 1866 | } |
| 1871 | 1867 | |
| 1872 | 1868 | static DRIVER_INIT( bmcorerm ) |
| r2418 | r2419 | |
| 1882 | 1878 | |
| 1883 | 1879 | DRIVER_INIT_CALL(beatmania); |
| 1884 | 1880 | |
| 1885 | ide_set_master_password(0, beatmania_master_password); | |
| 1886 | ide_set_user_password(0, bmcorerm_user_password); | |
| 1881 | ide_master_password = beatmania_master_password; | |
| 1882 | ide_user_password = bmcorerm_user_password; | |
| 1887 | 1883 | } |
| 1888 | 1884 | |
| 1889 | 1885 | static DRIVER_INIT( bm6thmix ) |
| r2418 | r2419 | |
| 1899 | 1895 | |
| 1900 | 1896 | DRIVER_INIT_CALL(beatmania); |
| 1901 | 1897 | |
| 1902 | ide_set_master_password(0, beatmania_master_password); | |
| 1903 | ide_set_user_password(0, bm6thmix_user_password); | |
| 1898 | ide_master_password = beatmania_master_password; | |
| 1899 | ide_user_password = bm6thmix_user_password; | |
| 1904 | 1900 | } |
| 1905 | 1901 | |
| 1906 | 1902 | static DRIVER_INIT( bm7thmix ) |
| r2418 | r2419 | |
| 1916 | 1912 | |
| 1917 | 1913 | DRIVER_INIT_CALL(beatmania); |
| 1918 | 1914 | |
| 1919 | ide_set_master_password(0, beatmania_master_password); | |
| 1920 | ide_set_user_password(0, bm7thmix_user_password); | |
| 1915 | ide_master_password = beatmania_master_password; | |
| 1916 | ide_user_password = bm7thmix_user_password; | |
| 1921 | 1917 | } |
| 1922 | 1918 | |
| 1923 | 1919 | #if 0 |
| r2418 | r2419 | |
| 1934 | 1930 | |
| 1935 | 1931 | DRIVER_INIT_CALL(beatmania); |
| 1936 | 1932 | |
| 1937 | ide_set_master_password(0, beatmania_master_password); | |
| 1938 | ide_set_user_password(0, bmfinal_user_password); | |
| 1933 | ide_master_password = beatmania_master_password; | |
| 1934 | ide_user_password = bmfinal_user_password; | |
| 1939 | 1935 | } |
| 1940 | 1936 | #endif |
| 1941 | 1937 |
| r2418 | r2419 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 67 | 67 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 68 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 68 | AM_RANGE(0x8000, 0x87ff) AM_R | |
| 69 | 69 | AM_RANGE(0x9000, 0x91ff) AM_RAM AM_BASE(&m57_scroll) |
| 70 | 70 | AM_RANGE(0xc820, 0xc8ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 71 | 71 | AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w) |
| r2418 | r2419 | |
|---|---|---|
| 1021 | 1021 | AM_RANGE(0x260000, 0x260001) AM_WRITENOP // Vertical synchronization register |
| 1022 | 1022 | AM_RANGE(0x270000, 0x270001) AM_WRITENOP // Video synchronization switch |
| 1023 | 1023 | AM_RANGE(0x280000, 0x29ffff) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 1024 | AM_RANGE(0x400000, 0x403fff) AM_R | |
| 1024 | AM_RANGE(0x400000, 0x403fff) AM_R | |
| 1025 | 1025 | AM_RANGE(0x404000, 0x40401f) AM_READWRITE(sys24_mixer_r, sys24_mixer_w) |
| 1026 | 1026 | AM_RANGE(0x600000, 0x63ffff) AM_READWRITE(sys24_sprite_r, sys24_sprite_w) |
| 1027 | 1027 | AM_RANGE(0x800000, 0x80007f) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w) |
| r2418 | r2419 | |
| 1060 | 1060 | AM_RANGE(0x260000, 0x260001) AM_WRITENOP // Vertical synchronization register |
| 1061 | 1061 | AM_RANGE(0x270000, 0x270001) AM_WRITENOP // Video synchronization switch |
| 1062 | 1062 | AM_RANGE(0x280000, 0x29ffff) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 1063 | AM_RANGE(0x400000, 0x403fff) AM_R | |
| 1063 | AM_RANGE(0x400000, 0x403fff) AM_R | |
| 1064 | 1064 | AM_RANGE(0x404000, 0x40401f) AM_READWRITE(sys24_mixer_r, sys24_mixer_w) |
| 1065 | 1065 | AM_RANGE(0x600000, 0x63ffff) AM_READWRITE(sys24_sprite_r, sys24_sprite_w) |
| 1066 | 1066 | AM_RANGE(0x800000, 0x80007f) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w) |
| r2418 | r2419 | |
|---|---|---|
| 62 | 62 | static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 63 | 63 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 64 | 64 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 65 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 65 | AM_RANGE(0xc000, 0xcfff) AM_R | |
| 66 | 66 | AM_RANGE(0xd000, 0xd000) AM_WRITE(t5182_sound_irq_w) |
| 67 | 67 | AM_RANGE(0xd001, 0xd001) AM_READ(t5182_sharedram_semaphore_snd_r) |
| 68 | 68 | AM_RANGE(0xd002, 0xd002) AM_WRITE(t5182_sharedram_semaphore_main_acquire_w) |
| r2418 | r2419 | |
|---|---|---|
| 208 | 208 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 209 | 209 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&mainram) |
| 210 | 210 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(&spriteram) |
| 211 | AM_RANGE(0x9400, 0x97ff) AM_READWRITE(SMH_RAM, ddayjlc_videoram_w) AM_BASE(&videoram) | |
| 212 | AM_RANGE(0x9800, 0x9fff) AM_READWRITE(SMH_RAM, ddayjlc_bgram_w) AM_BASE(&bgram) /* 9800-981f - videoregs */ | |
| 211 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(ddayjlc_videoram_w) AM_BASE(&videoram) | |
| 212 | AM_RANGE(0x9800, 0x9fff) AM_RAM_WRITE(ddayjlc_bgram_w) AM_BASE(&bgram) /* 9800-981f - videoregs */ | |
| 213 | 213 | AM_RANGE(0xa000, 0xdfff) AM_ROMBANK(1) AM_WRITENOP |
| 214 | 214 | AM_RANGE(0xe000, 0xe003) AM_WRITE(i8257_CH0_w) |
| 215 | 215 | AM_RANGE(0xe008, 0xe008) AM_WRITENOP |
| r2418 | r2419 | |
|---|---|---|
| 811 | 811 | static ADDRESS_MAP_START( system16a_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 812 | 812 | ADDRESS_MAP_UNMAP_HIGH |
| 813 | 813 | AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x380000) AM_ROM |
| 814 | AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_READWRITE(SMH_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 815 | AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_READWRITE(SMH_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 814 | AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_RAM_WRITE(segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 815 | AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_RAM_WRITE(segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 816 | 816 | AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 817 | AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_R | |
| 817 | AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_R | |
| 818 | 818 | AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w) |
| 819 | 819 | AM_RANGE(0xc60000, 0xc6ffff) AM_READ(watchdog_reset16_r) |
| 820 | 820 | AM_RANGE(0xc70000, 0xc73fff) AM_MIRROR(0x38c000) AM_RAM AM_BASE(&workram) |
| r2418 | r2419 | |
| 3179 | 3179 | GAME( 1986, fantzon1, fantzone, system16a_no7751, fantzone, generic_16a, ROT0, "Sega", "Fantasy Zone (set 1, unprotected)", 0 ) |
| 3180 | 3180 | GAME( 1988, pshot16a, passsht, system16a, pshot16a, pshot16a, ROT270, "Sega", "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", 0 ) |
| 3181 | 3181 | GAME( 1987, sdi, 0, system16a_no7751, sdi, sdi, ROT0, "Sega", "SDI - Strategic Defense Initiative (Europe, System 16A, FD1089B 317-0027)", 0 ) |
| 3182 | GAME( 1987, shinobi, 0, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set | |
| 3182 | GAME( 1987, shinobi, 0, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 6, System 16A, unprotected)", 0 ) | |
| 3183 | 3183 | GAME( 1987, shinobi1, shinobi, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 1, System 16A, FD1094 317-0050)", 0 ) |
| 3184 | 3184 | GAME( 1987, shinobls, shinobi, system16a, shinobi, generic_16a, ROT0, "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", 0 ) |
| 3185 | 3185 | GAME( 1987, sjryuko1, sjryuko, system16a, sjryuko, sjryukoa, ROT0, "White Board", "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 1053 | 1053 | AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w) |
| 1054 | 1054 | AM_RANGE(0x800000, 0x800fff) AM_READWRITE(memcard_r, memcard_w) |
| 1055 | 1055 | AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROMBANK(NEOGEO_BANK_BIOS) |
| 1056 | AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_R | |
| 1056 | AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_R | |
| 1057 | 1057 | AM_RANGE(0xe00000, 0xffffff) AM_READ(neogeo_unmapped_r) |
| 1058 | 1058 | ADDRESS_MAP_END |
| 1059 | 1059 |
| r2418 | r2419 | |
|---|---|---|
| 1152 | 1152 | |
| 1153 | 1153 | static ADDRESS_MAP_START( gx_type1_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 1154 | 1154 | AM_RANGE(0xd4a000, 0xd4a01f) AM_READ(gx6bppspr_r) // sprite ROM readback |
| 1155 | AM_RANGE(0xd90000, 0xd97fff) AM_RAM | |
| 1155 | AM_RANGE(0xd90000, 0xd97fff) AM_RAM | |
| 1156 | 1156 | AM_RANGE(0xdc0000, 0xdc1fff) AM_RAM // LAN RAM? (Racin' Force has, Open Golf doesn't) |
| 1157 | 1157 | AM_RANGE(0xdd0000, 0xdd00ff) AM_READNOP AM_WRITENOP // LAN board |
| 1158 | 1158 | AM_RANGE(0xdda000, 0xddafff) AM_WRITE(adc0834_w) |
| r2418 | r2419 | |
| 1162 | 1162 | AM_RANGE(0xe20000, 0xe2000f) AM_WRITE(SMH_NOP) |
| 1163 | 1163 | AM_RANGE(0xe40000, 0xe40003) AM_WRITE(SMH_NOP) |
| 1164 | 1164 | AM_RANGE(0xe80000, 0xe81fff) AM_RAM AM_BASE((UINT32**)&K053936_1_linectrl) // chips 21L+19L / S |
| 1165 | AM_RANGE(0xec0000, 0xedffff) AM_RAM | |
| 1165 | AM_RANGE(0xec0000, 0xedffff) AM_RAM | |
| 1166 | 1166 | AM_RANGE(0xf00000, 0xf3ffff) AM_READ(type1_roz_r1) // ROM readback |
| 1167 | 1167 | AM_RANGE(0xf40000, 0xf7ffff) AM_READ(type1_roz_r2) // ROM readback |
| 1168 | 1168 | AM_RANGE(0xf80000, 0xf80fff) AM_RAM // chip 21Q / S |
| r2418 | r2419 | |
| 1171 | 1171 | |
| 1172 | 1172 | static ADDRESS_MAP_START( gx_type2_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 1173 | 1173 | AM_RANGE(0xcc0000, 0xcc0003) AM_WRITE(esc_w) |
| 1174 | AM_RANGE(0xd90000, 0xd97fff) AM_RAM | |
| 1174 | AM_RANGE(0xd90000, 0xd97fff) AM_RAM | |
| 1175 | 1175 | ADDRESS_MAP_END |
| 1176 | 1176 | |
| 1177 | 1177 | static ADDRESS_MAP_START( gx_type3_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r2418 | r2419 | |
| 1181 | 1181 | AM_RANGE(0xe20000, 0xe20003) AM_WRITE(SMH_NOP) |
| 1182 | 1182 | AM_RANGE(0xe40000, 0xe40003) AM_WRITE(SMH_NOP) |
| 1183 | 1183 | AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_BASE((UINT32**)&K053936_1_linectrl) |
| 1184 | AM_RANGE(0xe80000, 0xe87fff) AM_RAM AM_WRITE(konamigx_555_palette_w) AM_BASE(&paletteram32) // main monitor palette (twice as large as reality) | |
| 1185 | AM_RANGE(0xea0000, 0xea3fff) AM_RAM AM_WRITE(konamigx_555_palette2_w) AM_BASE(&gx_subpaletteram32) // sub monitor palette | |
| 1184 | AM_RANGE(0xe80000, 0xe87fff) AM_RAM_WRITE(konamigx_555_palette_w) AM_BASE(&paletteram32) // main monitor palette (twice as large as reality) | |
| 1185 | AM_RANGE(0xea0000, 0xea3fff) AM_RAM_WRITE(konamigx_555_palette2_w) AM_BASE(&gx_subpaletteram32) // sub monitor palette | |
| 1186 | 1186 | AM_RANGE(0xec0000, 0xec0003) AM_READ(type3_sync_r) |
| 1187 | 1187 | AM_RANGE(0xf00000, 0xf07fff) AM_RAM |
| 1188 | 1188 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 1194 | 1194 | AM_RANGE(0xe20000, 0xe20003) AM_WRITE(SMH_NOP) |
| 1195 | 1195 | AM_RANGE(0xe40000, 0xe40003) AM_WRITE(SMH_NOP) |
| 1196 | 1196 | AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_BASE((UINT32**)&K053936_1_linectrl) // 29C & 29G (PSAC2 line control) |
| 1197 | AM_RANGE(0xe80000, 0xe8ffff) AM_RAM AM_WRITE(konamigx_palette_w) AM_BASE(&paletteram32) // 11G/13G/15G (main screen palette RAM) (twice as large as reality) | |
| 1198 | AM_RANGE(0xea0000, 0xea7fff) AM_RAM AM_WRITE(konamigx_palette2_w) AM_BASE(&gx_subpaletteram32) // 5G/7G/9G (sub screen palette RAM) | |
| 1197 | AM_RANGE(0xe80000, 0xe8ffff) AM_RAM_WRITE(konamigx_palette_w) AM_BASE(&paletteram32) // 11G/13G/15G (main screen palette RAM) (twice as large as reality) | |
| 1198 | AM_RANGE(0xea0000, 0xea7fff) AM_RAM_WRITE(konamigx_palette2_w) AM_BASE(&gx_subpaletteram32) // 5G/7G/9G (sub screen palette RAM) | |
| 1199 | 1199 | AM_RANGE(0xec0000, 0xec0003) AM_READ(type3_sync_r) // type 4 polls this too |
| 1200 | AM_RANGE(0xf00000, 0xf07fff) AM_RAM | |
| 1200 | AM_RANGE(0xf00000, 0xf07fff) AM_RAM | |
| 1201 | 1201 | ADDRESS_MAP_END |
| 1202 | 1202 | |
| 1203 | 1203 | /**********************************************************************************/ |
| r2418 | r2419 | |
| 3551 | 3551 | switch (gameDefs[i].special) |
| 3552 | 3552 | { |
| 3553 | 3553 | case 1: // LE2 guns |
| 3554 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd44000, 0xd44003, 0, 0, le2_gun_H_r ); | |
| 3555 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd44004, 0xd44007, 0, 0, le2_gun_V_r ); | |
| 3554 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd44000, 0xd44003, 0, 0, le2_gun_H_r ); | |
| 3555 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd44004, 0xd44007, 0, 0, le2_gun_V_r ); | |
| 3556 | 3556 | break; |
| 3557 | 3557 | |
| 3558 | 3558 | case 2: // tkmmpzdm hack |
| r2418 | r2419 | |
| 3588 | 3588 | break; |
| 3589 | 3589 | |
| 3590 | 3590 | case 7: // install type 4 Xilinx protection for non-type 3/4 games |
| 3591 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc0000, 0xcc0007, 0, 0, type4_prot_w ); | |
| 3591 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc0000, 0xcc0007, 0, 0, type4_prot_w ); | |
| 3592 | 3592 | break; |
| 3593 | 3593 | |
| 3594 | 3594 | case 8: // tbyahhoo |
| r2418 | r2419 | |
| 3603 | 3603 | switch (readback) |
| 3604 | 3604 | { |
| 3605 | 3605 | case BPP5: |
| 3606 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx5bppspr_r); | |
| 3606 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx5bppspr_r); | |
| 3607 | 3607 | break; |
| 3608 | 3608 | |
| 3609 | 3609 | case BPP66: |
| 3610 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, K056832_6bpp_rom_long_r); | |
| 3610 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, K056832_6bpp_rom_long_r); | |
| 3611 | 3611 | |
| 3612 | 3612 | case BPP6: |
| 3613 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx6bppspr_r); | |
| 3613 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx6bppspr_r); | |
| 3614 | 3614 | break; |
| 3615 | 3615 | } |
| 3616 | 3616 |
| r2418 | r2419 | |
|---|---|---|
| 362 | 362 | ADDRESS_MAP_UNMAP_HIGH |
| 363 | 363 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 364 | 364 | AM_RANGE(0x20c000, 0x20ffff) AM_RAM |
| 365 | AM_RANGE(0x400000, 0x403fff) AM_READWRITE(SMH_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 366 | AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SMH_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 365 | AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE(segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 366 | AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 367 | 367 | AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 368 | AM_RANGE(0xa00000, 0xa00fff) AM_R | |
| 368 | AM_RANGE(0xa00000, 0xa00fff) AM_R | |
| 369 | 369 | AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION(REGION_CPU2, 0) |
| 370 | 370 | AM_RANGE(0xc68000, 0xc68fff) AM_RAM AM_SHARE(1) AM_BASE(&segaic16_roadram_0) |
| 371 | 371 | AM_RANGE(0xc7c000, 0xc7ffff) AM_RAM AM_SHARE(2) |
| r2418 | r2419 | |
| 377 | 377 | ADDRESS_MAP_UNMAP_HIGH |
| 378 | 378 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 379 | 379 | AM_RANGE(0x040000, 0x043fff) AM_RAM AM_BASE(&workram) |
| 380 | AM_RANGE(0x100000, 0x107fff) AM_READWRITE(SMH_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 381 | AM_RANGE(0x108000, 0x108fff) AM_READWRITE(SMH_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 382 | AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SMH_RAM, segaic16_paletteram_w) AM_BASE(&paletteram16) | |
| 380 | AM_RANGE(0x100000, 0x107fff) AM_RAM_WRITE(segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) | |
| 381 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) | |
| 382 | AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&paletteram16) | |
| 383 | 383 | AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE(2) |
| 384 | 384 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 385 | 385 | AM_RANGE(0x140000, 0x14ffff) AM_READWRITE(sharrier_io_r, sharrier_io_w) |
| r2418 | r2419 | |
|---|---|---|
| 209 | 209 | AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w) |
| 210 | 210 | AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) |
| 211 | 211 | AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) |
| 212 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 212 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 213 | 213 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(thunderj_atarivc_r, thunderj_atarivc_w) AM_BASE(&atarivc_data) |
| 214 | AM_RANGE(0x3f0000, 0x3f1fff) AM_READWRITE(SMH_RAM, atarigen_playfield2_latched_msb_w) AM_BASE(&atarigen_playfield2) | |
| 215 | AM_RANGE(0x3f2000, 0x3f3fff) AM_READWRITE(SMH_RAM, atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 216 | AM_RANGE(0x3f4000, 0x3f5fff) AM_READWRITE(SMH_RAM, atarigen_playfield_dual_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 217 | AM_RANGE(0x3f6000, 0x3f7fff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 218 | AM_RANGE(0x3f8000, 0x3f8eff) AM_READWRITE(SMH_RAM, atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 214 | AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE(atarigen_playfield2_latched_msb_w) AM_BASE(&atarigen_playfield2) | |
| 215 | AM_RANGE(0x3f2000, 0x3f3fff) AM_RAM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 216 | AM_RANGE(0x3f4000, 0x3f5fff) AM_RAM_WRITE(atarigen_playfield_dual_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 217 | AM_RANGE(0x3f6000, 0x3f7fff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 218 | AM_RANGE(0x3f8000, 0x3f8eff) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) | |
| 219 | 219 | AM_RANGE(0x3f8f00, 0x3f8f7f) AM_RAM AM_BASE(&atarivc_eof_data) |
| 220 | AM_RANGE(0x3f8f80, 0x3f8fff) AM_R | |
| 220 | AM_RANGE(0x3f8f80, 0x3f8fff) AM_R | |
| 221 | 221 | AM_RANGE(0x3f9000, 0x3fffff) AM_RAM |
| 222 | 222 | ADDRESS_MAP_END |
| 223 | 223 |
| r2418 | r2419 | |
|---|---|---|
| 113 | 113 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 114 | 114 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 115 | 115 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| 116 | AM_RANGE(0x180000, 0x183fff) AM_RAM | |
| 116 | AM_RANGE(0x180000, 0x183fff) AM_RAM | |
| 117 | 117 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ(input_port_0_word_r) /* Coins + Service */ |
| 118 | 118 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ(input_port_1_word_r) /* 1P controls */ |
| 119 | 119 | AM_RANGE(0x1c0004, 0x1c0005) AM_READ(input_port_2_word_r) /* 2P controls */ |
| r2418 | r2419 | |
|---|---|---|
| 89 | 89 | AM_RANGE(0xa000, 0xa000) AM_WRITE(ladybug_flipscreen_w) |
| 90 | 90 | AM_RANGE(0xb000, 0xbfff) AM_WRITE(SN76496_0_w) |
| 91 | 91 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(SN76496_1_w) |
| 92 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(SMH_RAM, ladybug_videoram_w) AM_BASE(&videoram) | |
| 93 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(SMH_RAM, ladybug_colorram_w) AM_BASE(&colorram) | |
| 92 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(ladybug_videoram_w) AM_BASE(&videoram) | |
| 93 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(ladybug_colorram_w) AM_BASE(&colorram) | |
| 94 | 94 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_2_r) /* IN2 */ |
| 95 | 95 | ADDRESS_MAP_END |
| 96 | 96 |
| r2418 | r2419 | |
|---|---|---|
| 108 | 108 | AM_RANGE(0xc003, 0xc003) AM_READ(blueprnt_sh_dipsw_r) |
| 109 | 109 | AM_RANGE(0xd000, 0xd000) AM_WRITE(blueprnt_sound_command_w) |
| 110 | 110 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(watchdog_reset_r, blueprnt_flipscreen_w) |
| 111 | AM_RANGE(0xf000, 0xf3ff) AM_RAM | |
| 111 | AM_RANGE(0xf000, 0xf3ff) AM_RAM | |
| 112 | 112 | ADDRESS_MAP_END |
| 113 | 113 | |
| 114 | 114 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r2418 | r2419 | |
|---|---|---|
| 916 | 916 | static DRIVER_INIT( combasc ) |
| 917 | 917 | { |
| 918 | 918 | /* joystick instead of trackball */ |
| 919 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0404, 0x0404, 0, 0, input_port_4_r); | |
| 919 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0404, 0x0404, 0, 0, input_port_4_r); | |
| 920 | 920 | |
| 921 | 921 | combasc_init_common(); |
| 922 | 922 | } |
| r2418 | r2419 | |
|---|---|---|
| 196 | 196 | return stv_workram_h[0x0335bc/4]; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | void install_stvbios_speedups( | |
| 199 | void install_stvbios_speedups(running_machine *machine) | |
| 200 | 200 | { |
| 201 | 201 | /* idle skip bios? .. not 100% sure this is safe .. we'll see */ |
| 202 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60335d0, 0x60335d3, 0, 0, stv_speedup_r ); | |
| 203 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60335bc, 0x60335bf, 0, 0, stv_speedup2_r ); | |
| 202 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60335d0, 0x60335d3, 0, 0, stv_speedup_r ); | |
| 203 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60335bc, 0x60335bf, 0, 0, stv_speedup2_r ); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static READ32_HANDLER( shienryu_slave_speedup_r ) |
| r2418 | r2419 | |
| 224 | 224 | stv_default_eeprom = shienryu_default_eeprom; |
| 225 | 225 | stv_default_eeprom_length = sizeof(shienryu_default_eeprom); |
| 226 | 226 | |
| 227 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu | |
| 228 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu | |
| 227 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu | |
| 228 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu | |
| 229 | 229 | |
| 230 | 230 | DRIVER_INIT_CALL(stv); |
| 231 | 231 | } |
| r2418 | r2419 | |
| 252 | 252 | |
| 253 | 253 | (loops for 263473 instructions) |
| 254 | 254 | */ |
| 255 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r ); | |
| 255 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r ); | |
| 256 | 256 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup ); |
| 257 | 257 | |
| 258 | 258 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 297 | 297 | |
| 298 | 298 | (loops for 288688 instructions) |
| 299 | 299 | */ |
| 300 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r ); | |
| 301 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off ); | |
| 300 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r ); | |
| 301 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off ); | |
| 302 | 302 | |
| 303 | 303 | DRIVER_INIT_CALL(stv); |
| 304 | 304 | } |
| r2418 | r2419 | |
| 339 | 339 | |
| 340 | 340 | DRIVER_INIT(puyosun) |
| 341 | 341 | { |
| 342 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu | |
| 342 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu | |
| 343 | 343 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup ); |
| 344 | 344 | |
| 345 | 345 | DRIVER_INIT_CALL(ic13); |
| r2418 | r2419 | |
| 367 | 367 | |
| 368 | 368 | DRIVER_INIT(mausuke) |
| 369 | 369 | { |
| 370 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu | |
| 370 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu | |
| 371 | 371 | |
| 372 | 372 | DRIVER_INIT_CALL(ic13); |
| 373 | 373 | |
| r2418 | r2419 | |
| 404 | 404 | |
| 405 | 405 | DRIVER_INIT(cottonbm) |
| 406 | 406 | { |
| 407 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu | |
| 407 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu | |
| 408 | 408 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup ); |
| 409 | 409 | |
| 410 | 410 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 440 | 440 | |
| 441 | 441 | DRIVER_INIT(cotton2) |
| 442 | 442 | { |
| 443 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu | |
| 443 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu | |
| 444 | 444 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup ); |
| 445 | 445 | |
| 446 | 446 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 491 | 491 | { |
| 492 | 492 | dnmtdeka_pending_commands = 0; |
| 493 | 493 | |
| 494 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60985a0, 0x60985a3, 0, 0, dnmtdeka_speedup_r ); // idle loop of main cpu | |
| 495 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_write ); | |
| 496 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read ); | |
| 494 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60985a0, 0x60985a3, 0, 0, dnmtdeka_speedup_r ); // idle loop of main cpu | |
| 495 | memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read, dnmtdeka_cmd_write ); | |
| 497 | 496 | |
| 498 | 497 | DRIVER_INIT_CALL(ic13); |
| 499 | 498 | } |
| r2418 | r2419 | |
| 564 | 563 | { |
| 565 | 564 | diehard_pending_commands = 0; |
| 566 | 565 | |
| 567 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r ); | |
| 568 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_write ); | |
| 569 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_read ); | |
| 570 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_read ); | |
| 571 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write_cpu0 ); | |
| 572 | memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write ); | |
| 566 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r ); | |
| 567 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_write ); | |
| 568 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_read ); | |
| 569 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_read ); | |
| 570 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write_cpu0 ); | |
| 571 | memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write ); | |
| 573 | 572 | |
| 574 | 573 | |
| 575 | 574 | DRIVER_INIT_CALL(ic13); |
| r2418 | r2419 | |
| 601 | 600 | |
| 602 | 601 | DRIVER_INIT(fhboxers) |
| 603 | 602 | { |
| 604 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600420c, 0x600420f, 0, 0, fhboxers_speedup_r ); // idle loop of main cpu | |
| 605 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu | |
| 606 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu | |
| 603 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600420c, 0x600420f, 0, 0, fhboxers_speedup_r ); // idle loop of main cpu | |
| 604 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu | |
| 605 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu | |
| 607 | 606 | |
| 608 | 607 | DRIVER_INIT_CALL(ic13); |
| 609 | 608 | } |
| r2418 | r2419 | |
| 634 | 633 | |
| 635 | 634 | DRIVER_INIT(bakubaku) |
| 636 | 635 | { |
| 637 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60833f0, 0x60833f3, 0, 0, bakubaku_speedup_r ); // idle loop of main cpu | |
| 638 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ?? | |
| 639 | //memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6033660, 0x6033663, 0, 0, bakubaku_hangskip_r ); // it waits for a ram address to change what should change it? | |
| 636 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60833f0, 0x60833f3, 0, 0, bakubaku_speedup_r ); // idle loop of main cpu | |
| 637 | memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ?? | |
| 638 | //memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6033660, 0x6033663, 0, 0, bakubaku_hangskip_r ); // it waits for a ram address to change what should change it? | |
| 640 | 639 | |
| 641 | 640 | DRIVER_INIT_CALL(ic13); |
| 642 | 641 | } |
| r2418 | r2419 | |
| 685 | 684 | DRIVER_INIT( groovef ) |
| 686 | 685 | { |
| 687 | 686 | /* prevent game from hanging on startup -- todo: remove these hacks */ |
| 688 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r ); | |
| 689 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60fffcc, 0x60fffcf, 0, 0, groovef_hack1_r ); | |
| 687 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r ); | |
| 688 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fffcc, 0x60fffcf, 0, 0, groovef_hack1_r ); | |
| 690 | 689 | |
| 691 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60c64ec, 0x60c64ef, 0, 0, groovef_speedup_r ); | |
| 692 | // memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai. | |
| 690 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60c64ec, 0x60c64ef, 0, 0, groovef_speedup_r ); | |
| 691 | // memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai. | |
| 693 | 692 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup ); |
| 694 | 693 | |
| 695 | 694 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 749 | 748 | DRIVER_INIT( danchih ) |
| 750 | 749 | { |
| 751 | 750 | /* prevent game from hanging on title screen -- todo: remove these hacks */ |
| 752 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r ); | |
| 751 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r ); | |
| 753 | 752 | |
| 754 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r ); | |
| 753 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r ); | |
| 755 | 754 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup ); |
| 756 | 755 | |
| 757 | 756 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 797 | 796 | |
| 798 | 797 | DRIVER_INIT( astrass ) |
| 799 | 798 | { |
| 800 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000770, 0x6000773, 0, 0, astrass_hack_r ); | |
| 799 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000770, 0x6000773, 0, 0, astrass_hack_r ); | |
| 801 | 800 | |
| 802 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0608e4d8, 0x0608e4db, 0, 0, astrass_speedup_r ); | |
| 801 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0608e4d8, 0x0608e4db, 0, 0, astrass_speedup_r ); | |
| 803 | 802 | |
| 804 | install_astrass_protection(); | |
| 803 | install_astrass_protection(machine); | |
| 805 | 804 | |
| 806 | 805 | DRIVER_INIT_CALL(ic13); |
| 807 | 806 | } |
| r2418 | r2419 | |
| 834 | 833 | 0602A026: TST R0,R0 |
| 835 | 834 | 0602A028: BF $0602A024 |
| 836 | 835 | */ |
| 837 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06031424, 0x06031427, 0, 0, thunt_speedup_r ); | |
| 836 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06031424, 0x06031427, 0, 0, thunt_speedup_r ); | |
| 838 | 837 | |
| 839 | 838 | /* |
| 840 | 839 | 06013EE8: MOV.L @($10,PC),R0 |
| r2418 | r2419 | |
| 845 | 844 | 06013EF2: RTS |
| 846 | 845 | 06013EF4: MOV #$01,R0 |
| 847 | 846 | */ |
| 848 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075958, 0x0607595b, 0, 0, thunt_speedup2_r ); | |
| 847 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06075958, 0x0607595b, 0, 0, thunt_speedup2_r ); | |
| 849 | 848 | |
| 850 | 849 | /* |
| 851 | 850 | 0602AAF8: MOV.B @R11,R2 |
| r2418 | r2419 | |
| 885 | 884 | |
| 886 | 885 | DRIVER_INIT(sandor) |
| 887 | 886 | { |
| 888 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r ); | |
| 889 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r ); | |
| 887 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r ); | |
| 888 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r ); | |
| 890 | 889 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup); |
| 891 | 890 | DRIVER_INIT_CALL(ic13); |
| 892 | 891 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); |
| r2418 | r2419 | |
| 931 | 930 | 06041E34: CMP/PZ R0 |
| 932 | 931 | 06041E36: BT $06041E2C |
| 933 | 932 | */ |
| 934 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, grdforce_speedup_r ); | |
| 933 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, grdforce_speedup_r ); | |
| 935 | 934 | |
| 936 | 935 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup); |
| 937 | 936 | |
| r2418 | r2419 | |
| 959 | 958 | |
| 960 | 959 | DRIVER_INIT(batmanfr) |
| 961 | 960 | { |
| 962 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r ); | |
| 961 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r ); | |
| 963 | 962 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup ); |
| 964 | 963 | |
| 965 | 964 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 1005 | 1004 | |
| 1006 | 1005 | DRIVER_INIT(winterht) |
| 1007 | 1006 | { |
| 1008 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, winterht_speedup_r ); | |
| 1007 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, winterht_speedup_r ); | |
| 1009 | 1008 | |
| 1010 | 1009 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup ); |
| 1011 | 1010 | |
| r2418 | r2419 | |
| 1030 | 1029 | |
| 1031 | 1030 | DRIVER_INIT(seabass) |
| 1032 | 1031 | { |
| 1033 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, seabass_speedup_r ); | |
| 1032 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, seabass_speedup_r ); | |
| 1034 | 1033 | |
| 1035 | 1034 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup ); |
| 1036 | 1035 | |
| r2418 | r2419 | |
| 1054 | 1053 | |
| 1055 | 1054 | DRIVER_INIT(vfremix) |
| 1056 | 1055 | { |
| 1057 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r ); | |
| 1056 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r ); | |
| 1058 | 1057 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup ); |
| 1059 | 1058 | |
| 1060 | 1059 | DRIVER_INIT_CALL(ic13); |
| r2418 | r2419 | |
| 1078 | 1077 | |
| 1079 | 1078 | DRIVER_INIT(sss) |
| 1080 | 1079 | { |
| 1081 | install_standard_protection(); | |
| 1082 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r ); | |
| 1080 | install_standard_protection(machine); | |
| 1081 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r ); | |
| 1083 | 1082 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup ); |
| 1084 | 1083 | |
| 1085 | 1084 | DRIVER_INIT_CALL(ic13); |
| r2418 | r2419 | |
| 1106 | 1105 | |
| 1107 | 1106 | DRIVER_INIT(othellos) |
| 1108 | 1107 | { |
| 1109 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r ); | |
| 1108 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r ); | |
| 1110 | 1109 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup ); |
| 1111 | 1110 | |
| 1112 | 1111 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 1139 | 1138 | |
| 1140 | 1139 | DRIVER_INIT(gaxeduel) |
| 1141 | 1140 | { |
| 1142 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r); | |
| 1141 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r); | |
| 1143 | 1142 | DRIVER_INIT_CALL(ic13); |
| 1144 | 1143 | } |
| 1145 | 1144 | |
| r2418 | r2419 | |
| 1151 | 1150 | |
| 1152 | 1151 | DRIVER_INIT(suikoenb) |
| 1153 | 1152 | { |
| 1154 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r); | |
| 1153 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r); | |
| 1155 | 1154 | DRIVER_INIT_CALL(ic13); |
| 1156 | 1155 | } |
| 1157 | 1156 | |
| r2418 | r2419 | |
| 1173 | 1172 | DRIVER_INIT(sokyugrt) |
| 1174 | 1173 | { |
| 1175 | 1174 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sokyugrt_slave_speedup ); |
| 1176 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r); | |
| 1175 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r); | |
| 1177 | 1176 | DRIVER_INIT_CALL(ic13); |
| 1178 | 1177 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1179 | 1178 | |
| r2418 | r2419 | |
| 1206 | 1205 | DRIVER_INIT(znpwfv) |
| 1207 | 1206 | { |
| 1208 | 1207 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup ); |
| 1209 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r ); | |
| 1208 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r ); | |
| 1210 | 1209 | |
| 1211 | 1210 | DRIVER_INIT_CALL(ic13); |
| 1212 | 1211 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500); |
| r2418 | r2419 | |
| 1228 | 1227 | DRIVER_INIT(twcup98) |
| 1229 | 1228 | { |
| 1230 | 1229 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup ); |
| 1231 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r ); | |
| 1230 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r ); | |
| 1232 | 1231 | |
| 1233 | 1232 | DRIVER_INIT_CALL(ic13); |
| 1234 | install_standard_protection(); | |
| 1233 | install_standard_protection(machine); | |
| 1235 | 1234 | |
| 1236 | 1235 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5); |
| 1237 | 1236 | } |
| r2418 | r2419 | |
| 1252 | 1251 | DRIVER_INIT(smleague) |
| 1253 | 1252 | { |
| 1254 | 1253 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup ); |
| 1255 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r ); | |
| 1254 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r ); | |
| 1256 | 1255 | |
| 1257 | 1256 | DRIVER_INIT_CALL(ic13); |
| 1258 | 1257 | |
| r2418 | r2419 | |
| 1268 | 1267 | |
| 1269 | 1268 | DRIVER_INIT(finlarch) |
| 1270 | 1269 | { |
| 1271 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r ); | |
| 1270 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r ); | |
| 1272 | 1271 | |
| 1273 | 1272 | DRIVER_INIT_CALL(ic13); |
| 1274 | 1273 | |
| r2418 | r2419 | |
| 1299 | 1298 | DRIVER_INIT(maruchan) |
| 1300 | 1299 | { |
| 1301 | 1300 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup ); |
| 1302 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r ); | |
| 1301 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r ); | |
| 1303 | 1302 | |
| 1304 | 1303 | DRIVER_INIT_CALL(ic13); |
| 1305 | 1304 | |
| r2418 | r2419 | |
| 1316 | 1315 | |
| 1317 | 1316 | DRIVER_INIT(pblbeach) |
| 1318 | 1317 | { |
| 1319 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r ); | |
| 1318 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r ); | |
| 1320 | 1319 | |
| 1321 | 1320 | DRIVER_INIT_CALL(ic13); |
| 1322 | 1321 | } |
| r2418 | r2419 | |
| 1330 | 1329 | |
| 1331 | 1330 | DRIVER_INIT(shanhigw) |
| 1332 | 1331 | { |
| 1333 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r ); | |
| 1332 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r ); | |
| 1334 | 1333 | |
| 1335 | 1334 | DRIVER_INIT_CALL(stv); |
| 1336 | 1335 | } |
| r2418 | r2419 | |
| 1356 | 1355 | |
| 1357 | 1356 | DRIVER_INIT(elandore) |
| 1358 | 1357 | { |
| 1359 | install_standard_protection(); | |
| 1360 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r ); | |
| 1358 | install_standard_protection(machine); | |
| 1359 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r ); | |
| 1361 | 1360 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup); |
| 1362 | 1361 | DRIVER_INIT_CALL(stv); |
| 1363 | 1362 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(0); |
| r2418 | r2419 | |
| 1384 | 1383 | |
| 1385 | 1384 | DRIVER_INIT(rsgun) |
| 1386 | 1385 | { |
| 1387 | install_standard_protection(); | |
| 1388 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r ); | |
| 1386 | install_standard_protection(machine); | |
| 1387 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r ); | |
| 1389 | 1388 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup); |
| 1390 | 1389 | |
| 1391 | 1390 | DRIVER_INIT_CALL(stv); |
| r2418 | r2419 | |
| 1396 | 1395 | |
| 1397 | 1396 | DRIVER_INIT(ffreveng) |
| 1398 | 1397 | { |
| 1399 | install_standard_protection(); | |
| 1398 | install_standard_protection(machine); | |
| 1400 | 1399 | DRIVER_INIT_CALL(stv); |
| 1401 | 1400 | } |
| 1402 | 1401 | |
| 1403 | 1402 | DRIVER_INIT(decathlt) |
| 1404 | 1403 | { |
| 1405 | install_decathlt_protection(); | |
| 1404 | install_decathlt_protection(machine); | |
| 1406 | 1405 | DRIVER_INIT_CALL(ic13); |
| 1407 | 1406 | } |
| 1408 | 1407 | |
| r2418 | r2419 | |
| 1421 | 1420 | |
| 1422 | 1421 | DRIVER_INIT(nameclv3) |
| 1423 | 1422 | { |
| 1424 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r ); | |
| 1423 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r ); | |
| 1425 | 1424 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup ); |
| 1426 | 1425 | DRIVER_INIT_CALL(stv); |
| 1427 | 1426 | } |
| r2418 | r2419 | |
|---|---|---|
| 2088 | 2088 | { |
| 2089 | 2089 | /* disable the palette bank switching from the protection chip */ |
| 2090 | 2090 | segac2_common_init(NULL); |
| 2091 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, SMH_NOP); | |
| 2091 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, SMH_NOP); | |
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | static DRIVER_INIT( borench ) |
| r2418 | r2419 | |
| 2173 | 2173 | { |
| 2174 | 2174 | segac2_common_init(prot_func_pclub); |
| 2175 | 2175 | |
| 2176 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2177 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2178 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2176 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2177 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2178 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2179 | 2179 | } |
| 2180 | 2180 | |
| 2181 | 2181 | static DRIVER_INIT( pclubjv2 ) |
| 2182 | 2182 | { |
| 2183 | 2183 | segac2_common_init(prot_func_pclubjv2); |
| 2184 | 2184 | |
| 2185 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2186 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2187 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2185 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2186 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2187 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2188 | 2188 | } |
| 2189 | 2189 | |
| 2190 | 2190 | static DRIVER_INIT( pclubjv4 ) |
| 2191 | 2191 | { |
| 2192 | 2192 | segac2_common_init(prot_func_pclubjv4); |
| 2193 | 2193 | |
| 2194 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2195 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2196 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2194 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2195 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2196 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2197 | 2197 | } |
| 2198 | 2198 | |
| 2199 | 2199 | static DRIVER_INIT( pclubjv5 ) |
| 2200 | 2200 | { |
| 2201 | 2201 | segac2_common_init(prot_func_pclubjv5); |
| 2202 | 2202 | |
| 2203 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2204 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2205 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2203 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/ | |
| 2204 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/ | |
| 2205 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w); | |
| 2206 | 2206 | } |
| 2207 | 2207 | |
| 2208 | 2208 |
| r2418 | r2419 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | static ADDRESS_MAP_START( gberet_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 149 | 149 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 150 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 151 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 150 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 151 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 152 | 152 | AM_RANGE(0xd000, 0xd0ff) AM_RAM AM_BASE(&spriteram_2) |
| 153 | 153 | AM_RANGE(0xd100, 0xd1ff) AM_RAM AM_BASE(&spriteram) |
| 154 | 154 | AM_RANGE(0xd200, 0xdfff) AM_RAM |
| 155 | AM_RANGE(0xe000, 0xe03f) AM_RAM | |
| 155 | AM_RANGE(0xe000, 0xe03f) AM_RAM | |
| 156 | 156 | AM_RANGE(0xe040, 0xe042) AM_WRITENOP // ??? |
| 157 | 157 | AM_RANGE(0xe043, 0xe043) AM_WRITE(gberet_sprite_bank_w) |
| 158 | 158 | AM_RANGE(0xe044, 0xe044) AM_WRITE(gberet_flipscreen_w) |
| r2418 | r2419 | |
| 168 | 168 | |
| 169 | 169 | static ADDRESS_MAP_START( gberetb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 170 | 170 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 171 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 172 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 171 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 172 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 173 | 173 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 174 | 174 | AM_RANGE(0xe000, 0xe03f) AM_RAM |
| 175 | 175 | AM_RANGE(0xe040, 0xe043) AM_WRITENOP // ??? |
| r2418 | r2419 | |
| 189 | 189 | |
| 190 | 190 | static ADDRESS_MAP_START( mrgoemon_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 191 | 191 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 192 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 193 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 192 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(gberet_colorram_w) AM_BASE(&colorram) | |
| 193 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(gberet_videoram_w) AM_BASE(&videoram) | |
| 194 | 194 | AM_RANGE(0xd000, 0xd0ff) AM_RAM AM_BASE(&spriteram_2) |
| 195 | 195 | AM_RANGE(0xd100, 0xd1ff) AM_RAM AM_BASE(&spriteram) |
| 196 | 196 | AM_RANGE(0xd200, 0xdfff) AM_RAM |
| 197 | AM_RANGE(0xe000, 0xe03f) AM_RAM | |
| 197 | AM_RANGE(0xe000, 0xe03f) AM_RAM | |
| 198 | 198 | AM_RANGE(0xe040, 0xe042) AM_WRITENOP // ??? |
| 199 | 199 | AM_RANGE(0xe043, 0xe043) AM_WRITE(gberet_sprite_bank_w) |
| 200 | 200 | AM_RANGE(0xe044, 0xe044) AM_WRITE(mrgoemon_flipscreen_w) |
| r2418 | r2419 | |
|---|---|---|
| 413 | 413 | ADDRESS_MAP_GLOBAL_MASK(0xffff) |
| 414 | 414 | AM_RANGE(0x00000, 0x01fff) AM_RAM |
| 415 | 415 | AM_RANGE(0x02000, 0x020ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 416 | AM_RANGE(0x03000, 0x033ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, gottlieb_videoram_w) AM_BASE(&videoram) | |
| 417 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(SMH_RAM, gottlieb_charram_w) AM_BASE(&gottlieb_charram) | |
| 416 | AM_RANGE(0x03000, 0x033ff) AM_MIRROR(0x0400) AM_RAM_WRITE(gottlieb_videoram_w) AM_BASE(&videoram) | |
| 417 | AM_RANGE(0x04000, 0x04fff) AM_RAM_WRITE(gottlieb_charram_w) AM_BASE(&gottlieb_charram) | |
| 418 | 418 | AM_RANGE(0x06000, 0x0601f) AM_WRITE(gottlieb_paletteram_w) AM_BASE(&paletteram) |
| 419 | 419 | AM_RANGE(0x07000, 0x07000) AM_READWRITE(input_port_0_r, watchdog_reset_w) /* DSW */ |
| 420 | 420 | AM_RANGE(0x07001, 0x07001) AM_READWRITE(input_port_1_r, gottlieb_track_reset_w) /* buttons */ |
| r2418 | r2419 | |
| 431 | 431 | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_REGION(REGION_CPU1, 0x1000) /* or ROM */ |
| 432 | 432 | AM_RANGE(0x02000, 0x02fff) AM_RAM AM_REGION(REGION_CPU1, 0x2000) /* or ROM */ |
| 433 | 433 | AM_RANGE(0x03000, 0x037ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) // argusg wants to check this |
| 434 | AM_RANGE(0x03800, 0x03bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, gottlieb_videoram_w) AM_BASE(&videoram) | |
| 435 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(SMH_RAM, gottlieb_charram_w) AM_BASE(&gottlieb_charram) | |
| 434 | AM_RANGE(0x03800, 0x03bff) AM_MIRROR(0x0400) AM_RAM_WRITE(gottlieb_videoram_w) AM_BASE(&videoram) | |
| 435 | AM_RANGE(0x04000, 0x04fff) AM_RAM_WRITE(gottlieb_charram_w) AM_BASE(&gottlieb_charram) | |
| 436 | 436 | AM_RANGE(0x05000, 0x0501f) AM_WRITE(gottlieb_paletteram_w) AM_BASE(&paletteram) |
| 437 | 437 | AM_RANGE(0x05800, 0x05800) AM_READWRITE(input_port_0_r, watchdog_reset_w) /* DSW */ |
| 438 | 438 | AM_RANGE(0x05801, 0x05801) AM_READWRITE(input_port_1_r, gottlieb_track_reset_w) /* buttons */ |
| r2418 | r2419 | |
| 2232 | 2232 | static DRIVER_INIT( stooges ) |
| 2233 | 2233 | { |
| 2234 | 2234 | gottlieb_sound_init(); |
| 2235 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05804, 0x05804, 0, 0, stooges_IN4_r); | |
| 2236 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, stooges_output_w); | |
| 2235 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05804, 0x05804, 0, 0, stooges_IN4_r); | |
| 2236 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, stooges_output_w); | |
| 2237 | 2237 | } |
| 2238 | 2238 | |
| 2239 | 2239 | static DRIVER_INIT( laserdsc ) |
| 2240 | 2240 | { |
| 2241 | 2241 | gottlieb_sound_init(); |
| 2242 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, usvsthem_video_outputs_w); /* OUT1 */ | |
| 2243 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05805, 0x05805, 0, 0, gottlieb_laserdisc_command_w); /* command for the player */ | |
| 2244 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05806, 0x05806, 0, 0, gottlieb_laserdisc_mpx_w); | |
| 2242 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, usvsthem_video_outputs_w); /* OUT1 */ | |
| 2243 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05805, 0x05805, 0, 0, gottlieb_laserdisc_command_w); /* command for the player */ | |
| 2244 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05806, 0x05806, 0, 0, gottlieb_laserdisc_mpx_w); | |
| 2245 | 2245 | } |
| 2246 | 2246 | |
| 2247 | 2247 |
| r2418 | r2419 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | AM_RANGE(0x700000, 0x70ffff) AM_RAM // RAM |
| 209 | 209 | AM_RANGE(0x200000, 0x20001f) AM_READWRITE(galpanib_calc_r,galpanib_calc_w) // Protection |
| 210 | AM_RANGE(0x300000, 0x30000f) AM_READWRITE(SMH_RAM, kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 211 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(SMH_RAM, kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 212 | AM_RANGE(0x401000, 0x401fff) AM_READWRITE(SMH_RAM, kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 210 | AM_RANGE(0x300000, 0x30000f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs | |
| 211 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(&kaneko16_vram_1) // Layers 0 | |
| 212 | AM_RANGE(0x401000, 0x401fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(&kaneko16_vram_0) // | |
| 213 | 213 | AM_RANGE(0x402000, 0x402fff) AM_RAM AM_BASE(&kaneko16_vscroll_1) // |
| 214 | 214 | AM_RANGE(0x403000, 0x403fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) // |
| 215 | 215 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(pandora_spriteram_LSB_r, pandora_spriteram_LSB_w ) // sprites |
| 216 | AM_RANGE(0x600000, 0x600fff) AM_R | |
| 216 | AM_RANGE(0x600000, 0x600fff) AM_R | |
| 217 | 217 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(sandscrp_coin_counter_w) // Coin Counters (Lockout unused) |
| 218 | 218 | AM_RANGE(0xb00000, 0xb00001) AM_READ(input_port_0_word_r) // Inputs |
| 219 | 219 | AM_RANGE(0xb00002, 0xb00003) AM_READ(input_port_1_word_r) // |
| r2418 | r2419 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | memory_set_bank(1, newbank); |
| 297 | 297 | if (newbank == 4 && oldbank != 4) |
| 298 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w); | |
| 298 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w); | |
| 299 | 299 | else if (newbank != 4 && oldbank == 4) |
| 300 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 300 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| r2418 | r2419 | |
| 497 | 497 | |
| 498 | 498 | static ADDRESS_MAP_START( ddragon_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 499 | 499 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&rambase) |
| 500 | AM_RANGE(0x1000, 0x11ff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 501 | AM_RANGE(0x1200, 0x13ff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 500 | AM_RANGE(0x1000, 0x11ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 501 | AM_RANGE(0x1200, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 502 | 502 | AM_RANGE(0x1400, 0x17ff) AM_RAM |
| 503 | AM_RANGE(0x1800, 0x1fff) AM_R | |
| 503 | AM_RANGE(0x1800, 0x1fff) AM_R | |
| 504 | 504 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) |
| 505 | AM_RANGE(0x3000, 0x37ff) AM_R | |
| 505 | AM_RANGE(0x3000, 0x37ff) AM_R | |
| 506 | 506 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) |
| 507 | 507 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) |
| 508 | 508 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_4_r) |
| r2418 | r2419 | |
| 519 | 519 | |
| 520 | 520 | static ADDRESS_MAP_START( dd2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 521 | 521 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 522 | AM_RANGE(0x1800, 0x1fff) AM_R | |
| 522 | AM_RANGE(0x1800, 0x1fff) AM_R | |
| 523 | 523 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) |
| 524 | AM_RANGE(0x3000, 0x37ff) AM_R | |
| 524 | AM_RANGE(0x3000, 0x37ff) AM_R | |
| 525 | 525 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) |
| 526 | 526 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) |
| 527 | 527 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_4_r) |
| r2418 | r2419 | |
| 531 | 531 | AM_RANGE(0x3809, 0x3809) AM_WRITE(SMH_RAM) AM_BASE(&ddragon_scrollx_lo) |
| 532 | 532 | AM_RANGE(0x380a, 0x380a) AM_WRITE(SMH_RAM) AM_BASE(&ddragon_scrolly_lo) |
| 533 | 533 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) |
| 534 | AM_RANGE(0x3c00, 0x3dff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 535 | AM_RANGE(0x3e00, 0x3fff) AM_READWRITE(SMH_RAM, paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 534 | AM_RANGE(0x3c00, 0x3dff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 535 | AM_RANGE(0x3e00, 0x3fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 536 | 536 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1) |
| 537 | 537 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 538 | 538 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 616 | 616 | |
| 617 | 617 | static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 618 | 618 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 619 | AM_RANGE(0x0000, 0x0007) AM_R | |
| 619 | AM_RANGE(0x0000, 0x0007) AM_R | |
| 620 | 620 | AM_RANGE(0x0008, 0x007f) AM_RAM |
| 621 | 621 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 622 | 622 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 1815 | 1815 | sound_irq = M6809_IRQ_LINE; |
| 1816 | 1816 | ym_irq = M6809_FIRQ_LINE; |
| 1817 | 1817 | technos_video_hw = 0; |
| 1818 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w); | |
| 1818 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w); | |
| 1819 | 1819 | } |
| 1820 | 1820 | |
| 1821 | 1821 | |
| r2418 | r2419 | |
| 1827 | 1827 | sound_irq = M6809_IRQ_LINE; |
| 1828 | 1828 | ym_irq = M6809_FIRQ_LINE; |
| 1829 | 1829 | technos_video_hw = 0; |
| 1830 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w); | |
| 1830 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w); | |
| 1831 | 1831 | |
| 1832 | 1832 | /* the program rom has a simple bitswap encryption */ |
| 1833 | 1833 | rom = memory_region(REGION_CPU1); |
| r2418 | r2419 | |
|---|---|---|
| 365 | 365 | AM_RANGE(0x082000, 0x082005) AM_WRITE(ac_bgscroll_w) |
| 366 | 366 | AM_RANGE(0x082100, 0x082105) AM_WRITE(ac_txscroll_w) |
| 367 | 367 | AM_RANGE(0x082208, 0x082209) AM_WRITE(ac_unk2_w) |
| 368 | AM_RANGE(0x0a0000, 0x0a3fff) AM_READWRITE(SMH_RAM, ac_bgvram_w) AM_BASE(&ac_bgvram) | |
| 369 | AM_RANGE(0x0b0000, 0x0b3fff) AM_READWRITE(SMH_RAM, ac_txvram_w) AM_BASE(&ac_txvram) | |
| 370 | AM_RANGE(0x0b8000, 0x0bffff) AM_READWRITE(SMH_RAM, paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 368 | AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(ac_bgvram_w) AM_BASE(&ac_bgvram) | |
| 369 | AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(ac_txvram_w) AM_BASE(&ac_txvram) | |
| 370 | AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 371 | 371 | AM_RANGE(0x0f0000, 0x0f7fff) AM_RAM |
| 372 | 372 | AM_RANGE(0x0f8000, 0x0f8fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 373 | 373 | AM_RANGE(0x0f9000, 0x0fffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 189 | 189 | AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(K053245_word_r, K053245_word_w) |
| 190 | 190 | AM_RANGE(0x180800, 0x180fff) AM_RAM // extra RAM, or mirror for the above? |
| 191 | 191 | AM_RANGE(0x200000, 0x20000f) AM_READWRITE(K053244_word_r, K053244_word_w) |
| 192 | AM_RANGE(0x280000, 0x280fff) AM_R | |
| 192 | AM_RANGE(0x280000, 0x280fff) AM_R | |
| 193 | 193 | AM_RANGE(0x300000, 0x30001f) AM_READWRITE(K053244_lsb_r, K053244_lsb_w) |
| 194 | 194 | AM_RANGE(0x380000, 0x380001) AM_READ(input_port_0_word_r) |
| 195 | 195 | AM_RANGE(0x380002, 0x380003) AM_READ(control1_r) |
| r2418 | r2419 | |
|---|---|---|
| 161 | 161 | static ADDRESS_MAP_START( ppmast93_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 162 | 162 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) AM_WRITENOP AM_REGION(REGION_CPU1, 0x10000) |
| 163 | 163 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) |
| 164 | AM_RANGE(0xd000, 0xd7ff) AM_RAM | |
| 164 | AM_RANGE(0xd000, 0xd7ff) AM_RAM | |
| 165 | 165 | AM_RANGE(0xd800, 0xdfff) AM_WRITENOP |
| 166 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 166 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 167 | 167 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 168 | 168 | ADDRESS_MAP_END |
| 169 | 169 |
| r2418 | r2419 | |
|---|---|---|
| 1829 | 1829 | /* it seems that Mahjong Jogakuen runs on the same board as the others, |
| 1830 | 1830 | but with just these two addresses swapped. Instead of creating a new |
| 1831 | 1831 | MachineDriver, I just fix them here. */ |
| 1832 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8007, 0x8007, 0, 0, pteacher_blitter_bank_w); | |
| 1833 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8005, 0x8005, 0, 0, pteacher_gfx_bank_w); | |
| 1832 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8007, 0x8007, 0, 0, pteacher_blitter_bank_w); | |
| 1833 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8005, 0x8005, 0, 0, pteacher_gfx_bank_w); | |
| 1834 | 1834 | } |
| 1835 | 1835 | |
| 1836 | 1836 | static DRIVER_INIT( mjikaga ) |
| 1837 | 1837 | { |
| 1838 | 1838 | /* Mahjong Ikagadesuka is different as well. */ |
| 1839 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7802, 0x7802, 0, 0, pteacher_snd_r); | |
| 1840 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0123, 0x0123, 0, 0, pteacher_snd_answer_w); | |
| 1839 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7802, 0x7802, 0, 0, pteacher_snd_r); | |
| 1840 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0123, 0x0123, 0, 0, pteacher_snd_answer_w); | |
| 1841 | 1841 | } |
| 1842 | 1842 | |
| 1843 | 1843 | static DRIVER_INIT( reikaids ) |
| r2418 | r2419 | |
|---|---|---|
| 1379 | 1379 | exidy_color_latch[0] = 0x09; |
| 1380 | 1380 | |
| 1381 | 1381 | /* the ROM is actually mapped high */ |
| 1382 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK1); | |
| 1382 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK1); | |
| 1383 | 1383 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xf800); |
| 1384 | 1384 | } |
| 1385 | 1385 |
| r2418 | r2419 | |
|---|---|---|
| 118 | 118 | AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w) AM_BASE(&xxmissio_bgram) |
| 119 | 119 | AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM AM_BASE(&xxmissio_spriteram) |
| 120 | 120 | |
| 121 | AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM | |
| 121 | AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM | |
| 122 | 122 | |
| 123 | 123 | AM_RANGE(0xe000, 0xefff) AM_SHARE(5) AM_RAM |
| 124 | 124 | AM_RANGE(0xf000, 0xffff) AM_SHARE(6) AM_RAM |
| r2418 | r2419 | |
| 145 | 145 | AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w) |
| 146 | 146 | AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM |
| 147 | 147 | |
| 148 | AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM | |
| 148 | AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM | |
| 149 | 149 | |
| 150 | 150 | AM_RANGE(0xe000, 0xefff) AM_SHARE(6) AM_RAM |
| 151 | 151 | AM_RANGE(0xf000, 0xffff) AM_SHARE(5) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 928 | 928 | // Video |
| 929 | 929 | AM_RANGE(0x20000000, 0x2000bfff) AM_RAM AM_BASE(&hng64_spriteram) // Sprites |
| 930 | 930 | AM_RANGE(0x20010000, 0x20010013) AM_READ(hng64_random_read) |
| 931 | AM_RANGE(0x20100000, 0x2017ffff) AM_R | |
| 931 | AM_RANGE(0x20100000, 0x2017ffff) AM_R | |
| 932 | 932 | AM_RANGE(0x20190000, 0x20190037) AM_RAM AM_BASE(&hng64_videoregs) // Video Registers |
| 933 | 933 | AM_RANGE(0x20200000, 0x20203fff) AM_READWRITE(SMH_RAM,hng64_pal_w) AM_BASE(&paletteram32) // Palette |
| 934 | 934 | AM_RANGE(0x20208000, 0x2020805f) AM_READWRITE(tcram_r, tcram_w) AM_BASE(&hng64_tcram) // Transition Control |
| r2418 | r2419 | |
|---|---|---|
| 53 | 53 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 54 | 54 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 55 | 55 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 56 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(SMH_RAM, solomon_colorram_w) AM_BASE(&colorram) | |
| 57 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(SMH_RAM, solomon_videoram_w) AM_BASE(&videoram) | |
| 58 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, solomon_colorram2_w) AM_BASE(&solomon_colorram2) | |
| 59 | AM_RANGE(0xdc00, 0xdfff) AM_READWRITE(SMH_RAM, solomon_videoram2_w) AM_BASE(&solomon_videoram2) | |
| 56 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(solomon_colorram_w) AM_BASE(&colorram) | |
| 57 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(solomon_videoram_w) AM_BASE(&videoram) | |
| 58 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(solomon_colorram2_w) AM_BASE(&solomon_colorram2) | |
| 59 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(solomon_videoram2_w) AM_BASE(&solomon_videoram2) | |
| 60 | 60 | AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 61 | AM_RANGE(0xe400, 0xe5ff) AM_R | |
| 61 | AM_RANGE(0xe400, 0xe5ff) AM_R | |
| 62 | 62 | AM_RANGE(0xe600, 0xe600) AM_READ(input_port_0_r) |
| 63 | 63 | AM_RANGE(0xe601, 0xe601) AM_READ(input_port_1_r) |
| 64 | 64 | AM_RANGE(0xe602, 0xe602) AM_READ(input_port_2_r) |
| r2418 | r2419 | |
|---|---|---|
| 683 | 683 | |
| 684 | 684 | static DRIVER_INIT( macrossp ) |
| 685 | 685 | { |
| 686 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf10158, 0xf1015b, 0, 0, macrossp_speedup_w ); | |
| 686 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf10158, 0xf1015b, 0, 0, macrossp_speedup_w ); | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | static DRIVER_INIT( quizmoon ) |
| r2418 | r2419 | |
|---|---|---|
| 386 | 386 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 387 | 387 | AM_RANGE(0xc000, 0xcbff) AM_RAM AM_BASE(&spriteram) |
| 388 | 388 | AM_RANGE(0xcc00, 0xcfff) AM_WRITE(ppking_video_registers_w) |
| 389 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(SMH_RAM, gladiatr_paletteram_w) AM_BASE(&paletteram) | |
| 390 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(SMH_RAM, gladiatr_videoram_w) AM_BASE(&gladiatr_videoram) | |
| 391 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, gladiatr_colorram_w) AM_BASE(&gladiatr_colorram) | |
| 392 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, gladiatr_textram_w) AM_BASE(&gladiatr_textram) | |
| 389 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(gladiatr_paletteram_w) AM_BASE(&paletteram) | |
| 390 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(gladiatr_videoram_w) AM_BASE(&gladiatr_videoram) | |
| 391 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(gladiatr_colorram_w) AM_BASE(&gladiatr_colorram) | |
| 392 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(gladiatr_textram_w) AM_BASE(&gladiatr_textram) | |
| 393 | 393 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */ |
| 394 | 394 | ADDRESS_MAP_END |
| 395 | 395 | |
| r2418 | r2419 | |
| 425 | 425 | AM_RANGE(0x6000, 0xbfff) AM_ROMBANK(1) |
| 426 | 426 | AM_RANGE(0xc000, 0xcbff) AM_RAM AM_BASE(&spriteram) |
| 427 | 427 | AM_RANGE(0xcc00, 0xcfff) AM_WRITE(gladiatr_video_registers_w) |
| 428 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(SMH_RAM, gladiatr_paletteram_w) AM_BASE(&paletteram) | |
| 429 | AM_RANGE(0xd800, 0xdfff) AM_READWRITE(SMH_RAM, gladiatr_videoram_w) AM_BASE(&gladiatr_videoram) | |
| 430 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, gladiatr_colorram_w) AM_BASE(&gladiatr_colorram) | |
| 431 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, gladiatr_textram_w) AM_BASE(&gladiatr_textram) | |
| 428 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(gladiatr_paletteram_w) AM_BASE(&paletteram) | |
| 429 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(gladiatr_videoram_w) AM_BASE(&gladiatr_videoram) | |
| 430 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(gladiatr_colorram_w) AM_BASE(&gladiatr_colorram) | |
| 431 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(gladiatr_textram_w) AM_BASE(&gladiatr_textram) | |
| 432 | 432 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */ |
| 433 | 433 | ADDRESS_MAP_END |
| 434 | 434 | |
| r2418 | r2419 | |
| 1039 | 1039 | } |
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf6a3,0xf6a3,0,0, f6a3_r ); | |
| 1042 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf6a3,0xf6a3,0,0, f6a3_r ); | |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 |
| r2418 | r2419 | |
|---|---|---|
| 40 | 40 | & reset |
| 41 | 41 | - Scrolling in Cuby Bop's Game seems incorrect. |
| 42 | 42 | |
| 43 | puzznici note | |
| 44 | - this set is a bootleg, it uses a converted board without the MCU and has | |
| 45 | a hacked copyright message. The tilemap data for one of the girls appears | |
| 46 | to be corrupt, however this is correct, the bootleggers overwrote part of | |
| 47 | the data with the expected response sequence from the MCU in order to simulate | |
| 48 | it. | |
| 49 | ||
| 43 | 50 | */ |
| 44 | 51 | |
| 45 | 52 | |
| r2418 | r2419 | |
| 939 | 946 | AM_RANGE(0xbc00, 0xbc00) AM_WRITE(SMH_NOP) // Control register, function unknown |
| 940 | 947 | ADDRESS_MAP_END |
| 941 | 948 | |
| 949 | /* bootleg, doesn't have the MCU */ | |
| 950 | static ADDRESS_MAP_START( puzznici_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 951 | COMMON_BANKS_READ | |
| 952 | COMMON_SINGLE_READ | |
| 953 | AM_RANGE(0xa800, 0xa800) AM_READ(SMH_NOP) // Watchdog | |
| 954 | AM_RANGE(0xb000, 0xb7ff) AM_READ(SMH_RAM) // Wrong, used to overcome protection | |
| 955 | // AM_RANGE(0xb800, 0xb800) AM_READ(mcu_data_r) | |
| 956 | AM_RANGE(0xb801, 0xb801) AM_READ(mcu_control_r) | |
| 957 | ADDRESS_MAP_END | |
| 942 | 958 | |
| 959 | static ADDRESS_MAP_START( puzznici_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 960 | COMMON_BANKS_WRITE | |
| 961 | COMMON_SINGLE_WRITE | |
| 962 | AM_RANGE(0xb000, 0xb7ff) AM_WRITE(SMH_RAM) // Wrong, used to overcome protection | |
| 963 | // AM_RANGE(0xb800, 0xb800) AM_WRITE(mcu_data_w) | |
| 964 | // AM_RANGE(0xb801, 0xb801) AM_WRITE(mcu_control_w) | |
| 965 | AM_RANGE(0xbc00, 0xbc00) AM_WRITE(SMH_NOP) // Control register, function unknown | |
| 966 | ADDRESS_MAP_END | |
| 967 | ||
| 968 | ||
| 943 | 969 | static ADDRESS_MAP_START( plotting_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 944 | 970 | COMMON_BANKS_READ |
| 945 | 971 | COMMON_SINGLE_READ |
| r2418 | r2419 | |
| 2477 | 2503 | MDRV_MACHINE_RESET(puzznic) |
| 2478 | 2504 | MACHINE_DRIVER_END |
| 2479 | 2505 | |
| 2506 | static MACHINE_DRIVER_START( puzznici ) | |
| 2480 | 2507 | |
| 2508 | /* basic machine hardware */ | |
| 2509 | MDRV_IMPORT_FROM(plotting) | |
| 2510 | MDRV_CPU_MODIFY("main") | |
| 2511 | MDRV_CPU_PROGRAM_MAP(puzznici_readmem,puzznici_writemem) | |
| 2512 | ||
| 2513 | MDRV_MACHINE_RESET(puzznic) | |
| 2514 | MACHINE_DRIVER_END | |
| 2515 | ||
| 2516 | ||
| 2481 | 2517 | static MACHINE_DRIVER_START( horshoes ) |
| 2482 | 2518 | |
| 2483 | 2519 | /* basic machine hardware */ |
| r2418 | r2419 | |
| 2893 | 2929 | ROM_LOAD( "u09.ic9", 0x20000, 0x20000, CRC(3c115f8b) SHA1(8d518be01b7c4d6d993d5d9b62aab719a5c8baca) ) |
| 2894 | 2930 | ROM_END |
| 2895 | 2931 | |
| 2896 | ROM_START( puzznici ) | |
| 2932 | ROM_START( puzznici ) /* bootleg */ | |
| 2897 | 2933 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) |
| 2898 | 2934 | ROM_LOAD( "1.ic11", 0x00000, 0x20000, CRC(4612f5e0) SHA1(dc07a365414666568537d31ef01b58f2362cadaf) ) |
| 2899 | 2935 | ROM_RELOAD( 0x10000, 0x20000 ) |
| 2900 | 2936 | |
| 2901 | ROM_REGION( 0x0800, REGION_CPU2, 0 ) /* 2k for the microcontroller */ | |
| 2902 | ROM_LOAD( "mc68705p", 0x0000, 0x0800, NO_DUMP ) | |
| 2903 | ||
| 2904 | 2937 | ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 2905 | 2938 | ROM_LOAD( "u10.ic10", 0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) ) |
| 2906 | 2939 | ROM_LOAD( "3.ic9", 0x20000, 0x20000, CRC(2bf5232a) SHA1(a8fc06bb8bae2ca6bd21e3a96c9ed38bb356d5d7) ) |
| r2418 | r2419 | |
| 3056 | 3089 | { |
| 3057 | 3090 | UINT8 *ROM = memory_region(REGION_CPU2); |
| 3058 | 3091 | ROM[0x72]=0x45; /* reti -> retn ('dead' loop @ $1104 )*/ |
| 3059 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w); | |
| 3092 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w); | |
| 3060 | 3093 | } |
| 3061 | 3094 | |
| 3062 | 3095 | |
| r2418 | r2419 | |
| 3078 | 3111 | GAME( 1989, flipull, plotting, plotting, plotting, 0, ROT0, "Taito Corporation", "Flipull (Japan)", 0 ) |
| 3079 | 3112 | GAME( 1989, puzznic, 0, puzznic, puzznic, 0, ROT0, "Taito Corporation Japan", "Puzznic (World)", 0 ) |
| 3080 | 3113 | GAME( 1989, puzznicj, puzznic, puzznic, puzznic, 0, ROT0, "Taito Corporation", "Puzznic (Japan)", 0 ) |
| 3081 | GAME( 1989, puzznici, puzznic, puzznic, | |
| 3114 | GAME( 1989, puzznici, puzznic, puzznici, | |
| 3082 | 3115 | GAME( 1990, horshoes, 0, horshoes, horshoes, 0, ROT270, "Taito America Corporation", "American Horseshoes (US)", 0 ) |
| 3083 | 3116 | GAME( 1990, palamed, 0, palamed, palamed, 0, ROT0, "Taito Corporation", "Palamedes (Japan)", 0 ) |
| 3084 | 3117 | GAME( 1993, cachat, 0, cachat, cachat, 0, ROT0, "Taito Corporation", "Cachat (Japan)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 100 | 100 | AM_RANGE(0x0000, 0x0000) AM_READ(gyruss_scanline_r) |
| 101 | 101 | AM_RANGE(0x2000, 0x2000) AM_WRITE(interrupt_enable_w) |
| 102 | 102 | AM_RANGE(0x4000, 0x403f) AM_RAM |
| 103 | AM_RANGE(0x4040, 0x40ff) AM_R | |
| 103 | AM_RANGE(0x4040, 0x40ff) AM_R | |
| 104 | 104 | AM_RANGE(0x4100, 0x47ff) AM_RAM |
| 105 | 105 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_SHARE(1) |
| 106 | 106 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| r2418 | r2419 | |
|---|---|---|
| 497 | 497 | int data; |
| 498 | 498 | |
| 499 | 499 | /* Speedup handlers */ |
| 500 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x20b574, 0x20b577, 0, 0, irq_speedup_r_groundfx); | |
| 500 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20b574, 0x20b577, 0, 0, irq_speedup_r_groundfx); | |
| 501 | 501 | |
| 502 | 502 | /* make piv tile GFX format suitable for gfxdecode */ |
| 503 | 503 | offset = size/2; |
| r2418 | r2419 | |
|---|---|---|
| 53 | 53 | #include "machine/idectrl.h" |
| 54 | 54 | #include "cpu/i386/i386.h" |
| 55 | 55 | |
| 56 | static void ide_interrupt(const device_config *device, int state); | |
| 57 | ||
| 56 | 58 | static UINT32 *cga_ram; |
| 57 | 59 | static UINT32 *bios_ram; |
| 58 | 60 | |
| r2418 | r2419 | |
| 311 | 313 | |
| 312 | 314 | |
| 313 | 315 | |
| 314 | static READ32_HANDLER( ide | |
| 316 | static READ32_DEVICE_HANDLER( ide | |
| 315 | 317 | { |
| 316 | return ide_controller32_ | |
| 318 | return ide_controller32_ | |
| 317 | 319 | } |
| 318 | 320 | |
| 319 | static WRITE32_HANDLER( ide | |
| 321 | static WRITE32_DEVICE_HANDLER( ide | |
| 320 | 322 | { |
| 321 | ide_controller32_ | |
| 323 | ide_controller32_ | |
| 322 | 324 | } |
| 323 | 325 | |
| 324 | static READ32_HANDLER( fdc_r ) | |
| 326 | static READ32_DEVICE_HANDLER( fdc_r ) | |
| 325 | 327 | { |
| 326 | return ide_controller32_ | |
| 328 | return ide_controller32_ | |
| 327 | 329 | } |
| 328 | 330 | |
| 329 | static WRITE32_HANDLER( fdc_w ) | |
| 331 | static WRITE32_DEVICE_HANDLER( fdc_w ) | |
| 330 | 332 | { |
| 331 | 333 | //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask); |
| 332 | ide_controller32_ | |
| 334 | ide_controller32_ | |
| 333 | 335 | } |
| 334 | 336 | |
| 335 | 337 | |
| r2418 | r2419 | |
| 488 | 490 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", gamecstl_pic8259_32le_r, gamecstl_pic8259_32le_w) |
| 489 | 491 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 490 | 492 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| 491 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide | |
| 493 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide | |
| 492 | 494 | AM_RANGE(0x0300, 0x03af) AM_NOP |
| 493 | 495 | AM_RANGE(0x03b0, 0x03df) AM_NOP |
| 494 | 496 | AM_RANGE(0x0278, 0x027b) AM_WRITE(pnp_config_w) |
| 495 | AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w) | |
| 497 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w) | |
| 496 | 498 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE(pnp_data_w) |
| 497 | 499 | AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w) |
| 498 | 500 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 572 | 574 | |
| 573 | 575 | cpunum_set_irq_callback(0, irq_callback); |
| 574 | 576 | |
| 575 | gamecstl_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 576 | gamecstl_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 577 | gamecstl_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 578 | gamecstl_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 579 | gamecstl_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 577 | gamecstl_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); | |
| 578 | gamecstl_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); | |
| 579 | gamecstl_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); | |
| 580 | gamecstl_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); | |
| 581 | gamecstl_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); | |
| 580 | 582 | } |
| 581 | 583 | |
| 582 | 584 | |
| r2418 | r2419 | |
| 660 | 662 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 661 | 663 | MDRV_DEVICE_CONFIG( gamecstl_pic8259_2_config ) |
| 662 | 664 | |
| 665 | MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt) | |
| 666 | ||
| 663 | 667 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 664 | 668 | |
| 665 | 669 | /* video hardware */ |
| r2418 | r2419 | |
| 700 | 704 | pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state); |
| 701 | 705 | } |
| 702 | 706 | |
| 703 | static void ide_interrupt(int state) | |
| 707 | static void ide_interrupt(const device_config *device, int state) | |
| 704 | 708 | { |
| 705 | 709 | pic8259_set_irq_line( gamecstl_devices.pic8259_2, 6, state); |
| 706 | 710 | } |
| r2418 | r2419 | |
| 714 | 718 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2 |
| 715 | 719 | }; |
| 716 | 720 | |
| 717 | static const struct ide_interface ide_intf = | |
| 718 | { | |
| 719 | ide_interrupt | |
| 720 | }; | |
| 721 | ||
| 722 | 721 | static void gamecstl_set_keyb_int(int state) { |
| 723 | 722 | pic8259_set_irq_line(gamecstl_devices.pic8259_1, 1, state); |
| 724 | 723 | } |
| r2418 | r2419 | |
| 737 | 736 | pci_add_device(0, 7, &intel82371ab); |
| 738 | 737 | |
| 739 | 738 | kbdc8042_init(&at8042); |
| 740 | ||
| 741 | ide_controller_init(0, &ide_intf); | |
| 742 | 739 | } |
| 743 | 740 | |
| 744 | 741 | /*****************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 116 | 116 | static MACHINE_START( kangaroo_mcu ) |
| 117 | 117 | { |
| 118 | 118 | MACHINE_START_CALL(kangaroo); |
| 119 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w); | |
| 119 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w); | |
| 120 | 120 | kangaroo_clock = 0; |
| 121 | 121 | } |
| 122 | 122 |
| r2418 | r2419 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "cpu/cdp1802/cdp1802.h" |
| 4 | 3 | #include "cpu/cop400/cop400.h" |
| 5 | 4 | #include "video/cdp1869.h" |
| r2418 | r2419 | |
| 20 | 19 | |
| 21 | 20 | /* CDP1802 Interface */ |
| 22 | 21 | |
| 23 | static | |
| 22 | static CDP1802_MODE_READ( cidelsa_mode_r | |
| 24 | 23 | { |
| 25 | cidelsa_state *state = | |
| 24 | cidelsa_state *state = machine->driver_data; | |
| 26 | 25 | |
| 27 | 26 | return state->cdp1802_mode; |
| 28 | 27 | } |
| 29 | 28 | |
| 30 | static | |
| 29 | static CDP1802_EF_READ( cidelsa_ef_r | |
| 31 | 30 | { |
| 32 | 31 | /* |
| 33 | 32 | EF1 CDP1869 _PRD |
| r2418 | r2419 | |
| 36 | 35 | EF4 Coin 1 |
| 37 | 36 | */ |
| 38 | 37 | |
| 39 | return input_port_read( | |
| 38 | return input_port_read(machine, "EF"); | |
| 40 | 39 | } |
| 41 | 40 | |
| 42 | static | |
| 41 | static CDP1802_Q_WRITE( cidelsa_q_w | |
| 43 | 42 | { |
| 44 | cidelsa_state *state = | |
| 43 | cidelsa_state *state = machine->driver_data; | |
| 45 | 44 | |
| 46 | state->cdp1802_q = | |
| 45 | state->cdp1802_q = level; | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | static const | |
| 48 | static const cdp1802_interface cidelsa_cdp1802_config = | |
| 50 | 49 | { |
| 51 | 50 | cidelsa_mode_r, // MODE |
| 52 | 51 | cidelsa_ef_r, // EF |
| r2418 | r2419 | |
| 669 | 668 | |
| 670 | 669 | /* Game Drivers */ |
| 671 | 670 | |
| 672 | GAME( 1980, destryer, 0, destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 673 | GAME( 1980, destryea, destryer, destryea, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 674 | GAME( 1981, altair, 0, altair, altair, 0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 671 | GAME( 1980, destryer, 0, destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 672 | GAME( 1980, destryea, destryer, destryea, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 673 | GAME( 1981, altair, 0, altair, altair, 0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 675 | 674 | GAME( 1981, draco, 0, draco, draco, 0, ROT90, "Cidelsa", "Draco", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r2418 | r2419 | |
|---|---|---|
| 192 | 192 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 193 | 193 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 194 | 194 | AM_RANGE(0xe800, 0xe87f) AM_RAM |
| 195 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 195 | AM_RANGE(0xe900, 0xe9ff) AM_RAM | |
| 196 | 196 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 197 | 197 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 198 | 198 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 49 | 49 | AM_RANGE(0xe001, 0xe001) AM_READ(input_port_4_r) |
| 50 | 50 | AM_RANGE(0xe800, 0xe800) AM_WRITE(suprloco_soundport_w) |
| 51 | 51 | AM_RANGE(0xe801, 0xe801) AM_READWRITE(suprloco_control_r, suprloco_control_w) |
| 52 | AM_RANGE(0xf000, 0xf6ff) AM_RAM | |
| 52 | AM_RANGE(0xf000, 0xf6ff) AM_RAM | |
| 53 | 53 | AM_RANGE(0xf700, 0xf7df) AM_RAM /* unused */ |
| 54 | AM_RANGE(0xf7e0, 0xf7ff) AM_RAM | |
| 54 | AM_RANGE(0xf7e0, 0xf7ff) AM_RAM | |
| 55 | 55 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 56 | 56 | ADDRESS_MAP_END |
| 57 | 57 |
| r2418 | r2419 | |
|---|---|---|
| 368 | 368 | /* appears to be an earlier board */ |
| 369 | 369 | static ADDRESS_MAP_START( lethalth_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 370 | 370 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 371 | AM_RANGE(0x80000, 0x8ffff) AM_R | |
| 371 | AM_RANGE(0x80000, 0x8ffff) AM_R | |
| 372 | 372 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 373 | 373 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 374 | 374 | AM_RANGE(0xf8800, 0xf8fff) AM_READWRITE(m92_paletteram_r, m92_paletteram_w) |
| r2418 | r2419 | |
| 381 | 381 | AM_RANGE(0x00000, 0x9ffff) AM_ROM |
| 382 | 382 | AM_RANGE(0xa0000, 0xbffff) AM_ROMBANK(1) |
| 383 | 383 | AM_RANGE(0xc0000, 0xcffff) AM_ROMBANK(2) /* Mirror of rom: Used by In The Hunt as protection */ |
| 384 | AM_RANGE(0xd0000, 0xdffff) AM_R | |
| 384 | AM_RANGE(0xd0000, 0xdffff) AM_R | |
| 385 | 385 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 386 | 386 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 387 | 387 | AM_RANGE(0xf8800, 0xf8fff) AM_READWRITE(m92_paletteram_r, m92_paletteram_w) |
| r2418 | r2419 | |
| 2060 | 2060 | init_m92(machine, 1); |
| 2061 | 2061 | |
| 2062 | 2062 | /* This game has an eprom on the game board */ |
| 2063 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r); | |
| 2064 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_w); | |
| 2063 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r, m92_eeprom_w); | |
| 2065 | 2064 | |
| 2066 | 2065 | m92_game_kludge=2; |
| 2067 | 2066 | } |
| r2418 | r2419 | |
| 2083 | 2082 | m92_irq_vectorbase=0x20; |
| 2084 | 2083 | |
| 2085 | 2084 | /* NOP out the bankswitcher */ |
| 2086 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, SMH_NOP); | |
| 2085 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, SMH_NOP); | |
| 2087 | 2086 | } |
| 2088 | 2087 | |
| 2089 | 2088 | static DRIVER_INIT( nbbatman ) |
| r2418 | r2419 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | static ADDRESS_MAP_START( yard_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 27 | 27 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 28 | AM_RANGE(0x8000, 0x8fff) AM_RAM | |
| 28 | AM_RANGE(0x8000, 0x8fff) AM_RAM | |
| 29 | 29 | AM_RANGE(0x9000, 0x9fff) AM_WRITE(yard_scroll_panel_w) |
| 30 | 30 | AM_RANGE(0xc820, 0xc87f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 31 | 31 | AM_RANGE(0xa000, 0xa000) AM_RAM AM_BASE(&yard_scroll_x_low) |
| r2418 | r2419 | |
|---|---|---|
| 97 | 97 | /* prototypes */ |
| 98 | 98 | static MACHINE_RESET( vendetta ); |
| 99 | 99 | static void vendetta_banking( int lines ); |
| 100 | static void vendetta_video_banking( int select ); | |
| 100 | static void vendetta_video_banking( running_machine *machine, int select ); | |
| 101 | 101 | |
| 102 | 102 | VIDEO_START( vendetta ); |
| 103 | 103 | VIDEO_START( esckids ); |
| r2418 | r2419 | |
| 183 | 183 | |
| 184 | 184 | irq_enabled = ( data >> 6 ) & 1; |
| 185 | 185 | |
| 186 | vendetta_video_banking( data & 1 ); | |
| 186 | vendetta_video_banking( machine, data & 1 ); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /********************************************/ |
| r2418 | r2419 | |
| 201 | 201 | |
| 202 | 202 | static offs_t video_banking_base; |
| 203 | 203 | |
| 204 | static void vendetta_video_banking( int select ) | |
| 204 | static void vendetta_video_banking( running_machine *machine, int select ) | |
| 205 | 205 | { |
| 206 | 206 | if ( select & 1 ) |
| 207 | 207 | { |
| 208 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, SMH_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w ); | |
| 209 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w ); | |
| 208 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, SMH_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w ); | |
| 209 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w ); | |
| 210 | 210 | memory_set_bankptr(4, paletteram); |
| 211 | 211 | } |
| 212 | 212 | else |
| 213 | 213 | { |
| 214 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w ); | |
| 215 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w ); | |
| 214 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w ); | |
| 215 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w ); | |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| r2418 | r2419 | |
| 848 | 848 | |
| 849 | 849 | /* init banks */ |
| 850 | 850 | memory_set_bankptr( 1, &memory_region(REGION_CPU1)[0x10000] ); |
| 851 | vendetta_video_banking( 0 ); | |
| 851 | vendetta_video_banking( machine, 0 ); | |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | 854 |
| r2418 | r2419 | |
|---|---|---|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | |
| 1031 | static void system16b_generic_init(int _rom_board) | |
| 1031 | static void system16b_generic_init(running_machine *machine, int _rom_board) | |
| 1032 | 1032 | { |
| 1033 | 1033 | /* set the ROM board */ |
| 1034 | 1034 | rom_board = _rom_board; |
| r2418 | r2419 | |
| 1041 | 1041 | workram = auto_malloc(0x04000); |
| 1042 | 1042 | |
| 1043 | 1043 | /* init the memory mapper */ |
| 1044 | segaic16_memory_mapper_init(0, region_info_list[rom_board], sound_w, NULL); | |
| 1044 | segaic16_memory_mapper_init(machine, 0, region_info_list[rom_board], sound_w, NULL); | |
| 1045 | 1045 | |
| 1046 | 1046 | /* init the FD1094 */ |
| 1047 | 1047 | fd1094_driver_init(segaic16_memory_mapper_set_decrypted); |
| r2418 | r2419 | |
| 1077 | 1077 | static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 }; |
| 1078 | 1078 | int i; |
| 1079 | 1079 | |
| 1080 | segaic16_memory_mapper_reset(); | |
| 1080 | segaic16_memory_mapper_reset(machine); | |
| 1081 | 1081 | if (i8751_initial_config != NULL) |
| 1082 | segaic16_memory_mapper_config(i8751_initial_config); | |
| 1082 | segaic16_memory_mapper_config(machine, i8751_initial_config); | |
| 1083 | 1083 | segaic16_tilemap_reset(0); |
| 1084 | 1084 | |
| 1085 | 1085 | fd1094_machine_init(); |
| r2418 | r2419 | |
| 5048 | 5048 | ROM_LOAD16_BYTE( "opr11862.b1", 0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) ) |
| 5049 | 5049 | ROM_LOAD16_BYTE( "opr11865.b5", 0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) ) |
| 5050 | 5050 | ROM_LOAD16_BYTE( "opr11863.b2", 0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) ) |
| 5051 | // only 1 byte different, probably bad | |
| 5052 | // ROM_LOAD16_BYTE( "17.2b", 0x20001, 0x10000, CRC(66f38725) SHA1(f12076cc5a2ed66cbd7182a3786087121ec65b5c) ) | |
| 5053 | 5051 | ROM_LOAD16_BYTE( "opr11866.b6", 0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) ) |
| 5054 | 5052 | ROM_LOAD16_BYTE( "opr11864.b3", 0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) ) |
| 5055 | 5053 | ROM_LOAD16_BYTE( "opr11867.b7", 0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) ) |
| r2418 | r2419 | |
| 5288 | 5286 | ************************************************************************************************************************** |
| 5289 | 5287 | ************************************************************************************************************************** |
| 5290 | 5288 | |
| 5291 | Currently there is a bad dump (except for the sound CPU code) of the following set which needs redumping: | |
| 5292 | ||
| 5293 | 5289 | Shinobi, Sega System 16B |
| 5294 | CPU: 68000 + MC8123B (317-0054) | |
| 5295 | Program roms: epr-11355.a5 & epr-11356.a7 | |
| 5296 | Tiles: mpr-11363.a14, mpr-11364.a15 & mpr-11365.a16 | |
| 5297 | Sprites: mpr-11366.b1, mpr-11367.b2, mpr-11368.b5 & mpr-11369.b6 | |
| 5298 | Sound CPU Code: epr-11377.a10 (Sound CPU is MC8123B, 317-0054 | When decrypted it matches eprxxxxx.a10 of shinobi4) | |
| 5299 | Sound Data: mpr-11362.a11 | |
| 5290 | CPU: 68000 | |
| 5291 | ROM Board: 171-5521 | |
| 5292 | */ | |
| 5293 | ROM_START( shinobi5 ) | |
| 5294 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */ | |
| 5295 | ROM_LOAD16_BYTE( "epr11360.a7", 0x00000, 0x20000, CRC(b1f67ab9) SHA1(83eddd1ef3fbe58f1f8e8d57229fabf1907fc371) ) | |
| 5296 | ROM_LOAD16_BYTE( "epr11359.a5", 0x00001, 0x20000, CRC(0f0306e1) SHA1(eebe7c88e5f665d1d0920fb9b545e20b05be9b52) ) | |
| 5300 | 5297 | |
| 5301 | ************************************************************************************************************************** | |
| 5298 | ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */ | |
| 5299 | ROM_LOAD( "epr11363.a14", 0x00000, 0x20000, CRC(40914168) SHA1(cf0508e8c852c24ec3d2fc4a4013aec631d2271f) ) | |
| 5300 | ROM_LOAD( "epr11364.a15", 0x20000, 0x20000, CRC(e63649a4) SHA1(042dded1ff964889571f63d2642b2b21b75f9763) ) | |
| 5301 | ROM_LOAD( "epr11365.a16", 0x40000, 0x20000, CRC(1ef55d20) SHA1(314590881a2f18339b7b9c16010e408aa0164e04) ) | |
| 5302 | 5302 | |
| 5303 | ROM_REGION16_BE( 0x80000, REGION_GFX2, 0 ) /* sprites */ | |
| 5304 | ROM_LOAD16_BYTE( "epr11366.b1", 0x00001, 0x20000, CRC(319ede73) SHA1(c48ba4694ff677f30cc1ced3a3ad11c0feb1122d) ) | |
| 5305 | ROM_LOAD16_BYTE( "epr11368.b5", 0x00000, 0x20000, CRC(0377d7ce) SHA1(14f9674c142b78bf8b458beccfef93cc3e722c03) ) | |
| 5306 | ROM_LOAD16_BYTE( "epr11367.b2", 0x40001, 0x20000, CRC(1d06c5c7) SHA1(3a44f5a2058b96f212930c2e838eda1ce1036818) ) | |
| 5307 | ROM_LOAD16_BYTE( "epr11369.b6", 0x40000, 0x20000, CRC(d751d2a2) SHA1(3659948beacfc8dde5c50775859aa3fed537f768) ) | |
| 5308 | ||
| 5309 | ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */ | |
| 5310 | ROM_LOAD( "epr11361.a10", 0x00000, 0x08000, CRC(1f47ebcb) SHA1(32837f3f1dd5ff309d1d955c1a738c444b248d3d) ) | |
| 5311 | ROM_LOAD( "epr11362.a11", 0x10000, 0x20000, CRC(256af749) SHA1(041bd007ea7708c6d69f07865828b9bd17a139f5) ) | |
| 5312 | ROM_END | |
| 5313 | ||
| 5314 | ||
| 5315 | /************************************************************************************************************************** | |
| 5316 | ||
| 5303 | 5317 | Shinobi, Sega System 16B |
| 5304 | CPU: 68000 | |
| 5318 | CPU: 68000 + MC8123B (317-0054) | |
| 5305 | 5319 | ROM Board: 171-5521 |
| 5320 | Game Nunmber: 834-6499-03 | |
| 5306 | 5321 | */ |
| 5307 | 5322 | ROM_START( shinobi4 ) |
| 5308 | 5323 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */ |
| 5309 | 5324 | ROM_LOAD16_BYTE( "epr11360.a7", 0x00000, 0x20000, CRC(b1f67ab9) SHA1(83eddd1ef3fbe58f1f8e8d57229fabf1907fc371) ) |
| 5310 | ROM_LOAD16_BYTE( "epr11359.a | |
| 5325 | ROM_LOAD16_BYTE( "epr11359.a5", 0x00001, 0x20000, CRC(0f0306e1) SHA1(eebe7c88e5f665d1d0920fb9b545e20b05be9b52) ) | |
| 5311 | 5326 | |
| 5312 | ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */ | |
| 5313 | ROM_LOAD( "epr11284.b9", 0x00000, 0x10000, CRC(5f62e163) SHA1(03f008745a1af84142ada647acf3601049f43ad5) ) | |
| 5314 | ROM_LOAD( "epr11285.b10", 0x10000, 0x10000, CRC(75f8fbc9) SHA1(29072edcd583af60ec66b4c8bb82b179a3751edf) ) | |
| 5315 | ROM_LOAD( "epr11286.b11", 0x20000, 0x10000, CRC(06508bb9) SHA1(57c9036123ec8e35d0275ab6eaff25a16aa203d4) ) | |
| 5327 | ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */ | |
| 5328 | ROM_LOAD( "epr11363.a14", 0x00000, 0x20000, CRC(40914168) SHA1(cf0508e8c852c24ec3d2fc4a4013aec631d2271f) ) | |
| 5329 | ROM_LOAD( "epr11364.a15", 0x20000, 0x20000, CRC(e63649a4) SHA1(042dded1ff964889571f63d2642b2b21b75f9763) ) | |
| 5330 | ROM_LOAD( "epr11365.a16", 0x40000, 0x20000, CRC(1ef55d20) SHA1(314590881a2f18339b7b9c16010e408aa0164e04) ) | |
| 5316 | 5331 | |
| 5317 | 5332 | ROM_REGION16_BE( 0x80000, REGION_GFX2, 0 ) /* sprites */ |
| 5318 | ROM_LOAD16_BYTE( "epr11290.10", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) ) | |
| 5319 | ROM_LOAD16_BYTE( "epr11294.11", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) ) | |
| 5320 | ROM_LOAD16_BYTE( "epr11291.17", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) ) | |
| 5321 | ROM_LOAD16_BYTE( "epr11295.18", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) ) | |
| 5322 | ROM_LOAD16_BYTE( "epr11292.23", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) ) | |
| 5323 | ROM_LOAD16_BYTE( "epr11296.24", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) ) | |
| 5324 | ROM_LOAD16_BYTE( "epr11293.29", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) ) | |
| 5325 | ROM_LOAD16_BYTE( "epr11297.30", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) ) | |
| 5333 | ROM_LOAD16_BYTE( "epr11366.b1", 0x00001, 0x20000, CRC(319ede73) SHA1(c48ba4694ff677f30cc1ced3a3ad11c0feb1122d) ) | |
| 5334 | ROM_LOAD16_BYTE( "epr11368.b5", 0x00000, 0x20000, CRC(0377d7ce) SHA1(14f9674c142b78bf8b458beccfef93cc3e722c03) ) | |
| 5335 | ROM_LOAD16_BYTE( "epr11367.b2", 0x40001, 0x20000, CRC(1d06c5c7) SHA1(3a44f5a2058b96f212930c2e838eda1ce1036818) ) | |
| 5336 | ROM_LOAD16_BYTE( "epr11369.b6", 0x40000, 0x20000, CRC(d751d2a2) SHA1(3659948beacfc8dde5c50775859aa3fed537f768) ) | |
| 5326 | 5337 | |
| 5327 | 5338 | ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */ |
| 5328 | ROM_LOAD( "eprxxxxx.a10", 0x00000, 0x8000, CRC(1f47ebcb) SHA1(32837f3f1dd5ff309d1d955c1a738c444b248d3d) ) | |
| 5329 | ROM_LOAD( "epr11288.a8", 0x10000, 0x8000, CRC(c8df8460) SHA1(0aeb41a493df155edb5f600f53ec43b798927dff) ) | |
| 5330 | ROM_LOAD( "epr11289.a9", 0x20000, 0x8000, CRC(e5a4cf30) SHA1(d1982da7a550c11ab2253f5d64ac6ab847da0a04) ) | |
| 5339 | ROM_LOAD( "epr11377.a10", 0x00000, 0x08000, CRC(0fb6af34) SHA1(ae9da18bd2db317ed96c5f642f90cc1eba60ba99) ) /* MC8123B (317-0054) encrypted version of epr11361.a10 above */ | |
| 5340 | ROM_LOAD( "epr11362.a11", 0x10000, 0x20000, CRC(256af749) SHA1(041bd007ea7708c6d69f07865828b9bd17a139f5) ) | |
| 5341 | ||
| 5342 | ROM_REGION( 0x2000, REGION_USER2, 0 ) /* MC8123 key */ | |
| 5343 | ROM_LOAD( "317-0054.key", 0x0000, 0x2000, CRC(39fd4535) SHA1(93bbb139d2d5acc6a1e338d92077e79a5e880b2e) ) | |
| 5331 | 5344 | ROM_END |
| 5332 | 5345 | |
| 5333 | 5346 | /************************************************************************************************************************** |
| r2418 | r2419 | |
| 5337 | 5350 | */ |
| 5338 | 5351 | ROM_START( shinobi3 ) |
| 5339 | 5352 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */ |
| 5340 | ROM_LOAD16_BYTE( "epr11299.a4", 0x00000, 0x10000, CRC(b930399d) SHA1(955ff2948e1990463631b0bc5c7f5275384236cc) ) | |
| 5341 | ROM_LOAD16_BYTE( "epr11298.a1", 0x00001, 0x10000, CRC(343f4c46) SHA1(2cf5d00462ad85ae9a2e16d59171c8ab85e10f49) ) | |
| 5353 | ROM_LOAD16_BYTE( "epr11299.a4", 0x00000, 0x10000, CRC(b930399d) SHA1(955ff2948e1990463631b0bc5c7f5275384236cc) ) | |
| 5354 | ROM_LOAD16_BYTE( "epr11298.a1", 0x00001, 0x10000, CRC(343f4c46) SHA1(2cf5d00462ad85ae9a2e16d59171c8ab85e10f49) ) | |
| 5342 | 5355 | ROM_LOAD16_BYTE( "epr11283.a5", 0x20000, 0x10000, CRC(9d46e707) SHA1(37ab25b3b37365c9f45837bfb6ec80652691dd4c) ) |
| 5343 | 5356 | ROM_LOAD16_BYTE( "epr11281.a2", 0x20001, 0x10000, CRC(7961d07e) SHA1(38cbdab35f901532c0ad99ad0083513abd2ff182) ) |
| 5344 | 5357 | |
| r2418 | r2419 | |
| 6060 | 6073 | |
| 6061 | 6074 | static DRIVER_INIT( generic_5358_small ) |
| 6062 | 6075 | { |
| 6063 | system16b_generic_init(ROM_BOARD_171_5358_SMALL); | |
| 6076 | system16b_generic_init(machine, ROM_BOARD_171_5358_SMALL); | |
| 6064 | 6077 | } |
| 6065 | 6078 | |
| 6066 | 6079 | |
| 6067 | 6080 | static DRIVER_INIT( generic_5358 ) |
| 6068 | 6081 | { |
| 6069 | system16b_generic_init(ROM_BOARD_171_5358); | |
| 6082 | system16b_generic_init(machine, ROM_BOARD_171_5358); | |
| 6070 | 6083 | } |
| 6071 | 6084 | |
| 6072 | 6085 | |
| 6073 | 6086 | static DRIVER_INIT( generic_5521 ) |
| 6074 | 6087 | { |
| 6075 | system16b_generic_init(ROM_BOARD_171_5521); | |
| 6088 | system16b_generic_init(machine, ROM_BOARD_171_5521); | |
| 6076 | 6089 | } |
| 6077 | 6090 | |
| 6078 | 6091 | |
| 6079 | 6092 | static DRIVER_INIT( generic_5704 ) |
| 6080 | 6093 | { |
| 6081 | system16b_generic_init(ROM_BOARD_171_5704); | |
| 6094 | system16b_generic_init(machine, ROM_BOARD_171_5704); | |
| 6082 | 6095 | } |
| 6083 | 6096 | |
| 6084 | 6097 | |
| 6085 | 6098 | static DRIVER_INIT( generic_5797 ) |
| 6086 | 6099 | { |
| 6087 | system16b_generic_init(ROM_BOARD_171_5797); | |
| 6100 | system16b_generic_init(machine, ROM_BOARD_171_5797); | |
| 6088 | 6101 | } |
| 6089 | 6102 | |
| 6090 | 6103 | |
| r2418 | r2419 | |
| 6209 | 6222 | } |
| 6210 | 6223 | |
| 6211 | 6224 | |
| 6225 | static DRIVER_INIT( shinobi4_5521 ) | |
| 6226 | { | |
| 6227 | DRIVER_INIT_CALL(generic_5521); | |
| 6228 | mc8123_decrypt_rom(1, memory_region(REGION_USER2), 0, 0); | |
| 6229 | } | |
| 6230 | ||
| 6231 | ||
| 6212 | 6232 | static DRIVER_INIT( shinobi3_5358 ) |
| 6213 | 6233 | { |
| 6214 | 6234 | DRIVER_INIT_CALL(generic_5358); |
| r2418 | r2419 | |
| 6262 | 6282 | |
| 6263 | 6283 | static DRIVER_INIT( atomicp ) |
| 6264 | 6284 | { |
| 6265 | system16b_generic_init(ROM_BOARD_ATOMICP); | |
| 6285 | system16b_generic_init(machine, ROM_BOARD_ATOMICP); | |
| 6266 | 6286 | disable_screen_blanking = 1; |
| 6267 | 6287 | segaic16_display_enable = 1; |
| 6268 | 6288 | atomicp_sound_rate = 10000; |
| r2418 | r2419 | |
| 6271 | 6291 | |
| 6272 | 6292 | static DRIVER_INIT( snapper ) |
| 6273 | 6293 | { |
| 6274 | system16b_generic_init(ROM_BOARD_ATOMICP); | |
| 6294 | system16b_generic_init(machine, ROM_BOARD_ATOMICP); | |
| 6275 | 6295 | disable_screen_blanking = 1; |
| 6276 | 6296 | segaic16_display_enable = 1; |
| 6277 | 6297 | atomicp_sound_rate = 2500; |
| r2418 | r2419 | |
| 6332 | 6352 | GAME( 1987, defense, sdi, system16b, sdi, defense_5358, ROT0, "Sega", "Defense (System 16B, FD1089A 317-0028)", 0 ) |
| 6333 | 6353 | GAME( 1987, sdib, sdi, system16b, sdi, defense_5358, ROT0, "Sega", "SDI - Strategic Defense Initiative (System 16B, FD1089A 317-0028)", 0 ) |
| 6334 | 6354 | GAME( 1987, sdibl, sdi, system16b, sdi, sdi_5358, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg)", 0 ) |
| 6335 | GAME( 1987, shinobi4, shinobi, system16b, shinobi, generic_5521, ROT0, "Sega", "Shinobi (set 4, System 16B, unprotected)", 0 ) | |
| 6355 | GAME( 1987, shinobi5, shinobi, system16b, shinobi, generic_5521, ROT0, "Sega", "Shinobi (set 5, System 16B, unprotected)", 0 ) | |
| 6356 | GAME( 1987, shinobi4, shinobi, system16b, shinobi, shinobi4_5521, ROT0, "Sega", "Shinobi (set 4, System 16B, MC-8123B 317-0054)", 0 ) | |
| 6336 | 6357 | GAME( 1987, shinobi3, shinobi, system16b, shinobi, shinobi3_5358, ROT0, "Sega", "Shinobi (set 3, System 16B, MC-8123B 317-0054)", 0 ) |
| 6337 | 6358 | GAME( 1987, shinobi2, shinobi, system16b, shinobi, generic_5358, ROT0, "Sega", "Shinobi (set 2, System 16B, FD1094 317-0049)", 0 ) |
| 6338 | 6359 | GAME( 1987, sonicbom, 0, system16b, sonicbom, generic_5358, ROT270, "Sega", "Sonic Boom (FD1094 317-0053)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 71 | 71 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 72 | AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM | |
| 72 | AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM | |
| 73 | 73 | AM_RANGE(0x0c2000, 0x0c3fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) /* SPR Ram */ |
| 74 | AM_RANGE(0x080000, 0x080fff) AM_RAM AM_WRITE(wwfwfest_bg0_videoram_w) AM_BASE(&wwfwfest_bg0_videoram) /* BG0 Ram - 4 bytes per tile */ | |
| 75 | AM_RANGE(0x082000, 0x082fff) AM_RAM AM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE(&wwfwfest_bg1_videoram) /* BG1 Ram - 2 bytes per tile */ | |
| 74 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(wwfwfest_bg0_videoram_w) AM_BASE(&wwfwfest_bg0_videoram) /* BG0 Ram - 4 bytes per tile */ | |
| 75 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE(&wwfwfest_bg1_videoram) /* BG1 Ram - 2 bytes per tile */ | |
| 76 | 76 | AM_RANGE(0x100000, 0x100007) AM_WRITE(wwfwfest_scroll_write) |
| 77 | 77 | AM_RANGE(0x10000a, 0x10000b) AM_WRITE(wwfwfest_flipscreen_w) |
| 78 | 78 | AM_RANGE(0x140000, 0x140001) AM_WRITE(SMH_NOP) /* Irq 3 ack */ |
| r2418 | r2419 | |
|---|---|---|
| 55 | 55 | static ADDRESS_MAP_START( marineb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 56 | 56 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 57 | 57 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 58 | AM_RANGE(0x8800, 0x8bff) AM_R | |
| 58 | AM_RANGE(0x8800, 0x8bff) AM_R | |
| 59 | 59 | AM_RANGE(0x8c00, 0x8c3f) AM_RAM AM_BASE(&spriteram) /* Hoccer only */ |
| 60 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 60 | AM_RANGE(0x9000, 0x93ff) AM_R | |
| 61 | 61 | AM_RANGE(0x9800, 0x9800) AM_WRITE(marineb_column_scroll_w) |
| 62 | 62 | AM_RANGE(0x9a00, 0x9a00) AM_WRITE(marineb_palette_bank_0_w) |
| 63 | 63 | AM_RANGE(0x9c00, 0x9c00) AM_WRITE(marineb_palette_bank_1_w) |
| r2418 | r2419 | |
|---|---|---|
| 88 | 88 | AM_RANGE(0x112000, 0x1127ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&deco16_pf2_rowscroll) |
| 89 | 89 | |
| 90 | 90 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 91 | AM_RANGE(0x130000, 0x130fff) AM_RAM | |
| 91 | AM_RANGE(0x130000, 0x130fff) AM_RAM | |
| 92 | 92 | |
| 93 | 93 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(OKIM6295_data_0_lsb_w) |
| 94 | 94 | AM_RANGE(0x140006, 0x140007) AM_READ(OKIM6295_status_0_lsb_r) |
| r2418 | r2419 | |
|---|---|---|
| 122 | 122 | static ADDRESS_MAP_START( timeplt_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 123 | 123 | ADDRESS_MAP_UNMAP_HIGH |
| 124 | 124 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 125 | AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(SMH_RAM, timeplt_colorram_w) AM_BASE(&colorram) | |
| 126 | AM_RANGE(0xa400, 0xa7ff) AM_READWRITE(SMH_RAM, timeplt_videoram_w) AM_BASE(&videoram) | |
| 125 | AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(timeplt_colorram_w) AM_BASE(&colorram) | |
| 126 | AM_RANGE(0xa400, 0xa7ff) AM_RAM_WRITE(timeplt_videoram_w) AM_BASE(&videoram) | |
| 127 | 127 | AM_RANGE(0xa800, 0xafff) AM_RAM |
| 128 | 128 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram) |
| 129 | 129 | AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2) |
| r2418 | r2419 | |
| 146 | 146 | ADDRESS_MAP_UNMAP_HIGH |
| 147 | 147 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 148 | 148 | AM_RANGE(0x6004, 0x6004) AM_READ(psurge_protection_r) |
| 149 | AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(SMH_RAM, timeplt_colorram_w) AM_BASE(&colorram) | |
| 150 | AM_RANGE(0xa400, 0xa7ff) AM_READWRITE(SMH_RAM, timeplt_videoram_w) AM_BASE(&videoram) | |
| 149 | AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(timeplt_colorram_w) AM_BASE(&colorram) | |
| 150 | AM_RANGE(0xa400, 0xa7ff) AM_RAM_WRITE(timeplt_videoram_w) AM_BASE(&videoram) | |
| 151 | 151 | AM_RANGE(0xa800, 0xafff) AM_RAM |
| 152 | 152 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram) |
| 153 | 153 | AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2) |
| r2418 | r2419 | |
|---|---|---|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | static void multigam_init_smb3( | |
| 351 | static void multigam_init_smb3(running_machine *machine) | |
| 352 | 352 | { |
| 353 | 353 | UINT8* dst = memory_region( REGION_CPU1 ); |
| 354 | 354 | UINT8* src = memory_region( REGION_USER1 ); |
| r2418 | r2419 | |
| 356 | 356 | memcpy(&dst[0x8000], &src[0xa0000 + 0x3c000], 0x4000); |
| 357 | 357 | memcpy(&dst[0xc000], &src[0xa0000 + 0x3c000], 0x4000); |
| 358 | 358 | |
| 359 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w ); | |
| 359 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w ); | |
| 360 | 360 | |
| 361 | 361 | memory_set_bankptr(1, multigmc_mmc3_6000_ram); |
| 362 | 362 | |
| r2418 | r2419 | |
| 389 | 389 | |
| 390 | 390 | if ( data == 0xa8 ) |
| 391 | 391 | { |
| 392 | multigam_init_smb3(); | |
| 392 | multigam_init_smb3(machine); | |
| 393 | 393 | return; |
| 394 | 394 | } |
| 395 | 395 | else |
| 396 | 396 | { |
| 397 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w ); | |
| 397 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w ); | |
| 398 | 398 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x6000); |
| 399 | 399 | } |
| 400 | 400 |
| r2418 | r2419 | |
|---|---|---|
| 1187 | 1187 | AM_RANGE(0xca0000, 0xca0fff) AM_READWRITE(atarigx2_protection_r, atarigx2_protection_w) AM_BASE(&protection_base) |
| 1188 | 1188 | AM_RANGE(0xd00000, 0xd1ffff) AM_READ(a2d_data_r) |
| 1189 | 1189 | AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_BASE((UINT32 **)&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size) |
| 1190 | AM_RANGE(0xd40000, 0xd40fff) AM_R | |
| 1190 | AM_RANGE(0xd40000, 0xd40fff) AM_R | |
| 1191 | 1191 | AM_RANGE(0xd72000, 0xd75fff) AM_WRITE(atarigen_playfield32_w) AM_BASE(&atarigen_playfield32) |
| 1192 | 1192 | AM_RANGE(0xd76000, 0xd76fff) AM_WRITE(atarigen_alpha32_w) AM_BASE(&atarigen_alpha32) |
| 1193 | 1193 | AM_RANGE(0xd78000, 0xd78fff) AM_WRITE(atarirle_0_spriteram32_w) AM_BASE(&atarirle_0_spriteram32) |
| r2418 | r2419 | |
| 2096 | 2096 | atarigx2_motion_object_base = 0x400; |
| 2097 | 2097 | atarigx2_motion_object_mask = 0x3ff; |
| 2098 | 2098 | |
| 2099 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r); | |
| 2099 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r); | |
| 2100 | 2100 | } |
| 2101 | 2101 | |
| 2102 | 2102 |
| r2418 | r2419 | |
|---|---|---|
| 758 | 758 | static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 759 | 759 | AM_RANGE(0x00000000, 0x003fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram) /* Work RAM */ |
| 760 | 760 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 761 | AM_RANGE(0x74010000, 0x74017fff) AM_MIRROR(0x80000000) AM_R | |
| 761 | AM_RANGE(0x74010000, 0x74017fff) AM_MIRROR(0x80000000) AM_R | |
| 762 | 762 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 763 | 763 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 764 | 764 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) |
| r2418 | r2419 | |
|---|---|---|
| 80 | 80 | AM_RANGE(0xc805, 0xc805) AM_WRITE(vulgus_palette_bank_w) |
| 81 | 81 | AM_RANGE(0xc902, 0xc903) AM_RAM AM_BASE(&vulgus_scroll_high) |
| 82 | 82 | AM_RANGE(0xcc00, 0xcc7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 83 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(vulgus_fgvideoram_w) AM_BASE(&vulgus_fgvideoram) | |
| 84 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(vulgus_bgvideoram_w) AM_BASE(&vulgus_bgvideoram) | |
| 83 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(vulgus_fgvideoram_w) AM_BASE(&vulgus_fgvideoram) | |
| 84 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(vulgus_bgvideoram_w) AM_BASE(&vulgus_bgvideoram) | |
| 85 | 85 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 86 | 86 | ADDRESS_MAP_END |
| 87 | 87 |
| r2418 | r2419 | |
|---|---|---|
| 148 | 148 | static ADDRESS_MAP_START( roulette_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 149 | 149 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 150 | 150 | AM_RANGE(0x440000, 0x440fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 151 | AM_RANGE(0x500000, 0x500fff) AM_RAM AM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram) // bg | |
| 152 | AM_RANGE(0x501000, 0x501fff) AM_RAM AM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram) // mid | |
| 153 | AM_RANGE(0x502000, 0x503fff) AM_RAM AM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram) // fg | |
| 154 | AM_RANGE(0x504000, 0x50400b) AM_RAM AM_WRITE(sderby_scroll_w) | |
| 151 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram) // bg | |
| 152 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram) // mid | |
| 153 | AM_RANGE(0x502000, 0x503fff) AM_RAM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram) // fg | |
| 154 | AM_RANGE(0x504000, 0x50400b) AM_RAM_WRITE(sderby_scroll_w) | |
| 155 | 155 | AM_RANGE(0x50400e, 0x50400f) AM_WRITE( SMH_NOP ) |
| 156 | 156 | |
| 157 | 157 | AM_RANGE(0x708000, 0x70800d) AM_READ(roulette_input_r) AM_WRITE(SMH_NOP) // what are the writes? |
| r2418 | r2419 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 27 | 27 | AM_RANGE(0x0000, 0x17ff) AM_ROM |
| 28 | AM_RANGE(0x1800, 0x1bff) AM_RAM | |
| 28 | AM_RANGE(0x1800, 0x1bff) AM_RAM | |
| 29 | 29 | AM_RANGE(0x1c00, 0x1cff) AM_RAM |
| 30 | 30 | AM_RANGE(0x1d00, 0x1dff) AM_RAM |
| 31 | 31 | AM_RANGE(0x1e80, 0x1e80) AM_READWRITE(tinvader_port_0_r, tinvader_sound_w) |
| r2418 | r2419 | |
|---|---|---|
| 99 | 99 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 100 | 100 | AM_RANGE(0x040000, 0x0400ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 101 | 101 | AM_RANGE(0x041000, 0x043fff) AM_RAM // main ram |
| 102 | AM_RANGE(0x044000, 0x044fff) AM_RAM AM_WRITE(pkscramble_fgtilemap_w) AM_BASE(&pkscramble_fgtilemap_ram) // fg tilemap | |
| 103 | AM_RANGE(0x045000, 0x045fff) AM_RAM AM_WRITE(pkscramble_mdtilemap_w) AM_BASE(&pkscramble_mdtilemap_ram) // md tilemap (just a copy of fg?) | |
| 104 | AM_RANGE(0x046000, 0x046fff) AM_RAM AM_WRITE(pkscramble_bgtilemap_w) AM_BASE(&pkscramble_bgtilemap_ram) // bg tilemap | |
| 102 | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_BASE(&pkscramble_fgtilemap_ram) // fg tilemap | |
| 103 | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_BASE(&pkscramble_mdtilemap_ram) // md tilemap (just a copy of fg?) | |
| 104 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_BASE(&pkscramble_bgtilemap_ram) // bg tilemap | |
| 105 | 105 | AM_RANGE(0x047000, 0x047fff) AM_RAM // unused |
| 106 | AM_RANGE(0x048000, 0x048fff) AM_RAM | |
| 106 | AM_RANGE(0x048000, 0x048fff) AM_RAM | |
| 107 | 107 | AM_RANGE(0x049000, 0x049001) AM_READ(input_port_0_word_r) |
| 108 | 108 | AM_RANGE(0x049004, 0x049005) AM_READ(input_port_1_word_r) |
| 109 | 109 | AM_RANGE(0x049008, 0x049009) AM_WRITE(pkscramble_output_w) |
| r2418 | r2419 | |
|---|---|---|
| 121 | 121 | AM_RANGE(0xa000, 0xafff) AM_READWRITE(vastar_bg2videoram_r, vastar_bg2videoram_w) /* mirror address */ |
| 122 | 122 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE(vastar_bg1videoram_r, vastar_bg1videoram_w) /* mirror address */ |
| 123 | 123 | AM_RANGE(0xc000, 0xc000) AM_WRITE(SMH_RAM) AM_BASE(&vastar_sprite_priority) /* sprite/BG priority */ |
| 124 | AM_RANGE(0xc400, 0xcfff) AM_RAM | |
| 124 | AM_RANGE(0xc400, 0xcfff) AM_RAM | |
| 125 | 125 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) |
| 126 | 126 | AM_RANGE(0xf000, 0xf0ff) AM_READWRITE(vastar_sharedram_r, vastar_sharedram_w) AM_BASE(&vastar_sharedram) |
| 127 | 127 | AM_RANGE(0xf100, 0xf7ff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 205 | 205 | AM_RANGE(0x260010, 0x260011) AM_READ(special_port2_r) |
| 206 | 206 | AM_RANGE(0x260012, 0x260013) AM_READ(input_port_3_word_r) |
| 207 | 207 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w) |
| 208 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 208 | AM_RANGE(0x3e0000, 0x3e0fff) AM_R | |
| 209 | 209 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(relief_atarivc_r, relief_atarivc_w) AM_BASE(&atarivc_data) |
| 210 | AM_RANGE(0x3f0000, 0x3f1fff) AM_READWRITE(SMH_RAM, atarigen_playfield2_latched_msb_w) AM_BASE(&atarigen_playfield2) | |
| 211 | AM_RANGE(0x3f2000, 0x3f3fff) AM_READWRITE(SMH_RAM, atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 212 | AM_RANGE(0x3f4000, 0x3f5fff) AM_READWRITE(SMH_RAM, atarigen_playfield_dual_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 213 | AM_RANGE(0x3f6000, 0x3f67ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 210 | AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE(atarigen_playfield2_latched_msb_w) AM_BASE(&atarigen_playfield2) | |
| 211 | AM_RANGE(0x3f2000, 0x3f3fff) AM_RAM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield) | |
| 212 | AM_RANGE(0x3f4000, 0x3f5fff) AM_RAM_WRITE(atarigen_playfield_dual_upper_w) AM_BASE(&atarigen_playfield_upper) | |
| 213 | AM_RANGE(0x3f6000, 0x3f67ff) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) | |
| 214 | 214 | AM_RANGE(0x3f6800, 0x3f8eff) AM_RAM |
| 215 | 215 | AM_RANGE(0x3f8f00, 0x3f8f7f) AM_RAM AM_BASE(&atarivc_eof_data) |
| 216 | AM_RANGE(0x3f8f80, 0x3f8fff) AM_R | |
| 216 | AM_RANGE(0x3f8f80, 0x3f8fff) AM_R | |
| 217 | 217 | AM_RANGE(0x3f9000, 0x3fffff) AM_RAM |
| 218 | 218 | ADDRESS_MAP_END |
| 219 | 219 |
| r2418 | r2419 | |
|---|---|---|
| 3255 | 3255 | |
| 3256 | 3256 | static DRIVER_INIT( arabianm ) |
| 3257 | 3257 | { |
| 3258 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408124, 0x408127, 0, 0, irq_speedup_r_arabianm ); | |
| 3258 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408124, 0x408127, 0, 0, irq_speedup_r_arabianm ); | |
| 3259 | 3259 | f3_game=ARABIANM; |
| 3260 | 3260 | tile_decode(1); |
| 3261 | 3261 | } |
| r2418 | r2419 | |
| 3268 | 3268 | |
| 3269 | 3269 | static DRIVER_INIT( gseeker ) |
| 3270 | 3270 | { |
| 3271 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x40ad94, 0x40ad97, 0, 0, irq_speedup_r_gseeker ); | |
| 3271 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40ad94, 0x40ad97, 0, 0, irq_speedup_r_gseeker ); | |
| 3272 | 3272 | f3_game=GSEEKER; |
| 3273 | 3273 | tile_decode(0); |
| 3274 | 3274 | } |
| 3275 | 3275 | |
| 3276 | 3276 | static DRIVER_INIT( gunlock ) |
| 3277 | 3277 | { |
| 3278 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400007, 0, 0, irq_speedup_r_gunlock ); | |
| 3278 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400007, 0, 0, irq_speedup_r_gunlock ); | |
| 3279 | 3279 | f3_game=GUNLOCK; |
| 3280 | 3280 | tile_decode(1); |
| 3281 | 3281 | } |
| 3282 | 3282 | |
| 3283 | 3283 | static DRIVER_INIT( elvactr ) |
| 3284 | 3284 | { |
| 3285 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4007a0, 0x4007a3, 0, 0, irq_speedup_r_eaction2 ); | |
| 3285 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4007a0, 0x4007a3, 0, 0, irq_speedup_r_eaction2 ); | |
| 3286 | 3286 | f3_game=EACTION2; |
| 3287 | 3287 | tile_decode(1); |
| 3288 | 3288 | } |
| 3289 | 3289 | |
| 3290 | 3290 | static DRIVER_INIT( cupfinal ) |
| 3291 | 3291 | { |
| 3292 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cupfinal ); | |
| 3292 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cupfinal ); | |
| 3293 | 3293 | f3_game=SCFINALS; |
| 3294 | 3294 | tile_decode(1); |
| 3295 | 3295 | } |
| r2418 | r2419 | |
| 3310 | 3310 | /* Rom checksum error */ |
| 3311 | 3311 | RAM[0xdd0/4]=0x4e750000; |
| 3312 | 3312 | |
| 3313 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_scfinals ); | |
| 3313 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_scfinals ); | |
| 3314 | 3314 | f3_game=SCFINALS; |
| 3315 | 3315 | tile_decode(1); |
| 3316 | 3316 | } |
| 3317 | 3317 | |
| 3318 | 3318 | static DRIVER_INIT( lightbr ) |
| 3319 | 3319 | { |
| 3320 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400130, 0x400133, 0, 0, irq_speedup_r_lightbr ); | |
| 3320 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400130, 0x400133, 0, 0, irq_speedup_r_lightbr ); | |
| 3321 | 3321 | f3_game=LIGHTBR; |
| 3322 | 3322 | tile_decode(1); |
| 3323 | 3323 | } |
| 3324 | 3324 | |
| 3325 | 3325 | static DRIVER_INIT( kaiserkn ) |
| 3326 | 3326 | { |
| 3327 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408110, 0x408113, 0, 0, irq_speedup_r_kaiserkn ); | |
| 3327 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408110, 0x408113, 0, 0, irq_speedup_r_kaiserkn ); | |
| 3328 | 3328 | f3_game=KAISERKN; |
| 3329 | 3329 | tile_decode(1); |
| 3330 | 3330 | } |
| 3331 | 3331 | |
| 3332 | 3332 | static DRIVER_INIT( dariusg ) |
| 3333 | 3333 | { |
| 3334 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x406ba8, 0x406bab, 0, 0, irq_speedup_r_dariusg ); | |
| 3334 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x406ba8, 0x406bab, 0, 0, irq_speedup_r_dariusg ); | |
| 3335 | 3335 | f3_game=DARIUSG; |
| 3336 | 3336 | tile_decode(0); |
| 3337 | 3337 | } |
| 3338 | 3338 | |
| 3339 | 3339 | static DRIVER_INIT( spcinvdj ) |
| 3340 | 3340 | { |
| 3341 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400230, 0x400233, 0, 0, irq_speedup_r_spcinvdj ); | |
| 3341 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400230, 0x400233, 0, 0, irq_speedup_r_spcinvdj ); | |
| 3342 | 3342 | f3_game=SPCINVDX; |
| 3343 | 3343 | tile_decode(0); |
| 3344 | 3344 | } |
| r2418 | r2419 | |
| 3351 | 3351 | |
| 3352 | 3352 | static DRIVER_INIT( spcinv95 ) |
| 3353 | 3353 | { |
| 3354 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_spcinv95 ); | |
| 3354 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_spcinv95 ); | |
| 3355 | 3355 | f3_game=SPCINV95; |
| 3356 | 3356 | tile_decode(1); |
| 3357 | 3357 | } |
| 3358 | 3358 | |
| 3359 | 3359 | static DRIVER_INIT( gekirido ) |
| 3360 | 3360 | { |
| 3361 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x406bb0, 0x406bb3, 0, 0, irq_speedup_r_gekirido ); | |
| 3361 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x406bb0, 0x406bb3, 0, 0, irq_speedup_r_gekirido ); | |
| 3362 | 3362 | f3_game=GEKIRIDO; |
| 3363 | 3363 | tile_decode(1); |
| 3364 | 3364 | } |
| 3365 | 3365 | |
| 3366 | 3366 | static DRIVER_INIT( ktiger2 ) |
| 3367 | 3367 | { |
| 3368 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400570, 0x400573, 0, 0, irq_speedup_r_ktiger2 ); | |
| 3368 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400570, 0x400573, 0, 0, irq_speedup_r_ktiger2 ); | |
| 3369 | 3369 | f3_game=KTIGER2; |
| 3370 | 3370 | tile_decode(0); |
| 3371 | 3371 | } |
| 3372 | 3372 | |
| 3373 | 3373 | static DRIVER_INIT( bubsymph ) |
| 3374 | 3374 | { |
| 3375 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubsymph ); | |
| 3375 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubsymph ); | |
| 3376 | 3376 | f3_game=BUBSYMPH; |
| 3377 | 3377 | tile_decode(1); |
| 3378 | 3378 | } |
| 3379 | 3379 | |
| 3380 | 3380 | static DRIVER_INIT( bubblem ) |
| 3381 | 3381 | { |
| 3382 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubblem ); | |
| 3382 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubblem ); | |
| 3383 | 3383 | f3_game=BUBBLEM; |
| 3384 | 3384 | tile_decode(1); |
| 3385 | 3385 | } |
| 3386 | 3386 | |
| 3387 | 3387 | static DRIVER_INIT( cleopatr ) |
| 3388 | 3388 | { |
| 3389 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cleopatr ); | |
| 3389 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cleopatr ); | |
| 3390 | 3390 | f3_game=CLEOPATR; |
| 3391 | 3391 | tile_decode(0); |
| 3392 | 3392 | } |
| 3393 | 3393 | |
| 3394 | 3394 | static DRIVER_INIT( popnpop ) |
| 3395 | 3395 | { |
| 3396 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x401cf8, 0x401cfb, 0, 0, irq_speedup_r_popnpop ); | |
| 3396 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x401cf8, 0x401cfb, 0, 0, irq_speedup_r_popnpop ); | |
| 3397 | 3397 | f3_game=POPNPOP; |
| 3398 | 3398 | tile_decode(0); |
| 3399 | 3399 | } |
| 3400 | 3400 | |
| 3401 | 3401 | static DRIVER_INIT( landmakr ) |
| 3402 | 3402 | { |
| 3403 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr ); | |
| 3403 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr ); | |
| 3404 | 3404 | f3_game=LANDMAKR; |
| 3405 | 3405 | tile_decode(0); |
| 3406 | 3406 | } |
| r2418 | r2419 | |
| 3416 | 3416 | RAM[0x1ffff8/4]=0xffffffff; /* From 0xffffff03 */ |
| 3417 | 3417 | RAM[0x1ffffc/4]=0xffff0003; /* From 0xffff00ff */ |
| 3418 | 3418 | |
| 3419 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr ); | |
| 3419 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr ); | |
| 3420 | 3420 | f3_game=LANDMAKR; |
| 3421 | 3421 | tile_decode(0); |
| 3422 | 3422 | } |
| 3423 | 3423 | |
| 3424 | 3424 | static DRIVER_INIT( pbobble3 ) |
| 3425 | 3425 | { |
| 3426 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x405af4, 0x405af7, 0, 0, irq_speedup_r_pbobble3 ); | |
| 3426 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x405af4, 0x405af7, 0, 0, irq_speedup_r_pbobble3 ); | |
| 3427 | 3427 | f3_game=PBOBBLE3; |
| 3428 | 3428 | tile_decode(0); |
| 3429 | 3429 | } |
| 3430 | 3430 | |
| 3431 | 3431 | static DRIVER_INIT( pbobble4 ) |
| 3432 | 3432 | { |
| 3433 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4058f4, 0x4058f7, 0, 0, irq_speedup_r_pbobble4 ); | |
| 3433 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4058f4, 0x4058f7, 0, 0, irq_speedup_r_pbobble4 ); | |
| 3434 | 3434 | f3_game=PBOBBLE4; |
| 3435 | 3435 | tile_decode(0); |
| 3436 | 3436 | } |
| r2418 | r2419 | |
| 3443 | 3443 | |
| 3444 | 3444 | static DRIVER_INIT( pbobble2 ) |
| 3445 | 3445 | { |
| 3446 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x404a50, 0x404a53, 0, 0, irq_speedup_r_pbobble2 ); | |
| 3446 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x404a50, 0x404a53, 0, 0, irq_speedup_r_pbobble2 ); | |
| 3447 | 3447 | f3_game=PBOBBLE2; |
| 3448 | 3448 | tile_decode(0); |
| 3449 | 3449 | } |
| 3450 | 3450 | |
| 3451 | 3451 | static DRIVER_INIT( pbobbl2x ) |
| 3452 | 3452 | { |
| 3453 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x405c58, 0x405c5b, 0, 0, irq_speedup_r_pbobbl2x ); | |
| 3453 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x405c58, 0x405c5b, 0, 0, irq_speedup_r_pbobbl2x ); | |
| 3454 | 3454 | f3_game=PBOBBLE2; |
| 3455 | 3455 | tile_decode(0); |
| 3456 | 3456 | } |
| 3457 | 3457 | |
| 3458 | 3458 | static DRIVER_INIT( hthero95 ) |
| 3459 | 3459 | { |
| 3460 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_pwrgoal ); | |
| 3460 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_pwrgoal ); | |
| 3461 | 3461 | f3_game=HTHERO95; |
| 3462 | 3462 | tile_decode(0); |
| 3463 | 3463 | } |
| 3464 | 3464 | |
| 3465 | 3465 | static DRIVER_INIT( kirameki ) |
| 3466 | 3466 | { |
| 3467 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400414, 0x400417, 0, 0, irq_speedup_r_kirameki ); | |
| 3467 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400414, 0x400417, 0, 0, irq_speedup_r_kirameki ); | |
| 3468 | 3468 | f3_game=KIRAMEKI; |
| 3469 | 3469 | tile_decode(0); |
| 3470 | 3470 | } |
| 3471 | 3471 | |
| 3472 | 3472 | static DRIVER_INIT( puchicar ) |
| 3473 | 3473 | { |
| 3474 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4024d8, 0x4024db, 0, 0, irq_speedup_r_puchicar ); | |
| 3474 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4024d8, 0x4024db, 0, 0, irq_speedup_r_puchicar ); | |
| 3475 | 3475 | f3_game=PUCHICAR; |
| 3476 | 3476 | tile_decode(0); |
| 3477 | 3477 | } |
| 3478 | 3478 | |
| 3479 | 3479 | static DRIVER_INIT( twinqix ) |
| 3480 | 3480 | { |
| 3481 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_twinqix ); | |
| 3481 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_twinqix ); | |
| 3482 | 3482 | f3_game=TWINQIX; |
| 3483 | 3483 | tile_decode(0); |
| 3484 | 3484 | } |
| 3485 | 3485 | |
| 3486 | 3486 | static DRIVER_INIT( arkretrn ) |
| 3487 | 3487 | { |
| 3488 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x402154, 0x402157, 0, 0, irq_speedup_r_arkretrn ); | |
| 3488 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x402154, 0x402157, 0, 0, irq_speedup_r_arkretrn ); | |
| 3489 | 3489 | f3_game=ARKRETRN; |
| 3490 | 3490 | tile_decode(0); |
| 3491 | 3491 | } |
| r2418 | r2419 | |
|---|---|---|
| 83 | 83 | static ADDRESS_MAP_START( homerun_memmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 84 | 84 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 85 | 85 | AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1) |
| 86 | AM_RANGE(0x8000, 0x9fff) AM_RAM | |
| 86 | AM_RANGE(0x8000, 0x9fff) AM_RAM | |
| 87 | 87 | AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 88 | 88 | AM_RANGE(0xb000, 0xb0ff) AM_WRITE(homerun_color_w) |
| 89 | 89 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| r2418 | r2419 | |
|---|---|---|
| 176 | 176 | AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) /* MCU shared RAM */ |
| 177 | 177 | AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w) |
| 178 | 178 | AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w) |
| 179 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 179 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 180 | 180 | AM_RANGE(0x8800, 0x8fef) AM_RAM |
| 181 | 181 | AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 182 | 182 | |
| r2418 | r2419 | |
| 204 | 204 | AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w) |
| 205 | 205 | AM_RANGE(0x7800, 0x7fff) AM_ROM // champbb2 only |
| 206 | 206 | |
| 207 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 207 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 208 | 208 | AM_RANGE(0x8800, 0x8fef) AM_RAM |
| 209 | 209 | AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 210 | 210 |
| r2418 | r2419 | |
|---|---|---|
| 614 | 614 | AM_RANGE(0xf000, 0xf1ff) AM_MIRROR(0x0200) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 615 | 615 | AM_RANGE(0xf400, 0xf41f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_split1_w) AM_BASE(&paletteram) |
| 616 | 616 | AM_RANGE(0xf800, 0xf81f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_split2_w) AM_BASE(&paletteram_2) |
| 617 | AM_RANGE(0xfc00, 0xffff) AM_R | |
| 617 | AM_RANGE(0xfc00, 0xffff) AM_R | |
| 618 | 618 | ADDRESS_MAP_END |
| 619 | 619 | |
| 620 | 620 | /* upper I/O map determined by PAL; only SSIO ports are verified from schematics */ |
| r2418 | r2419 | |
| 641 | 641 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 642 | 642 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x1800) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 643 | 643 | AM_RANGE(0xe000, 0xe1ff) AM_MIRROR(0x1600) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 644 | AM_RANGE(0xe800, 0xefff) AM_MIRROR(0x1000) AM_R | |
| 644 | AM_RANGE(0xe800, 0xefff) AM_MIRROR(0x1000) AM_R | |
| 645 | 645 | ADDRESS_MAP_END |
| 646 | 646 | |
| 647 | 647 | /* upper I/O map determined by PAL; only SSIO ports are verified from schematics */ |
| r2418 | r2419 | |
| 668 | 668 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 669 | 669 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 670 | 670 | AM_RANGE(0xe800, 0xe9ff) AM_MIRROR(0x0200) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 671 | AM_RANGE(0xf000, 0xf7ff) AM_R | |
| 671 | AM_RANGE(0xf000, 0xf7ff) AM_R | |
| 672 | 672 | AM_RANGE(0xf800, 0xf87f) AM_MIRROR(0x0780) AM_WRITE(mcr_91490_paletteram_w) AM_BASE(&paletteram) |
| 673 | 673 | ADDRESS_MAP_END |
| 674 | 674 | |
| r2418 | r2419 | |
| 2470 | 2470 | mcr_init(90010, 91399, 90913); |
| 2471 | 2471 | mcr_sound_init(MCR_SSIO); |
| 2472 | 2472 | |
| 2473 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r); | |
| 2474 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_w); | |
| 2473 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r, twotiger_videoram_w); | |
| 2475 | 2474 | } |
| 2476 | 2475 | |
| 2477 | 2476 |
| r2418 | r2419 | |
|---|---|---|
| 154 | 154 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 155 | 155 | AM_RANGE(0x00000, 0x9ffff) AM_ROM |
| 156 | 156 | AM_RANGE(0xa0000, 0xbffff) AM_ROMBANK(1) |
| 157 | AM_RANGE(0xd0000, 0xdffff) AM_R | |
| 157 | AM_RANGE(0xd0000, 0xdffff) AM_R | |
| 158 | 158 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 159 | 159 | AM_RANGE(0xf8000, 0xf8fff) AM_RAM AM_BASE(&spriteram16) |
| 160 | AM_RANGE(0xf9000, 0xf9fff) AM_R | |
| 160 | AM_RANGE(0xf9000, 0xf9fff) AM_R | |
| 161 | 161 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 162 | 162 | ADDRESS_MAP_END |
| 163 | 163 |
| r2418 | r2419 | |
|---|---|---|
| 489 | 489 | AM_RANGE(0xd00c, 0xd00c) AM_READ(arkanoid_68705_input_0_r) /* mainly an input port, with 2 bits from the 68705 */ |
| 490 | 490 | AM_RANGE(0xd010, 0xd010) AM_READWRITE(input_port_1_r, watchdog_reset_w) |
| 491 | 491 | AM_RANGE(0xd018, 0xd018) AM_READWRITE(arkanoid_Z80_mcu_r, arkanoid_Z80_mcu_w) /* input from the 68705 */ |
| 492 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 492 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 493 | 493 | AM_RANGE(0xe800, 0xe83f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 494 | 494 | AM_RANGE(0xe840, 0xefff) AM_RAM |
| 495 | 495 | AM_RANGE(0xf000, 0xffff) AM_READNOP /* fixes instant death in final level */ |
| r2418 | r2419 | |
| 504 | 504 | AM_RANGE(0xd00c, 0xd00c) AM_READ(input_port_0_r) |
| 505 | 505 | AM_RANGE(0xd010, 0xd010) AM_READWRITE(input_port_1_r, watchdog_reset_w) |
| 506 | 506 | AM_RANGE(0xd018, 0xd018) AM_READ(arkanoid_input_2_r) AM_WRITENOP |
| 507 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 507 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 508 | 508 | AM_RANGE(0xe800, 0xe83f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 509 | 509 | AM_RANGE(0xe840, 0xefff) AM_RAM |
| 510 | 510 | AM_RANGE(0xf000, 0xffff) AM_READNOP /* fixes instant death in final level */ |
| r2418 | r2419 | |
| 1082 | 1082 | |
| 1083 | 1083 | /* Driver Initialization */ |
| 1084 | 1084 | |
| 1085 | static void arkanoid_bootleg_init( | |
| 1085 | static void arkanoid_bootleg_init( running_machine *machine ) | |
| 1086 | 1086 | { |
| 1087 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r ); | |
| 1088 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w ); | |
| 1089 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r ); | |
| 1087 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r ); | |
| 1088 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w ); | |
| 1089 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r ); | |
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | 1092 | static DRIVER_INIT( arkangc ) |
| 1093 | 1093 | { |
| 1094 | 1094 | arkanoid_bootleg_id = ARKANGC; |
| 1095 | arkanoid_bootleg_init(); | |
| 1095 | arkanoid_bootleg_init(machine); | |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | static DRIVER_INIT( arkangc2 ) |
| 1099 | 1099 | { |
| 1100 | 1100 | arkanoid_bootleg_id = ARKANGC2; |
| 1101 | arkanoid_bootleg_init(); | |
| 1101 | arkanoid_bootleg_init(machine); | |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | 1104 | static DRIVER_INIT( arkblock ) |
| 1105 | 1105 | { |
| 1106 | 1106 | arkanoid_bootleg_id = ARKBLOCK; |
| 1107 | arkanoid_bootleg_init(); | |
| 1107 | arkanoid_bootleg_init(machine); | |
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | 1110 | static DRIVER_INIT( arkbloc2 ) |
| 1111 | 1111 | { |
| 1112 | 1112 | arkanoid_bootleg_id = ARKBLOC2; |
| 1113 | arkanoid_bootleg_init(); | |
| 1113 | arkanoid_bootleg_init(machine); | |
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | static DRIVER_INIT( arkgcbl ) |
| 1117 | 1117 | { |
| 1118 | 1118 | arkanoid_bootleg_id = ARKGCBL; |
| 1119 | arkanoid_bootleg_init(); | |
| 1119 | arkanoid_bootleg_init(machine); | |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | static DRIVER_INIT( paddle2 ) |
| 1123 | 1123 | { |
| 1124 | 1124 | arkanoid_bootleg_id = PADDLE2; |
| 1125 | arkanoid_bootleg_init(); | |
| 1125 | arkanoid_bootleg_init(machine); | |
| 1126 | 1126 | } |
| 1127 | 1127 | |
| 1128 | 1128 |
| r2418 | r2419 | |
|---|---|---|
| 3881 | 3881 | RAM[0x438/2] = 0x4e71; // |
| 3882 | 3882 | |
| 3883 | 3883 | /* the sound code writes oki commands to both the lsb and msb */ |
| 3884 | memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xa0003, 0, 0, OKIM6295_data_0_both_w); | |
| 3885 | memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xc0000, 0xc0003, 0, 0, OKIM6295_data_1_both_w); | |
| 3884 | memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xa0003, 0, 0, OKIM6295_data_0_both_w); | |
| 3885 | memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc0000, 0xc0003, 0, 0, OKIM6295_data_1_both_w); | |
| 3886 | 3886 | } |
| 3887 | 3887 | |
| 3888 | 3888 | static DRIVER_INIT( peekaboo ) |
| 3889 | 3889 | { |
| 3890 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_r); | |
| 3891 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_w); | |
| 3890 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_r, protection_peekaboo_w); | |
| 3892 | 3891 | } |
| 3893 | 3892 | |
| 3894 | 3893 | static DRIVER_INIT( phantasm ) |
| r2418 | r2419 | |
| 3924 | 3923 | astyanax_rom_decode(0); |
| 3925 | 3924 | |
| 3926 | 3925 | /* Sprite RAM is mirrored. Why? */ |
| 3927 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_r); | |
| 3928 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_w); | |
| 3926 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_r, soldamj_spriteram16_w); | |
| 3929 | 3927 | } |
| 3930 | 3928 | |
| 3931 | 3929 | static DRIVER_INIT( stdragon ) |
| r2418 | r2419 | |
|---|---|---|
| 384 | 384 | static ADDRESS_MAP_START( slave_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 385 | 385 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 386 | 386 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(2) |
| 387 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_WRITE(airbustr_videoram2_w) AM_BASE(&airbustr_videoram2) | |
| 388 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_WRITE(airbustr_colorram2_w) AM_BASE(&airbustr_colorram2) | |
| 389 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_WRITE(airbustr_videoram_w) AM_BASE(&videoram) | |
| 390 | AM_RANGE(0xcc00, 0xcfff) AM_RAM AM_WRITE(airbustr_colorram_w) AM_BASE(&colorram) | |
| 391 | AM_RANGE(0xd000, 0xd5ff) AM_RAM AM_WRITE(airbustr_paletteram_w) AM_BASE(&paletteram) | |
| 387 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(airbustr_videoram2_w) AM_BASE(&airbustr_videoram2) | |
| 388 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(airbustr_colorram2_w) AM_BASE(&airbustr_colorram2) | |
| 389 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(airbustr_videoram_w) AM_BASE(&videoram) | |
| 390 | AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(airbustr_colorram_w) AM_BASE(&colorram) | |
| 391 | AM_RANGE(0xd000, 0xd5ff) AM_RAM_WRITE(airbustr_paletteram_w) AM_BASE(&paletteram) | |
| 392 | 392 | AM_RANGE(0xd600, 0xdfff) AM_RAM |
| 393 | 393 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 394 | 394 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE(1) |
| r2418 | r2419 | |
| 754 | 754 | |
| 755 | 755 | static DRIVER_INIT( airbustr ) |
| 756 | 756 | { |
| 757 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here | |
| 757 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here | |
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 |
| r2418 | r2419 | |
|---|---|---|
| 5126 | 5126 | static DRIVER_INIT( maketrax ) |
| 5127 | 5127 | { |
| 5128 | 5128 | /* set up protection handlers */ |
| 5129 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x50bf, 0, 0, maketrax_special_port2_r); | |
| 5130 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, maketrax_special_port3_r); | |
| 5129 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x50bf, 0, 0, maketrax_special_port2_r); | |
| 5130 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, maketrax_special_port3_r); | |
| 5131 | 5131 | |
| 5132 | 5132 | maketrax_rom_decode(); |
| 5133 | 5133 | } |
| r2418 | r2419 | |
| 5157 | 5157 | static DRIVER_INIT( korosuke ) |
| 5158 | 5158 | { |
| 5159 | 5159 | /* set up protection handlers */ |
| 5160 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x5080, 0, 0, korosuke_special_port2_r); | |
| 5161 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, korosuke_special_port3_r); | |
| 5160 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x5080, 0, 0, korosuke_special_port2_r); | |
| 5161 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, korosuke_special_port3_r); | |
| 5162 | 5162 | |
| 5163 | 5163 | korosuke_rom_decode(); |
| 5164 | 5164 | } |
| r2418 | r2419 | |
| 5381 | 5381 | static DRIVER_INIT( cannonbp ) |
| 5382 | 5382 | { |
| 5383 | 5383 | /* extra memory */ |
| 5384 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, SMH_BANK5, SMH_BANK5); | |
| 5384 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, SMH_BANK5, SMH_BANK5); | |
| 5385 | 5385 | memory_set_bankptr(5, auto_malloc(0x400)); |
| 5386 | 5386 | |
| 5387 | 5387 | /* protection? */ |
| 5388 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r); | |
| 5388 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r); | |
| 5389 | 5389 | } |
| 5390 | 5390 | |
| 5391 | 5391 |
| r2418 | r2419 | |
|---|---|---|
| 51 | 51 | /* bit 5 = memory bank select */ |
| 52 | 52 | if (data & 0x20) |
| 53 | 53 | { |
| 54 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 54 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 55 | 55 | memory_set_bankptr(5, paletteram); |
| 56 | 56 | |
| 57 | 57 | if (K051316_readroms) |
| 58 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */ | |
| 58 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */ | |
| 59 | 59 | else |
| 60 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */ | |
| 60 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */ | |
| 61 | 61 | } |
| 62 | 62 | else |
| 63 | 63 | { |
| 64 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */ | |
| 65 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */ | |
| 64 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */ | |
| 65 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */ | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* other bits unknown/unused */ |
| r2418 | r2419 | |
| 78 | 78 | |
| 79 | 79 | /* bit 4 = enable rom reading thru K051316 #1 & #2 */ |
| 80 | 80 | if ((K051316_readroms = (data & 0x10))){ |
| 81 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */ | |
| 81 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */ | |
| 82 | 82 | } |
| 83 | 83 | else{ |
| 84 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */ | |
| 84 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */ | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Saunset Riders, */ |
| r2418 | r2419 | |
|---|---|---|
| 580 | 580 | AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION(REGION_USER1, 0) |
| 581 | 581 | |
| 582 | 582 | AM_RANGE(0x300000, 0x300005) AM_READWRITE(srmp6_inputs_r, srmp6_input_select_w) // inputs |
| 583 | AM_RANGE(0x480000, 0x480fff) AM_R | |
| 583 | AM_RANGE(0x480000, 0x480fff) AM_R | |
| 584 | 584 | AM_RANGE(0x4d0000, 0x4d0001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // watchdog |
| 585 | 585 | |
| 586 | 586 | // OBJ RAM: checked [$400000-$47dfff] |
| r2418 | r2419 | |
|---|---|---|
| 111 | 111 | AM_RANGE(0x06000, 0x067ff) AM_RAM |
| 112 | 112 | AM_RANGE(0x07800, 0x097ff) AM_RAM |
| 113 | 113 | AM_RANGE(0x09800, 0x099ff) AM_RAM |
| 114 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_WRITE(sengokmj_bgvram_w) AM_BASE(&sengokmj_bgvram) | |
| 115 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM AM_WRITE(sengokmj_fgvram_w) AM_BASE(&sengokmj_fgvram) | |
| 116 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM AM_WRITE(sengokmj_mdvram_w) AM_BASE(&sengokmj_mdvram) | |
| 117 | AM_RANGE(0x0d800, 0x0e7ff) AM_RAM AM_WRITE(sengokmj_txvram_w) AM_BASE(&sengokmj_txvram) | |
| 118 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 114 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(sengokmj_bgvram_w) AM_BASE(&sengokmj_bgvram) | |
| 115 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(sengokmj_fgvram_w) AM_BASE(&sengokmj_fgvram) | |
| 116 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(sengokmj_mdvram_w) AM_BASE(&sengokmj_mdvram) | |
| 117 | AM_RANGE(0x0d800, 0x0e7ff) AM_RAM_WRITE(sengokmj_txvram_w) AM_BASE(&sengokmj_txvram) | |
| 118 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 119 | 119 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_BASE(&spriteram16) |
| 120 | 120 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| 121 | 121 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 4109 | 4109 | unpack_sprites(); |
| 4110 | 4110 | |
| 4111 | 4111 | // Speed Hack |
| 4112 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r); | |
| 4112 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r); | |
| 4113 | 4113 | } |
| 4114 | 4114 | |
| 4115 | 4115 | static DRIVER_INIT( dfeveron ) |
| r2418 | r2419 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | static ADDRESS_MAP_START( brkthru_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 101 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 101 | AM_RANGE(0x0000, 0x03ff) AM_R | |
| 102 | 102 | AM_RANGE(0x0400, 0x0bff) AM_RAM |
| 103 | AM_RANGE(0x0c00, 0x0fff) AM_R | |
| 103 | AM_RANGE(0x0c00, 0x0fff) AM_R | |
| 104 | 104 | AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 105 | 105 | AM_RANGE(0x1100, 0x17ff) AM_RAM |
| 106 | 106 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r) /* player controls, player start */ |
| r2418 | r2419 | |
| 117 | 117 | |
| 118 | 118 | /* same as brktrhu, but xor 0x1000 below 8k */ |
| 119 | 119 | static ADDRESS_MAP_START( darwin_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 120 | AM_RANGE(0x1000, 0x13ff) AM_R | |
| 120 | AM_RANGE(0x1000, 0x13ff) AM_R | |
| 121 | 121 | AM_RANGE(0x1400, 0x1bff) AM_RAM |
| 122 | AM_RANGE(0x1c00, 0x1fff) AM_R | |
| 122 | AM_RANGE(0x1c00, 0x1fff) AM_R | |
| 123 | 123 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 124 | 124 | AM_RANGE(0x0100, 0x01ff) AM_WRITE(SMH_NOP) /*tidyup, nothing realy here?*/ |
| 125 | 125 | AM_RANGE(0x0800, 0x0800) AM_READ(input_port_0_r) /* player controls, player start */ |
| r2418 | r2419 | |
|---|---|---|
| 520 | 520 | ADDRESS_MAP_END |
| 521 | 521 | |
| 522 | 522 | |
| 523 | void defender_install_io_space( | |
| 523 | void defender_install_io_space(running_machine *machine) | |
| 524 | 524 | { |
| 525 | 525 | /* this routine dynamically installs the memory mapped above from c000-cfff */ |
| 526 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, SMH_BANK4); | |
| 527 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w); | |
| 528 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0, williams_watchdog_reset_w); | |
| 529 | memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, SMH_BANK3, williams_cmos_w); | |
| 530 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r); | |
| 531 | memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r, pia_1_w); | |
| 532 | memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r, pia_0_w); | |
| 526 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, SMH_BANK4); | |
| 527 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w); | |
| 528 | memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0, williams_watchdog_reset_w); | |
| 529 | memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, SMH_BANK3, williams_cmos_w); | |
| 530 | memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r); | |
| 531 | memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r, pia_1_w); | |
| 532 | memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r, pia_0_w); | |
| 533 | 533 | memory_set_bankptr(3, generic_nvram); |
| 534 | 534 | memory_set_bankptr(4, paletteram); |
| 535 | 535 | } |
| r2418 | r2419 | |
| 552 | 552 | AM_RANGE(0xca00, 0xca07) AM_MIRROR(0x00f8) AM_WRITE(williams_blitter_w) |
| 553 | 553 | AM_RANGE(0xcb00, 0xcbff) AM_READ(williams_video_counter_r) |
| 554 | 554 | AM_RANGE(0xcbff, 0xcbff) AM_WRITE(williams_watchdog_reset_w) |
| 555 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 555 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 556 | 556 | AM_RANGE(0xd000, 0xffff) AM_ROM |
| 557 | 557 | ADDRESS_MAP_END |
| 558 | 558 | |
| r2418 | r2419 | |
| 567 | 567 | AM_RANGE(0xca00, 0xca07) AM_MIRROR(0x00f8) AM_WRITE(williams_blitter_w) |
| 568 | 568 | AM_RANGE(0xcb00, 0xcbff) AM_READ(williams_video_counter_r) |
| 569 | 569 | AM_RANGE(0xcbff, 0xcbff) AM_WRITE(williams_watchdog_reset_w) |
| 570 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 570 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 571 | 571 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 572 | 572 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 573 | 573 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 596 | 596 | AM_RANGE(0xca00, 0xca07) AM_MIRROR(0x00f8) AM_WRITE(williams_blitter_w) |
| 597 | 597 | AM_RANGE(0xcb00, 0xcbff) AM_READ(williams_video_counter_r) |
| 598 | 598 | AM_RANGE(0xcbff, 0xcbff) AM_WRITE(williams_watchdog_reset_w) |
| 599 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 599 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 600 | 600 | AM_RANGE(0xd000, 0xffff) AM_ROM |
| 601 | 601 | ADDRESS_MAP_END |
| 602 | 602 | |
| r2418 | r2419 | |
| 611 | 611 | static ADDRESS_MAP_START( williams2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 612 | 612 | AM_RANGE(0x0000, 0x7fff) AM_READWRITE(SMH_BANK1, SMH_RAM) AM_BASE(&williams_videoram) |
| 613 | 613 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 614 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 614 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 615 | 615 | AM_RANGE(0xc800, 0xc87f) AM_WRITE(williams2_bank_select_w) |
| 616 | 616 | AM_RANGE(0xc880, 0xc887) AM_MIRROR(0x0078) AM_WRITE(williams_blitter_w) |
| 617 | 617 | AM_RANGE(0xc900, 0xc97f) AM_WRITE(williams2_watchdog_reset_w) |
| r2418 | r2419 | |
| 625 | 625 | AM_RANGE(0xcb80, 0xcb9f) AM_WRITE(defender_video_control_w) |
| 626 | 626 | AM_RANGE(0xcba0, 0xcbbf) AM_WRITE(williams2_blit_window_enable_w) |
| 627 | 627 | AM_RANGE(0xcbe0, 0xcbef) AM_READ(williams2_video_counter_r) |
| 628 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 628 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 629 | 629 | AM_RANGE(0xd000, 0xffff) AM_ROM |
| 630 | 630 | ADDRESS_MAP_END |
| 631 | 631 | |
| r2418 | r2419 | |
| 633 | 633 | static ADDRESS_MAP_START( williams2_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 634 | 634 | AM_RANGE(0x0000, 0x7fff) AM_READWRITE(SMH_BANK1, SMH_RAM) AM_BASE(&williams_videoram) |
| 635 | 635 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 636 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 636 | AM_RANGE(0xc000, 0xc7ff) AM_R | |
| 637 | 637 | AM_RANGE(0xc800, 0xc87f) AM_WRITE(williams2_bank_select_w) |
| 638 | 638 | AM_RANGE(0xc880, 0xc887) AM_MIRROR(0x0078) AM_WRITE(williams_blitter_w) |
| 639 | 639 | AM_RANGE(0xc900, 0xc97f) AM_WRITE(williams2_watchdog_reset_w) |
| r2418 | r2419 | |
| 647 | 647 | AM_RANGE(0xcb80, 0xcb9f) AM_WRITE(defender_video_control_w) |
| 648 | 648 | AM_RANGE(0xcba0, 0xcbbf) AM_WRITE(williams2_blit_window_enable_w) |
| 649 | 649 | AM_RANGE(0xcbe0, 0xcbef) AM_READ(williams2_video_counter_r) |
| 650 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 650 | AM_RANGE(0xcc00, 0xcfff) AM_R | |
| 651 | 651 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 652 | 652 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 653 | 653 | ADDRESS_MAP_END |
| r2418 | r2419 | |
| 2602 | 2602 | CONFIGURE_PIAS(williams_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf); |
| 2603 | 2603 | |
| 2604 | 2604 | /* install a handler to catch protection checks */ |
| 2605 | mayday_protection = memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa190, 0xa191, 0, 0, mayday_protection_r); | |
| 2605 | mayday_protection = memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa190, 0xa191, 0, 0, mayday_protection_r); | |
| 2606 | 2606 | } |
| 2607 | 2607 | |
| 2608 | 2608 | |
| r2418 | r2419 | |
| 2640 | 2640 | CONFIGURE_PIAS(williams_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf); |
| 2641 | 2641 | |
| 2642 | 2642 | /* bubbles has a full 8-bit-wide CMOS */ |
| 2643 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, bubbles_cmos_w); | |
| 2643 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, bubbles_cmos_w); | |
| 2644 | 2644 | } |
| 2645 | 2645 | |
| 2646 | 2646 | |
| r2418 | r2419 | |
| 2686 | 2686 | |
| 2687 | 2687 | /* add a third PIA */ |
| 2688 | 2688 | pia_config(3, &spdball_pia_3_intf); |
| 2689 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_r); | |
| 2690 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_w); | |
| 2689 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_r, pia_3_w); | |
| 2691 | 2690 | |
| 2692 | 2691 | /* install extra input handlers */ |
| 2693 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc800, 0, 0, input_port_5_r); | |
| 2694 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc801, 0xc801, 0, 0, input_port_6_r); | |
| 2695 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc802, 0xc802, 0, 0, input_port_7_r); | |
| 2696 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc803, 0xc803, 0, 0, input_port_8_r); | |
| 2692 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc800, 0, 0, input_port_5_r); | |
| 2693 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc801, 0xc801, 0, 0, input_port_6_r); | |
| 2694 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc802, 0xc802, 0, 0, input_port_7_r); | |
| 2695 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc803, 0xc803, 0, 0, input_port_8_r); | |
| 2697 | 2696 | } |
| 2698 | 2697 | |
| 2699 | 2698 | |
| r2418 | r2419 | |
| 2701 | 2700 | { |
| 2702 | 2701 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2703 | 2702 | CONFIGURE_PIAS(williams_muxed_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf); |
| 2704 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP); | |
| 2703 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP); | |
| 2705 | 2704 | } |
| 2706 | 2705 | |
| 2707 | 2706 | |
| r2418 | r2419 | |
| 2709 | 2708 | { |
| 2710 | 2709 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2711 | 2710 | CONFIGURE_PIAS(williams_muxed_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf); |
| 2712 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP); | |
| 2711 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP); | |
| 2713 | 2712 | } |
| 2714 | 2713 | |
| 2715 | 2714 |
| r2418 | r2419 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | static ADDRESS_MAP_START( battlane_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 94 | 94 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1) |
| 95 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_WRITE(battlane_tileram_w) AM_SHARE(2) AM_BASE(&battlane_tileram) | |
| 96 | AM_RANGE(0x1800, 0x18ff) AM_RAM AM_WRITE(battlane_spriteram_w) AM_SHARE(3) AM_BASE(&battlane_spriteram) | |
| 95 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(battlane_tileram_w) AM_SHARE(2) AM_BASE(&battlane_tileram) | |
| 96 | AM_RANGE(0x1800, 0x18ff) AM_RAM_WRITE(battlane_spriteram_w) AM_SHARE(3) AM_BASE(&battlane_spriteram) | |
| 97 | 97 | AM_RANGE(0x1c00, 0x1c00) AM_READWRITE(input_port_0_r, battlane_video_ctrl_w) |
| 98 | 98 | AM_RANGE(0x1c01, 0x1c01) AM_READWRITE(input_port_1_r, battlane_scrollx_w) |
| 99 | 99 | AM_RANGE(0x1c02, 0x1c02) AM_READWRITE(input_port_2_r, battlane_scrolly_w) |
| r2418 | r2419 | |
| 101 | 101 | AM_RANGE(0x1c04, 0x1c04) AM_READWRITE(YM3526_status_port_0_r, YM3526_control_port_0_w) |
| 102 | 102 | AM_RANGE(0x1c05, 0x1c05) AM_WRITE(YM3526_write_port_0_w) |
| 103 | 103 | AM_RANGE(0x1e00, 0x1e3f) AM_WRITE(battlane_palette_w) |
| 104 | AM_RANGE(0x2000, 0x3fff) AM_RAM | |
| 104 | AM_RANGE(0x2000, 0x3fff) AM_RAM | |
| 105 | 105 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 106 | 106 | ADDRESS_MAP_END |
| 107 | 107 |
| r2418 | r2419 | |
|---|---|---|
| 1095 | 1095 | atarigen_eeprom_default = NULL; |
| 1096 | 1096 | atarigt_is_primrage = 0; |
| 1097 | 1097 | |
| 1098 | cage_init(REGION_USER1, 0x4fad); | |
| 1098 | cage_init(machine, REGION_USER1, 0x4fad); | |
| 1099 | 1099 | cage_set_irq_handler(cage_irq_callback); |
| 1100 | 1100 | |
| 1101 | 1101 | /* setup protection */ |
| r2418 | r2419 | |
| 1103 | 1103 | protection_w = tmek_protection_w; |
| 1104 | 1104 | |
| 1105 | 1105 | /* temp hack */ |
| 1106 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd72000, 0xd75fff, 0, 0, tmek_pf_w); | |
| 1106 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd72000, 0xd75fff, 0, 0, tmek_pf_w); | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | |
| 1110 | static void primrage_init_common(offs_t cage_speedup) | |
| 1110 | static void primrage_init_common(running_machine *machine, offs_t cage_speedup) | |
| 1111 | 1111 | { |
| 1112 | 1112 | atarigen_eeprom_default = NULL; |
| 1113 | 1113 | atarigt_is_primrage = 1; |
| 1114 | 1114 | |
| 1115 | cage_init(REGION_USER1, cage_speedup); | |
| 1115 | cage_init(machine, REGION_USER1, cage_speedup); | |
| 1116 | 1116 | cage_set_irq_handler(cage_irq_callback); |
| 1117 | 1117 | |
| 1118 | 1118 | /* install protection */ |
| r2418 | r2419 | |
| 1120 | 1120 | protection_w = primrage_protection_w; |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | static DRIVER_INIT( primrage ) { primrage_init_common(0x42f2); } | |
| 1124 | static DRIVER_INIT( primraga ) { primrage_init_common(0x48a4); } | |
| 1123 | static DRIVER_INIT( primrage ) { primrage_init_common(machine, 0x42f2); } | |
| 1124 | static DRIVER_INIT( primraga ) { primrage_init_common(machine, 0x48a4); } | |
| 1125 | 1125 | |
| 1126 | 1126 | |
| 1127 | 1127 |
| r2418 | r2419 | |
|---|---|---|
| 66 | 66 | static ADDRESS_MAP_START( cm_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 67 | 67 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 68 | 68 | AM_RANGE(0x8000, 0xd3ff) AM_RAM |
| 69 | AM_RANGE(0xd400, 0xd7ff) AM_RAM | |
| 69 | AM_RANGE(0xd400, 0xd7ff) AM_RAM | |
| 70 | 70 | AM_RANGE(0xd800, 0xdbff) AM_RAM |
| 71 | AM_RANGE(0xdc00, 0xdfff) AM_RAM | |
| 71 | AM_RANGE(0xdc00, 0xdfff) AM_RAM | |
| 72 | 72 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 73 | 73 | ADDRESS_MAP_END |
| 74 | 74 |
| r2418 | r2419 | |
|---|---|---|
| 110 | 110 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 111 | 111 | AM_RANGE(0x940000, 0x940fff) AM_RAM AM_BASE(&gms_vidram2) |
| 112 | 112 | AM_RANGE(0x980300, 0x983fff) AM_RAM // 0x2048 words ???, byte access |
| 113 | AM_RANGE(0x900000, 0x900fff) AM_R | |
| 113 | AM_RANGE(0x900000, 0x900fff) AM_R | |
| 114 | 114 | AM_RANGE(0x9c0000, 0x9c0fff) AM_RAM AM_BASE(&gms_vidram) |
| 115 | 115 | AM_RANGE(0xb00000, 0xb00001) AM_WRITE(eeprom_w) |
| 116 | 116 | AM_RANGE(0xC00000, 0xC00001) AM_READ(input_port_0_word_r) AM_WRITE(gms_write1) |
| r2418 | r2419 | |
|---|---|---|
| 163 | 163 | static ADDRESS_MAP_START( thepit_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 164 | 164 | AM_RANGE(0x0000, 0x4fff) AM_ROM |
| 165 | 165 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 166 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, thepit_colorram_w) AM_BASE(&thepit_colorram) | |
| 167 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, thepit_videoram_w) AM_BASE(&thepit_videoram) | |
| 166 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_colorram_w) AM_BASE(&thepit_colorram) | |
| 167 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_videoram_w) AM_BASE(&thepit_videoram) | |
| 168 | 168 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_BASE(&thepit_attributesram) |
| 169 | 169 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&thepit_spriteram) AM_SIZE(&thepit_spriteram_size) |
| 170 | 170 | AM_RANGE(0x9860, 0x98ff) AM_RAM |
| r2418 | r2419 | |
| 184 | 184 | static ADDRESS_MAP_START( intrepid_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 185 | 185 | AM_RANGE(0x0000, 0x4fff) AM_ROM |
| 186 | 186 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 187 | AM_RANGE(0x9000, 0x93ff) AM_READWRITE(SMH_RAM, thepit_videoram_w) AM_BASE(&thepit_videoram) | |
| 188 | AM_RANGE(0x9400, 0x97ff) AM_READWRITE(SMH_RAM, thepit_colorram_w) AM_BASE(&thepit_colorram) | |
| 187 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(thepit_videoram_w) AM_BASE(&thepit_videoram) | |
| 188 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(thepit_colorram_w) AM_BASE(&thepit_colorram) | |
| 189 | 189 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_BASE(&thepit_attributesram) |
| 190 | 190 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&thepit_spriteram) AM_SIZE(&thepit_spriteram_size) |
| 191 | 191 | AM_RANGE(0x9860, 0x98ff) AM_RAM |
| r2418 | r2419 | |
| 1037 | 1037 | static DRIVER_INIT( rtriv ) |
| 1038 | 1038 | { |
| 1039 | 1039 | // Set-up the weirdest questions read ever done |
| 1040 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, rtriv_question_r); | |
| 1040 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, rtriv_question_r); | |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 |
| r2418 | r2419 | |
|---|---|---|
| 202 | 202 | AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_BANK2) |
| 203 | 203 | AM_RANGE(0x6000, 0x7fff) AM_WRITE(trvmadns_gfxram_w) AM_BASE(&trvmadns_gfxram) |
| 204 | 204 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 205 | AM_RANGE(0xc000, 0xc01f) AM_RAM AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_le_w) AM_BASE(&paletteram) | |
| 206 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_WRITE(trvmadns_tileram_w) AM_BASE(&trvmadns_tileram) | |
| 205 | AM_RANGE(0xc000, 0xc01f) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_le_w) AM_BASE(&paletteram) | |
| 206 | AM_RANGE(0xa000, 0xbfff) AM_RAM_WRITE(trvmadns_tileram_w) AM_BASE(&trvmadns_tileram) | |
| 207 | 207 | AM_RANGE(0xe000, 0xe000) AM_WRITE(w2)//NOP |
| 208 | 208 | AM_RANGE(0xe004, 0xe004) AM_WRITE(w3)//NOP |
| 209 | 209 | ADDRESS_MAP_END |
| r2418 | r2419 | |
|---|---|---|
| 307 | 307 | AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(&spriteram) |
| 308 | 308 | AM_RANGE(0x5400, 0x547f) AM_WRITE(watchdog_reset_w) |
| 309 | 309 | AM_RANGE(0x5480, 0x54ff) AM_WRITE(irq_ack_w) |
| 310 | AM_RANGE(0x5500, 0x557f) AM_R | |
| 310 | AM_RANGE(0x5500, 0x557f) AM_R | |
| 311 | 311 | AM_RANGE(0x5580, 0x5587) AM_MIRROR(0x0078) AM_WRITE(cloud9_video_control_w) |
| 312 | 312 | AM_RANGE(0x5600, 0x5601) AM_MIRROR(0x0078) AM_WRITE(cloud9_coin_counter_w) |
| 313 | 313 | AM_RANGE(0x5602, 0x5603) AM_MIRROR(0x0078) AM_WRITE(cloud9_led_w) |
| r2418 | r2419 | |
|---|---|---|
| 495 | 495 | /* bit 5 = select work RAM or palette */ |
| 496 | 496 | if (lines & 0x20) |
| 497 | 497 | { |
| 498 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 498 | memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 499 | 499 | memory_set_bankptr(3, paletteram); |
| 500 | 500 | } |
| 501 | 501 | else |
| 502 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */ | |
| 502 | memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */ | |
| 503 | 503 | |
| 504 | 504 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 505 | 505 | K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| r2418 | r2419 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 59 | 59 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 60 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(pooyan_colorram_w) AM_BASE(&colorram) | |
| 61 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(pooyan_videoram_w) AM_BASE(&videoram) | |
| 60 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pooyan_colorram_w) AM_BASE(&colorram) | |
| 61 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pooyan_videoram_w) AM_BASE(&videoram) | |
| 62 | 62 | AM_RANGE(0x8800, 0x8fff) AM_RAM |
| 63 | 63 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram) |
| 64 | 64 | AM_RANGE(0x9400, 0x94ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2) |
| r2418 | r2419 | |
|---|---|---|
| 689 | 689 | decrypt156(); |
| 690 | 690 | cpunum_set_clockscale(machine, 0, 4.0f); /* core timings aren't accurate */ |
| 691 | 691 | descramble_sound(); |
| 692 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); | |
| 692 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 ) |
| r2418 | r2419 | |
|---|---|---|
| 578 | 578 | memory_set_opbase_handler(0, esb_setopbase); |
| 579 | 579 | |
| 580 | 580 | /* install read/write handlers for it */ |
| 581 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_r); | |
| 582 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_w); | |
| 581 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_r, esb_slapstic_w); | |
| 583 | 582 | |
| 584 | 583 | /* install additional banking */ |
| 585 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, SMH_BANK2); | |
| 584 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, SMH_BANK2); | |
| 586 | 585 | |
| 587 | 586 | /* prepare the matrix processor */ |
| 588 | 587 | starwars_is_esb = 1; |
| r2418 | r2419 | |
|---|---|---|
| 486 | 486 | |
| 487 | 487 | /* If this value is increased then something has gone wrong and the protection failed */ |
| 488 | 488 | /* Write-protect it for now */ |
| 489 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x109e98, 0x109e9b, 0, 0, genix_prot_r ); | |
| 489 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x109e98, 0x109e9b, 0, 0, genix_prot_r ); | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 |
| r2418 | r2419 | |
|---|---|---|
| 133 | 133 | AM_RANGE(0x0000, 0xbfff) AM_ROM AM_WRITENOP |
| 134 | 134 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)// is it here? |
| 135 | 135 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 136 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(cm_videoram_w) AM_BASE(&videoram) | |
| 137 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(cm_colorram_w) AM_BASE(&colorram) | |
| 136 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(cm_videoram_w) AM_BASE(&videoram) | |
| 137 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(cm_colorram_w) AM_BASE(&colorram) | |
| 138 | 138 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 139 | 139 | ADDRESS_MAP_END |
| 140 | 140 |
| r2418 | r2419 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 105 | 105 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 106 | AM_RANGE(0x100000, 0x103fff) AM_RAM | |
| 106 | AM_RANGE(0x100000, 0x103fff) AM_RAM | |
| 107 | 107 | AM_RANGE(0x108000, 0x108007) AM_RAM AM_BASE(&wrally_vregs) /* Video Registers */ |
| 108 | 108 | AM_RANGE(0x10800c, 0x10800d) AM_WRITE(SMH_NOP) /* CLR INT Video */ |
| 109 | AM_RANGE(0x200000, 0x203fff) AM_RAM | |
| 109 | AM_RANGE(0x200000, 0x203fff) AM_RAM | |
| 110 | 110 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&wrally_spriteram) /* Sprite RAM */ |
| 111 | 111 | AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r) /* DSW #1 & #2 */ |
| 112 | 112 | AM_RANGE(0x700002, 0x700003) AM_READ(input_port_1_word_r) /* INPUT 1P & 2P, COINSW, STARTSW */ |
| r2418 | r2419 | |
|---|---|---|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | static void system18_generic_init(int _rom_board) | |
| 163 | static void system18_generic_init(running_machine *machine, int _rom_board) | |
| 164 | 164 | { |
| 165 | 165 | /* set the ROM board */ |
| 166 | 166 | rom_board = _rom_board; |
| r2418 | r2419 | |
| 173 | 173 | workram = auto_malloc(0x04000); |
| 174 | 174 | |
| 175 | 175 | /* init the memory mapper */ |
| 176 | segaic16_memory_mapper_init(0, region_info_list[rom_board], sound_w, sound_r); | |
| 176 | segaic16_memory_mapper_init(machine, 0, region_info_list[rom_board], sound_w, sound_r); | |
| 177 | 177 | |
| 178 | 178 | /* init the FD1094 */ |
| 179 | 179 | fd1094_driver_init(segaic16_memory_mapper_set_decrypted); |
| r2418 | r2419 | |
| 199 | 199 | |
| 200 | 200 | static MACHINE_RESET( system18 ) |
| 201 | 201 | { |
| 202 | segaic16_memory_mapper_reset(); | |
| 202 | segaic16_memory_mapper_reset(machine); | |
| 203 | 203 | segaic16_tilemap_reset(0); |
| 204 | 204 | fd1094_machine_init(); |
| 205 | 205 | |
| r2418 | r2419 | |
| 2199 | 2199 | |
| 2200 | 2200 | static DRIVER_INIT( generic_shad ) |
| 2201 | 2201 | { |
| 2202 | system18_generic_init(ROM_BOARD_171_SHADOW); | |
| 2202 | system18_generic_init(machine, ROM_BOARD_171_SHADOW); | |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | 2205 | static DRIVER_INIT( generic_5874 ) |
| 2206 | 2206 | { |
| 2207 | system18_generic_init(ROM_BOARD_171_5874); | |
| 2207 | system18_generic_init(machine, ROM_BOARD_171_5874); | |
| 2208 | 2208 | } |
| 2209 | 2209 | |
| 2210 | 2210 | static DRIVER_INIT( generic_5987 ) |
| 2211 | 2211 | { |
| 2212 | system18_generic_init(ROM_BOARD_171_5987); | |
| 2212 | system18_generic_init(machine, ROM_BOARD_171_5987); | |
| 2213 | 2213 | } |
| 2214 | 2214 | |
| 2215 | 2215 |
| r2418 | r2419 | |
|---|---|---|
| 174 | 174 | AM_RANGE( 0x058000, 0x058001 ) AM_WRITE( astrocorp_eeprom_w ) |
| 175 | 175 | AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE( astrocorp_outputs_w ) |
| 176 | 176 | AM_RANGE( 0x05e000, 0x05e001 ) AM_READ( astrocorp_eeprom_r ) |
| 177 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM | |
| 177 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM | |
| 178 | 178 | AM_RANGE( 0x070000, 0x073fff ) AM_RAM |
| 179 | 179 | AM_RANGE( 0x080000, 0x080001 ) AM_WRITE( astrocorp_sound_bank_w ) |
| 180 | 180 | AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE( astrocorp_enable_w ) |
| r2418 | r2419 | |
|---|---|---|
| 96 | 96 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 97 | 97 | AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) |
| 98 | 98 | AM_RANGE(0x7c00, 0x7fff) AM_RAM |
| 99 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram) | |
| 100 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram) | |
| 99 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram) | |
| 100 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram) | |
| 101 | 101 | AM_RANGE(0x8800, 0x8bff) AM_RAM AM_BASE(&spriteram_2) /* ??? */ |
| 102 | 102 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) |
| 103 | 103 | AM_RANGE(0xa000, 0xa000) AM_WRITENOP /* ??? toggled twice at end of irq handler */ |
| r2418 | r2419 | |
| 147 | 147 | AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w) |
| 148 | 148 | AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w) |
| 149 | 149 | |
| 150 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram) | |
| 151 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram) | |
| 150 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram) | |
| 151 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram) | |
| 152 | 152 | AM_RANGE(0x8800, 0x8fff) AM_RAM AM_BASE(&spriteram_2) /* ??? */ |
| 153 | 153 | |
| 154 | 154 | AM_RANGE(0xa000, 0xa000) AM_WRITENOP /* ??? */ |
| r2418 | r2419 | |
|---|---|---|
| 35 | 35 | AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ajax_ls138_f10_r, ajax_ls138_f10_w) /* bankswitch + sound command + FIRQ command */ |
| 36 | 36 | AM_RANGE(0x0800, 0x0807) AM_READWRITE(K051937_r, K051937_w) /* sprite control registers */ |
| 37 | 37 | AM_RANGE(0x0c00, 0x0fff) AM_READWRITE(K051960_r, K051960_w) /* sprite RAM 2128SL at J7 */ |
| 38 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 38 | AM_RANGE(0x1000, 0x1fff) AM_R | |
| 39 | 39 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE(1) /* shared RAM with the 6809 */ |
| 40 | 40 | AM_RANGE(0x4000, 0x5fff) AM_RAM /* RAM 6264L at K10 */ |
| 41 | 41 | AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(2) /* banked ROM */ |
| r2418 | r2419 | |
|---|---|---|
| 42 | 42 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 43 | 43 | if ((data & 1) == 0) |
| 44 | 44 | /* overlay disabled, map RAM on 0x000000 */ |
| 45 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 45 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1); | |
| 46 | 46 | |
| 47 | 47 | else |
| 48 | 48 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 49 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 49 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 |
| r2418 | r2419 | |
|---|---|---|
| 478 | 478 | AM_RANGE(0x088000, 0x0883ff) AM_READ(SMH_RAM) |
| 479 | 479 | AM_RANGE(0x090000, 0x093fff) AM_READ(nmk_bgvideoram_r) |
| 480 | 480 | AM_RANGE(0x09d000, 0x09d7ff) AM_READ(nmk_txvideoram_r) |
| 481 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 481 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 482 | 482 | ADDRESS_MAP_END |
| 483 | 483 | |
| 484 | 484 | static ADDRESS_MAP_START( tharrier_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r2418 | r2419 | |
| 507 | 507 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 508 | 508 | AM_RANGE(0x080016, 0x080017) AM_WRITE(SMH_NOP) // frame number? |
| 509 | 509 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(NMK004_w) |
| 510 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 510 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 511 | 511 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 512 | 512 | AM_RANGE(0x08c002, 0x08c087) AM_WRITE(SMH_NOP) // ?? |
| 513 | AM_RANGE(0x090000, 0x093fff) AM_RAM AM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 514 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM AM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 515 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 513 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 514 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 515 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 516 | 516 | ADDRESS_MAP_END |
| 517 | 517 | |
| 518 | 518 | static ADDRESS_MAP_START( mustangb_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r2418 | r2419 | |
| 524 | 524 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 525 | 525 | AM_RANGE(0x080016, 0x080017) AM_WRITE(SMH_NOP) // frame number? |
| 526 | 526 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(seibu_main_mustb_w) |
| 527 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 527 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 528 | 528 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 529 | 529 | AM_RANGE(0x08c002, 0x08c087) AM_WRITE(SMH_NOP) // ?? |
| 530 | AM_RANGE(0x090000, 0x093fff) AM_RAM AM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 531 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM AM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 532 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 530 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 531 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 532 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 533 | 533 | ADDRESS_MAP_END |
| 534 | 534 | |
| 535 | 535 | |
| r2418 | r2419 | |
| 542 | 542 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 543 | 543 | AM_RANGE(0x080016, 0x080017) AM_WRITE(SMH_NOP) // frame number? |
| 544 | 544 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(afega_soundlatch_w) |
| 545 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 545 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 546 | 546 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 547 | 547 | AM_RANGE(0x08c002, 0x08c087) AM_WRITE(SMH_NOP) // ?? |
| 548 | AM_RANGE(0x090000, 0x093fff) AM_RAM AM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 549 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM AM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 550 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 548 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 549 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 550 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) | |
| 551 | 551 | ADDRESS_MAP_END |
| 552 | 552 | |
| 553 | 553 | |
| r2418 | r2419 | |
| 780 | 780 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 781 | 781 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(NMK004_w) |
| 782 | 782 | /* Video Region */ |
| 783 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 783 | AM_RANGE(0x088000, 0x0887ff) AM_RAM | |
| 784 | 784 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(nmk_scroll_w) |
| 785 | AM_RANGE(0x090000, 0x093fff) AM_RAM AM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 786 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM AM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 785 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) | |
| 786 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 787 | 787 | /* Main RAM, inc sprites, shared with MCU */ |
| 788 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 788 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 789 | 789 | ADDRESS_MAP_END |
| 790 | 790 | |
| 791 | 791 | |
| r2418 | r2419 | |
| 854 | 854 | // AM_RANGE(0x0b9000, 0x0bdfff) AM_READ(SMH_RAM) /* Work RAM */ |
| 855 | 855 | // AM_RANGE(0x0be000, 0x0befff) AM_READ(SMH_RAM) /* Work RAM */ |
| 856 | 856 | // AM_RANGE(0x0bf000, 0x0bffff) AM_READ(SMH_RAM) /* Work RAM */ |
| 857 | AM_RANGE(0x0b0000, 0x0bffff) AM_RAM | |
| 857 | AM_RANGE(0x0b0000, 0x0bffff) AM_RAM | |
| 858 | 858 | |
| 859 | 859 | |
| 860 | 860 | AM_RANGE(0x0c8000, 0x0c87ff) AM_READ(SMH_RAM) /* Palette RAM */ |
| r2418 | r2419 | |
| 976 | 976 | AM_RANGE(0x088000, 0x0887ff) AM_READ(SMH_RAM) |
| 977 | 977 | AM_RANGE(0x090000, 0x093fff) AM_READ(nmk_bgvideoram_r) |
| 978 | 978 | AM_RANGE(0x09c000, 0x09c7ff) AM_READ(nmk_txvideoram_r) |
| 979 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 979 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
| 980 | 980 | ADDRESS_MAP_END |
| 981 | 981 | |
| 982 | 982 | static ADDRESS_MAP_START( macross_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r2418 | r2419 | |
| 1012 | 1012 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 1013 | 1013 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(NMK004_w) |
| 1014 | 1014 | AM_RANGE(0x088000, 0x0887ff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) |
| 1015 | AM_RANGE(0x08c000, 0x08c1ff) AM_RAM | |
| 1015 | AM_RANGE(0x08c000, 0x08c1ff) AM_RAM | |
| 1016 | 1016 | AM_RANGE(0x08c200, 0x08c201) AM_WRITE(gunnail_scrolly_w) |
| 1017 | 1017 | AM_RANGE(0x08c202, 0x08c7ff) AM_RAM // extra scroll registers (used after a boss is killed and in level 5) |
| 1018 | 1018 | AM_RANGE(0x090000, 0x093fff) AM_WRITE(nmk_bgvideoram_w) AM_BASE(&nmk_bgvideoram) |
| r2418 | r2419 | |
| 4791 | 4791 | static READ16_HANDLER( vandykeb_r ) { return 0x0000; } |
| 4792 | 4792 | static DRIVER_INIT (vandykeb) |
| 4793 | 4793 | { |
| 4794 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x08000e, 0x08000f, 0, 0, vandykeb_r ); | |
| 4795 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x08001e, 0x08001f, 0, 0, SMH_NOP ); | |
| 4794 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x08000e, 0x08000f, 0, 0, vandykeb_r ); | |
| 4795 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x08001e, 0x08001f, 0, 0, SMH_NOP ); | |
| 4796 | 4796 | } |
| 4797 | 4797 | |
| 4798 | 4798 | |
| r2418 | r2419 | |
| 4838 | 4838 | AM_RANGE(0x080012, 0x080013) AM_READ(afega_unknown_r) |
| 4839 | 4839 | AM_RANGE(0x080000, 0x08001d) AM_WRITE(SMH_RAM) // |
| 4840 | 4840 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(afega_soundlatch_w) // To Sound CPU |
| 4841 | /**/AM_RANGE(0x084000, 0x084003) AM_RAM AM_WRITE(afega_scroll0_w) // Scroll on redhawkb (mirror or changed?..) | |
| 4842 | /**/AM_RANGE(0x084004, 0x084007) AM_RAM AM_WRITE(afega_scroll1_w) // Scroll on redhawkb (mirror or changed?..) | |
| 4841 | /**/AM_RANGE(0x084000, 0x084003) AM_RAM_WRITE(afega_scroll0_w) // Scroll on redhawkb (mirror or changed?..) | |
| 4842 | /**/AM_RANGE(0x084004, 0x084007) AM_RAM_WRITE(afega_scroll1_w) // Scroll on redhawkb (mirror or changed?..) | |
| 4843 | 4843 | AM_RANGE(0x080020, 0x087fff) AM_WRITE(SMH_RAM) // |
| 4844 | /**/AM_RANGE(0x088000, 0x0885ff) AM_R | |
| 4844 | /**/AM_RANGE(0x088000, 0x0885ff) AM_R | |
| 4845 | 4845 | AM_RANGE(0x088600, 0x08bfff) AM_WRITE(SMH_RAM) // |
| 4846 | /**/AM_RANGE(0x08c000, 0x08c003) AM_RAM AM_WRITE(afega_scroll0_w) AM_BASE(&afega_scroll_0) // Scroll | |
| 4847 | /**/AM_RANGE(0x08c004, 0x08c007) AM_RAM AM_WRITE(afega_scroll1_w) AM_BASE(&afega_scroll_1) // | |
| 4846 | /**/AM_RANGE(0x08c000, 0x08c003) AM_RAM_WRITE(afega_scroll0_w) AM_BASE(&afega_scroll_0) // Scroll | |
| 4847 | /**/AM_RANGE(0x08c004, 0x08c007) AM_RAM_WRITE(afega_scroll1_w) AM_BASE(&afega_scroll_1) // | |
| 4848 | 4848 | AM_RANGE(0x08c008, 0x08ffff) AM_WRITE(SMH_RAM) // |
| 4849 | /**/AM_RANGE(0x090000, 0x091fff) AM_R | |
| 4849 | /**/AM_RANGE(0x090000, 0x091fff) AM_R | |
| 4850 | 4850 | /**/AM_RANGE(0x092000, 0x093fff) AM_RAM // ? |
| 4851 | /**/AM_RANGE(0x09c000, 0x09c7ff) AM_R | |
| 4851 | /**/AM_RANGE(0x09c000, 0x09c7ff) AM_R | |
| 4852 | 4852 | |
| 4853 | 4853 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE(1) AM_WRITE(nmk16_mainram_strange_w) AM_BASE(&nmk16_mainram) |
| 4854 | 4854 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE(1) AM_WRITE(nmk16_mainram_strange_w) |
| r2418 | r2419 | |
|---|---|---|
| 182 | 182 | |
| 183 | 183 | static ADDRESS_MAP_START( miniboy7_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 184 | 184 | AM_RANGE(0x0000, 0x07ff) AM_RAM /* battery backed RAM? */ |
| 185 | AM_RANGE(0x0800, 0x0fff) AM_RAM AM_WRITE(miniboy7_videoram_w) AM_BASE(&videoram) | |
| 186 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_WRITE(miniboy7_colorram_w) AM_BASE(&colorram) | |
| 185 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(miniboy7_videoram_w) AM_BASE(&videoram) | |
| 186 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(miniboy7_colorram_w) AM_BASE(&colorram) | |
| 187 | 187 | AM_RANGE(0x1800, 0x25ff) AM_RAM /* looks like videoram */ |
| 188 | 188 | AM_RANGE(0x2600, 0x27ff) AM_RAM |
| 189 | 189 | AM_RANGE(0x2800, 0x2800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| r2418 | r2419 | |
|---|---|---|
| 477 | 477 | AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */ |
| 478 | 478 | AM_RANGE(0x1000, 0x2fff) AM_READ(SMH_ROM) AM_BASE_MEMBER(m10_state, rom) |
| 479 | 479 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 480 | AM_RANGE(0x4800, 0x4bff) AM_R | |
| 480 | AM_RANGE(0x4800, 0x4bff) AM_R | |
| 481 | 481 | AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(m10_state, chargen) /* background ????? */ |
| 482 | 482 | AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r) |
| 483 | 483 | AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r) |
| r2418 | r2419 | |
| 491 | 491 | AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */ |
| 492 | 492 | AM_RANGE(0x1000, 0x2fff) AM_READ(SMH_ROM) AM_BASE_MEMBER(m10_state, rom) |
| 493 | 493 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 494 | AM_RANGE(0x4800, 0x4bff) AM_R | |
| 494 | AM_RANGE(0x4800, 0x4bff) AM_R | |
| 495 | 495 | AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(m10_state, chargen) /* background ????? */ |
| 496 | 496 | AM_RANGE(0xa100, 0xa100) AM_WRITE(m11_a100_w) /* sound writes ???? */ |
| 497 | 497 | AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
| 505 | 505 | AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */ |
| 506 | 506 | AM_RANGE(0x1000, 0x33ff) AM_READ(SMH_ROM) AM_BASE_MEMBER(m10_state, rom) |
| 507 | 507 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 508 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(SMH_RAM, m10_colorram_w) AM_BASE(&colorram) /* foreground colour */ | |
| 509 | AM_RANGE(0x5000, 0x57ff) AM_READWRITE(SMH_RAM, m15_chargen_w) AM_BASE_MEMBER(m10_state, chargen) /* background ????? */ | |
| 508 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(m10_colorram_w) AM_BASE(&colorram) /* foreground colour */ | |
| 509 | AM_RANGE(0x5000, 0x57ff) AM_RAM_WRITE(m15_chargen_w) AM_BASE_MEMBER(m10_state, chargen) /* background ????? */ | |
| 510 | 510 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_3_r) |
| 511 | 511 | AM_RANGE(0xa100, 0xa100) AM_WRITE(m15_a100_w) /* sound writes ???? */ |
| 512 | 512 | AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r) |
| r2418 | r2419 | |
|---|---|---|
| 50 | 50 | #define Y1 dsp56k.aluDataRegs[1].w.h |
| 51 | 51 | #define Y0 dsp56k.aluDataRegs[1].w.l |
| 52 | 52 | |
| 53 | #define A dsp56k.aluAccumRegs[0]. | |
| 53 | #define A dsp56k.aluAccumRegs[0].q | |
| 54 | 54 | #define A2 dsp56k.aluAccumRegs[0].b.h4 |
| 55 | 55 | #define A1 dsp56k.aluAccumRegs[0].w.h |
| 56 | 56 | #define A0 dsp56k.aluAccumRegs[0].w.l |
| 57 | #define B dsp56k.aluAccumRegs[1]. | |
| 57 | #define B dsp56k.aluAccumRegs[1].q | |
| 58 | 58 | #define B2 dsp56k.aluAccumRegs[1].b.h4 |
| 59 | 59 | #define B1 dsp56k.aluAccumRegs[1].w.h |
| 60 | 60 | #define B0 dsp56k.aluAccumRegs[1].w.l |
| r2418 | r2419 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | /* if specified, this gets called for every DMA read */ |
| 106 | 106 | cdp1802_dma_read_func dma_r; |
| 107 | ||
| 107 | ||
| 108 | 108 | /* if specified, this gets called for every DMA write */ |
| 109 | 109 | cdp1802_dma_write_func dma_w; |
| 110 | 110 | }; |
| r2418 | r2419 | |
|---|---|---|
| 916 | 916 | { |
| 917 | 917 | case 0: s += sprintf( s, "bw+ix" ); break; |
| 918 | 918 | case 1: s += sprintf( s, "bw+iy" ); break; |
| 919 | case 2: s += sprintf( s, "bw+ix" ); break; | |
| 920 | case 3: s += sprintf( s, "bw+iy" ); break; | |
| 919 | case 2: s += sprintf( s, "bp+ix" ); break; | |
| 920 | case 3: s += sprintf( s, "bp+iy" ); break; | |
| 921 | 921 | case 4: s += sprintf( s, "ix" ); break; |
| 922 | 922 | case 5: s += sprintf( s, "iy" ); break; |
| 923 | 923 | case 6: |
| r2418 | r2419 | |
|---|---|---|
| 1252 | 1252 | mipscpu.berr = 1; |
| 1253 | 1253 | } |
| 1254 | 1254 | |
| 1255 | static void mips_update_scratchpad( | |
| 1255 | static void mips_update_scratchpad( running_machine *machine ) | |
| 1256 | 1256 | { |
| 1257 | 1257 | int cpu = cpu_getactivecpu(); |
| 1258 | 1258 | |
| 1259 | 1259 | if( ( mipscpu.biu & BIU_RAM ) == 0 ) |
| 1260 | 1260 | { |
| 1261 | memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r ); | |
| 1262 | memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_w ); | |
| 1261 | memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, psx_berr_w ); | |
| 1263 | 1262 | } |
| 1264 | 1263 | else if( ( mipscpu.biu & BIU_DS ) == 0 ) |
| 1265 | 1264 | { |
| 1266 | memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r ); | |
| 1267 | memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_NOP ); | |
| 1265 | memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, SMH_NOP ); | |
| 1268 | 1266 | } |
| 1269 | 1267 | else |
| 1270 | 1268 | { |
| 1271 | memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32 ); | |
| 1272 | memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32 ); | |
| 1269 | memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 ); | |
| 1273 | 1270 | |
| 1274 | 1271 | memory_set_bankptr( 32, mipscpu.dcache ); |
| 1275 | 1272 | } |
| r2418 | r2419 | |
| 1564 | 1561 | { |
| 1565 | 1562 | mips_update_memory_handlers(); |
| 1566 | 1563 | mips_update_address_masks(); |
| 1567 | mips_update_scratchpad(); | |
| 1564 | mips_update_scratchpad(machine); | |
| 1568 | 1565 | } |
| 1569 | 1566 | |
| 1570 | 1567 | static void mips_state_register( const char *type, int index ) |
| r2418 | r2419 | |
| 1605 | 1602 | |
| 1606 | 1603 | mips_update_memory_handlers(); |
| 1607 | 1604 | mips_update_address_masks(); |
| 1608 | mips_update_scratchpad(); | |
| 1605 | mips_update_scratchpad(Machine); | |
| 1609 | 1606 | |
| 1610 | 1607 | mips_set_cp0r( CP0_SR, SR_BEV ); |
| 1611 | 1608 | mips_set_cp0r( CP0_CAUSE, 0x00000000 ); |
| r2418 | r2419 | |
| 2887 | 2884 | |
| 2888 | 2885 | if( ( old & ( BIU_RAM | BIU_DS ) ) != ( mipscpu.biu & ( BIU_RAM | BIU_DS ) ) ) |
| 2889 | 2886 | { |
| 2890 | mips_update_scratchpad(); | |
| 2887 | mips_update_scratchpad(machine); | |
| 2891 | 2888 | } |
| 2892 | 2889 | } |
| 2893 | 2890 | |
| r2418 | r2419 | |
| 2992 | 2989 | #define B ( mipscpu.cp2dr[ 6 ].b.h2 ) |
| 2993 | 2990 | #define CODE ( mipscpu.cp2dr[ 6 ].b.h3 ) |
| 2994 | 2991 | #define OTZ ( mipscpu.cp2dr[ 7 ].w.l ) |
| 2995 | #define IR0 ( mipscpu.cp2dr[ 8 ].d ) | |
| 2996 | #define IR1 ( mipscpu.cp2dr[ 9 ].d ) | |
| 2997 | #define IR2 ( mipscpu.cp2dr[ 10 ].d ) | |
| 2998 | #define IR3 ( mipscpu.cp2dr[ 11 ].d ) | |
| 2992 | #define IR0 ( mipscpu.cp2dr[ 8 ].sw.l ) | |
| 2993 | #define IR1 ( mipscpu.cp2dr[ 9 ].sw.l ) | |
| 2994 | #define IR2 ( mipscpu.cp2dr[ 10 ].sw.l ) | |
| 2995 | #define IR3 ( mipscpu.cp2dr[ 11 ].sw.l ) | |
| 2999 | 2996 | #define SXY0 ( mipscpu.cp2dr[ 12 ].d ) |
| 3000 | #define SX0 ( mipscpu.cp2dr[ 12 ].w.l ) | |
| 3001 | #define SY0 ( mipscpu.cp2dr[ 12 ].w.h ) | |
| 2997 | #define SX0 ( mipscpu.cp2dr[ 12 ].sw.l ) | |
| 2998 | #define SY0 ( mipscpu.cp2dr[ 12 ].sw.h ) | |
| 3002 | 2999 | #define SXY1 ( mipscpu.cp2dr[ 13 ].d ) |
| 3003 | #define SX1 ( mipscpu.cp2dr[ 13 ].w.l ) | |
| 3004 | #define SY1 ( mipscpu.cp2dr[ 13 ].w.h ) | |
| 3000 | #define SX1 ( mipscpu.cp2dr[ 13 ].sw.l ) | |
| 3001 | #define SY1 ( mipscpu.cp2dr[ 13 ].sw.h ) | |
| 3005 | 3002 | #define SXY2 ( mipscpu.cp2dr[ 14 ].d ) |
| 3006 | #define SX2 ( mipscpu.cp2dr[ 14 ].w.l ) | |
| 3007 | #define SY2 ( mipscpu.cp2dr[ 14 ].w.h ) | |
| 3003 | #define SX2 ( mipscpu.cp2dr[ 14 ].sw.l ) | |
| 3004 | #define SY2 ( mipscpu.cp2dr[ 14 ].sw.h ) | |
| 3008 | 3005 | #define SXYP ( mipscpu.cp2dr[ 15 ].d ) |
| 3009 | #define SXP ( mipscpu.cp2dr[ 15 ].w.l ) | |
| 3010 | #define SYP ( mipscpu.cp2dr[ 15 ].w.h ) | |
| 3006 | #define SXP ( mipscpu.cp2dr[ 15 ].sw.l ) | |
| 3007 | #define SYP ( mipscpu.cp2dr[ 15 ].sw.h ) | |
| 3011 | 3008 | #define SZ0 ( mipscpu.cp2dr[ 16 ].w.l ) |
| 3012 | 3009 | #define SZ1 ( mipscpu.cp2dr[ 17 ].w.l ) |
| 3013 | 3010 | #define SZ2 ( mipscpu.cp2dr[ 18 ].w.l ) |
| r2418 | r2419 | |
| 3029 | 3026 | #define CD2 ( mipscpu.cp2dr[ 22 ].b.h3 ) |
| 3030 | 3027 | #define RES1 ( mipscpu.cp2dr[ 23 ].d ) |
| 3031 | 3028 | #define MAC0 ( mipscpu.cp2dr[ 24 ].d ) |
| 3032 | #define MAC1 ( mipscpu.cp2dr[ 25 ].d ) | |
| 3033 | #define MAC2 ( mipscpu.cp2dr[ 26 ].d ) | |
| 3034 | #define MAC3 ( mipscpu.cp2dr[ 27 ].d ) | |
| 3029 | #define MAC1 ( mipscpu.cp2dr[ 25 ].sd ) | |
| 3030 | #define MAC2 ( mipscpu.cp2dr[ 26 ].sd ) | |
| 3031 | #define MAC3 ( mipscpu.cp2dr[ 27 ].sd ) | |
| 3035 | 3032 | #define IRGB ( mipscpu.cp2dr[ 28 ].d ) |
| 3036 | 3033 | #define ORGB ( mipscpu.cp2dr[ 29 ].d ) |
| 3037 | 3034 | #define LZCS ( mipscpu.cp2dr[ 30 ].d ) |
| 3038 | 3035 | #define LZCR ( mipscpu.cp2dr[ 31 ].d ) |
| 3039 | 3036 | |
| 3040 | #define D1 ( mipscpu.cp2cr[ 0 ].d ) | |
| 3041 | #define R11 ( mipscpu.cp2cr[ 0 ].w.l ) | |
| 3042 | #define R12 ( mipscpu.cp2cr[ 0 ].w.h ) | |
| 3043 | #define R13 ( mipscpu.cp2cr[ 1 ].w.l ) | |
| 3044 | #define R21 ( mipscpu.cp2cr[ 1 ].w.h ) | |
| 3045 | #define D2 ( mipscpu.cp2cr[ 2 ].d ) | |
| 3046 | #define R22 ( mipscpu.cp2cr[ 2 ].w.l ) | |
| 3047 | #define R23 ( mipscpu.cp2cr[ 2 ].w.h ) | |
| 3048 | #define R31 ( mipscpu.cp2cr[ 3 ].w.l ) | |
| 3049 | #define R32 ( mipscpu.cp2cr[ 3 ].w.h ) | |
| 3050 | #define D3 ( mipscpu.cp2cr[ 4 ].d ) | |
| 3051 | #define R33 ( mipscpu.cp2cr[ 4 ].w.l ) | |
| 3052 | #define TRX ( mipscpu.cp2cr[ 5 ].d ) | |
| 3053 | #define TRY ( mipscpu.cp2cr[ 6 ].d ) | |
| 3054 | #define TRZ ( mipscpu.cp2cr[ 7 ].d ) | |
| 3055 | #define L11 ( mipscpu.cp2cr[ 8 ].w.l ) | |
| 3056 | #define L12 ( mipscpu.cp2cr[ 8 ].w.h ) | |
| 3057 | #define L13 ( mipscpu.cp2cr[ 9 ].w.l ) | |
| 3058 | #define L21 ( mipscpu.cp2cr[ 9 ].w.h ) | |
| 3059 | #define L22 ( mipscpu.cp2cr[ 10 ].w.l ) | |
| 3060 | #define L23 ( mipscpu.cp2cr[ 10 ].w.h ) | |
| 3061 | #define L31 ( mipscpu.cp2cr[ 11 ].w.l ) | |
| 3062 | #define L32 ( mipscpu.cp2cr[ 11 ].w.h ) | |
| 3063 | #define L33 ( mipscpu.cp2cr[ 12 ].w.l ) | |
| 3064 | #define RBK ( mipscpu.cp2cr[ 13 ].d ) | |
| 3065 | #define GBK ( mipscpu.cp2cr[ 14 ].d ) | |
| 3066 | #define BBK ( mipscpu.cp2cr[ 15 ].d ) | |
| 3067 | #define LR1 ( mipscpu.cp2cr[ 16 ].w.l ) | |
| 3068 | #define LR2 ( mipscpu.cp2cr[ 16 ].w.h ) | |
| 3069 | #define LR3 ( mipscpu.cp2cr[ 17 ].w.l ) | |
| 3070 | #define LG1 ( mipscpu.cp2cr[ 17 ].w.h ) | |
| 3071 | #define LG2 ( mipscpu.cp2cr[ 18 ].w.l ) | |
| 3072 | #define LG3 ( mipscpu.cp2cr[ 18 ].w.h ) | |
| 3073 | #define LB1 ( mipscpu.cp2cr[ 19 ].w.l ) | |
| 3074 | #define LB2 ( mipscpu.cp2cr[ 19 ].w.h ) | |
| 3075 | #define LB3 ( mipscpu.cp2cr[ 20 ].w.l ) | |
| 3076 | #define RFC ( mipscpu.cp2cr[ 21 ].d ) | |
| 3077 | #define GFC ( mipscpu.cp2cr[ 22 ].d ) | |
| 3078 | #define BFC ( mipscpu.cp2cr[ 23 ].d ) | |
| 3037 | #define R11 ( mipscpu.cp2cr[ 0 ].sw.l ) | |
| 3038 | #define R12 ( mipscpu.cp2cr[ 0 ].sw.h ) | |
| 3039 | #define R13 ( mipscpu.cp2cr[ 1 ].sw.l ) | |
| 3040 | #define R21 ( mipscpu.cp2cr[ 1 ].sw.h ) | |
| 3041 | #define R22 ( mipscpu.cp2cr[ 2 ].sw.l ) | |
| 3042 | #define R23 ( mipscpu.cp2cr[ 2 ].sw.h ) | |
| 3043 | #define R31 ( mipscpu.cp2cr[ 3 ].sw.l ) | |
| 3044 | #define R32 ( mipscpu.cp2cr[ 3 ].sw.h ) | |
| 3045 | #define R33 ( mipscpu.cp2cr[ 4 ].sw.l ) | |
| 3046 | #define TRX ( mipscpu.cp2cr[ 5 ].sd ) | |
| 3047 | #define TRY ( mipscpu.cp2cr[ 6 ].sd ) | |
| 3048 | #define TRZ ( mipscpu.cp2cr[ 7 ].sd ) | |
| 3049 | #define L11 ( mipscpu.cp2cr[ 8 ].sw.l ) | |
| 3050 | #define L12 ( mipscpu.cp2cr[ 8 ].sw.h ) | |
| 3051 | #define L13 ( mipscpu.cp2cr[ 9 ].sw.l ) | |
| 3052 | #define L21 ( mipscpu.cp2cr[ 9 ].sw.h ) | |
| 3053 | #define L22 ( mipscpu.cp2cr[ 10 ].sw.l ) | |
| 3054 | #define L23 ( mipscpu.cp2cr[ 10 ].sw.h ) | |
| 3055 | #define L31 ( mipscpu.cp2cr[ 11 ].sw.l ) | |
| 3056 | #define L32 ( mipscpu.cp2cr[ 11 ].sw.h ) | |
| 3057 | #define L33 ( mipscpu.cp2cr[ 12 ].sw.l ) | |
| 3058 | #define RBK ( mipscpu.cp2cr[ 13 ].sd ) | |
| 3059 | #define GBK ( mipscpu.cp2cr[ 14 ].sd ) | |
| 3060 | #define BBK ( mipscpu.cp2cr[ 15 ].sd ) | |
| 3061 | #define LR1 ( mipscpu.cp2cr[ 16 ].sw.l ) | |
| 3062 | #define LR2 ( mipscpu.cp2cr[ 16 ].sw.h ) | |
| 3063 | #define LR3 ( mipscpu.cp2cr[ 17 ].sw.l ) | |
| 3064 | #define LG1 ( mipscpu.cp2cr[ 17 ].sw.h ) | |
| 3065 | #define LG2 ( mipscpu.cp2cr[ 18 ].sw.l ) | |
| 3066 | #define LG3 ( mipscpu.cp2cr[ 18 ].sw.h ) | |
| 3067 | #define LB1 ( mipscpu.cp2cr[ 19 ].sw.l ) | |
| 3068 | #define LB2 ( mipscpu.cp2cr[ 19 ].sw.h ) | |
| 3069 | #define LB3 ( mipscpu.cp2cr[ 20 ].sw.l ) | |
| 3070 | #define RFC ( mipscpu.cp2cr[ 21 ].sd ) | |
| 3071 | #define GFC ( mipscpu.cp2cr[ 22 ].sd ) | |
| 3072 | #define BFC ( mipscpu.cp2cr[ 23 ].sd ) | |
| 3079 | 3073 | #define OFX ( mipscpu.cp2cr[ 24 ].d ) |
| 3080 | 3074 | #define OFY ( mipscpu.cp2cr[ 25 ].d ) |
| 3081 | 3075 | #define H ( mipscpu.cp2cr[ 26 ].w.l ) |
| 3082 | 3076 | #define DQA ( mipscpu.cp2cr[ 27 ].w.l ) |
| 3083 | 3077 | #define DQB ( mipscpu.cp2cr[ 28 ].d ) |
| 3084 | #define ZSF3 ( mipscpu.cp2cr[ 29 ].w.l ) | |
| 3085 | #define ZSF4 ( mipscpu.cp2cr[ 30 ].w.l ) | |
| 3078 | #define ZSF3 ( mipscpu.cp2cr[ 29 ].sw.l ) | |
| 3079 | #define ZSF4 ( mipscpu.cp2cr[ 30 ].sw.l ) | |
| 3086 | 3080 | #define FLAG ( mipscpu.cp2cr[ 31 ].d ) |
| 3087 | 3081 | |
| 3088 | 3082 | INLINE INT32 LIM( INT32 value, INT32 max, INT32 min, UINT32 flag ) |
| r2418 | r2419 | |
| 3111 | 3105 | case 9: |
| 3112 | 3106 | case 10: |
| 3113 | 3107 | case 11: |
| 3114 | mipscpu.cp2dr[ reg ].d = (INT32) | |
| 3108 | mipscpu.cp2dr[ reg ].d = (INT32) | |
| 3115 | 3109 | break; |
| 3116 | 3110 | |
| 3117 | 3111 | case 7: |
| r2418 | r2419 | |
| 3119 | 3113 | case 17: |
| 3120 | 3114 | case 18: |
| 3121 | 3115 | case 19: |
| 3122 | mipscpu.cp2dr[ reg ].d = (UINT32) | |
| 3116 | mipscpu.cp2dr[ reg ].d = (UINT32) | |
| 3123 | 3117 | break; |
| 3124 | 3118 | |
| 3125 | 3119 | case 15: |
| r2418 | r2419 | |
| 3204 | 3198 | break; |
| 3205 | 3199 | |
| 3206 | 3200 | case 31: |
| 3207 | value = ( mipscpu.cp2cr[ reg ].d & 0x80000fff ) | ( value & ~0x80000fff ); | |
| 3201 | value = value & 0x7ffff000; | |
| 3202 | if( ( value & 0x7f87e000 ) != 0 ) | |
| 3203 | { | |
| 3204 | value |= 0x80000000; | |
| 3205 | } | |
| 3208 | 3206 | break; |
| 3209 | 3207 | } |
| 3210 | 3208 | |
| r2418 | r2419 | |
| 3224 | 3222 | return n_value; |
| 3225 | 3223 | } |
| 3226 | 3224 | |
| 3227 | #define A1( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 30 ), -(INT64)0x80000000, ( 1 << 27 ) ) | |
| 3228 | #define A2( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 29 ), -(INT64)0x80000000, ( 1 << 26 ) ) | |
| 3229 | #define A3( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 28 ), -(INT64)0x80000000, ( 1 << 25 ) ) | |
| 3225 | /* Setting bits 12 & 19-22 in FLAG does not set bit 31 */ | |
| 3226 | ||
| 3227 | #define A1( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 30 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 27 ) ) | |
| 3228 | #define A2( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 29 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 26 ) ) | |
| 3229 | #define A3( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 28 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 25 ) ) | |
| 3230 | 3230 | #define Lm_B1( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << 31 ) | ( 1 << 24 ) ) |
| 3231 | 3231 | #define Lm_B2( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << 31 ) | ( 1 << 23 ) ) |
| 3232 | #define Lm_B3( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << | |
| 3232 | #define Lm_B3( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << | |
| 3233 | 3233 | #define Lm_C1( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 21 ) ) |
| 3234 | 3234 | #define Lm_C2( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 20 ) ) |
| 3235 | 3235 | #define Lm_C3( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 19 ) ) |
| r2418 | r2419 | |
| 3256 | 3256 | |
| 3257 | 3257 | static void docop2( int gteop ) |
| 3258 | 3258 | { |
| 3259 | int | |
| 3259 | int | |
| 3260 | 3260 | int n_v; |
| 3261 | int | |
| 3261 | int | |
| 3262 | 3262 | int n_pass; |
| 3263 | 3263 | UINT16 n_v1; |
| 3264 | 3264 | UINT16 n_v2; |
| 3265 | 3265 | UINT16 n_v3; |
| 3266 | const UINT16 *const *p_n_mx; | |
| 3267 | const UINT32 *const *p_n_cv; | |
| 3268 | static const UINT16 n_zm = 0; | |
| 3269 | static const UINT32 n_zc = 0; | |
| 3266 | const INT16 *const *p_n_mx; | |
| 3267 | const INT32 *const *p_n_cv; | |
| 3268 | static const INT16 n_zm = 0; | |
| 3269 | static const INT32 n_zc = 0; | |
| 3270 | 3270 | static const UINT16 *const p_n_vx[] = { &VX0, &VX1, &VX2 }; |
| 3271 | 3271 | static const UINT16 *const p_n_vy[] = { &VY0, &VY1, &VY2 }; |
| 3272 | 3272 | static const UINT16 *const p_n_vz[] = { &VZ0, &VZ1, &VZ2 }; |
| 3273 | static const UINT16 *const p_n_rm[] = { &R11, &R12, &R13, &R21, &R22, &R23, &R31, &R32, &R33 }; | |
| 3274 | static const UINT16 *const p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 }; | |
| 3275 | static const UINT16 *const p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 }; | |
| 3276 | static const UINT16 *const p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm }; | |
| 3277 | static const UINT16 *const *const p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm }; | |
| 3278 | static const UINT32 *const p_n_tr[] = { &TRX, &TRY, &TRZ }; | |
| 3279 | static const UINT32 *const p_n_bk[] = { &RBK, &GBK, &BBK }; | |
| 3280 | static const UINT32 *const p_n_fc[] = { &RFC, &GFC, &BFC }; | |
| 3281 | static const UINT32 *const p_n_zc[] = { &n_zc, &n_zc, &n_zc }; | |
| 3282 | static const UINT32 *const *const p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc }; | |
| 3273 | static const INT16 *const p_n_rm[] = { &R11, &R12, &R13, &R21, &R22, &R23, &R31, &R32, &R33 }; | |
| 3274 | static const INT16 *const p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 }; | |
| 3275 | static const INT16 *const p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 }; | |
| 3276 | static const INT16 *const p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm }; | |
| 3277 | static const INT16 *const *const p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm }; | |
| 3278 | static const INT32 *const p_n_tr[] = { &TRX, &TRY, &TRZ }; | |
| 3279 | static const INT32 *const p_n_bk[] = { &RBK, &GBK, &BBK }; | |
| 3280 | static const INT32 *const p_n_fc[] = { &RFC, &GFC, &BFC }; | |
| 3281 | static const INT32 *const p_n_zc[] = { &n_zc, &n_zc, &n_zc }; | |
| 3282 | static const INT32 *const *const p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc }; | |
| 3283 | 3283 | INT64 mac0; |
| 3284 | 3284 | |
| 3285 | 3285 | switch( GTE_FUNCT( gteop ) ) |
| r2418 | r2419 | |
| 3309 | 3309 | return; |
| 3310 | 3310 | } |
| 3311 | 3311 | break; |
| 3312 | ||
| 3312 | 3313 | case 0x06: |
| 3313 | if( gteop == 0x0400006 || | |
| 3314 | gteop == 0x1400006 || | |
| 3315 | gteop == 0x0155cc6 ) | |
| 3316 | { | |
| 3317 | GTELOG( "NCLIP" ); | |
| 3318 | FLAG = 0; | |
| 3314 | GTELOG( "NCLIP" ); | |
| 3315 | FLAG = 0; | |
| 3319 | 3316 | |
| 3320 | MAC0 = F( ( (INT64)(INT16)SX0 * (INT16)SY1 ) + ( (INT16)SX1 * (INT16)SY2 ) + ( (INT16)SX2 * (INT16)SY0 ) - ( (INT16)SX0 * (INT16)SY2 ) - ( (INT16)SX1 * (INT16)SY0 ) - ( (INT16)SX2 * (INT16)SY1 ) ); | |
| 3321 | return; | |
| 3322 | } | |
| 3323 | break; | |
| 3317 | MAC0 = F( (INT64)( SX0 * SY1 ) + ( SX1 * SY2 ) + ( SX2 * SY0 ) - ( SX0 * SY2 ) - ( SX1 * SY0 ) - ( SX2 * SY1 ) ); | |
| 3318 | return; | |
| 3319 | ||
| 3324 | 3320 | case 0x0c: |
| 3325 | if( GTE_OP( gteop ) == 0x17 ) | |
| 3326 | { | |
| 3327 | GTELOG( "OP" ); | |
| 3328 | n_sf = 12 * GTE_SF( gteop ); | |
| 3329 | FLAG = 0; | |
| 3321 | GTELOG( "OP" ); | |
| 3322 | FLAG = 0; | |
| 3330 | 3323 | |
| 3331 | MAC1 = A1( ( ( (INT64)(INT32)D2 * (INT16)IR3 ) - ( (INT64)(INT32)D3 * (INT16)IR2 ) ) >> n_sf ); | |
| 3332 | MAC2 = A2( ( ( (INT64)(INT32)D3 * (INT16)IR1 ) - ( (INT64)(INT32)D1 * (INT16)IR3 ) ) >> n_sf ); | |
| 3333 | MAC3 = A3( ( ( (INT64)(INT32)D1 * (INT16)IR2 ) - ( (INT64)(INT32)D2 * (INT16)IR1 ) ) >> n_sf ); | |
| 3334 | IR1 = Lm_B1( (INT32)MAC1, 0 ); | |
| 3335 | IR2 = Lm_B2( (INT32)MAC2, 0 ); | |
| 3336 | IR3 = Lm_B3( (INT32)MAC3, 0 ); | |
| 3337 | return; | |
| 3338 | } | |
| 3339 | break; | |
| 3324 | shift = 12 * GTE_SF( gteop ); | |
| 3325 | lm = GTE_LM( gteop ); | |
| 3326 | ||
| 3327 | MAC1 = A1( ( (INT64) ( R22 * IR3 ) - ( R33 * IR2 ) ) >> shift ); | |
| 3328 | MAC2 = A2( ( (INT64) ( R33 * IR1 ) - ( R11 * IR3 ) ) >> shift ); | |
| 3329 | MAC3 = A3( ( (INT64) ( R11 * IR2 ) - ( R22 * IR1 ) ) >> shift ); | |
| 3330 | IR1 = Lm_B1( MAC1, lm ); | |
| 3331 | IR2 = Lm_B2( MAC2, lm ); | |
| 3332 | IR3 = Lm_B3( MAC3, lm ); | |
| 3333 | return; | |
| 3334 | ||
| 3340 | 3335 | case 0x10: |
| 3341 | if( gteop == 0x0780010 ) | |
| 3342 | { | |
| 3343 | GTELOG( "DPCS" ); | |
| 3344 | FLAG = 0; | |
| 3336 | GTELOG( "DPCS" ); | |
| 3337 | FLAG = 0; | |
| 3345 | 3338 | |
| 3346 | MAC1 = A1( ( ( (INT64)R << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)RFC - ( R << 4 ), 0 ) ) ) ) >> 12 ); | |
| 3347 | MAC2 = A2( ( ( (INT64)G << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)GFC - ( G << 4 ), 0 ) ) ) ) >> 12 ); | |
| 3348 | MAC3 = A3( ( ( (INT64)B << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)BFC - ( B << 4 ), 0 ) ) ) ) >> 12 ); | |
| 3349 | IR1 = Lm_B1( (INT32)MAC1, 0 ); | |
| 3350 | IR2 = Lm_B2( (INT32)MAC2, 0 ); | |
| 3351 | IR3 = Lm_B3( (INT32)MAC3, 0 ); | |
| 3352 | CD0 = CD1; | |
| 3353 | CD1 = CD2; | |
| 3354 | CD2 = CODE; | |
| 3355 | R0 = R1; | |
| 3356 | R1 = R2; | |
| 3357 | R2 = Lm_C1( (INT32)MAC1 >> 4 ); | |
| 3358 | G0 = G1; | |
| 3359 | G1 = G2; | |
| 3360 | G2 = Lm_C2( (INT32)MAC2 >> 4 ); | |
| 3361 | B0 = B1; | |
| 3362 | B1 = B2; | |
| 3363 | B2 = Lm_C3( (INT32)MAC3 >> 4 ); | |
| 3364 | return; | |
| 3365 | } | |
| 3366 | break; | |
| 3339 | shift = 12 * GTE_SF( gteop ); | |
| 3340 | lm = GTE_LM( gteop ); | |
| 3341 | ||
| 3342 | MAC1 = ( ( R << 16 ) + ( IR0 * Lm_B1( A1( (INT64) RFC - ( R << 4 ) ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3343 | MAC2 = ( ( G << 16 ) + ( IR0 * Lm_B2( A2( (INT64) GFC - ( G << 4 ) ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3344 | MAC3 = ( ( B << 16 ) + ( IR0 * Lm_B3( A3( (INT64) BFC - ( B << 4 ) ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3345 | IR1 = Lm_B1( MAC1, lm ); | |
| 3346 | IR2 = Lm_B2( MAC2, lm ); | |
| 3347 | IR3 = Lm_B3( MAC3, lm ); | |
| 3348 | RGB0 = RGB1; | |
| 3349 | RGB1 = RGB2; | |
| 3350 | CD2 = CODE; | |
| 3351 | R2 = Lm_C1( MAC1 >> 4 ); | |
| 3352 | G2 = Lm_C2( MAC2 >> 4 ); | |
| 3353 | B2 = Lm_C3( MAC3 >> 4 ); | |
| 3354 | return; | |
| 3355 | ||
| 3367 | 3356 | case 0x11: |
| 3368 | if( gteop == 0x0980011 ) | |
| 3369 | { | |
| 3370 | GTELOG( "INTPL" ); | |
| 3371 | FLAG = 0; | |
| 3357 | GTELOG( "INTPL" ); | |
| 3358 | FLAG = 0; | |
| 3372 | 3359 | |
| 3373 | MAC1 = A1( ( ( (INT64)(INT16)IR1 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)RFC - (INT16)IR1, 0 ) ) ) ) >> 12 ); | |
| 3374 | MAC2 = A2( ( ( (INT64)(INT16)IR2 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)GFC - (INT16)IR2, 0 ) ) ) ) >> 12 ); | |
| 3375 | MAC3 = A3( ( ( (INT64)(INT16)IR3 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)BFC - (INT16)IR3, 0 ) ) ) ) >> 12 ); | |
| 3376 | IR1 = Lm_B1( (INT32)MAC1, 0 ); | |
| 3377 | IR2 = Lm_B2( (INT32)MAC2, 0 ); | |
| 3378 | IR3 = Lm_B3( (INT32)MAC3, 0 ); | |
| 3379 | CD0 = CD1; | |
| 3380 | CD1 = CD2; | |
| 3381 | CD2 = CODE; | |
| 3382 | R0 = R1; | |
| 3383 | R1 = R2; | |
| 3384 | R2 = Lm_C1( (INT32)MAC1 ); | |
| 3385 | G0 = G1; | |
| 3386 | G1 = G2; | |
| 3387 | G2 = Lm_C2( (INT32)MAC2 ); | |
| 3388 | B0 = B1; | |
| 3389 | B1 = B2; | |
| 3390 | B2 = Lm_C3( (INT32)MAC3 ); | |
| 3391 | return; | |
| 3392 | } | |
| 3393 | break; | |
| 3360 | shift = 12 * GTE_SF( gteop ); | |
| 3361 | lm = GTE_LM( gteop ); | |
| 3362 | ||
| 3363 | MAC1 = ( ( IR1 << 12 ) + ( IR0 * Lm_B1( A1( (INT64) RFC - IR1 ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3364 | MAC2 = ( ( IR2 << 12 ) + ( IR0 * Lm_B2( A2( (INT64) GFC - IR2 ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3365 | MAC3 = ( ( IR3 << 12 ) + ( IR0 * Lm_B3( A3( (INT64) BFC - IR3 ) << ( 12 - shift ), 0 ) ) ) >> shift; | |
| 3366 | IR1 = Lm_B1( MAC1, lm ); | |
| 3367 | IR2 = Lm_B2( MAC2, lm ); | |
| 3368 | IR3 = Lm_B3( MAC3, lm ); | |
| 3369 | RGB0 = RGB1; | |
| 3370 | RGB1 = RGB2; | |
| 3371 | CD2 = CODE; | |
| 3372 | R2 = Lm_C1( MAC1 >> 4 ); | |
| 3373 | G2 = Lm_C2( MAC2 >> 4 ); | |
| 3374 | B2 = Lm_C3( MAC3 >> 4 ); | |
| 3375 | return; | |
| 3376 | ||
| 3394 | 3377 | case 0x12: |
| 3395 | 3378 | if( GTE_OP( gteop ) == 0x04 ) |
| 3396 | 3379 | { |
| 3397 | 3380 | GTELOG( "MVMVA" ); |
| 3398 | | |
| 3381 | | |
| 3399 | 3382 | p_n_mx = p_p_n_mx[ GTE_MX( gteop ) ]; |
| 3400 | 3383 | n_v = GTE_V( gteop ); |
| 3401 | 3384 | if( n_v < 3 ) |
| r2418 | r2419 | |
| 3411 | 3394 | n_v3 = IR3; |
| 3412 | 3395 | } |
| 3413 | 3396 | p_n_cv = p_p_n_cv[ GTE_CV( gteop ) ]; |
| 3414 | | |
| 3397 | | |
| 3415 | 3398 | FLAG = 0; |
| 3416 | 3399 | |
| 3417 | MAC1 = A1( ( ( (INT64)(INT32)*p_n_cv[ 0 ] << 12 ) + ( (INT16)*p_n_mx[ 0 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 1 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 2 ] * (INT16)n_v3 ) ) >> n_sf ); | |
| 3418 | MAC2 = A2( ( ( (INT64)(INT32)*p_n_cv[ 1 ] << 12 ) + ( (INT16)*p_n_mx[ 3 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 4 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 5 ] * (INT16)n_v3 ) ) >> n_sf ); | |
| 3419 | MAC3 = A3( ( ( (INT64)(INT32)*p_n_cv[ 2 ] << 12 ) + ( (INT16)*p_n_mx[ 6 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 7 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 8 ] * (INT16)n_v3 ) ) >> n_sf ); | |
| 3400 | MAC1 = A1( ( ( (INT64)(INT32)*p_n_cv[ 0 ] << 12 ) + ( (INT16)*p_n_mx[ 0 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 1 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 2 ] * (INT16)n_v3 ) ) >> shift ); | |
| 3401 | MAC2 = A2( ( ( (INT64)(INT32)*p_n_cv[ 1 ] << 12 ) + ( (INT16)*p_n_mx[ 3 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 4 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 5 ] * (INT16)n_v3 ) ) >> shift ); | |
| 3402 | MAC3 = A3( ( ( (INT64)(INT32)*p_n_cv[ 2 ] << 12 ) + ( (INT16)*p_n_mx[ 6 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 7 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 8 ] * (INT16)n_v3 ) ) >> shift ); | |
| 3420 | 3403 | |
| 3421 | IR1 = Lm_B1( (INT32)MAC1, n_lm ); | |
| 3422 | IR2 = Lm_B2( (INT32)MAC2, n_lm ); | |
| 3423 | IR3 = Lm_B3( (INT32)MAC3, n_lm ); | |
| 3404 | IR1 = Lm_B1( (INT32)MAC1, lm ); | |
| 3405 | IR2 = Lm_B2( (INT32)MAC2, lm ); | |
| 3406 | IR3 = Lm_B3( (INT32)MAC3, lm ); | |
| 3424 | 3407 | return; |
| 3425 | 3408 | } |
| 3426 | 3409 | break; |
| r2418 | r2419 | |
| 3679 | 3662 | return; |
| 3680 | 3663 | } |
| 3681 | 3664 | break; |
| 3665 | ||
| 3682 | 3666 | case 0x28: |
| 3683 | if( GTE_OP( gteop ) == 0x0a && GTE_LM( gteop ) == 1 ) | |
| 3684 | { | |
| 3685 | GTELOG( "SQR" ); | |
| 3686 | n_sf = 12 * GTE_SF( gteop ); | |
| 3687 | FLAG = 0; | |
| 3667 | GTELOG( "SQR" ); | |
| 3668 | FLAG = 0; | |
| 3688 | 3669 | |
| 3689 | MAC1 = A1( ( (INT64)(INT16)IR1 * (INT16)IR1 ) >> n_sf ); | |
| 3690 | MAC2 = A2( ( (INT64)(INT16)IR2 * (INT16)IR2 ) >> n_sf ); | |
| 3691 | MAC3 = A3( ( (INT64)(INT16)IR3 * (INT16)IR3 ) >> n_sf ); | |
| 3692 | IR1 = Lm_B1( MAC1, 1 ); | |
| 3693 | IR2 = Lm_B2( MAC2, 1 ); | |
| 3694 | IR3 = Lm_B3( MAC3, 1 ); | |
| 3695 | return; | |
| 3696 | } | |
| 3697 | break; | |
| 3670 | shift = 12 * GTE_SF( gteop ); | |
| 3671 | lm = GTE_LM( gteop ); | |
| 3672 | ||
| 3673 | MAC1 = A1( ( IR1 * IR1 ) >> shift ); | |
| 3674 | MAC2 = A2( ( IR2 * IR2 ) >> shift ); | |
| 3675 | MAC3 = A3( ( IR3 * IR3 ) >> shift ); | |
| 3676 | IR1 = Lm_B1( MAC1, lm ); | |
| 3677 | IR2 = Lm_B2( MAC2, lm ); | |
| 3678 | IR3 = Lm_B3( MAC3, lm ); | |
| 3679 | return; | |
| 3680 | ||
| 3698 | 3681 | // DCPL 0x29 |
| 3699 | 3682 | case 0x2a: |
| 3700 | 3683 | if( gteop == 0x0f8002a ) |
| r2418 | r2419 | |
| 3780 | 3763 | GTE_OP( gteop ) == 0x19 ) |
| 3781 | 3764 | { |
| 3782 | 3765 | GTELOG( "GPF" ); |
| 3783 | | |
| 3766 | | |
| 3784 | 3767 | FLAG = 0; |
| 3785 | 3768 | |
| 3786 | MAC1 = A1( ( (INT64)(INT16)IR0 * (INT16)IR1 ) >> n_sf ); | |
| 3787 | MAC2 = A2( ( (INT64)(INT16)IR0 * (INT16)IR2 ) >> n_sf ); | |
| 3788 | MAC3 = A3( ( (INT64)(INT16)IR0 * (INT16)IR3 ) >> n_sf ); | |
| 3769 | MAC1 = A1( ( (INT64)(INT16)IR0 * (INT16)IR1 ) >> shift ); | |
| 3770 | MAC2 = A2( ( (INT64)(INT16)IR0 * (INT16)IR2 ) >> shift ); | |
| 3771 | MAC3 = A3( ( (INT64)(INT16)IR0 * (INT16)IR3 ) >> shift ); | |
| 3789 | 3772 | IR1 = Lm_B1( (INT32)MAC1, 0 ); |
| 3790 | 3773 | IR2 = Lm_B2( (INT32)MAC2, 0 ); |
| 3791 | 3774 | IR3 = Lm_B3( (INT32)MAC3, 0 ); |
| r2418 | r2419 | |
| 3808 | 3791 | if( GTE_OP( gteop ) == 0x1a ) |
| 3809 | 3792 | { |
| 3810 | 3793 | GTELOG( "GPL" ); |
| 3811 | | |
| 3794 | | |
| 3812 | 3795 | FLAG = 0; |
| 3813 | 3796 | |
| 3814 | MAC1 = A1( ( ( (INT64)(INT32)MAC1 << n_sf ) + ( (INT16)IR0 * (INT16)IR1 ) ) >> n_sf ); | |
| 3815 | MAC2 = A2( ( ( (INT64)(INT32)MAC2 << n_sf ) + ( (INT16)IR0 * (INT16)IR2 ) ) >> n_sf ); | |
| 3816 | MAC3 = A3( ( ( (INT64)(INT32)MAC3 << n_sf ) + ( (INT16)IR0 * (INT16)IR3 ) ) >> n_sf ); | |
| 3797 | MAC1 = A1( ( ( (INT64)(INT32)MAC1 << shift ) + ( (INT16)IR0 * (INT16)IR1 ) ) >> shift ); | |
| 3798 | MAC2 = A2( ( ( (INT64)(INT32)MAC2 << shift ) + ( (INT16)IR0 * (INT16)IR2 ) ) >> shift ); | |
| 3799 | MAC3 = A3( ( ( (INT64)(INT32)MAC3 << shift ) + ( (INT16)IR0 * (INT16)IR3 ) ) >> shift ); | |
| 3817 | 3800 | IR1 = Lm_B1( (INT32)MAC1, 0 ); |
| 3818 | 3801 | IR2 = Lm_B2( (INT32)MAC2, 0 ); |
| 3819 | 3802 | IR3 = Lm_B3( (INT32)MAC3, 0 ); |
| r2418 | r2419 | |
|---|---|---|
| 202 | 202 | /* compare the priority of the interrupt to the PSW */ |
| 203 | 203 | if (irq->priority > priority) |
| 204 | 204 | { |
| 205 | /* get the priority of this interrupt */ | |
| 206 | int new_pc = RWORD(irq->vector); | |
| 207 | int new_psw = RWORD(irq->vector + 2); | |
| 205 | int vector = irq->vector; | |
| 206 | int new_pc, new_psw; | |
| 208 | 207 | |
| 209 | /* call the callback */ | |
| 210 | if (t11.irq_callback) | |
| 208 | /* call the callback; if we don't get -1 back, use the return value as our vector */ | |
| 209 | if (t11.irq_callback != NULL) | |
| 211 | 210 | { |
| 212 | int vector = 0; | |
| 213 | ||
| 214 | if (t11.irq_state & 8) vector = 3; | |
| 215 | else if (t11.irq_state & 4) vector = 2; | |
| 216 | else if (t11.irq_state & 2) vector = 1; | |
| 217 | (*t11.irq_callback)(vector); | |
| 211 | int new_vector = (*t11.irq_callback)(t11.irq_state & 15); | |
| 212 | if (new_vector != -1) | |
| 213 | vector = new_vector; | |
| 218 | 214 | } |
| 219 | 215 | |
| 220 | /* kludge for 720 - fix me! */ | |
| 221 | if (new_pc == 0) | |
| 222 | return; | |
| 216 | /* fetch the new PC and PSW from that vector */ | |
| 217 | assert((vector & 3) == 0); | |
| 218 | new_pc = RWORD(vector); | |
| 219 | new_psw = RWORD(vector + 2); | |
| 223 | 220 | |
| 224 | 221 | /* push the old state, set the new one */ |
| 225 | 222 | PUSH(PSW); |
| r2418 | r2419 | |
| 459 | 456 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 460 | 457 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(t11); break; |
| 461 | 458 | case CPUINFO_INT_INPUT_LINES: info->i = 4; break; |
| 462 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = | |
| 459 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = -1; break; | |
| 463 | 460 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 464 | 461 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; |
| 465 | 462 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | * |
| 86 | 86 | *************************************/ |
| 87 | 87 | |
| 88 | INLINE UINT16 read16be_with_read8_handler(read8_machine_func handler, | |
| 88 | INLINE UINT16 read16be_with_read8_handler(read8_machine_func handler, running_machine * | |
| 89 | 89 | { |
| 90 | 90 | UINT16 result = 0; |
| 91 | 91 | if (ACCESSING_BITS_8_15) |
| 92 | result |= ((UINT16)(*handler)( | |
| 92 | result |= ((UINT16)(*handler)( | |
| 93 | 93 | if (ACCESSING_BITS_0_7) |
| 94 | result |= ((UINT16)(*handler)( | |
| 94 | result |= ((UINT16)(*handler)( | |
| 95 | 95 | return result; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | INLINE void write16be_with_write8_handler(write8_machine_func handler, | |
| 99 | INLINE void write16be_with_write8_handler(write8_machine_func handler, running_machine * | |
| 100 | 100 | { |
| 101 | 101 | if (ACCESSING_BITS_8_15) |
| 102 | (*handler)( | |
| 102 | (*handler)( | |
| 103 | 103 | if (ACCESSING_BITS_0_7) |
| 104 | (*handler)( | |
| 104 | (*handler)( | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r2418 | r2419 | |
| 111 | 111 | * |
| 112 | 112 | *************************************/ |
| 113 | 113 | |
| 114 | INLINE UINT16 read16le_with_read8_handler(read8_machine_func handler, | |
| 114 | INLINE UINT16 read16le_with_read8_handler(read8_machine_func handler, running_machine * | |
| 115 | 115 | { |
| 116 | 116 | UINT16 result = 0; |
| 117 | 117 | if (ACCESSING_BITS_0_7) |
| 118 | result |= ((UINT16) (*handler)( | |
| 118 | result |= ((UINT16) (*handler)( | |
| 119 | 119 | if (ACCESSING_BITS_8_15) |
| 120 | result |= ((UINT16) (*handler)( | |
| 120 | result |= ((UINT16) (*handler)( | |
| 121 | 121 | return result; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | INLINE void write16le_with_write8_handler(write8_machine_func handler, | |
| 125 | INLINE void write16le_with_write8_handler(write8_machine_func handler, running_machine * | |
| 126 | 126 | { |
| 127 | 127 | if (ACCESSING_BITS_0_7) |
| 128 | (*handler)( | |
| 128 | (*handler)( | |
| 129 | 129 | if (ACCESSING_BITS_8_15) |
| 130 | (*handler)( | |
| 130 | (*handler)( | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r2418 | r2419 | |
| 137 | 137 | * |
| 138 | 138 | *************************************/ |
| 139 | 139 | |
| 140 | INLINE UINT32 read32be_with_read8_handler(read8_machine_func handler, | |
| 140 | INLINE UINT32 read32be_with_read8_handler(read8_machine_func handler, running_machine * | |
| 141 | 141 | { |
| 142 | 142 | UINT32 result = 0; |
| 143 | 143 | if (ACCESSING_BITS_16_31) |
| 144 | result |= read16be_with_read8_handler(handler, | |
| 144 | result |= read16be_with_read8_handler(handler, | |
| 145 | 145 | if (ACCESSING_BITS_0_15) |
| 146 | result |= read16be_with_read8_handler(handler, | |
| 146 | result |= read16be_with_read8_handler(handler, | |
| 147 | 147 | return result; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | INLINE void write32be_with_write8_handler(write8_machine_func handler, | |
| 151 | INLINE void write32be_with_write8_handler(write8_machine_func handler, running_machine * | |
| 152 | 152 | { |
| 153 | 153 | if (ACCESSING_BITS_16_31) |
| 154 | write16be_with_write8_handler(handler, | |
| 154 | write16be_with_write8_handler(handler, | |
| 155 | 155 | if (ACCESSING_BITS_0_15) |
| 156 | write16be_with_write8_handler(handler, | |
| 156 | write16be_with_write8_handler(handler, | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| r2418 | r2419 | |
| 163 | 163 | * |
| 164 | 164 | *************************************/ |
| 165 | 165 | |
| 166 | INLINE UINT32 read32le_with_read8_handler(read8_machine_func handler, | |
| 166 | INLINE UINT32 read32le_with_read8_handler(read8_machine_func handler, running_machine * | |
| 167 | 167 | { |
| 168 | 168 | UINT32 result = 0; |
| 169 | 169 | if (ACCESSING_BITS_0_15) |
| 170 | result |= read16le_with_read8_handler(handler, | |
| 170 | result |= read16le_with_read8_handler(handler, | |
| 171 | 171 | if (ACCESSING_BITS_16_31) |
| 172 | result |= read16le_with_read8_handler(handler, | |
| 172 | result |= read16le_with_read8_handler(handler, | |
| 173 | 173 | return result; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| 177 | INLINE void write32le_with_write8_handler(write8_machine_func handler, | |
| 177 | INLINE void write32le_with_write8_handler(write8_machine_func handler, running_machine * | |
| 178 | 178 | { |
| 179 | 179 | if (ACCESSING_BITS_0_15) |
| 180 | write16le_with_write8_handler(handler, | |
| 180 | write16le_with_write8_handler(handler, | |
| 181 | 181 | if (ACCESSING_BITS_16_31) |
| 182 | write16le_with_write8_handler(handler, | |
| 182 | write16le_with_write8_handler(handler, | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r2418 | r2419 | |
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | INLINE UINT32 read32be_with_16be_handler(read16_machine_func handler, | |
| 192 | INLINE UINT32 read32be_with_16be_handler(read16_machine_func handler, running_machine * | |
| 193 | 193 | { |
| 194 | 194 | UINT32 result = 0; |
| 195 | 195 | if (ACCESSING_BITS_16_31) |
| 196 | result |= (*handler)( | |
| 196 | result |= (*handler)( | |
| 197 | 197 | if (ACCESSING_BITS_0_15) |
| 198 | result |= (*handler)( | |
| 198 | result |= (*handler)( | |
| 199 | 199 | return result; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | INLINE void write32be_with_16be_handler(write16_machine_func handler, | |
| 203 | INLINE void write32be_with_16be_handler(write16_machine_func handler, running_machine * | |
| 204 | 204 | { |
| 205 | 205 | if (ACCESSING_BITS_16_31) |
| 206 | (*handler)( | |
| 206 | (*handler)( | |
| 207 | 207 | if (ACCESSING_BITS_0_15) |
| 208 | (*handler)( | |
| 208 | (*handler)( | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| r2418 | r2419 | |
| 215 | 215 | * |
| 216 | 216 | *************************************/ |
| 217 | 217 | |
| 218 | INLINE UINT32 read32le_with_16le_handler(read16_machine_func handler, | |
| 218 | INLINE UINT32 read32le_with_16le_handler(read16_machine_func handler, running_machine * | |
| 219 | 219 | { |
| 220 | 220 | UINT32 result = 0; |
| 221 | 221 | if (ACCESSING_BITS_0_15) |
| 222 | result |= (*handler)( | |
| 222 | result |= (*handler)( | |
| 223 | 223 | if (ACCESSING_BITS_16_31) |
| 224 | result |= (*handler)( | |
| 224 | result |= (*handler)( | |
| 225 | 225 | return result; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
| 229 | INLINE void write32le_with_16le_handler(write16_machine_func handler, | |
| 229 | INLINE void write32le_with_16le_handler(write16_machine_func handler, running_machine * | |
| 230 | 230 | { |
| 231 | 231 | if (ACCESSING_BITS_0_15) |
| 232 | (*handler)( | |
| 232 | (*handler)( | |
| 233 | 233 | if (ACCESSING_BITS_16_31) |
| 234 | (*handler)( | |
| 234 | (*handler)( | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| r2418 | r2419 | |
| 241 | 241 | * |
| 242 | 242 | *************************************/ |
| 243 | 243 | |
| 244 | INLINE UINT32 read32be_with_16le_handler(read16_machine_func handler, | |
| 244 | INLINE UINT32 read32be_with_16le_handler(read16_machine_func handler, running_machine * | |
| 245 | 245 | { |
| 246 | 246 | UINT32 result = 0; |
| 247 | 247 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 248 | result = read32le_with_16le_handler(handler, | |
| 248 | result = read32le_with_16le_handler(handler, | |
| 249 | 249 | return FLIPENDIAN_INT32(result); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| 253 | INLINE void write32be_with_16le_handler(write16_machine_func handler, | |
| 253 | INLINE void write32be_with_16le_handler(write16_machine_func handler, running_machine * | |
| 254 | 254 | { |
| 255 | 255 | data = FLIPENDIAN_INT32(data); |
| 256 | 256 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 257 | write32le_with_16le_handler(handler, | |
| 257 | write32le_with_16le_handler(handler, | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| r2418 | r2419 | |
| 264 | 264 | * |
| 265 | 265 | *************************************/ |
| 266 | 266 | |
| 267 | INLINE UINT32 read32le_with_16be_handler(read16_machine_func handler, | |
| 267 | INLINE UINT32 read32le_with_16be_handler(read16_machine_func handler, running_machine * | |
| 268 | 268 | { |
| 269 | 269 | UINT32 result = 0; |
| 270 | 270 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 271 | result = read32be_with_16be_handler(handler, | |
| 271 | result = read32be_with_16be_handler(handler, | |
| 272 | 272 | return FLIPENDIAN_INT32(result); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| 276 | INLINE void write32le_with_16be_handler(write16_machine_func handler, | |
| 276 | INLINE void write32le_with_16be_handler(write16_machine_func handler, running_machine * | |
| 277 | 277 | { |
| 278 | 278 | data = FLIPENDIAN_INT32(data); |
| 279 | 279 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 280 | write32be_with_16be_handler(handler, | |
| 280 | write32be_with_16be_handler(handler, | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r2418 | r2419 | |
| 287 | 287 | * |
| 288 | 288 | *************************************/ |
| 289 | 289 | |
| 290 | INLINE UINT64 read64be_with_read8_handler(read8_machine_func handler, | |
| 290 | INLINE UINT64 read64be_with_read8_handler(read8_machine_func handler, running_machine * | |
| 291 | 291 | { |
| 292 | 292 | UINT64 result = 0; |
| 293 | 293 | if (ACCESSING_BITS_32_63) |
| 294 | result |= (UINT64)read32be_with_read8_handler(handler, | |
| 294 | result |= (UINT64)read32be_with_read8_handler(handler, | |
| 295 | 295 | if (ACCESSING_BITS_0_31) |
| 296 | result |= (UINT64)read32be_with_read8_handler(handler, | |
| 296 | result |= (UINT64)read32be_with_read8_handler(handler, | |
| 297 | 297 | return result; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| 301 | INLINE void write64be_with_write8_handler(write8_machine_func handler, | |
| 301 | INLINE void write64be_with_write8_handler(write8_machine_func handler, running_machine * | |
| 302 | 302 | { |
| 303 | 303 | if (ACCESSING_BITS_32_63) |
| 304 | write32be_with_write8_handler(handler, | |
| 304 | write32be_with_write8_handler(handler, | |
| 305 | 305 | if (ACCESSING_BITS_0_31) |
| 306 | write32be_with_write8_handler(handler, | |
| 306 | write32be_with_write8_handler(handler, | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
| r2418 | r2419 | |
| 313 | 313 | * |
| 314 | 314 | *************************************/ |
| 315 | 315 | |
| 316 | INLINE UINT64 read64le_with_read8_handler(read8_machine_func handler, | |
| 316 | INLINE UINT64 read64le_with_read8_handler(read8_machine_func handler, running_machine * | |
| 317 | 317 | { |
| 318 | 318 | UINT64 result = 0; |
| 319 | 319 | if (ACCESSING_BITS_0_31) |
| 320 | result |= (UINT64)read32le_with_read8_handler(handler, | |
| 320 | result |= (UINT64)read32le_with_read8_handler(handler, | |
| 321 | 321 | if (ACCESSING_BITS_32_63) |
| 322 | result |= (UINT64)read32le_with_read8_handler(handler, | |
| 322 | result |= (UINT64)read32le_with_read8_handler(handler, | |
| 323 | 323 | return result; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| 327 | INLINE void write64le_with_write8_handler(write8_machine_func handler, | |
| 327 | INLINE void write64le_with_write8_handler(write8_machine_func handler, running_machine * | |
| 328 | 328 | { |
| 329 | 329 | if (ACCESSING_BITS_0_31) |
| 330 | write32le_with_write8_handler(handler, | |
| 330 | write32le_with_write8_handler(handler, | |
| 331 | 331 | if (ACCESSING_BITS_32_63) |
| 332 | write32le_with_write8_handler(handler, | |
| 332 | write32le_with_write8_handler(handler, | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | |
| r2418 | r2419 | |
| 339 | 339 | * |
| 340 | 340 | *************************************/ |
| 341 | 341 | |
| 342 | INLINE UINT32 read64be_with_16be_handler(read16_machine_func handler, | |
| 342 | INLINE UINT32 read64be_with_16be_handler(read16_machine_func handler, running_machine * | |
| 343 | 343 | { |
| 344 | 344 | UINT64 result = 0; |
| 345 | 345 | if (ACCESSING_BITS_32_63) |
| 346 | result |= (UINT64)read32be_with_16be_handler(handler, | |
| 346 | result |= (UINT64)read32be_with_16be_handler(handler, | |
| 347 | 347 | if (ACCESSING_BITS_0_31) |
| 348 | result |= (UINT64)read32be_with_16be_handler(handler, | |
| 348 | result |= (UINT64)read32be_with_16be_handler(handler, | |
| 349 | 349 | return result; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | INLINE void write64be_with_16be_handler(write16_machine_func handler, | |
| 353 | INLINE void write64be_with_16be_handler(write16_machine_func handler, running_machine * | |
| 354 | 354 | { |
| 355 | 355 | if (ACCESSING_BITS_32_63) |
| 356 | write32be_with_16be_handler(handler, | |
| 356 | write32be_with_16be_handler(handler, | |
| 357 | 357 | if (ACCESSING_BITS_0_31) |
| 358 | write32be_with_16be_handler(handler, | |
| 358 | write32be_with_16be_handler(handler, | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| r2418 | r2419 | |
| 365 | 365 | * |
| 366 | 366 | *************************************/ |
| 367 | 367 | |
| 368 | INLINE UINT32 read64le_with_16le_handler(read16_machine_func handler, | |
| 368 | INLINE UINT32 read64le_with_16le_handler(read16_machine_func handler, running_machine * | |
| 369 | 369 | { |
| 370 | 370 | UINT64 result = 0; |
| 371 | 371 | if (ACCESSING_BITS_0_31) |
| 372 | result |= (UINT64)read32le_with_16le_handler(handler, | |
| 372 | result |= (UINT64)read32le_with_16le_handler(handler, | |
| 373 | 373 | if (ACCESSING_BITS_32_63) |
| 374 | result |= (UINT64)read32le_with_16le_handler(handler, | |
| 374 | result |= (UINT64)read32le_with_16le_handler(handler, | |
| 375 | 375 | return result; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | INLINE void write64le_with_16le_handler(write16_machine_func handler, | |
| 379 | INLINE void write64le_with_16le_handler(write16_machine_func handler, running_machine * | |
| 380 | 380 | { |
| 381 | 381 | if (ACCESSING_BITS_0_31) |
| 382 | write32le_with_16le_handler(handler, | |
| 382 | write32le_with_16le_handler(handler, | |
| 383 | 383 | if (ACCESSING_BITS_32_63) |
| 384 | write32le_with_16le_handler(handler, | |
| 384 | write32le_with_16le_handler(handler, | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| r2418 | r2419 | |
| 391 | 391 | * |
| 392 | 392 | *************************************/ |
| 393 | 393 | |
| 394 | INLINE UINT32 read64be_with_16le_handler(read16_machine_func handler, | |
| 394 | INLINE UINT32 read64be_with_16le_handler(read16_machine_func handler, running_machine * | |
| 395 | 395 | { |
| 396 | 396 | UINT64 result = 0; |
| 397 | 397 | if (ACCESSING_BITS_32_63) |
| 398 | result |= (UINT64)read32be_with_16le_handler(handler, | |
| 398 | result |= (UINT64)read32be_with_16le_handler(handler, | |
| 399 | 399 | if (ACCESSING_BITS_0_31) |
| 400 | result |= (UINT64)read32be_with_16le_handler(handler, | |
| 400 | result |= (UINT64)read32be_with_16le_handler(handler, | |
| 401 | 401 | return result; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
| 405 | INLINE void write64be_with_16le_handler(write16_machine_func handler, | |
| 405 | INLINE void write64be_with_16le_handler(write16_machine_func handler, running_machine * | |
| 406 | 406 | { |
| 407 | 407 | if (ACCESSING_BITS_32_63) |
| 408 | write32be_with_16le_handler(handler, | |
| 408 | write32be_with_16le_handler(handler, | |
| 409 | 409 | if (ACCESSING_BITS_0_31) |
| 410 | write32be_with_16le_handler(handler, | |
| 410 | write32be_with_16le_handler(handler, | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| r2418 | r2419 | |
| 417 | 417 | * |
| 418 | 418 | *************************************/ |
| 419 | 419 | |
| 420 | INLINE UINT32 read64le_with_16be_handler(read16_machine_func handler, | |
| 420 | INLINE UINT32 read64le_with_16be_handler(read16_machine_func handler, running_machine * | |
| 421 | 421 | { |
| 422 | 422 | UINT64 result = 0; |
| 423 | 423 | if (ACCESSING_BITS_0_31) |
| 424 | result |= (UINT64)read32le_with_16be_handler(handler, | |
| 424 | result |= (UINT64)read32le_with_16be_handler(handler, | |
| 425 | 425 | if (ACCESSING_BITS_32_63) |
| 426 | result |= (UINT64)read32le_with_16be_handler(handler, | |
| 426 | result |= (UINT64)read32le_with_16be_handler(handler, | |
| 427 | 427 | return result; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | |
| 431 | INLINE void write64le_with_16be_handler(write16_machine_func handler, | |
| 431 | INLINE void write64le_with_16be_handler(write16_machine_func handler, running_machine * | |
| 432 | 432 | { |
| 433 | 433 | if (ACCESSING_BITS_0_31) |
| 434 | write32le_with_16be_handler(handler, | |
| 434 | write32le_with_16be_handler(handler, | |
| 435 | 435 | if (ACCESSING_BITS_32_63) |
| 436 | write32le_with_16be_handler(handler, | |
| 436 | write32le_with_16be_handler(handler, | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| r2418 | r2419 | |
| 443 | 443 | * |
| 444 | 444 | *************************************/ |
| 445 | 445 | |
| 446 | INLINE UINT64 read64be_with_32be_handler(read32_machine_func handler, | |
| 446 | INLINE UINT64 read64be_with_32be_handler(read32_machine_func handler, running_machine * | |
| 447 | 447 | { |
| 448 | 448 | UINT64 result = 0; |
| 449 | 449 | if (ACCESSING_BITS_32_63) |
| 450 | result |= (UINT64)(*handler)( | |
| 450 | result |= (UINT64)(*handler)( | |
| 451 | 451 | if (ACCESSING_BITS_0_31) |
| 452 | result |= (UINT64)(*handler)( | |
| 452 | result |= (UINT64)(*handler)( | |
| 453 | 453 | return result; |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| 457 | INLINE void write64be_with_32be_handler(write32_machine_func handler, | |
| 457 | INLINE void write64be_with_32be_handler(write32_machine_func handler, running_machine * | |
| 458 | 458 | { |
| 459 | 459 | if (ACCESSING_BITS_32_63) |
| 460 | (*handler)( | |
| 460 | (*handler)( | |
| 461 | 461 | if (ACCESSING_BITS_0_31) |
| 462 | (*handler)( | |
| 462 | (*handler)( | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| r2418 | r2419 | |
| 469 | 469 | * |
| 470 | 470 | *************************************/ |
| 471 | 471 | |
| 472 | INLINE UINT64 read64le_with_32le_handler(read32_machine_func handler, | |
| 472 | INLINE UINT64 read64le_with_32le_handler(read32_machine_func handler, running_machine * | |
| 473 | 473 | { |
| 474 | 474 | UINT64 result = 0; |
| 475 | 475 | if (ACCESSING_BITS_0_31) |
| 476 | result |= (UINT64)(*handler)( | |
| 476 | result |= (UINT64)(*handler)( | |
| 477 | 477 | if (ACCESSING_BITS_32_63) |
| 478 | result |= (UINT64)(*handler)( | |
| 478 | result |= (UINT64)(*handler)( | |
| 479 | 479 | return result; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| 483 | INLINE void write64le_with_32le_handler(write32_machine_func handler, | |
| 483 | INLINE void write64le_with_32le_handler(write32_machine_func handler, running_machine * | |
| 484 | 484 | { |
| 485 | 485 | if (ACCESSING_BITS_0_31) |
| 486 | (*handler)( | |
| 486 | (*handler)( | |
| 487 | 487 | if (ACCESSING_BITS_32_63) |
| 488 | (*handler)( | |
| 488 | (*handler)( | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| r2418 | r2419 | |
| 495 | 495 | * |
| 496 | 496 | *************************************/ |
| 497 | 497 | |
| 498 | INLINE UINT64 read64be_with_32le_handler(read32_machine_func handler, | |
| 498 | INLINE UINT64 read64be_with_32le_handler(read32_machine_func handler, running_machine * | |
| 499 | 499 | { |
| 500 | 500 | UINT64 result; |
| 501 | 501 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 502 | result = read64le_with_32le_handler(handler, | |
| 502 | result = read64le_with_32le_handler(handler, | |
| 503 | 503 | return FLIPENDIAN_INT64(result); |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | |
| 507 | INLINE void write64be_with_32le_handler(write32_machine_func handler, | |
| 507 | INLINE void write64be_with_32le_handler(write32_machine_func handler, running_machine * | |
| 508 | 508 | { |
| 509 | 509 | data = FLIPENDIAN_INT64(data); |
| 510 | 510 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 511 | write64le_with_32le_handler(handler, | |
| 511 | write64le_with_32le_handler(handler, | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| r2418 | r2419 | |
| 518 | 518 | * |
| 519 | 519 | *************************************/ |
| 520 | 520 | |
| 521 | INLINE UINT64 read64le_with_32be_handler(read32_machine_func handler, | |
| 521 | INLINE UINT64 read64le_with_32be_handler(read32_machine_func handler, running_machine * | |
| 522 | 522 | { |
| 523 | 523 | UINT64 result; |
| 524 | 524 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 525 | result = read64be_with_32be_handler(handler, | |
| 525 | result = read64be_with_32be_handler(handler, | |
| 526 | 526 | return FLIPENDIAN_INT64(result); |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
| 530 | INLINE void write64le_with_32be_handler(write32_machine_func handler, | |
| 530 | INLINE void write64le_with_32be_handler(write32_machine_func handler, running_machine * | |
| 531 | 531 | { |
| 532 | 532 | data = FLIPENDIAN_INT64(data); |
| 533 | 533 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 534 | write64be_with_32be_handler(handler, | |
| 534 | write64be_with_32be_handler(handler, | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
| r2418 | r2419 | |
| 545 | 545 | #define READ_TEMPLATE(bits, name, handler, func) \ |
| 546 | 546 | READ##bits##_HANDLER( name##_r ) \ |
| 547 | 547 | { \ |
| 548 | return func(handler, | |
| 548 | return func(handler, | |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | #define READ_TEMPLATE_COND(bits, name, handler, func, cond) \ |
| 552 | 552 | READ##bits##_HANDLER( name##_r ) \ |
| 553 | 553 | { \ |
| 554 | 554 | if (cond) \ |
| 555 | return func(handler, | |
| 555 | return func(handler, | |
| 556 | 556 | return 0; \ |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | #define WRITE_TEMPLATE(bits, name, handler, func) \ |
| 560 | 560 | WRITE##bits##_HANDLER( name##_w ) \ |
| 561 | 561 | { \ |
| 562 | func(handler, | |
| 562 | func(handler, | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | #define WRITE_TEMPLATE_COND(bits, name, handler, func, cond) \ |
| 566 | 566 | WRITE##bits##_HANDLER( name##_w ) \ |
| 567 | 567 | { \ |
| 568 | 568 | if (cond) \ |
| 569 | return func(handler, | |
| 569 | return func(handler, | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 |
| r2418 | r2419 | |
|---|---|---|
| 204 | 204 | #endif |
| 205 | 205 | |
| 206 | 206 | |
| 207 | ||
| 207 | 208 | /*************************************************************************** |
| 208 | 209 | TYPE DEFINITIONS |
| 209 | 210 | ***************************************************************************/ |
| r2418 | r2419 | |
| 242 | 243 | memory_handler handler; /* function pointer for handler */ |
| 243 | 244 | void * object; /* object associated with the handler */ |
| 244 | 245 | const char * name; /* name of the handler */ |
| 246 | memory_handler subhandler; /* function pointer for subhandler */ | |
| 247 | void * subobject; /* object associated with the subhandler */ | |
| 248 | UINT8 subunits; /* number of subunits to access */ | |
| 249 | UINT8 subshift[8]; /* shift amounts for up to 8 subunits */ | |
| 245 | 250 | offs_t bytestart; /* byte-adjusted start address for handler */ |
| 246 | 251 | offs_t byteend; /* byte-adjusted end address for handler */ |
| 247 | 252 | offs_t bytemask; /* byte-adjusted mask against the final address */ |
| r2418 | r2419 | |
| 269 | 274 | { |
| 270 | 275 | UINT8 cpunum; /* CPU index */ |
| 271 | 276 | UINT8 spacenum; /* address space index */ |
| 277 | UINT8 endianness; /* endianness of this space */ | |
| 272 | 278 | INT8 ashift; /* address shift */ |
| 273 | 279 | UINT8 abits; /* address bits */ |
| 274 | 280 | UINT8 dbits; /* data bits */ |
| r2418 | r2419 | |
| 333 | 339 | |
| 334 | 340 | #ifdef ENABLE_DEBUGGER |
| 335 | 341 | static debug_hook_read_func debug_hook_read; /* pointer to debugger callback for memory reads */ |
| 336 | static debug_hook_write_func | |
| 342 | static debug_hook_write_func debug_hook_write; /* pointer to debugger callback for memory writes */ | |
| 337 | 343 | #endif |
| 338 | 344 | |
| 339 | 345 | static const data_accessors memory_accessors[ADDRESS_SPACES][4][2] = |
| r2418 | r2419 | |
| 412 | 418 | static void memory_init_cpudata(const machine_config *config); |
| 413 | 419 | static void memory_init_preflight(const machine_config *config); |
| 414 | 420 | static void memory_init_populate(running_machine *machine); |
| 415 | static void install_mem_handler_private(addrspace_data *space, read_or_write readorwrite, int databits, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name); | |
| 416 | static void install_mem_handler(addrspace_data *space, read_or_write readorwrite, int databits, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name); | |
| 421 | static void space_map_range_private(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name); | |
| 422 | static void space_map_range(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name); | |
| 417 | 423 | static void bank_assign_static(int banknum, int cpunum, int spacenum, read_or_write readorwrite, offs_t bytestart, offs_t byteend); |
| 418 | 424 | static genf *bank_assign_dynamic(int cpunum, int spacenum, read_or_write readorwrite, offs_t bytestart, offs_t byteend); |
| 419 | static UINT8 get_handler_index(handler_data *table, void *object, genf *handler, const char *handler_name, offs_t bytestart, offs_t byteend, offs_t bytemask); | |
| 420 | static void populate_table_range(addrspace_data *space, read_or_write readorwrite, offs_t bytestart, offs_t byteend, UINT8 handler); | |
| 425 | static UINT8 table_assign_handler(handler_data *table, void *object, genf *handler, const char *handler_name, offs_t bytestart, offs_t byteend, offs_t bytemask); | |
| 426 | static void table_compute_subhandler(handler_data *table, UINT8 entry, read_or_write readorwrite, int spacebits, int spaceendian, int handlerbits, int handlerunitmask); | |
| 427 | static void table_populate_range(table_data *tabledata, offs_t bytestart, offs_t byteend, UINT8 handler); | |
| 428 | static void table_populate_range_mirrored(table_data *tabledata, offs_t bytestart, offs_t byteend, offs_t bytemirror, UINT8 handler); | |
| 421 | 429 | static UINT8 subtable_alloc(table_data *tabledata); |
| 422 | 430 | static void subtable_realloc(table_data *tabledata, UINT8 subentry); |
| 423 | 431 | static int subtable_merge(table_data *tabledata); |
| r2418 | r2419 | |
| 430 | 438 | static address_map_entry *assign_intersecting_blocks(addrspace_data *space, offs_t bytestart, offs_t byteend, UINT8 *base); |
| 431 | 439 | static void memory_init_locate(running_machine *machine); |
| 432 | 440 | static void *memory_find_base(int cpunum, int spacenum, offs_t byteaddress); |
| 433 | static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which); | |
| 441 | static memory_handler get_stub_handler(read_or_write readorwrite, int spacedbits, int handlerdbits); | |
| 442 | static genf *get_static_handler(int handlerbits, int readorwrite, int spacenum, int which); | |
| 434 | 443 | static void memory_exit(running_machine *machine); |
| 435 | 444 | static void mem_dump(void); |
| 436 | 445 | |
| r2418 | r2419 | |
| 782 | 791 | break; |
| 783 | 792 | |
| 784 | 793 | case ADDRMAP_TOKEN_READ: |
| 794 | TOKEN_UNGET_UINT32(tokens); | |
| 795 | TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->read_bits, 8, entry->read_mask, 8); | |
| 785 | 796 | entry->read = TOKEN_GET_PTR(tokens, read); |
| 786 | 797 | entry->read_name = TOKEN_GET_STRING(tokens); |
| 787 | 798 | break; |
| 788 | 799 | |
| 789 | 800 | case ADDRMAP_TOKEN_WRITE: |
| 801 | TOKEN_UNGET_UINT32(tokens); | |
| 802 | TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->write_bits, 8, entry->write_mask, 8); | |
| 790 | 803 | entry->write = TOKEN_GET_PTR(tokens, write); |
| 791 | 804 | entry->write_name = TOKEN_GET_STRING(tokens); |
| 792 | 805 | break; |
| 793 | 806 | |
| 794 | 807 | case ADDRMAP_TOKEN_DEVICE_READ: |
| 808 | TOKEN_UNGET_UINT32(tokens); | |
| 809 | TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->read_bits, 8, entry->read_mask, 8); | |
| 795 | 810 | entry->read = TOKEN_GET_PTR(tokens, read); |
| 796 | 811 | entry->read_name = TOKEN_GET_STRING(tokens); |
| 797 | 812 | entry->read_devtype = TOKEN_GET_PTR(tokens, devtype); |
| r2418 | r2419 | |
| 799 | 814 | break; |
| 800 | 815 | |
| 801 | 816 | case ADDRMAP_TOKEN_DEVICE_WRITE: |
| 817 | TOKEN_UNGET_UINT32(tokens); | |
| 818 | TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->write_bits, 8, entry->write_mask, 8); | |
| 802 | 819 | entry->write = TOKEN_GET_PTR(tokens, write); |
| 803 | 820 | entry->write_name = TOKEN_GET_STRING(tokens); |
| 804 | 821 | entry->write_devtype = TOKEN_GET_PTR(tokens, devtype); |
| r2418 | r2419 | |
| 1264 | 1281 | |
| 1265 | 1282 | |
| 1266 | 1283 | /*------------------------------------------------- |
| 1267 | memory_install_readX_handler - install dynamic | |
| 1268 | read handler for X-bit case | |
| 1284 | memory_install_handlerX - install | |
| 1285 | dynamic machine read and write handlers for | |
| 1286 | X-bit case | |
| 1269 | 1287 | -------------------------------------------------*/ |
| 1270 | 1288 | |
| 1271 | void *_memory_install_ | |
| 1289 | void *_memory_install_ | |
| 1272 | 1290 | { |
| 1273 | 1291 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1274 | if (handler >= STATIC_COUNT) | |
| 1275 | fatalerror("fatal: can only use static banks with memory_install_read_handler()"); | |
| 1276 | install_mem_handler(space, ROW_READ, space->dbits, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)handler, Machine, handler_name); | |
| 1292 | if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT) | |
| 1293 | fatalerror("fatal: can only use static banks with memory_install_handler()"); | |
| 1294 | if (rhandler != 0) | |
| 1295 | space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, machine, rhandler_name); | |
| 1296 | if (whandler != 0) | |
| 1297 | space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, machine, whandler_name); | |
| 1277 | 1298 | mem_dump(); |
| 1278 | 1299 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1279 | 1300 | } |
| 1280 | 1301 | |
| 1281 | UINT8 *_memory_install_ | |
| 1302 | UINT8 *_memory_install_ | |
| 1282 | 1303 | { |
| 1283 | 1304 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1284 | install_mem_handler(space, ROW_READ, 8, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1305 | if (rhandler != NULL) | |
| 1306 | space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name); | |
| 1307 | if (whandler != NULL) | |
| 1308 | space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name); | |
| 1285 | 1309 | mem_dump(); |
| 1286 | 1310 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1287 | 1311 | } |
| 1288 | 1312 | |
| 1289 | UINT16 *_memory_install_ | |
| 1313 | UINT16 *_memory_install_h | |
| 1290 | 1314 | { |
| 1291 | 1315 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1292 | install_mem_handler(space, ROW_READ, 16, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1316 | if (rhandler != NULL) | |
| 1317 | space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name); | |
| 1318 | if (whandler != NULL) | |
| 1319 | space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name); | |
| 1293 | 1320 | mem_dump(); |
| 1294 | 1321 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1295 | 1322 | } |
| 1296 | 1323 | |
| 1297 | UINT32 *_memory_install_ | |
| 1324 | UINT32 *_memory_install_h | |
| 1298 | 1325 | { |
| 1299 | 1326 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1300 | install_mem_handler(space, ROW_READ, 32, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1327 | if (rhandler != NULL) | |
| 1328 | space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name); | |
| 1329 | if (whandler != NULL) | |
| 1330 | space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name); | |
| 1301 | 1331 | mem_dump(); |
| 1302 | 1332 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1303 | 1333 | } |
| 1304 | 1334 | |
| 1305 | UINT64 *_memory_install_ | |
| 1335 | UINT64 *_memory_install_h | |
| 1306 | 1336 | { |
| 1307 | 1337 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1308 | install_mem_handler(space, ROW_READ, 64, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1338 | if (rhandler != NULL) | |
| 1339 | space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name); | |
| 1340 | if (whandler != NULL) | |
| 1341 | space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name); | |
| 1309 | 1342 | mem_dump(); |
| 1310 | 1343 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1311 | 1344 | } |
| 1312 | 1345 | |
| 1313 | 1346 | |
| 1314 | 1347 | /*------------------------------------------------- |
| 1315 | memory_install_writeX_handler - install dynamic | |
| 1316 | write handler for X-bit case | |
| 1348 | memory_install_device_handlerX - | |
| 1349 | install dynamic device read and write handlers | |
| 1350 | for X-bit case | |
| 1317 | 1351 | -------------------------------------------------*/ |
| 1318 | 1352 | |
| 1319 | void *_memory_install_ | |
| 1353 | void *_memory_install_device_handler(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) | |
| 1320 | 1354 | { |
| 1321 | 1355 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1322 | if (handler >= STATIC_COUNT) | |
| 1323 | fatalerror("fatal: can only use static banks with memory_install_write_handler()"); | |
| 1324 | install_mem_handler(space, ROW_WRITE, space->dbits, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1325 | mem_dump(); | |
| 1326 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); | |
| 1327 | } | |
| 1328 | ||
| 1329 | UINT8 *_memory_install_write8_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_machine_func handler, const char *handler_name) | |
| 1330 | { | |
| 1331 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1332 | install_mem_handler(space, ROW_WRITE, 8, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1333 | mem_dump(); | |
| 1334 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); | |
| 1335 | } | |
| 1336 | ||
| 1337 | UINT16 *_memory_install_write16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_machine_func handler, const char *handler_name) | |
| 1338 | { | |
| 1339 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1340 | install_mem_handler(space, ROW_WRITE, 16, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1341 | mem_dump(); | |
| 1342 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); | |
| 1343 | } | |
| 1344 | ||
| 1345 | UINT32 *_memory_install_write32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_machine_func handler, const char *handler_name) | |
| 1346 | { | |
| 1347 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1348 | install_mem_handler(space, ROW_WRITE, 32, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1349 | mem_dump(); | |
| 1350 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); | |
| 1351 | } | |
| 1352 | ||
| 1353 | UINT64 *_memory_install_write64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_machine_func handler, const char *handler_name) | |
| 1354 | { | |
| 1355 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1356 | install_mem_handler(space, ROW_WRITE, 64, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name); | |
| 1357 | mem_dump(); | |
| 1358 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); | |
| 1359 | } | |
| 1360 | ||
| 1361 | ||
| 1362 | /*------------------------------------------------- | |
| 1363 | memory_install_readwriteX_handler - install | |
| 1364 | dynamic read and write handlers for X-bit case | |
| 1365 | -------------------------------------------------*/ | |
| 1366 | ||
| 1367 | void *_memory_install_readwrite_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) | |
| 1368 | { | |
| 1369 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1370 | 1356 | if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT) |
| 1371 | fatalerror("fatal: can only use static banks with memory_install_readwrite_handler()"); | |
| 1372 | install_mem_handler(space, ROW_READ, space->dbits, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, Machine, rhandler_name); | |
| 1373 | install_mem_handler(space, ROW_WRITE, space->dbits, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, Machine, whandler_name); | |
| 1357 | fatalerror("fatal: can only use static banks with memory_install_device_handler()"); | |
| 1358 | if (rhandler != 0) | |
| 1359 | space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, (void *)device, rhandler_name); | |
| 1360 | if (whandler != 0) | |
| 1361 | space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name); | |
| 1374 | 1362 | mem_dump(); |
| 1375 | 1363 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1376 | 1364 | } |
| 1377 | 1365 | |
| 1378 | UINT8 *_memory_install_ | |
| 1366 | UINT8 *_memory_install_ | |
| 1379 | 1367 | { |
| 1380 | 1368 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1381 | install_mem_handler(space, ROW_READ, 8, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name); | |
| 1382 | install_mem_handler(space, ROW_WRITE, 8, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name); | |
| 1369 | if (rhandler != NULL) | |
| 1370 | space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name); | |
| 1371 | if (whandler != NULL) | |
| 1372 | space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); | |
| 1383 | 1373 | mem_dump(); |
| 1384 | 1374 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1385 | 1375 | } |
| 1386 | 1376 | |
| 1387 | UINT16 *_memory_install_ | |
| 1377 | UINT16 *_memory_install_ | |
| 1388 | 1378 | { |
| 1389 | 1379 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1390 | install_mem_handler(space, ROW_READ, 16, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name); | |
| 1391 | install_mem_handler(space, ROW_WRITE, 16, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name); | |
| 1380 | if (rhandler != NULL) | |
| 1381 | space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name); | |
| 1382 | if (whandler != NULL) | |
| 1383 | space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); | |
| 1392 | 1384 | mem_dump(); |
| 1393 | 1385 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1394 | 1386 | } |
| 1395 | 1387 | |
| 1396 | UINT32 *_memory_install_ | |
| 1388 | UINT32 *_memory_install_ | |
| 1397 | 1389 | { |
| 1398 | 1390 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1399 | install_mem_handler(space, ROW_READ, 32, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name); | |
| 1400 | install_mem_handler(space, ROW_WRITE, 32, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name); | |
| 1391 | if (rhandler != NULL) | |
| 1392 | space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name); | |
| 1393 | if (whandler != NULL) | |
| 1394 | space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); | |
| 1401 | 1395 | mem_dump(); |
| 1402 | 1396 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1403 | 1397 | } |
| 1404 | 1398 | |
| 1405 | UINT64 *_memory_install_ | |
| 1399 | UINT64 *_memory_install_ | |
| 1406 | 1400 | { |
| 1407 | 1401 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1408 | install_mem_handler(space, ROW_READ, 64, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name); | |
| 1409 | install_mem_handler(space, ROW_WRITE, 64, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name); | |
| 1402 | if (rhandler != NULL) | |
| 1403 | space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name); | |
| 1404 | if (whandler != NULL) | |
| 1405 | space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); | |
| 1410 | 1406 | mem_dump(); |
| 1411 | 1407 | return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart)); |
| 1412 | 1408 | } |
| r2418 | r2419 | |
| 1443 | 1439 | /* determine the address and data bits */ |
| 1444 | 1440 | space->cpunum = cpunum; |
| 1445 | 1441 | space->spacenum = spacenum; |
| 1442 | space->endianness = cputype_endianness(cputype); | |
| 1446 | 1443 | space->ashift = cputype_addrbus_shift(cputype, spacenum); |
| 1447 | 1444 | space->abits = cputype_addrbus_width(cputype, spacenum); |
| 1448 | 1445 | space->dbits = cputype_databus_width(cputype, spacenum); |
| 1449 | 1446 | space->addrmask = 0xffffffffUL >> (32 - space->abits); |
| 1450 | 1447 | space->bytemask = ADDR2BYTE_END(space, space->addrmask); |
| 1451 | space->accessors = memory_get_accessors(spacenum, space->dbits, | |
| 1448 | space->accessors = memory_get_accessors(spacenum, space->dbits, spac | |
| 1452 | 1449 | space->map = NULL; |
| 1453 | 1450 | |
| 1454 | 1451 | /* if there's nothing here, just punt */ |
| r2418 | r2419 | |
| 1614 | 1611 | |
| 1615 | 1612 | if (entry->read.generic != NULL) |
| 1616 | 1613 | { |
| 1614 | int bits = (entry->read_bits == 0) ? space->dbits : entry->read_bits; | |
| 1617 | 1615 | void *object = machine; |
| 1618 | 1616 | if (entry->read_devtype != NULL) |
| 1619 | 1617 | { |
| r2418 | r2419 | |
| 1621 | 1619 | if (object == NULL) |
| 1622 | 1620 | fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(entry->read_devtype), entry->read_devtag); |
| 1623 | 1621 | } |
| 1624 | | |
| 1622 | | |
| 1625 | 1623 | } |
| 1626 | 1624 | if (entry->write.generic != NULL) |
| 1627 | 1625 | { |
| 1626 | int bits = (entry->write_bits == 0) ? space->dbits : entry->write_bits; | |
| 1628 | 1627 | void *object = machine; |
| 1629 | 1628 | if (entry->write_devtype != NULL) |
| 1630 | 1629 | { |
| r2418 | r2419 | |
| 1632 | 1631 | if (object == NULL) |
| 1633 | 1632 | fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(entry->write_devtype), entry->write_devtag); |
| 1634 | 1633 | } |
| 1635 | | |
| 1634 | | |
| 1636 | 1635 | } |
| 1637 | 1636 | } |
| 1638 | 1637 | } |
| r2418 | r2419 | |
| 1641 | 1640 | |
| 1642 | 1641 | |
| 1643 | 1642 | /*------------------------------------------------- |
| 1644 | install_mem_handler_private - wrapper for | |
| 1645 | install_mem_handler which is used at | |
| 1643 | space_map_range_private - wrapper for | |
| 1644 | space_map_range which is used at | |
| 1646 | 1645 | initialization time and converts RAM/ROM |
| 1647 | 1646 | banks to dynamically assigned banks |
| 1648 | 1647 | -------------------------------------------------*/ |
| 1649 | 1648 | |
| 1650 | static void | |
| 1649 | static void | |
| 1651 | 1650 | { |
| 1652 | 1651 | /* translate ROM to RAM/UNMAP here */ |
| 1653 | 1652 | if (HANDLER_IS_ROM(handler)) |
| r2418 | r2419 | |
| 1671 | 1670 | } |
| 1672 | 1671 | |
| 1673 | 1672 | /* then do a normal installation */ |
| 1674 | | |
| 1673 | | |
| 1675 | 1674 | } |
| 1676 | 1675 | |
| 1677 | 1676 | |
| 1678 | 1677 | /*------------------------------------------------- |
| 1679 | install_mem_handler - installs a handler for | |
| 1680 | memory operations | |
| 1678 | space_map_range - maps a range of addresses | |
| 1679 | to the specified handler within an address | |
| 1680 | space | |
| 1681 | 1681 | -------------------------------------------------*/ |
| 1682 | 1682 | |
| 1683 | static void | |
| 1683 | static void | |
| 1684 | 1684 | { |
| 1685 | offs_t lmirrorbit[LEVEL2_BITS], lmirrorbits, hmirrorbit[32 - LEVEL2_BITS], hmirrorbits, lmirrorcount, hmirrorcount; | |
| 1686 | 1685 | table_data *tabledata = (readorwrite == ROW_WRITE) ? &space->write : &space->read; |
| 1687 | 1686 | offs_t bytestart, byteend, bytemask, bytemirror; |
| 1688 | UINT8 idx, prev_entry = STATIC_INVALID; | |
| 1689 | int cur_index, prev_index = 0; | |
| 1690 | int i; | |
| 1687 | UINT8 entry; | |
| 1691 | 1688 | |
| 1692 | /* sanity check */ | |
| 1693 | if (HANDLER_IS_ROM(handler) || HANDLER_IS_RAM(handler)) | |
| 1694 | fatalerror("fatal: install_mem_handler called with ROM or RAM after initialization"); | |
| 1695 | if (space->dbits != databits) | |
| 1696 | fatalerror("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space", databits, space->dbits); | |
| 1697 | if (addrstart > addrend) | |
| 1698 | fatalerror("fatal: install_mem_handler called with start greater than end"); | |
| 1689 | /* sanity checks */ | |
| 1690 | assert(space != NULL); | |
| 1691 | assert(handlerbits == 8 || handlerbits == 16 || handlerbits == 32 || handlerbits == 64); | |
| 1699 | 1692 | |
| 1700 | 1693 | /* adjust the incoming addresses */ |
| 1701 | 1694 | bytestart = addrstart; |
| r2418 | r2419 | |
| 1704 | 1697 | bytemask = addrmask; |
| 1705 | 1698 | adjust_addresses(space, &bytestart, &byteend, &bytemask, &bytemirror); |
| 1706 | 1699 | |
| 1700 | /* validity checks */ | |
| 1701 | assert_always(!HANDLER_IS_ROM(handler), "space_map_range called with ROM after initialization"); | |
| 1702 | assert_always(!HANDLER_IS_RAM(handler), "space_map_range called with RAM after initialization"); | |
| 1703 | assert_always(addrstart <= addrend, "space_map_range called with start greater than end"); | |
| 1704 | assert_always(handlerbits <= space->dbits, "space_map_range called with handlers larger than the address space"); | |
| 1705 | assert_always((bytestart & (space->dbits / 8 - 1)) == 0, "space_map_range called with misaligned start address"); | |
| 1706 | assert_always((byteend & (space->dbits / 8 - 1)) == (space->dbits / 8 - 1), "space_map_range called with misaligned end address"); | |
| 1707 | ||
| 1707 | 1708 | /* if we're installing a new bank, make sure we mark it */ |
| 1708 | 1709 | if (HANDLER_IS_BANK(handler)) |
| 1709 | 1710 | bank_assign_static(HANDLER_TO_BANK(handler), space->cpunum, space->spacenum, readorwrite, bytestart, byteend); |
| 1710 | 1711 | |
| 1711 | /* determine the mirror bits */ | |
| 1712 | hmirrorbits = lmirrorbits = 0; | |
| 1713 | for (i = 0; i < LEVEL2_BITS; i++) | |
| 1714 | if (bytemirror & (1 << i)) | |
| 1715 | lmirrorbit[lmirrorbits++] = 1 << i; | |
| 1716 | for (i = LEVEL2_BITS; i < 32; i++) | |
| 1717 | if (bytemirror & (1 << i)) | |
| 1718 | hmirrorbit[hmirrorbits++] = 1 << i; | |
| 1719 | ||
| 1720 | 1712 | /* get the final handler index */ |
| 1721 | | |
| 1713 | entry = | |
| 1722 | 1714 | |
| 1723 | /* loop over mirrors in the level 2 table */ | |
| 1724 | for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) | |
| 1725 | { | |
| 1726 | /* compute the base of this mirror */ | |
| 1727 | offs_t hmirrorbase = 0; | |
| 1728 | for (i = 0; i < hmirrorbits; i++) | |
| 1729 | if (hmirrorcount & (1 << i)) | |
| 1730 | hmirrorbase |= hmirrorbit[i]; | |
| 1715 | /* fix up the handler if a stub is required */ | |
| 1716 | if (handlerbits != space->dbits) | |
| 1717 | table_compute_subhandler(tabledata->handlers, entry, readorwrite, space->dbits, space->endianness, handlerbits, handlerunitmask); | |
| 1731 | 1718 | |
| 1732 | /* if this is not our first time through, and the level 2 entry matches the previous | |
| 1733 | level 2 entry, just do a quick map and get out; note that this only works for entries | |
| 1734 | which don't span multiple level 1 table entries */ | |
| 1735 | cur_index = LEVEL1_INDEX(bytestart + hmirrorbase); | |
| 1736 | if (cur_index == LEVEL1_INDEX(byteend + hmirrorbase)) | |
| 1737 | { | |
| 1738 | if (hmirrorcount != 0 && prev_entry == tabledata->table[cur_index]) | |
| 1739 | { | |
| 1740 | VPRINTF(("Quick mapping subtable at %08X to match subtable at %08X\n", cur_index << LEVEL2_BITS, prev_index << LEVEL2_BITS)); | |
| 1719 | /* populate it */ | |
| 1720 | table_populate_range_mirrored(tabledata, bytestart, byteend, bytemirror, entry); | |
| 1741 | 1721 | |
| 1742 | /* release the subtable if the old value was a subtable */ | |
| 1743 | if (tabledata->table[cur_index] >= SUBTABLE_BASE) | |
| 1744 | subtable_release(tabledata, tabledata->table[cur_index]); | |
| 1745 | ||
| 1746 | /* reallocate the subtable if the new value is a subtable */ | |
| 1747 | if (tabledata->table[prev_index] >= SUBTABLE_BASE) | |
| 1748 | subtable_realloc(tabledata, tabledata->table[prev_index]); | |
| 1749 | ||
| 1750 | /* set the new value and short-circuit the mapping step */ | |
| 1751 | tabledata->table[cur_index] = tabledata->table[prev_index]; | |
| 1752 | continue; | |
| 1753 | } | |
| 1754 | prev_index = cur_index; | |
| 1755 | prev_entry = tabledata->table[cur_index]; | |
| 1756 | } | |
| 1757 | ||
| 1758 | /* loop over mirrors in the level 1 table */ | |
| 1759 | for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++) | |
| 1760 | { | |
| 1761 | /* compute the base of this mirror */ | |
| 1762 | offs_t lmirrorbase = hmirrorbase; | |
| 1763 | for (i = 0; i < lmirrorbits; i++) | |
| 1764 | if (lmirrorcount & (1 << i)) | |
| 1765 | lmirrorbase |= lmirrorbit[i]; | |
| 1766 | ||
| 1767 | /* populate the tables */ | |
| 1768 | populate_table_range(space, readorwrite, bytestart + lmirrorbase, byteend + lmirrorbase, idx); | |
| 1769 | } | |
| 1770 | } | |
| 1771 | ||
| 1772 | 1722 | /* if this is being installed to a live CPU, update the context */ |
| 1773 | 1723 | if (space->cpunum == cur_context) |
| 1774 | 1724 | memory_set_context(cur_context); |
| r2418 | r2419 | |
| 1842 | 1792 | |
| 1843 | 1793 | |
| 1844 | 1794 | /*------------------------------------------------- |
| 1845 | | |
| 1795 | | |
| 1846 | 1796 | handler, or allocates a new one as necessary |
| 1847 | 1797 | -------------------------------------------------*/ |
| 1848 | 1798 | |
| 1849 | static UINT8 | |
| 1799 | static UINT8 | |
| 1850 | 1800 | { |
| 1851 | 1801 | int entry; |
| 1852 | 1802 | |
| r2418 | r2419 | |
| 1893 | 1843 | |
| 1894 | 1844 | |
| 1895 | 1845 | /*------------------------------------------------- |
| 1896 | populate_table_range - assign a memory handler | |
| 1846 | table_compute_subhandler - compute data for | |
| 1847 | a subhandler | |
| 1848 | -------------------------------------------------*/ | |
| 1849 | ||
| 1850 | static void table_compute_subhandler(handler_data *table, UINT8 entry, read_or_write readorwrite, int spacebits, int spaceendian, int handlerbits, int handlerunitmask) | |
| 1851 | { | |
| 1852 | int maxunits = spacebits / handlerbits; | |
| 1853 | handler_data *hdata = &table[entry]; | |
| 1854 | int unitnum; | |
| 1855 | ||
| 1856 | assert_always(!HANDLER_IS_STATIC(entry), "table_compute_subhandler called with static handlers and mismatched data bus widths"); | |
| 1857 | ||
| 1858 | /* copy raw data to the subhandler data */ | |
| 1859 | hdata->subobject = hdata->object; | |
| 1860 | hdata->subhandler = hdata->handler; | |
| 1861 | ||
| 1862 | /* fill in a stub as the real handler */ | |
| 1863 | hdata->object = hdata; | |
| 1864 | hdata->handler = get_stub_handler(readorwrite, spacebits, handlerbits); | |
| 1865 | ||
| 1866 | /* compute the number of subunits */ | |
| 1867 | hdata->subunits = 0; | |
| 1868 | for (unitnum = 0; unitnum < maxunits; unitnum++) | |
| 1869 | if (handlerunitmask & (1 << unitnum)) | |
| 1870 | hdata->subunits++; | |
| 1871 | assert_always(hdata->subunits > 0, "table_compute_subhandler called with no bytes specified in mask"); | |
| 1872 | ||
| 1873 | /* then fill in the shifts based on the endianness */ | |
| 1874 | if (spaceendian == CPU_IS_LE) | |
| 1875 | { | |
| 1876 | UINT8 *unitshift = &hdata->subshift[0]; | |
| 1877 | for (unitnum = 0; unitnum < maxunits; unitnum++) | |
| 1878 | if (handlerunitmask & (1 << unitnum)) | |
| 1879 | *unitshift++ = unitnum * handlerbits; | |
| 1880 | } | |
| 1881 | else | |
| 1882 | { | |
| 1883 | UINT8 *unitshift = &hdata->subshift[hdata->subunits]; | |
| 1884 | for (unitnum = 0; unitnum < maxunits; unitnum++) | |
| 1885 | if (handlerunitmask & (1 << unitnum)) | |
| 1886 | *--unitshift = unitnum * handlerbits; | |
| 1887 | } | |
| 1888 | } | |
| 1889 | ||
| 1890 | ||
| 1891 | /*------------------------------------------------- | |
| 1892 | table_populate_range - assign a memory handler | |
| 1897 | 1893 | to a range of addresses |
| 1898 | 1894 | -------------------------------------------------*/ |
| 1899 | 1895 | |
| 1900 | static void populate_ | |
| 1896 | static void table_populate_ | |
| 1901 | 1897 | { |
| 1902 | table_data *tabledata = (readorwrite == ROW_WRITE) ? &space->write : &space->read; | |
| 1903 | 1898 | offs_t l2mask = (1 << LEVEL2_BITS) - 1; |
| 1904 | 1899 | offs_t l1start = bytestart >> LEVEL2_BITS; |
| 1905 | 1900 | offs_t l2start = bytestart & l2mask; |
| r2418 | r2419 | |
| 1957 | 1952 | |
| 1958 | 1953 | |
| 1959 | 1954 | /*------------------------------------------------- |
| 1955 | table_populate_range_mirrored - assign a | |
| 1956 | memory handler to a range of addresses | |
| 1957 | including mirrors | |
| 1958 | -------------------------------------------------*/ | |
| 1959 | ||
| 1960 | static void table_populate_range_mirrored(table_data *tabledata, offs_t bytestart, offs_t byteend, offs_t bytemirror, UINT8 handler) | |
| 1961 | { | |
| 1962 | offs_t lmirrorbit[LEVEL2_BITS], lmirrorbits, hmirrorbit[32 - LEVEL2_BITS], hmirrorbits, lmirrorcount, hmirrorcount; | |
| 1963 | UINT8 prev_entry = STATIC_INVALID; | |
| 1964 | int cur_index, prev_index = 0; | |
| 1965 | int i; | |
| 1966 | ||
| 1967 | /* determine the mirror bits */ | |
| 1968 | hmirrorbits = lmirrorbits = 0; | |
| 1969 | for (i = 0; i < LEVEL2_BITS; i++) | |
| 1970 | if (bytemirror & (1 << i)) | |
| 1971 | lmirrorbit[lmirrorbits++] = 1 << i; | |
| 1972 | for (i = LEVEL2_BITS; i < 32; i++) | |
| 1973 | if (bytemirror & (1 << i)) | |
| 1974 | hmirrorbit[hmirrorbits++] = 1 << i; | |
| 1975 | ||
| 1976 | /* loop over mirrors in the level 2 table */ | |
| 1977 | for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) | |
| 1978 | { | |
| 1979 | /* compute the base of this mirror */ | |
| 1980 | offs_t hmirrorbase = 0; | |
| 1981 | for (i = 0; i < hmirrorbits; i++) | |
| 1982 | if (hmirrorcount & (1 << i)) | |
| 1983 | hmirrorbase |= hmirrorbit[i]; | |
| 1984 | ||
| 1985 | /* if this is not our first time through, and the level 2 entry matches the previous | |
| 1986 | level 2 entry, just do a quick map and get out; note that this only works for entries | |
| 1987 | which don't span multiple level 1 table entries */ | |
| 1988 | cur_index = LEVEL1_INDEX(bytestart + hmirrorbase); | |
| 1989 | if (cur_index == LEVEL1_INDEX(byteend + hmirrorbase)) | |
| 1990 | { | |
| 1991 | if (hmirrorcount != 0 && prev_entry == tabledata->table[cur_index]) | |
| 1992 | { | |
| 1993 | VPRINTF(("Quick mapping subtable at %08X to match subtable at %08X\n", cur_index << LEVEL2_BITS, prev_index << LEVEL2_BITS)); | |
| 1994 | ||
| 1995 | /* release the subtable if the old value was a subtable */ | |
| 1996 | if (tabledata->table[cur_index] >= SUBTABLE_BASE) | |
| 1997 | subtable_release(tabledata, tabledata->table[cur_index]); | |
| 1998 | ||
| 1999 | /* reallocate the subtable if the new value is a subtable */ | |
| 2000 | if (tabledata->table[prev_index] >= SUBTABLE_BASE) | |
| 2001 | subtable_realloc(tabledata, tabledata->table[prev_index]); | |
| 2002 | ||
| 2003 | /* set the new value and short-circuit the mapping step */ | |
| 2004 | tabledata->table[cur_index] = tabledata->table[prev_index]; | |
| 2005 | continue; | |
| 2006 | } | |
| 2007 | prev_index = cur_index; | |
| 2008 | prev_entry = tabledata->table[cur_index]; | |
| 2009 | } | |
| 2010 | ||
| 2011 | /* loop over mirrors in the level 1 table */ | |
| 2012 | for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++) | |
| 2013 | { | |
| 2014 | /* compute the base of this mirror */ | |
| 2015 | offs_t lmirrorbase = hmirrorbase; | |
| 2016 | for (i = 0; i < lmirrorbits; i++) | |
| 2017 | if (lmirrorcount & (1 << i)) | |
| 2018 | lmirrorbase |= lmirrorbit[i]; | |
| 2019 | ||
| 2020 | /* populate the tables */ | |
| 2021 | table_populate_range(tabledata, bytestart + lmirrorbase, byteend + lmirrorbase, handler); | |
| 2022 | } | |
| 2023 | } | |
| 2024 | } | |
| 2025 | ||
| 2026 | ||
| 2027 | /*------------------------------------------------- | |
| 1960 | 2028 | subtable_alloc - allocate a fresh subtable |
| 1961 | 2029 | and set its usecount to 1 |
| 1962 | 2030 | -------------------------------------------------*/ |
| r2418 | r2419 | |
| 2697 | 2765 | memory handlers |
| 2698 | 2766 | -------------------------------------------------*/ |
| 2699 | 2767 | |
| 2700 | static genf *get_static_handler(int | |
| 2768 | static genf *get_static_handler(int handlerbits, int readorwrite, int spacenum, int which) | |
| 2701 | 2769 | { |
| 2702 | 2770 | static const struct |
| 2703 | 2771 | { |
| 2704 | UINT8 | |
| 2772 | UINT8 handlerbits; | |
| 2705 | 2773 | UINT8 handlernum; |
| 2706 | 2774 | UINT8 spacenum; |
| 2707 | 2775 | genf * read; |
| r2418 | r2419 | |
| 2739 | 2807 | int tablenum; |
| 2740 | 2808 | |
| 2741 | 2809 | for (tablenum = 0; tablenum < sizeof(static_handler_list) / sizeof(static_handler_list[0]); tablenum++) |
| 2742 | if (static_handler_list[tablenum]. | |
| 2810 | if (static_handler_list[tablenum].handlerbits == handlerbits && static_handler_list[tablenum].handlernum == which) | |
| 2743 | 2811 | if (static_handler_list[tablenum].spacenum == 0xff || static_handler_list[tablenum].spacenum == spacenum) |
| 2744 | 2812 | return readorwrite ? static_handler_list[tablenum].write : static_handler_list[tablenum].read; |
| 2745 | 2813 | |
| r2418 | r2419 | |
| 2944 | 3012 | |
| 2945 | 3013 | |
| 2946 | 3014 | |
| 3015 | /*************************************************************************** | |
| 3016 | STUB HANDLERS THAT MAP TO BYTE READS | |
| 3017 | ***************************************************************************/ | |
| 2947 | 3018 | |
| 3019 | /*------------------------------------------------- | |
| 3020 | stub_read8_from_16 - return a 16-bit | |
| 3021 | value combined from one or more byte accesses | |
| 3022 | -------------------------------------------------*/ | |
| 2948 | 3023 | |
| 3024 | static READ16_HANDLER( stub_read8_from_16 ) | |
| 3025 | { | |
| 3026 | const handler_data *handler = (const handler_data *)machine; | |
| 3027 | const UINT8 *subshift = handler->subshift; | |
| 3028 | int subunits = handler->subunits; | |
| 3029 | UINT16 result = 0; | |
| 2949 | 3030 | |
| 3031 | offset *= subunits; | |
| 3032 | while (subunits-- != 0) | |
| 3033 | { | |
| 3034 | int shift = *subshift++; | |
| 3035 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3036 | result |= (*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift; | |
| 3037 | offset++; | |
| 3038 | } | |
| 3039 | return result; | |
| 3040 | } | |
| 2950 | 3041 | |
| 3042 | ||
| 3043 | /*------------------------------------------------- | |
| 3044 | stub_read8_from_32 - return a 32-bit | |
| 3045 | value combined from one or more byte accesses | |
| 3046 | -------------------------------------------------*/ | |
| 3047 | ||
| 3048 | static READ32_HANDLER( stub_read8_from_32 ) | |
| 3049 | { | |
| 3050 | const handler_data *handler = (const handler_data *)machine; | |
| 3051 | const UINT8 *subshift = handler->subshift; | |
| 3052 | int subunits = handler->subunits; | |
| 3053 | UINT32 result = 0; | |
| 3054 | ||
| 3055 | offset *= subunits; | |
| 3056 | while (subunits-- != 0) | |
| 3057 | { | |
| 3058 | int shift = *subshift++; | |
| 3059 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3060 | result |= (*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift; | |
| 3061 | offset++; | |
| 3062 | } | |
| 3063 | return result; | |
| 3064 | } | |
| 3065 | ||
| 3066 | ||
| 3067 | /*------------------------------------------------- | |
| 3068 | stub_read8_from_64 - return a 64-bit | |
| 3069 | value combined from one or more byte accesses | |
| 3070 | -------------------------------------------------*/ | |
| 3071 | ||
| 3072 | static READ64_HANDLER( stub_read8_from_64 ) | |
| 3073 | { | |
| 3074 | const handler_data *handler = (const handler_data *)machine; | |
| 3075 | const UINT8 *subshift = handler->subshift; | |
| 3076 | int subunits = handler->subunits; | |
| 3077 | UINT64 result = 0; | |
| 3078 | ||
| 3079 | offset *= subunits; | |
| 3080 | while (subunits-- != 0) | |
| 3081 | { | |
| 3082 | int shift = *subshift++; | |
| 3083 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3084 | result |= (UINT64)(*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift; | |
| 3085 | offset++; | |
| 3086 | } | |
| 3087 | return result; | |
| 3088 | } | |
| 3089 | ||
| 3090 | ||
| 3091 | /*------------------------------------------------- | |
| 3092 | stub_read16_from_32 - return a 32-bit | |
| 3093 | value combined from one or more word accesses | |
| 3094 | -------------------------------------------------*/ | |
| 3095 | ||
| 3096 | static READ32_HANDLER( stub_read16_from_32 ) | |
| 3097 | { | |
| 3098 | const handler_data *handler = (const handler_data *)machine; | |
| 3099 | const UINT8 *subshift = handler->subshift; | |
| 3100 | int subunits = handler->subunits; | |
| 3101 | UINT32 result = 0; | |
| 3102 | ||
| 3103 | offset *= subunits; | |
| 3104 | while (subunits-- != 0) | |
| 3105 | { | |
| 3106 | int shift = *subshift++; | |
| 3107 | if ((UINT16)(mem_mask >> shift) != 0xffff) | |
| 3108 | result |= (*handler->subhandler.read.mhandler16)(handler->subobject, offset, mem_mask >> shift) << shift; | |
| 3109 | offset++; | |
| 3110 | } | |
| 3111 | return result; | |
| 3112 | } | |
| 3113 | ||
| 3114 | ||
| 3115 | /*------------------------------------------------- | |
| 3116 | stub_read16_from_64 - return a 64-bit | |
| 3117 | value combined from one or more word accesses | |
| 3118 | -------------------------------------------------*/ | |
| 3119 | ||
| 3120 | static READ64_HANDLER( stub_read16_from_64 ) | |
| 3121 | { | |
| 3122 | const handler_data *handler = (const handler_data *)machine; | |
| 3123 | const UINT8 *subshift = handler->subshift; | |
| 3124 | int subunits = handler->subunits; | |
| 3125 | UINT64 result = 0; | |
| 3126 | ||
| 3127 | offset *= subunits; | |
| 3128 | while (subunits-- != 0) | |
| 3129 | { | |
| 3130 | int shift = *subshift++; | |
| 3131 | if ((UINT16)(mem_mask >> shift) != 0xffff) | |
| 3132 | result |= (UINT64)(*handler->subhandler.read.mhandler16)(handler->subobject, offset, mem_mask >> shift) << shift; | |
| 3133 | offset++; | |
| 3134 | } | |
| 3135 | return result; | |
| 3136 | } | |
| 3137 | ||
| 3138 | ||
| 3139 | /*------------------------------------------------- | |
| 3140 | stub_read32_from_64 - return a 64-bit | |
| 3141 | value combined from one or more dword accesses | |
| 3142 | -------------------------------------------------*/ | |
| 3143 | ||
| 3144 | static READ64_HANDLER( stub_read32_from_64 ) | |
| 3145 | { | |
| 3146 | const handler_data *handler = (const handler_data *)machine; | |
| 3147 | const UINT8 *subshift = handler->subshift; | |
| 3148 | int subunits = handler->subunits; | |
| 3149 | UINT64 result = 0; | |
| 3150 | ||
| 3151 | offset *= subunits; | |
| 3152 | while (subunits-- != 0) | |
| 3153 | { | |
| 3154 | int shift = *subshift++; | |
| 3155 | if ((UINT32)(mem_mask >> shift) != 0xffffffff) | |
| 3156 | result |= (UINT64)(*handler->subhandler.read.mhandler32)(handler->subobject, offset, mem_mask >> shift) << shift; | |
| 3157 | offset++; | |
| 3158 | } | |
| 3159 | return result; | |
| 3160 | } | |
| 3161 | ||
| 3162 | ||
| 3163 | ||
| 2951 | 3164 | /*************************************************************************** |
| 3165 | STUB HANDLERS THAT MAP TO BYTE WRITES | |
| 3166 | ***************************************************************************/ | |
| 3167 | ||
| 3168 | /*------------------------------------------------- | |
| 3169 | stub_write8_from_16 - convert a 16-bit | |
| 3170 | write to one or more byte accesses | |
| 3171 | -------------------------------------------------*/ | |
| 3172 | ||
| 3173 | static WRITE16_HANDLER( stub_write8_from_16 ) | |
| 3174 | { | |
| 3175 | const handler_data *handler = (const handler_data *)machine; | |
| 3176 | const UINT8 *subshift = handler->subshift; | |
| 3177 | int subunits = handler->subunits; | |
| 3178 | ||
| 3179 | offset *= subunits; | |
| 3180 | while (subunits-- != 0) | |
| 3181 | { | |
| 3182 | int shift = *subshift++; | |
| 3183 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3184 | (*handler->subhandler.write.mhandler8)(handler->subobject, offset, data >> shift); | |
| 3185 | offset++; | |
| 3186 | } | |
| 3187 | } | |
| 3188 | ||
| 3189 | ||
| 3190 | /*------------------------------------------------- | |
| 3191 | stub_write8_from_32 - convert a 32-bit | |
| 3192 | write to one or more byte accesses | |
| 3193 | -------------------------------------------------*/ | |
| 3194 | ||
| 3195 | static WRITE32_HANDLER( stub_write8_from_32 ) | |
| 3196 | { | |
| 3197 | const handler_data *handler = (const handler_data *)machine; | |
| 3198 | const UINT8 *subshift = handler->subshift; | |
| 3199 | int subunits = handler->subunits; | |
| 3200 | ||
| 3201 | offset *= subunits; | |
| 3202 | while (subunits-- != 0) | |
| 3203 | { | |
| 3204 | int shift = *subshift++; | |
| 3205 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3206 | (*handler->subhandler.write.mhandler8)(handler->subobject, offset, data >> shift); | |
| 3207 | offset++; | |
| 3208 | } | |
| 3209 | } | |
| 3210 | ||
| 3211 | ||
| 3212 | /*------------------------------------------------- | |
| 3213 | stub_write8_from_64 - convert a 64-bit | |
| 3214 | write to one or more byte accesses | |
| 3215 | -------------------------------------------------*/ | |
| 3216 | ||
| 3217 | static WRITE64_HANDLER( stub_write8_from_64 ) | |
| 3218 | { | |
| 3219 | const handler_data *handler = (const handler_data *)machine; | |
| 3220 | const UINT8 *subshift = handler->subshift; | |
| 3221 | int subunits = handler->subunits; | |
| 3222 | ||
| 3223 | offset *= subunits; | |
| 3224 | while (subunits-- != 0) | |
| 3225 | { | |
| 3226 | int shift = *subshift++; | |
| 3227 | if ((UINT8)(mem_mask >> shift) != 0xff) | |
| 3228 | (*handler->subhandler.write.mhandler8)(handler->subobject, offset, data >> shift); | |
| 3229 | offset++; | |
| 3230 | } | |
| 3231 | } | |
| 3232 | ||
| 3233 | ||
| 3234 | /*------------------------------------------------- | |
| 3235 | stub_write16_from_32 - convert a 32-bit | |
| 3236 | write to one or more word accesses | |
| 3237 | -------------------------------------------------*/ | |
| 3238 | ||
| 3239 | static WRITE32_HANDLER( stub_write16_from_32 ) | |
| 3240 | { | |
| 3241 | const handler_data *handler = (const handler_data *)machine; | |
| 3242 | const UINT8 *subshift = handler->subshift; | |
| 3243 | int subunits = handler->subunits; | |
| 3244 | ||
| 3245 | offset *= subunits; | |
| 3246 | while (subunits-- != 0) | |
| 3247 | { | |
| 3248 | int shift = *subshift++; | |
| 3249 | if ((UINT16)(mem_mask >> shift) != 0xffff) | |
| 3250 | (*handler->subhandler.write.mhandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift); | |
| 3251 | offset++; | |
| 3252 | } | |
| 3253 | } | |
| 3254 | ||
| 3255 | ||
| 3256 | /*------------------------------------------------- | |
| 3257 | stub_write16_from_64 - convert a 64-bit | |
| 3258 | write to one or more word accesses | |
| 3259 | -------------------------------------------------*/ | |
| 3260 | ||
| 3261 | static WRITE64_HANDLER( stub_write16_from_64 ) | |
| 3262 | { | |
| 3263 | const handler_data *handler = (const handler_data *)machine; | |
| 3264 | const UINT8 *subshift = handler->subshift; | |
| 3265 | int subunits = handler->subunits; | |
| 3266 | ||
| 3267 | offset *= subunits; | |
| 3268 | while (subunits-- != 0) | |
| 3269 | { | |
| 3270 | int shift = *subshift++; | |
| 3271 | if ((UINT16)(mem_mask >> shift) != 0xffff) | |
| 3272 | (*handler->subhandler.write.mhandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift); | |
| 3273 | offset++; | |
| 3274 | } | |
| 3275 | } | |
| 3276 | ||
| 3277 | ||
| 3278 | /*------------------------------------------------- | |
| 3279 | stub_write32_from_64 - convert a 64-bit | |
| 3280 | write to one or more word accesses | |
| 3281 | -------------------------------------------------*/ | |
| 3282 | ||
| 3283 | static WRITE64_HANDLER( stub_write32_from_64 ) | |
| 3284 | { | |
| 3285 | const handler_data *handler = (const handler_data *)machine; | |
| 3286 | const UINT8 *subshift = handler->subshift; | |
| 3287 | int subunits = handler->subunits; | |
| 3288 | ||
| 3289 | offset *= subunits; | |
| 3290 | while (subunits-- != 0) | |
| 3291 | { | |
| 3292 | int shift = *subshift++; | |
| 3293 | if ((UINT32)(mem_mask >> shift) != 0xffffffff) | |
| 3294 | (*handler->subhandler.write.mhandler32)(handler->subobject, offset, data >> shift, mem_mask >> shift); | |
| 3295 | offset++; | |
| 3296 | } | |
| 3297 | } | |
| 3298 | ||
| 3299 | ||
| 3300 | ||
| 3301 | /*************************************************************************** | |
| 3302 | STUB ACCESSORS | |
| 3303 | ***************************************************************************/ | |
| 3304 | ||
| 3305 | /*------------------------------------------------- | |
| 3306 | get_stub_handler - return the appropriate | |
| 3307 | stub handler | |
| 3308 | -------------------------------------------------*/ | |
| 3309 | ||
| 3310 | static memory_handler get_stub_handler(read_or_write readorwrite, int spacedbits, int handlerdbits) | |
| 3311 | { | |
| 3312 | memory_handler result = { 0 }; | |
| 3313 | ||
| 3314 | /* read stubs */ | |
| 3315 | if (readorwrite == ROW_READ) | |
| 3316 | { | |
| 3317 | /* 16-bit read stubs */ | |
| 3318 | if (spacedbits == 16) | |
| 3319 | { | |
| 3320 | if (handlerdbits == 8) | |
| 3321 | result.read.mhandler16 = stub_read8_from_16; | |
| 3322 | } | |
| 3323 | ||
| 3324 | /* 32-bit read stubs */ | |
| 3325 | else if (spacedbits == 32) | |
| 3326 | { | |
| 3327 | if (handlerdbits == 8) | |
| 3328 | result.read.mhandler32 = stub_read8_from_32; | |
| 3329 | else if (handlerdbits == 16) | |
| 3330 | result.read.mhandler32 = stub_read16_from_32; | |
| 3331 | } | |
| 3332 | ||
| 3333 | /* 64-bit read stubs */ | |
| 3334 | else if (spacedbits == 64) | |
| 3335 | { | |
| 3336 | if (handlerdbits == 8) | |
| 3337 | result.read.mhandler64 = stub_read8_from_64; | |
| 3338 | else if (handlerdbits == 16) | |
| 3339 | result.read.mhandler64 = stub_read16_from_64; | |
| 3340 | else if (handlerdbits == 32) | |
| 3341 | result.read.mhandler64 = stub_read32_from_64; | |
| 3342 | } | |
| 3343 | } | |
| 3344 | ||
| 3345 | /* write stubs */ | |
| 3346 | else if (readorwrite == ROW_WRITE) | |
| 3347 | { | |
| 3348 | /* 16-bit write stubs */ | |
| 3349 | if (spacedbits == 16) | |
| 3350 | { | |
| 3351 | if (handlerdbits == 8) | |
| 3352 | result.write.mhandler16 = stub_write8_from_16; | |
| 3353 | } | |
| 3354 | ||
| 3355 | /* 32-bit write stubs */ | |
| 3356 | else if (spacedbits == 32) | |
| 3357 | { | |
| 3358 | if (handlerdbits == 8) | |
| 3359 | result.write.mhandler32 = stub_write8_from_32; | |
| 3360 | else if (handlerdbits == 16) | |
| 3361 | result.write.mhandler32 = stub_write16_from_32; | |
| 3362 | } | |
| 3363 | ||
| 3364 | /* 64-bit write stubs */ | |
| 3365 | else if (spacedbits == 64) | |
| 3366 | { | |
| 3367 | if (handlerdbits == 8) | |
| 3368 | result.write.mhandler64 = stub_write8_from_64; | |
| 3369 | else if (handlerdbits == 16) | |
| 3370 | result.write.mhandler64 = stub_write16_from_64; | |
| 3371 | else if (handlerdbits == 32) | |
| 3372 | result.write.mhandler64 = stub_write32_from_64; | |
| 3373 | } | |
| 3374 | } | |
| 3375 | ||
| 3376 | assert(result.read.generic != NULL); | |
| 3377 | return result; | |
| 3378 | } | |
| 3379 | ||
| 3380 | ||
| 3381 | ||
| 3382 | /*************************************************************************** | |
| 2952 | 3383 | MEMORY HANDLER LOOKUP HELPERS |
| 2953 | 3384 | ***************************************************************************/ |
| 2954 | 3385 | |
| r2418 | r2419 | |
| 2974 | 3405 | } |
| 2975 | 3406 | |
| 2976 | 3407 | |
| 3408 | ||
| 2977 | 3409 | /*************************************************************************** |
| 2978 | 3410 | 8-BIT READ HANDLERS |
| 2979 | 3411 | ***************************************************************************/ |
| r2418 | r2419 | |
| 3170 | 3602 | ***************************************************************************/ |
| 3171 | 3603 | |
| 3172 | 3604 | /*------------------------------------------------- |
| 3173 | write_byte_generic - write a byte to an | |
| 3605 | stub_write_byte_generic - write a byte to an | |
| 3174 | 3606 | arbitrary address space |
| 3175 | 3607 | -------------------------------------------------*/ |
| 3176 | 3608 |
| r2418 | r2419 | |
|---|---|---|
| 26 | 26 | /* address spaces */ |
| 27 | 27 | enum |
| 28 | 28 | { |
| 29 | ADDRESS_SPACE_PROGRAM = 0, | |
| 29 | ADDRESS_SPACE_PROGRAM = 0, | |
| 30 | 30 | ADDRESS_SPACE_DATA, /* data address space */ |
| 31 | 31 | ADDRESS_SPACE_IO, /* I/O address space */ |
| 32 | 32 | ADDRESS_SPACES /* maximum number of address spaces */ |
| r2418 | r2419 | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | /* device read/write handlers */ |
| 110 | typedef UINT8 (*read8_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset); | |
| 111 | typedef void (*write8_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); | |
| 112 | typedef UINT16 (*read16_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); | |
| 113 | typedef void (*write16_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); | |
| 114 | typedef UINT32 (*read32_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); | |
| 115 | typedef void (*write32_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); | |
| 116 | typedef UINT64 (*read64_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); | |
| 117 | typedef void (*write64_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); | |
| 110 | typedef UINT8 (*read8_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset); | |
| 111 | typedef void (*write8_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); | |
| 112 | typedef UINT16 (*read16_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); | |
| 113 | typedef void (*write16_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); | |
| 114 | typedef UINT32 (*read32_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); | |
| 115 | typedef void (*write32_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); | |
| 116 | typedef UINT64 (*read64_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); | |
| 117 | typedef void (*write64_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); | |
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | /* data_accessors is a struct with accessors of all flavors */ |
| r2418 | r2419 | |
| 192 | 192 | offs_t addrmirror; /* mirror bits */ |
| 193 | 193 | offs_t addrmask; /* mask bits */ |
| 194 | 194 | read_handler read; /* read handler callback */ |
| 195 | UINT8 read_bits; /* bits for the read handler callback (0=default, 1=8, 2=16, 3=32) */ | |
| 196 | UINT8 read_mask; /* mask bits indicating which subunits to process */ | |
| 195 | 197 | const char * read_name; /* read handler callback name */ |
| 196 | 198 | device_type read_devtype; /* read device type for device references */ |
| 197 | 199 | const char * read_devtag; /* read tag for the relevant device */ |
| 198 | 200 | write_handler write; /* write handler callback */ |
| 201 | UINT8 write_bits; /* bits for the write handler callback (0=default, 1=8, 2=16, 3=32) */ | |
| 202 | UINT8 write_mask; /* mask bits indicating which subunits to process */ | |
| 199 | 203 | const char * write_name; /* write handler callback name */ |
| 200 | 204 | device_type write_devtype; /* read device type for device references */ |
| 201 | 205 | const char * write_devtag; /* read tag for the relevant device */ |
| r2418 | r2419 | |
| 284 | 288 | write16_device_func dwrite; /* pointer to native device write handler */ |
| 285 | 289 | read8_machine_func mread8; /* pointer to 8-bit machine read handler */ |
| 286 | 290 | write8_machine_func mwrite8; /* pointer to 8-bit machine write handler */ |
| 291 | read8_device_func dread8; /* pointer to 8-bit device read handler */ | |
| 292 | write8_device_func dwrite8; /* pointer to 8-bit device write handler */ | |
| 287 | 293 | read_handler read; /* generic read handlers */ |
| 288 | 294 | write_handler write; /* generic write handlers */ |
| 289 | 295 | device_type devtype; /* device type */ |
| r2418 | r2419 | |
| 304 | 310 | write32_device_func dwrite; /* pointer to native device write handler */ |
| 305 | 311 | read8_machine_func mread8; /* pointer to 8-bit machine read handler */ |
| 306 | 312 | write8_machine_func mwrite8; /* pointer to 8-bit machine write handler */ |
| 313 | read8_device_func dread8; /* pointer to 8-bit device read handler */ | |
| 314 | write8_device_func dwrite8; /* pointer to 8-bit device write handler */ | |
| 307 | 315 | read16_machine_func mread16; /* pointer to 16-bit machine read handler */ |
| 308 | 316 | write16_machine_func mwrite16; /* pointer to 16-bit machine write handler */ |
| 317 | read16_device_func dread16; /* pointer to 16-bit device read handler */ | |
| 318 | write16_device_func dwrite16; /* pointer to 16-bit device write handler */ | |
| 309 | 319 | read_handler read; /* generic read handlers */ |
| 310 | 320 | write_handler write; /* generic write handlers */ |
| 311 | 321 | device_type devtype; /* device type */ |
| r2418 | r2419 | |
| 326 | 336 | write64_device_func dwrite; /* pointer to native device write handler */ |
| 327 | 337 | read8_machine_func mread8; /* pointer to 8-bit machine read handler */ |
| 328 | 338 | write8_machine_func mwrite8; /* pointer to 8-bit machine write handler */ |
| 339 | read8_device_func dread8; /* pointer to 8-bit device read handler */ | |
| 340 | write8_device_func dwrite8; /* pointer to 8-bit device write handler */ | |
| 329 | 341 | read16_machine_func mread16; /* pointer to 16-bit machine read handler */ |
| 330 | 342 | write16_machine_func mwrite16; /* pointer to 16-bit machine write handler */ |
| 343 | read16_device_func dread16; /* pointer to 16-bit device read handler */ | |
| 344 | write16_device_func dwrite16; /* pointer to 16-bit device write handler */ | |
| 331 | 345 | read32_machine_func mread32; /* pointer to 32-bit machine read handler */ |
| 332 | 346 | write32_machine_func mwrite32; /* pointer to 32-bit machine write handler */ |
| 347 | read32_device_func dread32; /* pointer to 32-bit device read handler */ | |
| 348 | write32_device_func dwrite32; /* pointer to 32-bit device write handler */ | |
| 333 | 349 | read_handler read; /* generic read handlers */ |
| 334 | 350 | write_handler write; /* generic write handlers */ |
| 335 | 351 | device_type devtype; /* device type */ |
| r2418 | r2419 | |
| 359 | 375 | |
| 360 | 376 | |
| 361 | 377 | /* device read/write handler function macros */ |
| 362 | #define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset) | |
| 363 | #define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) | |
| 364 | #define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) | |
| 365 | #define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) | |
| 366 | #define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) | |
| 367 | #define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) | |
| 368 | #define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) | |
| 369 | #define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) | |
| 378 | #define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset) | |
| 379 | #define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) | |
| 380 | #define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) | |
| 381 | #define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) | |
| 382 | #define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) | |
| 383 | #define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) | |
| 384 | #define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) | |
| 385 | #define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) | |
| 370 | 386 | |
| 371 | 387 | |
| 372 | 388 | /* static memory handler (SMH) macros that can be used in place of read/write handlers */ |
| r2418 | r2419 | |
| 451 | 467 | |
| 452 | 468 | |
| 453 | 469 | /* wrappers for dynamic read handler installation */ |
| 454 | #define memory_install_read_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 455 | _memory_install_read_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 456 | #define memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 457 | _memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 458 | #define memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 459 | _memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 460 | #define memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 461 | _memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 462 | #define memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 463 | _memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 470 | #define memory_install_read_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 471 | _memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, (FPTR)NULL, #rhandler, NULL) | |
| 472 | #define memory_install_read8_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 473 | _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 474 | #define memory_install_read16_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 475 | _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 476 | #define memory_install_read32_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 477 | _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 478 | #define memory_install_read64_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 479 | _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 464 | 480 | |
| 481 | #define memory_install_read_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 482 | _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 483 | #define memory_install_read8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 484 | _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 485 | #define memory_install_read16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 486 | _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 487 | #define memory_install_read32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 488 | _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 489 | #define memory_install_read64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \ | |
| 490 | _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL) | |
| 465 | 491 | |
| 492 | ||
| 466 | 493 | /* wrappers for dynamic write handler installation */ |
| 467 | #define memory_install_write_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 468 | _memory_install_write_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 469 | #define memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 470 | _memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 471 | #define memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 472 | _memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 473 | #define memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 474 | _memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 475 | #define memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 476 | _memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 494 | #define memory_install_write_handler(machine, cpu, space, start, end, mask, mirror, whandler) \ | |
| 495 | _memory_install_handler(machine, cpu, space, start, end, mask, mirror, (FPTR)NULL, whandler, NULL, #whandler) | |
| 496 | #define memory_install_write8_handler(machine, cpu, space, start, end, mask, mirror, whandler) \ | |
| 497 | _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 498 | #define memory_install_write16_handler(machine, cpu, space, start, end, mask, mirror, whandler) \ | |
| 499 | _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 500 | #define memory_install_write32_handler(machine, cpu, space, start, end, mask, mirror, whandler) \ | |
| 501 | _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 502 | #define memory_install_write64_handler(machine, cpu, space, start, end, mask, mirror, whandler) \ | |
| 503 | _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 477 | 504 | |
| 505 | #define memory_install_write_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \ | |
| 506 | _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 507 | #define memory_install_write8_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \ | |
| 508 | _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 509 | #define memory_install_write16_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \ | |
| 510 | _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 511 | #define memory_install_write32_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \ | |
| 512 | _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 513 | #define memory_install_write64_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \ | |
| 514 | _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler) | |
| 478 | 515 | |
| 516 | ||
| 479 | 517 | /* wrappers for dynamic read/write handler installation */ |
| 480 | #define memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 481 | _memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 482 | #define memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 483 | _memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 484 | #define memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 485 | _memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 486 | #define memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 487 | _memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 488 | #define memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 489 | _memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 518 | #define memory_install_readwrite_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 519 | _memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 520 | #define memory_install_readwrite8_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 521 | _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 522 | #define memory_install_readwrite16_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 523 | _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 524 | #define memory_install_readwrite32_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 525 | _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 526 | #define memory_install_readwrite64_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 527 | _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 490 | 528 | |
| 529 | #define memory_install_readwrite_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 530 | _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 531 | #define memory_install_readwrite8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 532 | _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 533 | #define memory_install_readwrite16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 534 | _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 535 | #define memory_install_readwrite32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 536 | _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 537 | #define memory_install_readwrite64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 538 | _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 491 | 539 | |
| 540 | ||
| 492 | 541 | /* macros for accessing bytes and words within larger chunks */ |
| 493 | 542 | #ifdef LSB_FIRST |
| 494 | 543 | |
| r2418 | r2419 | |
| 532 | 581 | #define address_map_0 NULL |
| 533 | 582 | |
| 534 | 583 | |
| 584 | /* maps a full 64-bit mask down to an 8-bit byte mask */ | |
| 585 | #define UNITMASK8(x) \ | |
| 586 | ((((UINT64)(x) >> (63-7)) & 0x80) | \ | |
| 587 | (((UINT64)(x) >> (55-6)) & 0x40) | \ | |
| 588 | (((UINT64)(x) >> (47-5)) & 0x20) | \ | |
| 589 | (((UINT64)(x) >> (39-4)) & 0x10) | \ | |
| 590 | (((UINT64)(x) >> (31-3)) & 0x08) | \ | |
| 591 | (((UINT64)(x) >> (23-2)) & 0x04) | \ | |
| 592 | (((UINT64)(x) >> (15-1)) & 0x02) | \ | |
| 593 | (((UINT64)(x) >> ( 7-0)) & 0x01)) | |
| 594 | ||
| 595 | /* maps a full 64-bit mask down to a 4-bit word mask */ | |
| 596 | #define UNITMASK16(x) \ | |
| 597 | ((((UINT64)(x) >> (63-3)) & 0x08) | \ | |
| 598 | (((UINT64)(x) >> (47-2)) & 0x04) | \ | |
| 599 | (((UINT64)(x) >> (31-1)) & 0x02) | \ | |
| 600 | (((UINT64)(x) >> (15-0)) & 0x01)) | |
| 601 | ||
| 602 | /* maps a full 64-bit mask down to a 2-bit dword mask */ | |
| 603 | #define UNITMASK32(x) \ | |
| 604 | ((((UINT64)(x) >> (63-1)) & 0x02) | \ | |
| 605 | (((UINT64)(x) >> (31-0)) & 0x01)) | |
| 606 | ||
| 607 | ||
| 608 | ||
| 535 | 609 | /* start/end tags for the address map */ |
| 536 | 610 | #define ADDRESS_MAP_START(_name, _space, _bits) \ |
| 537 | 611 | const addrmap##_bits##_token address_map_##_name[] = { \ |
| r2418 | r2419 | |
| 574 | 648 | TOKEN_UINT64_PACK2(ADDRMAP_TOKEN_MIRROR, 8, _mirror, 32), |
| 575 | 649 | |
| 576 | 650 | #define AM_READ(_handler) \ |
| 577 | TOKEN_UINT32_PACK | |
| 651 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_READ, 8, 0, 8, 0, 8), \ | |
| 578 | 652 | TOKEN_PTR(mread, _handler), \ |
| 579 | 653 | TOKEN_STRING(#_handler), |
| 580 | 654 | |
| 655 | #define AM_READ8(_handler, _unitmask) \ | |
| 656 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_READ, 8, 8, 8, UNITMASK8(_unitmask), 8), \ | |
| 657 | TOKEN_PTR(mread8, _handler), \ | |
| 658 | TOKEN_STRING(#_handler), | |
| 659 | ||
| 660 | #define AM_READ16(_handler, _unitmask) \ | |
| 661 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_READ, 8, 16, 8, UNITMASK16(_unitmask), 8), \ | |
| 662 | TOKEN_PTR(mread16, _handler), \ | |
| 663 | TOKEN_STRING(#_handler), | |
| 664 | ||
| 665 | #define AM_READ32(_handler, _unitmask) \ | |
| 666 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_READ, 8, 32, 8, UNITMASK32(_unitmask), 8), \ | |
| 667 | TOKEN_PTR(mread32, _handler), \ | |
| 668 | TOKEN_STRING(#_handler), | |
| 669 | ||
| 581 | 670 | #define AM_WRITE(_handler) \ |
| 582 | TOKEN_UINT32_PACK | |
| 671 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_WRITE, 8, 0, 8, 0, 8), \ | |
| 583 | 672 | TOKEN_PTR(mwrite, _handler), \ |
| 584 | 673 | TOKEN_STRING(#_handler), |
| 585 | 674 | |
| 675 | #define AM_WRITE8(_handler, _unitmask) \ | |
| 676 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_WRITE, 8, 8, 8, UNITMASK8(_unitmask), 8), \ | |
| 677 | TOKEN_PTR(mwrite8, _handler), \ | |
| 678 | TOKEN_STRING(#_handler), | |
| 679 | ||
| 680 | #define AM_WRITE16(_handler, _unitmask) \ | |
| 681 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_WRITE, 8, 16, 8, UNITMASK16(_unitmask), 8), \ | |
| 682 | TOKEN_PTR(mwrite16, _handler), \ | |
| 683 | TOKEN_STRING(#_handler), | |
| 684 | ||
| 685 | #define AM_WRITE32(_handler, _unitmask) \ | |
| 686 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_WRITE, 8, 32, 8, UNITMASK32(_unitmask), 8), \ | |
| 687 | TOKEN_PTR(mwrite32, _handler), \ | |
| 688 | TOKEN_STRING(#_handler), | |
| 689 | ||
| 586 | 690 | #define AM_DEVREAD(_type, _tag, _handler) \ |
| 587 | TOKEN_UINT32_PACK | |
| 691 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 0, 8, 0, 8), \ | |
| 588 | 692 | TOKEN_PTR(dread, _handler), \ |
| 589 | 693 | TOKEN_STRING(#_handler), \ |
| 590 | 694 | TOKEN_PTR(devtype, _type), \ |
| 591 | 695 | TOKEN_STRING(_tag), |
| 592 | 696 | |
| 697 | #define AM_DEVREAD8(_type, _tag, _handler, _unitmask) \ | |
| 698 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 8, 8, UNITMASK8(_unitmask), 8), \ | |
| 699 | TOKEN_PTR(dread8, _handler), \ | |
| 700 | TOKEN_STRING(#_handler), \ | |
| 701 | TOKEN_PTR(devtype, _type), \ | |
| 702 | TOKEN_STRING(_tag), | |
| 703 | ||
| 704 | #define AM_DEVREAD16(_type, _tag, _handler, _unitmask) \ | |
| 705 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 16, 8, UNITMASK16(_unitmask), 8), \ | |
| 706 | TOKEN_PTR(dread16, _handler), \ | |
| 707 | TOKEN_STRING(#_handler), \ | |
| 708 | TOKEN_PTR(devtype, _type), \ | |
| 709 | TOKEN_STRING(_tag), | |
| 710 | ||
| 711 | #define AM_DEVREAD32(_type, _tag, _handler, _unitmask) \ | |
| 712 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 32, 8, UNITMASK32(_unitmask), 8), \ | |
| 713 | TOKEN_PTR(dread32, _handler), \ | |
| 714 | TOKEN_STRING(#_handler), \ | |
| 715 | TOKEN_PTR(devtype, _type), \ | |
| 716 | TOKEN_STRING(_tag), | |
| 717 | ||
| 593 | 718 | #define AM_DEVWRITE(_type, _tag, _handler) \ |
| 594 | TOKEN_UINT32_PACK | |
| 719 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 0, 8, 0, 8), \ | |
| 595 | 720 | TOKEN_PTR(dwrite, _handler), \ |
| 596 | 721 | TOKEN_STRING(#_handler), \ |
| 597 | 722 | TOKEN_PTR(devtype, _type), \ |
| 598 | 723 | TOKEN_STRING(_tag), |
| 599 | 724 | |
| 725 | #define AM_DEVWRITE8(_type, _tag, _handler, _unitmask) \ | |
| 726 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 8, 8, UNITMASK8(_unitmask), 8), \ | |
| 727 | TOKEN_PTR(dwrite8, _handler), \ | |
| 728 | TOKEN_STRING(#_handler), \ | |
| 729 | TOKEN_PTR(devtype, _type), \ | |
| 730 | TOKEN_STRING(_tag), | |
| 731 | ||
| 732 | #define AM_DEVWRITE16(_type, _tag, _handler, _unitmask) \ | |
| 733 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 16, 8, UNITMASK16(_unitmask), 8), \ | |
| 734 | TOKEN_PTR(dwrite16, _handler), \ | |
| 735 | TOKEN_STRING(#_handler), \ | |
| 736 | TOKEN_PTR(devtype, _type), \ | |
| 737 | TOKEN_STRING(_tag), | |
| 738 | ||
| 739 | #define AM_DEVWRITE32(_type, _tag, _handler, _unitmask) \ | |
| 740 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 32, 8, UNITMASK32(_unitmask), 8), \ | |
| 741 | TOKEN_PTR(dwrite32, _handler), \ | |
| 742 | TOKEN_STRING(#_handler), \ | |
| 743 | TOKEN_PTR(devtype, _type), \ | |
| 744 | TOKEN_STRING(_tag), | |
| 745 | ||
| 600 | 746 | #define AM_READ_PORT(_tag) \ |
| 601 | TOKEN_UINT32_PACK | |
| 747 | TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_READ_PORT, 8, 0, 8, 0, 8), \ | |
| 602 | 748 | TOKEN_STRING(_tag), |
| 603 | 749 | |
| 604 | 750 | #define AM_REGION(_region, _offs) \ |
| r2418 | r2419 | |
| 624 | 770 | |
| 625 | 771 | /* common shortcuts */ |
| 626 | 772 | #define AM_READWRITE(_read,_write) AM_READ(_read) AM_WRITE(_write) |
| 773 | #define AM_READWRITE8(_read,_write,_shift) AM_READ8(_read,_shift) AM_WRITE8(_write,_shift) | |
| 774 | #define AM_READWRITE16(_read,_write,_shift) AM_READ16(_read,_shift) AM_WRITE16(_write,_shift) | |
| 775 | #define AM_READWRITE32(_read,_write,_shift) AM_READ32(_read,_shift) AM_WRITE32(_write,_shift) | |
| 776 | ||
| 627 | 777 | #define AM_DEVREADWRITE(_type,_tag,_read,_write) AM_DEVREAD(_type,_tag,_read) AM_DEVWRITE(_type,_tag,_write) |
| 778 | #define AM_DEVREADWRITE8(_type,_tag,_read,_write,_shift) AM_DEVREAD8(_type,_tag,_read,_shift) AM_DEVWRITE8(_type,_tag,_write,_shift) | |
| 779 | #define AM_DEVREADWRITE16(_type,_tag,_read,_write,_shift) AM_DEVREAD16(_type,_tag,_read,_shift) AM_DEVWRITE16(_type,_tag,_write,_shift) | |
| 780 | #define AM_DEVREADWRITE32(_type,_tag,_read,_write,_shift) AM_DEVREAD32(_type,_tag,_read,_shift) AM_DEVWRITE32(_type,_tag,_write,_shift) | |
| 781 | ||
| 628 | 782 | #define AM_ROM AM_READ(SMH_ROM) |
| 783 | #define AM_ROMBANK(_bank) AM_READ(SMH_BANK(_bank)) | |
| 784 | ||
| 629 | 785 | #define AM_RAM AM_READWRITE(SMH_RAM, SMH_RAM) |
| 786 | #define AM_RAMBANK(_bank) AM_READWRITE(SMH_BANK(_bank), SMH_BANK(_bank)) | |
| 787 | #define AM_RAM_WRITE(_write) AM_READWRITE(SMH_RAM, _write) | |
| 630 | 788 | #define AM_WRITEONLY AM_WRITE(SMH_RAM) |
| 789 | ||
| 631 | 790 | #define AM_UNMAP AM_READWRITE(SMH_UNMAP, SMH_UNMAP) |
| 632 | #define AM_ROMBANK(_bank) AM_READ(SMH_BANK(_bank)) | |
| 633 | #define AM_RAMBANK(_bank) AM_READWRITE(SMH_BANK(_bank), SMH_BANK(_bank)) | |
| 634 | 791 | #define AM_NOP AM_READWRITE(SMH_NOP, SMH_NOP) |
| 635 | 792 | #define AM_READNOP AM_READ(SMH_NOP) |
| 636 | 793 | #define AM_WRITENOP AM_WRITE(SMH_NOP) |
| r2418 | r2419 | |
| 717 | 874 | int memory_get_log_unmap(int spacenum); |
| 718 | 875 | |
| 719 | 876 | /* dynamic address space mapping */ |
| 720 | void * _memory_install_read_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name); | |
| 721 | UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func handler, const char *handler_name); | |
| 722 | UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func handler, const char *handler_name); | |
| 723 | UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func handler, const char *handler_name); | |
| 724 | UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func handler, const char *handler_name); | |
| 725 | void * _memory_install_write_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name); | |
| 726 | UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_machine_func handler, const char *handler_name); | |
| 727 | UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_machine_func handler, const char *handler_name); | |
| 728 | UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_machine_func handler, const char *handler_name); | |
| 729 | UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_machine_func handler, const char *handler_name); | |
| 730 | void * _memory_install_readwrite_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name); | |
| 731 | UINT8 * _memory_install_readwrite8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 732 | UINT16 * _memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 733 | UINT32 * _memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 734 | UINT64 * _memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 877 | void * _memory_install_handler (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name); | |
| 878 | UINT8 * _memory_install_handler8 (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 879 | UINT16 * _memory_install_handler16(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 880 | UINT32 * _memory_install_handler32(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 881 | UINT64 * _memory_install_handler64(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 735 | 882 | |
| 883 | /* dynamic device address space mapping */ | |
| 884 | void * _memory_install_device_handler (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name); | |
| 885 | UINT8 * _memory_install_device_handler8 (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 886 | UINT16 * _memory_install_device_handler16(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 887 | UINT32 * _memory_install_device_handler32(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 888 | UINT64 * _memory_install_device_handler64(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 889 | ||
| 736 | 890 | /* memory debugging */ |
| 737 | 891 | void memory_dump(FILE *file); |
| 738 | 892 | const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t byteaddress); |
| r2418 | r2419 | |
|---|---|---|
| 156 | 156 | UINT8 single_scale; /* scale joystick differently if default is between min/max */ |
| 157 | 157 | UINT8 interpolate; /* should we do linear interpolation for mid-frame reads? */ |
| 158 | 158 | UINT8 lastdigital; /* was the last modification caused by a digital form? */ |
| 159 | UINT32 crosshair_pos; /* position of fake crosshair */ | |
| 160 | 159 | }; |
| 161 | 160 | |
| 162 | 161 | |
| r2418 | r2419 | |
| 3210 | 3209 | |
| 3211 | 3210 | /************************************* |
| 3212 | 3211 | * |
| 3212 | * Apply analogue port settings | |
| 3213 | * | |
| 3214 | *************************************/ | |
| 3215 | ||
| 3216 | INT32 apply_analogue_settings(INT32 current, analog_port_info *info) | |
| 3217 | { | |
| 3218 | INT32 value; | |
| 3219 | input_port_entry *portentry = info->portentry; | |
| 3220 | ||
| 3221 | /* apply the min/max and then the sensitivity */ | |
| 3222 | current = apply_analog_min_max(info, current); | |
| 3223 | current = APPLY_SENSITIVITY(current, portentry->analog.sensitivity); | |
| 3224 | ||
| 3225 | /* apply reversal if needed */ | |
| 3226 | if (portentry->analog.reverse) | |
| 3227 | current = info->reverse_val - current; | |
| 3228 | else if (info->single_scale) | |
| 3229 | /* it's a pedal or the default value is equal to min/max */ | |
| 3230 | /* so we need to adjust the center to the minimum */ | |
| 3231 | current -= INPUT_ABSOLUTE_MIN; | |
| 3232 | ||
| 3233 | /* map differently for positive and negative values */ | |
| 3234 | if (current >= 0) | |
| 3235 | value = APPLY_SCALE(current, info->scalepos); | |
| 3236 | else | |
| 3237 | value = APPLY_SCALE(current, info->scaleneg); | |
| 3238 | value += portentry->default_value; | |
| 3239 | ||
| 3240 | return value; | |
| 3241 | } | |
| 3242 | ||
| 3243 | ||
| 3244 | ||
| 3245 | /************************************* | |
| 3246 | * | |
| 3213 | 3247 | * Analog port interpolation |
| 3214 | 3248 | * |
| 3215 | 3249 | *************************************/ |
| r2418 | r2419 | |
| 3240 | 3274 | else |
| 3241 | 3275 | current = info->accum; |
| 3242 | 3276 | |
| 3243 | /* apply the min/max and then the sensitivity */ | |
| 3244 | current = apply_analog_min_max(info, current); | |
| 3245 | current = APPLY_SENSITIVITY(current, portentry->analog.sensitivity); | |
| 3277 | value = apply_analogue_settings(current, info); | |
| 3246 | 3278 | |
| 3247 | /* apply reversal if needed */ | |
| 3248 | if (portentry->analog.reverse) | |
| 3249 | current = info->reverse_val - current; | |
| 3250 | else if (info->single_scale) | |
| 3251 | /* it's a pedal or the default value is equal to min/max */ | |
| 3252 | /* so we need to adjust the center to the minimum */ | |
| 3253 | current -= INPUT_ABSOLUTE_MIN; | |
| 3254 | ||
| 3255 | /* map differently for positive and negative values */ | |
| 3256 | if (current >= 0) | |
| 3257 | value = APPLY_SCALE(current, info->scalepos); | |
| 3258 | else | |
| 3259 | value = APPLY_SCALE(current, info->scaleneg); | |
| 3260 | value += portentry->default_value; | |
| 3261 | ||
| 3262 | /* store crosshair position before any remapping */ | |
| 3263 | info->crosshair_pos = (INT32)value & (portentry->mask >> info->shift); | |
| 3264 | ||
| 3265 | 3279 | /* remap the value if needed */ |
| 3266 | 3280 | if (portentry->analog.remap_table) |
| 3267 | 3281 | value = info->portentry->analog.remap_table[value]; |
| r2418 | r2419 | |
| 3361 | 3375 | for (info = portinfo->analoginfo; info; info = info->next) |
| 3362 | 3376 | { |
| 3363 | 3377 | portentry = info->portentry; |
| 3364 | if (portentry->player == player && portentry->analog.crossaxis == axis) | |
| 3378 | if (portentry->player == player && portentry->analog.crossaxis == axis && input_port_condition(portentry)) | |
| 3365 | 3379 | { |
| 3366 | result = info->c | |
| 3380 | result = apply_analogue_settings(info->accum, info) & (portentry->mask >> inf | |
| 3367 | 3381 | break; |
| 3368 | 3382 | } |
| 3369 | 3383 | } |
| r2418 | r2419 | |
|---|---|---|
| 10 | 10 | #include "deprecat.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | /************************************* | |
| 14 | * | |
| 15 | * Debugging | |
| 16 | * | |
| 17 | *************************************/ | |
| 13 | /*************************************************************************** | |
| 14 | DEBUGGING | |
| 15 | ***************************************************************************/ | |
| 18 | 16 | |
| 19 | 17 | #define VERBOSE 0 |
| 20 | 18 | #define PRINTF_IDE_COMMANDS 0 |
| r2418 | r2419 | |
| 26 | 24 | |
| 27 | 25 | |
| 28 | 26 | |
| 29 | /************************************* | |
| 30 | * | |
| 31 | * Constants | |
| 32 | * | |
| 33 | *************************************/ | |
| 27 | /*************************************************************************** | |
| 28 | CONSTANTS | |
| 29 | ***************************************************************************/ | |
| 34 | 30 | |
| 35 | 31 | #define IDE_DISK_SECTOR_SIZE 512 |
| 36 | 32 | |
| r2418 | r2419 | |
| 97 | 93 | |
| 98 | 94 | |
| 99 | 95 | |
| 100 | /************************************* | |
| 101 | * | |
| 102 | * Type definitions | |
| 103 | * | |
| 104 | *************************************/ | |
| 96 | /*************************************************************************** | |
| 97 | TYPE DEFINITIONS | |
| 98 | ***************************************************************************/ | |
| 105 | 99 | |
| 106 | struct ide_state | |
| 100 | typedef struct _ide_state ide_state; | |
| 101 | struct _ide_state | |
| 107 | 102 | { |
| 108 | UINT8 adapter_control; | |
| 109 | UINT8 status; | |
| 110 | UINT8 error; | |
| 111 | UINT8 command; | |
| 112 | UINT8 interrupt_pending; | |
| 113 | UINT8 precomp_offset; | |
| 103 | const device_config *device; | |
| 114 | 104 | |
| 115 | UINT8 buffer[IDE_DISK_SECTOR_SIZE]; | |
| 116 | UINT8 features[IDE_DISK_SECTOR_SIZE]; | |
| 117 | UINT16 buffer_offset; | |
| 118 | UINT16 sector_count; | |
| 105 | UINT8 adapter_control; | |
| 106 | UINT8 status; | |
| 107 | UINT8 error; | |
| 108 | UINT8 command; | |
| 109 | UINT8 interrupt_pending; | |
| 110 | UINT8 precomp_offset; | |
| 119 | 111 | |
| 120 | UINT16 block_count; | |
| 121 | UINT16 sectors_until_int; | |
| 122 | UINT8 verify_only; | |
| 112 | UINT8 buffer[IDE_DISK_SECTOR_SIZE]; | |
| 113 | UINT8 features[IDE_DISK_SECTOR_SIZE]; | |
| 114 | UINT16 buffer_offset; | |
| 115 | UINT16 sector_count; | |
| 123 | 116 | |
| 124 | UINT8 dma_active; | |
| 125 | UINT8 dma_cpu; | |
| 126 | UINT8 dma_address_xor; | |
| 127 | UINT8 dma_last_buffer; | |
| 128 | offs_t dma_address; | |
| 129 | offs_t dma_descriptor; | |
| 130 | UINT32 dma_bytes_left; | |
| 117 | UINT16 block_count; | |
| 118 | UINT16 sectors_until_int; | |
| 119 | UINT8 verify_only; | |
| 131 | 120 | |
| 132 | UINT8 bus_master_command; | |
| 133 | UINT8 bus_master_status; | |
| 134 | UINT32 bus_master_descriptor; | |
| 121 | UINT8 dma_active; | |
| 122 | UINT8 dma_cpu; | |
| 123 | UINT8 dma_address_xor; | |
| 124 | UINT8 dma_last_buffer; | |
| 125 | offs_t dma_address; | |
| 126 | offs_t dma_descriptor; | |
| 127 | UINT32 dma_bytes_left; | |
| 135 | 128 | |
| 136 | UINT16 cur_cylinder; | |
| 137 | UINT8 cur_sector; | |
| 138 | UINT8 cur_head; | |
| 139 | UINT8 cur_head_reg; | |
| 129 | UINT8 bus_master_command; | |
| 130 | UINT8 bus_master_status; | |
| 131 | UINT32 bus_master_descriptor; | |
| 140 | 132 | |
| 141 | UINT32 cur_lba; | |
| 133 | UINT16 cur_cylinder; | |
| 134 | UINT8 cur_sector; | |
| 135 | UINT8 cur_head; | |
| 136 | UINT8 cur_head_reg; | |
| 142 | 137 | |
| 143 | UINT16 num_cylinders; | |
| 144 | UINT8 num_sectors; | |
| 145 | UINT8 num_heads; | |
| 138 | UINT32 cur_lba; | |
| 146 | 139 | |
| 147 | UINT8 config_unknown; | |
| 148 | UINT8 config_register[IDE_CONFIG_REGISTERS]; | |
| 149 | UINT8 config_register_num; | |
| 140 | UINT16 num_cylinders; | |
| 141 | UINT8 num_sectors; | |
| 142 | UINT8 num_heads; | |
| 150 | 143 | |
| 151 | const struct ide_interface *intf; | |
| 152 | hard_disk_file * disk; | |
| 153 | emu_timer * last_status_timer; | |
| 154 | emu_timer * reset_timer; | |
| 144 | UINT8 config_unknown; | |
| 145 | UINT8 config_register[IDE_CONFIG_REGISTERS]; | |
| 146 | UINT8 config_register_num; | |
| 155 | 147 | |
| 156 | UINT8 master_password_enable; | |
| 157 | UINT8 user_password_enable; | |
| 148 | hard_disk_file *disk; | |
| 149 | emu_timer * last_status_timer; | |
| 150 | emu_timer * reset_timer; | |
| 151 | ||
| 152 | UINT8 master_password_enable; | |
| 153 | UINT8 user_password_enable; | |
| 158 | 154 | const UINT8 * master_password; |
| 159 | 155 | const UINT8 * user_password; |
| 160 | 156 | }; |
| 161 | 157 | |
| 162 | 158 | |
| 163 | 159 | |
| 164 | /************************************* | |
| 165 | * | |
| 166 | * Local variables | |
| 167 | * | |
| 168 | *************************************/ | |
| 160 | /*************************************************************************** | |
| 161 | FUNCTION PROTOTYPES | |
| 162 | ***************************************************************************/ | |
| 169 | 163 | |
| 170 | static | |
| 164 | static T | |
| 171 | 165 | |
| 166 | static void ide_build_features(ide_state *ide); | |
| 172 | 167 | |
| 168 | static void continue_read(ide_state *ide); | |
| 169 | static void read_sector_done(ide_state *ide); | |
| 170 | static TIMER_CALLBACK( read_sector_done_callback ); | |
| 171 | static void read_first_sector(ide_state *ide); | |
| 172 | static void read_next_sector(ide_state *ide); | |
| 173 | 173 | |
| 174 | /************************************* | |
| 175 | * | |
| 176 | * Prototypes | |
| 177 | * | |
| 178 | *************************************/ | |
| 174 | static UINT32 ide_controller_read(const device_config *device, offs_t offset, int size); | |
| 175 | static void ide_controller_write(const device_config *device, offs_t offset, int size, UINT32 data); | |
| 179 | 176 | |
| 180 | static TIMER_CALLBACK( reset_callback ); | |
| 181 | 177 | |
| 182 | static void ide_build_features(struct ide_state *ide); | |
| 183 | 178 | |
| 184 | static void continue_read(struct ide_state *ide); | |
| 185 | static void read_sector_done(struct ide_state *ide); | |
| 186 | static TIMER_CALLBACK( read_sector_done_callback ); | |
| 187 | static void read_first_sector(struct ide_state *ide); | |
| 188 | static void read_next_sector(struct ide_state *ide); | |
| 179 | /*************************************************************************** | |
| 180 | INLINE FUNCTIONS | |
| 181 | ***************************************************************************/ | |
| 189 | 182 | |
| 190 | static UINT32 ide_controller_read(struct ide_state *ide, offs_t offset, int size); | |
| 191 | static void ide_controller_write(struct ide_state *ide, offs_t offset, int size, UINT32 data); | |
| 183 | /*------------------------------------------------- | |
| 184 | get_safe_token - makes sure that the passed | |
| 185 | in device is, in fact, an IDE controller | |
| 186 | -------------------------------------------------*/ | |
| 192 | 187 | |
| 188 | INLINE ide_state *get_safe_token(const device_config *device) | |
| 189 | { | |
| 190 | assert(device != NULL); | |
| 191 | assert(device->token != NULL); | |
| 192 | assert(device->type == IDE_CONTROLLER); | |
| 193 | 193 | |
| 194 | return (ide_state *)device->token; | |
| 195 | } | |
| 194 | 196 | |
| 195 | /************************************* | |
| 196 | * | |
| 197 | * Interrupts | |
| 198 | * | |
| 199 | *************************************/ | |
| 200 | 197 | |
| 201 | INLINE void signal_interrupt( | |
| 198 | INLINE void signal_interrupt( | |
| 202 | 199 | { |
| 200 | const ide_config *config = ide->device->inline_config; | |
| 201 | ||
| 203 | 202 | LOG(("IDE interrupt assert\n")); |
| 204 | 203 | |
| 205 | 204 | /* signal an interrupt */ |
| 206 | if (ide->intf->interrupt) | |
| 207 | (*ide->intf->interrupt)(ASSERT_LINE); | |
| 205 | if (config->interrupt != NULL) | |
| 206 | (*config->interrupt)(ide->device, ASSERT_LINE); | |
| 208 | 207 | ide->interrupt_pending = 1; |
| 209 | 208 | ide->bus_master_status |= IDE_BUSMASTER_STATUS_IRQ; |
| 210 | 209 | } |
| 211 | 210 | |
| 212 | 211 | |
| 213 | INLINE void clear_interrupt( | |
| 212 | INLINE void clear_interrupt( | |
| 214 | 213 | { |
| 214 | const ide_config *config = ide->device->inline_config; | |
| 215 | ||
| 215 | 216 | LOG(("IDE interrupt clear\n")); |
| 216 | 217 | |
| 217 | 218 | /* clear an interrupt */ |
| 218 | if (ide->intf->interrupt) | |
| 219 | (*ide->intf->interrupt)(CLEAR_LINE); | |
| 219 | if (config->interrupt != NULL) | |
| 220 | (*config->interrupt)(ide->device, CLEAR_LINE); | |
| 220 | 221 | ide->interrupt_pending = 0; |
| 221 | 222 | } |
| 222 | 223 | |
| 223 | 224 | |
| 224 | 225 | |
| 225 | /************************************* | |
| 226 | * | |
| 227 | * Delayed interrupt handling | |
| 228 | * | |
| 229 | *************************************/ | |
| 226 | /*************************************************************************** | |
| 227 | DELAYED INTERRUPT HANDLING | |
| 228 | ***************************************************************************/ | |
| 230 | 229 | |
| 231 | 230 | static TIMER_CALLBACK( delayed_interrupt ) |
| 232 | 231 | { |
| 233 | | |
| 232 | | |
| 234 | 233 | ide->status &= ~IDE_STATUS_BUSY; |
| 235 | 234 | signal_interrupt(ide); |
| 236 | 235 | } |
| r2418 | r2419 | |
| 238 | 237 | |
| 239 | 238 | static TIMER_CALLBACK( delayed_interrupt_buffer_ready ) |
| 240 | 239 | { |
| 241 | | |
| 240 | | |
| 242 | 241 | ide->status &= ~IDE_STATUS_BUSY; |
| 243 | 242 | ide->status |= IDE_STATUS_BUFFER_READY; |
| 244 | 243 | signal_interrupt(ide); |
| 245 | 244 | } |
| 246 | 245 | |
| 247 | 246 | |
| 248 | INLINE void signal_delayed_interrupt( | |
| 247 | INLINE void signal_delayed_interrupt( | |
| 249 | 248 | { |
| 250 | 249 | /* clear buffer ready and set the busy flag */ |
| 251 | 250 | ide->status &= ~IDE_STATUS_BUFFER_READY; |
| r2418 | r2419 | |
| 260 | 259 | |
| 261 | 260 | |
| 262 | 261 | |
| 263 | /************************************* | |
| 264 | * | |
| 265 | * Initialization & reset | |
| 266 | * | |
| 267 | *************************************/ | |
| 262 | /*************************************************************************** | |
| 263 | INITIALIZATION AND RESET | |
| 264 | ***************************************************************************/ | |
| 268 | 265 | |
| 269 | ||
| 266 | UINT8 | |
| 270 | 267 | { |
| 271 | int i; | |
| 272 | ||
| 273 | /* close all open hard disks */ | |
| 274 | for (i = 0; i < MAX_IDE_CONTROLLERS; i++) | |
| 275 | if (idestate[i].disk) | |
| 276 | { | |
| 277 | hard_disk_close(idestate[i].disk); | |
| 278 | idestate[i].disk = NULL; | |
| 279 | } | |
| 280 | } | |
| 281 | ||
| 282 | ||
| 283 | int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle) | |
| 284 | { | |
| 285 | struct ide_state *ide = &idestate[which]; | |
| 286 | const hard_disk_info *hdinfo; | |
| 287 | ||
| 288 | /* must be called during init phase */ | |
| 289 | assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "ide_controller_init can only be called at init time"); | |
| 290 | add_exit_callback(Machine, ide_controller_exit); | |
| 291 | ||
| 292 | /* NULL interface is immediate failure */ | |
| 293 | if (!intf) | |
| 294 | return 1; | |
| 295 | ||
| 296 | /* reset the IDE state */ | |
| 297 | memset(ide, 0, sizeof(*ide)); | |
| 298 | ide->intf = intf; | |
| 299 | ||
| 300 | /* set MAME harddisk handle */ | |
| 301 | ide->disk = hard_disk_open(diskhandle); | |
| 302 | ||
| 303 | /* get and copy the geometry */ | |
| 304 | if (ide->disk) | |
| 305 | { | |
| 306 | hdinfo = hard_disk_get_info(ide->disk); | |
| 307 | ide->num_cylinders = hdinfo->cylinders; | |
| 308 | ide->num_sectors = hdinfo->sectors; | |
| 309 | ide->num_heads = hdinfo->heads; | |
| 310 | if (hdinfo->sectorbytes != IDE_DISK_SECTOR_SIZE) | |
| 311 | /* wrong sector len */ | |
| 312 | return 1; | |
| 313 | #if PRINTF_IDE_COMMANDS | |
| 314 | mame_printf_debug("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors); | |
| 315 | #endif | |
| 316 | } | |
| 317 | ||
| 318 | /* build the features page */ | |
| 319 | ide_build_features(ide); | |
| 320 | ||
| 321 | /* create a timer for timing status */ | |
| 322 | ide->last_status_timer = timer_alloc(NULL, NULL); | |
| 323 | ide->reset_timer = timer_alloc(reset_callback, ide); | |
| 324 | ||
| 325 | /* register ide status */ | |
| 326 | state_save_register_item("ide", which, ide->adapter_control); | |
| 327 | state_save_register_item("ide", which, ide->status); | |
| 328 | state_save_register_item("ide", which, ide->error); | |
| 329 | state_save_register_item("ide", which, ide->command); | |
| 330 | state_save_register_item("ide", which, ide->interrupt_pending); | |
| 331 | state_save_register_item("ide", which, ide->precomp_offset); | |
| 332 | ||
| 333 | state_save_register_item_array("ide", which, ide->buffer); | |
| 334 | state_save_register_item_array("ide", which, ide->features); | |
| 335 | state_save_register_item("ide", which, ide->buffer_offset); | |
| 336 | state_save_register_item("ide", which, ide->sector_count); | |
| 337 | ||
| 338 | state_save_register_item("ide", which, ide->block_count); | |
| 339 | state_save_register_item("ide", which, ide->sectors_until_int); | |
| 340 | ||
| 341 | state_save_register_item("ide", which, ide->dma_active); | |
| 342 | state_save_register_item("ide", which, ide->dma_cpu); | |
| 343 | state_save_register_item("ide", which, ide->dma_address_xor); | |
| 344 | state_save_register_item("ide", which, ide->dma_last_buffer); | |
| 345 | state_save_register_item("ide", which, ide->dma_address); | |
| 346 | state_save_register_item("ide", which, ide->dma_descriptor); | |
| 347 | state_save_register_item("ide", which, ide->dma_bytes_left); | |
| 348 | ||
| 349 | state_save_register_item("ide", which, ide->bus_master_command); | |
| 350 | state_save_register_item("ide", which, ide->bus_master_status); | |
| 351 | state_save_register_item("ide", which, ide->bus_master_descriptor); | |
| 352 | ||
| 353 | state_save_register_item("ide", which, ide->cur_cylinder); | |
| 354 | state_save_register_item("ide", which, ide->cur_sector); | |
| 355 | state_save_register_item("ide", which, ide->cur_head); | |
| 356 | state_save_register_item("ide", which, ide->cur_head_reg); | |
| 357 | ||
| 358 | state_save_register_item("ide", which, ide->cur_lba); | |
| 359 | ||
| 360 | state_save_register_item("ide", which, ide->num_cylinders); | |
| 361 | state_save_register_item("ide", which, ide->num_sectors); | |
| 362 | state_save_register_item("ide", which, ide->num_heads); | |
| 363 | ||
| 364 | state_save_register_item("ide", which, ide->config_unknown); | |
| 365 | state_save_register_item_array("ide", which, ide->config_register); | |
| 366 | state_save_register_item("ide", which, ide->config_register_num); | |
| 367 | ||
| 368 | state_save_register_item("ide", which, ide->master_password_enable); | |
| 369 | state_save_register_item("ide", which, ide->user_password_enable); | |
| 370 | ||
| 371 | return 0; | |
| 372 | } | |
| 373 | ||
| 374 | int ide_controller_init(int which, const struct ide_interface *intf) | |
| 375 | { | |
| 376 | /* we only support one hard disk right now; get a handle to it */ | |
| 377 | return ide_controller_init_custom(which, intf, get_disk_handle(0)); | |
| 378 | } | |
| 379 | ||
| 380 | ||
| 381 | static void ide_controller_reset_ptr(struct ide_state *ide) | |
| 382 | { | |
| 383 | LOG(("IDE controller reset performed\n")); | |
| 384 | ||
| 385 | /* reset the drive state */ | |
| 386 | ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE; | |
| 387 | ide->error = IDE_ERROR_DEFAULT; | |
| 388 | ide->buffer_offset = 0; | |
| 389 | ide->master_password_enable = (ide->master_password != NULL); | |
| 390 | ide->user_password_enable = (ide->user_password != NULL); | |
| 391 | clear_interrupt(ide); | |
| 392 | } | |
| 393 | ||
| 394 | ||
| 395 | void ide_controller_reset(int which) | |
| 396 | { | |
| 397 | ide_controller_reset_ptr(&idestate[which]); | |
| 398 | } | |
| 399 | ||
| 400 | ||
| 401 | UINT8 *ide_get_features(int which) | |
| 402 | { | |
| 403 | struct ide_state *ide = &idestate[which]; | |
| 268 | ide_state *ide = get_safe_token(device); | |
| 404 | 269 | return ide->features; |
| 405 | 270 | } |
| 406 | 271 | |
| 407 | 272 | |
| 408 | void ide_set_master_password( | |
| 273 | void ide_set_master_password(const device_config *device, const UINT8 *password) | |
| 409 | 274 | { |
| 410 | | |
| 275 | | |
| 411 | 276 | |
| 412 | 277 | ide->master_password = password; |
| 413 | 278 | ide->master_password_enable = (ide->master_password != NULL); |
| 414 | 279 | } |
| 415 | 280 | |
| 416 | 281 | |
| 417 | void ide_set_user_password( | |
| 282 | void ide_set_user_password(const device_config *device, const UINT8 *password) | |
| 418 | 283 | { |
| 419 | | |
| 284 | | |
| 420 | 285 | |
| 421 | 286 | ide->user_password = password; |
| 422 | 287 | ide->user_password_enable = (ide->user_password != NULL); |
| r2418 | r2419 | |
| 425 | 290 | |
| 426 | 291 | static TIMER_CALLBACK( reset_callback ) |
| 427 | 292 | { |
| 428 | | |
| 293 | | |
| 429 | 294 | } |
| 430 | 295 | |
| 431 | 296 | |
| r2418 | r2419 | |
| 488 | 353 | * |
| 489 | 354 | *************************************/ |
| 490 | 355 | |
| 491 | INLINE UINT32 lba_address( | |
| 356 | INLINE UINT32 lba_address( | |
| 492 | 357 | { |
| 493 | 358 | /* LBA direct? */ |
| 494 | 359 | if (ide->cur_head_reg & 0x40) |
| r2418 | r2419 | |
| 507 | 372 | * |
| 508 | 373 | *************************************/ |
| 509 | 374 | |
| 510 | INLINE void next_sector( | |
| 375 | INLINE void next_sector( | |
| 511 | 376 | { |
| 512 | 377 | /* LBA direct? */ |
| 513 | 378 | if (ide->cur_head_reg & 0x40) |
| r2418 | r2419 | |
| 561 | 426 | } |
| 562 | 427 | |
| 563 | 428 | |
| 564 | static void ide_build_features( | |
| 429 | static void ide_build_features( | |
| 565 | 430 | { |
| 566 | 431 | int total_sectors = ide->num_cylinders * ide->num_heads * ide->num_sectors; |
| 567 | 432 | int sectors_per_track = ide->num_heads * ide->num_sectors; |
| r2418 | r2419 | |
| 729 | 594 | |
| 730 | 595 | static TIMER_CALLBACK( security_error_done ) |
| 731 | 596 | { |
| 732 | | |
| 597 | | |
| 733 | 598 | |
| 734 | 599 | /* clear error state */ |
| 735 | 600 | ide->status &= ~IDE_STATUS_ERROR; |
| 736 | 601 | ide->status |= IDE_STATUS_DRIVE_READY; |
| 737 | 602 | } |
| 738 | 603 | |
| 739 | static void security_error( | |
| 604 | static void security_error( | |
| 740 | 605 | { |
| 741 | 606 | /* set error state */ |
| 742 | 607 | ide->status |= IDE_STATUS_ERROR; |
| r2418 | r2419 | |
| 754 | 619 | * |
| 755 | 620 | *************************************/ |
| 756 | 621 | |
| 757 | static void continue_read( | |
| 622 | static void continue_read( | |
| 758 | 623 | { |
| 759 | 624 | /* reset the totals */ |
| 760 | 625 | ide->buffer_offset = 0; |
| r2418 | r2419 | |
| 787 | 652 | } |
| 788 | 653 | |
| 789 | 654 | |
| 790 | static void write_buffer_to_dma( | |
| 655 | static void write_buffer_to_dma( | |
| 791 | 656 | { |
| 792 | 657 | int bytesleft = IDE_DISK_SECTOR_SIZE; |
| 793 | 658 | UINT8 *data = ide->buffer; |
| r2418 | r2419 | |
| 834 | 699 | } |
| 835 | 700 | |
| 836 | 701 | |
| 837 | static void read_sector_done( | |
| 702 | static void read_sector_done( | |
| 838 | 703 | { |
| 839 | 704 | int lba = lba_address(ide), count = 0; |
| 840 | 705 | |
| r2418 | r2419 | |
| 901 | 766 | } |
| 902 | 767 | |
| 903 | 768 | |
| 904 | static void read_first_sector( | |
| 769 | static void read_first_sector( | |
| 905 | 770 | { |
| 906 | 771 | /* mark ourselves busy */ |
| 907 | 772 | ide->status |= IDE_STATUS_BUSY; |
| r2418 | r2419 | |
| 925 | 790 | } |
| 926 | 791 | |
| 927 | 792 | |
| 928 | static void read_next_sector( | |
| 793 | static void read_next_sector( | |
| 929 | 794 | { |
| 930 | 795 | /* mark ourselves busy */ |
| 931 | 796 | ide->status |= IDE_STATUS_BUSY; |
| r2418 | r2419 | |
| 952 | 817 | * |
| 953 | 818 | *************************************/ |
| 954 | 819 | |
| 955 | static void write_sector_done( | |
| 820 | static void write_sector_done( | |
| 956 | 821 | static TIMER_CALLBACK( write_sector_done_callback ); |
| 957 | 822 | |
| 958 | static void continue_write( | |
| 823 | static void continue_write( | |
| 959 | 824 | { |
| 960 | 825 | /* reset the totals */ |
| 961 | 826 | ide->buffer_offset = 0; |
| r2418 | r2419 | |
| 985 | 850 | } |
| 986 | 851 | |
| 987 | 852 | |
| 988 | static void read_buffer_from_dma( | |
| 853 | static void read_buffer_from_dma( | |
| 989 | 854 | { |
| 990 | 855 | int bytesleft = IDE_DISK_SECTOR_SIZE; |
| 991 | 856 | UINT8 *data = ide->buffer; |
| r2418 | r2419 | |
| 1032 | 897 | } |
| 1033 | 898 | |
| 1034 | 899 | |
| 1035 | static void write_sector_done( | |
| 900 | static void write_sector_done( | |
| 1036 | 901 | { |
| 1037 | 902 | int lba = lba_address(ide), count = 0; |
| 1038 | 903 | |
| r2418 | r2419 | |
| 1110 | 975 | * |
| 1111 | 976 | *************************************/ |
| 1112 | 977 | |
| 1113 | static void handle_command( | |
| 978 | static void handle_command( | |
| 1114 | 979 | { |
| 1115 | 980 | /* implicitly clear interrupts here */ |
| 1116 | 981 | clear_interrupt(ide); |
| r2418 | r2419 | |
| 1309 | 1174 | * |
| 1310 | 1175 | *************************************/ |
| 1311 | 1176 | |
| 1312 | static UINT32 ide_controller_read(st | |
| 1177 | static UINT32 ide_controller_read(const | |
| 1313 | 1178 | { |
| 1179 | ide_state *ide = get_safe_token(device); | |
| 1314 | 1180 | UINT32 result = 0; |
| 1315 | 1181 | |
| 1316 | 1182 | /* logit */ |
| r2418 | r2419 | |
| 1420 | 1286 | * |
| 1421 | 1287 | *************************************/ |
| 1422 | 1288 | |
| 1423 | static void ide_controller_write(st | |
| 1289 | static void ide_controller_write(const | |
| 1424 | 1290 | { |
| 1291 | ide_state *ide = get_safe_token(device); | |
| 1292 | ||
| 1425 | 1293 | /* logit */ |
| 1426 | 1294 | if (offset != IDE_ADDR_DATA) |
| 1427 | 1295 | LOG(("%08X:IDE write to %03X = %08X, size=%d\n", activecpu_get_previouspc(), offset, data, size)); |
| r2418 | r2419 | |
| 1568 | 1436 | * |
| 1569 | 1437 | *************************************/ |
| 1570 | 1438 | |
| 1571 | static UINT32 ide_bus_master_read(st | |
| 1439 | static UINT32 ide_bus_master_read(const | |
| 1572 | 1440 | { |
| 1441 | ide_state *ide = get_safe_token(device); | |
| 1442 | ||
| 1573 | 1443 | LOG(("%08X:ide_bus_master_read(%d, %d)\n", activecpu_get_previouspc(), offset, size)); |
| 1574 | 1444 | |
| 1575 | 1445 | /* command register */ |
| r2418 | r2419 | |
| 1595 | 1465 | * |
| 1596 | 1466 | *************************************/ |
| 1597 | 1467 | |
| 1598 | static void ide_bus_master_write(st | |
| 1468 | static void ide_bus_master_write(const | |
| 1599 | 1469 | { |
| 1470 | ide_state *ide = get_safe_token(device); | |
| 1471 | ||
| 1600 | 1472 | LOG(("%08X:ide_bus_master_write(%d, %d, %08X)\n", activecpu_get_previouspc(), offset, size, data)); |
| 1601 | 1473 | |
| 1602 | 1474 | /* command register */ |
| r2418 | r2419 | |
| 1663 | 1535 | *************************************/ |
| 1664 | 1536 | |
| 1665 | 1537 | /* |
| 1666 | ide_bus_ | |
| 1538 | ide_bus_ | |
| 1667 | 1539 | |
| 1668 | 1540 | Read a 16-bit word from the IDE bus directly. |
| 1669 | 1541 | |
| 1670 | 1542 | select: 0->CS1Fx active, 1->CS3Fx active |
| 1671 | 1543 | offset: register offset (state of DA2-DA0) |
| 1672 | 1544 | */ |
| 1673 | int ide_bus_ | |
| 1545 | int ide_bus_ | |
| 1674 | 1546 | { |
| 1675 | 1547 | offset += select ? 0x3f0 : 0x1f0; |
| 1676 | return ide_controller_read( | |
| 1548 | return ide_controller_read( | |
| 1677 | 1549 | } |
| 1678 | 1550 | |
| 1679 | 1551 | /* |
| 1680 | ide_bus_ | |
| 1552 | ide_bus_ | |
| 1681 | 1553 | |
| 1682 | 1554 | Write a 16-bit word to the IDE bus directly. |
| 1683 | 1555 | |
| r2418 | r2419 | |
| 1685 | 1557 | offset: register offset (state of DA2-DA0) |
| 1686 | 1558 | data: data written (state of D0-D15 or D0-D7) |
| 1687 | 1559 | */ |
| 1688 | void ide_bus_ | |
| 1560 | void ide_bus_ | |
| 1689 | 1561 | { |
| 1690 | 1562 | offset += select ? 0x3f0 : 0x1f0; |
| 1691 | 1563 | if (offset == 0x1f0) |
| 1692 | ide_controller_write( | |
| 1564 | ide_controller_write( | |
| 1693 | 1565 | else |
| 1694 | ide_controller_write( | |
| 1566 | ide_controller_write( | |
| 1695 | 1567 | } |
| 1696 | 1568 | |
| 1697 | int ide_controller_ | |
| 1569 | int ide_controller_ | |
| 1698 | 1570 | { |
| 1699 | return ide_controller_read( | |
| 1571 | return ide_controller_read( | |
| 1700 | 1572 | } |
| 1701 | 1573 | |
| 1702 | void ide_controller_ | |
| 1574 | void ide_controller_ | |
| 1703 | 1575 | { |
| 1704 | ide_controller_write( | |
| 1576 | ide_controller_write( | |
| 1705 | 1577 | } |
| 1706 | 1578 | |
| 1707 | 1579 | |
| r2418 | r2419 | |
| 1711 | 1583 | * |
| 1712 | 1584 | *************************************/ |
| 1713 | 1585 | |
| 1714 | READ32_HANDLER( ide_controller32 | |
| 1586 | READ32_DEVICE_HANDLER( ide_controller32 | |
| 1715 | 1587 | { |
| 1716 | 1588 | int size; |
| 1717 | 1589 | |
| 1718 | 1590 | offset *= 4; |
| 1719 | 1591 | size = convert_to_offset_and_size32(&offset, mem_mask); |
| 1720 | 1592 | |
| 1721 | return ide_controller_read( | |
| 1593 | return ide_controller_read( | |
| 1722 | 1594 | } |
| 1723 | 1595 | |
| 1724 | 1596 | |
| 1725 | WRITE32_HANDLER( ide_controller32 | |
| 1597 | WRITE32_DEVICE_HANDLER( ide_controller32 | |
| 1726 | 1598 | { |
| 1727 | 1599 | int size; |
| 1728 | 1600 | |
| 1729 | 1601 | offset *= 4; |
| 1730 | 1602 | size = convert_to_offset_and_size32(&offset, mem_mask); |
| 1731 | 1603 | |
| 1732 | ide_controller_write( | |
| 1604 | ide_controller_write( | |
| 1733 | 1605 | } |
| 1734 | 1606 | |
| 1735 | 1607 | |
| 1736 | READ32_HANDLER( ide_bus_master32 | |
| 1608 | READ32_DEVICE_HANDLER( ide_bus_master32 | |
| 1737 | 1609 | { |
| 1738 | 1610 | int size; |
| 1739 | 1611 | |
| 1740 | 1612 | offset *= 4; |
| 1741 | 1613 | size = convert_to_offset_and_size32(&offset, mem_mask); |
| 1742 | 1614 | |
| 1743 | return ide_bus_master_read( | |
| 1615 | return ide_bus_master_read( | |
| 1744 | 1616 | } |
| 1745 | 1617 | |
| 1746 | 1618 | |
| 1747 | WRITE32_HANDLER( ide_bus_master32 | |
| 1619 | WRITE32_DEVICE_HANDLER( ide_bus_master32 | |
| 1748 | 1620 | { |
| 1749 | 1621 | int size; |
| 1750 | 1622 | |
| 1751 | 1623 | offset *= 4; |
| 1752 | 1624 | size = convert_to_offset_and_size32(&offset, mem_mask); |
| 1753 | 1625 | |
| 1754 | ide_bus_master_write( | |
| 1626 | ide_bus_master_write( | |
| 1755 | 1627 | } |
| 1756 | 1628 | |
| 1757 | 1629 | |
| r2418 | r2419 | |
| 1762 | 1634 | * |
| 1763 | 1635 | *************************************/ |
| 1764 | 1636 | |
| 1765 | READ16_HANDLER( ide_controller16 | |
| 1637 | READ16_DEVICE_HANDLER( ide_controller16 | |
| 1766 | 1638 | { |
| 1767 | 1639 | int size; |
| 1768 | 1640 | |
| 1769 | 1641 | offset *= 2; |
| 1770 | 1642 | size = convert_to_offset_and_size16(&offset, mem_mask); |
| 1771 | 1643 | |
| 1772 | return ide_controller_read( | |
| 1644 | return ide_controller_read( | |
| 1773 | 1645 | } |
| 1774 | 1646 | |
| 1775 | 1647 | |
| 1776 | WRITE16_HANDLER( ide_controller16 | |
| 1648 | WRITE16_DEVICE_HANDLER( ide_controller16 | |
| 1777 | 1649 | { |
| 1778 | 1650 | int size; |
| 1779 | 1651 | |
| 1780 | 1652 | offset *= 2; |
| 1781 | 1653 | size = convert_to_offset_and_size16(&offset, mem_mask); |
| 1782 | 1654 | |
| 1783 | ide_controller_write( | |
| 1655 | ide_controller_write( | |
| 1784 | 1656 | } |
| 1657 | ||
| 1658 | ||
| 1659 | ||
| 1660 | /*************************************************************************** | |
| 1661 | DEVICE INTERFACE | |
| 1662 | ***************************************************************************/ | |
| 1663 | ||
| 1664 | /*------------------------------------------------- | |
| 1665 | device start callback | |
| 1666 | -------------------------------------------------*/ | |
| 1667 | ||
| 1668 | static DEVICE_START( ide_controller ) | |
| 1669 | { | |
| 1670 | ide_state *ide = get_safe_token(device); | |
| 1671 | const hard_disk_info *hdinfo; | |
| 1672 | const ide_config *config; | |
| 1673 | char unique_tag[50]; | |
| 1674 | ||
| 1675 | /* validate some basic stuff */ | |
| 1676 | assert(device != NULL); | |
| 1677 | assert(device->static_config == NULL); | |
| 1678 | assert(device->inline_config != NULL); | |
| 1679 | assert(device->machine != NULL); | |
| 1680 | assert(device->machine->config != NULL); | |
| 1681 | ||
| 1682 | /* store a pointer back to the device */ | |
| 1683 | ide->device = device; | |
| 1684 | ||
| 1685 | /* set MAME harddisk handle */ | |
| 1686 | config = device->inline_config; | |
| 1687 | ide->disk = hard_disk_open(get_disk_handle(config->disknum)); | |
| 1688 | ||
| 1689 | /* get and copy the geometry */ | |
| 1690 | if (ide->disk != NULL) | |
| 1691 | { | |
| 1692 | hdinfo = hard_disk_get_info(ide->disk); | |
| 1693 | if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) | |
| 1694 | { | |
| 1695 | ide->num_cylinders = hdinfo->cylinders; | |
| 1696 | ide->num_sectors = hdinfo->sectors; | |
| 1697 | ide->num_heads = hdinfo->heads; | |
| 1698 | #if PRINTF_IDE_COMMANDS | |
| 1699 | mame_printf_debug("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors); | |
| 1700 | #endif | |
| 1701 | } | |
| 1702 | } | |
| 1703 | ||
| 1704 | /* build the features page */ | |
| 1705 | ide_build_features(ide); | |
| 1706 | ||
| 1707 | /* create a timer for timing status */ | |
| 1708 | ide->last_status_timer = timer_alloc(NULL, NULL); | |
| 1709 | ide->reset_timer = timer_alloc(reset_callback, (void *)device); | |
| 1710 | ||
| 1711 | /* create the name for save states */ | |
| 1712 | assert(strlen(device->tag) < 30); | |
| 1713 | state_save_combine_module_and_tag(unique_tag, "ide_controller", device->tag); | |
| 1714 | ||
| 1715 | /* register ide states */ | |
| 1716 | state_save_register_item(unique_tag, 0, ide->adapter_control); | |
| 1717 | state_save_register_item(unique_tag, 0, ide->status); | |
| 1718 | state_save_register_item(unique_tag, 0, ide->error); | |
| 1719 | state_save_register_item(unique_tag, 0, ide->command); | |
| 1720 | state_save_register_item(unique_tag, 0, ide->interrupt_pending); | |
| 1721 | state_save_register_item(unique_tag, 0, ide->precomp_offset); | |
| 1722 | ||
| 1723 | state_save_register_item_array(unique_tag, 0, ide->buffer); | |
| 1724 | state_save_register_item_array(unique_tag, 0, ide->features); | |
| 1725 | state_save_register_item(unique_tag, 0, ide->buffer_offset); | |
| 1726 | state_save_register_item(unique_tag, 0, ide->sector_count); | |
| 1727 | ||
| 1728 | state_save_register_item(unique_tag, 0, ide->block_count); | |
| 1729 | state_save_register_item(unique_tag, 0, ide->sectors_until_int); | |
| 1730 | ||
| 1731 | state_save_register_item(unique_tag, 0, ide->dma_active); | |
| 1732 | state_save_register_item(unique_tag, 0, ide->dma_cpu); | |
| 1733 | state_save_register_item(unique_tag, 0, ide->dma_address_xor); | |
| 1734 | state_save_register_item(unique_tag, 0, ide->dma_last_buffer); | |
| 1735 | state_save_register_item(unique_tag, 0, ide->dma_address); | |
| 1736 | state_save_register_item(unique_tag, 0, ide->dma_descriptor); | |
| 1737 | state_save_register_item(unique_tag, 0, ide->dma_bytes_left); | |
| 1738 | ||
| 1739 | state_save_register_item(unique_tag, 0, ide->bus_master_command); | |
| 1740 | state_save_register_item(unique_tag, 0, ide->bus_master_status); | |
| 1741 | state_save_register_item(unique_tag, 0, ide->bus_master_descriptor); | |
| 1742 | ||
| 1743 | state_save_register_item(unique_tag, 0, ide->cur_cylinder); | |
| 1744 | state_save_register_item(unique_tag, 0, ide->cur_sector); | |
| 1745 | state_save_register_item(unique_tag, 0, ide->cur_head); | |
| 1746 | state_save_register_item(unique_tag, 0, ide->cur_head_reg); | |
| 1747 | ||
| 1748 | state_save_register_item(unique_tag, 0, ide->cur_lba); | |
| 1749 | ||
| 1750 | state_save_register_item(unique_tag, 0, ide->num_cylinders); | |
| 1751 | state_save_register_item(unique_tag, 0, ide->num_sectors); | |
| 1752 | state_save_register_item(unique_tag, 0, ide->num_heads); | |
| 1753 | ||
| 1754 | state_save_register_item(unique_tag, 0, ide->config_unknown); | |
| 1755 | state_save_register_item_array(unique_tag, 0, ide->config_register); | |
| 1756 | state_save_register_item(unique_tag, 0, ide->config_register_num); | |
| 1757 | ||
| 1758 | state_save_register_item(unique_tag, 0, ide->master_password_enable); | |
| 1759 | state_save_register_item(unique_tag, 0, ide->user_password_enable); | |
| 1760 | } | |
| 1761 | ||
| 1762 | ||
| 1763 | /*------------------------------------------------- | |
| 1764 | device exit callback | |
| 1765 | -------------------------------------------------*/ | |
| 1766 | ||
| 1767 | static DEVICE_STOP( ide_controller ) | |
| 1768 | { | |
| 1769 | ide_state *ide = get_safe_token(device); | |
| 1770 | ||
| 1771 | /* close the hard disk */ | |
| 1772 | if (ide->disk != NULL) | |
| 1773 | hard_disk_close(ide->disk); | |
| 1774 | } | |
| 1775 | ||
| 1776 | ||
| 1777 | /*------------------------------------------------- | |
| 1778 | device reset callback | |
| 1779 | -------------------------------------------------*/ | |
| 1780 | ||
| 1781 | static DEVICE_RESET( ide_controller ) | |
| 1782 | { | |
| 1783 | ide_state *ide = get_safe_token(device); | |
| 1784 | ||
| 1785 | LOG(("IDE controller reset performed\n")); | |
| 1786 | ||
| 1787 | /* reset the drive state */ | |
| 1788 | ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE; | |
| 1789 | ide->error = IDE_ERROR_DEFAULT; | |
| 1790 | ide->buffer_offset = 0; | |
| 1791 | ide->master_password_enable = (ide->master_password != NULL); | |
| 1792 | ide->user_password_enable = (ide->user_password != NULL); | |
| 1793 | clear_interrupt(ide); | |
| 1794 | } | |
| 1795 | ||
| 1796 | ||
| 1797 | /*------------------------------------------------- | |
| 1798 | device set info callback | |
| 1799 | -------------------------------------------------*/ | |
| 1800 | ||
| 1801 | static DEVICE_SET_INFO( ide_controller ) | |
| 1802 | { | |
| 1803 | switch (state) | |
| 1804 | { | |
| 1805 | /* no parameters to set */ | |
| 1806 | } | |
| 1807 | } | |
| 1808 | ||
| 1809 | ||
| 1810 | /*------------------------------------------------- | |
| 1811 | device get info callback | |
| 1812 | -------------------------------------------------*/ | |
| 1813 | ||
| 1814 | DEVICE_GET_INFO( ide_controller ) | |
| 1815 | { | |
| 1816 | switch (state) | |
| 1817 | { | |
| 1818 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 1819 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(ide_state); break; | |
| 1820 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(ide_config); break; | |
| 1821 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; | |
| 1822 | ||
| 1823 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1824 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(ide_controller); break; | |
| 1825 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ide_controller); break; | |
| 1826 | case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(ide_controller); break; | |
| 1827 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ide_controller);break; | |
| 1828 | ||
| 1829 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 1830 | case DEVINFO_STR_NAME: info->s = "IDE Controller"; break; | |
| 1831 | case DEVINFO_STR_FAMILY: info->s = "Disk Controller"; break; | |
| 1832 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1833 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1834 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1835 | } | |
| 1836 | } |
| r2418 | r2419 | |
|---|---|---|
| 1198 | 1198 | WRITE8_HANDLER( pia_6_alt_w ) { pia_alt_write(6, offset, data); } |
| 1199 | 1199 | WRITE8_HANDLER( pia_7_alt_w ) { pia_alt_write(7, offset, data); } |
| 1200 | 1200 | |
| 1201 | /******************* Standard 16-bit CPU interfaces, D0-D7 *******************/ | |
| 1202 | ||
| 1203 | READ16_HANDLER( pia_0_lsb_r ) { return pia_read(0, offset); } | |
| 1204 | READ16_HANDLER( pia_1_lsb_r ) { return pia_read(1, offset); } | |
| 1205 | READ16_HANDLER( pia_2_lsb_r ) { return pia_read(2, offset); } | |
| 1206 | READ16_HANDLER( pia_3_lsb_r ) { return pia_read(3, offset); } | |
| 1207 | READ16_HANDLER( pia_4_lsb_r ) { return pia_read(4, offset); } | |
| 1208 | READ16_HANDLER( pia_5_lsb_r ) { return pia_read(5, offset); } | |
| 1209 | READ16_HANDLER( pia_6_lsb_r ) { return pia_read(6, offset); } | |
| 1210 | READ16_HANDLER( pia_7_lsb_r ) { return pia_read(7, offset); } | |
| 1211 | ||
| 1212 | WRITE16_HANDLER( pia_0_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(0, offset, data); } | |
| 1213 | WRITE16_HANDLER( pia_1_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(1, offset, data); } | |
| 1214 | WRITE16_HANDLER( pia_2_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(2, offset, data); } | |
| 1215 | WRITE16_HANDLER( pia_3_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(3, offset, data); } | |
| 1216 | WRITE16_HANDLER( pia_4_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(4, offset, data); } | |
| 1217 | WRITE16_HANDLER( pia_5_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(5, offset, data); } | |
| 1218 | WRITE16_HANDLER( pia_6_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(6, offset, data); } | |
| 1219 | WRITE16_HANDLER( pia_7_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(7, offset, data); } | |
| 1220 | ||
| 1221 | READ16_HANDLER( pia_0_lsb_alt_r ) { return pia_alt_read(0, offset); } | |
| 1222 | READ16_HANDLER( pia_1_lsb_alt_r ) { return pia_alt_read(1, offset); } | |
| 1223 | READ16_HANDLER( pia_2_lsb_alt_r ) { return pia_alt_read(2, offset); } | |
| 1224 | READ16_HANDLER( pia_3_lsb_alt_r ) { return pia_alt_read(3, offset); } | |
| 1225 | READ16_HANDLER( pia_4_lsb_alt_r ) { return pia_alt_read(4, offset); } | |
| 1226 | READ16_HANDLER( pia_5_lsb_alt_r ) { return pia_alt_read(5, offset); } | |
| 1227 | READ16_HANDLER( pia_6_lsb_alt_r ) { return pia_alt_read(6, offset); } | |
| 1228 | READ16_HANDLER( pia_7_lsb_alt_r ) { return pia_alt_read(7, offset); } | |
| 1229 | ||
| 1230 | WRITE16_HANDLER( pia_0_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(0, offset, data); } | |
| 1231 | WRITE16_HANDLER( pia_1_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(1, offset, data); } | |
| 1232 | WRITE16_HANDLER( pia_2_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(2, offset, data); } | |
| 1233 | WRITE16_HANDLER( pia_3_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(3, offset, data); } | |
| 1234 | WRITE16_HANDLER( pia_4_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(4, offset, data); } | |
| 1235 | WRITE16_HANDLER( pia_5_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(5, offset, data); } | |
| 1236 | WRITE16_HANDLER( pia_6_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(6, offset, data); } | |
| 1237 | WRITE16_HANDLER( pia_7_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(7, offset, data); } | |
| 1238 | ||
| 1239 | /******************* Standard 16-bit CPU interfaces, D8-D15 *******************/ | |
| 1240 | ||
| 1241 | READ16_HANDLER( pia_0_msb_r ) { return pia_read(0, offset) << 8; } | |
| 1242 | READ16_HANDLER( pia_1_msb_r ) { return pia_read(1, offset) << 8; } | |
| 1243 | READ16_HANDLER( pia_2_msb_r ) { return pia_read(2, offset) << 8; } | |
| 1244 | READ16_HANDLER( pia_3_msb_r ) { return pia_read(3, offset) << 8; } | |
| 1245 | READ16_HANDLER( pia_4_msb_r ) { return pia_read(4, offset) << 8; } | |
| 1246 | READ16_HANDLER( pia_5_msb_r ) { return pia_read(5, offset) << 8; } | |
| 1247 | READ16_HANDLER( pia_6_msb_r ) { return pia_read(6, offset) << 8; } | |
| 1248 | READ16_HANDLER( pia_7_msb_r ) { return pia_read(7, offset) << 8; } | |
| 1249 | ||
| 1250 | WRITE16_HANDLER( pia_0_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(0, offset, data >> 8); } | |
| 1251 | WRITE16_HANDLER( pia_1_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(1, offset, data >> 8); } | |
| 1252 | WRITE16_HANDLER( pia_2_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(2, offset, data >> 8); } | |
| 1253 | WRITE16_HANDLER( pia_3_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(3, offset, data >> 8); } | |
| 1254 | WRITE16_HANDLER( pia_4_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(4, offset, data >> 8); } | |
| 1255 | WRITE16_HANDLER( pia_5_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(5, offset, data >> 8); } | |
| 1256 | WRITE16_HANDLER( pia_6_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(6, offset, data >> 8); } | |
| 1257 | WRITE16_HANDLER( pia_7_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(7, offset, data >> 8); } | |
| 1258 | ||
| 1259 | READ16_HANDLER( pia_0_msb_alt_r ) { return pia_alt_read(0, offset) << 8; } | |
| 1260 | READ16_HANDLER( pia_1_msb_alt_r ) { return pia_alt_read(1, offset) << 8; } | |
| 1261 | READ16_HANDLER( pia_2_msb_alt_r ) { return pia_alt_read(2, offset) << 8; } | |
| 1262 | READ16_HANDLER( pia_3_msb_alt_r ) { return pia_alt_read(3, offset) << 8; } | |
| 1263 | READ16_HANDLER( pia_4_msb_alt_r ) { return pia_alt_read(4, offset) << 8; } | |
| 1264 | READ16_HANDLER( pia_5_msb_alt_r ) { return pia_alt_read(5, offset) << 8; } | |
| 1265 | READ16_HANDLER( pia_6_msb_alt_r ) { return pia_alt_read(6, offset) << 8; } | |
| 1266 | READ16_HANDLER( pia_7_msb_alt_r ) { return pia_alt_read(7, offset) << 8; } | |
| 1267 | ||
| 1268 | WRITE16_HANDLER( pia_0_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(0, offset, data >> 8); } | |
| 1269 | WRITE16_HANDLER( pia_1_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(1, offset, data >> 8); } | |
| 1270 | WRITE16_HANDLER( pia_2_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(2, offset, data >> 8); } | |
| 1271 | WRITE16_HANDLER( pia_3_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(3, offset, data >> 8); } | |
| 1272 | WRITE16_HANDLER( pia_4_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(4, offset, data >> 8); } | |
| 1273 | WRITE16_HANDLER( pia_5_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(5, offset, data >> 8); } | |
| 1274 | WRITE16_HANDLER( pia_6_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(6, offset, data >> 8); } | |
| 1275 | WRITE16_HANDLER( pia_7_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(7, offset, data >> 8); } | |
| 1276 | ||
| 1277 | 1201 | /******************* 8-bit A/B port interfaces *******************/ |
| 1278 | 1202 | |
| 1279 | 1203 | WRITE8_HANDLER( pia_0_porta_w ) { pia_set_input_a(0, data, 0); } |
| r2418 | r2419 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | |
| 3 | | |
| 4 | 4 | |
| 5 | Generic (PC-style) IDE controller implementation. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 5 | 10 | ***************************************************************************/ |
| 6 | 11 | |
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __IDECTRL_H__ | |
| 15 | #define __IDECTRL_H__ | |
| 16 | ||
| 7 | 17 | #include "harddisk.h" |
| 8 | 18 | |
| 9 | 19 | |
| 10 | #define MAX_IDE_CONTROLLERS 1 | |
| 20 | /*************************************************************************** | |
| 21 | TYPE DEFINITIONS | |
| 22 | ***************************************************************************/ | |
| 11 | 23 | |
| 12 | struct ide_interface | |
| 24 | typedef struct _ide_config ide_config; | |
| 25 | struct _ide_config | |
| 13 | 26 | { |
| 14 | void (*interrupt)(int state); | |
| 27 | UINT32 disknum; | |
| 28 | void (*interrupt)(const device_config *device, int state); | |
| 15 | 29 | }; |
| 16 | 30 | |
| 17 | int ide_controller_init(int which, const struct ide_interface *intf); | |
| 18 | int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle); | |
| 19 | void ide_controller_reset(int which); | |
| 20 | UINT8 *ide_get_features(int which); | |
| 21 | 31 | |
| 22 | void ide_set_master_password(int which, const UINT8 *password); | |
| 23 | void ide_set_user_password(int which, const UINT8 *password); | |
| 24 | 32 | |
| 25 | int ide_bus_0_r(int select, int offset); | |
| 26 | void ide_bus_0_w(int select, int offset, int data); | |
| 33 | /*************************************************************************** | |
| 34 | TIMER DEVICE CONFIGURATION MACROS | |
| 35 | ***************************************************************************/ | |
| 27 | 36 | |
| 28 | int ide_controller_0_r(int reg); | |
| 29 | void ide_controller_0_w(int reg, int data); | |
| 37 | #define MDRV_IDE_CONTROLLER_ADD(_tag, _disknum, _callback) \ | |
| 38 | MDRV_DEVICE_ADD(_tag, IDE_CONTROLLER) \ | |
| 39 | MDRV_DEVICE_CONFIG_DATA32(ide_config, disknum, _disknum) \ | |
| 40 | MDRV_DEVICE_CONFIG_DATAPTR(ide_config, interrupt, _callback) | |
| 30 | 41 | |
| 31 | READ32_HANDLER( ide_controller32_0_r ); | |
| 32 | WRITE32_HANDLER( ide_controller32_0_w ); | |
| 33 | READ32_HANDLER( ide_bus_master32_0_r ); | |
| 34 | WRITE32_HANDLER( ide_bus_master32_0_w ); | |
| 42 | #define MDRV_IDE_CONTROLLER_REMOVE(_tag) \ | |
| 43 | MDRV_DEVICE_REMOVE(_tag, IDE_CONTROLLER) | |
| 35 | 44 | |
| 36 | READ16_HANDLER( ide_controller16_0_r ); | |
| 37 | WRITE16_HANDLER( ide_controller16_0_w ); | |
| 45 | ||
| 46 | ||
| 47 | /*************************************************************************** | |
| 48 | FUNCTION PROTOTYPES | |
| 49 | ***************************************************************************/ | |
| 50 | ||
| 51 | UINT8 *ide_get_features(const device_config *device); | |
| 52 | ||
| 53 | void ide_set_master_password(const device_config *device, const UINT8 *password); | |
| 54 | void ide_set_user_password(const device_config *device, const UINT8 *password); | |
| 55 | ||
| 56 | int ide_bus_r(const device_config *config, int select, int offset); | |
| 57 | void ide_bus_w(const device_config *config, int select, int offset, int data); | |
| 58 | ||
| 59 | int ide_controller_r(const device_config *config, int reg); | |
| 60 | void ide_controller_w(const device_config *config, int reg, int data); | |
| 61 | ||
| 62 | READ32_DEVICE_HANDLER( ide_controller32_r ); | |
| 63 | WRITE32_DEVICE_HANDLER( ide_controller32_w ); | |
| 64 | READ32_DEVICE_HANDLER( ide_bus_master32_r ); | |
| 65 | WRITE32_DEVICE_HANDLER( ide_bus_master32_w ); | |
| 66 | ||
| 67 | READ16_DEVICE_HANDLER( ide_controller16_r ); | |
| 68 | WRITE16_DEVICE_HANDLER( ide_controller16_w ); | |
| 69 | ||
| 70 | ||
| 71 | /* ----- timer device interface ----- */ | |
| 72 | ||
| 73 | /* device get info callback */ | |
| 74 | #define IDE_CONTROLLER DEVICE_GET_INFO_NAME(ide_controller) | |
| 75 | DEVICE_GET_INFO( ide_controller ); | |
| 76 | ||
| 77 | ||
| 78 | #endif /* __IDECTRL_H__ */ |
| r2418 | r2419 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | |
| 171 | /*---------- Standard 16-bit CPU interfaces, D0-D7 -------*/ | |
| 172 | ||
| 173 | READ16_HANDLER( pia_0_lsb_r ); | |
| 174 | READ16_HANDLER( pia_1_lsb_r ); | |
| 175 | READ16_HANDLER( pia_2_lsb_r ); | |
| 176 | READ16_HANDLER( pia_3_lsb_r ); | |
| 177 | READ16_HANDLER( pia_4_lsb_r ); | |
| 178 | READ16_HANDLER( pia_5_lsb_r ); | |
| 179 | READ16_HANDLER( pia_6_lsb_r ); | |
| 180 | READ16_HANDLER( pia_7_lsb_r ); | |
| 181 | ||
| 182 | WRITE16_HANDLER( pia_0_lsb_w ); | |
| 183 | WRITE16_HANDLER( pia_1_lsb_w ); | |
| 184 | WRITE16_HANDLER( pia_2_lsb_w ); | |
| 185 | WRITE16_HANDLER( pia_3_lsb_w ); | |
| 186 | WRITE16_HANDLER( pia_4_lsb_w ); | |
| 187 | WRITE16_HANDLER( pia_5_lsb_w ); | |
| 188 | WRITE16_HANDLER( pia_6_lsb_w ); | |
| 189 | WRITE16_HANDLER( pia_7_lsb_w ); | |
| 190 | ||
| 191 | READ16_HANDLER( pia_0_lsb_alt_r ); | |
| 192 | READ16_HANDLER( pia_1_lsb_alt_r ); | |
| 193 | READ16_HANDLER( pia_2_lsb_alt_r ); | |
| 194 | READ16_HANDLER( pia_3_lsb_alt_r ); | |
| 195 | READ16_HANDLER( pia_4_lsb_alt_r ); | |
| 196 | READ16_HANDLER( pia_5_lsb_alt_r ); | |
| 197 | READ16_HANDLER( pia_6_lsb_alt_r ); | |
| 198 | READ16_HANDLER( pia_7_lsb_alt_r ); | |
| 199 | ||
| 200 | WRITE16_HANDLER( pia_0_lsb_alt_w ); | |
| 201 | WRITE16_HANDLER( pia_1_lsb_alt_w ); | |
| 202 | WRITE16_HANDLER( pia_2_lsb_alt_w ); | |
| 203 | WRITE16_HANDLER( pia_3_lsb_alt_w ); | |
| 204 | WRITE16_HANDLER( pia_4_lsb_alt_w ); | |
| 205 | WRITE16_HANDLER( pia_5_lsb_alt_w ); | |
| 206 | WRITE16_HANDLER( pia_6_lsb_alt_w ); | |
| 207 | WRITE16_HANDLER( pia_7_lsb_alt_w ); | |
| 208 | ||
| 209 | ||
| 210 | ||
| 211 | /*--------- Standard 16-bit CPU interfaces, D8-D15 -------*/ | |
| 212 | ||
| 213 | READ16_HANDLER( pia_0_msb_r ); | |
| 214 | READ16_HANDLER( pia_1_msb_r ); | |
| 215 | READ16_HANDLER( pia_2_msb_r ); | |
| 216 | READ16_HANDLER( pia_3_msb_r ); | |
| 217 | READ16_HANDLER( pia_4_msb_r ); | |
| 218 | READ16_HANDLER( pia_5_msb_r ); | |
| 219 | READ16_HANDLER( pia_6_msb_r ); | |
| 220 | READ16_HANDLER( pia_7_msb_r ); | |
| 221 | ||
| 222 | WRITE16_HANDLER( pia_0_msb_w ); | |
| 223 | WRITE16_HANDLER( pia_1_msb_w ); | |
| 224 | WRITE16_HANDLER( pia_2_msb_w ); | |
| 225 | WRITE16_HANDLER( pia_3_msb_w ); | |
| 226 | WRITE16_HANDLER( pia_4_msb_w ); | |
| 227 | WRITE16_HANDLER( pia_5_msb_w ); | |
| 228 | WRITE16_HANDLER( pia_6_msb_w ); | |
| 229 | WRITE16_HANDLER( pia_7_msb_w ); | |
| 230 | ||
| 231 | READ16_HANDLER( pia_0_msb_alt_r ); | |
| 232 | READ16_HANDLER( pia_1_msb_alt_r ); | |
| 233 | READ16_HANDLER( pia_2_msb_alt_r ); | |
| 234 | READ16_HANDLER( pia_3_msb_alt_r ); | |
| 235 | READ16_HANDLER( pia_4_msb_alt_r ); | |
| 236 | READ16_HANDLER( pia_5_msb_alt_r ); | |
| 237 | READ16_HANDLER( pia_6_msb_alt_r ); | |
| 238 | READ16_HANDLER( pia_7_msb_alt_r ); | |
| 239 | ||
| 240 | WRITE16_HANDLER( pia_0_msb_alt_w ); | |
| 241 | WRITE16_HANDLER( pia_1_msb_alt_w ); | |
| 242 | WRITE16_HANDLER( pia_2_msb_alt_w ); | |
| 243 | WRITE16_HANDLER( pia_3_msb_alt_w ); | |
| 244 | WRITE16_HANDLER( pia_4_msb_alt_w ); | |
| 245 | WRITE16_HANDLER( pia_5_msb_alt_w ); | |
| 246 | WRITE16_HANDLER( pia_6_msb_alt_w ); | |
| 247 | WRITE16_HANDLER( pia_7_msb_alt_w ); | |
| 248 | ||
| 249 | ||
| 250 | ||
| 251 | 171 | /*--------------- 8-bit A/B port interfaces -------------*/ |
| 252 | 172 | |
| 253 | 173 | WRITE8_HANDLER( pia_0_porta_w ); |
| r2418 | r2419 | |
|---|---|---|
| 14 | 14 | #ifndef __INPTPORT_H__ |
| 15 | 15 | #define __INPTPORT_H__ |
| 16 | 16 | |
| 17 | #include <time.h> | |
| 18 | ||
| 17 | 19 | #include "memory.h" |
| 18 | 20 | #include "inputseq.h" |
| 19 | 21 | #include "tokenize.h" |
| r2418 | r2419 | |
| 897 | 899 | #define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num) |
| 898 | 900 | |
| 899 | 901 | |
| 900 | ||
| 901 | 902 | /*************************************************************************** |
| 902 | 903 | FUNCTION PROTOTYPES |
| 903 | 904 | ***************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 91 | 91 | #ifdef LSB_FIRST |
| 92 | 92 | struct { UINT8 l,h,h2,h3; } b; |
| 93 | 93 | struct { UINT16 l,h; } w; |
| 94 | struct { INT8 l,h,h2,h3; } sb; | |
| 95 | struct { INT16 l,h; } sw; | |
| 94 | 96 | #else |
| 95 | 97 | struct { UINT8 h3,h2,h,l; } b; |
| 98 | struct { INT8 h3,h2,h,l; } sb; | |
| 96 | 99 | struct { UINT16 h,l; } w; |
| 100 | struct { INT16 h,l; } sw; | |
| 97 | 101 | #endif |
| 98 | 102 | UINT32 d; |
| 103 | INT32 sd; | |
| 99 | 104 | } PAIR; |
| 100 | 105 | |
| 101 | 106 | |
| r2418 | r2419 | |
| 110 | 115 | struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b; |
| 111 | 116 | struct { UINT16 l,h,h2,h3; } w; |
| 112 | 117 | struct { UINT32 l,h; } d; |
| 118 | struct { INT8 l,h,h2,h3,h4,h5,h6,h7; } sb; | |
| 119 | struct { INT16 l,h,h2,h3; } sw; | |
| 120 | struct { INT32 l,h; } sd; | |
| 113 | 121 | #else |
| 114 | 122 | struct { UINT8 h7,h6,h5,h4,h3,h2,h,l; } b; |
| 115 | 123 | struct { UINT16 h3,h2,h,l; } w; |
| 116 | 124 | struct { UINT32 h,l; } d; |
| 125 | struct { INT8 h7,h6,h5,h4,h3,h2,h,l; } sb; | |
| 126 | struct { INT16 h3,h2,h,l; } sw; | |
| 127 | struct { INT32 h,l; } sd; | |
| 117 | 128 | #endif |
| 118 | UINT64 lw; | |
| 129 | UINT64 q; | |
| 130 | INT64 sq; | |
| 119 | 131 | } PAIR64; |
| 120 | 132 | |
| 121 | 133 |
| r2418 | r2419 | |
|---|---|---|
| 85 | 85 | * |
| 86 | 86 | *************************************/ |
| 87 | 87 | |
| 88 | INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, voi | |
| 88 | INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask) | |
| 89 | 89 | { |
| 90 | 90 | UINT16 result = 0; |
| 91 | 91 | if ((mem_mask & 0xff00) != 0xff00) |
| 92 | result |= ((UINT16)(*handler)( | |
| 92 | result |= ((UINT16)(*handler)(device, offset * 2 + 0)) << 8; | |
| 93 | 93 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 94 | result |= ((UINT16)(*handler)( | |
| 94 | result |= ((UINT16)(*handler)(device, offset * 2 + 1)) << 0; | |
| 95 | 95 | return result; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | INLINE void write16be_with_write8_device_handler(write8_device_func handler, voi | |
| 99 | INLINE void write16be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask) | |
| 100 | 100 | { |
| 101 | 101 | if ((mem_mask & 0xff00) != 0xff00) |
| 102 | (*handler)( | |
| 102 | (*handler)(device, offset * 2 + 0, data >> 8); | |
| 103 | 103 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 104 | (*handler)( | |
| 104 | (*handler)(device, offset * 2 + 1, data >> 0); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r2418 | r2419 | |
| 111 | 111 | * |
| 112 | 112 | *************************************/ |
| 113 | 113 | |
| 114 | INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, voi | |
| 114 | INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask) | |
| 115 | 115 | { |
| 116 | 116 | UINT16 result = 0; |
| 117 | 117 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 118 | result |= ((UINT16) (*handler)( | |
| 118 | result |= ((UINT16) (*handler)(device, offset * 2 + 0)) << 0; | |
| 119 | 119 | if ((mem_mask & 0xff00) != 0xff00) |
| 120 | result |= ((UINT16) (*handler)( | |
| 120 | result |= ((UINT16) (*handler)(device, offset * 2 + 1)) << 8; | |
| 121 | 121 | return result; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | INLINE void write16le_with_write8_device_handler(write8_device_func handler, voi | |
| 125 | INLINE void write16le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask) | |
| 126 | 126 | { |
| 127 | 127 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 128 | (*handler)( | |
| 128 | (*handler)(device, offset * 2 + 0, data >> 0); | |
| 129 | 129 | if ((mem_mask & 0xff00) != 0xff00) |
| 130 | (*handler)( | |
| 130 | (*handler)(device, offset * 2 + 1, data >> 8); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r2418 | r2419 | |
| 137 | 137 | * |
| 138 | 138 | *************************************/ |
| 139 | 139 | |
| 140 | INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, voi | |
| 140 | INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 141 | 141 | { |
| 142 | 142 | UINT32 result = 0; |
| 143 | 143 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 144 | result |= read16be_with_read8_device_handler(handler, | |
| 144 | result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 16) << 16; | |
| 145 | 145 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 146 | result |= read16be_with_read8_device_handler(handler, | |
| 146 | result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0; | |
| 147 | 147 | return result; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | INLINE void write32be_with_write8_device_handler(write8_device_func handler, voi | |
| 151 | INLINE void write32be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 152 | 152 | { |
| 153 | 153 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 154 | write16be_with_write8_device_handler(handler, | |
| 154 | write16be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 155 | 155 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 156 | write16be_with_write8_device_handler(handler, | |
| 156 | write16be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| r2418 | r2419 | |
| 163 | 163 | * |
| 164 | 164 | *************************************/ |
| 165 | 165 | |
| 166 | INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, voi | |
| 166 | INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 167 | 167 | { |
| 168 | 168 | UINT32 result = 0; |
| 169 | 169 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 170 | result |= read16le_with_read8_device_handler(handler, | |
| 170 | result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask) << 0; | |
| 171 | 171 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 172 | result |= read16le_with_read8_device_handler(handler, | |
| 172 | result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 173 | 173 | return result; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| 177 | INLINE void write32le_with_write8_device_handler(write8_device_func handler, voi | |
| 177 | INLINE void write32le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 178 | 178 | { |
| 179 | 179 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 180 | write16le_with_write8_device_handler(handler, | |
| 180 | write16le_with_write8_device_handler(handler, device, offset * 2 + 0, data, mem_mask); | |
| 181 | 181 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 182 | write16le_with_write8_device_handler(handler, | |
| 182 | write16le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r2418 | r2419 | |
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, voi | |
| 192 | INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 193 | 193 | { |
| 194 | 194 | UINT32 result = 0; |
| 195 | 195 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 196 | result |= (*handler)( | |
| 196 | result |= (*handler)(device, offset * 2 + 0, mem_mask >> 16) << 16; | |
| 197 | 197 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 198 | result |= (*handler)( | |
| 198 | result |= (*handler)(device, offset * 2 + 1, mem_mask) << 0; | |
| 199 | 199 | return result; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | INLINE void write32be_with_16be_device_handler(write16_device_func handler, voi | |
| 203 | INLINE void write32be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 204 | 204 | { |
| 205 | 205 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 206 | (*handler)( | |
| 206 | (*handler)(device, offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 207 | 207 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 208 | (*handler)( | |
| 208 | (*handler)(device, offset * 2 + 1, data, mem_mask); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| r2418 | r2419 | |
| 215 | 215 | * |
| 216 | 216 | *************************************/ |
| 217 | 217 | |
| 218 | INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, voi | |
| 218 | INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 219 | 219 | { |
| 220 | 220 | UINT32 result = 0; |
| 221 | 221 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 222 | result |= (*handler)( | |
| 222 | result |= (*handler)(device, offset * 2 + 0, mem_mask) << 0; | |
| 223 | 223 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 224 | result |= (*handler)( | |
| 224 | result |= (*handler)(device, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 225 | 225 | return result; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
| 229 | INLINE void write32le_with_16le_device_handler(write16_device_func handler, voi | |
| 229 | INLINE void write32le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 230 | 230 | { |
| 231 | 231 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 232 | (*handler)( | |
| 232 | (*handler)(device, offset * 2 + 0, data, mem_mask); | |
| 233 | 233 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 234 | (*handler)( | |
| 234 | (*handler)(device, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| r2418 | r2419 | |
| 241 | 241 | * |
| 242 | 242 | *************************************/ |
| 243 | 243 | |
| 244 | INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, voi | |
| 244 | INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 245 | 245 | { |
| 246 | 246 | UINT32 result = 0; |
| 247 | 247 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 248 | result = read32le_with_16le_device_handler(handler, | |
| 248 | result = read32le_with_16le_device_handler(handler, device, offset, mem_mask); | |
| 249 | 249 | return FLIPENDIAN_INT32(result); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| 253 | INLINE void write32be_with_16le_device_handler(write16_device_func handler, voi | |
| 253 | INLINE void write32be_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 254 | 254 | { |
| 255 | 255 | data = FLIPENDIAN_INT32(data); |
| 256 | 256 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 257 | write32le_with_16le_device_handler(handler, | |
| 257 | write32le_with_16le_device_handler(handler, device, offset, data, mem_mask); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| r2418 | r2419 | |
| 264 | 264 | * |
| 265 | 265 | *************************************/ |
| 266 | 266 | |
| 267 | INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, voi | |
| 267 | INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) | |
| 268 | 268 | { |
| 269 | 269 | UINT32 result = 0; |
| 270 | 270 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 271 | result = read32be_with_16be_device_handler(handler, | |
| 271 | result = read32be_with_16be_device_handler(handler, device, offset, mem_mask); | |
| 272 | 272 | return FLIPENDIAN_INT32(result); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| 276 | INLINE void write32le_with_16be_device_handler(write16_device_func handler, voi | |
| 276 | INLINE void write32le_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) | |
| 277 | 277 | { |
| 278 | 278 | data = FLIPENDIAN_INT32(data); |
| 279 | 279 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 280 | write32be_with_16be_device_handler(handler, | |
| 280 | write32be_with_16be_device_handler(handler, device, offset, data, mem_mask); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r2418 | r2419 | |
| 287 | 287 | * |
| 288 | 288 | *************************************/ |
| 289 | 289 | |
| 290 | INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, voi | |
| 290 | INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 291 | 291 | { |
| 292 | 292 | UINT64 result = 0; |
| 293 | 293 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 294 | result |= (UINT64)read32be_with_read8_device_handler(handler, | |
| 294 | result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 295 | 295 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 296 | result |= (UINT64)read32be_with_read8_device_handler(handler, | |
| 296 | result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0; | |
| 297 | 297 | return result; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| 301 | INLINE void write64be_with_write8_device_handler(write8_device_func handler, voi | |
| 301 | INLINE void write64be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 302 | 302 | { |
| 303 | 303 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 304 | write32be_with_write8_device_handler(handler, | |
| 304 | write32be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 305 | 305 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 306 | write32be_with_write8_device_handler(handler, | |
| 306 | write32be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
| r2418 | r2419 | |
| 313 | 313 | * |
| 314 | 314 | *************************************/ |
| 315 | 315 | |
| 316 | INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, voi | |
| 316 | INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 317 | 317 | { |
| 318 | 318 | UINT64 result = 0; |
| 319 | 319 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 320 | result |= (UINT64)read32le_with_read8_device_handler(handler, | |
| 320 | result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 321 | 321 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 322 | result |= (UINT64)read32le_with_read8_device_handler(handler, | |
| 322 | result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 323 | 323 | return result; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| 327 | INLINE void write64le_with_write8_device_handler(write8_device_func handler, voi | |
| 327 | INLINE void write64le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 328 | 328 | { |
| 329 | 329 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 330 | write32le_with_write8_device_handler(handler, | |
| 330 | write32le_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 331 | 331 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 332 | write32le_with_write8_device_handler(handler, | |
| 332 | write32le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | |
| r2418 | r2419 | |
| 339 | 339 | * |
| 340 | 340 | *************************************/ |
| 341 | 341 | |
| 342 | INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, voi | |
| 342 | INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 343 | 343 | { |
| 344 | 344 | UINT64 result = 0; |
| 345 | 345 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 346 | result |= (UINT64)read32be_with_16be_device_handler(handler, | |
| 346 | result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 347 | 347 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 348 | result |= (UINT64)read32be_with_16be_device_handler(handler, | |
| 348 | result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 349 | 349 | return result; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | INLINE void write64be_with_16be_device_handler(write16_device_func handler, voi | |
| 353 | INLINE void write64be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 354 | 354 | { |
| 355 | 355 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 356 | write32be_with_16be_device_handler(handler, | |
| 356 | write32be_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 357 | 357 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 358 | write32be_with_16be_device_handler(handler, | |
| 358 | write32be_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| r2418 | r2419 | |
| 365 | 365 | * |
| 366 | 366 | *************************************/ |
| 367 | 367 | |
| 368 | INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, voi | |
| 368 | INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 369 | 369 | { |
| 370 | 370 | UINT64 result = 0; |
| 371 | 371 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 372 | result |= (UINT64)read32le_with_16le_device_handler(handler, | |
| 372 | result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 373 | 373 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 374 | result |= (UINT64)read32le_with_16le_device_handler(handler, | |
| 374 | result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 375 | 375 | return result; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | INLINE void write64le_with_16le_device_handler(write16_device_func handler, voi | |
| 379 | INLINE void write64le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 380 | 380 | { |
| 381 | 381 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 382 | write32le_with_16le_device_handler(handler, | |
| 382 | write32le_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 383 | 383 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 384 | write32le_with_16le_device_handler(handler, | |
| 384 | write32le_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| r2418 | r2419 | |
| 391 | 391 | * |
| 392 | 392 | *************************************/ |
| 393 | 393 | |
| 394 | INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, voi | |
| 394 | INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 395 | 395 | { |
| 396 | 396 | UINT64 result = 0; |
| 397 | 397 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 398 | result |= (UINT64)read32be_with_16le_device_handler(handler, | |
| 398 | result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 399 | 399 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 400 | result |= (UINT64)read32be_with_16le_device_handler(handler, | |
| 400 | result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 401 | 401 | return result; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
| 405 | INLINE void write64be_with_16le_device_handler(write16_device_func handler, voi | |
| 405 | INLINE void write64be_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 406 | 406 | { |
| 407 | 407 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 408 | write32be_with_16le_device_handler(handler, | |
| 408 | write32be_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 409 | 409 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 410 | write32be_with_16le_device_handler(handler, | |
| 410 | write32be_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| r2418 | r2419 | |
| 417 | 417 | * |
| 418 | 418 | *************************************/ |
| 419 | 419 | |
| 420 | INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, voi | |
| 420 | INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 421 | 421 | { |
| 422 | 422 | UINT64 result = 0; |
| 423 | 423 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 424 | result |= (UINT64)read32le_with_16be_device_handler(handler, | |
| 424 | result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 425 | 425 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 426 | result |= (UINT64)read32le_with_16be_device_handler(handler, | |
| 426 | result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 427 | 427 | return result; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | |
| 431 | INLINE void write64le_with_16be_device_handler(write16_device_func handler, voi | |
| 431 | INLINE void write64le_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 432 | 432 | { |
| 433 | 433 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 434 | write32le_with_16be_device_handler(handler, | |
| 434 | write32le_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 435 | 435 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 436 | write32le_with_16be_device_handler(handler, | |
| 436 | write32le_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| r2418 | r2419 | |
| 443 | 443 | * |
| 444 | 444 | *************************************/ |
| 445 | 445 | |
| 446 | INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, voi | |
| 446 | INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 447 | 447 | { |
| 448 | 448 | UINT64 result = 0; |
| 449 | 449 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 450 | result |= (UINT64)(*handler)( | |
| 450 | result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 451 | 451 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 452 | result |= (UINT64)(*handler)( | |
| 452 | result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 453 | 453 | return result; |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| 457 | INLINE void write64be_with_32be_device_handler(write32_device_func handler, voi | |
| 457 | INLINE void write64be_with_32be_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 458 | 458 | { |
| 459 | 459 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 460 | (*handler)( | |
| 460 | (*handler)(device, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 461 | 461 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 462 | (*handler)( | |
| 462 | (*handler)(device, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| r2418 | r2419 | |
| 469 | 469 | * |
| 470 | 470 | *************************************/ |
| 471 | 471 | |
| 472 | INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, voi | |
| 472 | INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 473 | 473 | { |
| 474 | 474 | UINT64 result = 0; |
| 475 | 475 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 476 | result |= (UINT64)(*handler)( | |
| 476 | result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 477 | 477 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 478 | result |= (UINT64)(*handler)( | |
| 478 | result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 479 | 479 | return result; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| 483 | INLINE void write64le_with_32le_device_handler(write32_device_func handler, voi | |
| 483 | INLINE void write64le_with_32le_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 484 | 484 | { |
| 485 | 485 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 486 | (*handler)( | |
| 486 | (*handler)(device, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 487 | 487 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 488 | (*handler)( | |
| 488 | (*handler)(device, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| r2418 | r2419 | |
| 495 | 495 | * |
| 496 | 496 | *************************************/ |
| 497 | 497 | |
| 498 | INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, voi | |
| 498 | INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 499 | 499 | { |
| 500 | 500 | UINT64 result; |
| 501 | 501 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 502 | result = read64le_with_32le_device_handler(handler, | |
| 502 | result = read64le_with_32le_device_handler(handler, device, offset, mem_mask); | |
| 503 | 503 | return FLIPENDIAN_INT64(result); |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | |
| 507 | INLINE void write64be_with_32le_device_handler(write32_device_func handler, voi | |
| 507 | INLINE void write64be_with_32le_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 508 | 508 | { |
| 509 | 509 | data = FLIPENDIAN_INT64(data); |
| 510 | 510 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 511 | write64le_with_32le_device_handler(handler, | |
| 511 | write64le_with_32le_device_handler(handler, device, offset, data, mem_mask); | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| r2418 | r2419 | |
| 518 | 518 | * |
| 519 | 519 | *************************************/ |
| 520 | 520 | |
| 521 | INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, voi | |
| 521 | INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) | |
| 522 | 522 | { |
| 523 | 523 | UINT64 result; |
| 524 | 524 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 525 | result = read64be_with_32be_device_handler(handler, | |
| 525 | result = read64be_with_32be_device_handler(handler, device, offset, mem_mask); | |
| 526 | 526 | return FLIPENDIAN_INT64(result); |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
| 530 | INLINE void write64le_with_32be_device_handler(write32_device_func handler, voi | |
| 530 | INLINE void write64le_with_32be_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) | |
| 531 | 531 | { |
| 532 | 532 | data = FLIPENDIAN_INT64(data); |
| 533 | 533 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 534 | write64be_with_32be_device_handler(handler, | |
| 534 | write64be_with_32be_device_handler(handler, device, offset, data, mem_mask); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 |
| r2418 | r2419 | |
|---|---|---|
| 111 | 111 | XTAL_27_164MHz = 27164000, /* Typically used on 90's Taito PCBs to drive the custom chips */ |
| 112 | 112 | XTAL_28MHz = 28000000, |
| 113 | 113 | XTAL_28_37516MHz = 28375160, /* Amiga PAL systems */ |
| 114 | XTAL_28_63636MHz = 28636360, /* | |
| 114 | XTAL_28_63636MHz = 28636360, /* Later Leland games and Atari GT, Amiga NTSC , Raiden2 h/w */ | |
| 115 | 115 | XTAL_30_4761MHz = 30476100, /* Taito JC */ |
| 116 | 116 | XTAL_32MHz = 32000000, |
| 117 | 117 | XTAL_32_22MHz = 32220000, /* Typically used on 90's Data East PCBs */ |
| r2418 | r2419 | |
| 136 | 136 | XTAL_60MHz = 60000000, |
| 137 | 137 | XTAL_61_44MHz = 61440000, /* dkong */ |
| 138 | 138 | XTAL_64MHz = 64000000, /* BattleToads */ |
| 139 | XTAL_66_6667MHz = 66666700, /* | |
| 139 | XTAL_66_6667MHz = 66666700, /* Later Midway games */ | |
| 140 | 140 | XTAL_67_7376MHz = 67737600, /* PSX-based h/w, Sony ZN1-2-based */ |
| 141 | 141 | XTAL_73_728MHz = 73728000, /* Ms. Pac-Man/Galaga 20th Anniversary */ |
| 142 | XTAL_100MHz = 100000000, /* PSX-based Namco System 12, Vegas, Sony ZN1-2-based */ | |
| 143 | XTAL_101_4912MHz = 101491200, /* PSX-based Namco System 10 */ | |
| 142 | XTAL_100MHz = 100000000, /* PSX-based Namco System 12, Vegas, Sony ZN1-2-based */ | |
| 143 | XTAL_101_4912MHz = 101491200, /* PSX-based Namco System 10 */ | |
| 144 | 144 | |
| 145 | 145 | /* Resonators (There are probably more. Almost always used for driving OKI sound chips) */ |
| 146 | 146 |
| r2418 | r2419 | |
|---|---|---|
| 13 | 13 | #include "harddriv.h" |
| 14 | 14 | #include "machine/idectrl.h" |
| 15 | 15 | |
| 16 | /* FIXME - this is so completely broken until we device-ize IDE drives */ | |
| 17 | struct ide_interface; | |
| 16 | 18 | |
| 17 | 19 | static void ide_get_params(const device_config *image, int *which_bus, int *which_address, |
| 18 | 20 | struct ide_interface **intf, |
| r2418 | r2419 | |
| 60 | 62 | parent_init(device); |
| 61 | 63 | |
| 62 | 64 | /* configure IDE */ |
| 63 | ide_controller_init_custom(which_bus, intf, NULL); | |
| 65 | /* FIXME IDE */ | |
| 66 | /* ide_controller_init_custom(which_bus, intf, NULL); */ | |
| 64 | 67 | } |
| 65 | 68 | |
| 66 | 69 | |
| r2418 | r2419 | |
| 84 | 87 | return result; |
| 85 | 88 | |
| 86 | 89 | /* configure IDE */ |
| 87 | ide_controller_init_custom(which_bus, intf, mess_hd_get_chd_file(image)); | |
| 88 | ide_controller_reset(which_bus); | |
| 90 | /* FIXME IDE */ | |
| 91 | /* ide_controller_init_custom(which_bus, intf, mess_hd_get_chd_file(image)); */ | |
| 92 | /* ide_controller_reset(which_bus); */ | |
| 89 | 93 | return INIT_PASS; |
| 90 | 94 | } |
| 91 | 95 | |
| r2418 | r2419 | |
| 108 | 112 | parent_unload(image); |
| 109 | 113 | |
| 110 | 114 | /* configure IDE */ |
| 111 | ide_controller_init_custom(which_bus, intf, NULL); | |
| 112 | ide_controller_reset(which_bus); | |
| 115 | /* FIXME IDE */ | |
| 116 | /* ide_controller_init_custom(which_bus, intf, NULL); */ | |
| 117 | /* ide_controller_reset(which_bus); */ | |
| 113 | 118 | } |
| 114 | 119 | |
| 115 | 120 | |
| r2418 | r2419 | |
| 141 | 146 | error = 1; |
| 142 | 147 | } |
| 143 | 148 | |
| 144 | if (count > MAX_IDE_CONTROLLERS) | |
| 145 | { | |
| 146 | mame_printf_error("%s: Too many IDE devices; maximum is %d\n", devclass->gamedrv->name, MAX_IDE_CONTROLLERS); | |
| 147 | error = 1; | |
| 148 | } | |
| 149 | ||
| 150 | 149 | return error; |
| 151 | 150 | } |
| 152 | 151 |
| r2418 | r2419 | |
|---|---|---|
| 109 | 109 | int ram_validate_option(void); |
| 110 | 110 | void ram_dump(const char *filename); |
| 111 | 111 | |
| 112 | UINT8 *memory_install_ram8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t ram_offset, int bank); | |
| 112 | UINT8 *memory_install_ram8_handler(running_machine *machine, int cpunum, int spacenum, offs_t start, offs_t end, offs_t ram_offset, int bank); | |
| 113 | 113 | |
| 114 | 114 | /* --------------------------------------------------------------------------------------------- */ |
| 115 | 115 |
| r2418 | r2419 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | /* ----------------------------------------------------------------------- */ |
| 131 | 131 | |
| 132 | UINT8 *memory_install_ram8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t ram_offset, int bank) | |
| 132 | UINT8 *memory_install_ram8_handler(running_machine *machine, int cpunum, int spacenum, offs_t start, offs_t end, offs_t ram_offset, int bank) | |
| 133 | 133 | { |
| 134 | 134 | read8_machine_func read_bank = (read8_machine_func) (FPTR)(STATIC_BANK1 + bank - 1); |
| 135 | 135 | write8_machine_func write_bank = (write8_machine_func) (FPTR)(STATIC_BANK1 + bank - 1); |
| r2418 | r2419 | |
| 137 | 137 | |
| 138 | 138 | memory_set_bankptr(bank, mess_ram + ram_offset); |
| 139 | 139 | |
| 140 | memory_install_read8_handler(cpunum, spacenum, start, | |
| 140 | memory_install_read8_handler(machine, cpunum, spacenum, start, | |
| 141 | 141 | MIN(end, start - ram_offset + mess_ram_size - 1), 0, 0, read_bank); |
| 142 | memory_install_write8_handler(cpunum, spacenum, start, | |
| 142 | memory_install_write8_handler(machine, cpunum, spacenum, start, | |
| 143 | 143 | MIN(end, start - ram_offset + mess_ram_size - 1), 0, 0, write_bank); |
| 144 | 144 | |
| 145 | 145 | if (bank_size > (mess_ram_size - ram_offset)) |
| 146 | 146 | { |
| 147 | memory_install_read8_handler(cpunum, spacenum, start - ram_offset + mess_ram_size, end, 0, 0, SMH_ROM); | |
| 148 | memory_install_write8_handler(cpunum, spacenum, start - ram_offset + mess_ram_size, end, 0, 0, SMH_ROM); | |
| 147 | memory_install_read8_handler(machine, cpunum, spacenum, start - ram_offset + mess_ram_size, end, 0, 0, SMH_ROM); | |
| 148 | memory_install_write8_handler(machine, cpunum, spacenum, start - ram_offset + mess_ram_size, end, 0, 0, SMH_ROM); | |
| 149 | 149 | } |
| 150 | 150 | return mess_ram + ram_offset; |
| 151 | 151 | } |
| r2418 | r2419 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | /*----------- defined in drivers/spectrum.c -----------*/ |
| 74 | 74 | |
| 75 | extern void ts2068_update_memory( | |
| 75 | extern void ts2068_update_memory(running_machine *machine); | |
| 76 | 76 | extern int spectrum_128_port_7ffd_data; |
| 77 | 77 | extern int spectrum_plus3_port_1ffd_data; |
| 78 | 78 | extern int ts2068_port_ff_data; |
| r2418 | r2419 | |
| 80 | 80 | extern int PreviousFE; |
| 81 | 81 | extern unsigned char *spectrum_128_screen_location; |
| 82 | 82 | |
| 83 | extern void spectrum_128_update_memory(void); | |
| 84 | extern void spectrum_plus3_update_memory(void); | |
| 83 | extern void spectrum_128_update_memory(running_machine *machine); | |
| 84 | extern void spectrum_plus3_update_memory(running_machine *machine); | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | /*----------- defined in video/spectrum.c -----------*/ |
| r2418 | r2419 | |
|---|---|---|
| 44 | 44 | WRITE64_HANDLER( bebox_80000480_w ); |
| 45 | 45 | WRITE64_HANDLER( bebox_flash_w ); |
| 46 | 46 | |
| 47 | void bebox_ide_interrupt(int state); | |
| 47 | 48 | |
| 49 | ||
| 48 | 50 | #endif /* BEBOX_H_ */ |
| r2418 | r2419 | |
|---|---|---|
| 607 | 607 | sel = vga.gc.data[6] & 0x0c; |
| 608 | 608 | if (sel) |
| 609 | 609 | { |
| 610 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler : SMH_NOP); | |
| 611 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler : SMH_NOP); | |
| 612 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler : SMH_NOP); | |
| 613 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler : SMH_NOP); | |
| 614 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler : SMH_NOP); | |
| 615 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler : SMH_NOP); | |
| 610 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler : SMH_NOP); | |
| 611 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler : SMH_NOP); | |
| 612 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler : SMH_NOP); | |
| 613 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler : SMH_NOP); | |
| 614 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler : SMH_NOP); | |
| 615 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler : SMH_NOP); | |
| 616 | 616 | } |
| 617 | 617 | else |
| 618 | 618 | { |
| 619 | 619 | memory_set_bankptr(1, vga.memory); |
| 620 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 621 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 620 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 621 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 622 | 622 | } |
| 623 | 623 | break; |
| 624 | 624 | |
| r2418 | r2419 | |
| 626 | 626 | sel = vga.gc.data[6] & 0x0c; |
| 627 | 627 | if (sel) |
| 628 | 628 | { |
| 629 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler64 : SMH_NOP); | |
| 630 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler64 : SMH_NOP); | |
| 631 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler64 : SMH_NOP); | |
| 632 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler64 : SMH_NOP); | |
| 633 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler64 : SMH_NOP); | |
| 634 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler64 : SMH_NOP); | |
| 629 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler64 : SMH_NOP); | |
| 630 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler64 : SMH_NOP); | |
| 631 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler64 : SMH_NOP); | |
| 632 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler64 : SMH_NOP); | |
| 633 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler64 : SMH_NOP); | |
| 634 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler64 : SMH_NOP); | |
| 635 | 635 | } |
| 636 | 636 | else |
| 637 | 637 | { |
| 638 | 638 | memory_set_bankptr(1, vga.memory); |
| 639 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 640 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 639 | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 640 | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); | |
| 641 | 641 | } |
| 642 | 642 | break; |
| 643 | 643 | |
| r2418 | r2419 | |
| 1139 | 1139 | switch(buswidth) |
| 1140 | 1140 | { |
| 1141 | 1141 | case 8: |
| 1142 | memory_install_read8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_r ); | |
| 1143 | memory_install_read8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_r ); | |
| 1144 | memory_install_read8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_r ); | |
| 1142 | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_r ); | |
| 1143 | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_r ); | |
| 1144 | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_r ); | |
| 1145 | 1145 | |
| 1146 | memory_install_write8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_w ); | |
| 1147 | memory_install_write8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_w ); | |
| 1148 | memory_install_write8_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_w ); | |
| 1146 | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_w ); | |
| 1147 | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_w ); | |
| 1148 | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_w ); | |
| 1149 | 1149 | break; |
| 1150 | 1150 | |
| 1151 | 1151 | case 64: |
| 1152 | memory_install_read64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_r ); | |
| 1153 | memory_install_read64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_r ); | |
| 1154 | memory_install_read64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_r ); | |
| 1152 | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_r ); | |
| 1153 | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_r ); | |
| 1154 | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_r ); | |
| 1155 | 1155 | |
| 1156 | memory_install_write64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_w ); | |
| 1157 | memory_install_write64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_w ); | |
| 1158 | memory_install_write64_handler(0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_w ); | |
| 1156 | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_w ); | |
| 1157 | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_w ); | |
| 1158 | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_w ); | |
| 1159 | 1159 | break; |
| 1160 | 1160 | } |
| 1161 | 1161 |
| r2418 | r2419 | |
|---|---|---|
| 8 | 8 | but the pen colours may be wrong. This needs to be tested. */ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 11 | 12 | #include "machine/8255ppi.h" |
| 12 | 13 | #include "includes/pc8801.h" |
| 13 | 14 | |
| r2418 | r2419 | |
| 298 | 299 | } |
| 299 | 300 | |
| 300 | 301 | |
| 301 | if (rh5) memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, rh5); | |
| 302 | if (wh5) memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, wh5); | |
| 303 | if (rh6) memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, rh6); | |
| 304 | if (wh6) memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, wh6); | |
| 302 | if (rh5) memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, rh5); | |
| 303 | if (wh5) memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, wh5); | |
| 304 | if (rh6) memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, rh6); | |
| 305 | if (wh6) memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, wh6); | |
| 305 | 306 | } |
| 306 | 307 | |
| 307 | 308 | WRITE8_HANDLER(pc88sr_disp_32) |
| r2418 | r2419 | |
|---|---|---|
| 96 | 96 | switch(buswidth) |
| 97 | 97 | { |
| 98 | 98 | case 8: |
| 99 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0x07000, SMH_BANK11 ); | |
| 100 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0x07000, pc_video_videoram_w ); | |
| 101 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_MDA_r ); | |
| 102 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_MDA_w ); | |
| 99 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0x07000, SMH_BANK11 ); | |
| 100 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0x07000, pc_video_videoram_w ); | |
| 101 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_MDA_r ); | |
| 102 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_MDA_w ); | |
| 103 | 103 | break; |
| 104 | 104 | |
| 105 | 105 | default: |
| r2418 | r2419 | |
| 412 | 412 | switch(buswidth) |
| 413 | 413 | { |
| 414 | 414 | case 8: |
| 415 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, SMH_BANK11 ); | |
| 416 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc_video_videoram_w ); | |
| 417 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_hercules_r ); | |
| 418 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_hercules_w ); | |
| 415 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, SMH_BANK11 ); | |
| 416 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc_video_videoram_w ); | |
| 417 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_hercules_r ); | |
| 418 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_hercules_w ); | |
| 419 | 419 | break; |
| 420 | 420 | |
| 421 | 421 | default: |
| r2418 | r2419 | |
|---|---|---|
| 685 | 685 | switch(buswidth) |
| 686 | 686 | { |
| 687 | 687 | case 8: |
| 688 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_aga_mda_r ); | |
| 689 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_aga_mda_w ); | |
| 690 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_aga_cga_r ); | |
| 691 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_aga_cga_w ); | |
| 688 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_aga_mda_r ); | |
| 689 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc_aga_mda_w ); | |
| 690 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_aga_cga_r ); | |
| 691 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_aga_cga_w ); | |
| 692 | 692 | break; |
| 693 | 693 | |
| 694 | 694 | case 16: |
| 695 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc16le_aga_mda_r ); | |
| 696 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc16le_aga_mda_w ); | |
| 697 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc16le_aga_cga_r ); | |
| 698 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc16le_aga_cga_w ); | |
| 695 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc16le_aga_mda_r ); | |
| 696 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, pc16le_aga_mda_w ); | |
| 697 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc16le_aga_cga_r ); | |
| 698 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc16le_aga_cga_w ); | |
| 699 | 699 | break; |
| 700 | 700 | |
| 701 | 701 | default: |
| r2418 | r2419 | |
| 721 | 721 | switch(buswidth) |
| 722 | 722 | { |
| 723 | 723 | case 8: |
| 724 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga_r ); | |
| 725 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga_w ); | |
| 724 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga_r ); | |
| 725 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga_w ); | |
| 726 | 726 | break; |
| 727 | 727 | |
| 728 | 728 | case 16: |
| 729 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga16le_r ); | |
| 730 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga16le_w ); | |
| 729 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga16le_r ); | |
| 730 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc200_cga16le_w ); | |
| 731 | 731 | break; |
| 732 | 732 | |
| 733 | 733 | default: |
| r2418 | r2419 | |
|---|---|---|
| 432 | 432 | switch(buswidth) |
| 433 | 433 | { |
| 434 | 434 | case 8: |
| 435 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 436 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram_w ); | |
| 437 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_r ); | |
| 438 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_w ); | |
| 435 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 436 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram_w ); | |
| 437 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_r ); | |
| 438 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_w ); | |
| 439 | 439 | break; |
| 440 | 440 | |
| 441 | 441 | case 16: |
| 442 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 443 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram16le_w ); | |
| 444 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_r ); | |
| 445 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_w ); | |
| 442 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 443 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram16le_w ); | |
| 444 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_r ); | |
| 445 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_w ); | |
| 446 | 446 | break; |
| 447 | 447 | |
| 448 | 448 | case 32: |
| 449 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 450 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram32_w ); | |
| 451 | memory_install_read32_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_r ); | |
| 452 | memory_install_write32_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_w ); | |
| 449 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); | |
| 450 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram32_w ); | |
| 451 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_r ); | |
| 452 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_w ); | |
| 453 | 453 | break; |
| 454 | 454 | |
| 455 | 455 | default: |
| r2418 | r2419 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | DRIVER_INIT ( zx ) |
| 26 | 26 | { |
| 27 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0x8000, SMH_BANK1); | |
| 28 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0x8000, SMH_BANK1); | |
| 27 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0x8000, SMH_BANK1); | |
| 28 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0x8000, SMH_BANK1); | |
| 29 | 29 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x4000); |
| 30 | 30 | } |
| 31 | 31 |
| r2418 | r2419 | |
|---|---|---|
| 292 | 292 | |
| 293 | 293 | PageRegs[TaskReg][Page].memory=readbank; |
| 294 | 294 | memory_set_bankptr(Page+1,readbank); |
| 295 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end,0,0,writebank); | |
| 296 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, bank_start, bank_end,0,0,writebank); | |
| 295 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end,0,0,writebank); | |
| 296 | memory_install_write8_handler(Machine, 1, ADDRESS_SPACE_PROGRAM, bank_start, bank_end,0,0,writebank); | |
| 297 | 297 | |
| 298 | 298 | LOG_BANK_UPDATE(("UpdateBanks:MapPage=$%02X readbank=$%X\n",MapPage,(int)(FPTR)readbank)); |
| 299 | 299 | LOG_BANK_UPDATE(("PageRegsSet Task=%X Page=%x\n",TaskReg,Page)); |
| r2418 | r2419 | |
|---|---|---|
| 301 | 301 | |
| 302 | 302 | if (RAM10K) |
| 303 | 303 | { |
| 304 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_RAM); | |
| 304 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_RAM); | |
| 305 | 305 | } |
| 306 | 306 | else if (RAM4K) |
| 307 | 307 | { |
| 308 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x37ff, 0, 0, SMH_NOP); | |
| 309 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3fff, 0, 0, SMH_RAM); | |
| 308 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x37ff, 0, 0, SMH_NOP); | |
| 309 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3fff, 0, 0, SMH_RAM); | |
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 313 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 |
| r2418 | r2419 | |
|---|---|---|
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | 1652 | |
| 1653 | static void apple2gs_setup_memory( | |
| 1653 | static void apple2gs_setup_memory(running_machine *machine) | |
| 1654 | 1654 | { |
| 1655 | 1655 | offs_t begin, end; |
| 1656 | 1656 | apple2_memmap_config cfg; |
| r2418 | r2419 | |
| 1662 | 1662 | state_save_register_item_array("APPLE2GS_SLOWMEM", 0, apple2gs_slowmem); |
| 1663 | 1663 | |
| 1664 | 1664 | /* install expanded memory */ |
| 1665 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 1666 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 1665 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 1666 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 1667 | 1667 | memory_set_bankptr(1, mess_ram + 0x010000); |
| 1668 | 1668 | |
| 1669 | 1669 | /* install hi memory */ |
| 1670 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, SMH_BANK2); | |
| 1671 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, apple2gs_slowmem_w); | |
| 1672 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe00400, 0xe007ff, 0, 0, apple2gs_E004xx_w); | |
| 1673 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe02000, 0xe03fff, 0, 0, apple2gs_E02xxx_w); | |
| 1674 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe10400, 0xe107ff, 0, 0, apple2gs_E104xx_w); | |
| 1675 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe12000, 0xe13fff, 0, 0, apple2gs_E12xxx_w); | |
| 1670 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, SMH_BANK2); | |
| 1671 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, apple2gs_slowmem_w); | |
| 1672 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00400, 0xe007ff, 0, 0, apple2gs_E004xx_w); | |
| 1673 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe02000, 0xe03fff, 0, 0, apple2gs_E02xxx_w); | |
| 1674 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe10400, 0xe107ff, 0, 0, apple2gs_E104xx_w); | |
| 1675 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe12000, 0xe13fff, 0, 0, apple2gs_E12xxx_w); | |
| 1676 | 1676 | memory_set_bankptr(2, apple2gs_slowmem); |
| 1677 | 1677 | |
| 1678 | 1678 | /* install alternate ROM bank */ |
| 1679 | 1679 | begin = 0x1000000 - memory_region_length(REGION_CPU1); |
| 1680 | 1680 | end = 0xffffff; |
| 1681 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_BANK3); | |
| 1681 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_BANK3); | |
| 1682 | 1682 | memory_set_bankptr(3, memory_region(REGION_CPU1)); |
| 1683 | 1683 | |
| 1684 | 1684 | /* install new xxC000-xxCFFF handlers */ |
| 1685 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_r); | |
| 1686 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_w); | |
| 1687 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_r); | |
| 1688 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_w); | |
| 1689 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_r); | |
| 1690 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_w); | |
| 1691 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_r); | |
| 1692 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_w); | |
| 1685 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_r); | |
| 1686 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_w); | |
| 1687 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_r); | |
| 1688 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_w); | |
| 1689 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_r); | |
| 1690 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_w); | |
| 1691 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_r); | |
| 1692 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_w); | |
| 1693 | 1693 | memory_set_opbase_handler(0, apple2gs_opbase); |
| 1694 | 1694 | |
| 1695 | 1695 | /* install aux memory writes (for shadowing) */ |
| 1696 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x010400, 0x0107FF, 0, 0, apple2gs_aux0400_w); | |
| 1697 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x012000, 0x013FFF, 0, 0, apple2gs_aux2000_w); | |
| 1698 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x014000, 0x019FFF, 0, 0, apple2gs_aux4000_w); | |
| 1696 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010400, 0x0107FF, 0, 0, apple2gs_aux0400_w); | |
| 1697 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x012000, 0x013FFF, 0, 0, apple2gs_aux2000_w); | |
| 1698 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x014000, 0x019FFF, 0, 0, apple2gs_aux4000_w); | |
| 1699 | 1699 | |
| 1700 | 1700 | /* setup the Apple II memory system */ |
| 1701 | 1701 | memset(&cfg, 0, sizeof(cfg)); |
| r2418 | r2419 | |
| 1791 | 1791 | |
| 1792 | 1792 | /* init the various subsystems */ |
| 1793 | 1793 | scc_init(NULL); |
| 1794 | apple2gs_setup_memory(); | |
| 1794 | apple2gs_setup_memory(machine); | |
| 1795 | 1795 | |
| 1796 | 1796 | /* save state stuff. note that the driver takes care of docram. */ |
| 1797 | 1797 | state_save_register_global_array(mess_ram); |
| r2418 | r2419 | |
|---|---|---|
| 128 | 128 | begin = begin_bank << 13; |
| 129 | 129 | end = ( end_bank << 13 ) | 0x1FFF; |
| 130 | 130 | |
| 131 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_handlers[bank] ); | |
| 131 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_handlers[bank] ); | |
| 132 | 132 | memory_set_bankptr( bank, hp48_banks[begin_bank].base ); |
| 133 | 133 | |
| 134 | 134 | bank++; |
| r2418 | r2419 | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if ( hp48s.mem[HDW].adr != -1 ) { |
| 142 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, hp48s.mem[HDW].adr&~0x3f, | |
| 142 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, hp48s.mem[HDW].adr&~0x3f, | |
| 143 | 143 | hp48s.mem[HDW].adr|0x3f, 0, 0, hp48_read); |
| 144 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, hp48s.mem[HDW].adr&~0x3f, | |
| 144 | // memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, hp48s.mem[HDW].adr&~0x3f, | |
| 145 | 145 | // hp48s.mem[HDW].adr|0x3f, 0, 0, hp48_write); |
| 146 | 146 | } |
| 147 | 147 | } |
| r2418 | r2419 | |
|---|---|---|
| 378 | 378 | /* install bank 8 (C000-CFFF) */ |
| 379 | 379 | if (via_0_a & 0x40) |
| 380 | 380 | { |
| 381 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_r); | |
| 382 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_w); | |
| 381 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_r); | |
| 382 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_w); | |
| 383 | 383 | } |
| 384 | 384 | else |
| 385 | 385 | { |
| 386 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8); | |
| 386 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8); | |
| 387 | 387 | if (via_0_a & 0x08) |
| 388 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_UNMAP); | |
| 388 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_UNMAP); | |
| 389 | 389 | else |
| 390 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8); | |
| 390 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8); | |
| 391 | 391 | apple3_setbank(8, ~0, 0x4000); |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /* install bank 9 (C100-C4FF) */ |
| 395 | 395 | if (via_0_a & 0x40) |
| 396 | 396 | { |
| 397 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP); | |
| 398 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP); | |
| 397 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP); | |
| 398 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP); | |
| 399 | 399 | } |
| 400 | 400 | else |
| 401 | 401 | { |
| 402 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9); | |
| 402 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9); | |
| 403 | 403 | if (via_0_a & 0x08) |
| 404 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_UNMAP); | |
| 404 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_UNMAP); | |
| 405 | 405 | else |
| 406 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9); | |
| 406 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9); | |
| 407 | 407 | apple3_setbank(9, ~0, 0x4100); |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /* install bank 10 (C500-C7FF) */ |
| 411 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10); | |
| 411 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10); | |
| 412 | 412 | if (via_0_a & 0x08) |
| 413 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_UNMAP); | |
| 413 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_UNMAP); | |
| 414 | 414 | else |
| 415 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10); | |
| 415 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10); | |
| 416 | 416 | apple3_setbank(10, ~0, 0x4500); |
| 417 | 417 | |
| 418 | 418 | /* install bank 11 (C800-CFFF) */ |
| 419 | 419 | if (via_0_a & 0x40) |
| 420 | 420 | { |
| 421 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP); | |
| 422 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP); | |
| 421 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP); | |
| 422 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP); | |
| 423 | 423 | } |
| 424 | 424 | else |
| 425 | 425 | { |
| 426 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11); | |
| 426 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11); | |
| 427 | 427 | if (via_0_a & 0x08) |
| 428 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_UNMAP); | |
| 428 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_UNMAP); | |
| 429 | 429 | else |
| 430 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11); | |
| 430 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11); | |
| 431 | 431 | apple3_setbank(11, ~0, 0x4800); |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /* install bank 6 (D000-EFFF) */ |
| 435 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6); | |
| 435 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6); | |
| 436 | 436 | if (via_0_a & 0x08) |
| 437 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_UNMAP); | |
| 437 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_UNMAP); | |
| 438 | 438 | else |
| 439 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6); | |
| 439 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6); | |
| 440 | 440 | apple3_setbank(6, ~0, 0x5000); |
| 441 | 441 | |
| 442 | 442 | /* install bank 7 (F000-FFFF) */ |
| 443 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7); | |
| 443 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7); | |
| 444 | 444 | if (via_0_a & 0x09) |
| 445 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_UNMAP); | |
| 445 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_UNMAP); | |
| 446 | 446 | else |
| 447 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7); | |
| 447 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7); | |
| 448 | 448 | if (via_0_a & 0x01) |
| 449 | 449 | memory_set_bankptr(7, memory_region(REGION_CPU1)); |
| 450 | 450 | else |
| 451 | 451 | apple3_setbank(7, ~0, 0x7000); |
| 452 | 452 | |
| 453 | 453 | /* reinstall VIA handlers */ |
| 454 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_r); | |
| 455 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_w); | |
| 456 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_r); | |
| 457 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_w); | |
| 454 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_r); | |
| 455 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_w); | |
| 456 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_r); | |
| 457 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_w); | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 |
| r2418 | r2419 | |
|---|---|---|
| 6 | 6 | ***************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 9 | 10 | #include "includes/c65.h" |
| 10 | 11 | #include "includes/c64.h" |
| 11 | 12 | |
| r2418 | r2419 | |
| 446 | 447 | expansion_ram_begin = 0x80000; |
| 447 | 448 | expansion_ram_end = 0x80000 + (mess_ram_size - 128*1024) - 1; |
| 448 | 449 | |
| 449 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, expansion_ram_begin, expansion_ram_end, | |
| 450 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, expansion_ram_begin, expansion_ram_end, | |
| 450 | 451 | 0, 0, (data == 0x00) ? SMH_BANK16 : SMH_NOP); |
| 451 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, expansion_ram_begin, expansion_ram_end, | |
| 452 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, expansion_ram_begin, expansion_ram_end, | |
| 452 | 453 | 0, 0, (data == 0x00) ? SMH_BANK16 : SMH_NOP); |
| 453 | 454 | |
| 454 | 455 | if (data == 0x00) |
| r2418 | r2419 | |
| 591 | 592 | rh = c65_read_io_dc00; |
| 592 | 593 | wh = c65_write_io_dc00; |
| 593 | 594 | } |
| 594 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, rh); | |
| 595 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, wh); | |
| 595 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, rh); | |
| 596 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, wh); | |
| 596 | 597 | } |
| 597 | 598 | |
| 598 | 599 | c65_io_dc00_on=!(value&1); |
| r2418 | r2419 | |
| 677 | 678 | memory_set_bankptr (8, c64_colorram+0x400); |
| 678 | 679 | memory_set_bankptr (9, c64_colorram+0x400); |
| 679 | 680 | } |
| 680 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, rh8); | |
| 681 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, wh9); | |
| 681 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, rh8); | |
| 682 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0dc00, 0x0dfff, 0, 0, wh9); | |
| 682 | 683 | } |
| 683 | 684 | else |
| 684 | 685 | { |
| r2418 | r2419 | |
| 701 | 702 | memory_set_bankptr (8, c64_memory + 0xdc00); |
| 702 | 703 | } |
| 703 | 704 | } |
| 704 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0d000, 0x0d7ff, 0, 0, rh4); | |
| 705 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0d000, 0x0d7ff, 0, 0, wh5); | |
| 705 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0d000, 0x0d7ff, 0, 0, rh4); | |
| 706 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0d000, 0x0d7ff, 0, 0, wh5); | |
| 706 | 707 | |
| 707 | 708 | if (!c64_game && c64_exrom) |
| 708 | 709 | { |
| r2418 | r2419 | |
|---|---|---|
| 116 | 116 | rh = (read16_machine_func) (FPTR)bank; |
| 117 | 117 | wh = is_rom ? SMH_UNMAP : (write16_machine_func) (FPTR)bank; |
| 118 | 118 | |
| 119 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, memory_begin, | |
| 119 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, memory_begin, | |
| 120 | 120 | memory_end, memory_mask, 0, rh); |
| 121 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, memory_begin, | |
| 121 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, memory_begin, | |
| 122 | 122 | memory_end, memory_mask, 0, wh); |
| 123 | 123 | |
| 124 | 124 | memory_set_bankptr(bank, memory_data); |
| r2418 | r2419 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 10 | 11 | #include "mpc105.h" |
| 11 | 12 | #include "machine/pci.h" |
| 12 | 13 | |
| r2418 | r2419 | |
| 23 | 24 | static struct mpc105_info *mpc105; |
| 24 | 25 | |
| 25 | 26 | |
| 26 | static void mpc105_update_memory( | |
| 27 | static void mpc105_update_memory(running_machine *machine) | |
| 27 | 28 | { |
| 28 | 29 | int cpunum, bank; |
| 29 | 30 | offs_t begin, end; |
| 30 | 31 | |
| 31 | 32 | if (LOG_MPC105) |
| 32 | logerror("mpc105_update_memory(): Updating memory (bank enable=0x%02X)\n", mpc105->bank_enable); | |
| 33 | logerror("mpc105_update_memory(machine): Updating memory (bank enable=0x%02X)\n", mpc105->bank_enable); | |
| 33 | 34 | |
| 34 | 35 | if (mpc105->bank_base > 0) |
| 35 | 36 | { |
| 36 | 37 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 37 | 38 | { |
| 38 | 39 | /* first clear everything out */ |
| 39 | memory_install_read64_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x00000000, 0x3FFFFFFF, 0, 0, SMH_NOP); | |
| 40 | memory_install_write64_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x00000000, 0x3FFFFFFF, 0, 0, SMH_NOP); | |
| 40 | memory_install_read64_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, 0x00000000, 0x3FFFFFFF, 0, 0, SMH_NOP); | |
| 41 | memory_install_write64_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, 0x00000000, 0x3FFFFFFF, 0, 0, SMH_NOP); | |
| 41 | 42 | } |
| 42 | 43 | } |
| 43 | 44 | |
| r2418 | r2419 | |
| 63 | 64 | { |
| 64 | 65 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 65 | 66 | { |
| 66 | memory_install_read64_handler(cpunum, ADDRESS_SPACE_PROGRAM, begin, end, | |
| 67 | memory_install_read64_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, begin, end, | |
| 67 | 68 | 0, 0, (read64_machine_func) (FPTR)(bank + mpc105->bank_base)); |
| 68 | memory_install_write64_handler(cpunum, ADDRESS_SPACE_PROGRAM, begin, end, | |
| 69 | memory_install_write64_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, begin, end, | |
| 69 | 70 | 0, 0, (write64_machine_func) (FPTR)(bank + mpc105->bank_base)); |
| 70 | 71 | } |
| 71 | 72 | memory_set_bankptr(bank + mpc105->bank_base, mess_ram); |
| r2418 | r2419 | |
| 173 | 174 | if (mpc105->bank_registers[i] != data) |
| 174 | 175 | { |
| 175 | 176 | mpc105->bank_registers[i] = data; |
| 176 | mpc105_update_memory(); | |
| 177 | mpc105_update_memory(Machine); | |
| 177 | 178 | } |
| 178 | 179 | break; |
| 179 | 180 | |
| r2418 | r2419 | |
| 181 | 182 | if (mpc105->bank_enable != (UINT8) data) |
| 182 | 183 | { |
| 183 | 184 | mpc105->bank_enable = (UINT8) data; |
| 184 | mpc105_update_memory(); | |
| 185 | mpc105_update_memory(Machine); | |
| 185 | 186 | } |
| 186 | 187 | break; |
| 187 | 188 |
| r2418 | r2419 | |
|---|---|---|
| 40 | 40 | case 4: |
| 41 | 41 | memory_set_bankptr (4, mem); |
| 42 | 42 | memory_set_bankptr (5, mem + 0x1ff8); |
| 43 | memory_install_read8_handler | |
| 43 | memory_install_read8_handler | |
| 44 | 44 | break; |
| 45 | 45 | case 5: |
| 46 | 46 | memory_set_bankptr (6, mem); |
| 47 | 47 | memory_set_bankptr (7, mem + 0x1800); |
| 48 | memory_install_read8_handler | |
| 48 | memory_install_read8_handler | |
| 49 | 49 | break; |
| 50 | 50 | case 6: |
| 51 | 51 | memory_set_bankptr (8, mem); |
| 52 | 52 | memory_set_bankptr (9, mem + 0x1800); |
| 53 | memory_install_read8_handler | |
| 53 | memory_install_read8_handler | |
| 54 | 54 | break; |
| 55 | 55 | case 7: |
| 56 | 56 | memory_set_bankptr (10, mem); |
| r2418 | r2419 | |
| 360 | 360 | case 2: |
| 361 | 361 | msx_cpu_setbank (5, state->mem + state->banks[2] * 0x2000); |
| 362 | 362 | msx_cpu_setbank (6, state->mem + state->banks[3] * 0x2000); |
| 363 | memory_install_read8_handler | |
| 363 | memory_install_read8_handler | |
| 364 | 364 | state->cart.scc.active ? konami_scc_bank5 : SMH_BANK7); |
| 365 | 365 | break; |
| 366 | 366 | case 3: |
| r2418 | r2419 | |
| 1179 | 1179 | case 1: |
| 1180 | 1180 | msx_cpu_setbank (3, state->mem); |
| 1181 | 1181 | msx_cpu_setbank (4, state->mem + 0x2000); |
| 1182 | memory_install_read8_handler | |
| 1182 | memory_install_read8_handler | |
| 1183 | 1183 | break; |
| 1184 | 1184 | case 2: |
| 1185 | 1185 | msx_cpu_setbank (5, msx1.empty); |
| 1186 | 1186 | msx_cpu_setbank (6, msx1.empty); |
| 1187 | memory_install_read8_handler | |
| 1187 | memory_install_read8_handler | |
| 1188 | 1188 | break; |
| 1189 | 1189 | case 3: |
| 1190 | 1190 | msx_cpu_setbank (7, msx1.empty); |
| r2418 | r2419 | |
| 1291 | 1291 | case 1: |
| 1292 | 1292 | msx_cpu_setbank (3, state->mem); |
| 1293 | 1293 | msx_cpu_setbank (4, state->mem + 0x2000); |
| 1294 | memory_install_read8_handler | |
| 1294 | memory_install_read8_handler | |
| 1295 | 1295 | break; |
| 1296 | 1296 | case 2: |
| 1297 | 1297 | msx_cpu_setbank (5, msx1.empty); |
| 1298 | 1298 | msx_cpu_setbank (6, msx1.empty); |
| 1299 | memory_install_read8_handler | |
| 1299 | memory_install_read8_handler | |
| 1300 | 1300 | break; |
| 1301 | 1301 | case 3: |
| 1302 | 1302 | msx_cpu_setbank (7, msx1.empty); |
| r2418 | r2419 | |
| 2048 | 2048 | case 2: |
| 2049 | 2049 | msx_cpu_setbank (5, state->mem + state->banks[2] * 0x2000); |
| 2050 | 2050 | msx_cpu_setbank (6, state->mem + state->banks[3] * 0x2000); |
| 2051 | memory_install_read8_handler | |
| 2051 | memory_install_read8_handler | |
| 2052 | 2052 | state->cart.sccp.scc_active ? soundcartridge_scc : SMH_BANK7); |
| 2053 | memory_install_read8_handler | |
| 2053 | memory_install_read8_handler | |
| 2054 | 2054 | state->cart.sccp.sccp_active ? soundcartridge_sccp : SMH_BANK9); |
| 2055 | 2055 | break; |
| 2056 | 2056 | case 3: |
| r2418 | r2419 | |
|---|---|---|
| 165 | 165 | { |
| 166 | 166 | timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1350_power_up); |
| 167 | 167 | |
| 168 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1); | |
| 169 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1); | |
| 168 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1); | |
| 169 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK1); | |
| 170 | 170 | memory_set_bankptr(1, &mess_ram[0x0000]); |
| 171 | 171 | |
| 172 | 172 | if (mess_ram_size >= 0x3000) |
| 173 | 173 | { |
| 174 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK2); | |
| 175 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK2); | |
| 174 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK2); | |
| 175 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK2); | |
| 176 | 176 | memory_set_bankptr(2, &mess_ram[0x1000]); |
| 177 | 177 | } |
| 178 | 178 | else |
| 179 | 179 | { |
| 180 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_NOP); | |
| 181 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_NOP); | |
| 180 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_NOP); | |
| 181 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_NOP); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if (mess_ram_size >= 0x5000) |
| 185 | 185 | { |
| 186 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK3); | |
| 187 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK3); | |
| 186 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK3); | |
| 187 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK3); | |
| 188 | 188 | memory_set_bankptr(3, &mess_ram[0x3000]); |
| 189 | 189 | } |
| 190 | 190 | else |
| 191 | 191 | { |
| 192 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 193 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 192 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 193 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_NOP); | |
| 194 | 194 | } |
| 195 | 195 | } |
| r2418 | r2419 | |
|---|---|---|
| 170 | 170 | /* Memory map related CoCo 1/2 and Dragons only */ |
| 171 | 171 | static UINT8 *bas_rom_bank; /* Dragon 64 / Alpha rom bank in use, basic rom bank on coco */ |
| 172 | 172 | static UINT8 *bottom_32k; /* ram to be mapped into bottom 32K */ |
| 173 | static void setup_memory_map( | |
| 173 | static void setup_memory_map(running_machine *machine); | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | /* These sets of defines control logging. When MAME_DEBUG is off, all logging |
| r2418 | r2419 | |
| 1619 | 1619 | bas_rom_bank = bank; /* Record which rom we are using so that the irq routine */ |
| 1620 | 1620 | /* uses the vectors from the correct rom ! (alpha) */ |
| 1621 | 1621 | |
| 1622 | setup_memory_map(); /* Setup memory map as needed */ | |
| 1622 | setup_memory_map(Machine); /* Setup memory map as needed */ | |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | /********************************************************************************************/ |
| r2418 | r2419 | |
| 1822 | 1822 | default : bottom_32k=&mess_ram[0x00000]; break; // Just to shut the compiler up ! |
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | setup_memory_map(); | |
| 1825 | setup_memory_map(Machine); | |
| 1826 | 1826 | } |
| 1827 | 1827 | |
| 1828 | 1828 | |
| r2418 | r2419 | |
| 1863 | 1863 | return bas_rom_bank[0x3ff0 + offset]; |
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | static void setup_memory_map( | |
| 1866 | static void setup_memory_map(running_machine *machine) | |
| 1867 | 1867 | { |
| 1868 | 1868 | /* |
| 1869 | 1869 | The following table contains the RAM block mappings for the CoCo 1/2 and Dragon computers |
| r2418 | r2419 | |
| 1953 | 1953 | else |
| 1954 | 1954 | memory_set_bankptr(block_index+1,&mess_ram[memmap[wbank-1].start]); |
| 1955 | 1955 | |
| 1956 | memory_install_read_handler(0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, block_index+1); | |
| 1957 | memory_install_write_handler(0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, block_index+1); | |
| 1956 | memory_install_read_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, block_index+1); | |
| 1957 | memory_install_write_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, block_index+1); | |
| 1958 | 1958 | } |
| 1959 | 1959 | else |
| 1960 | 1960 | { |
| 1961 | memory_install_read_handler(0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, STATIC_NOP); | |
| 1962 | memory_install_write_handler(0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, STATIC_NOP); | |
| 1961 | memory_install_read_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, STATIC_NOP); | |
| 1962 | memory_install_write_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memmap[block_index].start, memmap[block_index].end, 0, 0, STATIC_NOP); | |
| 1963 | 1963 | } |
| 1964 | 1964 | } |
| 1965 | 1965 | |
| r2418 | r2419 | |
| 1977 | 1977 | offset=&coco_rom[0x4000+(0x1000*(block_index-4))]; |
| 1978 | 1978 | |
| 1979 | 1979 | memory_set_bankptr(block_index + 9,offset); |
| 1980 | memory_install_write_handler(0, ADDRESS_SPACE_PROGRAM, memmap[block_index+8].start, memmap[block_index+8].end, 0, 0, STATIC_NOP); | |
| 1980 | memory_install_write_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memmap[block_index+8].start, memmap[block_index+8].end, 0, 0, STATIC_NOP); | |
| 1981 | 1981 | } |
| 1982 | 1982 | } |
| 1983 | 1983 | } |
| r2418 | r2419 | |
| 1999 | 1999 | else |
| 2000 | 2000 | bottom_32k=mess_ram; |
| 2001 | 2001 | |
| 2002 | setup_memory_map(); | |
| 2002 | setup_memory_map(Machine); | |
| 2003 | 2003 | } |
| 2004 | 2004 | } |
| 2005 | 2005 | |
| r2418 | r2419 | |
| 2029 | 2029 | * TODO: Verify that the CoCo 3 ignored this |
| 2030 | 2030 | */ |
| 2031 | 2031 | |
| 2032 | setup_memory_map(); | |
| 2032 | setup_memory_map(Machine); | |
| 2033 | 2033 | } |
| 2034 | 2034 | |
| 2035 | 2035 | |
| r2418 | r2419 | |
| 2130 | 2130 | if(val) |
| 2131 | 2131 | bottom_32k=mess_ram; // Always reset, when in maptype 1 |
| 2132 | 2132 | |
| 2133 | setup_memory_map(); | |
| 2133 | setup_memory_map(Machine); | |
| 2134 | 2134 | } |
| 2135 | 2135 | |
| 2136 | 2136 | /************************************* |
| r2418 | r2419 | |
| 2274 | 2274 | |
| 2275 | 2275 | /* set up the banks */ |
| 2276 | 2276 | memory_set_bankptr(i + 1, readbank); |
| 2277 | memory_install_write_handler(0, ADDRESS_SPACE_PROGRAM, bank_info[i].start, bank_info[i].end, 0, 0, writebank); | |
| 2277 | memory_install_write_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, bank_info[i].start, bank_info[i].end, 0, 0, writebank); | |
| 2278 | 2278 | |
| 2279 | 2279 | if (LOG_MMU) |
| 2280 | 2280 | { |
| r2418 | r2419 | |
|---|---|---|
| 386 | 386 | |
| 387 | 387 | static void dmac_install(offs_t base) |
| 388 | 388 | { |
| 389 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, amiga_dmac_r); | |
| 390 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, amiga_dmac_w); | |
| 389 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, amiga_dmac_r); | |
| 390 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, amiga_dmac_w); | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | static void dmac_uninstall(offs_t base) |
| 394 | 394 | { |
| 395 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, SMH_UNMAP); | |
| 396 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, SMH_UNMAP); | |
| 395 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, SMH_UNMAP); | |
| 396 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, SMH_UNMAP); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static const amiga_autoconfig_device dmac_device = |
| r2418 | r2419 | |
|---|---|---|
| 56 | 56 | FUNCTION PROTOTYPES |
| 57 | 57 | ***************************************************************************/ |
| 58 | 58 | |
| 59 | static void init_nes_core( | |
| 59 | static void init_nes_core(running_machine *machine); | |
| 60 | 60 | static void nes_machine_stop(running_machine *machine); |
| 61 | 61 | |
| 62 | 62 | |
| r2418 | r2419 | |
| 70 | 70 | return image_from_devtype_and_index(IO_CARTSLOT, 0); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | static void init_nes_core ( | |
| 73 | static void init_nes_core (running_machine *machine) | |
| 74 | 74 | { |
| 75 | 75 | /* We set these here in case they weren't set in the cart loader */ |
| 76 | 76 | nes.rom = memory_region(REGION_CPU1); |
| r2418 | r2419 | |
| 80 | 80 | |
| 81 | 81 | /* Brutal hack put in as a consequence of the new memory system; we really |
| 82 | 82 | * need to fix the NES code */ |
| 83 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07ff, 0, 0x1800, SMH_BANK10); | |
| 84 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07ff, 0, 0x1800, SMH_BANK10); | |
| 83 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07ff, 0, 0x1800, SMH_BANK10); | |
| 84 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07ff, 0, 0x1800, SMH_BANK10); | |
| 85 | 85 | memory_set_bankptr(10, nes.rom); |
| 86 | 86 | |
| 87 | 87 | battery_ram = nes.wram; |
| r2418 | r2419 | |
| 92 | 92 | case 20: |
| 93 | 93 | nes.slow_banking = 0; |
| 94 | 94 | nes_fds.data = auto_malloc( 0x8000 ); |
| 95 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4030, 0x403f, 0, 0, fds_r); | |
| 96 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xdfff, 0, 0, SMH_BANK2); | |
| 97 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK1); | |
| 95 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4030, 0x403f, 0, 0, fds_r); | |
| 96 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xdfff, 0, 0, SMH_BANK2); | |
| 97 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK1); | |
| 98 | 98 | |
| 99 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4020, 0x402f, 0, 0, fds_w); | |
| 100 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xdfff, 0, 0, SMH_BANK2); | |
| 99 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4020, 0x402f, 0, 0, fds_w); | |
| 100 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xdfff, 0, 0, SMH_BANK2); | |
| 101 | 101 | |
| 102 | 102 | memory_set_bankptr(1, &nes.rom[0xe000]); |
| 103 | 103 | memory_set_bankptr(2, nes_fds.data ); |
| r2418 | r2419 | |
| 105 | 105 | case 40: |
| 106 | 106 | nes.slow_banking = 1; |
| 107 | 107 | /* Game runs code in between banks, so we do things different */ |
| 108 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_RAM); | |
| 109 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_ROM); | |
| 108 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_RAM); | |
| 109 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_ROM); | |
| 110 | 110 | |
| 111 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w); | |
| 112 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, nes_mapper_w); | |
| 111 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w); | |
| 112 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, nes_mapper_w); | |
| 113 | 113 | break; |
| 114 | 114 | default: |
| 115 | 115 | nes.slow_banking = 0; |
| 116 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK5); | |
| 117 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 118 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK2); | |
| 119 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK3); | |
| 120 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK4); | |
| 116 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK5); | |
| 117 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 118 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK2); | |
| 119 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK3); | |
| 120 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK4); | |
| 121 | 121 | |
| 122 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w); | |
| 123 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, nes_mapper_w); | |
| 122 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w); | |
| 123 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, nes_mapper_w); | |
| 124 | 124 | break; |
| 125 | 125 | } |
| 126 | 126 | |
| r2418 | r2419 | |
| 185 | 185 | |
| 186 | 186 | MACHINE_START( nes ) |
| 187 | 187 | { |
| 188 | init_nes_core(); | |
| 188 | init_nes_core(machine); | |
| 189 | 189 | add_exit_callback(machine, nes_machine_stop); |
| 190 | 190 | } |
| 191 | 191 |
| r2418 | r2419 | |
|---|---|---|
| 208 | 208 | case MBC_NONE: |
| 209 | 209 | break; |
| 210 | 210 | case MBC_MMM01: |
| 211 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_rom_bank_mmm01_0000_w ); | |
| 212 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_mmm01_2000_w); | |
| 213 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_rom_bank_mmm01_4000_w); | |
| 214 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_rom_bank_mmm01_6000_w); | |
| 211 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_rom_bank_mmm01_0000_w ); | |
| 212 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_mmm01_2000_w); | |
| 213 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_rom_bank_mmm01_4000_w); | |
| 214 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_rom_bank_mmm01_6000_w); | |
| 215 | 215 | break; |
| 216 | 216 | case MBC_MBC1: |
| 217 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 218 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc1 ); | |
| 219 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc1 ); | |
| 220 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc1 ); | |
| 217 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 218 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc1 ); | |
| 219 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc1 ); | |
| 220 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc1 ); | |
| 221 | 221 | break; |
| 222 | 222 | case MBC_MBC2: |
| 223 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc2 ); | |
| 223 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc2 ); | |
| 224 | 224 | break; |
| 225 | 225 | case MBC_MBC3: |
| 226 | 226 | case MBC_HUC1: /* Possibly wrong */ |
| 227 | 227 | case MBC_HUC3: /* Possibly wrong */ |
| 228 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 229 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc3 ); | |
| 230 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc3 ); | |
| 231 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc3 ); | |
| 228 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 229 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc3 ); | |
| 230 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc3 ); | |
| 231 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc3 ); | |
| 232 | 232 | break; |
| 233 | 233 | case MBC_MBC5: |
| 234 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); | |
| 235 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc5 ); | |
| 236 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc5 ); | |
| 234 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); | |
| 235 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc5 ); | |
| 236 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc5 ); | |
| 237 | 237 | break; |
| 238 | 238 | case MBC_MBC6: |
| 239 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_bank_select_mbc6 ); | |
| 240 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, gb_rom_bank_select_mbc6_1 ); | |
| 241 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, gb_rom_bank_select_mbc6_2 ); | |
| 239 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_bank_select_mbc6 ); | |
| 240 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, gb_rom_bank_select_mbc6_1 ); | |
| 241 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, gb_rom_bank_select_mbc6_2 ); | |
| 242 | 242 | break; |
| 243 | 243 | case MBC_MBC7: |
| 244 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); | |
| 245 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, gb_rom_bank_select_mbc7 ); | |
| 246 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x7fff, 0, 0, gb_rom_bank_unknown_mbc7 ); | |
| 244 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); | |
| 245 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, gb_rom_bank_select_mbc7 ); | |
| 246 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x7fff, 0, 0, gb_rom_bank_unknown_mbc7 ); | |
| 247 | 247 | break; |
| 248 | 248 | case MBC_TAMA5: |
| 249 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, gb_ram_tama5 ); | |
| 249 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, gb_ram_tama5 ); | |
| 250 | 250 | break; |
| 251 | 251 | case MBC_WISDOM: |
| 252 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, gb_rom_bank_select_wisdom ); | |
| 252 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, gb_rom_bank_select_wisdom ); | |
| 253 | 253 | break; |
| 254 | 254 | case MBC_MBC1_KOR: |
| 255 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 256 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc1_kor ); | |
| 257 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc1_kor ); | |
| 258 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc1_kor ); | |
| 255 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, gb_ram_enable ); /* We don't emulate RAM enable yet */ | |
| 256 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, gb_rom_bank_select_mbc1_kor ); | |
| 257 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, gb_ram_bank_select_mbc1_kor ); | |
| 258 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, gb_mem_mode_select_mbc1_kor ); | |
| 259 | 259 | break; |
| 260 | 260 | |
| 261 | 261 | case MBC_MEGADUCK: |
| 262 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0001, 0x0001, 0, 0, megaduck_rom_bank_select_type1 ); | |
| 263 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xB000, 0xB000, 0, 0, megaduck_rom_bank_select_type2 ); | |
| 262 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0001, 0x0001, 0, 0, megaduck_rom_bank_select_type1 ); | |
| 263 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xB000, 0xB000, 0, 0, megaduck_rom_bank_select_type2 ); | |
| 264 | 264 | break; |
| 265 | 265 | } |
| 266 | 266 |
| r2418 | r2419 | |
|---|---|---|
| 268 | 268 | /************************ BANK ***********************************************/ |
| 269 | 269 | |
| 270 | 270 | /* BANK1 0000-0FFF */ |
| 271 | static void bank1_RAM(UINT8 *mem) | |
| 271 | static void bank1_RAM(running_machine *machine, UINT8 *mem) | |
| 272 | 272 | { |
| 273 | 273 | memory_set_bankptr(1, &mem[0x00000]); |
| 274 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 275 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 274 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 275 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | static void bank1_ROM(UINT8 *mem) | |
| 278 | static void bank1_ROM(running_machine *machine, UINT8 *mem) | |
| 279 | 279 | { |
| 280 | 280 | memory_set_bankptr(1, &mem[0x10000]); |
| 281 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 282 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 281 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 282 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | /* BANK2 1000-1FFF */ |
| 287 | static void bank2_RAM(UINT8 *mem) | |
| 287 | static void bank2_RAM(running_machine *machine, UINT8 *mem) | |
| 288 | 288 | { |
| 289 | 289 | memory_set_bankptr(2, &mem[0x01000]); |
| 290 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 291 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 290 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 291 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | static void bank2_ROM(UINT8 *mem) | |
| 294 | static void bank2_ROM(running_machine *machine, UINT8 *mem) | |
| 295 | 295 | { |
| 296 | 296 | memory_set_bankptr(2, &mem[0x11000]); |
| 297 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 298 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_UNMAP); | |
| 297 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 298 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_UNMAP); | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | /* BANK3 8000-9FFF */ |
| 303 | static void bank3_RAM(UINT8 *mem) | |
| 303 | static void bank3_RAM(running_machine *machine, UINT8 *mem) | |
| 304 | 304 | { |
| 305 | 305 | memory_set_bankptr(3, &mem[0x08000]); |
| 306 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 307 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 306 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 307 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | static void bank3_VID(UINT8 *mem) | |
| 310 | static void bank3_VID(running_machine *machine, UINT8 *mem) | |
| 311 | 311 | { |
| 312 | 312 | memory_set_bankptr(3, videoram); |
| 313 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 314 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 313 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 314 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK3); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | /* BANK4 A000-BFFF */ |
| 319 | static void bank4_RAM(UINT8 *mem) | |
| 319 | static void bank4_RAM(running_machine *machine, UINT8 *mem) | |
| 320 | 320 | { |
| 321 | 321 | memory_set_bankptr(4, &mem[0x0a000]); |
| 322 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 323 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 322 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 323 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | static void bank4_VID(UINT8 *mem) | |
| 326 | static void bank4_VID(running_machine *machine, UINT8 *mem) | |
| 327 | 327 | { |
| 328 | 328 | memory_set_bankptr(4, videoram + 0x2000); |
| 329 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 330 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 329 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 330 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA000, 0xBFFF, 0, 0, SMH_BANK4); | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| 334 | 334 | /* BANK7 C000-CFFF */ |
| 335 | static void bank5_RAM(UINT8 *mem) | |
| 335 | static void bank5_RAM(running_machine *machine, UINT8 *mem) | |
| 336 | 336 | { |
| 337 | 337 | memory_set_bankptr(5, &mem[0x0c000]); |
| 338 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xCFFF, 0, 0, SMH_BANK5); | |
| 339 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xCFFF, 0, 0, SMH_BANK5); | |
| 338 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xCFFF, 0, 0, SMH_BANK5); | |
| 339 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xCFFF, 0, 0, SMH_BANK5); | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | /* BANK6 D000-D7FF */ |
| 344 | static void bank6_NOP(UINT8 *mem) | |
| 344 | static void bank6_NOP(running_machine *machine, UINT8 *mem) | |
| 345 | 345 | { |
| 346 | 346 | memory_set_bankptr(6, &mem[0x0d000]); |
| 347 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_NOP); | |
| 348 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_NOP); | |
| 347 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_NOP); | |
| 348 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_NOP); | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | static void bank6_RAM(UINT8 *mem) | |
| 351 | static void bank6_RAM(running_machine *machine, UINT8 *mem) | |
| 352 | 352 | { |
| 353 | 353 | memory_set_bankptr(6, &mem[0x0d000]); |
| 354 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 355 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 354 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 355 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | static void bank6_VIO(UINT8 *mem) | |
| 358 | static void bank6_VIO(running_machine *machine, UINT8 *mem) | |
| 359 | 359 | { |
| 360 | 360 | memory_set_bankptr(6, videoram); |
| 361 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 362 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 361 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 362 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xD7FF, 0, 0, SMH_BANK6); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
| 366 | 366 | /* BANK9 D800-DFFF */ |
| 367 | static void bank7_NOP(UINT8 *mem) | |
| 367 | static void bank7_NOP(running_machine *machine, UINT8 *mem) | |
| 368 | 368 | { |
| 369 | 369 | memory_set_bankptr(7, &mem[0x0d800]); |
| 370 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_NOP); | |
| 371 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_NOP); | |
| 370 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_NOP); | |
| 371 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_NOP); | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | static void bank7_RAM(UINT8 *mem) | |
| 374 | static void bank7_RAM(running_machine *machine, UINT8 *mem) | |
| 375 | 375 | { |
| 376 | 376 | memory_set_bankptr(7, &mem[0x0d800]); |
| 377 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 378 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 377 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 378 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | static void bank7_VIO(UINT8 *mem) | |
| 381 | static void bank7_VIO(running_machine *machine, UINT8 *mem) | |
| 382 | 382 | { |
| 383 | 383 | memory_set_bankptr(7, colorram); |
| 384 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 385 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 384 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 385 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD800, 0xDFFF, 0, 0, SMH_BANK7); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | /* BANK8 E000-FFFF */ |
| 390 | static void bank8_NOP(UINT8 *mem) | |
| 390 | static void bank8_NOP(running_machine *machine, UINT8 *mem) | |
| 391 | 391 | { |
| 392 | 392 | memory_set_bankptr(8, &mem[0x0e000]); |
| 393 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_NOP); | |
| 394 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_NOP); | |
| 393 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_NOP); | |
| 394 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_NOP); | |
| 395 | 395 | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | static void bank8_RAM(UINT8 *mem) | |
| 398 | static void bank8_RAM(running_machine *machine, UINT8 *mem) | |
| 399 | 399 | { |
| 400 | 400 | memory_set_bankptr(8, &mem[0x0e000]); |
| 401 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_BANK8); | |
| 402 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_BANK8); | |
| 401 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_BANK8); | |
| 402 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, SMH_BANK8); | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | static void bank8_VIO(UINT8 *mem) | |
| 405 | static void bank8_VIO(running_machine *machine, UINT8 *mem) | |
| 406 | 406 | { |
| 407 | 407 | memory_set_bankptr(8, &mem[0x16000]); |
| 408 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, mz700_mmio_r); | |
| 409 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, mz700_mmio_w); | |
| 408 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, mz700_mmio_r); | |
| 409 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xFFFF, 0, 0, mz700_mmio_w); | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | |
| r2418 | r2419 | |
| 421 | 421 | { |
| 422 | 422 | case 0: /* 0000-0FFF RAM */ |
| 423 | 423 | LOG(1,"mz700_bank_w",("0: 0000-0FFF RAM\n")); |
| 424 | bank1_RAM(mem); | |
| 424 | bank1_RAM(machine, mem); | |
| 425 | 425 | mz700_locked = 0; |
| 426 | 426 | break; |
| 427 | 427 | |
| 428 | 428 | case 1: /* D000-FFFF RAM */ |
| 429 | 429 | LOG(1,"mz700_bank_w",("1: D000-FFFF RAM\n")); |
| 430 | bank6_RAM(mem); | |
| 431 | bank7_RAM(mem); | |
| 432 | bank8_RAM(mem); | |
| 430 | bank6_RAM(machine, mem); | |
| 431 | bank7_RAM(machine, mem); | |
| 432 | bank8_RAM(machine, mem); | |
| 433 | 433 | mz700_locked = 0; |
| 434 | 434 | vio_mode = 1; |
| 435 | 435 | break; |
| 436 | 436 | |
| 437 | 437 | case 2: /* 0000-0FFF ROM */ |
| 438 | 438 | LOG(1,"mz700_bank_w",("2: 0000-0FFF ROM\n")); |
| 439 | bank1_ROM(mem); | |
| 439 | bank1_ROM(machine, mem); | |
| 440 | 440 | mz700_locked = 0; |
| 441 | 441 | break; |
| 442 | 442 | |
| 443 | 443 | case 3: /* D000-FFFF videoram, memory mapped io */ |
| 444 | 444 | LOG(1,"mz700_bank_w",("3: D000-FFFF videoram, memory mapped io\n")); |
| 445 | bank6_VIO(mem); | |
| 446 | bank7_VIO(mem); | |
| 447 | bank8_VIO(mem); | |
| 445 | bank6_VIO(machine, mem); | |
| 446 | bank7_VIO(machine, mem); | |
| 447 | bank8_VIO(machine, mem); | |
| 448 | 448 | mz700_locked = 0; |
| 449 | 449 | vio_mode = 3; |
| 450 | 450 | break; |
| 451 | 451 | |
| 452 | 452 | case 4: /* 0000-0FFF ROM D000-FFFF videoram, memory mapped io */ |
| 453 | 453 | LOG(1,"mz700_bank_w",("4: 0000-0FFF ROM; D000-FFFF videoram, memory mapped io\n")); |
| 454 | bank1_ROM(mem); | |
| 455 | bank6_VIO(mem); | |
| 456 | bank7_VIO(mem); | |
| 457 | bank8_VIO(mem); | |
| 454 | bank1_ROM(machine, mem); | |
| 455 | bank6_VIO(machine, mem); | |
| 456 | bank7_VIO(machine, mem); | |
| 457 | bank8_VIO(machine, mem); | |
| 458 | 458 | mz700_locked = 0; |
| 459 | 459 | vio_mode = 3; |
| 460 | 460 | break; |
| r2418 | r2419 | |
| 465 | 465 | { |
| 466 | 466 | vio_lock = vio_mode; |
| 467 | 467 | mz700_locked = 1; |
| 468 | bank6_NOP(mem); | |
| 469 | bank7_NOP(mem); | |
| 470 | bank8_NOP(mem); | |
| 468 | bank6_NOP(machine, mem); | |
| 469 | bank7_NOP(machine, mem); | |
| 470 | bank8_NOP(machine, mem); | |
| 471 | 471 | } |
| 472 | 472 | break; |
| 473 | 473 | |
| r2418 | r2419 | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | /* port E0 - E9 */ |
| 526 | ||
| 526 | ||
| 527 | 527 | { |
| 528 | 528 | UINT8 *mem = memory_region(REGION_CPU1); |
| 529 | 529 | UINT8 data = 0xff; |
| r2418 | r2419 | |
| 532 | 532 | { |
| 533 | 533 | case 0: /* 1000-1FFF PCG ROM */ |
| 534 | 534 | LOG(1,"mz800_bank_r",("0: 1000-1FFF PCG ROM")); |
| 535 | bank2_ROM(mem); | |
| 535 | bank2_ROM(machine, mem); | |
| 536 | 536 | if ((mz800_display_mode & 0x08) == 0) |
| 537 | 537 | { |
| 538 | 538 | if (VERBOSE>=1) logerror("; 8000-9FFF videoram"); |
| 539 | bank3_VID(mem); | |
| 539 | bank3_VID(machine, mem); | |
| 540 | 540 | if (mz800_display_mode & 0x04) |
| 541 | 541 | { |
| 542 | 542 | if (VERBOSE>=1) logerror("; A000-BFFF videoram"); |
| 543 | 543 | /* 640x480 mode so A000-BFFF is videoram too */ |
| 544 | bank4_VID(mem); | |
| 544 | bank4_VID(machine, mem); | |
| 545 | 545 | } |
| 546 | 546 | else |
| 547 | 547 | { |
| 548 | 548 | if (VERBOSE>=1) logerror("; A000-BFFF RAM"); |
| 549 | bank4_RAM(mem); | |
| 549 | bank4_RAM(machine, mem); | |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | else |
| 553 | 553 | { |
| 554 | 554 | if (VERBOSE>=1) logerror("; C000-CFFF PCG RAM"); |
| 555 | 555 | /* make C000-CFFF PCG RAM */ |
| 556 | bank5_RAM(mem); | |
| 556 | bank5_RAM(machine, mem); | |
| 557 | 557 | } |
| 558 | 558 | if (VERBOSE>=1) logerror("\n"); |
| 559 | 559 | break; |
| 560 | 560 | |
| 561 | 561 | case 1: /* make 1000-1FFF and C000-CFFF RAM */ |
| 562 | 562 | LOG(1,"mz800_bank_r",("1: 1000-1FFF RAM")); |
| 563 | bank2_RAM(mem); | |
| 563 | bank2_RAM(machine, mem); | |
| 564 | 564 | if ((mz800_display_mode & 0x08) == 0) |
| 565 | 565 | { |
| 566 | 566 | if (VERBOSE>=1) logerror("; 8000-9FFF RAM; A000-BFFF RAM"); |
| 567 | 567 | /* make 8000-BFFF RAM */ |
| 568 | bank3_RAM(mem); | |
| 569 | bank4_RAM(mem); | |
| 568 | bank3_RAM(machine, mem); | |
| 569 | bank4_RAM(machine, mem); | |
| 570 | 570 | } |
| 571 | 571 | else |
| 572 | 572 | { |
| 573 | 573 | if (VERBOSE>=1) logerror("; C000-CFFF RAM"); |
| 574 | 574 | /* make C000-CFFF RAM */ |
| 575 | bank5_RAM(mem); | |
| 575 | bank5_RAM(machine, mem); | |
| 576 | 576 | } |
| 577 | 577 | if (VERBOSE>=1) logerror("\n"); |
| 578 | 578 | break; |
| r2418 | r2419 | |
| 620 | 620 | mz800_display_mode = data; |
| 621 | 621 | if ((mz800_display_mode & 0x08) == 0) |
| 622 | 622 | { |
| 623 | bank8_RAM(mem); | |
| 623 | bank8_RAM(machine, mem); | |
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | |
| r2418 | r2419 | |
| 649 | 649 | { |
| 650 | 650 | case 0: /* 0000-0FFF RAM */ |
| 651 | 651 | LOG(1,"mz800_bank_w",("0: 0000-0FFF RAM\n")); |
| 652 | bank1_RAM(mem); | |
| 652 | bank1_RAM(machine, mem); | |
| 653 | 653 | mz800_locked = 0; |
| 654 | 654 | break; |
| 655 | 655 | |
| 656 | 656 | case 1: /* D000-FFFF RAM */ |
| 657 | 657 | LOG(1,"mz800_bank_w",("1: D000-FFFF RAM\n")); |
| 658 | bank6_RAM(mem); | |
| 659 | bank7_RAM(mem); | |
| 660 | bank8_RAM(mem); | |
| 658 | bank6_RAM(machine, mem); | |
| 659 | bank7_RAM(machine, mem); | |
| 660 | bank8_RAM(machine, mem); | |
| 661 | 661 | mz800_locked = 0; |
| 662 | 662 | vio_mode = 1; |
| 663 | 663 | break; |
| 664 | 664 | |
| 665 | 665 | case 2: /* 0000-0FFF ROM */ |
| 666 | 666 | LOG(1,"mz800_bank_w",("2: 0000-0FFF ROM\n")); |
| 667 | bank1_ROM(mem); | |
| 667 | bank1_ROM(machine, mem); | |
| 668 | 668 | mz800_locked = 0; |
| 669 | 669 | break; |
| 670 | 670 | |
| 671 | 671 | case 3: /* D000-FFFF videoram, memory mapped io */ |
| 672 | 672 | LOG(1,"mz800_bank_w",("3: D000-FFFF videoram, memory mapped io\n")); |
| 673 | bank6_VIO(mem); | |
| 674 | bank7_VIO(mem); | |
| 675 | bank8_VIO(mem); | |
| 673 | bank6_VIO(machine, mem); | |
| 674 | bank7_VIO(machine, mem); | |
| 675 | bank8_VIO(machine, mem); | |
| 676 | 676 | mz800_locked = 0; |
| 677 | 677 | vio_mode = 3; |
| 678 | 678 | break; |
| 679 | 679 | |
| 680 | 680 | case 4: /* 0000-0FFF ROM D000-FFFF videoram, memory mapped io */ |
| 681 | 681 | LOG(1,"mz800_bank_w",("4: 0000-0FFF ROM; D000-FFFF videoram, memory mapped io\n")); |
| 682 | bank1_ROM(mem); | |
| 683 | bank6_VIO(mem); | |
| 684 | bank7_VIO(mem); | |
| 685 | bank8_VIO(mem); | |
| 682 | bank1_ROM(machine, mem); | |
| 683 | bank6_VIO(machine, mem); | |
| 684 | bank7_VIO(machine, mem); | |
| 685 | bank8_VIO(machine, mem); | |
| 686 | 686 | mz800_locked = 0; |
| 687 | 687 | vio_mode = 3; |
| 688 | 688 | break; |
| r2418 | r2419 | |
| 693 | 693 | { |
| 694 | 694 | vio_lock = vio_mode; |
| 695 | 695 | mz800_locked = 1; |
| 696 | bank6_NOP(mem); | |
| 697 | bank7_NOP(mem); | |
| 698 | bank8_NOP(mem); | |
| 696 | bank6_NOP(machine, mem); | |
| 697 | bank7_NOP(machine, mem); | |
| 698 | bank8_NOP(machine, mem); | |
| 699 | 699 | } |
| 700 | 700 | break; |
| 701 | 701 | |
| r2418 | r2419 | |
| 709 | 709 | mz800_port_e8 = data; |
| 710 | 710 | if (mz800_port_e8 & 0x80) |
| 711 | 711 | { |
| 712 | bank6_VIO(mem); | |
| 713 | bank7_VIO(mem); | |
| 714 | bank8_VIO(mem); | |
| 712 | bank6_VIO(machine, mem); | |
| 713 | bank7_VIO(machine, mem); | |
| 714 | bank8_VIO(machine, mem); | |
| 715 | 715 | } |
| 716 | 716 | else |
| 717 | 717 | { |
| 718 | bank6_RAM(mem); | |
| 719 | bank7_RAM(mem); | |
| 720 | bank8_RAM(mem); | |
| 718 | bank6_RAM(machine, mem); | |
| 719 | bank7_RAM(machine, mem); | |
| 720 | bank8_RAM(machine, mem); | |
| 721 | 721 | } |
| 722 | 722 | break; |
| 723 | 723 | } |
| r2418 | r2419 | |
|---|---|---|
| 227 | 227 | DRIVER_INIT( aim65 ) |
| 228 | 228 | { |
| 229 | 229 | /* Init RAM */ |
| 230 | memory_install_readwrite8_handler | |
| 230 | memory_install_readwrite8_handler | |
| 231 | 231 | 0, mess_ram_size - 1, 0, 0, SMH_BANK1, SMH_BANK1); |
| 232 | 232 | memory_set_bankptr(1, mess_ram); |
| 233 | 233 | |
| 234 | 234 | if (mess_ram_size < 4 * 1024) |
| 235 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 235 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 236 | 236 | mess_ram_size, 0x0fff, 0, 0, SMH_NOP, SMH_NOP); |
| 237 | 237 | |
| 238 | 238 | pia_config(0, &pia); |
| r2418 | r2419 | |
|---|---|---|
| 304 | 304 | |
| 305 | 305 | |
| 306 | 306 | |
| 307 | static void to7_update_cart_bank | |
| 307 | static void to7_update_cart_bank | |
| 308 | 308 | { |
| 309 | 309 | static int old_bank = -1; |
| 310 | 310 | int bank = 0; |
| 311 | 311 | if ( thom_cart_nb_banks ) |
| 312 | 312 | { |
| 313 | 313 | bank = thom_cart_bank % thom_cart_nb_banks; |
| 314 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to7_cartridge_r ); | |
| 314 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to7_cartridge_r ); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if ( bank != old_bank ) |
| r2418 | r2419 | |
| 325 | 325 | |
| 326 | 326 | static STATE_POSTLOAD( to7_update_cart_bank_postload ) |
| 327 | 327 | { |
| 328 | to7_update_cart_bank(); | |
| 328 | to7_update_cart_bank(machine); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | |
| r2418 | r2419 | |
| 337 | 337 | return; |
| 338 | 338 | |
| 339 | 339 | thom_cart_bank = offset & 3; |
| 340 | to7_update_cart_bank(); | |
| 340 | to7_update_cart_bank(machine); | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| r2418 | r2419 | |
| 348 | 348 | UINT8* pos = memory_region( REGION_CPU1 ) + 0x10000; |
| 349 | 349 | UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000]; |
| 350 | 350 | thom_cart_bank = offset & 3; |
| 351 | to7_update_cart_bank(); | |
| 351 | to7_update_cart_bank(machine); | |
| 352 | 352 | return data; |
| 353 | 353 | } |
| 354 | 354 | |
| r2418 | r2419 | |
| 1281 | 1281 | pia_set_input_cb1( THOM_PIA_SYS, 0 ); |
| 1282 | 1282 | |
| 1283 | 1283 | /* memory */ |
| 1284 | to7_update_cart_bank(); | |
| 1284 | to7_update_cart_bank(machine); | |
| 1285 | 1285 | /* thom_cart_bank not reset */ |
| 1286 | 1286 | |
| 1287 | 1287 | /* lightpen */ |
| r2418 | r2419 | |
| 1323 | 1323 | /* install 16 KB or 16 KB + 8 KB memory extensions */ |
| 1324 | 1324 | /* BASIC instruction to see free memory: ?FRE(0) */ |
| 1325 | 1325 | int extram = mess_ram_size - 24*1024; |
| 1326 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000 + extram - 1, 0, 0, | |
| 1326 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000 + extram - 1, 0, 0, | |
| 1327 | 1327 | (write8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); |
| 1328 | memory_install_read8_handler( | |
| 1328 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000 + extram - 1, 0, 0, | |
| 1329 | 1329 | (read8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); |
| 1330 | 1330 | memory_configure_bank( THOM_RAM_BANK, 0, 1, mess_ram + 0x6000, extram ); |
| 1331 | 1331 | memory_set_bank( THOM_RAM_BANK, 0 ); |
| r2418 | r2419 | |
| 1370 | 1370 | |
| 1371 | 1371 | |
| 1372 | 1372 | |
| 1373 | static void to770_update_ram_bank( | |
| 1373 | static void to770_update_ram_bank(running_machine *machine) | |
| 1374 | 1374 | { |
| 1375 | 1375 | UINT8 portb = pia_get_port_b_z_mask( THOM_PIA_SYS ); |
| 1376 | 1376 | static int old_bank = -1; |
| r2418 | r2419 | |
| 1402 | 1402 | if ( mess_ram_size == 128*1024 || bank < 2 ) |
| 1403 | 1403 | { |
| 1404 | 1404 | memory_set_bank( THOM_RAM_BANK, bank ); |
| 1405 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, (write8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); | |
| 1405 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, (write8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); | |
| 1406 | 1406 | } |
| 1407 | 1407 | else |
| 1408 | 1408 | { |
| 1409 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, SMH_UNMAP ); | |
| 1409 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, SMH_UNMAP ); | |
| 1410 | 1410 | } |
| 1411 | 1411 | |
| 1412 | 1412 | old_bank = bank; |
| r2418 | r2419 | |
| 1416 | 1416 | |
| 1417 | 1417 | static STATE_POSTLOAD ( to770_update_ram_bank_postload ) |
| 1418 | 1418 | { |
| 1419 | to770_update_ram_bank(); | |
| 1419 | to770_update_ram_bank(machine); | |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | 1422 | |
| 1423 | 1423 | |
| 1424 | 1424 | static WRITE8_HANDLER ( to770_sys_portb_out ) |
| 1425 | 1425 | { |
| 1426 | to770_update_ram_bank(); | |
| 1426 | to770_update_ram_bank(machine); | |
| 1427 | 1427 | } |
| 1428 | 1428 | |
| 1429 | 1429 | |
| r2418 | r2419 | |
| 1528 | 1528 | pia_set_input_cb1( THOM_PIA_SYS, 0 ); |
| 1529 | 1529 | |
| 1530 | 1530 | /* memory */ |
| 1531 | to7_update_cart_bank(); | |
| 1532 | to770_update_ram_bank(); | |
| 1531 | to7_update_cart_bank(machine); | |
| 1532 | to770_update_ram_bank(machine); | |
| 1533 | 1533 | /* thom_cart_bank not reset */ |
| 1534 | 1534 | |
| 1535 | 1535 | /* lightpen */ |
| r2418 | r2419 | |
| 1772 | 1772 | |
| 1773 | 1773 | |
| 1774 | 1774 | |
| 1775 | static void mo5_update_cart_bank | |
| 1775 | static void mo5_update_cart_bank | |
| 1776 | 1776 | { |
| 1777 | 1777 | static int old_bank = -1; |
| 1778 | 1778 | int rom_is_ram = mo5_reg_cart & 4; |
| 1779 | 1779 | int bank = 0; |
| 1780 | 1780 | |
| 1781 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, | |
| 1781 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, | |
| 1782 | 1782 | (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); |
| 1783 | 1783 | |
| 1784 | 1784 | if ( rom_is_ram && thom_cart_nb_banks == 4 ) |
| 1785 | 1785 | { |
| 1786 | 1786 | /* 64 KB ROM from "JANE" cartridge */ |
| 1787 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 1787 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 1788 | 1788 | bank = mo5_reg_cart & 3; |
| 1789 | 1789 | if ( bank != old_bank ) |
| 1790 | 1790 | LOG_BANK(( "mo5_update_cart_bank: CART is cartridge bank %i (A7CB style)\n", bank )); |
| r2418 | r2419 | |
| 1794 | 1794 | /* 64 KB RAM from network extension */ |
| 1795 | 1795 | int write_enable = mo5_reg_cart & 8; |
| 1796 | 1796 | bank = 4 + ( mo5_reg_cart & 3 ); |
| 1797 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? | |
| 1797 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? | |
| 1798 | 1798 | (write8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) : SMH_NOP ); |
| 1799 | 1799 | if ( bank != old_bank ) |
| 1800 | 1800 | LOG_BANK(( "mo5_update_cart_bank: CART is nanonetwork RAM bank %i (write-enable=%i)\n", mo5_reg_cart & 3, write_enable ? 1 : 0 )); |
| r2418 | r2419 | |
| 1802 | 1802 | else |
| 1803 | 1803 | { |
| 1804 | 1804 | /* regular cartridge bank switch */ |
| 1805 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, mo5_cartridge_w ); | |
| 1805 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, mo5_cartridge_w ); | |
| 1806 | 1806 | if ( thom_cart_nb_banks ) |
| 1807 | 1807 | { |
| 1808 | 1808 | bank = thom_cart_bank % thom_cart_nb_banks; |
| 1809 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xbffc, 0xbfff, 0, 0, mo5_cartridge_r ); | |
| 1809 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xbffc, 0xbfff, 0, 0, mo5_cartridge_r ); | |
| 1810 | 1810 | } |
| 1811 | 1811 | if ( bank != old_bank ) |
| 1812 | 1812 | LOG_BANK(( "mo5_update_cart_bank: CART is internal / cartridge bank %i\n", thom_cart_bank )); |
| r2418 | r2419 | |
| 1819 | 1819 | |
| 1820 | 1820 | static STATE_POSTLOAD( mo5_update_cart_bank_postload ) |
| 1821 | 1821 | { |
| 1822 | mo5_update_cart_bank(); | |
| 1822 | mo5_update_cart_bank(machine); | |
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | 1825 | |
| r2418 | r2419 | |
| 1831 | 1831 | return; |
| 1832 | 1832 | |
| 1833 | 1833 | thom_cart_bank = offset & 3; |
| 1834 | mo5_update_cart_bank(); | |
| 1834 | mo5_update_cart_bank(machine); | |
| 1835 | 1835 | } |
| 1836 | 1836 | |
| 1837 | 1837 | |
| r2418 | r2419 | |
| 1842 | 1842 | UINT8* pos = memory_region( REGION_CPU1 ) + 0x10000; |
| 1843 | 1843 | UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000]; |
| 1844 | 1844 | thom_cart_bank = offset & 3; |
| 1845 | mo5_update_cart_bank(); | |
| 1845 | mo5_update_cart_bank(machine); | |
| 1846 | 1846 | return data; |
| 1847 | 1847 | } |
| 1848 | 1848 | |
| r2418 | r2419 | |
| 1852 | 1852 | WRITE8_HANDLER ( mo5_ext_w ) |
| 1853 | 1853 | { |
| 1854 | 1854 | mo5_reg_cart = data; |
| 1855 | mo5_update_cart_bank(); | |
| 1855 | mo5_update_cart_bank(machine); | |
| 1856 | 1856 | } |
| 1857 | 1857 | |
| 1858 | 1858 | |
| r2418 | r2419 | |
| 1886 | 1886 | pia_set_input_ca1( THOM_PIA_SYS, 0 ); |
| 1887 | 1887 | |
| 1888 | 1888 | /* memory */ |
| 1889 | mo5_update_cart_bank(); | |
| 1889 | mo5_update_cart_bank(machine); | |
| 1890 | 1890 | /* mo5_reg_cart not reset */ |
| 1891 | 1891 | /* thom_cart_bank not reset */ |
| 1892 | 1892 | |
| r2418 | r2419 | |
| 2138 | 2138 | static UINT8 to9_soft_bank; |
| 2139 | 2139 | |
| 2140 | 2140 | |
| 2141 | static void to9_update_cart_bank | |
| 2141 | static void to9_update_cart_bank | |
| 2142 | 2142 | { |
| 2143 | 2143 | static int old_bank = -1; |
| 2144 | 2144 | int bank = 0; |
| 2145 | int slot = ( mc6846_get_output_port( | |
| 2145 | int slot = ( mc6846_get_output_port(machine) >> 4 ) & 3; /* bits 4-5: ROM bank */ | |
| 2146 | 2146 | |
| 2147 | 2147 | /* reset cartridge read handler */ |
| 2148 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 2148 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 2149 | 2149 | |
| 2150 | 2150 | switch ( slot ) |
| 2151 | 2151 | { |
| r2418 | r2419 | |
| 2172 | 2172 | if ( thom_cart_nb_banks ) |
| 2173 | 2173 | { |
| 2174 | 2174 | bank = thom_cart_bank % thom_cart_nb_banks; |
| 2175 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to7_cartridge_r ); | |
| 2175 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to7_cartridge_r ); | |
| 2176 | 2176 | } |
| 2177 | 2177 | if ( bank != old_bank ) |
| 2178 | 2178 | LOG_BANK(( "to9_update_cart_bank: CART is cartridge bank %i\n", thom_cart_bank )); |
| r2418 | r2419 | |
| 2187 | 2187 | |
| 2188 | 2188 | static STATE_POSTLOAD( to9_update_cart_bank_postload ) |
| 2189 | 2189 | { |
| 2190 | to9_update_cart_bank(); | |
| 2190 | to9_update_cart_bank(machine); | |
| 2191 | 2191 | } |
| 2192 | 2192 | |
| 2193 | 2193 | |
| r2418 | r2419 | |
| 2204 | 2204 | thom_cart_bank = offset & 3; |
| 2205 | 2205 | else |
| 2206 | 2206 | to9_soft_bank = offset & 3; |
| 2207 | to9_update_cart_bank(); | |
| 2207 | to9_update_cart_bank(machine); | |
| 2208 | 2208 | } |
| 2209 | 2209 | |
| 2210 | 2210 | |
| r2418 | r2419 | |
| 2215 | 2215 | UINT8* pos = memory_region( REGION_CPU1 ) + 0x10000; |
| 2216 | 2216 | UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000]; |
| 2217 | 2217 | thom_cart_bank = offset & 3; |
| 2218 | to9_update_cart_bank(); | |
| 2218 | to9_update_cart_bank(machine); | |
| 2219 | 2219 | return data; |
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | |
| 2223 | 2223 | |
| 2224 | static void to9_update_ram_bank ( | |
| 2224 | static void to9_update_ram_bank (running_machine *machine) | |
| 2225 | 2225 | { |
| 2226 | 2226 | static int old_bank = -1; |
| 2227 | UINT8 port = mc6846_get_output_port( | |
| 2227 | UINT8 port = mc6846_get_output_port(machine); | |
| 2228 | 2228 | UINT8 portb = pia_get_port_b_z_mask( THOM_PIA_SYS ); |
| 2229 | 2229 | UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */ |
| 2230 | 2230 | int bank; |
| r2418 | r2419 | |
| 2256 | 2256 | if ( mess_ram_size == 192*1024 || bank < 6 ) |
| 2257 | 2257 | { |
| 2258 | 2258 | memory_set_bank( THOM_RAM_BANK, bank ); |
| 2259 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, (write8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); | |
| 2259 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, (write8_machine_func)(STATIC_BANK1 + THOM_RAM_BANK - 1) ); | |
| 2260 | 2260 | } |
| 2261 | 2261 | else |
| 2262 | 2262 | { |
| 2263 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, SMH_NOP ); | |
| 2263 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, SMH_NOP ); | |
| 2264 | 2264 | } |
| 2265 | 2265 | |
| 2266 | 2266 | old_bank = bank; |
| r2418 | r2419 | |
| 2270 | 2270 | |
| 2271 | 2271 | static STATE_POSTLOAD( to9_update_ram_bank_postload ) |
| 2272 | 2272 | { |
| 2273 | to9_update_ram_bank(); | |
| 2273 | to9_update_ram_bank(machine); | |
| 2274 | 2274 | } |
| 2275 | 2275 | |
| 2276 | 2276 | |
| r2418 | r2419 | |
| 2773 | 2773 | static WRITE8_HANDLER ( to9_sys_portb_out ) |
| 2774 | 2774 | { |
| 2775 | 2775 | to9_update_centronics(); /* bits 0-1: printer */ |
| 2776 | to9_update_ram_bank(); | |
| 2776 | to9_update_ram_bank(machine); | |
| 2777 | 2777 | |
| 2778 | 2778 | if ( data & 4 ) /* bit 2: video overlay (TODO) */ |
| 2779 | 2779 | LOG(( "to9_sys_portb_out: video overlay not handled\n" )); |
| r2418 | r2419 | |
| 2801 | 2801 | static WRITE8_HANDLER ( to9_timer_port_out ) |
| 2802 | 2802 | { |
| 2803 | 2803 | thom_set_mode_point( data & 1 ); /* bit 0: video bank */ |
| 2804 | to9_update_ram_bank(); | |
| 2805 | to9_update_cart_bank(); | |
| 2804 | to9_update_ram_bank(machine); | |
| 2805 | to9_update_cart_bank(machine); | |
| 2806 | 2806 | } |
| 2807 | 2807 | |
| 2808 | 2808 | |
| r2418 | r2419 | |
| 2847 | 2847 | |
| 2848 | 2848 | /* memory */ |
| 2849 | 2849 | to9_soft_bank = 0; |
| 2850 | to9_update_cart_bank(); | |
| 2851 | to9_update_ram_bank(); | |
| 2850 | to9_update_cart_bank(machine); | |
| 2851 | to9_update_ram_bank(machine); | |
| 2852 | 2852 | /* thom_cart_bank not reset */ |
| 2853 | 2853 | |
| 2854 | 2854 | /* lightpen */ |
| r2418 | r2419 | |
| 3269 | 3269 | |
| 3270 | 3270 | |
| 3271 | 3271 | |
| 3272 | static void to8_update_ram_bank ( | |
| 3272 | static void to8_update_ram_bank (running_machine *machine) | |
| 3273 | 3273 | { |
| 3274 | 3274 | UINT8 bank = 0; |
| 3275 | 3275 | |
| r2418 | r2419 | |
| 3313 | 3313 | { |
| 3314 | 3314 | memory_set_bank( TO8_DATA_LO, to8_data_vpage ); |
| 3315 | 3315 | memory_set_bank( TO8_DATA_HI, to8_data_vpage ); |
| 3316 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, to8_data_vpage <= 4 ? to8_data_lo_w : (write8_machine_func)(STATIC_BANK1 + TO8_DATA_LO - 1) ); | |
| 3317 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, to8_data_vpage <= 4 ? to8_data_hi_w : (write8_machine_func)(STATIC_BANK1 + TO8_DATA_HI - 1) ); | |
| 3316 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, to8_data_vpage <= 4 ? to8_data_lo_w : (write8_machine_func)(STATIC_BANK1 + TO8_DATA_LO - 1) ); | |
| 3317 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, to8_data_vpage <= 4 ? to8_data_hi_w : (write8_machine_func)(STATIC_BANK1 + TO8_DATA_HI - 1) ); | |
| 3318 | 3318 | } |
| 3319 | 3319 | else |
| 3320 | 3320 | { |
| 3321 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_NOP ); | |
| 3322 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP ); | |
| 3321 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_NOP ); | |
| 3322 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP ); | |
| 3323 | 3323 | } |
| 3324 | 3324 | } |
| 3325 | 3325 | |
| r2418 | r2419 | |
| 3327 | 3327 | |
| 3328 | 3328 | static STATE_POSTLOAD( to8_update_ram_bank_postload ) |
| 3329 | 3329 | { |
| 3330 | to8_update_ram_bank(); | |
| 3330 | to8_update_ram_bank(machine); | |
| 3331 | 3331 | } |
| 3332 | 3332 | |
| 3333 | 3333 | |
| 3334 | 3334 | |
| 3335 | static void to8_update_cart_bank ( | |
| 3335 | static void to8_update_cart_bank (running_machine *machine) | |
| 3336 | 3336 | { |
| 3337 | 3337 | static int old_bank = -1; |
| 3338 | 3338 | int bank = 0; |
| 3339 | 3339 | |
| 3340 | 3340 | /* reset bank switch */ |
| 3341 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 3341 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 3342 | 3342 | |
| 3343 | 3343 | if ( to8_reg_cart & 0x20 ) |
| 3344 | 3344 | { |
| 3345 | 3345 | /* RAM space */ |
| 3346 | 3346 | to8_cart_vpage = to8_reg_cart & 31; |
| 3347 | 3347 | bank = 8 + to8_cart_vpage; |
| 3348 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, | |
| 3348 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, | |
| 3349 | 3349 | ((to8_cart_vpage < 8 || mess_ram_size == 512*1024) && (to8_reg_cart & 0x40)) ? |
| 3350 | 3350 | (to8_cart_vpage <= 4) ? to8_vcart_w : |
| 3351 | 3351 | (write8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) : |
| r2418 | r2419 | |
| 3355 | 3355 | } |
| 3356 | 3356 | else |
| 3357 | 3357 | { |
| 3358 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, to8_cartridge_w ); | |
| 3358 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, to8_cartridge_w ); | |
| 3359 | 3359 | if ( to8_soft_select ) |
| 3360 | 3360 | { |
| 3361 | 3361 | /* internal software ROM space */ |
| r2418 | r2419 | |
| 3370 | 3370 | if ( thom_cart_nb_banks ) |
| 3371 | 3371 | { |
| 3372 | 3372 | bank = thom_cart_bank % thom_cart_nb_banks; |
| 3373 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to8_cartridge_r ); | |
| 3373 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, to8_cartridge_r ); | |
| 3374 | 3374 | |
| 3375 | 3375 | } |
| 3376 | 3376 | |
| r2418 | r2419 | |
| 3391 | 3391 | |
| 3392 | 3392 | static STATE_POSTLOAD( to8_update_cart_bank_postload ) |
| 3393 | 3393 | { |
| 3394 | to8_update_cart_bank(); | |
| 3394 | to8_update_cart_bank(machine); | |
| 3395 | 3395 | } |
| 3396 | 3396 | |
| 3397 | 3397 | |
| r2418 | r2419 | |
| 3407 | 3407 | else |
| 3408 | 3408 | thom_cart_bank = offset & 3; |
| 3409 | 3409 | |
| 3410 | to8_update_cart_bank(); | |
| 3410 | to8_update_cart_bank(machine); | |
| 3411 | 3411 | } |
| 3412 | 3412 | |
| 3413 | 3413 | |
| r2418 | r2419 | |
| 3418 | 3418 | UINT8* pos = memory_region( REGION_CPU1 ) + 0x10000; |
| 3419 | 3419 | UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000]; |
| 3420 | 3420 | thom_cart_bank = offset & 3; |
| 3421 | to8_update_cart_bank(); | |
| 3421 | to8_update_cart_bank(machine); | |
| 3422 | 3422 | return data; |
| 3423 | 3423 | } |
| 3424 | 3424 | |
| r2418 | r2419 | |
| 3555 | 3555 | if ( to8_reg_sys1 & 0x10 ) |
| 3556 | 3556 | { |
| 3557 | 3557 | to8_reg_ram = data; |
| 3558 | to8_update_ram_bank(); | |
| 3558 | to8_update_ram_bank(machine); | |
| 3559 | 3559 | } |
| 3560 | 3560 | break; |
| 3561 | 3561 | |
| 3562 | 3562 | case 2: /* cartridge register */ |
| 3563 | 3563 | to8_reg_cart = data; |
| 3564 | to8_update_cart_bank(); | |
| 3564 | to8_update_cart_bank(machine); | |
| 3565 | 3565 | break; |
| 3566 | 3566 | |
| 3567 | 3567 | case 3: /* system register 1 */ |
| 3568 | 3568 | to8_reg_sys1 = data; |
| 3569 | 3569 | to8_update_floppy_bank(); |
| 3570 | to8_update_ram_bank(); | |
| 3571 | to8_update_cart_bank(); | |
| 3570 | to8_update_ram_bank(machine); | |
| 3571 | to8_update_cart_bank(machine); | |
| 3572 | 3572 | break; |
| 3573 | 3573 | |
| 3574 | 3574 | default: |
| r2418 | r2419 | |
| 3688 | 3688 | static WRITE8_HANDLER ( to8_sys_portb_out ) |
| 3689 | 3689 | { |
| 3690 | 3690 | to9_update_centronics(); /* bits 0-1: printer */ |
| 3691 | to8_update_ram_bank(); | |
| 3691 | to8_update_ram_bank(machine); | |
| 3692 | 3692 | |
| 3693 | 3693 | if ( data & 4 ) /* bit 2: video overlay (TODO) */ |
| 3694 | 3694 | LOG(( "to8_sys_portb_out: video overlay not handled\n" )); |
| r2418 | r2419 | |
| 3729 | 3729 | memory_set_bank( TO8_BIOS_BANK, to8_bios_bank ); |
| 3730 | 3730 | to8_soft_select = (data & 0x04) ? 1 : 0; /* bit 2: internal ROM select */ |
| 3731 | 3731 | to8_update_floppy_bank(); |
| 3732 | to8_update_cart_bank(); | |
| 3732 | to8_update_cart_bank(machine); | |
| 3733 | 3733 | to8_kbd_set_ack( ack ); |
| 3734 | 3734 | } |
| 3735 | 3735 | |
| r2418 | r2419 | |
| 3813 | 3813 | to8_data_vpage = 0; |
| 3814 | 3814 | to8_soft_bank = 0; |
| 3815 | 3815 | to8_bios_bank = 0; |
| 3816 | to8_update_ram_bank(); | |
| 3817 | to8_update_cart_bank(); | |
| 3816 | to8_update_ram_bank(machine); | |
| 3817 | to8_update_cart_bank(machine); | |
| 3818 | 3818 | to8_update_floppy_bank(); |
| 3819 | 3819 | memory_set_bank( TO8_BIOS_BANK, 0 ); |
| 3820 | 3820 | /* thom_cart_bank not reset */ |
| r2418 | r2419 | |
| 3923 | 3923 | memory_set_bank( TO8_BIOS_BANK, bios_bank ); |
| 3924 | 3924 | to8_soft_select = (data & 0x04) ? 1 : 0; /* bit 2: internal ROM select */ |
| 3925 | 3925 | to8_update_floppy_bank(); |
| 3926 | to8_update_cart_bank(); | |
| 3926 | to8_update_cart_bank(machine); | |
| 3927 | 3927 | } |
| 3928 | 3928 | |
| 3929 | 3929 | |
| r2418 | r2419 | |
| 3980 | 3980 | to8_data_vpage = 0; |
| 3981 | 3981 | to8_soft_bank = 0; |
| 3982 | 3982 | to8_bios_bank = 0; |
| 3983 | to8_update_ram_bank(); | |
| 3984 | to8_update_cart_bank(); | |
| 3983 | to8_update_ram_bank(machine); | |
| 3984 | to8_update_cart_bank(machine); | |
| 3985 | 3985 | to8_update_floppy_bank(); |
| 3986 | 3986 | memory_set_bank( TO8_BIOS_BANK, 0 ); |
| 3987 | 3987 | /* thom_cart_bank not reset */ |
| r2418 | r2419 | |
| 4083 | 4083 | |
| 4084 | 4084 | |
| 4085 | 4085 | |
| 4086 | static void mo6_update_cart_bank ( | |
| 4086 | static void mo6_update_cart_bank (running_machine *machine) | |
| 4087 | 4087 | { |
| 4088 | 4088 | int b = (pia_get_output_a( THOM_PIA_SYS ) >> 5) & 1; |
| 4089 | 4089 | static int old_bank = -1; |
| 4090 | 4090 | int bank = 0; |
| 4091 | 4091 | |
| 4092 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 4092 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, (read8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) ); | |
| 4093 | 4093 | |
| 4094 | 4094 | if ( ( ( to8_reg_sys1 & 0x40 ) && ( to8_reg_cart & 0x20 ) ) || ( ! ( to8_reg_sys1 & 0x40 ) && ( mo5_reg_cart & 4 ) ) ) |
| 4095 | 4095 | { |
| r2418 | r2419 | |
| 4099 | 4099 | /* use a7e6 */ |
| 4100 | 4100 | to8_cart_vpage = to8_reg_cart & 7; /* 128 KB RAM only = 8 pages */ |
| 4101 | 4101 | bank = 8 + to8_cart_vpage; |
| 4102 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, | |
| 4102 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, | |
| 4103 | 4103 | (to8_reg_cart & 0x40) ? (to8_cart_vpage <= 4) ? to8_vcart_w : |
| 4104 | 4104 | (write8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) : SMH_NOP ); |
| 4105 | 4105 | if ( bank != old_bank ) |
| r2418 | r2419 | |
| 4108 | 4108 | else if ( thom_cart_nb_banks == 4 ) |
| 4109 | 4109 | { |
| 4110 | 4110 | /* "JANE"-style cartridge bank switching */ |
| 4111 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 4111 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 4112 | 4112 | bank = mo5_reg_cart & 3; |
| 4113 | 4113 | if ( bank != old_bank ) |
| 4114 | 4114 | LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i (A7CB style)\n", bank )); |
| r2418 | r2419 | |
| 4119 | 4119 | int write_enable = mo5_reg_cart & 8; |
| 4120 | 4120 | to8_cart_vpage = (mo5_reg_cart & 3) | 4; |
| 4121 | 4121 | bank = 8 + to8_cart_vpage; |
| 4122 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? | |
| 4122 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? | |
| 4123 | 4123 | (write8_machine_func)(STATIC_BANK1 + THOM_CART_BANK - 1) : SMH_NOP ); |
| 4124 | 4124 | if ( bank != old_bank ) |
| 4125 | 4125 | LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (write-enable=%i) (MO5 compat.)\n", to8_cart_vpage, write_enable ? 1 : 0 )); |
| r2418 | r2419 | |
| 4128 | 4128 | else |
| 4129 | 4129 | { |
| 4130 | 4130 | /* ROM space */ |
| 4131 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 4131 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, SMH_NOP ); | |
| 4132 | 4132 | if ( to8_reg_sys2 & 0x20 ) |
| 4133 | 4133 | { |
| 4134 | 4134 | /* internal ROM */ |
| r2418 | r2419 | |
| 4142 | 4142 | else |
| 4143 | 4143 | { |
| 4144 | 4144 | /* cartridge */ |
| 4145 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, mo6_cartridge_w ); | |
| 4145 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, mo6_cartridge_w ); | |
| 4146 | 4146 | if ( thom_cart_nb_banks ) |
| 4147 | 4147 | { |
| 4148 | 4148 | bank = thom_cart_bank % thom_cart_nb_banks; |
| 4149 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xbffc, 0xbfff, 0, 0, mo6_cartridge_r ); | |
| 4149 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xbffc, 0xbfff, 0, 0, mo6_cartridge_r ); | |
| 4150 | 4150 | } |
| 4151 | 4151 | if ( bank != old_bank ) |
| 4152 | 4152 | LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i\n", bank )); |
| r2418 | r2419 | |
| 4162 | 4162 | |
| 4163 | 4163 | static STATE_POSTLOAD( mo6_update_cart_bank_postload ) |
| 4164 | 4164 | { |
| 4165 | mo6_update_cart_bank(); | |
| 4165 | mo6_update_cart_bank(machine); | |
| 4166 | 4166 | } |
| 4167 | 4167 | |
| 4168 | 4168 | |
| r2418 | r2419 | |
| 4174 | 4174 | return; |
| 4175 | 4175 | |
| 4176 | 4176 | thom_cart_bank = offset & 3; |
| 4177 | mo6_update_cart_bank(); | |
| 4177 | mo6_update_cart_bank(machine); | |
| 4178 | 4178 | } |
| 4179 | 4179 | |
| 4180 | 4180 | |
| r2418 | r2419 | |
| 4185 | 4185 | UINT8* pos = memory_region( REGION_CPU1 ) + 0x10000; |
| 4186 | 4186 | UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000]; |
| 4187 | 4187 | thom_cart_bank = offset & 3; |
| 4188 | mo6_update_cart_bank(); | |
| 4188 | mo6_update_cart_bank(machine); | |
| 4189 | 4189 | return data; |
| 4190 | 4190 | } |
| 4191 | 4191 | |
| r2418 | r2419 | |
| 4195 | 4195 | { |
| 4196 | 4196 | /* MO5 network extension compatible */ |
| 4197 | 4197 | mo5_reg_cart = data; |
| 4198 | mo6_update_cart_bank(); | |
| 4198 | mo6_update_cart_bank(machine); | |
| 4199 | 4199 | } |
| 4200 | 4200 | |
| 4201 | 4201 | |
| r2418 | r2419 | |
| 4327 | 4327 | to7_game_mute = data & 4; /* bit 2: sound mute */ |
| 4328 | 4328 | thom_set_caps_led( (data & 16) ? 0 : 1 ) ; /* bit 4: keyboard led */ |
| 4329 | 4329 | mo5_set_cassette( (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */ |
| 4330 | mo6_update_cart_bank(); /* bit 5: rom bank */ | |
| 4330 | mo6_update_cart_bank(machine); /* bit 5: rom bank */ | |
| 4331 | 4331 | to7_game_sound_update(); |
| 4332 | 4332 | } |
| 4333 | 4333 | |
| r2418 | r2419 | |
| 4444 | 4444 | |
| 4445 | 4445 | case 2: /* cartridge register */ |
| 4446 | 4446 | to8_reg_cart = data; |
| 4447 | mo6_update_cart_bank(); | |
| 4447 | mo6_update_cart_bank(machine); | |
| 4448 | 4448 | break; |
| 4449 | 4449 | |
| 4450 | 4450 | case 3: /* system register 1 */ |
| 4451 | 4451 | to8_reg_sys1 = data; |
| 4452 | 4452 | mo6_update_ram_bank(); |
| 4453 | mo6_update_cart_bank(); | |
| 4453 | mo6_update_cart_bank(machine); | |
| 4454 | 4454 | break; |
| 4455 | 4455 | |
| 4456 | 4456 | default: |
| r2418 | r2419 | |
| 4518 | 4518 | to8_reg_sys2 = data; |
| 4519 | 4519 | thom_set_video_page( data >> 6 ); |
| 4520 | 4520 | thom_set_border_color( data & 15 ); |
| 4521 | mo6_update_cart_bank(); | |
| 4521 | mo6_update_cart_bank(machine); | |
| 4522 | 4522 | } |
| 4523 | 4523 | break; |
| 4524 | 4524 | |
| r2418 | r2419 | |
| 4569 | 4569 | to8_cart_vpage = 0; |
| 4570 | 4570 | to8_data_vpage = 0; |
| 4571 | 4571 | mo6_update_ram_bank(); |
| 4572 | mo6_update_cart_bank(); | |
| 4572 | mo6_update_cart_bank(machine); | |
| 4573 | 4573 | /* mo5_reg_cart not reset */ |
| 4574 | 4574 | /* thom_cart_bank not reset */ |
| 4575 | 4575 | } |
| r2418 | r2419 | |
| 4745 | 4745 | thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ |
| 4746 | 4746 | to7_game_mute = data & 4; /* bit 2: sound mute */ |
| 4747 | 4747 | mo5_set_cassette( (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */ |
| 4748 | mo6_update_cart_bank(); /* bit 5: rom bank */ | |
| 4748 | mo6_update_cart_bank(machine); /* bit 5: rom bank */ | |
| 4749 | 4749 | to7_game_sound_update(); |
| 4750 | 4750 | } |
| 4751 | 4751 | |
| r2418 | r2419 | |
| 4841 | 4841 | to8_cart_vpage = 0; |
| 4842 | 4842 | to8_data_vpage = 0; |
| 4843 | 4843 | mo6_update_ram_bank(); |
| 4844 | mo6_update_cart_bank(); | |
| 4844 | mo6_update_cart_bank(machine); | |
| 4845 | 4845 | /* mo5_reg_cart not reset */ |
| 4846 | 4846 | /* thom_cart_bank not reset */ |
| 4847 | 4847 | } |
| r2418 | r2419 | |
|---|---|---|
| 198 | 198 | { |
| 199 | 199 | logerror("SYM1 VIA2 W 0x%02x\n", data); |
| 200 | 200 | |
| 201 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa600, 0xa67f, 0, 0, | |
| 201 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa600, 0xa67f, 0, 0, | |
| 202 | 202 | ((input_port_read(machine, "WP") & 0x01) && !(data & 0x01)) ? SMH_NOP : SMH_BANK5); |
| 203 | 203 | |
| 204 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x07ff, 0, 0, | |
| 204 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x07ff, 0, 0, | |
| 205 | 205 | ((input_port_read(machine, "WP") & 0x02) && !(data & 0x02)) ? SMH_NOP : SMH_BANK2); |
| 206 | 206 | |
| 207 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0bff, 0, 0, | |
| 207 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0bff, 0, 0, | |
| 208 | 208 | ((input_port_read(machine, "WP") & 0x04) && !(data & 0x04)) ? SMH_NOP : SMH_BANK3); |
| 209 | 209 | |
| 210 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c00, 0x0fff, 0, 0, | |
| 210 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c00, 0x0fff, 0, 0, | |
| 211 | 211 | ((input_port_read(machine, "WP") & 0x08) && !(data & 0x08)) ? SMH_NOP : SMH_BANK4); |
| 212 | 212 | } |
| 213 | 213 | |
| r2418 | r2419 | |
| 277 | 277 | /* wipe expansion memory banks that are not installed */ |
| 278 | 278 | if (mess_ram_size < 4*1024) |
| 279 | 279 | { |
| 280 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 280 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 281 | 281 | mess_ram_size, 0x0fff, 0, 0, SMH_NOP, SMH_NOP); |
| 282 | 282 | } |
| 283 | 283 | |
| r2418 | r2419 | |
| 305 | 305 | |
| 306 | 306 | /* make 0xf800 to 0xffff point to the last half of the monitor ROM |
| 307 | 307 | so that the CPU can find its reset vectors */ |
| 308 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 308 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 309 | 309 | 0xf800, 0xffff, 0, 0, SMH_BANK1, SMH_NOP); |
| 310 | 310 | memory_set_bankptr(1, sym1_monitor + 0x800); |
| 311 | 311 | } |
| r2418 | r2419 | |
|---|---|---|
| 1164 | 1164 | * when these are safe in the cpu */ |
| 1165 | 1165 | lynx_memory_config = data; |
| 1166 | 1166 | |
| 1167 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfcff, 0, 0, (data & 1) ? SMH_BANK1 : suzy_read); | |
| 1168 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfcff, 0, 0, (data & 1) ? SMH_BANK1 : suzy_write); | |
| 1169 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfd00, 0xfdff, 0, 0, (data & 2) ? SMH_BANK2 : mikey_read); | |
| 1170 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfd00, 0xfdff, 0, 0, (data & 2) ? SMH_BANK2 : mikey_write); | |
| 1167 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfcff, 0, 0, (data & 1) ? SMH_BANK1 : suzy_read); | |
| 1168 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfcff, 0, 0, (data & 1) ? SMH_BANK1 : suzy_write); | |
| 1169 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd00, 0xfdff, 0, 0, (data & 2) ? SMH_BANK2 : mikey_read); | |
| 1170 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd00, 0xfdff, 0, 0, (data & 2) ? SMH_BANK2 : mikey_write); | |
| 1171 | 1171 | |
| 1172 | 1172 | if (data & 1) |
| 1173 | 1173 | memory_set_bankptr(1, lynx_mem_fc00); |
| r2418 | r2419 | |
|---|---|---|
| 249 | 249 | { |
| 250 | 250 | if ( input_port_read_indexed(machine, 0) & 0x080 ) |
| 251 | 251 | { |
| 252 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK10); | |
| 253 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 252 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK10); | |
| 253 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 254 | 254 | memory_set_bankptr(10, &ROM[0x0c000]); |
| 255 | 255 | logerror("cgenie DOS enabled\n"); |
| 256 | 256 | memcpy(&ROM[0x0c000],&ROM[0x10000], 0x2000); |
| 257 | 257 | } |
| 258 | 258 | else |
| 259 | 259 | { |
| 260 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 261 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 260 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 261 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 262 | 262 | logerror("cgenie DOS disabled (no floppy image given)\n"); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | else |
| 266 | 266 | { |
| 267 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 268 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 267 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 268 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_NOP); | |
| 269 | 269 | logerror("cgenie DOS disabled\n"); |
| 270 | 270 | memset(&memory_region(REGION_CPU1)[0x0c000], 0x00, 0x2000); |
| 271 | 271 | } |
| r2418 | r2419 | |
| 273 | 273 | /* copy EXT ROM, if enabled or wipe out that memory area */ |
| 274 | 274 | if( input_port_read_indexed(machine, 0) & 0x20 ) |
| 275 | 275 | { |
| 276 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_ROM); | |
| 277 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_ROM); | |
| 276 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_ROM); | |
| 277 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_ROM); | |
| 278 | 278 | logerror("cgenie EXT enabled\n"); |
| 279 | 279 | memcpy(&memory_region(REGION_CPU1)[0x0e000], |
| 280 | 280 | &memory_region(REGION_CPU1)[0x12000], 0x1000); |
| 281 | 281 | } |
| 282 | 282 | else |
| 283 | 283 | { |
| 284 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_NOP); | |
| 285 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_NOP); | |
| 284 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_NOP); | |
| 285 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_NOP); | |
| 286 | 286 | logerror("cgenie EXT disabled\n"); |
| 287 | 287 | memset(&memory_region(REGION_CPU1)[0x0e000], 0x00, 0x1000); |
| 288 | 288 | } |
| r2418 | r2419 | |
| 324 | 324 | memset(gfx + i * 8, i, 8); |
| 325 | 325 | |
| 326 | 326 | /* set up RAM */ |
| 327 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 328 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0, cgenie_videoram_w); | |
| 327 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 328 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000 + mess_ram_size - 1, 0, 0, cgenie_videoram_w); | |
| 329 | 329 | videoram = mess_ram; |
| 330 | 330 | memory_set_bankptr(1, mess_ram); |
| 331 | 331 |
| r2418 | r2419 | |
|---|---|---|
| 24 | 24 | switch (aquarius_ramsize) |
| 25 | 25 | { |
| 26 | 26 | case 02: |
| 27 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_RAM); | |
| 28 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_RAM); | |
| 29 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 30 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 27 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_RAM); | |
| 28 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_RAM); | |
| 29 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 30 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 31 | 31 | break; |
| 32 | 32 | case 01: |
| 33 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 34 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 35 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 36 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 33 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 34 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 35 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 36 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_RAM); | |
| 37 | 37 | break; |
| 38 | 38 | case 00: |
| 39 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 40 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 41 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP); | |
| 42 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP); | |
| 39 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 40 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_NOP); | |
| 41 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP); | |
| 42 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP); | |
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | } |
| r2418 | r2419 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | static UINT8 pmd85_startup_mem_map = 0; |
| 26 | 26 | static UINT8 pmd853_memory_mapping = 0x01; |
| 27 | static void (*pmd85_update_memory) | |
| 27 | static void (*pmd85_update_memory) | |
| 28 | 28 | |
| 29 | 29 | enum {PMD85_LED_1, PMD85_LED_2, PMD85_LED_3}; |
| 30 | 30 | enum {PMD85_1, PMD85_2, PMD85_2A, PMD85_2B, PMD85_3, ALFA, MATO}; |
| r2418 | r2419 | |
| 33 | 33 | |
| 34 | 34 | static emu_timer * pmd85_cassette_timer; |
| 35 | 35 | |
| 36 | static void pmd851_update_memory | |
| 36 | static void pmd851_update_memory | |
| 37 | 37 | { |
| 38 | 38 | if (pmd85_startup_mem_map) |
| 39 | 39 | { |
| 40 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 41 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 42 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_UNMAP); | |
| 43 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_NOP); | |
| 40 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 41 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 42 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_UNMAP); | |
| 43 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_NOP); | |
| 44 | 44 | |
| 45 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 46 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_NOP); | |
| 45 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 46 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_NOP); | |
| 47 | 47 | |
| 48 | 48 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x010000); |
| 49 | 49 | memory_set_bankptr(3, memory_region(REGION_CPU1) + 0x010000); |
| r2418 | r2419 | |
| 55 | 55 | } |
| 56 | 56 | else |
| 57 | 57 | { |
| 58 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 59 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 60 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3); | |
| 61 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4); | |
| 62 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK5); | |
| 58 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 59 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 60 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3); | |
| 61 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4); | |
| 62 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK5); | |
| 63 | 63 | |
| 64 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 65 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4); | |
| 64 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2); | |
| 65 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4); | |
| 66 | 66 | |
| 67 | 67 | memory_set_bankptr(1, mess_ram); |
| 68 | 68 | memory_set_bankptr(2, mess_ram + 0x1000); |
| r2418 | r2419 | |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void pmd852a_update_memory | |
| 75 | static void pmd852a_update_memory | |
| 76 | 76 | { |
| 77 | 77 | if (pmd85_startup_mem_map) |
| 78 | 78 | { |
| 79 | 79 | |
| 80 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 81 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_UNMAP); | |
| 80 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 81 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_UNMAP); | |
| 82 | 82 | |
| 83 | 83 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x010000); |
| 84 | 84 | memory_set_bankptr(2, mess_ram + 0x9000); |
| r2418 | r2419 | |
| 94 | 94 | } |
| 95 | 95 | else |
| 96 | 96 | { |
| 97 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 98 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3); | |
| 97 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 98 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3); | |
| 99 | 99 | |
| 100 | 100 | memory_set_bankptr(1, mess_ram); |
| 101 | 101 | memory_set_bankptr(2, mess_ram + 0x1000); |
| r2418 | r2419 | |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | static void pmd853_update_memory | |
| 108 | static void pmd853_update_memory | |
| 109 | 109 | { |
| 110 | 110 | if (pmd85_startup_mem_map) |
| 111 | 111 | { |
| r2418 | r2419 | |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static void alfa_update_memory | |
| 142 | static void alfa_update_memory | |
| 143 | 143 | { |
| 144 | 144 | if (pmd85_startup_mem_map) |
| 145 | 145 | { |
| 146 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 147 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x33ff, 0, 0, SMH_UNMAP); | |
| 148 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3400, 0x3fff, 0, 0, SMH_NOP); | |
| 146 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_UNMAP); | |
| 147 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x33ff, 0, 0, SMH_UNMAP); | |
| 148 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3400, 0x3fff, 0, 0, SMH_NOP); | |
| 149 | 149 | |
| 150 | 150 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x010000); |
| 151 | 151 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x011000); |
| r2418 | r2419 | |
| 156 | 156 | } |
| 157 | 157 | else |
| 158 | 158 | { |
| 159 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 160 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x33ff, 0, 0, SMH_BANK2); | |
| 161 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3400, 0x3fff, 0, 0, SMH_BANK3); | |
| 159 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1); | |
| 160 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x33ff, 0, 0, SMH_BANK2); | |
| 161 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3400, 0x3fff, 0, 0, SMH_BANK3); | |
| 162 | 162 | |
| 163 | 163 | memory_set_bankptr(1, mess_ram); |
| 164 | 164 | memory_set_bankptr(2, mess_ram + 0x1000); |
| r2418 | r2419 | |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | static void mato_update_memory | |
| 170 | static void mato_update_memory | |
| 171 | 171 | { |
| 172 | 172 | if (pmd85_startup_mem_map) |
| 173 | 173 | { |
| 174 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 174 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 175 | 175 | |
| 176 | 176 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x010000); |
| 177 | 177 | memory_set_bankptr(2, mess_ram + 0xc000); |
| r2418 | r2419 | |
| 180 | 180 | } |
| 181 | 181 | else |
| 182 | 182 | { |
| 183 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 183 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 184 | 184 | |
| 185 | 185 | memory_set_bankptr(1, mess_ram); |
| 186 | 186 | memory_set_bankptr(2, mess_ram + 0x4000); |
| r2418 | r2419 | |
| 525 | 525 | if (pmd85_startup_mem_map) |
| 526 | 526 | { |
| 527 | 527 | pmd85_startup_mem_map = 0; |
| 528 | pmd85_update_memory(); | |
| 528 | (*pmd85_update_memory)(machine); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | switch (offset & 0x0c) |
| r2418 | r2419 | |
| 539 | 539 | if ((offset & 0x03) == 0x03) |
| 540 | 540 | { |
| 541 | 541 | pmd853_memory_mapping = data & 0x01; |
| 542 | pmd85_update_memory(); | |
| 542 | (*pmd85_update_memory)(machine); | |
| 543 | 543 | } |
| 544 | 544 | break; |
| 545 | 545 | } |
| r2418 | r2419 | |
| 632 | 632 | if (pmd85_startup_mem_map) |
| 633 | 633 | { |
| 634 | 634 | pmd85_startup_mem_map = 0; |
| 635 | pmd85_update_memory(); | |
| 635 | (*pmd85_update_memory)(machine); | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | switch (offset & 0x0c) |
| r2418 | r2419 | |
| 890 | 890 | /* memory initialization */ |
| 891 | 891 | memset(mess_ram, 0, sizeof(unsigned char)*0x10000); |
| 892 | 892 | pmd85_startup_mem_map = 1; |
| 893 | pmd85_update_memory(); | |
| 893 | pmd85_update_memory(machine); | |
| 894 | 894 | |
| 895 | 895 | /* io devices initialization */ |
| 896 | 896 | switch (pmd85_model) |
| r2418 | r2419 | |
|---|---|---|
| 338 | 338 | if (spectrum_128_port_7ffd_data == -1) |
| 339 | 339 | return; |
| 340 | 340 | if (spectrum_plus3_port_1ffd_data == -1) |
| 341 | spectrum_128_update_memory(); | |
| 341 | spectrum_128_update_memory(Machine); | |
| 342 | 342 | |
| 343 | 343 | else |
| 344 | 344 | { |
| r2418 | r2419 | |
| 347 | 347 | spectrum_plus3_port_1ffd_data = 0x04; |
| 348 | 348 | else |
| 349 | 349 | spectrum_plus3_port_1ffd_data = 0; |
| 350 | spectrum_plus3_update_memory(); | |
| 350 | spectrum_plus3_update_memory(Machine); | |
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | 353 | |
| r2418 | r2419 | |
| 1035 | 1035 | { |
| 1036 | 1036 | ts2068_port_f4_data = 0x03; |
| 1037 | 1037 | ts2068_port_ff_data = 0x00; |
| 1038 | ts2068_update_memory(); | |
| 1038 | ts2068_update_memory(Machine); | |
| 1039 | 1039 | } |
| 1040 | 1040 | if (z80_type == SPECTRUM_Z80_SNAPSHOT_TS2068 && !strcmp(machine->gamedrv->name,"ts2068")) |
| 1041 | 1041 | { |
| 1042 | 1042 | ts2068_port_f4_data = pSnapshot[35]; |
| 1043 | 1043 | ts2068_port_ff_data = pSnapshot[36]; |
| 1044 | ts2068_update_memory(); | |
| 1044 | ts2068_update_memory(Machine); | |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
| 1047 | 1047 | } |
| r2418 | r2419 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | int cpunum; |
| 64 | 64 | cpunum = mame_find_cpu_index(machine, "m8502"); |
| 65 | memory_install_read8_handler(cpunum, ADDRESS_SPACE_PROGRAM, start, end, 0, 0, rh); | |
| 65 | memory_install_read8_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, start, end, 0, 0, rh); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 |
| r2418 | r2419 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static void intel82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end, int read_bank, write32_machine_func wh) |
| 106 | 106 | { |
| 107 | memory_install_read_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_bank); | |
| 107 | memory_install_read_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_bank); | |
| 108 | 108 | if (val & 0x01) |
| 109 | 109 | memory_set_bankptr(read_bank, i82439tx->bios_ram + (begin - 0xC0000) / 4); |
| 110 | 110 | else |
| 111 | 111 | memory_set_bankptr(read_bank, memory_region(REGION_USER1) + (begin - 0xC0000)); |
| 112 | 112 | |
| 113 | 113 | if (val & 0x02) |
| 114 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 114 | memory_install_write32_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 115 | 115 | else |
| 116 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_NOP); | |
| 116 | memory_install_write32_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_NOP); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 |
| r2418 | r2419 | |
|---|---|---|
| 163 | 163 | { |
| 164 | 164 | startup_mem_map = 0; |
| 165 | 165 | |
| 166 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 167 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2); | |
| 168 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK3); | |
| 169 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xffff, 0, 0, SMH_UNMAP); | |
| 166 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 167 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2); | |
| 168 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK3); | |
| 169 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xffff, 0, 0, SMH_UNMAP); | |
| 170 | 170 | |
| 171 | 171 | memory_set_bankptr(1, mess_ram); |
| 172 | 172 | memory_set_bankptr(2, mess_ram + 0x4000); |
| r2418 | r2419 | |
| 222 | 222 | |
| 223 | 223 | startup_mem_map = 1; |
| 224 | 224 | |
| 225 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 226 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 227 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 228 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xffff, 0, 0, SMH_UNMAP); | |
| 225 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 226 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 227 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 228 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xffff, 0, 0, SMH_UNMAP); | |
| 229 | 229 | |
| 230 | 230 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x010000); |
| 231 | 231 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x010000); |
| r2418 | r2419 | |
|---|---|---|
| 394 | 394 | if(ext_w==NULL) |
| 395 | 395 | { |
| 396 | 396 | /* read only mode */ |
| 397 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_NOP); | |
| 398 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_NOP); | |
| 397 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_NOP); | |
| 398 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_NOP); | |
| 399 | 399 | } |
| 400 | 400 | else |
| 401 | 401 | { |
| 402 | 402 | /* r/w mode */ |
| 403 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1); | |
| 404 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK2); | |
| 403 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1); | |
| 404 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK2); | |
| 405 | 405 | if(ext_w!=ext_r) logerror("differnt between read and write bank of extension memory.\n"); |
| 406 | 406 | } |
| 407 | 407 | } |
| r2418 | r2419 | |
| 411 | 411 | if(RAMmode) |
| 412 | 412 | { |
| 413 | 413 | /* RAM */ |
| 414 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1); | |
| 415 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK2); | |
| 414 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1); | |
| 415 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK2); | |
| 416 | 416 | memory_set_bankptr(1, pc8801_mainRAM + 0x0000); |
| 417 | 417 | memory_set_bankptr(2, pc8801_mainRAM + 0x6000); |
| 418 | 418 | } |
| r2418 | r2419 | |
| 420 | 420 | { |
| 421 | 421 | /* ROM */ |
| 422 | 422 | /* write through to main RAM */ |
| 423 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, pc8801_writemem1); | |
| 424 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, pc8801_writemem2); | |
| 423 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, pc8801_writemem1); | |
| 424 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, pc8801_writemem2); | |
| 425 | 425 | if(ROMmode) |
| 426 | 426 | { |
| 427 | 427 | /* N-BASIC */ |
| r2418 | r2419 | |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | /* 0x8000 to 0xffff */ |
| 446 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_read_textwindow); | |
| 447 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_write_textwindow); | |
| 446 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_read_textwindow); | |
| 447 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_write_textwindow); | |
| 448 | 448 | |
| 449 | 449 | memory_set_bankptr(4, pc8801_mainRAM + 0x8400); |
| 450 | 450 | |
| r2418 | r2419 | |
| 455 | 455 | } |
| 456 | 456 | else |
| 457 | 457 | { |
| 458 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK5); | |
| 459 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK5); | |
| 460 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6); | |
| 461 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6); | |
| 458 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK5); | |
| 459 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK5); | |
| 460 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6); | |
| 461 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6); | |
| 462 | 462 | |
| 463 | 463 | memory_set_bankptr(5, pc8801_mainRAM + 0xc000); |
| 464 | 464 | if(maptvram) |
| r2418 | r2419 | |
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | ||
| 471 | ||
| 472 | 472 | { |
| 473 | 473 | UINT8 ret[2]; |
| 474 | 474 | select_extmem(NULL,NULL,ret); |
| r2418 | r2419 | |
|---|---|---|
| 325 | 325 | else |
| 326 | 326 | wh = SMH_NOP; |
| 327 | 327 | } |
| 328 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, rh); | |
| 329 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, wh); | |
| 328 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, rh); | |
| 329 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, wh); | |
| 330 | 330 | |
| 331 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xe7ff, 0, 0, (data & 2) == 0 ? SMH_BANK6 : SMH_NOP); | |
| 332 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffef, 0, 0, (data & 2) == 0 ? SMH_BANK8 : SMH_NOP); | |
| 333 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff1, 0xffff, 0, 0, (data & 2) == 0 ? SMH_BANK9 : SMH_NOP); | |
| 331 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xe7ff, 0, 0, (data & 2) == 0 ? SMH_BANK6 : SMH_NOP); | |
| 332 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffef, 0, 0, (data & 2) == 0 ? SMH_BANK8 : SMH_NOP); | |
| 333 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff1, 0xffff, 0, 0, (data & 2) == 0 ? SMH_BANK9 : SMH_NOP); | |
| 334 | 334 | |
| 335 | 335 | if (data&0x20) |
| 336 | 336 | { |
| r2418 | r2419 | |
| 345 | 345 | else |
| 346 | 346 | wh = SMH_NOP; |
| 347 | 347 | } |
| 348 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wh); | |
| 348 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wh); | |
| 349 | 349 | |
| 350 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, (data & 1) == 0 ? SMH_BANK2 : SMH_NOP); | |
| 351 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, (data & 1) == 0 ? SMH_BANK3 : SMH_NOP); | |
| 352 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, (data & 1) == 0 ? SMH_BANK4 : SMH_NOP); | |
| 350 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, (data & 1) == 0 ? SMH_BANK2 : SMH_NOP); | |
| 351 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, (data & 1) == 0 ? SMH_BANK3 : SMH_NOP); | |
| 352 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, (data & 1) == 0 ? SMH_BANK4 : SMH_NOP); | |
| 353 | 353 | |
| 354 | 354 | |
| 355 | 355 | if (data&4) { |
| r2418 | r2419 | |
| 389 | 389 | { |
| 390 | 390 | pet80_bank1_base = pet_memory + 0x8000; |
| 391 | 391 | memory_set_bankptr(1, pet80_bank1_base ); |
| 392 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, pet80_bank1_w); | |
| 392 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, pet80_bank1_w); | |
| 393 | 393 | |
| 394 | 394 | memory_set_bankptr(2, pet_memory + 0x9000); |
| 395 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, SMH_UNMAP); | |
| 395 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, SMH_UNMAP); | |
| 396 | 396 | |
| 397 | 397 | memory_set_bankptr(3, pet_memory + 0xa000); |
| 398 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_UNMAP); | |
| 398 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_UNMAP); | |
| 399 | 399 | |
| 400 | 400 | memory_set_bankptr(4,pet_memory+0xb000); |
| 401 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 401 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 402 | 402 | |
| 403 | 403 | memory_set_bankptr(6,pet_memory+0xc000); |
| 404 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xe7ff, 0, 0, SMH_UNMAP); | |
| 404 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xe7ff, 0, 0, SMH_UNMAP); | |
| 405 | 405 | |
| 406 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, cbm8096_io_r); | |
| 407 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, cbm8096_io_w); | |
| 406 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, cbm8096_io_r); | |
| 407 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0, cbm8096_io_w); | |
| 408 | 408 | |
| 409 | 409 | memory_set_bankptr(8,pet_memory+0xf000); |
| 410 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffef, 0, 0, SMH_UNMAP); | |
| 410 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffef, 0, 0, SMH_UNMAP); | |
| 411 | 411 | |
| 412 | 412 | memory_set_bankptr(9,pet_memory+0xfff1); |
| 413 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff1, 0xffff, 0, 0, SMH_UNMAP); | |
| 413 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff1, 0xffff, 0, 0, SMH_UNMAP); | |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
| r2418 | r2419 | |
| 455 | 455 | level=!level; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | static void pet_common_driver_init | |
| 458 | static void pet_common_driver_init | |
| 459 | 459 | { |
| 460 | 460 | int i; |
| 461 | 461 | |
| r2418 | r2419 | |
| 463 | 463 | if (!pet_memory) |
| 464 | 464 | pet_memory = mess_ram; |
| 465 | 465 | |
| 466 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK10); | |
| 467 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK10); | |
| 466 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK10); | |
| 467 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK10); | |
| 468 | 468 | memory_set_bankptr(10, pet_memory); |
| 469 | 469 | |
| 470 | 470 | if (mess_ram_size < 0x8000) |
| 471 | 471 | { |
| 472 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7FFF, 0, 0, SMH_NOP); | |
| 473 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7FFF, 0, 0, SMH_NOP); | |
| 472 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7FFF, 0, 0, SMH_NOP); | |
| 473 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7FFF, 0, 0, SMH_NOP); | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /* 2114 poweron ? 64 x 0xff, 64x 0, and so on */ |
| r2418 | r2419 | |
| 490 | 490 | |
| 491 | 491 | DRIVER_INIT( pet ) |
| 492 | 492 | { |
| 493 | pet_common_driver_init | |
| 493 | pet_common_driver_init | |
| 494 | 494 | pia_config(0, &pet_pia0); |
| 495 | 495 | pet_vh_init(); |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | DRIVER_INIT( petb ) |
| 499 | 499 | { |
| 500 | pet_common_driver_init | |
| 500 | pet_common_driver_init | |
| 501 | 501 | pia_config(0, &petb_pia0); |
| 502 | 502 | pet_vh_init(); |
| 503 | 503 | } |
| r2418 | r2419 | |
| 505 | 505 | DRIVER_INIT( pet1 ) |
| 506 | 506 | { |
| 507 | 507 | pet_basic1 = 1; |
| 508 | pet_common_driver_init | |
| 508 | pet_common_driver_init | |
| 509 | 509 | pia_config(0, &pet_pia0); |
| 510 | 510 | pet_vh_init(); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | DRIVER_INIT( pet40 ) |
| 514 | 514 | { |
| 515 | pet_common_driver_init | |
| 515 | pet_common_driver_init | |
| 516 | 516 | pia_config(0, &pet_pia0); |
| 517 | 517 | pet_vh_init(); |
| 518 | 518 | } |
| r2418 | r2419 | |
| 522 | 522 | cbm8096 = 1; |
| 523 | 523 | pet_memory = memory_region(REGION_CPU1); |
| 524 | 524 | |
| 525 | pet_common_driver_init | |
| 525 | pet_common_driver_init | |
| 526 | 526 | pia_config(0, &petb_pia0); |
| 527 | 527 | videoram = &pet_memory[0x8000]; |
| 528 | 528 | videoram_size = 0x800; |
| r2418 | r2419 | |
| 532 | 532 | DRIVER_INIT( superpet ) |
| 533 | 533 | { |
| 534 | 534 | superpet = 1; |
| 535 | pet_common_driver_init | |
| 535 | pet_common_driver_init | |
| 536 | 536 | pia_config(0, &petb_pia0); |
| 537 | 537 | |
| 538 | 538 | superpet_memory = auto_malloc(0x10000); |
| r2418 | r2419 | |
| 569 | 569 | { |
| 570 | 570 | if (CBM8096_MEMORY) |
| 571 | 571 | { |
| 572 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff0, 0xfff0, 0, 0, cbm8096_w); | |
| 572 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff0, 0xfff0, 0, 0, cbm8096_w); | |
| 573 | 573 | } |
| 574 | 574 | else |
| 575 | 575 | { |
| 576 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff0, 0xfff0, 0, 0, SMH_NOP); | |
| 576 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff0, 0xfff0, 0, 0, SMH_NOP); | |
| 577 | 577 | } |
| 578 | 578 | cbm8096_w(machine, 0, 0); |
| 579 | 579 | } |
| r2418 | r2419 | |
|---|---|---|
| 474 | 474 | |
| 475 | 475 | if (SIDCARD) |
| 476 | 476 | { |
| 477 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_r); | |
| 478 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_w); | |
| 479 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_r); | |
| 480 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_w); | |
| 477 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_r); | |
| 478 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_w); | |
| 479 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_r); | |
| 480 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_w); | |
| 481 | 481 | } |
| 482 | 482 | else |
| 483 | 483 | { |
| 484 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, SMH_NOP); | |
| 485 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, SMH_NOP); | |
| 486 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, SMH_NOP); | |
| 487 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, SMH_NOP); | |
| 484 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, SMH_NOP); | |
| 485 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfd40, 0xfd5f, 0, 0, SMH_NOP); | |
| 486 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, SMH_NOP); | |
| 487 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe80, 0xfe9f, 0, 0, SMH_NOP); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | #if 0 |
| r2418 | r2419 | |
| 499 | 499 | memory_set_bankptr(6, mess_ram + (0x8000 % mess_ram_size)); |
| 500 | 500 | memory_set_bankptr(7, mess_ram + (0xc000 % mess_ram_size)); |
| 501 | 501 | |
| 502 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xff20, 0xff3d, 0, 0, SMH_BANK10); | |
| 503 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xff40, 0xffff, 0, 0, SMH_BANK11); | |
| 502 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff20, 0xff3d, 0, 0, SMH_BANK10); | |
| 503 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff40, 0xffff, 0, 0, SMH_BANK11); | |
| 504 | 504 | memory_set_bankptr(10, mess_ram + (0xff20 % mess_ram_size)); |
| 505 | 505 | memory_set_bankptr(11, mess_ram + (0xff40 % mess_ram_size)); |
| 506 | 506 | |
| 507 | 507 | if (SIDCARD_HACK) |
| 508 | memory_install_write8_handler | |
| 508 | memory_install_write8_handler | |
| 509 | 509 | |
| 510 | 510 | ted7360_set_dma (ted7360_dma_read, ted7360_dma_read_rom); |
| 511 | 511 | } |
| 512 | 512 | else |
| 513 | 513 | { |
| 514 | memory_install_write8_handler | |
| 514 | memory_install_write8_handler | |
| 515 | 515 | memory_set_bankptr(10, mess_ram + (0x4000 % mess_ram_size)); |
| 516 | 516 | |
| 517 | 517 | if (SIDCARD_HACK) |
| 518 | memory_install_write8_handler | |
| 518 | memory_install_write8_handler | |
| 519 | 519 | |
| 520 | 520 | ted7360_set_dma (ted7360_dma_read, ted7360_dma_read_rom); |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | if (IEC8ON || REAL_C1551) |
| 524 | 524 | { |
| 525 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, tpi6525_2_port_w); | |
| 526 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, tpi6525_2_port_r); | |
| 525 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, tpi6525_2_port_w); | |
| 526 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, tpi6525_2_port_r); | |
| 527 | 527 | } |
| 528 | 528 | else |
| 529 | 529 | { |
| 530 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, SMH_NOP); | |
| 531 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, SMH_NOP); | |
| 530 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, SMH_NOP); | |
| 531 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee0, 0xfeff, 0, 0, SMH_NOP); | |
| 532 | 532 | } |
| 533 | 533 | if (IEC9ON) |
| 534 | 534 | { |
| 535 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, tpi6525_3_port_w); | |
| 536 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, tpi6525_3_port_r); | |
| 535 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, tpi6525_3_port_w); | |
| 536 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, tpi6525_3_port_r); | |
| 537 | 537 | } |
| 538 | 538 | else |
| 539 | 539 | { |
| 540 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, SMH_NOP); | |
| 541 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, SMH_NOP); | |
| 540 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, SMH_NOP); | |
| 541 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec0, 0xfedf, 0, 0, SMH_NOP); | |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | cbm_drive_0_config (SERIAL, 8); |
| r2418 | r2419 | |
|---|---|---|
| 493 | 493 | CALL &320 to start, or use BOBY rom. |
| 494 | 494 | */ |
| 495 | 495 | |
| 496 | static void oric_install_apple2_interface( | |
| 496 | static void oric_install_apple2_interface(running_machine *machine) | |
| 497 | 497 | { |
| 498 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 499 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r); | |
| 500 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4); | |
| 498 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 499 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r); | |
| 500 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4); | |
| 501 | 501 | |
| 502 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 503 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w); | |
| 502 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 503 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w); | |
| 504 | 504 | memory_set_bankptr(4, memory_region(REGION_CPU1) + 0x014000 + 0x020); |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | |
| 508 | static void oric_enable_memory(int low, int high, int rd, int wr) | |
| 508 | static void oric_enable_memory(running_machine *machine, int low, int high, int rd, int wr) | |
| 509 | 509 | { |
| 510 | 510 | int i; |
| 511 | 511 | for (i = low; i <= high; i++) |
| 512 | 512 | { |
| 513 | 513 | switch(i) { |
| 514 | 514 | case 1: |
| 515 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rd ? SMH_BANK1 : SMH_NOP); | |
| 516 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, wr ? SMH_BANK5 : SMH_UNMAP); | |
| 515 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rd ? SMH_BANK1 : SMH_NOP); | |
| 516 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, wr ? SMH_BANK5 : SMH_UNMAP); | |
| 517 | 517 | break; |
| 518 | 518 | case 2: |
| 519 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xf7ff, 0, 0, rd ? SMH_BANK2 : SMH_NOP); | |
| 520 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xf7ff, 0, 0, wr ? SMH_BANK6 : SMH_UNMAP); | |
| 519 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xf7ff, 0, 0, rd ? SMH_BANK2 : SMH_NOP); | |
| 520 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xf7ff, 0, 0, wr ? SMH_BANK6 : SMH_UNMAP); | |
| 521 | 521 | break; |
| 522 | 522 | case 3: |
| 523 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, rd ? SMH_BANK3 : SMH_NOP); | |
| 523 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, rd ? SMH_BANK3 : SMH_NOP); | |
| 524 | 524 | break; |
| 525 | 525 | } |
| 526 | 526 | } |
| r2418 | r2419 | |
| 549 | 549 | /* bit 0 is 0 for page 0, 1 for page 1 */ |
| 550 | 550 | memory_set_bankptr(4, memory_region(REGION_CPU1) + 0x014000 + 0x0100 + (((offset & 0x02)>>1)<<8)); |
| 551 | 551 | |
| 552 | oric_enable_memory(1, 3, TRUE, TRUE); | |
| 552 | oric_enable_memory(machine, 1, 3, TRUE, TRUE); | |
| 553 | 553 | |
| 554 | 554 | /* bit 1 is 0, rom enabled, bit 1 is 1 ram enabled */ |
| 555 | 555 | if ((offset & 0x01)==0) |
| r2418 | r2419 | |
| 585 | 585 | /* APPLE 2 INTERFACE V2 */ |
| 586 | 586 | static void oric_install_apple2_v2_interface(running_machine *machine) |
| 587 | 587 | { |
| 588 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 589 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r); | |
| 590 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4); | |
| 588 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 589 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r); | |
| 590 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4); | |
| 591 | 591 | |
| 592 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 593 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w); | |
| 594 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0380, 0x0383, 0, 0, apple2_v2_interface_w); | |
| 592 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 593 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w); | |
| 594 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0380, 0x0383, 0, 0, apple2_v2_interface_w); | |
| 595 | 595 | |
| 596 | 596 | apple2_v2_interface_w(machine, 0, 0); |
| 597 | 597 | } |
| r2418 | r2419 | |
| 607 | 607 | static unsigned char port_3fb_w; |
| 608 | 608 | |
| 609 | 609 | |
| 610 | static void oric_jasmin_set_mem_0x0c000( | |
| 610 | static void oric_jasmin_set_mem_0x0c000(running_machine *machine) | |
| 611 | 611 | { |
| 612 | 612 | /* assumption: |
| 613 | 613 | 1. It is possible to access all 16k overlay ram. |
| r2418 | r2419 | |
| 631 | 631 | /* no it is disabled */ |
| 632 | 632 | /*logerror("&c000-&ffff is os rom\n"); */ |
| 633 | 633 | |
| 634 | oric_enable_memory(1, 3, TRUE, FALSE); | |
| 634 | oric_enable_memory(machine, 1, 3, TRUE, FALSE); | |
| 635 | 635 | |
| 636 | 636 | rom_ptr = memory_region(REGION_CPU1) + 0x010000; |
| 637 | 637 | memory_set_bankptr(1, rom_ptr); |
| r2418 | r2419 | |
| 642 | 642 | { |
| 643 | 643 | /*logerror("&c000-&ffff is ram\n"); */ |
| 644 | 644 | |
| 645 | oric_enable_memory(1, 3, TRUE, TRUE); | |
| 645 | oric_enable_memory(machine, 1, 3, TRUE, TRUE); | |
| 646 | 646 | |
| 647 | 647 | memory_set_bankptr(1, oric_ram_0x0c000); |
| 648 | 648 | memory_set_bankptr(2, oric_ram_0x0c000+0x02000); |
| r2418 | r2419 | |
| 661 | 661 | /* overlay ram disabled */ |
| 662 | 662 | |
| 663 | 663 | /*logerror("&c000-&f8ff is nothing!\n"); */ |
| 664 | oric_enable_memory(1, 2, FALSE, FALSE); | |
| 664 | oric_enable_memory(machine, 1, 2, FALSE, FALSE); | |
| 665 | 665 | } |
| 666 | 666 | else |
| 667 | 667 | { |
| 668 | 668 | /*logerror("&c000-&f8ff is ram!\n"); */ |
| 669 | oric_enable_memory(1, 2, TRUE, TRUE); | |
| 669 | oric_enable_memory(machine, 1, 2, TRUE, TRUE); | |
| 670 | 670 | |
| 671 | 671 | memory_set_bankptr(1, oric_ram_0x0c000); |
| 672 | 672 | memory_set_bankptr(2, oric_ram_0x0c000+0x02000); |
| r2418 | r2419 | |
| 680 | 680 | |
| 681 | 681 | /*logerror("&f800-&ffff is jasmin rom\n"); */ |
| 682 | 682 | /* jasmin rom enabled */ |
| 683 | oric_enable_memory(3, 3, TRUE, TRUE); | |
| 683 | oric_enable_memory(machine, 3, 3, TRUE, TRUE); | |
| 684 | 684 | rom_ptr = memory_region(REGION_CPU1) + 0x010000+0x04000+0x02000; |
| 685 | 685 | memory_set_bankptr(3, rom_ptr); |
| 686 | 686 | memory_set_bankptr(7, rom_ptr); |
| r2418 | r2419 | |
| 771 | 771 | case 0x0a: |
| 772 | 772 | logerror("jasmin overlay ram w: %02x PC: %04x\n",data,activecpu_get_pc()); |
| 773 | 773 | port_3fa_w = data; |
| 774 | oric_jasmin_set_mem_0x0c000(); | |
| 774 | oric_jasmin_set_mem_0x0c000(machine); | |
| 775 | 775 | break; |
| 776 | 776 | case 0x0b: |
| 777 | 777 | logerror("jasmin romdis w: %02x PC: %04x\n",data,activecpu_get_pc()); |
| 778 | 778 | port_3fb_w = data; |
| 779 | oric_jasmin_set_mem_0x0c000(); | |
| 779 | oric_jasmin_set_mem_0x0c000(machine); | |
| 780 | 780 | break; |
| 781 | 781 | /* bit 0,1 of addr is the drive */ |
| 782 | 782 | case 0x0c: |
| r2418 | r2419 | |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | |
| 796 | static void oric_install_jasmin_interface( | |
| 796 | static void oric_install_jasmin_interface(running_machine *machine) | |
| 797 | 797 | { |
| 798 | 798 | /* romdis */ |
| 799 | 799 | port_3fb_w = 1; |
| 800 | oric_jasmin_set_mem_0x0c000(); | |
| 800 | oric_jasmin_set_mem_0x0c000(machine); | |
| 801 | 801 | |
| 802 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ef, 0, 0, oric_IO_r); | |
| 803 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x03f0, 0x03ff, 0, 0, oric_jasmin_r); | |
| 802 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ef, 0, 0, oric_IO_r); | |
| 803 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x03f0, 0x03ff, 0, 0, oric_jasmin_r); | |
| 804 | 804 | |
| 805 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ef, 0, 0, oric_IO_w); | |
| 806 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x03f0, 0x03ff, 0, 0, oric_jasmin_w); | |
| 805 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ef, 0, 0, oric_IO_w); | |
| 806 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x03f0, 0x03ff, 0, 0, oric_jasmin_w); | |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | /*********************************/ |
| r2418 | r2419 | |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | |
| 879 | static void oric_microdisc_set_mem_0x0c000( | |
| 879 | static void oric_microdisc_set_mem_0x0c000(running_machine *machine) | |
| 880 | 880 | { |
| 881 | 881 | if (oric_is_telestrat) |
| 882 | 882 | return; |
| r2418 | r2419 | |
| 888 | 888 | { |
| 889 | 889 | /*logerror("&c000-&dfff is ram\n"); */ |
| 890 | 890 | /* rom disabled enable ram */ |
| 891 | oric_enable_memory(1, 1, TRUE, TRUE); | |
| 891 | oric_enable_memory(machine, 1, 1, TRUE, TRUE); | |
| 892 | 892 | memory_set_bankptr(1, oric_ram_0x0c000); |
| 893 | 893 | memory_set_bankptr(5, oric_ram_0x0c000); |
| 894 | 894 | } |
| r2418 | r2419 | |
| 897 | 897 | unsigned char *rom_ptr; |
| 898 | 898 | /*logerror("&c000-&dfff is os rom\n"); */ |
| 899 | 899 | /* basic rom */ |
| 900 | oric_enable_memory(1, 1, TRUE, FALSE); | |
| 900 | oric_enable_memory(machine, 1, 1, TRUE, FALSE); | |
| 901 | 901 | rom_ptr = memory_region(REGION_CPU1) + 0x010000; |
| 902 | 902 | memory_set_bankptr(1, rom_ptr); |
| 903 | 903 | memory_set_bankptr(5, rom_ptr); |
| r2418 | r2419 | |
| 910 | 910 | unsigned char *rom_ptr; |
| 911 | 911 | /*logerror("&e000-&ffff is os rom\n"); */ |
| 912 | 912 | /* basic rom */ |
| 913 | oric_enable_memory(2, 3, TRUE, FALSE); | |
| 913 | oric_enable_memory(machine, 2, 3, TRUE, FALSE); | |
| 914 | 914 | rom_ptr = memory_region(REGION_CPU1) + 0x010000; |
| 915 | 915 | memory_set_bankptr(2, rom_ptr+0x02000); |
| 916 | 916 | memory_set_bankptr(3, rom_ptr+0x03800); |
| r2418 | r2419 | |
| 925 | 925 | { |
| 926 | 926 | unsigned char *rom_ptr; |
| 927 | 927 | /*logerror("&e000-&ffff is disk rom\n"); */ |
| 928 | oric_enable_memory(2, 3, TRUE, FALSE); | |
| 928 | oric_enable_memory(machine, 2, 3, TRUE, FALSE); | |
| 929 | 929 | /* enable rom of microdisc interface */ |
| 930 | 930 | rom_ptr = memory_region(REGION_CPU1) + 0x014000; |
| 931 | 931 | memory_set_bankptr(2, rom_ptr); |
| r2418 | r2419 | |
| 935 | 935 | { |
| 936 | 936 | /*logerror("&e000-&ffff is ram\n"); */ |
| 937 | 937 | /* rom disabled enable ram */ |
| 938 | oric_enable_memory(2, 3, TRUE, TRUE); | |
| 938 | oric_enable_memory(machine, 2, 3, TRUE, TRUE); | |
| 939 | 939 | memory_set_bankptr(2, oric_ram_0x0c000+0x02000); |
| 940 | 940 | memory_set_bankptr(3, oric_ram_0x0c000+0x03800); |
| 941 | 941 | memory_set_bankptr(6, oric_ram_0x0c000+0x02000); |
| r2418 | r2419 | |
| 1025 | 1025 | |
| 1026 | 1026 | wd17xx_set_density(density); |
| 1027 | 1027 | |
| 1028 | oric_microdisc_set_mem_0x0c000(); | |
| 1028 | oric_microdisc_set_mem_0x0c000(machine); | |
| 1029 | 1029 | oric_microdisc_refresh_wd179x_ints(machine); |
| 1030 | 1030 | } |
| 1031 | 1031 | break; |
| r2418 | r2419 | |
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | static void oric_install_microdisc_interface( | |
| 1039 | static void oric_install_microdisc_interface(running_machine *machine) | |
| 1040 | 1040 | { |
| 1041 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 1042 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, oric_microdisc_r); | |
| 1043 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, oric_IO_r); | |
| 1041 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r); | |
| 1042 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, oric_microdisc_r); | |
| 1043 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, oric_IO_r); | |
| 1044 | 1044 | |
| 1045 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 1046 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, oric_microdisc_w); | |
| 1047 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, oric_IO_w); | |
| 1045 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w); | |
| 1046 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, oric_microdisc_w); | |
| 1047 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, oric_IO_w); | |
| 1048 | 1048 | |
| 1049 | 1049 | /* disable os rom, enable microdisc rom */ |
| 1050 | 1050 | /* 0x0c000-0x0dfff will be ram, 0x0e000-0x0ffff will be microdisc rom */ |
| 1051 | 1051 | port_314_w = 0x0ff^((1<<7) | (1<<1)); |
| 1052 | 1052 | |
| 1053 | oric_microdisc_set_mem_0x0c000(); | |
| 1053 | oric_microdisc_set_mem_0x0c000(machine); | |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | |
| r2418 | r2419 | |
| 1148 | 1148 | unsigned char *rom_ptr; |
| 1149 | 1149 | |
| 1150 | 1150 | /* os rom */ |
| 1151 | oric_enable_memory(1, 3, TRUE, FALSE); | |
| 1151 | oric_enable_memory(machine, 1, 3, TRUE, FALSE); | |
| 1152 | 1152 | rom_ptr = memory_region(REGION_CPU1) + 0x010000; |
| 1153 | 1153 | memory_set_bankptr(1, rom_ptr); |
| 1154 | 1154 | memory_set_bankptr(2, rom_ptr+0x02000); |
| r2418 | r2419 | |
| 1160 | 1160 | |
| 1161 | 1161 | if (disc_interface_id==ORIC_FLOPPY_INTERFACE_APPLE2) |
| 1162 | 1162 | { |
| 1163 | oric_install_apple2_interface(); | |
| 1163 | oric_install_apple2_interface(machine); | |
| 1164 | 1164 | } |
| 1165 | 1165 | else |
| 1166 | 1166 | { |
| 1167 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ff, 0, 0, oric_IO_r); | |
| 1168 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ff, 0, 0, oric_IO_w); | |
| 1167 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ff, 0, 0, oric_IO_r); | |
| 1168 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x03ff, 0, 0, oric_IO_w); | |
| 1169 | 1169 | } |
| 1170 | 1170 | } |
| 1171 | 1171 | break; |
| r2418 | r2419 | |
| 1179 | 1179 | |
| 1180 | 1180 | case ORIC_FLOPPY_INTERFACE_MICRODISC: |
| 1181 | 1181 | { |
| 1182 | oric_install_microdisc_interface(); | |
| 1182 | oric_install_microdisc_interface(machine); | |
| 1183 | 1183 | } |
| 1184 | 1184 | break; |
| 1185 | 1185 | |
| 1186 | 1186 | case ORIC_FLOPPY_INTERFACE_JASMIN: |
| 1187 | 1187 | { |
| 1188 | oric_install_jasmin_interface(); | |
| 1188 | oric_install_jasmin_interface(machine); | |
| 1189 | 1189 | } |
| 1190 | 1190 | break; |
| 1191 | 1191 | } |
| r2418 | r2419 | |
| 1342 | 1342 | |
| 1343 | 1343 | static struct telestrat_mem_block telestrat_blocks[8]; |
| 1344 | 1344 | |
| 1345 | static void telestrat_refresh_mem( | |
| 1345 | static void telestrat_refresh_mem(running_machine *machine) | |
| 1346 | 1346 | { |
| 1347 | 1347 | read8_machine_func rh; |
| 1348 | 1348 | write8_machine_func wh; |
| r2418 | r2419 | |
| 1376 | 1376 | } |
| 1377 | 1377 | break; |
| 1378 | 1378 | } |
| 1379 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, rh); | |
| 1380 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, wh); | |
| 1379 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, rh); | |
| 1380 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, wh); | |
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | 1383 | static READ8_HANDLER(telestrat_via2_in_a_func) |
| r2418 | r2419 | |
| 1397 | 1397 | { |
| 1398 | 1398 | telestrat_bank_selection = data & 0x07; |
| 1399 | 1399 | |
| 1400 | telestrat_refresh_mem(); | |
| 1400 | telestrat_refresh_mem(machine); | |
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| 1403 | 1403 | |
| r2418 | r2419 | |
| 1508 | 1508 | telestrat_blocks[7].ptr = memory_region(REGION_CPU1)+0x01c000; |
| 1509 | 1509 | |
| 1510 | 1510 | telestrat_bank_selection = 7; |
| 1511 | telestrat_refresh_mem(); | |
| 1511 | telestrat_refresh_mem(machine); | |
| 1512 | 1512 | |
| 1513 | 1513 | /* disable os rom, enable microdisc rom */ |
| 1514 | 1514 | /* 0x0c000-0x0dfff will be ram, 0x0e000-0x0ffff will be microdisc rom */ |
| r2418 | r2419 | |
|---|---|---|
| 42 | 42 | mc10_bfff = 0x00; |
| 43 | 43 | mc10_keyboard_strobe = 0x00; |
| 44 | 44 | |
| 45 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 45 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 46 | 46 | 0x4000, 0x4000 + mess_ram_size - 1, 0, 0, SMH_BANK1, SMH_BANK1); |
| 47 | 47 | memory_set_bankptr(1, mess_ram); |
| 48 | 48 |
| r2418 | r2419 | |
|---|---|---|
| 130 | 130 | if (mess_ram_size > 0x0a0000) |
| 131 | 131 | { |
| 132 | 132 | offs_t ram_limit = 0x100000 + mess_ram_size - 0x0a0000; |
| 133 | memory_install_read_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, ram_limit - 1, 0, 0, STATIC_BANK1); | |
| 134 | memory_install_write_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, ram_limit - 1, 0, 0, STATIC_BANK1); | |
| 133 | memory_install_read_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, ram_limit - 1, 0, 0, 1); | |
| 134 | memory_install_write_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, ram_limit - 1, 0, 0, 1); | |
| 135 | 135 | memory_set_bankptr(1, mess_ram + 0xa0000); |
| 136 | 136 | } |
| 137 | 137 | } |
| r2418 | r2419 | |
| 350 | 350 | switch(buswidth) |
| 351 | 351 | { |
| 352 | 352 | case 8: |
| 353 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 354 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 353 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 354 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 355 | 355 | |
| 356 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, rh); | |
| 357 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 356 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, rh); | |
| 357 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 358 | 358 | break; |
| 359 | 359 | } |
| 360 | 360 | } |
| r2418 | r2419 | |
|---|---|---|
| 245 | 245 | memory_set_bankptr(1, memory_region(REGION_USER1)); |
| 246 | 246 | if (RAM32K) |
| 247 | 247 | { |
| 248 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_RAM); | |
| 249 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_RAM); | |
| 248 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_RAM); | |
| 249 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_RAM); | |
| 250 | 250 | } |
| 251 | 251 | else |
| 252 | 252 | { |
| 253 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_NOP); | |
| 254 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_NOP); | |
| 253 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_NOP); | |
| 254 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xdfff, 0, 0, SMH_NOP); | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 |
| r2418 | r2419 | |
|---|---|---|
| 173 | 173 | ula.rompage = data & 0x0f; |
| 174 | 174 | if ( ula.rompage == 8 || ula.rompage == 9 ) { |
| 175 | 175 | ula.rompage = 8; |
| 176 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, electron_read_keyboard ); | |
| 176 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, electron_read_keyboard ); | |
| 177 | 177 | } else { |
| 178 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2 ); | |
| 178 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2 ); | |
| 179 | 179 | } |
| 180 | 180 | memory_set_bank(2, ula.rompage); |
| 181 | 181 | } |
| r2418 | r2419 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /* prototypes */ |
| 30 | static void ide_interrupt_callback(int state); | |
| 31 | ||
| 32 | 30 | static int ide_cru_r(running_machine *machine, int offset); |
| 33 | 31 | static void ide_cru_w(running_machine *machine, int offset, int data); |
| 34 | 32 | static READ8_HANDLER(ide_mem_r); |
| r2418 | r2419 | |
| 66 | 64 | |
| 67 | 65 | static int ide_irq, clk_irq; |
| 68 | 66 | |
| 69 | static const struct ide_interface ti99_ide_interface = | |
| 70 | { | |
| 71 | ide_interrupt_callback | |
| 72 | }; | |
| 73 | ||
| 74 | 67 | /* The card has a 8-bit->16-bit demultiplexer that can be set-up to assume |
| 75 | 68 | either that the LSByte of a word is accessed first or that the MSByte of a word |
| 76 | 69 | is accessed first. The former is true with ti-99/4(a), the latter with the |
| r2418 | r2419 | |
| 79 | 72 | static int tms9995_mode; |
| 80 | 73 | |
| 81 | 74 | /* |
| 82 | ide_interrupt | |
| 75 | ti99_ide_interrupt | |
| 83 | 76 | |
| 84 | 77 | IDE interrupt callback |
| 85 | 78 | */ |
| 86 | ||
| 79 | ||
| 87 | 80 | { |
| 88 | 81 | ide_irq = state; |
| 89 | 82 | if (cru_register & cru_reg_int_en) |
| r2418 | r2419 | |
| 221 | 214 | |
| 222 | 215 | if ((offset == 6) || (offset == 7)) |
| 223 | 216 | if ((cru_register & cru_reg_int_en) && !(cru_register & cru_reg_reset)) |
| 224 | | |
| 217 | | |
| 225 | 218 | break; |
| 226 | 219 | } |
| 227 | 220 | } |
| r2418 | r2419 | |
| 257 | 250 | case 2: /* IDE registers set 1 (CS1Fx) */ |
| 258 | 251 | if (tms9995_mode ? (!(offset & 1)) : (offset & 1)) |
| 259 | 252 | { /* first read triggers 16-bit read cycle */ |
| 260 | input_latch = (! (offset & 0x10)) ? ide_bus_0_r(0, (offset >> 1) & 0x7) : 0; | |
| 253 | const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 254 | input_latch = (! (offset & 0x10)) ? ide_bus_r(ide_device, 0, (offset >> 1) & 0x7) : 0; | |
| 261 | 255 | } |
| 262 | 256 | |
| 263 | 257 | /* return latched input */ |
| r2418 | r2419 | |
| 268 | 262 | case 3: /* IDE registers set 2 (CS3Fx) */ |
| 269 | 263 | if (tms9995_mode ? (!(offset & 1)) : (offset & 1)) |
| 270 | 264 | { /* first read triggers 16-bit read cycle */ |
| 271 | input_latch = (! (offset & 0x10)) ? ide_bus_0_r(1, (offset >> 1) & 0x7) : 0; | |
| 265 | const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 266 | input_latch = (! (offset & 0x10)) ? ide_bus_r(ide_device, 1, (offset >> 1) & 0x7) : 0; | |
| 272 | 267 | } |
| 273 | 268 | |
| 274 | 269 | /* return latched input */ |
| r2418 | r2419 | |
| 333 | 328 | |
| 334 | 329 | if (tms9995_mode ? (offset & 1) : (!(offset & 1))) |
| 335 | 330 | { /* second write triggers 16-bit write cycle */ |
| 336 | ide_bus_0_w(0, (offset >> 1) & 0x7, output_latch); | |
| 331 | const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 332 | ide_bus_w(ide_device, 0, (offset >> 1) & 0x7, output_latch); | |
| 337 | 333 | } |
| 338 | 334 | break; |
| 339 | 335 | case 3: /* IDE registers set 2 (CS3Fx) */ |
| r2418 | r2419 | |
| 350 | 346 | |
| 351 | 347 | if (tms9995_mode ? (offset & 1) : (!(offset & 1))) |
| 352 | 348 | { /* second write triggers 16-bit write cycle */ |
| 353 | ide_bus_0_w(1, (offset >> 1) & 0x7, output_latch); | |
| 349 | const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 350 | ide_bus_w(ide_device, 1, (offset >> 1) & 0x7, output_latch); | |
| 354 | 351 | } |
| 355 | 352 | break; |
| 356 | 353 | } |
| r2418 | r2419 | |
| 377 | 374 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 378 | 375 | |
| 379 | 376 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 380 | case DEVINFO_PTR_IDEDRIVE_INTERFACE: info->p = (void *) | |
| 377 | case DEVINFO_PTR_IDEDRIVE_INTERFACE: info->p = (void *) ~0 | |
| 381 | 378 | |
| 382 | 379 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 383 | 380 | case MESS_DEVINFO_STR_DEV_TAG: strcpy(info->s = device_temp_str(), "99_ide"); break; |
| r2418 | r2419 | |
|---|---|---|
| 146 | 146 | DRIVER_INIT( apple1 ) |
| 147 | 147 | { |
| 148 | 148 | /* Set up the handlers for MESS's dynamically-sized RAM. */ |
| 149 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 149 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 150 | 150 | 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); |
| 151 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 151 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 152 | 152 | 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); |
| 153 | 153 | memory_set_bankptr(1, mess_ram); |
| 154 | 154 |
| r2418 | r2419 | |
|---|---|---|
| 309 | 309 | WRITE8_HANDLER ( orionz80_memory_page_w ); |
| 310 | 310 | WRITE8_HANDLER ( orionz80_dispatcher_w ); |
| 311 | 311 | |
| 312 | void orionz80_switch_bank( | |
| 312 | static void orionz80_switch_bank(running_machine *machine) | |
| 313 | 313 | { |
| 314 | 314 | UINT8 bank_select; |
| 315 | 315 | UINT8 segment_select; |
| r2418 | r2419 | |
| 317 | 317 | bank_select = (orionz80_dispatcher & 0x0c) >> 2; |
| 318 | 318 | segment_select = orionz80_dispatcher & 0x03; |
| 319 | 319 | |
| 320 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 320 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 321 | 321 | if ((orionz80_dispatcher & 0x80)==0) { // dispatcher on |
| 322 | 322 | memory_set_bankptr(1, mess_ram + 0x10000 * bank_select + segment_select * 0x4000 ); |
| 323 | 323 | } else { // dispatcher off |
| r2418 | r2419 | |
| 327 | 327 | memory_set_bankptr(2, mess_ram + 0x4000 + 0x10000 * orionz80_memory_page); |
| 328 | 328 | |
| 329 | 329 | if ((orionz80_dispatcher & 0x20) == 0) { |
| 330 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_w); | |
| 331 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w); | |
| 332 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_w); | |
| 333 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_r); | |
| 334 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_r); | |
| 335 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_r); | |
| 330 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_w); | |
| 331 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w); | |
| 332 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_w); | |
| 333 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_r); | |
| 334 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_r); | |
| 335 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_r); | |
| 336 | 336 | |
| 337 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xf8ff, 0, 0, orion128_video_mode_w); | |
| 338 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf900, 0xf9ff, 0, 0, orionz80_memory_page_w); | |
| 339 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfa00, 0xfaff, 0, 0, orion128_video_page_w); | |
| 340 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfb00, 0xfbff, 0, 0, orionz80_dispatcher_w); | |
| 341 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfeff, 0, 0, SMH_UNMAP); | |
| 342 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xff00, 0xffff, 0, 0, orionz80_sound_w); | |
| 337 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xf8ff, 0, 0, orion128_video_mode_w); | |
| 338 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf900, 0xf9ff, 0, 0, orionz80_memory_page_w); | |
| 339 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfa00, 0xfaff, 0, 0, orion128_video_page_w); | |
| 340 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfb00, 0xfbff, 0, 0, orionz80_dispatcher_w); | |
| 341 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfeff, 0, 0, SMH_UNMAP); | |
| 342 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff00, 0xffff, 0, 0, orionz80_sound_w); | |
| 343 | 343 | |
| 344 | 344 | memory_set_bankptr(3, mess_ram + 0xf000); |
| 345 | 345 | memory_set_bankptr(5, memory_region(REGION_CPU1) + 0xf800); |
| r2418 | r2419 | |
| 355 | 355 | WRITE8_HANDLER ( orionz80_memory_page_w ) |
| 356 | 356 | { |
| 357 | 357 | orionz80_memory_page = data & 7; |
| 358 | orionz80_switch_bank(); | |
| 358 | orionz80_switch_bank(machine); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | WRITE8_HANDLER ( orionz80_dispatcher_w ) |
| 362 | 362 | { |
| 363 | 363 | orionz80_dispatcher = data; |
| 364 | orionz80_switch_bank(); | |
| 364 | orionz80_switch_bank(machine); | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | MACHINE_RESET ( orionz80 ) |
| 368 | 368 | { |
| 369 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 370 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xefff, 0, 0, SMH_BANK2); | |
| 371 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf3ff, 0, 0, SMH_BANK3); | |
| 369 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 370 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xefff, 0, 0, SMH_BANK2); | |
| 371 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf3ff, 0, 0, SMH_BANK3); | |
| 372 | 372 | |
| 373 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_w); | |
| 374 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w); | |
| 375 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_w); | |
| 376 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_r); | |
| 377 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_r); | |
| 378 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_r); | |
| 373 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_w); | |
| 374 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w); | |
| 375 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_w); | |
| 376 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf400, 0xf4ff, 0, 0, orion128_system_r); | |
| 377 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_r); | |
| 378 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_r); | |
| 379 | 379 | |
| 380 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xf8ff, 0, 0, orion128_video_mode_w); | |
| 381 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf900, 0xf9ff, 0, 0, orionz80_memory_page_w); | |
| 382 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfa00, 0xfaff, 0, 0, orion128_video_page_w); | |
| 383 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfb00, 0xfbff, 0, 0, orionz80_dispatcher_w); | |
| 384 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfeff, 0, 0, SMH_UNMAP); | |
| 385 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xff00, 0xffff, 0, 0, orionz80_sound_w); | |
| 380 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xf8ff, 0, 0, orion128_video_mode_w); | |
| 381 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf900, 0xf9ff, 0, 0, orionz80_memory_page_w); | |
| 382 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfa00, 0xfaff, 0, 0, orion128_video_page_w); | |
| 383 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfb00, 0xfbff, 0, 0, orionz80_dispatcher_w); | |
| 384 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfc00, 0xfeff, 0, 0, SMH_UNMAP); | |
| 385 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff00, 0xffff, 0, 0, orionz80_sound_w); | |
| 386 | 386 | |
| 387 | 387 | |
| 388 | 388 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xf800); |
| r2418 | r2419 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | void ti99_ide_init(void); |
| 7 | 7 | void ti99_ide_reset(int in_tms9995_mode); |
| 8 | ||
| 9 | void ti99_ide_interrupt(int state); |
| r2418 | r2419 | |
|---|---|---|
| 72 | 72 | * Driver/Machine Init |
| 73 | 73 | * ----------------------------------------------------------------------- */ |
| 74 | 74 | |
| 75 | static void a7800_driver_init(int ispal, int lines) | |
| 75 | static void a7800_driver_init(running_machine *machine, int ispal, int lines) | |
| 76 | 76 | { |
| 77 | 77 | if (ispal) |
| 78 | 78 | { |
| r2418 | r2419 | |
| 97 | 97 | memory_set_bankptr(7, &ROM[0x2000]); /* MAINRAM */ |
| 98 | 98 | |
| 99 | 99 | /* Brutal hack put in as a consequence of new memory system; fix this */ |
| 100 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0480, 0x04FF, 0, 0, SMH_BANK10); | |
| 101 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0480, 0x04FF, 0, 0, SMH_BANK10); | |
| 100 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0480, 0x04FF, 0, 0, SMH_BANK10); | |
| 101 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0480, 0x04FF, 0, 0, SMH_BANK10); | |
| 102 | 102 | memory_set_bankptr(10, memory_region(REGION_CPU1) + 0x0480); |
| 103 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x27FF, 0, 0, SMH_BANK11); | |
| 104 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x27FF, 0, 0, SMH_BANK11); | |
| 103 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x27FF, 0, 0, SMH_BANK11); | |
| 104 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x27FF, 0, 0, SMH_BANK11); | |
| 105 | 105 | memory_set_bankptr(11, memory_region(REGION_CPU1) + 0x1800); |
| 106 | 106 | } |
| 107 | 107 | |
| r2418 | r2419 | |
| 109 | 109 | |
| 110 | 110 | DRIVER_INIT( a7800_ntsc ) |
| 111 | 111 | { |
| 112 | a7800_driver_init(FALSE, 262); | |
| 112 | a7800_driver_init(machine, FALSE, 262); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | DRIVER_INIT( a7800_pal ) |
| 118 | 118 | { |
| 119 | a7800_driver_init(TRUE, 312); | |
| 119 | a7800_driver_init(machine, TRUE, 312); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| r2418 | r2419 | |
| 139 | 139 | /* pokey cartridge */ |
| 140 | 140 | if (a7800_cart_type & 0x01) |
| 141 | 141 | { |
| 142 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7FFF, 0, 0, pokey1_r); | |
| 143 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7FFF, 0, 0, pokey1_w); | |
| 142 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7FFF, 0, 0, pokey1_r); | |
| 143 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7FFF, 0, 0, pokey1_w); | |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 |
| r2418 | r2419 | |
|---|---|---|
| 460 | 460 | * |
| 461 | 461 | *************************************/ |
| 462 | 462 | |
| 463 | static READ8_HANDLER( bebox_800001F0_8_r ) { return ide_controller_0_r(offset + 0x1F0); } | |
| 464 | static WRITE8_HANDLER( bebox_800001F0_8_w ) { ide_controller_0_w(offset + 0x1F0, data); } | |
| 463 | static const device_config *ide_device(running_machine *machine) | |
| 464 | { | |
| 465 | return device_list_find_by_tag( | |
| 466 | machine->config->devicelist, | |
| 467 | IDE_CONTROLLER, | |
| 468 | "ide_controller"); | |
| 469 | } | |
| 465 | 470 | |
| 471 | static READ8_HANDLER( bebox_800001F0_8_r ) { return ide_controller_r(ide_device(machine), offset + 0x1F0); } | |
| 472 | static WRITE8_HANDLER( bebox_800001F0_8_w ) { ide_controller_w(ide_device(machine), offset + 0x1F0, data); } | |
| 473 | ||
| 466 | 474 | READ64_HANDLER( bebox_800001F0_r ) { return read64be_with_read8_handler(bebox_800001F0_8_r, machine, offset, mem_mask); } |
| 467 | 475 | WRITE64_HANDLER( bebox_800001F0_w ) { write64be_with_write8_handler(bebox_800001F0_8_w, machine, offset, data, mem_mask); } |
| 468 | 476 | |
| r2418 | r2419 | |
| 474 | 482 | if (((mem_mask >> 8) & 0xFF) == 0) |
| 475 | 483 | { |
| 476 | 484 | result &= ~(0xFF << 8); |
| 477 | result |= ide_controller_ | |
| 485 | result |= ide_controller_ | |
| 478 | 486 | } |
| 479 | 487 | |
| 480 | 488 | if (((mem_mask >> 0) & 0xFF) == 0) |
| 481 | 489 | { |
| 482 | 490 | result &= ~(0xFF << 0); |
| 483 | result |= ide_controller_ | |
| 491 | result |= ide_controller_ | |
| 484 | 492 | } |
| 485 | 493 | return result; |
| 486 | 494 | } |
| r2418 | r2419 | |
| 491 | 499 | pc64be_fdc_w(machine, offset, data, mem_mask | 0xFFFF); |
| 492 | 500 | |
| 493 | 501 | if (((mem_mask >> 8) & 0xFF) == 0) |
| 494 | ide_controller_ | |
| 502 | ide_controller_ | |
| 495 | 503 | |
| 496 | 504 | if (((mem_mask >> 0) & 0xFF) == 0) |
| 497 | ide_controller_ | |
| 505 | ide_controller_ | |
| 498 | 506 | } |
| 499 | 507 | |
| 500 | 508 | |
| 501 | ||
| 509 | ||
| 502 | 510 | { |
| 503 | 511 | bebox_set_irq_bit(Machine, 7, state); |
| 504 | 512 | if ( bebox_devices.pic8259_master ) { |
| r2418 | r2419 | |
| 507 | 515 | } |
| 508 | 516 | |
| 509 | 517 | |
| 510 | static const struct ide_interface bebox_ide_interface = | |
| 511 | { | |
| 512 | bebox_ide_interrupt | |
| 513 | }; | |
| 514 | ||
| 515 | ||
| 516 | 518 | /************************************* |
| 517 | 519 | * |
| 518 | 520 | * Video card (Cirrus Logic CL-GD5430) |
| r2418 | r2419 | |
| 558 | 560 | bebox_vga_memory_rh = rh; |
| 559 | 561 | bebox_vga_memory_wh = wh; |
| 560 | 562 | |
| 561 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00A0000, 0xC00BFFFF, 0, 0, SMH_NOP); | |
| 562 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00A0000, 0xC00BFFFF, 0, 0, SMH_NOP); | |
| 563 | memory_install_read64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00A0000, 0xC00BFFFF, 0, 0, SMH_NOP); | |
| 564 | memory_install_write64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00A0000, 0xC00BFFFF, 0, 0, SMH_NOP); | |
| 563 | 565 | |
| 564 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0000000 + begin, 0xC0000000 + end, 0, 0, rh64); | |
| 565 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0000000 + begin, 0xC0000000 + end, 0, 0, wh64); | |
| 566 | memory_install_read64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xC0000000 + begin, 0xC0000000 + end, 0, 0, rh64); | |
| 567 | memory_install_write64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xC0000000 + begin, 0xC0000000 + end, 0, 0, wh64); | |
| 566 | 568 | } |
| 567 | 569 | |
| 568 | 570 | |
| r2418 | r2419 | |
| 985 | 987 | if (scsi53c810_data[5] != 0xFFFFFFF0) |
| 986 | 988 | { |
| 987 | 989 | addr = (scsi53c810_data[5] | 0xC0000000) & ~0xFF; |
| 988 | memory_install_read64_handler(0, ADDRESS_SPACE_PROGRAM, addr, addr + 0xFF, 0, 0, scsi53c810_r); | |
| 989 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, addr, addr + 0xFF, 0, 0, scsi53c810_w); | |
| 990 | memory_install_read64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, addr, addr + 0xFF, 0, 0, scsi53c810_r); | |
| 991 | memory_install_write64_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, addr, addr + 0xFF, 0, 0, scsi53c810_w); | |
| 990 | 992 | } |
| 991 | 993 | } |
| 992 | 994 | break; |
| r2418 | r2419 | |
| 1049 | 1051 | |
| 1050 | 1052 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); |
| 1051 | 1053 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); |
| 1052 | ide_controller_reset(0); | |
| 1053 | 1054 | } |
| 1054 | 1055 | |
| 1055 | 1056 | static void bebox_exit(running_machine *machine) |
| r2418 | r2419 | |
| 1080 | 1081 | /* install MESS managed RAM */ |
| 1081 | 1082 | for (cpu = 0; cpu < 2; cpu++) |
| 1082 | 1083 | { |
| 1083 | memory_install_read64_handler(cpu, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0x02000000, SMH_BANK3); | |
| 1084 | memory_install_write64_handler(cpu, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0x02000000, SMH_BANK3); | |
| 1084 | memory_install_read64_handler(machine, cpu, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0x02000000, SMH_BANK3); | |
| 1085 | memory_install_write64_handler(machine, cpu, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0x02000000, SMH_BANK3); | |
| 1085 | 1086 | } |
| 1086 | 1087 | memory_set_bankptr(3, mess_ram); |
| 1087 | 1088 | |
| r2418 | r2419 | |
| 1093 | 1094 | |
| 1094 | 1095 | // pc_fdc_init(&bebox_fdc_interface); |
| 1095 | 1096 | mc146818_init(MC146818_STANDARD); |
| 1096 | ide_controller_init_custom(0, &bebox_ide_interface, NULL); | |
| 1097 | 1097 | pc_vga_init(machine, &bebox_vga_interface, &cirrus_svga_interface); |
| 1098 | 1098 | kbdc8042_init(&bebox_8042_interface); |
| 1099 | 1099 | |
| r2418 | r2419 | |
| 1102 | 1102 | vram_end = vram_begin + pc_vga_memory_size() - 1; |
| 1103 | 1103 | for (cpu = 0; cpu < 2; cpu++) |
| 1104 | 1104 | { |
| 1105 | memory_install_read64_handler(cpu, ADDRESS_SPACE_PROGRAM, vram_begin, vram_end, 0, 0, bebox_video_r); | |
| 1106 | memory_install_write64_handler(cpu, ADDRESS_SPACE_PROGRAM, vram_begin, vram_end, 0, 0, bebox_video_w); | |
| 1105 | memory_install_read64_handler(machine, cpu, ADDRESS_SPACE_PROGRAM, vram_begin, vram_end, 0, 0, bebox_video_r); | |
| 1106 | memory_install_write64_handler(machine, cpu, ADDRESS_SPACE_PROGRAM, vram_begin, vram_end, 0, 0, bebox_video_w); | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | /* SCSI */ |
| r2418 | r2419 | |
| 1128 | 1128 | /* bcctr 0x14, 0 */ |
| 1129 | 1129 | U64(0x4E80042000000000) |
| 1130 | 1130 | }; |
| 1131 | memory_install_read64_handler(1, ADDRESS_SPACE_PROGRAM, 0x9421FFF0, 0x9421FFFF, 0, 0, SMH_BANK1); | |
| 1131 | memory_install_read64_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x9421FFF0, 0x9421FFFF, 0, 0, SMH_BANK1); | |
| 1132 | 1132 | memory_set_bankptr(1, ops); |
| 1133 | 1133 | } |
| 1134 | 1134 | } |
| r2418 | r2419 | |
|---|---|---|
| 280 | 280 | switch (mess_ram_size) |
| 281 | 281 | { |
| 282 | 282 | case 1 * 1024: |
| 283 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 283 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 284 | 284 | 0x1400, 0x9000, 0, 0, SMH_NOP, SMH_NOP); |
| 285 | 285 | break; |
| 286 | 286 | |
| 287 | 287 | case 16 * 1024: |
| 288 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 288 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 289 | 289 | 0x1400, 0x4fff, 0, 0, SMH_BANK1, SMH_BANK1); |
| 290 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 290 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 291 | 291 | 0x5000, 0xafff, 0, 0, SMH_NOP, SMH_NOP); |
| 292 | 292 | memory_set_bankptr(1, mess_ram); |
| 293 | 293 | break; |
| 294 | 294 | |
| 295 | 295 | case 32 * 1024: |
| 296 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 296 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 297 | 297 | 0x1400, 0x8fff, 0, 0, SMH_BANK1, SMH_BANK1); |
| 298 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 298 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 299 | 299 | 0x9000, 0xafff, 0, 0, SMH_NOP, SMH_NOP); |
| 300 | 300 | memory_set_bankptr(1, mess_ram); |
| 301 | 301 | break; |
| 302 | 302 | |
| 303 | 303 | case 40 * 1024: |
| 304 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 304 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 305 | 305 | 0x1400, 0xafff, 0, 0, SMH_BANK1, SMH_BANK1); |
| 306 | 306 | memory_set_bankptr(1, mess_ram); |
| 307 | 307 | break; |
| r2418 | r2419 | |
|---|---|---|
| 314 | 314 | /* set ram bank, for invalid pages a nop-handler will be installed */ |
| 315 | 315 | if (ram_page >= mess_ram_size/0x8000) |
| 316 | 316 | { |
| 317 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP, SMH_NOP); | |
| 318 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_NOP, SMH_NOP); | |
| 317 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP, SMH_NOP); | |
| 318 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_NOP, SMH_NOP); | |
| 319 | 319 | } |
| 320 | 320 | else if (ram_page + 1 == mess_ram_size/0x8000) |
| 321 | 321 | { |
| 322 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP, SMH_NOP); | |
| 323 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 322 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_NOP, SMH_NOP); | |
| 323 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 324 | 324 | memory_set_bank(4, ram_page); |
| 325 | 325 | } |
| 326 | 326 | else |
| 327 | 327 | { |
| 328 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK3, SMH_BANK3); | |
| 329 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 328 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK3, SMH_BANK3); | |
| 329 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK4, SMH_BANK4); | |
| 330 | 330 | memory_set_bank(3, ram_page); |
| 331 | 331 | memory_set_bank(4, ram_page); |
| 332 | 332 | } |
| r2418 | r2419 | |
| 362 | 362 | z80dart_init(0, &mtx_dart_intf); |
| 363 | 363 | |
| 364 | 364 | /* install handlers for dart interface */ |
| 365 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0d, 0, 0, mtx_dart_data_r, mtx_dart_data_w); | |
| 366 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, mtx_dart_control_r, mtx_dart_control_w); | |
| 365 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0d, 0, 0, mtx_dart_data_r, mtx_dart_data_w); | |
| 366 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, mtx_dart_control_r, mtx_dart_control_w); | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | MACHINE_RESET( rs128 ) |
| r2418 | r2419 | |
|---|---|---|
| 884 | 884 | switch (input_port_read_indexed(machine, 0) & 3) |
| 885 | 885 | { |
| 886 | 886 | case 0: // 1K only :) |
| 887 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_NOP); | |
| 888 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_NOP); | |
| 887 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_NOP); | |
| 888 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_NOP); | |
| 889 | 889 | break; |
| 890 | 890 | case 1: // +7K TANEX |
| 891 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x1fff, 0, 0, SMH_RAM); | |
| 892 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x1fff, 0, 0, SMH_RAM); | |
| 893 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0xbbff, 0, 0, SMH_NOP); | |
| 894 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0xbbff, 0, 0, SMH_NOP); | |
| 891 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x1fff, 0, 0, SMH_RAM); | |
| 892 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x1fff, 0, 0, SMH_RAM); | |
| 893 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0xbbff, 0, 0, SMH_NOP); | |
| 894 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0xbbff, 0, 0, SMH_NOP); | |
| 895 | 895 | break; |
| 896 | 896 | default: // +7K TANEX + 40K TANRAM |
| 897 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_RAM); | |
| 898 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_RAM); | |
| 897 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_RAM); | |
| 898 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0xbbff, 0, 0, SMH_RAM); | |
| 899 | 899 | break; |
| 900 | 900 | } |
| 901 | 901 |
| r2418 | r2419 | |
|---|---|---|
| 157 | 157 | return specimx_color; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | void specimx_set_bank(int i,int data) { | |
| 161 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffbf, 0, 0, SMH_BANK3); | |
| 162 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc0, 0xffdf, 0, 0, SMH_BANK4); | |
| 160 | static void specimx_set_bank(running_machine *machine, int i,int data) | |
| 161 | { | |
| 162 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffbf, 0, 0, SMH_BANK3); | |
| 163 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xffc0, 0xffdf, 0, 0, SMH_BANK4); | |
| 163 | 164 | memory_set_bankptr(4, mess_ram + 0xffc0); |
| 164 | 165 | switch(i) { |
| 165 | 166 | case 0 : |
| 166 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 167 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, video_memory_w); | |
| 167 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 168 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, video_memory_w); | |
| 168 | 169 | |
| 169 | 170 | memory_set_bankptr(1, mess_ram); |
| 170 | 171 | memory_set_bankptr(2, mess_ram + 0x9000); |
| 171 | 172 | memory_set_bankptr(3, mess_ram + 0xc000); |
| 172 | 173 | break; |
| 173 | 174 | case 1 : |
| 174 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 175 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_BANK2); | |
| 175 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_BANK1); | |
| 176 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_BANK2); | |
| 176 | 177 | |
| 177 | 178 | memory_set_bankptr(1, mess_ram + 0x10000); |
| 178 | 179 | memory_set_bankptr(2, mess_ram + 0x19000); |
| 179 | 180 | memory_set_bankptr(3, mess_ram + 0x1c000); |
| 180 | 181 | break; |
| 181 | 182 | case 2 : |
| 182 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_UNMAP); | |
| 183 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 183 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x8fff, 0, 0, SMH_UNMAP); | |
| 184 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 184 | 185 | |
| 185 | 186 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x10000); |
| 186 | 187 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x19000); |
| r2418 | r2419 | |
| 194 | 195 | } |
| 195 | 196 | WRITE8_HANDLER( specimx_select_bank ) |
| 196 | 197 | { |
| 197 | specimx_set_bank(offset, data); | |
| 198 | specimx_set_bank(machine, offset, data); | |
| 198 | 199 | } |
| 199 | 200 | |
| 200 | 201 | DRIVER_INIT(specimx) |
| r2418 | r2419 | |
| 239 | 240 | |
| 240 | 241 | MACHINE_RESET( specimx ) |
| 241 | 242 | { |
| 242 | specimx_set_bank(2,0x00); // Initiali load ROM disk | |
| 243 | specimx_set_bank(machine, 2,0x00); // Initiali load ROM disk | |
| 243 | 244 | specimx_color = 0x70; |
| 244 | 245 | wd17xx_reset(); |
| 245 | 246 | wd17xx_set_side(0); |
| r2418 | r2419 | |
| 313 | 314 | static UINT8 RR_register; |
| 314 | 315 | static UINT8 RC_register; |
| 315 | 316 | |
| 316 | void erik_set_bank( | |
| 317 | static void erik_set_bank(running_machine *machine) { | |
| 317 | 318 | UINT8 bank1 = (RR_register & 3); |
| 318 | 319 | UINT8 bank2 = ((RR_register >> 2) & 3); |
| 319 | 320 | UINT8 bank3 = ((RR_register >> 4) & 3); |
| 320 | 321 | UINT8 bank4 = ((RR_register >> 6) & 3); |
| 321 | 322 | |
| 322 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 323 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x8fff, 0, 0, SMH_BANK2); | |
| 324 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_BANK3); | |
| 325 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK4); | |
| 326 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_BANK5); | |
| 327 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK6); | |
| 323 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 324 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x8fff, 0, 0, SMH_BANK2); | |
| 325 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_BANK3); | |
| 326 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_BANK4); | |
| 327 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_BANK5); | |
| 328 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK6); | |
| 328 | 329 | |
| 329 | 330 | switch(bank1) { |
| 330 | 331 | case 1: |
| r2418 | r2419 | |
| 333 | 334 | memory_set_bankptr(1, mess_ram + 0x10000*(bank1-1)); |
| 334 | 335 | break; |
| 335 | 336 | case 0: |
| 336 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 337 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 337 | 338 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x10000); |
| 338 | 339 | break; |
| 339 | 340 | } |
| r2418 | r2419 | |
| 344 | 345 | memory_set_bankptr(2, mess_ram + 0x10000*(bank2-1) + 0x4000); |
| 345 | 346 | break; |
| 346 | 347 | case 0: |
| 347 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x8fff, 0, 0, SMH_UNMAP); | |
| 348 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x8fff, 0, 0, SMH_UNMAP); | |
| 348 | 349 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x14000); |
| 349 | 350 | break; |
| 350 | 351 | } |
| r2418 | r2419 | |
| 355 | 356 | memory_set_bankptr(3, mess_ram + 0x10000*(bank3-1) + 0x9000); |
| 356 | 357 | break; |
| 357 | 358 | case 0: |
| 358 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 359 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 359 | 360 | memory_set_bankptr(3, memory_region(REGION_CPU1) + 0x19000); |
| 360 | 361 | break; |
| 361 | 362 | } |
| r2418 | r2419 | |
| 368 | 369 | memory_set_bankptr(6, mess_ram + 0x10000*(bank4-1) + 0x0f800); |
| 369 | 370 | break; |
| 370 | 371 | case 0: |
| 371 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_UNMAP); | |
| 372 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xefff, 0, 0, SMH_UNMAP); | |
| 372 | 373 | memory_set_bankptr(4, memory_region(REGION_CPU1) + 0x1c000); |
| 373 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP); | |
| 374 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_NOP); | |
| 375 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, specialist_keyboard_w); | |
| 376 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, specialist_keyboard_r); | |
| 374 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP); | |
| 375 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xf7ff, 0, 0, SMH_NOP); | |
| 376 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, specialist_keyboard_w); | |
| 377 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, specialist_keyboard_r); | |
| 377 | 378 | break; |
| 378 | 379 | } |
| 379 | 380 | } |
| r2418 | r2419 | |
| 401 | 402 | |
| 402 | 403 | RR_register = 0x00; |
| 403 | 404 | RC_register = 0x00; |
| 404 | erik_set_bank(); | |
| 405 | erik_set_bank(machine); | |
| 405 | 406 | } |
| 406 | 407 | |
| 407 | 408 | READ8_HANDLER ( erik_rr_reg_r ) |
| r2418 | r2419 | |
| 411 | 412 | WRITE8_HANDLER( erik_rr_reg_w ) |
| 412 | 413 | { |
| 413 | 414 | RR_register = data; |
| 414 | erik_set_bank(); | |
| 415 | erik_set_bank(machine); | |
| 415 | 416 | } |
| 416 | 417 | |
| 417 | 418 | READ8_HANDLER ( erik_rc_reg_r ) |
| r2418 | r2419 | |
|---|---|---|
| 97 | 97 | { |
| 98 | 98 | case 03: |
| 99 | 99 | case 02: |
| 100 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_RAM); | |
| 101 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_RAM); | |
| 102 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 103 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 100 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_RAM); | |
| 101 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_RAM); | |
| 102 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 103 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 104 | 104 | break; |
| 105 | 105 | case 01: |
| 106 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 107 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 108 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 109 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 106 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 107 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 108 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 109 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_RAM); | |
| 110 | 110 | break; |
| 111 | 111 | case 00: |
| 112 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 113 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 114 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_NOP); | |
| 115 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_NOP); | |
| 112 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 113 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8800, 0xffff, 0, 0, SMH_NOP); | |
| 114 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_NOP); | |
| 115 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x87ff, 0, 0, SMH_NOP); | |
| 116 | 116 | break; |
| 117 | 117 | } |
| 118 | 118 |
| r2418 | r2419 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | static void amiga_ar1_check_overlay( void ) |
| 130 | 130 | { |
| 131 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x00007f, 0, 0, amiga_ar1_chipmem_w); | |
| 131 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x00007f, 0, 0, amiga_ar1_chipmem_w); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static void amiga_ar1_init( void ) |
| r2418 | r2419 | |
| 147 | 147 | memset(ar_ram, 0, 0x4000); |
| 148 | 148 | |
| 149 | 149 | /* Install ROM */ |
| 150 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf7ffff, 0, 0, SMH_BANK2); | |
| 151 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf7ffff, 0, 0, SMH_ROM); | |
| 150 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf7ffff, 0, 0, SMH_BANK2); | |
| 151 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf7ffff, 0, 0, SMH_ROM); | |
| 152 | 152 | |
| 153 | 153 | /* Install RAM */ |
| 154 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9fc000, 0x9fffff, 0, 0, SMH_BANK3); | |
| 155 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9fc000, 0x9fffff, 0, 0, SMH_BANK3); | |
| 154 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x9fc000, 0x9fffff, 0, 0, SMH_BANK3); | |
| 155 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x9fc000, 0x9fffff, 0, 0, SMH_BANK3); | |
| 156 | 156 | |
| 157 | 157 | /* Configure Banks */ |
| 158 | 158 | memory_set_bankptr(2, memory_region(REGION_USER2)); |
| r2418 | r2419 | |
| 203 | 203 | { |
| 204 | 204 | if ( data & 2 ) |
| 205 | 205 | { |
| 206 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xbfd000, 0xbfefff, 0, 0, amiga_ar23_cia_r); | |
| 206 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xbfd000, 0xbfefff, 0, 0, amiga_ar23_cia_r); | |
| 207 | 207 | } |
| 208 | 208 | else |
| 209 | 209 | { |
| 210 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xbfd000, 0xbfefff, 0, 0, amiga_cia_r); | |
| 210 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xbfd000, 0xbfefff, 0, 0, amiga_cia_r); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | amiga_ar23_mode = (data&0x3); |
| r2418 | r2419 | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /* overlay disabled, map RAM on 0x000000 */ |
| 240 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1); | |
| 240 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1); | |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
| r2418 | r2419 | |
| 277 | 277 | memory_set_bank(1, 2); |
| 278 | 278 | |
| 279 | 279 | /* writes go to chipram */ |
| 280 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, amiga_ar23_chipmem_w); | |
| 280 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, amiga_ar23_chipmem_w); | |
| 281 | 281 | |
| 282 | 282 | /* trigger NMI irq */ |
| 283 | 283 | cpunum_set_input_line(machine, 0, 7, PULSE_LINE); |
| r2418 | r2419 | |
| 335 | 335 | static void amiga_ar23_check_overlay( void ) |
| 336 | 336 | { |
| 337 | 337 | amiga_ar23_mode = 3; |
| 338 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x00000f, 0, 0, amiga_ar23_chipmem_w); | |
| 338 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x00000f, 0, 0, amiga_ar23_chipmem_w); | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | static void amiga_ar23_init( int ar3 ) |
| r2418 | r2419 | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /* Install ROM */ |
| 365 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400000+size, 0, mirror, SMH_BANK2); | |
| 366 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400000+size, 0, mirror, SMH_ROM); | |
| 365 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400000+size, 0, mirror, SMH_BANK2); | |
| 366 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400000+size, 0, mirror, SMH_ROM); | |
| 367 | 367 | |
| 368 | 368 | /* Install RAM */ |
| 369 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x440000, 0x44ffff, 0, 0, SMH_BANK3); | |
| 370 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x440000, 0x44ffff, 0, 0, SMH_BANK3); | |
| 369 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x440000, 0x44ffff, 0, 0, SMH_BANK3); | |
| 370 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x440000, 0x44ffff, 0, 0, SMH_BANK3); | |
| 371 | 371 | |
| 372 | 372 | /* Install Custom chip monitor */ |
| 373 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdff000, 0xdff1ff, 0, 0, amiga_ar23_custom_r); | |
| 374 | // memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdff000, 0xdff1ff, 0, 0, amiga_ar23_custom_w); | |
| 373 | // memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xdff000, 0xdff1ff, 0, 0, amiga_ar23_custom_r); | |
| 374 | // memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xdff000, 0xdff1ff, 0, 0, amiga_ar23_custom_w); | |
| 375 | 375 | |
| 376 | 376 | /* Install status/mode handlers */ |
| 377 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, mirror, amiga_ar23_mode_r); | |
| 378 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400003, 0, mirror, amiga_ar23_mode_w); | |
| 377 | memory_install_read16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, mirror, amiga_ar23_mode_r); | |
| 378 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400003, 0, mirror, amiga_ar23_mode_w); | |
| 379 | 379 | |
| 380 | 380 | /* Configure Banks */ |
| 381 | 381 | memory_set_bankptr(2, memory_region(REGION_USER2)); |
| r2418 | r2419 | |
|---|---|---|
| 83 | 83 | Machine Initialisation |
| 84 | 84 | ******************************************************************************/ |
| 85 | 85 | |
| 86 | static void common_init_machine(int base) | |
| 86 | static void common_init_machine(running_machine *machine, int base) | |
| 87 | 87 | { |
| 88 | 88 | /* internal ram */ |
| 89 | 89 | memory_configure_bank(1, 0, 1, mess_ram, 0); |
| r2418 | r2419 | |
| 95 | 95 | case 22 * 1024: |
| 96 | 96 | case 32 * 1024: |
| 97 | 97 | /* install 16KB memory expansion */ |
| 98 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, base, base + 0x3fff, 0, 0, SMH_BANK2); | |
| 99 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0x3fff, 0, 0, SMH_BANK2); | |
| 98 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0x3fff, 0, 0, SMH_BANK2); | |
| 99 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base, base + 0x3fff, 0, 0, SMH_BANK2); | |
| 100 | 100 | memory_configure_bank(2, 0, 1, mess_ram + base - 0x7800, 0); |
| 101 | 101 | memory_set_bank(2, 0); |
| 102 | 102 | |
| 103 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, base + 0x4000, 0xffff, 0, 0, SMH_NOP); | |
| 104 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x4000, 0xffff, 0, 0, SMH_NOP); | |
| 103 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x4000, 0xffff, 0, 0, SMH_NOP); | |
| 104 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x4000, 0xffff, 0, 0, SMH_NOP); | |
| 105 | 105 | break; |
| 106 | 106 | |
| 107 | 107 | case 66 * 1024: |
| r2418 | r2419 | |
| 109 | 109 | /* 64KB/4MB memory expansion */ |
| 110 | 110 | |
| 111 | 111 | /* install fixed first bank */ |
| 112 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 113 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 112 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 113 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2); | |
| 114 | 114 | memory_configure_bank(2, 0, 1, mess_ram + 0x800, 0); |
| 115 | 115 | memory_set_bank(2, 0); |
| 116 | 116 | |
| 117 | 117 | /* install the others, dynamically banked in */ |
| 118 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK3); | |
| 119 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK3); | |
| 118 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK3); | |
| 119 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK3); | |
| 120 | 120 | memory_configure_bank(3, 0, (mess_ram_size - 0x4800) / 0x4000, mess_ram + 0x4800, 0x4000); |
| 121 | 121 | memory_set_bank(3, 0); |
| 122 | 122 | break; |
| 123 | 123 | |
| 124 | 124 | default: |
| 125 | 125 | /* no memory expansion */ |
| 126 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, base, 0xffff, 0, 0, SMH_NOP); | |
| 127 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base, 0xffff, 0, 0, SMH_NOP); | |
| 126 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base, 0xffff, 0, 0, SMH_NOP); | |
| 127 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base, 0xffff, 0, 0, SMH_NOP); | |
| 128 | 128 | break; |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | MACHINE_START(laser110) |
| 133 | 133 | { |
| 134 | common_init_machine(0x8000); | |
| 134 | common_init_machine(machine, 0x8000); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | MACHINE_START(laser210) |
| 138 | 138 | { |
| 139 | common_init_machine(0x9000); | |
| 139 | common_init_machine(machine, 0x9000); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | MACHINE_START(laser310) |
| 143 | 143 | { |
| 144 | common_init_machine(0xb800); | |
| 144 | common_init_machine(machine, 0xb800); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 |
| r2418 | r2419 | |
|---|---|---|
| 923 | 923 | |
| 924 | 924 | if ( sms_cartridge[sms_current_cartridge].features & CF_CODEMASTERS_MAPPER ) { |
| 925 | 925 | /* Install special memory handlers */ |
| 926 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0000, 0, 0, sms_codemasters_page0_w ); | |
| 927 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, sms_codemasters_page1_w ); | |
| 926 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0000, 0, 0, sms_codemasters_page0_w ); | |
| 927 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, sms_codemasters_page1_w ); | |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | /* Initialize SIO stuff for GG */ |
| r2418 | r2419 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 11 | 12 | #include "includes/coupe.h" |
| 12 | 13 | #include "devices/basicdsk.h" |
| 13 | 14 | #include "machine/wd17xx.h" |
| r2418 | r2419 | |
| 34 | 35 | wh = is_readonly ? SMH_UNMAP : (write8_machine_func) (STATIC_BANK1 + (FPTR)bank - 1); |
| 35 | 36 | } |
| 36 | 37 | |
| 37 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, rh); | |
| 38 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, wh); | |
| 38 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, rh); | |
| 39 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, wh); | |
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | |
| r2418 | r2419 | |
| 172 | 173 | if (input_port_read(machine, "config") & 0x01) |
| 173 | 174 | { |
| 174 | 175 | /* install RTC */ |
| 175 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, coupe_rtc_r, coupe_rtc_w); | |
| 176 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, coupe_rtc_r, coupe_rtc_w); | |
| 176 | 177 | } |
| 177 | 178 | else |
| 178 | 179 | { |
| 179 | 180 | /* no RTC support */ |
| 180 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, SMH_UNMAP, SMH_UNMAP); | |
| 181 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, SMH_UNMAP, SMH_UNMAP); | |
| 181 | 182 | } |
| 182 | 183 | |
| 183 | 184 | coupe_update_memory(); |
| r2418 | r2419 | |
|---|---|---|
| 79 | 79 | // DRIVER INIT & EXIT // |
| 80 | 80 | //////////////////////// |
| 81 | 81 | |
| 82 | static void init_ram_handler( offs_t start, offs_t size, offs_t mirror) | |
| 82 | static void init_ram_handler(running_machine *machine, offs_t start, offs_t size, offs_t mirror) | |
| 83 | 83 | { |
| 84 | memory_install_read_handler( 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); | |
| 85 | memory_install_write_handler( 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); | |
| 84 | memory_install_read_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); | |
| 85 | memory_install_write_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); | |
| 86 | 86 | memory_set_bankptr( 1, mess_ram); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | DRIVER_INIT( cybikov1 ) |
| 90 | 90 | { |
| 91 | 91 | _logerror( 0, ("init_cybikov1\n")); |
| 92 | init_ram_handler( 0x200000, mess_ram_size, 0x200000); | |
| 92 | init_ram_handler(machine, 0x200000, mess_ram_size, 0x200000); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | DRIVER_INIT( cybikov2 ) |
| 96 | 96 | { |
| 97 | 97 | _logerror( 0, ("init_cybikov2\n")); |
| 98 | init_ram_handler( 0x200000, mess_ram_size, 0x200000); | |
| 98 | init_ram_handler(machine, 0x200000, mess_ram_size, 0x200000); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | DRIVER_INIT( cybikoxt ) |
| 102 | 102 | { |
| 103 | 103 | _logerror( 0, ("init_cybikoxt\n")); |
| 104 | init_ram_handler( 0x400000, mess_ram_size, 0x200000); | |
| 104 | init_ram_handler(machine, 0x400000, mess_ram_size, 0x200000); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | //////////////////// |
| r2418 | r2419 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | /* install the actual handlers */ |
| 198 | 198 | if (begin <= end_r) |
| 199 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end_r, 0, 0, rh); | |
| 199 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end_r, 0, 0, rh); | |
| 200 | 200 | |
| 201 | 201 | /* did we 'go past the end?' */ |
| 202 | 202 | if (end_r < apple2_mem_config.memmap[i].end) |
| 203 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, end_r + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP); | |
| 203 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, end_r + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP); | |
| 204 | 204 | |
| 205 | 205 | /* set the memory bank */ |
| 206 | 206 | if (rbase) |
| r2418 | r2419 | |
| 271 | 271 | |
| 272 | 272 | /* install the actual handlers */ |
| 273 | 273 | if (begin <= end_w) |
| 274 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end_w, 0, 0, wh); | |
| 274 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end_w, 0, 0, wh); | |
| 275 | 275 | |
| 276 | 276 | /* did we 'go past the end?' */ |
| 277 | 277 | if (end_w < apple2_mem_config.memmap[i].end) |
| 278 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, end_w + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP); | |
| 278 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, end_w + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP); | |
| 279 | 279 | |
| 280 | 280 | /* set the memory bank */ |
| 281 | 281 | if (wbase) |
| r2418 | r2419 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | *******************************************************************************/ |
| 48 | 48 | |
| 49 | static void primo_update_memory | |
| 49 | static void primo_update_memory | |
| 50 | 50 | { |
| 51 | 51 | switch (primo_port_FD & 0x03) |
| 52 | 52 | { |
| 53 | 53 | case 0x00: /* Original ROM */ |
| 54 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 54 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 55 | 55 | memory_set_bankptr(1, memory_region(REGION_CPU1)+0x10000); |
| 56 | 56 | break; |
| 57 | 57 | case 0x01: /* EPROM extension 1 */ |
| 58 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 58 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 59 | 59 | memory_set_bankptr(1, memory_region(REGION_CPU1)+0x14000); |
| 60 | 60 | break; |
| 61 | 61 | case 0x02: /* RAM */ |
| 62 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 62 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 63 | 63 | memory_set_bankptr(1, memory_region(REGION_CPU1)); |
| 64 | 64 | break; |
| 65 | 65 | case 0x03: /* EPROM extension 2 */ |
| 66 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 66 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 67 | 67 | memory_set_bankptr(1, memory_region(REGION_CPU1)+0x18000); |
| 68 | 68 | break; |
| 69 | 69 | } |
| r2418 | r2419 | |
| 199 | 199 | if (!input_port_read_indexed(machine, 6)) |
| 200 | 200 | { |
| 201 | 201 | primo_port_FD = data; |
| 202 | primo_update_memory(); | |
| 202 | primo_update_memory(machine); | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| r2418 | r2419 | |
| 242 | 242 | { |
| 243 | 243 | if (input_port_read_indexed(machine, 6)) |
| 244 | 244 | primo_port_FD = 0x00; |
| 245 | primo_update_memory(); | |
| 245 | primo_update_memory(machine); | |
| 246 | 246 | cpunum_set_clockscale(machine, 0, input_port_read_indexed(machine, 5) ? 1.5 : 1.0); |
| 247 | 247 | } |
| 248 | 248 |
| r2418 | r2419 | |
|---|---|---|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | static void update_ti85_memory ( | |
| 133 | static void update_ti85_memory (running_machine *machine) | |
| 134 | 134 | { |
| 135 | 135 | memory_set_bankptr(2,memory_region(REGION_CPU1) + 0x010000 + 0x004000*ti85_memory_page_0x4000); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static void update_ti86_memory ( | |
| 138 | static void update_ti86_memory (running_machine *machine) | |
| 139 | 139 | { |
| 140 | 140 | write8_machine_func wh; |
| 141 | 141 | |
| r2418 | r2419 | |
| 150 | 150 | memory_set_bankptr(2,memory_region(REGION_CPU1) + 0x010000 + 0x004000*(ti85_memory_page_0x4000&0x0f)); |
| 151 | 151 | wh = SMH_UNMAP; |
| 152 | 152 | } |
| 153 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh); | |
| 153 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh); | |
| 154 | 154 | |
| 155 | 155 | if (ti86_memory_page_0x8000 & 0x40) |
| 156 | 156 | { |
| r2418 | r2419 | |
| 163 | 163 | memory_set_bankptr(3,memory_region(REGION_CPU1) + 0x010000 + 0x004000*(ti86_memory_page_0x8000&0x0f)); |
| 164 | 164 | wh = SMH_UNMAP; |
| 165 | 165 | } |
| 166 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh); | |
| 166 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /*************************************************************************** |
| r2418 | r2419 | |
| 195 | 195 | |
| 196 | 196 | timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback); |
| 197 | 197 | |
| 198 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 199 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 198 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 199 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 200 | 200 | memory_set_bankptr(1,memory_region(REGION_CPU1) + 0x010000); |
| 201 | 201 | memory_set_bankptr(2,memory_region(REGION_CPU1) + 0x014000); |
| 202 | 202 | } |
| r2418 | r2419 | |
| 225 | 225 | |
| 226 | 226 | timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback); |
| 227 | 227 | |
| 228 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 229 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 228 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 229 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 230 | 230 | memory_set_bankptr(1,memory_region(REGION_CPU1) + 0x010000); |
| 231 | 231 | memory_set_bankptr(2,memory_region(REGION_CPU1) + 0x014000); |
| 232 | 232 | |
| r2418 | r2419 | |
| 254 | 254 | |
| 255 | 255 | ti86_ram = auto_malloc(128*1024); |
| 256 | 256 | { |
| 257 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 257 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 258 | 258 | |
| 259 | 259 | memory_set_bankptr(1,memory_region(REGION_CPU1) + 0x010000); |
| 260 | 260 | memory_set_bankptr(2,memory_region(REGION_CPU1) + 0x014000); |
| r2418 | r2419 | |
| 392 | 392 | WRITE8_HANDLER ( ti85_port_0005_w ) |
| 393 | 393 | { |
| 394 | 394 | ti85_memory_page_0x4000 = data; |
| 395 | update_ti85_memory(); | |
| 395 | update_ti85_memory(machine); | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | WRITE8_HANDLER ( ti85_port_0006_w ) |
| r2418 | r2419 | |
| 412 | 412 | WRITE8_HANDLER ( ti86_port_0005_w ) |
| 413 | 413 | { |
| 414 | 414 | ti85_memory_page_0x4000 = data&((data&0x40)?0x47:0x4f); |
| 415 | update_ti86_memory(); | |
| 415 | update_ti86_memory(machine); | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | WRITE8_HANDLER ( ti86_port_0006_w ) |
| 419 | 419 | { |
| 420 | 420 | ti86_memory_page_0x8000 = data&((data&0x40)?0x47:0x4f); |
| 421 | update_ti86_memory(); | |
| 421 | update_ti86_memory(machine); | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | |
| r2418 | r2419 | |
| 547 | 547 | ti85_keypad_mask = hdw[0x00]&0x7f; |
| 548 | 548 | |
| 549 | 549 | ti85_memory_page_0x4000 = hdw[0x08]&0xff; |
| 550 | update_ti85_memory | |
| 550 | update_ti85_memory | |
| 551 | 551 | |
| 552 | 552 | ti85_power_mode = hdw[0x14]&0xff; |
| 553 | 553 | |
| r2418 | r2419 | |
| 589 | 589 | ti86_memory_page_0x8000 = hdw[0x0c]&0xff ? 0x40 : 0x00; |
| 590 | 590 | ti86_memory_page_0x8000 |= hdw[0x10]&0x0f; |
| 591 | 591 | |
| 592 | update_ti86_memory | |
| 592 | update_ti86_memory | |
| 593 | 593 | |
| 594 | 594 | lo = hdw[0x2c] & 0x0ff; |
| 595 | 595 | hi = hdw[0x2d] & 0x0ff; |
| r2418 | r2419 | |
|---|---|---|
| 415 | 415 | } |
| 416 | 416 | }; |
| 417 | 417 | |
| 418 | static void c64_bankswitch | |
| 418 | static void c64_bankswitch | |
| 419 | 419 | static void c64_robocop2_w(running_machine *machine, int offset, int value) |
| 420 | 420 | { |
| 421 | 421 | /* robocop2 0xe00 |
| r2418 | r2419 | |
| 437 | 437 | if (is_c128(machine)) |
| 438 | 438 | c128_bankswitch_64(machine, 0); |
| 439 | 439 | else |
| 440 | c64_bankswitch(0); | |
| 440 | c64_bankswitch(machine, 0); | |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | static void c64_supergames_w(running_machine *machine, int offset, int value) |
| r2418 | r2419 | |
| 465 | 465 | if (is_c128(machine)) |
| 466 | 466 | c128_bankswitch_64 (machine, 0); |
| 467 | 467 | else |
| 468 | c64_bankswitch | |
| 468 | c64_bankswitch | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | WRITE8_HANDLER( c64_write_io ) |
| r2418 | r2419 | |
| 602 | 602 | * E000 ROMH RAM |
| 603 | 603 | * F000 ROMH ROMH |
| 604 | 604 | */ |
| 605 | static void c64_bankswitch | |
| 605 | static void c64_bankswitch | |
| 606 | 606 | { |
| 607 | 607 | static int old = -1, exrom, game; |
| 608 | 608 | int data, loram, hiram, charen; |
| r2418 | r2419 | |
| 651 | 651 | || (charen && (loram || hiram))) |
| 652 | 652 | { |
| 653 | 653 | c64_io_enabled = 1; |
| 654 | // memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, c64_read_io); | |
| 655 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, c64_write_io); | |
| 654 | // memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, c64_read_io); | |
| 655 | // memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, c64_write_io); | |
| 656 | 656 | // if ( cpu_getactivecpu() >= 0 ) |
| 657 | 657 | // memory_set_opbase(activecpu_get_physical_pc_byte()); |
| 658 | 658 | } |
| r2418 | r2419 | |
| 665 | 665 | } else { |
| 666 | 666 | c64_io_ram_r_ptr = c64_memory + 0xd000; |
| 667 | 667 | } |
| 668 | // memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK5); | |
| 669 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK6); | |
| 668 | // memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK5); | |
| 669 | // memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK6); | |
| 670 | 670 | // memory_set_bankptr (6, c64_memory + 0xd000); |
| 671 | 671 | // if (!charen && (loram || hiram)) |
| 672 | 672 | // { |
| r2418 | r2419 | |
| 681 | 681 | if (!c64_game && c64_exrom) |
| 682 | 682 | { |
| 683 | 683 | memory_set_bankptr (7, romh); |
| 684 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_NOP); | |
| 684 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_NOP); | |
| 685 | 685 | } |
| 686 | 686 | else |
| 687 | 687 | { |
| r2418 | r2419 | |
| 748 | 748 | //c65_bankswitch(); |
| 749 | 749 | } |
| 750 | 750 | else if (!ultimax) |
| 751 | c64_bankswitch | |
| 751 | c64_bankswitch | |
| 752 | 752 | c64_memory[0x000] = program_read_byte( 0 ); |
| 753 | 753 | c64_memory[0x001] = program_read_byte( 1 ); |
| 754 | 754 | } |
| r2418 | r2419 | |
| 998 | 998 | c64_rom_load(); |
| 999 | 999 | |
| 1000 | 1000 | if (is_c128(machine)) |
| 1001 | c128_bankswitch_64 | |
| 1001 | c128_bankswitch_64 | |
| 1002 | 1002 | if (!ultimax) |
| 1003 | c64_bankswitch | |
| 1003 | c64_bankswitch | |
| 1004 | 1004 | memory_set_opbase_handler( 0, c64_opbase ); |
| 1005 | 1005 | } |
| 1006 | 1006 |
| r2418 | r2419 | |
|---|---|---|
| 2329 | 2329 | |
| 2330 | 2330 | /* Another brutal hack to work around 0.101u1 memory changes */ |
| 2331 | 2331 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK10); |
| 2332 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK10); | |
| 2332 | memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK10); | |
| 2333 | 2333 | memory_set_bankptr(10, memory_region(REGION_CPU2)); |
| 2334 | 2334 | |
| 2335 | 2335 | // memory_set_bankptr(1,memory_region(REGION_USER1)); /* cartridge at BANK1 */ |
| r2418 | r2419 | |
|---|---|---|
| 446 | 446 | for (i = 0; i < 256; i++) |
| 447 | 447 | gfx[i] = i; |
| 448 | 448 | |
| 449 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_r ); | |
| 450 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_w ); | |
| 449 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_r ); | |
| 450 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_w ); | |
| 451 | 451 | videoram_size=0x10000; |
| 452 | 452 | videoram=memory_region(REGION_CPU1)+0xb0000; |
| 453 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc200_16le_port378_r ); | |
| 453 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc200_16le_port378_r ); | |
| 454 | 454 | |
| 455 | 455 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 456 | 456 | } |
| r2418 | r2419 | |
| 464 | 464 | for (i = 0; i < 256; i++) |
| 465 | 465 | gfx[i] = i; |
| 466 | 466 | |
| 467 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x0C000, SMH_BANK1 ); | |
| 468 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x0C000, pc1512_videoram16le_w ); | |
| 467 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x0C000, SMH_BANK1 ); | |
| 468 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x0C000, pc1512_videoram16le_w ); | |
| 469 | 469 | |
| 470 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1512_16le_r ); | |
| 471 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1512_16le_w ); | |
| 470 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1512_16le_r ); | |
| 471 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1512_16le_w ); | |
| 472 | 472 | |
| 473 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc16le_parallelport2_r ); | |
| 473 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc16le_parallelport2_r ); | |
| 474 | 474 | |
| 475 | 475 | |
| 476 | 476 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| r2418 | r2419 | |
| 486 | 486 | switch(buswidth) |
| 487 | 487 | { |
| 488 | 488 | case 8: |
| 489 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 490 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 489 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 490 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xA0000, 0xBFFFF, 0, 0, SMH_NOP); | |
| 491 | 491 | |
| 492 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, rh); | |
| 493 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 492 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, rh); | |
| 493 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); | |
| 494 | 494 | break; |
| 495 | 495 | |
| 496 | 496 | default: |
| r2418 | r2419 | |
| 517 | 517 | DRIVER_INIT( pc1640 ) |
| 518 | 518 | { |
| 519 | 519 | pc_vga_init(machine, &vga_interface, NULL); |
| 520 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK1 ); | |
| 521 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK2 ); | |
| 522 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK3 ); | |
| 520 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK1 ); | |
| 521 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK2 ); | |
| 522 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK3 ); | |
| 523 | 523 | |
| 524 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK1 ); | |
| 525 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK2 ); | |
| 526 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK3 ); | |
| 524 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK1 ); | |
| 525 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK2 ); | |
| 526 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK3 ); | |
| 527 | 527 | |
| 528 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, vga_port16le_03b0_r ); | |
| 529 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, paradise_ega16le_03c0_r ); | |
| 530 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1640_16le_port3d0_r ); | |
| 528 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, vga_port16le_03b0_r ); | |
| 529 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, paradise_ega16le_03c0_r ); | |
| 530 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc1640_16le_port3d0_r ); | |
| 531 | 531 | |
| 532 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, vga_port16le_03b0_w ); | |
| 533 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, vga_port16le_03c0_w ); | |
| 534 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, vga_port16le_03d0_w ); | |
| 532 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bf, 0, 0, vga_port16le_03b0_w ); | |
| 533 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, vga_port16le_03c0_w ); | |
| 534 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, vga_port16le_03d0_w ); | |
| 535 | 535 | |
| 536 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc1640_16le_port278_r ); | |
| 537 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x4278, 0x427b, 0, 0, pc1640_16le_port4278_r ); | |
| 536 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc1640_16le_port278_r ); | |
| 537 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x4278, 0x427b, 0, 0, pc1640_16le_port4278_r ); | |
| 538 | 538 | |
| 539 | 539 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 540 | 540 |
| r2418 | r2419 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | /* Check for Street fighter 2 */ |
| 203 | 203 | if ( size == PCE_ROM_MAXSIZE ) { |
| 204 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x01ff0, 0x01ff3, 0, 0, pce_sf2_banking_w ); | |
| 204 | memory_install_write8_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0x01ff0, 0x01ff3, 0, 0, pce_sf2_banking_w ); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /* Check for Populous */ |
| 208 | 208 | if ( ! memcmp( ROM + 0x1F26, "POPULOUS", 8 ) ) { |
| 209 | 209 | cartridge_ram = auto_malloc( 0x8000 ); |
| 210 | 210 | memory_set_bankptr( 2, cartridge_ram ); |
| 211 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087FFF, 0, 0, pce_cartridge_ram_w ); | |
| 211 | memory_install_write8_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087FFF, 0, 0, pce_cartridge_ram_w ); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /* Check for CD system card */ |
| r2418 | r2419 | |
| 219 | 219 | pce_sys3_card = 1; |
| 220 | 220 | cartridge_ram = auto_malloc( 0x30000 ); |
| 221 | 221 | memory_set_bankptr( 4, cartridge_ram ); |
| 222 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0D0000, 0x0FFFFF, 0, 0, pce_cartridge_ram_w ); | |
| 222 | memory_install_write8_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0x0D0000, 0x0FFFFF, 0, 0, pce_cartridge_ram_w ); | |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | return 0; |
| r2418 | r2419 | |
|---|---|---|
| 102 | 102 | static void ti99_8_internal_dsr_reset(void); |
| 103 | 103 | |
| 104 | 104 | static void ti99_4p_internal_dsr_reset(void); |
| 105 | static void ti99_TIxram_init(void); | |
| 106 | static void ti99_sAMSxram_init(void); | |
| 107 | static void ti99_4p_mapper_init(void); | |
| 108 | static void ti99_myarcxram_init(void); | |
| 105 | static void ti99_TIxram_init(running_machine *machine); | |
| 106 | static void ti99_sAMSxram_init(running_machine *machine); | |
| 107 | static void ti99_4p_mapper_init(running_machine *machine); | |
| 108 | static void ti99_myarcxram_init(running_machine *machine); | |
| 109 | 109 | static void ti99_evpc_reset(void); |
| 110 | 110 | |
| 111 | 111 | /* |
| r2418 | r2419 | |
| 727 | 727 | how the switches are set. Later we use the configuration switches to |
| 728 | 728 | determine which one to use. */ |
| 729 | 729 | ti99_peb_init(); |
| 730 | ti99_floppy_controllers_init_all(machine); | |
| 731 | ti99_ide_init(); | |
| 732 | ti99_rs232_init(); | |
| 730 | ti99_floppy_controllers_init_all(machine); | |
| 731 | ti99_ide_init(); | |
| 732 | ti99_rs232_init(); | |
| 733 | 733 | ti99_hsgpl_init(); |
| 734 | 734 | ti99_usbsm_init(); |
| 735 | 735 | } |
| r2418 | r2419 | |
| 821 | 821 | |
| 822 | 822 | if (ti99_model != model_99_8) |
| 823 | 823 | { |
| 824 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r); | |
| 825 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w); | |
| 824 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r); | |
| 825 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w); | |
| 826 | 826 | |
| 827 | 827 | sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tmc0285); |
| 828 | 828 | } |
| r2418 | r2419 | |
| 831 | 831 | { |
| 832 | 832 | if (ti99_model != model_99_8) |
| 833 | 833 | { |
| 834 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_nop_8_r); | |
| 835 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_nop_8_w); | |
| 834 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_nop_8_r); | |
| 835 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_nop_8_w); | |
| 836 | 836 | } |
| 837 | 837 | } |
| 838 | 838 | |
| r2418 | r2419 | |
| 840 | 840 | { |
| 841 | 841 | case xRAM_kind_none: |
| 842 | 842 | default: |
| 843 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_r); | |
| 844 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_w); | |
| 845 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_r); | |
| 846 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_w); | |
| 843 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_r); | |
| 844 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_w); | |
| 845 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_r); | |
| 846 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_w); | |
| 847 | 847 | break; |
| 848 | 848 | case xRAM_kind_TI: |
| 849 | ti99_TIxram_init(); | |
| 849 | ti99_TIxram_init(machine); | |
| 850 | 850 | break; |
| 851 | 851 | case xRAM_kind_super_AMS: |
| 852 | ti99_sAMSxram_init(); | |
| 852 | ti99_sAMSxram_init(machine); | |
| 853 | 853 | break; |
| 854 | 854 | case xRAM_kind_99_4p_1Mb: |
| 855 | ti99_4p_mapper_init(); | |
| 855 | ti99_4p_mapper_init(machine); | |
| 856 | 856 | break; |
| 857 | 857 | case xRAM_kind_foundation_128k: |
| 858 | 858 | case xRAM_kind_foundation_512k: |
| 859 | 859 | case xRAM_kind_myarc_128k: |
| 860 | 860 | case xRAM_kind_myarc_512k: |
| 861 | ti99_myarcxram_init(); | |
| 861 | ti99_myarcxram_init(machine); | |
| 862 | 862 | break; |
| 863 | 863 | case xRAM_kind_99_8: |
| 864 | 864 | break; |
| r2418 | r2419 | |
| 2610 | 2610 | static READ16_HANDLER ( ti99_TIxramhigh_r ); |
| 2611 | 2611 | static WRITE16_HANDLER ( ti99_TIxramhigh_w ); |
| 2612 | 2612 | |
| 2613 | static void ti99_TIxram_init( | |
| 2613 | static void ti99_TIxram_init(running_machine *machine) | |
| 2614 | 2614 | { |
| 2615 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_r); | |
| 2616 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_w); | |
| 2617 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_r); | |
| 2618 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_w); | |
| 2615 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_r); | |
| 2616 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_w); | |
| 2617 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_r); | |
| 2618 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_w); | |
| 2619 | 2619 | } |
| 2620 | 2620 | |
| 2621 | 2621 | /* low 8 kb: 0x2000-0x3fff */ |
| r2418 | r2419 | |
| 2682 | 2682 | |
| 2683 | 2683 | |
| 2684 | 2684 | /* set up super AMS handlers, and set initial state */ |
| 2685 | static void ti99_sAMSxram_init( | |
| 2685 | static void ti99_sAMSxram_init(running_machine *machine) | |
| 2686 | 2686 | { |
| 2687 | 2687 | int i; |
| 2688 | 2688 | |
| 2689 | 2689 | |
| 2690 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_r); | |
| 2691 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_w); | |
| 2692 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_r); | |
| 2693 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_w); | |
| 2690 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_r); | |
| 2691 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_w); | |
| 2692 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_r); | |
| 2693 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_w); | |
| 2694 | 2694 | |
| 2695 | 2695 | ti99_peb_set_card_handlers(0x1e00, & sAMS_expansion_handlers); |
| 2696 | 2696 | |
| r2418 | r2419 | |
| 2792 | 2792 | |
| 2793 | 2793 | |
| 2794 | 2794 | /* set up handlers, and set initial state */ |
| 2795 | static void ti99_4p_mapper_init( | |
| 2795 | static void ti99_4p_mapper_init(running_machine *machine) | |
| 2796 | 2796 | { |
| 2797 | 2797 | int i; |
| 2798 | 2798 | |
| 2799 | 2799 | /* Not required at run-time */ |
| 2800 | /*memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); | |
| 2801 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); | |
| 2802 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); | |
| 2803 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); | |
| 2804 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); | |
| 2805 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); | |
| 2806 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); | |
| 2807 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); | |
| 2808 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); | |
| 2809 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); | |
| 2810 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); | |
| 2811 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); | |
| 2812 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); | |
| 2813 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); | |
| 2814 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10); | |
| 2815 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10);*/ | |
| 2800 | /*memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); | |
| 2801 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); | |
| 2802 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); | |
| 2803 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); | |
| 2804 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); | |
| 2805 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); | |
| 2806 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); | |
| 2807 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); | |
| 2808 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); | |
| 2809 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); | |
| 2810 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); | |
| 2811 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); | |
| 2812 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); | |
| 2813 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); | |
| 2814 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10); | |
| 2815 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10);*/ | |
| 2816 | 2816 | |
| 2817 | 2817 | ti99_peb_set_16bit_card_handlers(0x1e00, & ti99_4p_mapper_handlers); |
| 2818 | 2818 | |
| r2418 | r2419 | |
| 2946 | 2946 | |
| 2947 | 2947 | |
| 2948 | 2948 | /* set up myarc handlers, and set initial state */ |
| 2949 | static void ti99_myarcxram_init( | |
| 2949 | static void ti99_myarcxram_init(running_machine *machine) | |
| 2950 | 2950 | { |
| 2951 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_r); | |
| 2952 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_w); | |
| 2953 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_r); | |
| 2954 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_w); | |
| 2951 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_r); | |
| 2952 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_w); | |
| 2953 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_r); | |
| 2954 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_w); | |
| 2955 | 2955 | |
| 2956 | 2956 | switch (xRAM_kind) |
| 2957 | 2957 | { |
| r2418 | r2419 | |
|---|---|---|
| 167 | 167 | // 4 kb memory feedback 512 bytes too few??? |
| 168 | 168 | // 11 kb ram: program stored at 8000 |
| 169 | 169 | #if 1 |
| 170 | memory_install_write8_handler | |
| 170 | memory_install_write8_handler | |
| 171 | 171 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x8000); |
| 172 | 172 | #else |
| 173 | 173 | if (PC1251_RAM11K) |
| 174 | 174 | { |
| 175 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xafff, 0, 0, SMH_RAM); | |
| 176 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xc5ff, 0, 0, SMH_NOP); | |
| 177 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc7ff, 0, 0, SMH_RAM); | |
| 178 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xf7ff, 0, 0, SMH_RAM); | |
| 175 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xafff, 0, 0, SMH_RAM); | |
| 176 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xc5ff, 0, 0, SMH_NOP); | |
| 177 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc7ff, 0, 0, SMH_RAM); | |
| 178 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xf7ff, 0, 0, SMH_RAM); | |
| 179 | 179 | } |
| 180 | 180 | else if (PC1251_RAM6K) |
| 181 | 181 | { |
| 182 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_NOP); | |
| 183 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xc7ff, 0, 0, SMH_RAM); | |
| 184 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0, SMH_RAM); | |
| 182 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_NOP); | |
| 183 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xc7ff, 0, 0, SMH_RAM); | |
| 184 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0, SMH_RAM); | |
| 185 | 185 | } |
| 186 | 186 | else if (PC1251_RAM4K) |
| 187 | 187 | { |
| 188 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xb7ff, 0, 0, SMH_NOP); | |
| 189 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xc7ff, 0, 0, SMH_RAM); | |
| 190 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0, SMH_RAM); | |
| 188 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xb7ff, 0, 0, SMH_NOP); | |
| 189 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xc7ff, 0, 0, SMH_RAM); | |
| 190 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0, SMH_RAM); | |
| 191 | 191 | } |
| 192 | 192 | else |
| 193 | 193 | { |
| 194 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xc5ff, 0, 0, SMH_NOP); | |
| 195 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc9ff, 0, 0, SMH_RAM); | |
| 196 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xca00, 0xcbff, 0, 0, SMH_RAM); | |
| 194 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xc5ff, 0, 0, SMH_NOP); | |
| 195 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc600, 0xc9ff, 0, 0, SMH_RAM); | |
| 196 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xca00, 0xcbff, 0, 0, SMH_RAM); | |
| 197 | 197 | } |
| 198 | 198 | #endif |
| 199 | 199 | } |
| r2418 | r2419 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | DRIVER_INIT( galaxy ) |
| 151 | 151 | { |
| 152 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800+mess_ram_size-1, 0, 0, SMH_BANK1); | |
| 153 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800+mess_ram_size-1, 0, 0, SMH_BANK1); | |
| 152 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800+mess_ram_size-1, 0, 0, SMH_BANK1); | |
| 153 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800+mess_ram_size-1, 0, 0, SMH_BANK1); | |
| 154 | 154 | memory_set_bankptr(1, mess_ram); |
| 155 | 155 | |
| 156 | 156 | if (mess_ram_size < (6+48)*1024) |
| 157 | 157 | { |
| 158 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800+mess_ram_size, 0xffff, 0, 0, SMH_NOP); | |
| 159 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800+mess_ram_size, 0xffff, 0, 0, SMH_NOP); | |
| 158 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800+mess_ram_size, 0xffff, 0, 0, SMH_NOP); | |
| 159 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800+mess_ram_size, 0xffff, 0, 0, SMH_NOP); | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| r2418 | r2419 | |
| 167 | 167 | MACHINE_RESET( galaxy ) |
| 168 | 168 | { |
| 169 | 169 | /* ROM 2 enable/disable */ |
| 170 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, input_port_read_indexed(machine, 7) ? SMH_BANK10 : SMH_NOP); | |
| 171 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 170 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, input_port_read_indexed(machine, 7) ? SMH_BANK10 : SMH_NOP); | |
| 171 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_NOP); | |
| 172 | 172 | if (input_port_read_indexed(machine, 7)) |
| 173 | 173 | memory_set_bankptr(10, memory_region(REGION_CPU1) + 0x1000); |
| 174 | 174 |
| r2418 | r2419 | |
|---|---|---|
| 1507 | 1507 | temp = (data16 & 0x0fff) << 8; |
| 1508 | 1508 | if (data16 & 0x1000) |
| 1509 | 1509 | { |
| 1510 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_r); | |
| 1511 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_w); | |
| 1510 | memory_install_read16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_r); | |
| 1511 | memory_install_write16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_w); | |
| 1512 | 1512 | } |
| 1513 | 1513 | else |
| 1514 | 1514 | { |
| 1515 | 1515 | temp &= 0xffff; |
| 1516 | memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_r); | |
| 1517 | memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_w); | |
| 1516 | memory_install_read16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_r); | |
| 1517 | memory_install_write16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_w); | |
| 1518 | 1518 | } |
| 1519 | 1519 | /* popmessage("Sound CPU reset");*/ |
| 1520 | 1520 | break; |
| r2418 | r2419 | |
|---|---|---|
| 192 | 192 | write_handler = SMH_NOP; |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, offset * 0x4000, offset * 0x4000 + 0x3fff, 0, 0, read_handler); | |
| 196 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, offset * 0x4000, offset * 0x4000 + 0x3fff, 0, 0, write_handler); | |
| 195 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, offset * 0x4000, offset * 0x4000 + 0x3fff, 0, 0, read_handler); | |
| 196 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, offset * 0x4000, offset * 0x4000 + 0x3fff, 0, 0, write_handler); | |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 |
| r2418 | r2419 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static int kc85_pio_data[2]; |
| 23 | 23 | |
| 24 | static void kc85_4_update_0x0c000(void); | |
| 25 | static void kc85_4_update_0x0e000(void); | |
| 26 | static void kc85_4_update_0x08000(void); | |
| 27 | //static void kc85_4_update_0x04000(void); | |
| 24 | static void kc85_4_update_0x0c000(running_machine *machine); | |
| 25 | static void kc85_4_update_0x0e000(running_machine *machine); | |
| 26 | static void kc85_4_update_0x08000(running_machine *machine); | |
| 28 | 27 | |
| 29 | 28 | /* PIO PORT A: port 0x088: |
| 30 | 29 | |
| r2418 | r2419 | |
| 1131 | 1130 | bit 0: ram 4 |
| 1132 | 1131 | */ |
| 1133 | 1132 | |
| 1134 | static void kc85_4_update_0x08000( | |
| 1133 | static void kc85_4_update_0x08000(running_machine *machine) | |
| 1135 | 1134 | { |
| 1136 | 1135 | unsigned char *ram_page; |
| 1137 | 1136 | |
| r2418 | r2419 | |
| 1147 | 1146 | |
| 1148 | 1147 | memory_set_bankptr(3, mem_ptr); |
| 1149 | 1148 | memory_set_bankptr(4, mem_ptr+0x02800); |
| 1150 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); | |
| 1151 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); | |
| 1149 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); | |
| 1150 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); | |
| 1152 | 1151 | |
| 1153 | 1152 | /* write protect RAM8 ? */ |
| 1154 | 1153 | if ((kc85_pio_data[1] & (1<<6))==0) |
| 1155 | 1154 | { |
| 1156 | 1155 | /* ram8 is enabled and write protected */ |
| 1157 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1158 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1156 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1157 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1159 | 1158 | } |
| 1160 | 1159 | else |
| 1161 | 1160 | { |
| 1162 | 1161 | LOG(("RAM8 write enabled\n")); |
| 1163 | 1162 | |
| 1164 | 1163 | /* ram8 is enabled and write enabled */ |
| 1165 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); | |
| 1166 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); | |
| 1164 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); | |
| 1165 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); | |
| 1167 | 1166 | memory_set_bankptr(9, mem_ptr); |
| 1168 | 1167 | memory_set_bankptr(10, mem_ptr+0x02800); |
| 1169 | 1168 | } |
| r2418 | r2419 | |
| 1172 | 1171 | { |
| 1173 | 1172 | LOG(("no memory at ram8\n")); |
| 1174 | 1173 | |
| 1175 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1176 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1177 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1178 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1174 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1175 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1176 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); | |
| 1177 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); | |
| 1179 | 1178 | } |
| 1180 | 1179 | |
| 1181 | 1180 | /* if IRM is enabled override block 3/9 settings */ |
| r2418 | r2419 | |
| 1186 | 1185 | |
| 1187 | 1186 | memory_set_bankptr(3, ram_page); |
| 1188 | 1187 | memory_set_bankptr(9, ram_page); |
| 1189 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); | |
| 1190 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); | |
| 1188 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); | |
| 1189 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); | |
| 1191 | 1190 | |
| 1192 | 1191 | ram_page = kc85_4_get_video_ram_base(0, 0); |
| 1193 | 1192 | |
| 1194 | 1193 | memory_set_bankptr( 4, ram_page + 0x2800); |
| 1195 | 1194 | memory_set_bankptr(10, ram_page + 0x2800); |
| 1196 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); | |
| 1197 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); | |
| 1195 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); | |
| 1196 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); | |
| 1198 | 1197 | } |
| 1199 | 1198 | } |
| 1200 | 1199 | |
| 1201 | 1200 | /* update status of memory area 0x0000-0x03fff */ |
| 1202 | static void kc85_4_update_0x00000( | |
| 1201 | static void kc85_4_update_0x00000(running_machine *machine) | |
| 1203 | 1202 | { |
| 1204 | 1203 | /* access ram? */ |
| 1205 | 1204 | if (kc85_pio_data[0] & (1<<1)) |
| r2418 | r2419 | |
| 1207 | 1206 | LOG(("ram0 enabled\n")); |
| 1208 | 1207 | |
| 1209 | 1208 | /* yes; set address of bank */ |
| 1210 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 1209 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); | |
| 1211 | 1210 | memory_set_bankptr(1, mess_ram); |
| 1212 | 1211 | |
| 1213 | 1212 | /* write protect ram? */ |
| r2418 | r2419 | |
| 1217 | 1216 | LOG(("ram0 write protected\n")); |
| 1218 | 1217 | |
| 1219 | 1218 | /* ram is enabled and write protected */ |
| 1220 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 1219 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 1221 | 1220 | } |
| 1222 | 1221 | else |
| 1223 | 1222 | { |
| 1224 | 1223 | LOG(("ram0 write enabled\n")); |
| 1225 | 1224 | |
| 1226 | 1225 | /* ram is enabled and write enabled; and set address of bank */ |
| 1227 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK7); | |
| 1226 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK7); | |
| 1228 | 1227 | memory_set_bankptr(7, mess_ram); |
| 1229 | 1228 | } |
| 1230 | 1229 | } |
| r2418 | r2419 | |
| 1234 | 1233 | |
| 1235 | 1234 | // memory_set_bankptr(1,memory_region(REGION_CPU1) + 0x013000); |
| 1236 | 1235 | /* ram is disabled */ |
| 1237 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); | |
| 1238 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); | |
| 1236 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); | |
| 1237 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); | |
| 1239 | 1238 | } |
| 1240 | 1239 | } |
| 1241 | 1240 | |
| 1242 | 1241 | /* update status of memory area 0x4000-0x07fff */ |
| 1243 | static void kc85_4_update_0x04000( | |
| 1242 | static void kc85_4_update_0x04000(running_machine *machine) | |
| 1244 | 1243 | { |
| 1245 | 1244 | read8_machine_func rh; |
| 1246 | 1245 | write8_machine_func wh; |
| r2418 | r2419 | |
| 1284 | 1283 | rh = SMH_NOP; |
| 1285 | 1284 | wh = SMH_NOP; |
| 1286 | 1285 | } |
| 1287 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, rh); | |
| 1288 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh); | |
| 1286 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, rh); | |
| 1287 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh); | |
| 1289 | 1288 | } |
| 1290 | 1289 | |
| 1291 | 1290 | |
| 1292 | 1291 | /* update memory address 0x0c000-0x0e000 */ |
| 1293 | static void kc85_4_update_0x0c000( | |
| 1292 | static void kc85_4_update_0x0c000(running_machine *machine) | |
| 1294 | 1293 | { |
| 1295 | 1294 | read8_machine_func rh; |
| 1296 | 1295 | |
| r2418 | r2419 | |
| 1327 | 1326 | rh = SMH_NOP; |
| 1328 | 1327 | } |
| 1329 | 1328 | } |
| 1330 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1329 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1331 | 1330 | } |
| 1332 | 1331 | |
| 1333 | 1332 | /* update memory address 0x0e000-0x0ffff */ |
| 1334 | static void kc85_4_update_0x0e000( | |
| 1333 | static void kc85_4_update_0x0e000(running_machine *machine) | |
| 1335 | 1334 | { |
| 1336 | 1335 | read8_machine_func rh; |
| 1337 | 1336 | |
| r2418 | r2419 | |
| 1349 | 1348 | |
| 1350 | 1349 | rh = SMH_NOP; |
| 1351 | 1350 | } |
| 1352 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1351 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1353 | 1352 | } |
| 1354 | 1353 | |
| 1355 | 1354 | /* PIO PORT A: port 0x088: |
| r2418 | r2419 | |
| 1384 | 1383 | |
| 1385 | 1384 | case 0: |
| 1386 | 1385 | { |
| 1387 | kc85_4_update_0x0c000(); | |
| 1388 | kc85_4_update_0x0e000(); | |
| 1389 | kc85_4_update_0x08000(); | |
| 1390 | kc85_4_update_0x00000(); | |
| 1386 | kc85_4_update_0x0c000(machine); | |
| 1387 | kc85_4_update_0x0e000(machine); | |
| 1388 | kc85_4_update_0x08000(machine); | |
| 1389 | kc85_4_update_0x00000(machine); | |
| 1391 | 1390 | |
| 1392 | 1391 | kc_cassette_set_motor((data>>6) & 0x01); |
| 1393 | 1392 | } |
| r2418 | r2419 | |
| 1397 | 1396 | { |
| 1398 | 1397 | int speaker_level; |
| 1399 | 1398 | |
| 1400 | kc85_4_update_0x08000(); | |
| 1399 | kc85_4_update_0x08000(machine); | |
| 1401 | 1400 | |
| 1402 | 1401 | /* 16 speaker levels */ |
| 1403 | 1402 | speaker_level = (data>>1) & 0x0f; |
| r2418 | r2419 | |
| 1417 | 1416 | |
| 1418 | 1417 | kc85_86_data = data; |
| 1419 | 1418 | |
| 1420 | kc85_4_update_0x0c000(); | |
| 1421 | kc85_4_update_0x04000(); | |
| 1419 | kc85_4_update_0x0c000(machine); | |
| 1420 | kc85_4_update_0x04000(machine); | |
| 1422 | 1421 | } |
| 1423 | 1422 | |
| 1424 | 1423 | READ8_HANDLER ( kc85_4_86_r ) |
| r2418 | r2419 | |
| 1435 | 1434 | |
| 1436 | 1435 | kc85_4_video_ram_select_bank(data & 0x01); |
| 1437 | 1436 | |
| 1438 | kc85_4_update_0x08000(); | |
| 1437 | kc85_4_update_0x08000(machine); | |
| 1439 | 1438 | } |
| 1440 | 1439 | |
| 1441 | 1440 | READ8_HANDLER ( kc85_4_84_r ) |
| r2418 | r2419 | |
| 1445 | 1444 | /*****************************************************************/ |
| 1446 | 1445 | |
| 1447 | 1446 | /* update memory region 0x0c000-0x0e000 */ |
| 1448 | static void kc85_3_update_0x0c000( | |
| 1447 | static void kc85_3_update_0x0c000(running_machine *machine) | |
| 1449 | 1448 | { |
| 1450 | 1449 | read8_machine_func rh; |
| 1451 | 1450 | |
| r2418 | r2419 | |
| 1463 | 1462 | |
| 1464 | 1463 | rh = SMH_NOP; |
| 1465 | 1464 | } |
| 1466 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1465 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1467 | 1466 | } |
| 1468 | 1467 | |
| 1469 | 1468 | /* update memory address 0x0e000-0x0ffff */ |
| 1470 | static void kc85_3_update_0x0e000( | |
| 1469 | static void kc85_3_update_0x0e000(running_machine *machine) | |
| 1471 | 1470 | { |
| 1472 | 1471 | read8_machine_func rh; |
| 1473 | 1472 | |
| r2418 | r2419 | |
| 1485 | 1484 | |
| 1486 | 1485 | rh = SMH_NOP; |
| 1487 | 1486 | } |
| 1488 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1487 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1489 | 1488 | } |
| 1490 | 1489 | |
| 1491 | 1490 | /* update status of memory area 0x0000-0x03fff */ |
| 1492 | 1491 | /* SMH_BANK1 is used for read operations and SMH_BANK6 is used |
| 1493 | 1492 | for write operations */ |
| 1494 | static void kc85_3_update_0x00000( | |
| 1493 | static void kc85_3_update_0x00000(running_machine *machine) | |
| 1495 | 1494 | { |
| 1496 | 1495 | read8_machine_func rh; |
| 1497 | 1496 | write8_machine_func wh; |
| r2418 | r2419 | |
| 1534 | 1533 | wh = SMH_NOP; |
| 1535 | 1534 | } |
| 1536 | 1535 | |
| 1537 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh); | |
| 1538 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh); | |
| 1536 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh); | |
| 1537 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh); | |
| 1539 | 1538 | } |
| 1540 | 1539 | |
| 1541 | 1540 | /* update status of memory area 0x08000-0x0ffff */ |
| 1542 | 1541 | /* SMH_BANK3 is used for read, SMH_BANK8 is used for write */ |
| 1543 | static void kc85_3_update_0x08000( | |
| 1542 | static void kc85_3_update_0x08000(running_machine *machine) | |
| 1544 | 1543 | { |
| 1545 | 1544 | read8_machine_func rh; |
| 1546 | 1545 | write8_machine_func wh; |
| r2418 | r2419 | |
| 1589 | 1588 | wh = SMH_NOP; |
| 1590 | 1589 | } |
| 1591 | 1590 | |
| 1592 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, rh); | |
| 1593 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh); | |
| 1591 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, rh); | |
| 1592 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh); | |
| 1594 | 1593 | } |
| 1595 | 1594 | |
| 1596 | 1595 | |
| r2418 | r2419 | |
| 1626 | 1625 | |
| 1627 | 1626 | case 0: |
| 1628 | 1627 | { |
| 1629 | kc85_3_update_0x0c000(); | |
| 1630 | kc85_3_update_0x0e000(); | |
| 1631 | kc85_3_update_0x00000(); | |
| 1628 | kc85_3_update_0x0c000(machine); | |
| 1629 | kc85_3_update_0x0e000(machine); | |
| 1630 | kc85_3_update_0x00000(machine); | |
| 1632 | 1631 | |
| 1633 | 1632 | kc_cassette_set_motor((data>>6) & 0x01); |
| 1634 | 1633 | } |
| r2418 | r2419 | |
| 1638 | 1637 | { |
| 1639 | 1638 | int speaker_level; |
| 1640 | 1639 | |
| 1641 | kc85_3_update_0x08000(); | |
| 1640 | kc85_3_update_0x08000(machine); | |
| 1642 | 1641 | |
| 1643 | 1642 | /* 16 speaker levels */ |
| 1644 | 1643 | speaker_level = (data>>1) & 0x0f; |
| r2418 | r2419 | |
| 1669 | 1668 | { |
| 1670 | 1669 | memory_set_opbase_handler(0,0); |
| 1671 | 1670 | |
| 1672 | kc85_3_update_0x00000(); | |
| 1671 | kc85_3_update_0x00000(machine); | |
| 1673 | 1672 | |
| 1674 | 1673 | return (cpunum_get_reg(0, REG_PC) & 0x0ffff); |
| 1675 | 1674 | } |
| r2418 | r2419 | |
| 1679 | 1678 | { |
| 1680 | 1679 | memory_set_opbase_handler(0,0); |
| 1681 | 1680 | |
| 1682 | kc85_4_update_0x00000(); | |
| 1681 | kc85_4_update_0x00000(machine); | |
| 1683 | 1682 | |
| 1684 | 1683 | return (cpunum_get_reg(0, REG_PC) & 0x0ffff); |
| 1685 | 1684 | } |
| r2418 | r2419 | |
| 1865 | 1864 | kc85_pio_data[0] = 0x0f; |
| 1866 | 1865 | kc85_pio_data[1] = 0x0f1; |
| 1867 | 1866 | |
| 1868 | kc85_4_update_0x04000(); | |
| 1869 | kc85_4_update_0x08000(); | |
| 1870 | kc85_4_update_0x0c000(); | |
| 1871 | kc85_4_update_0x0e000(); | |
| 1867 | kc85_4_update_0x04000(machine); | |
| 1868 | kc85_4_update_0x08000(machine); | |
| 1869 | kc85_4_update_0x0c000(machine); | |
| 1870 | kc85_4_update_0x0e000(machine); | |
| 1872 | 1871 | |
| 1873 | 1872 | kc85_common_init(); |
| 1874 | 1873 | |
| 1875 | kc85_4_update_0x00000(); | |
| 1874 | kc85_4_update_0x00000(machine); | |
| 1876 | 1875 | |
| 1877 | 1876 | |
| 1878 | 1877 | #if 0 |
| r2418 | r2419 | |
| 1899 | 1898 | memory_set_bankptr(2,mess_ram+0x0c000); |
| 1900 | 1899 | memory_set_bankptr(7,mess_ram+0x0c000); |
| 1901 | 1900 | |
| 1902 | kc85_3_update_0x08000(); | |
| 1903 | kc85_3_update_0x0c000(); | |
| 1904 | kc85_3_update_0x0e000(); | |
| 1901 | kc85_3_update_0x08000(machine); | |
| 1902 | kc85_3_update_0x0c000(machine); | |
| 1903 | kc85_3_update_0x0e000(machine); | |
| 1905 | 1904 | |
| 1906 | 1905 | kc85_common_init(); |
| 1907 | 1906 | |
| 1908 | kc85_3_update_0x00000(); | |
| 1907 | kc85_3_update_0x00000(machine); | |
| 1909 | 1908 | |
| 1910 | 1909 | #if 0 |
| 1911 | 1910 | /* this is temporary. Normally when a Z80 is reset, it will |
| r2418 | r2419 | |
|---|---|---|
| 195 | 195 | state_save_register_global(vip_reset); |
| 196 | 196 | state_save_register_global(vip_run); |
| 197 | 197 | |
| 198 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 199 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 198 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 199 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1); | |
| 200 | 200 | |
| 201 | 201 | if (mess_ram_size < 0x8000) |
| 202 | 202 | { |
| 203 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7fff, 0, 0, SMH_UNMAP); | |
| 204 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7fff, 0, 0, SMH_UNMAP); | |
| 203 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7fff, 0, 0, SMH_UNMAP); | |
| 204 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x7fff, 0, 0, SMH_UNMAP); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | for (addr = 0; addr < mess_ram_size; addr++) |
| r2418 | r2419 | |
|---|---|---|
| 510 | 510 | state_save_register_global(eeprom_enable); |
| 511 | 511 | |
| 512 | 512 | /* init the sound system and install DSP speedups */ |
| 513 | cojag_sound_init(); | |
| 513 | cojag_sound_init(machine); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | static QUICKLOAD_LOAD( jaguar ) |
| r2418 | r2419 | |
|---|---|---|
| 425 | 425 | break; |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 428 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 429 | 429 | (bank * 0x4000), (bank * 0x4000) + 0x3fff, 0, 0, read_handler); |
| 430 | 430 | |
| 431 | 431 | if (write_handler) |
| 432 | 432 | { |
| 433 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 433 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 434 | 434 | (bank * 0x4000), (bank * 0x4000) + 0x3fff, 0, 0, write_handler); |
| 435 | 435 | } |
| 436 | 436 | } |
| r2418 | r2419 | |
|---|---|---|
| 161 | 161 | #include "machine/smartmed.h" |
| 162 | 162 | #include "sound/5220intf.h" |
| 163 | 163 | #include "devices/harddriv.h" |
| 164 | #include "machine/idectrl.h" | |
| 164 | 165 | |
| 165 | 166 | /* |
| 166 | 167 | Memory map - see description above |
| r2418 | r2419 | |
| 423 | 424 | MDRV_SOUND_ADD(TMS5220, 680000L) |
| 424 | 425 | MDRV_SOUND_CONFIG(tms5220interface) |
| 425 | 426 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 427 | ||
| 428 | /* devices */ | |
| 429 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 426 | 430 | MACHINE_DRIVER_END |
| 427 | 431 | |
| 428 | 432 | |
| r2418 | r2419 | |
| 454 | 458 | MDRV_SOUND_ADD(WAVE, 0) |
| 455 | 459 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 456 | 460 | |
| 461 | /* devices */ | |
| 462 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 457 | 463 | MACHINE_DRIVER_END |
| 458 | 464 | |
| 459 | 465 | /* |
| r2418 | r2419 | |
| 602 | 608 | } |
| 603 | 609 | } |
| 604 | 610 | |
| 605 | #if 0 | |
| 606 | static void ti99_8_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) | |
| 607 | { | |
| 608 | /* quickload */ | |
| 609 | switch(state) | |
| 610 | { | |
| 611 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 612 | case MESS_DEVINFO_INT_TYPE: info->i = IO_QUICKLOAD; break; | |
| 613 | case MESS_DEVINFO_INT_READABLE: info->i = 1; break; | |
| 614 | case MESS_DEVINFO_INT_WRITEABLE: info->i = 1; break; | |
| 615 | case MESS_DEVINFO_INT_CREATABLE: info->i = 1; break; | |
| 616 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; | |
| 617 | case MESS_DEVINFO_INT_RESET_ON_LOAD: info->i = 1; break; | |
| 618 | ||
| 619 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 620 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(ti99_hsgpl); break; | |
| 621 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(ti99_hsgpl); break; | |
| 622 | ||
| 623 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 624 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), ""); break; | |
| 625 | } | |
| 626 | } | |
| 627 | #endif | |
| 628 | ||
| 629 | 611 | static void ti99_8_memcard_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 630 | 612 | { |
| 631 | 613 | /* memcard */ |
| r2418 | r2419 | |
|---|---|---|
| 12 | 12 | Kevin Thacker [MESS driver] |
| 13 | 13 | |
| 14 | 14 | ******************************************************************************/ |
| 15 | ||
| 15 | 16 | #include "driver.h" |
| 17 | #include "deprecat.h" | |
| 16 | 18 | #include "includes/z88.h" |
| 17 | 19 | #include "sound/speaker.h" |
| 18 | 20 | |
| r2418 | r2419 | |
| 190 | 192 | write_handler = (write_addr != NULL) ? (write8_machine_func) (STATIC_BANK1 + (FPTR)(bank_base - 1 + 1)) : SMH_UNMAP; |
| 191 | 193 | |
| 192 | 194 | /* install the handlers */ |
| 193 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, read_handler); | |
| 194 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, write_handler); | |
| 195 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, read_handler); | |
| 196 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, write_handler); | |
| 195 | 197 | |
| 196 | 198 | /* and set the banks */ |
| 197 | 199 | if (read_addr != NULL) |
| r2418 | r2419 | |
|---|---|---|
| 408 | 408 | break; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 411 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 412 | 412 | (bank * 0x4000), (bank * 0x4000) + 0x3fff, 0, 0, read_handler); |
| 413 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 413 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 414 | 414 | (bank * 0x4000), (bank * 0x4000) + 0x3fff, 0, 0, write_handler); |
| 415 | 415 | } |
| 416 | 416 |
| r2418 | r2419 | |
|---|---|---|
| 274 | 274 | switch (mess_ram_size) |
| 275 | 275 | { |
| 276 | 276 | case 8*1024: |
| 277 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 278 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 277 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 278 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 279 | 279 | break; |
| 280 | 280 | |
| 281 | 281 | case 16*1024: |
| 282 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x9fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 283 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 282 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x9fff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 283 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 284 | 284 | break; |
| 285 | 285 | |
| 286 | 286 | case 24*1024: |
| 287 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xbfff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 287 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xbfff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 288 | 288 | break; |
| 289 | 289 | } |
| 290 | 290 |
| r2418 | r2419 | |
|---|---|---|
| 1930 | 1930 | { |
| 1931 | 1931 | /* Install RAM handlers */ |
| 1932 | 1932 | x68k_spriteram = (UINT16*)memory_region(REGION_USER1); |
| 1933 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(read16_machine_func)1); | |
| 1934 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(write16_machine_func)1); | |
| 1933 | memory_install_read16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(read16_machine_func)1); | |
| 1934 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(write16_machine_func)1); | |
| 1935 | 1935 | memory_set_bankptr(1,mess_ram); |
| 1936 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(read16_machine_func)x68k_gvram_r); | |
| 1937 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(write16_machine_func)x68k_gvram_w); | |
| 1936 | memory_install_read16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(read16_machine_func)x68k_gvram_r); | |
| 1937 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(write16_machine_func)x68k_gvram_w); | |
| 1938 | 1938 | memory_set_bankptr(2,gvram); // so that code in VRAM is executable - needed for Terra Cresta |
| 1939 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(read16_machine_func)x68k_tvram_r); | |
| 1940 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(write16_machine_func)x68k_tvram_w); | |
| 1939 | memory_install_read16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(read16_machine_func)x68k_tvram_r); | |
| 1940 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(write16_machine_func)x68k_tvram_w); | |
| 1941 | 1941 | memory_set_bankptr(3,tvram); // so that code in VRAM is executable - needed for Terra Cresta |
| 1942 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(read16_machine_func)x68k_sram_r); | |
| 1943 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(write16_machine_func)x68k_sram_w); | |
| 1942 | memory_install_read16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(read16_machine_func)x68k_sram_r); | |
| 1943 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(write16_machine_func)x68k_sram_w); | |
| 1944 | 1944 | memory_set_bankptr(4,generic_nvram16); // so that code in SRAM is executable, there is an option for booting from SRAM |
| 1945 | 1945 | |
| 1946 | 1946 | // start keyboard timer |
| r2418 | r2419 | |
|---|---|---|
| 159 | 159 | #include "devices/dsk.h" |
| 160 | 160 | |
| 161 | 161 | |
| 162 | extern void spectrum_128_update_memory(void); | |
| 163 | extern void spectrum_plus3_update_memory(void); | |
| 164 | ||
| 165 | ||
| 166 | 162 | static const struct AY8910interface spectrum_ay_interface = |
| 167 | 163 | { |
| 168 | 164 | NULL |
| r2418 | r2419 | |
| 386 | 382 | spectrum_128_port_7ffd_data = data; |
| 387 | 383 | |
| 388 | 384 | /* update memory */ |
| 389 | spectrum_128_update_memory(); | |
| 385 | spectrum_128_update_memory(machine); | |
| 390 | 386 | } |
| 391 | 387 | |
| 392 | extern void spectrum_128_update_memory( | |
| 388 | extern void spectrum_128_update_memory(running_machine *machine) | |
| 393 | 389 | { |
| 394 | 390 | unsigned char *ChosenROM; |
| 395 | 391 | int ROMSelection; |
| r2418 | r2419 | |
| 538 | 534 | |
| 539 | 535 | /* set initial ram config */ |
| 540 | 536 | spectrum_128_port_7ffd_data = 0; |
| 541 | spectrum_128_update_memory(); | |
| 537 | spectrum_128_update_memory(machine); | |
| 542 | 538 | |
| 543 | 539 | MACHINE_RESET_CALL(spectrum); |
| 544 | 540 | } |
| r2418 | r2419 | |
| 590 | 586 | } |
| 591 | 587 | |
| 592 | 588 | |
| 593 | void spectrum_plus3_update_memory( | |
| 589 | void spectrum_plus3_update_memory(running_machine *machine) | |
| 594 | 590 | { |
| 595 | 591 | if (spectrum_128_port_7ffd_data & 8) |
| 596 | 592 | { |
| r2418 | r2419 | |
| 639 | 635 | ChosenROM = memory_region(REGION_CPU1) + 0x010000 + (ROMSelection<<14); |
| 640 | 636 | |
| 641 | 637 | memory_set_bankptr(1, ChosenROM); |
| 642 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 638 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); | |
| 643 | 639 | |
| 644 | 640 | logerror("rom switch: %02x\n", ROMSelection); |
| 645 | 641 | } |
| r2418 | r2419 | |
| 659 | 655 | memory_set_bankptr(1, ram_data); |
| 660 | 656 | memory_set_bankptr(5, ram_data); |
| 661 | 657 | /* allow writes to 0x0000-0x03fff */ |
| 662 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK5); | |
| 658 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK5); | |
| 663 | 659 | |
| 664 | 660 | ram_data = spectrum_ram + (memory_selection[1]<<14); |
| 665 | 661 | memory_set_bankptr(2, ram_data); |
| r2418 | r2419 | |
| 694 | 690 | spectrum_128_port_7ffd_data = data; |
| 695 | 691 | |
| 696 | 692 | /* update memory */ |
| 697 | spectrum_plus3_update_memory(); | |
| 693 | spectrum_plus3_update_memory(machine); | |
| 698 | 694 | } |
| 699 | 695 | |
| 700 | 696 | static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w) |
| r2418 | r2419 | |
| 716 | 712 | if ((spectrum_128_port_7ffd_data & 0x20)==0) |
| 717 | 713 | { |
| 718 | 714 | /* no */ |
| 719 | spectrum_plus3_update_memory(); | |
| 715 | spectrum_plus3_update_memory(machine); | |
| 720 | 716 | } |
| 721 | 717 | } |
| 722 | 718 | |
| r2418 | r2419 | |
| 847 | 843 | /* Initial configuration */ |
| 848 | 844 | spectrum_128_port_7ffd_data = 0; |
| 849 | 845 | spectrum_plus3_port_1ffd_data = 0; |
| 850 | spectrum_plus3_update_memory(); | |
| 846 | spectrum_plus3_update_memory(machine); | |
| 851 | 847 | |
| 852 | 848 | MACHINE_RESET_CALL(spectrum); |
| 853 | 849 | } |
| r2418 | r2419 | |
| 868 | 864 | static WRITE8_HANDLER(ts2068_port_f4_w) |
| 869 | 865 | { |
| 870 | 866 | ts2068_port_f4_data = data; |
| 871 | ts2068_update_memory(); | |
| 867 | ts2068_update_memory(machine); | |
| 872 | 868 | } |
| 873 | 869 | |
| 874 | 870 | static WRITE8_HANDLER(ts2068_port_f5_w) |
| r2418 | r2419 | |
| 906 | 902 | Bit 7 Cartridge (0) / EXROM (1) select |
| 907 | 903 | */ |
| 908 | 904 | ts2068_port_ff_data = data; |
| 909 | ts2068_update_memory(); | |
| 905 | ts2068_update_memory(machine); | |
| 910 | 906 | logerror("Port %04x write %02x\n", offset, data); |
| 911 | 907 | } |
| 912 | 908 | |
| r2418 | r2419 | |
| 970 | 966 | * at the same time. |
| 971 | 967 | * |
| 972 | 968 | *******************************************************************/ |
| 973 | void ts2068_update_memory( | |
| 969 | void ts2068_update_memory(running_machine *machine) | |
| 974 | 970 | { |
| 975 | 971 | unsigned char *ChosenROM, *ExROM, *DOCK; |
| 976 | 972 | read8_machine_func rh; |
| r2418 | r2419 | |
| 1016 | 1012 | wh = SMH_UNMAP; |
| 1017 | 1013 | logerror("0000-1fff HOME\n"); |
| 1018 | 1014 | } |
| 1019 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, rh); | |
| 1020 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, wh); | |
| 1015 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, rh); | |
| 1016 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, wh); | |
| 1021 | 1017 | |
| 1022 | 1018 | if (ts2068_port_f4_data & 0x02) |
| 1023 | 1019 | { |
| r2418 | r2419 | |
| 1055 | 1051 | wh = SMH_UNMAP; |
| 1056 | 1052 | logerror("2000-3fff HOME\n"); |
| 1057 | 1053 | } |
| 1058 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, rh); | |
| 1059 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, wh); | |
| 1054 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, rh); | |
| 1055 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, wh); | |
| 1060 | 1056 | |
| 1061 | 1057 | if (ts2068_port_f4_data & 0x04) |
| 1062 | 1058 | { |
| r2418 | r2419 | |
| 1094 | 1090 | wh = SMH_BANK11; |
| 1095 | 1091 | logerror("4000-5fff RAM\n"); |
| 1096 | 1092 | } |
| 1097 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, rh); | |
| 1098 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, wh); | |
| 1093 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, rh); | |
| 1094 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, wh); | |
| 1099 | 1095 | |
| 1100 | 1096 | if (ts2068_port_f4_data & 0x08) |
| 1101 | 1097 | { |
| r2418 | r2419 | |
| 1133 | 1129 | wh = SMH_BANK12; |
| 1134 | 1130 | logerror("6000-7fff RAM\n"); |
| 1135 | 1131 | } |
| 1136 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, rh); | |
| 1137 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, wh); | |
| 1132 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, rh); | |
| 1133 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, wh); | |
| 1138 | 1134 | |
| 1139 | 1135 | if (ts2068_port_f4_data & 0x10) |
| 1140 | 1136 | { |
| r2418 | r2419 | |
| 1172 | 1168 | wh = SMH_BANK13; |
| 1173 | 1169 | logerror("8000-9fff RAM\n"); |
| 1174 | 1170 | } |
| 1175 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0,rh); | |
| 1176 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0,wh); | |
| 1171 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0,rh); | |
| 1172 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0,wh); | |
| 1177 | 1173 | |
| 1178 | 1174 | if (ts2068_port_f4_data & 0x20) |
| 1179 | 1175 | { |
| r2418 | r2419 | |
| 1211 | 1207 | wh = SMH_BANK14; |
| 1212 | 1208 | logerror("a000-bfff RAM\n"); |
| 1213 | 1209 | } |
| 1214 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rh); | |
| 1215 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, wh); | |
| 1210 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rh); | |
| 1211 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, wh); | |
| 1216 | 1212 | |
| 1217 | 1213 | if (ts2068_port_f4_data & 0x40) |
| 1218 | 1214 | { |
| r2418 | r2419 | |
| 1250 | 1246 | wh = SMH_BANK15; |
| 1251 | 1247 | logerror("c000-dfff RAM\n"); |
| 1252 | 1248 | } |
| 1253 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1254 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, wh); | |
| 1249 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); | |
| 1250 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, wh); | |
| 1255 | 1251 | |
| 1256 | 1252 | if (ts2068_port_f4_data & 0x80) |
| 1257 | 1253 | { |
| r2418 | r2419 | |
| 1289 | 1285 | wh = SMH_BANK16; |
| 1290 | 1286 | logerror("e000-ffff RAM\n"); |
| 1291 | 1287 | } |
| 1292 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1293 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, wh); | |
| 1288 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); | |
| 1289 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, wh); | |
| 1294 | 1290 | } |
| 1295 | 1291 | |
| 1296 | 1292 | |
| r2418 | r2419 | |
| 1314 | 1310 | { |
| 1315 | 1311 | ts2068_port_ff_data = 0; |
| 1316 | 1312 | ts2068_port_f4_data = 0; |
| 1317 | ts2068_update_memory(); | |
| 1313 | ts2068_update_memory(machine); | |
| 1318 | 1314 | |
| 1319 | 1315 | MACHINE_RESET_CALL(spectrum); |
| 1320 | 1316 | } |
| r2418 | r2419 | |
| 1520 | 1516 | |
| 1521 | 1517 | static int scorpion_256_port_1ffd_data = 0; |
| 1522 | 1518 | |
| 1523 | static void scorpion_update_memory( | |
| 1519 | static void scorpion_update_memory(running_machine *machine) | |
| 1524 | 1520 | { |
| 1525 | 1521 | unsigned char *ChosenROM; |
| 1526 | 1522 | int ROMSelection; |
| r2418 | r2419 | |
| 1590 | 1586 | |
| 1591 | 1587 | logerror("rom switch: %02x\n", ROMSelection); |
| 1592 | 1588 | } |
| 1593 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh); | |
| 1594 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh); | |
| 1589 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh); | |
| 1590 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh); | |
| 1595 | 1591 | } |
| 1596 | 1592 | |
| 1597 | 1593 | |
| r2418 | r2419 | |
| 1607 | 1603 | spectrum_128_port_7ffd_data = data; |
| 1608 | 1604 | |
| 1609 | 1605 | /* update memory */ |
| 1610 | scorpion_update_memory(); | |
| 1606 | scorpion_update_memory(machine); | |
| 1611 | 1607 | } |
| 1612 | 1608 | |
| 1613 | 1609 | static WRITE8_HANDLER(scorpion_port_1ffd_w) |
| r2418 | r2419 | |
| 1619 | 1615 | /* disable paging? */ |
| 1620 | 1616 | if ((spectrum_128_port_7ffd_data & 0x20)==0) |
| 1621 | 1617 | { |
| 1622 | scorpion_update_memory(); | |
| 1618 | scorpion_update_memory(machine); | |
| 1623 | 1619 | } |
| 1624 | 1620 | } |
| 1625 | 1621 | |
| r2418 | r2419 | |
| 1722 | 1718 | spectrum_128_port_7ffd_data = 0; |
| 1723 | 1719 | scorpion_256_port_1ffd_data = 0; |
| 1724 | 1720 | |
| 1725 | scorpion_update_memory(); | |
| 1721 | scorpion_update_memory(machine); | |
| 1726 | 1722 | } |
| 1727 | 1723 | |
| 1728 | 1724 | /****************************************************************************************************/ |
| r2418 | r2419 | |
|---|---|---|
| 1451 | 1451 | } |
| 1452 | 1452 | }; |
| 1453 | 1453 | |
| 1454 | static void atarist_configure_memory( | |
| 1454 | static void atarist_configure_memory(running_machine *machine) | |
| 1455 | 1455 | { |
| 1456 | 1456 | switch (mess_ram_size) |
| 1457 | 1457 | { |
| 1458 | 1458 | case 256 * 1024: |
| 1459 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x03ffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1460 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x040000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1459 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x03ffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1460 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x040000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1461 | 1461 | break; |
| 1462 | 1462 | case 512 * 1024: |
| 1463 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x07ffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1464 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1463 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x07ffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1464 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1465 | 1465 | break; |
| 1466 | 1466 | case 1024 * 1024: |
| 1467 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x0fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1468 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1467 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x0fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1468 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1469 | 1469 | break; |
| 1470 | 1470 | case 2048 * 1024: |
| 1471 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1472 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1471 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1472 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1473 | 1473 | break; |
| 1474 | 1474 | case 4096 * 1024: |
| 1475 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1476 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 1475 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1476 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 1477 | 1477 | break; |
| 1478 | 1478 | } |
| 1479 | 1479 | |
| r2418 | r2419 | |
| 1483 | 1483 | memory_configure_bank(2, 0, 1, memory_region(REGION_CPU1) + 0x200000, 0); |
| 1484 | 1484 | memory_set_bank(2, 0); |
| 1485 | 1485 | |
| 1486 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1486 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1487 | 1487 | |
| 1488 | 1488 | memory_configure_bank(3, 0, 1, memory_region(REGION_CPU1) + 0xfa0000, 0); |
| 1489 | 1489 | memory_set_bank(3, 0); |
| r2418 | r2419 | |
| 1523 | 1523 | { |
| 1524 | 1524 | atarist_state *state = machine->driver_data; |
| 1525 | 1525 | |
| 1526 | atarist_configure_memory(); | |
| 1526 | atarist_configure_memory(machine); | |
| 1527 | 1527 | atarist_state_save(); |
| 1528 | 1528 | |
| 1529 | 1529 | centronics_config(0, atarist_centronics_config); |
| r2418 | r2419 | |
| 1613 | 1613 | { |
| 1614 | 1614 | atarist_state *state = machine->driver_data; |
| 1615 | 1615 | |
| 1616 | atarist_configure_memory(); | |
| 1616 | atarist_configure_memory(machine); | |
| 1617 | 1617 | atariste_state_save(); |
| 1618 | 1618 | |
| 1619 | 1619 | centronics_config(0, atarist_centronics_config); |
| r2418 | r2419 | |
| 1635 | 1635 | rp5c15_init(machine, &rtc_intf); |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | static void stbook_configure_memory( | |
| 1638 | static void stbook_configure_memory(running_machine *machine) | |
| 1639 | 1639 | { |
| 1640 | 1640 | switch (mess_ram_size) |
| 1641 | 1641 | { |
| 1642 | 1642 | case 1024 * 1024: |
| 1643 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x07ffff, 0, 0x080000, SMH_BANK1, SMH_BANK1); | |
| 1644 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1643 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x07ffff, 0, 0x080000, SMH_BANK1, SMH_BANK1); | |
| 1644 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x3fffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1645 | 1645 | break; |
| 1646 | 1646 | case 4096 * 1024: |
| 1647 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1648 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 1647 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000008, 0x1fffff, 0, 0, SMH_BANK1, SMH_BANK1); | |
| 1648 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x3fffff, 0, 0, SMH_BANK2, SMH_BANK2); | |
| 1649 | 1649 | break; |
| 1650 | 1650 | } |
| 1651 | 1651 | |
| r2418 | r2419 | |
| 1655 | 1655 | memory_configure_bank(2, 0, 1, memory_region(REGION_CPU1) + 0x200000, 0); |
| 1656 | 1656 | memory_set_bank(2, 0); |
| 1657 | 1657 | |
| 1658 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1658 | memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 1659 | 1659 | |
| 1660 | 1660 | memory_configure_bank(3, 0, 1, memory_region(REGION_CPU1) + 0xfa0000, 0); |
| 1661 | 1661 | memory_set_bank(3, 0); |
| r2418 | r2419 | |
| 1749 | 1749 | { |
| 1750 | 1750 | atarist_state *state = machine->driver_data; |
| 1751 | 1751 | |
| 1752 | stbook_configure_memory(); | |
| 1752 | stbook_configure_memory(machine); | |
| 1753 | 1753 | atariste_state_save(); |
| 1754 | 1754 | |
| 1755 | 1755 | state_save_register_global(krxd); |
| r2418 | r2419 | |
| 2151 | 2151 | { |
| 2152 | 2152 | if (image_fread(image, ptr, filesize) == filesize) |
| 2153 | 2153 | { |
| 2154 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_BANK3, SMH_BANK3); | |
| 2154 | memory_install_readwrite16_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0xfa0000, 0xfbffff, 0, 0, SMH_BANK3, SMH_BANK3); | |
| 2155 | 2155 | |
| 2156 | 2156 | return INIT_PASS; |
| 2157 | 2157 | } |
| r2418 | r2419 | |
|---|---|---|
| 212 | 212 | #include "machine/smartmed.h" |
| 213 | 213 | #include "sound/5220intf.h" |
| 214 | 214 | #include "devices/harddriv.h" |
| 215 | #include "machine/idectrl.h" | |
| 215 | 216 | |
| 216 | 217 | /* |
| 217 | 218 | memory map |
| r2418 | r2419 | |
| 470 | 471 | MDRV_VIDEO_START(geneve) |
| 471 | 472 | MDRV_VIDEO_UPDATE(generic_bitmapped) |
| 472 | 473 | |
| 474 | /* sound hardware */ | |
| 473 | 475 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 474 | 476 | MDRV_SOUND_ADD(SN76496, 3579545) /* 3.579545 MHz */ |
| 475 | 477 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 476 | 478 | MDRV_SOUND_ADD(TMS5220, 680000L) |
| 477 | 479 | MDRV_SOUND_CONFIG(tms5220interface) |
| 478 | 480 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 481 | ||
| 482 | /* devices */ | |
| 483 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 479 | 484 | MACHINE_DRIVER_END |
| 480 | 485 | |
| 481 | 486 |
| r2418 | r2419 | |
|---|---|---|
| 665 | 665 | |
| 666 | 666 | /* System Configuration */ |
| 667 | 667 | |
| 668 | static void sg1000_map_cartridge_memory(UINT8 *ptr, int size) | |
| 668 | static void sg1000_map_cartridge_memory(running_machine *machine, UINT8 *ptr, int size) | |
| 669 | 669 | { |
| 670 | 670 | if (size == 40 * 1024) |
| 671 | 671 | { |
| 672 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 673 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_UNMAP); | |
| 672 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 673 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_UNMAP); | |
| 674 | 674 | memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0x8000, 0); |
| 675 | 675 | memory_set_bank(1, 0); |
| 676 | 676 | } |
| 677 | 677 | else if (size == 48 * 1024) |
| 678 | 678 | { |
| 679 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 680 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 679 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 680 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_UNMAP); | |
| 681 | 681 | memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0x8000, 0); |
| 682 | 682 | memory_set_bank(1, 0); |
| 683 | 683 | } |
| r2418 | r2419 | |
| 685 | 685 | { |
| 686 | 686 | // Terebi Oekaki |
| 687 | 687 | |
| 688 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, &tvdraw_axis_w); | |
| 689 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, &tvdraw_status_r); | |
| 690 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, &tvdraw_data_r); | |
| 691 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, SMH_NOP); | |
| 688 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, &tvdraw_axis_w); | |
| 689 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, &tvdraw_status_r); | |
| 690 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, &tvdraw_data_r); | |
| 691 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, SMH_NOP); | |
| 692 | 692 | } |
| 693 | 693 | else if (!strncmp("ASCII 1986", (const char *)&ptr[0x1cc3], 10)) |
| 694 | 694 | { |
| 695 | 695 | // The Castle |
| 696 | 696 | |
| 697 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 698 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 697 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 698 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 699 | 699 | } |
| 700 | 700 | } |
| 701 | 701 | |
| r2418 | r2419 | |
| 709 | 709 | return INIT_FAIL; |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | sg1000_map_cartridge_memory(ptr, size); | |
| 712 | sg1000_map_cartridge_memory(image->machine, ptr, size); | |
| 713 | 713 | |
| 714 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc3ff, 0, 0x3c00, SMH_BANK2); | |
| 715 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc3ff, 0, 0x3c00, SMH_BANK2); | |
| 714 | memory_install_read8_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc3ff, 0, 0x3c00, SMH_BANK2); | |
| 715 | memory_install_write8_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc3ff, 0, 0x3c00, SMH_BANK2); | |
| 716 | 716 | |
| 717 | 717 | return INIT_PASS; |
| 718 | 718 | } |
| r2418 | r2419 | |
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | static void sc3000_map_cartridge_memory(UINT8 *ptr) | |
| 733 | static void sc3000_map_cartridge_memory(running_machine *machine, UINT8 *ptr) | |
| 734 | 734 | { |
| 735 | 735 | if (!strncmp("SC-3000 BASIC Level 3 ver 1.0", (const char *)&ptr[0x6a20], 29)) |
| 736 | 736 | { |
| 737 | 737 | // SC-3000 BASIC Level III |
| 738 | 738 | |
| 739 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 740 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 739 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 740 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 741 | 741 | |
| 742 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 743 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 742 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 743 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2); | |
| 744 | 744 | } |
| 745 | 745 | else if (!strncmp("PIANO", (const char *)&ptr[0x0841], 5)) |
| 746 | 746 | { |
| 747 | 747 | // Sega SC-3000 Music Editor |
| 748 | 748 | |
| 749 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 750 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 749 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 750 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK1); | |
| 751 | 751 | |
| 752 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 753 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 752 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 753 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 754 | 754 | } |
| 755 | 755 | else |
| 756 | 756 | { |
| 757 | 757 | // regular cartridges |
| 758 | 758 | |
| 759 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 760 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 759 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 760 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0x3800, SMH_BANK2); | |
| 761 | 761 | } |
| 762 | 762 | } |
| 763 | 763 | |
| r2418 | r2419 | |
| 771 | 771 | return INIT_FAIL; |
| 772 | 772 | } |
| 773 | 773 | |
| 774 | sg1000_map_cartridge_memory(ptr, size); | |
| 775 | sc3000_map_cartridge_memory(ptr); | |
| 774 | sg1000_map_cartridge_memory(image->machine, ptr, size); | |
| 775 | sc3000_map_cartridge_memory(image->machine, ptr); | |
| 776 | 776 | |
| 777 | 777 | return INIT_PASS; |
| 778 | 778 | } |
| r2418 | r2419 | |
|---|---|---|
| 1151 | 1151 | }; |
| 1152 | 1152 | |
| 1153 | 1153 | |
| 1154 | static void install_banks(int count, unsigned init) | |
| 1154 | static void install_banks(running_machine *machine, int count, unsigned init) | |
| 1155 | 1155 | { |
| 1156 | 1156 | int i; |
| 1157 | 1157 | |
| r2418 | r2419 | |
| 1165 | 1165 | SMH_BANK4, |
| 1166 | 1166 | }; |
| 1167 | 1167 | |
| 1168 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 1168 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 1169 | 1169 | 0x1000 + (i + 0) * 0x1000 / count - 0, |
| 1170 | 1170 | 0x1000 + (i + 1) * 0x1000 / count - 1, 0, 0, handler[i]); |
| 1171 | 1171 | |
| r2418 | r2419 | |
| 1549 | 1549 | switch (banking_mode) |
| 1550 | 1550 | { |
| 1551 | 1551 | case mode2K: |
| 1552 | install_banks(2, 0x0000); | |
| 1552 | install_banks(machine, 2, 0x0000); | |
| 1553 | 1553 | break; |
| 1554 | 1554 | |
| 1555 | 1555 | case mode4K: |
| 1556 | install_banks(1, 0x0000); | |
| 1556 | install_banks(machine, 1, 0x0000); | |
| 1557 | 1557 | break; |
| 1558 | 1558 | |
| 1559 | 1559 | case modeF8: |
| 1560 | 1560 | if (!memcmp(&CART[0x1ffc],snowwhite,sizeof(snowwhite))) { |
| 1561 | install_banks(1, 0x0000); | |
| 1561 | install_banks(machine, 1, 0x0000); | |
| 1562 | 1562 | } else { |
| 1563 | install_banks(1, 0x1000); | |
| 1563 | install_banks(machine, 1, 0x1000); | |
| 1564 | 1564 | } |
| 1565 | 1565 | break; |
| 1566 | 1566 | |
| 1567 | 1567 | case modeFA: |
| 1568 | install_banks(1, 0x2000); | |
| 1568 | install_banks(machine, 1, 0x2000); | |
| 1569 | 1569 | break; |
| 1570 | 1570 | |
| 1571 | 1571 | case modeF6: |
| 1572 | install_banks(1, 0x0000); | |
| 1572 | install_banks(machine, 1, 0x0000); | |
| 1573 | 1573 | break; |
| 1574 | 1574 | |
| 1575 | 1575 | case modeF4: |
| 1576 | install_banks(1, 0x7000); | |
| 1576 | install_banks(machine, 1, 0x7000); | |
| 1577 | 1577 | break; |
| 1578 | 1578 | |
| 1579 | 1579 | case modeFE: |
| 1580 | install_banks(1, 0x0000); | |
| 1580 | install_banks(machine, 1, 0x0000); | |
| 1581 | 1581 | break; |
| 1582 | 1582 | |
| 1583 | 1583 | case modeE0: |
| 1584 | install_banks(4, 0x1c00); | |
| 1584 | install_banks(machine, 4, 0x1c00); | |
| 1585 | 1585 | break; |
| 1586 | 1586 | |
| 1587 | 1587 | case mode3F: |
| 1588 | install_banks(2, cart_size - 0x800); | |
| 1588 | install_banks(machine, 2, cart_size - 0x800); | |
| 1589 | 1589 | number_banks = cart_size / 0x800; |
| 1590 | 1590 | break; |
| 1591 | 1591 | |
| 1592 | 1592 | case modeUA: |
| 1593 | install_banks(1, 0x1000); | |
| 1593 | install_banks(machine, 1, 0x1000); | |
| 1594 | 1594 | break; |
| 1595 | 1595 | |
| 1596 | 1596 | case modeE7: |
| 1597 | install_banks(2, 0x3800); | |
| 1597 | install_banks(machine, 2, 0x3800); | |
| 1598 | 1598 | break; |
| 1599 | 1599 | |
| 1600 | 1600 | case modeDC: |
| 1601 | install_banks(1, 0x1000 * current_bank); | |
| 1601 | install_banks(machine, 1, 0x1000 * current_bank); | |
| 1602 | 1602 | break; |
| 1603 | 1603 | |
| 1604 | 1604 | case modeCV: |
| 1605 | install_banks(2, 0x0000); | |
| 1605 | install_banks(machine, 2, 0x0000); | |
| 1606 | 1606 | break; |
| 1607 | 1607 | |
| 1608 | 1608 | case mode3E: |
| 1609 | install_banks(2, cart_size - 0x800); | |
| 1609 | install_banks(machine, 2, cart_size - 0x800); | |
| 1610 | 1610 | number_banks = cart_size / 0x800; |
| 1611 | 1611 | mode3E_ram_enabled = 0; |
| 1612 | 1612 | break; |
| 1613 | 1613 | |
| 1614 | 1614 | case modeSS: |
| 1615 | install_banks(2, 0x0000); | |
| 1615 | install_banks(machine, 2, 0x0000); | |
| 1616 | 1616 | break; |
| 1617 | 1617 | |
| 1618 | 1618 | case modeFV: |
| 1619 | install_banks(1, 0x0000); | |
| 1619 | install_banks(machine, 1, 0x0000); | |
| 1620 | 1620 | current_bank = 0; |
| 1621 | 1621 | break; |
| 1622 | 1622 | |
| 1623 | 1623 | case modeDPC: |
| 1624 | install_banks(1, 0x0000); | |
| 1624 | install_banks(machine, 1, 0x0000); | |
| 1625 | 1625 | break; |
| 1626 | 1626 | |
| 1627 | 1627 | case mode32in1: |
| 1628 | install_banks(2, 0x0000); | |
| 1628 | install_banks(machine, 2, 0x0000); | |
| 1629 | 1629 | current_reset_bank_counter = current_reset_bank_counter & 0x1F; |
| 1630 | 1630 | break; |
| 1631 | 1631 | |
| r2418 | r2419 | |
| 1634 | 1634 | if ( cart_size == 0x2000 ) |
| 1635 | 1635 | current_reset_bank_counter = 0; |
| 1636 | 1636 | current_bank = current_reset_bank_counter * 2; |
| 1637 | install_banks(1, 0x1000 * current_bank); | |
| 1637 | install_banks(machine, 1, 0x1000 * current_bank); | |
| 1638 | 1638 | break; |
| 1639 | 1639 | } |
| 1640 | 1640 | |
| r2418 | r2419 | |
| 1642 | 1642 | |
| 1643 | 1643 | if (banking_mode == modeDC) |
| 1644 | 1644 | { |
| 1645 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fec, 0x1fec, 0, 0, current_bank_r); | |
| 1645 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fec, 0x1fec, 0, 0, current_bank_r); | |
| 1646 | 1646 | } |
| 1647 | 1647 | |
| 1648 | 1648 | /* set up bank switch registers */ |
| r2418 | r2419 | |
| 1650 | 1650 | switch (banking_mode) |
| 1651 | 1651 | { |
| 1652 | 1652 | case modeF8: |
| 1653 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_w); | |
| 1654 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r); | |
| 1653 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_w); | |
| 1654 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r); | |
| 1655 | 1655 | break; |
| 1656 | 1656 | |
| 1657 | 1657 | case modeFA: |
| 1658 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ffa, 0, 0, modeFA_switch_w); | |
| 1659 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ffa, 0, 0, modeFA_switch_r); | |
| 1658 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ffa, 0, 0, modeFA_switch_w); | |
| 1659 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ffa, 0, 0, modeFA_switch_r); | |
| 1660 | 1660 | break; |
| 1661 | 1661 | |
| 1662 | 1662 | case modeF6: |
| 1663 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff6, 0x1ff9, 0, 0, modeF6_switch_w); | |
| 1664 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff6, 0x1ff9, 0, 0, modeF6_switch_r); | |
| 1663 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff6, 0x1ff9, 0, 0, modeF6_switch_w); | |
| 1664 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff6, 0x1ff9, 0, 0, modeF6_switch_r); | |
| 1665 | 1665 | memory_set_opbase_handler( 0, modeF6_opbase ); |
| 1666 | 1666 | break; |
| 1667 | 1667 | |
| 1668 | 1668 | case modeF4: |
| 1669 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff4, 0x1ffb, 0, 0, modeF4_switch_w); | |
| 1670 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff4, 0x1ffb, 0, 0, modeF4_switch_r); | |
| 1669 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff4, 0x1ffb, 0, 0, modeF4_switch_w); | |
| 1670 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff4, 0x1ffb, 0, 0, modeF4_switch_r); | |
| 1671 | 1671 | break; |
| 1672 | 1672 | |
| 1673 | 1673 | case modeE0: |
| 1674 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1ff8, 0, 0, modeE0_switch_w); | |
| 1675 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1ff8, 0, 0, modeE0_switch_r); | |
| 1674 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1ff8, 0, 0, modeE0_switch_w); | |
| 1675 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1ff8, 0, 0, modeE0_switch_r); | |
| 1676 | 1676 | break; |
| 1677 | 1677 | |
| 1678 | 1678 | case mode3F: |
| 1679 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x00, 0x3f, 0, 0, mode3F_switch_w); | |
| 1679 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00, 0x3f, 0, 0, mode3F_switch_w); | |
| 1680 | 1680 | break; |
| 1681 | 1681 | |
| 1682 | 1682 | case modeUA: |
| 1683 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x200, 0x27f, 0, 0, modeUA_switch_w); | |
| 1684 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x200, 0x27f, 0, 0, modeUA_switch_r); | |
| 1683 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200, 0x27f, 0, 0, modeUA_switch_w); | |
| 1684 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200, 0x27f, 0, 0, modeUA_switch_r); | |
| 1685 | 1685 | break; |
| 1686 | 1686 | |
| 1687 | 1687 | case modeE7: |
| 1688 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1fe7, 0, 0, modeE7_switch_w); | |
| 1689 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1fe7, 0, 0, modeE7_switch_r); | |
| 1690 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe8, 0x1feb, 0, 0, modeE7_RAM_switch_w); | |
| 1691 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fe8, 0x1feb, 0, 0, modeE7_RAM_switch_r); | |
| 1692 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x18ff, 0, 0, SMH_BANK9); | |
| 1693 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1900, 0x19ff, 0, 0, SMH_BANK9); | |
| 1688 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1fe7, 0, 0, modeE7_switch_w); | |
| 1689 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe0, 0x1fe7, 0, 0, modeE7_switch_r); | |
| 1690 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe8, 0x1feb, 0, 0, modeE7_RAM_switch_w); | |
| 1691 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fe8, 0x1feb, 0, 0, modeE7_RAM_switch_r); | |
| 1692 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x18ff, 0, 0, SMH_BANK9); | |
| 1693 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1900, 0x19ff, 0, 0, SMH_BANK9); | |
| 1694 | 1694 | memory_set_bankptr( 9, extra_RAM + 4 * 256 ); |
| 1695 | 1695 | break; |
| 1696 | 1696 | |
| 1697 | 1697 | case modeDC: |
| 1698 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff0, 0x1ff0, 0, 0, modeDC_switch_w); | |
| 1699 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff0, 0x1ff0, 0, 0, modeDC_switch_r); | |
| 1698 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff0, 0x1ff0, 0, 0, modeDC_switch_w); | |
| 1699 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff0, 0x1ff0, 0, 0, modeDC_switch_r); | |
| 1700 | 1700 | break; |
| 1701 | 1701 | |
| 1702 | 1702 | case modeFE: |
| 1703 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01fe, 0x01fe, 0, 0, modeFE_switch_w); | |
| 1704 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01fe, 0x01fe, 0, 0, modeFE_switch_r); | |
| 1703 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01fe, 0x01fe, 0, 0, modeFE_switch_w); | |
| 1704 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01fe, 0x01fe, 0, 0, modeFE_switch_r); | |
| 1705 | 1705 | break; |
| 1706 | 1706 | |
| 1707 | 1707 | case mode3E: |
| 1708 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3e, 0x3e, 0, 0, mode3E_RAM_switch_w); | |
| 1709 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3f, 0x3f, 0, 0, mode3E_switch_w); | |
| 1710 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1400, 0x15ff, 0, 0, mode3E_RAM_w); | |
| 1708 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3e, 0x3e, 0, 0, mode3E_RAM_switch_w); | |
| 1709 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f, 0x3f, 0, 0, mode3E_switch_w); | |
| 1710 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1400, 0x15ff, 0, 0, mode3E_RAM_w); | |
| 1711 | 1711 | break; |
| 1712 | 1712 | |
| 1713 | 1713 | case modeSS: |
| 1714 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, modeSS_r); | |
| 1714 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, modeSS_r); | |
| 1715 | 1715 | bank_base[1] = extra_RAM + 2 * 0x800; |
| 1716 | 1716 | bank_base[2] = CART; |
| 1717 | 1717 | memory_set_bankptr( 1, bank_base[1] ); |
| r2418 | r2419 | |
| 1724 | 1724 | break; |
| 1725 | 1725 | |
| 1726 | 1726 | case modeFV: |
| 1727 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fd0, 0x1fd0, 0, 0, modeFV_switch_w); | |
| 1728 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fd0, 0x1fd0, 0, 0, modeFV_switch_r); | |
| 1727 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fd0, 0x1fd0, 0, 0, modeFV_switch_w); | |
| 1728 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fd0, 0x1fd0, 0, 0, modeFV_switch_r); | |
| 1729 | 1729 | break; |
| 1730 | 1730 | |
| 1731 | 1731 | case modeDPC: |
| 1732 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x103f, 0, 0, modeDPC_r); | |
| 1733 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1040, 0x107f, 0, 0, modeDPC_w); | |
| 1734 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_w); | |
| 1735 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r); | |
| 1732 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x103f, 0, 0, modeDPC_r); | |
| 1733 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1040, 0x107f, 0, 0, modeDPC_w); | |
| 1734 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_w); | |
| 1735 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r); | |
| 1736 | 1736 | memory_set_opbase_handler( 0, modeDPC_opbase_handler ); |
| 1737 | 1737 | { |
| 1738 | 1738 | int data_fetcher; |
| r2418 | r2419 | |
| 1752 | 1752 | break; |
| 1753 | 1753 | |
| 1754 | 1754 | case modeJVP: |
| 1755 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_r); | |
| 1756 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_w); | |
| 1755 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_r); | |
| 1756 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_w); | |
| 1757 | 1757 | break; |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| r2418 | r2419 | |
| 1761 | 1761 | |
| 1762 | 1762 | if (banking_mode == modeFA) |
| 1763 | 1763 | { |
| 1764 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x10ff, 0, 0, SMH_BANK9); | |
| 1765 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1100, 0x11ff, 0, 0, SMH_BANK9); | |
| 1764 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x10ff, 0, 0, SMH_BANK9); | |
| 1765 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1100, 0x11ff, 0, 0, SMH_BANK9); | |
| 1766 | 1766 | |
| 1767 | 1767 | memory_set_bankptr(9, extra_RAM); |
| 1768 | 1768 | } |
| 1769 | 1769 | |
| 1770 | 1770 | if (banking_mode == modeCV) |
| 1771 | 1771 | { |
| 1772 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1400, 0x17ff, 0, 0, SMH_BANK9); | |
| 1773 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x13ff, 0, 0, SMH_BANK9); | |
| 1772 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1400, 0x17ff, 0, 0, SMH_BANK9); | |
| 1773 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x13ff, 0, 0, SMH_BANK9); | |
| 1774 | 1774 | |
| 1775 | 1775 | memory_set_bankptr(9, extra_RAM); |
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | if (chip) |
| 1779 | 1779 | { |
| 1780 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x107f, 0, 0, SMH_BANK9); | |
| 1781 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1080, 0x10ff, 0, 0, SMH_BANK9); | |
| 1780 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x107f, 0, 0, SMH_BANK9); | |
| 1781 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1080, 0x10ff, 0, 0, SMH_BANK9); | |
| 1782 | 1782 | |
| 1783 | 1783 | memory_set_bankptr(9, extra_RAM); |
| 1784 | 1784 | } |
| r2418 | r2419 | |
|---|---|---|
| 267 | 267 | { |
| 268 | 268 | /* when upper 16 bytes are accessed use keyboard read |
| 269 | 269 | handler */ |
| 270 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 270 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 271 | 271 | block * 0x04000 + 0x3ff0, block * 0x04000 + 0x3fff, 0, 0, |
| 272 | 272 | pcw_keyboard_r); |
| 273 | 273 | } |
| 274 | 274 | else |
| 275 | 275 | { |
| 276 | 276 | /* restore bank handler across entire block */ |
| 277 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, | |
| 277 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, | |
| 278 | 278 | block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff, 0, 0, |
| 279 | 279 | (read8_machine_func) (STATIC_BANK1 + (FPTR)block)); |
| 280 | 280 | } |
| r2418 | r2419 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | /* Memory */ |
| 50 | 50 | |
| 51 | static void bw2_set_banks(UINT8 data) | |
| 51 | static void bw2_set_banks(running_machine *machine, UINT8 data) | |
| 52 | 52 | { |
| 53 | 53 | /* |
| 54 | 54 | Y0 /RAM1 Memory bank 1 |
| r2418 | r2419 | |
| 67 | 67 | { |
| 68 | 68 | case 0: |
| 69 | 69 | case 1: |
| 70 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 71 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 70 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 71 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 72 | 72 | break; |
| 73 | 73 | |
| 74 | 74 | case 2: |
| r2418 | r2419 | |
| 78 | 78 | case 6: |
| 79 | 79 | if (mess_ram_size < ((bank + 1) * 32 * 1024)) |
| 80 | 80 | { |
| 81 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 82 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 81 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 82 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 83 | 83 | } |
| 84 | 84 | else |
| 85 | 85 | { |
| 86 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 87 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 86 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 87 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 88 | 88 | } |
| 89 | 89 | break; |
| 90 | 90 | |
| 91 | 91 | case 7: |
| 92 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 93 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 92 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 93 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 94 | 94 | break; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | memory_set_bank(1, bank); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void ramcard_set_banks(UINT8 data) | |
| 100 | static void ramcard_set_banks(running_machine *machine, UINT8 data) | |
| 101 | 101 | { |
| 102 | 102 | /* |
| 103 | 103 | Y0 /RAM1 Memory bank 1 |
| r2418 | r2419 | |
| 117 | 117 | case 0: |
| 118 | 118 | case 1: |
| 119 | 119 | case 5: |
| 120 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 121 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 120 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 121 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 122 | 122 | break; |
| 123 | 123 | |
| 124 | 124 | case 3: |
| r2418 | r2419 | |
| 126 | 126 | case 6: |
| 127 | 127 | if (mess_ram_size < ((bank + 1) * 32 * 1024)) |
| 128 | 128 | { |
| 129 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 130 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 129 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 130 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 131 | 131 | } |
| 132 | 132 | else |
| 133 | 133 | { |
| 134 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 135 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 134 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 135 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 136 | 136 | } |
| 137 | 137 | break; |
| 138 | 138 | |
| 139 | 139 | case 2: |
| 140 | 140 | case 7: |
| 141 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 142 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 141 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1); | |
| 142 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP); | |
| 143 | 143 | break; |
| 144 | 144 | } |
| 145 | 145 | |
| r2418 | r2419 | |
| 351 | 351 | |
| 352 | 352 | if (input_port_read(machine, "RAMCARD") & 0x01) |
| 353 | 353 | { |
| 354 | ramcard_set_banks(data & 0x07); | |
| 354 | ramcard_set_banks(machine, data & 0x07); | |
| 355 | 355 | } |
| 356 | 356 | else |
| 357 | 357 | { |
| 358 | bw2_set_banks(data & 0x07); | |
| 358 | bw2_set_banks(machine, data & 0x07); | |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| r2418 | r2419 | |
| 511 | 511 | memory_configure_bank(1, 7, 1, memory_region(REGION_CPU1), 0); |
| 512 | 512 | memory_configure_bank(1, 8, 16, ramcard_ram, 0x8000); |
| 513 | 513 | |
| 514 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x30, 0x30, 0, 0x0f, &ramcard_bank_w); | |
| 514 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x30, 0x30, 0, 0x0f, &ramcard_bank_w); | |
| 515 | 515 | } |
| 516 | 516 | else |
| 517 | 517 | { |
| r2418 | r2419 | |
|---|---|---|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /* overlay disabled, map RAM on 0x000000 */ |
| 288 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1); | |
| 288 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1); | |
| 289 | 289 | |
| 290 | 290 | amiga_cart_check_overlay(); |
| 291 | 291 | } |
| 292 | 292 | else |
| 293 | 293 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 294 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, SMH_UNMAP); | |
| 294 | memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, SMH_UNMAP); | |
| 295 | 295 | |
| 296 | 296 | set_led_status( 0, ( data & 2 ) ? 0 : 1 ); /* bit 2 = Power Led on Amiga */ |
| 297 | 297 | output_set_value("power_led", ( data & 2 ) ? 0 : 1); |
| r2418 | r2419 | |
| 343 | 343 | if (input_port_read(Machine, "hardware") & 0x08) |
| 344 | 344 | { |
| 345 | 345 | /* Install RTC */ |
| 346 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, amiga_clock_r, amiga_clock_w); | |
| 346 | memory_install_readwrite16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, amiga_clock_r, amiga_clock_w); | |
| 347 | 347 | } |
| 348 | 348 | else |
| 349 | 349 | { |
| 350 | 350 | /* No RTC support */ |
| 351 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 351 | memory_install_readwrite16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, SMH_UNMAP, SMH_UNMAP); | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 |
| r2418 | r2419 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | if (bank < 7) |
| 161 | 161 | { |
| 162 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end, 0, 0, SMH_UNMAP); | |
| 162 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end, 0, 0, SMH_UNMAP); | |
| 163 | 163 | logerror("ABC806 deallocating %04x-%04x back to ROM\n", bank_start, bank_end); |
| 164 | 164 | } |
| 165 | 165 | else |
| 166 | 166 | { |
| 167 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end, 0, 0, (write8_machine_func)(FPTR)(STATIC_BANK1 + bank)); | |
| 167 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, bank_start, bank_end, 0, 0, (write8_machine_func)(FPTR)(STATIC_BANK1 + bank)); | |
| 168 | 168 | logerror("ABC806 deallocating %04x-%04x back to RAM\n", bank_start, bank_end); |
| 169 | 169 | } |
| 170 | 170 | } |
| r2418 | r2419 | |
| 742 | 742 | |
| 743 | 743 | MACHINE_START_CALL(abc800); |
| 744 | 744 | |
| 745 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 746 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2, SMH_UNMAP); | |
| 747 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3, SMH_UNMAP); | |
| 748 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4, SMH_UNMAP); | |
| 749 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, SMH_BANK5, SMH_UNMAP); | |
| 750 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5fff, 0, 0, SMH_BANK6, SMH_UNMAP); | |
| 751 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK7, SMH_UNMAP); | |
| 745 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, SMH_BANK1, SMH_UNMAP); | |
| 746 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1fff, 0, 0, SMH_BANK2, SMH_UNMAP); | |
| 747 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK3, SMH_UNMAP); | |
| 748 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK4, SMH_UNMAP); | |
| 749 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, SMH_BANK5, SMH_UNMAP); | |
| 750 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5fff, 0, 0, SMH_BANK6, SMH_UNMAP); | |
| 751 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, SMH_BANK7, SMH_UNMAP); | |
| 752 | 752 | |
| 753 | // memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 753 | // memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7fff, 0, 0, SMH_BANK8, SMH_BANK8); | |
| 754 | 754 | |
| 755 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 756 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, SMH_BANK10, SMH_BANK10); | |
| 757 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_BANK11, SMH_BANK11); | |
| 758 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, SMH_BANK12, SMH_BANK12); | |
| 759 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK13, SMH_BANK13); | |
| 760 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK14, SMH_BANK14); | |
| 761 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_BANK15, SMH_BANK15); | |
| 762 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK16, SMH_BANK16); | |
| 755 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, SMH_BANK9, SMH_BANK9); | |
| 756 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9fff, 0, 0, SMH_BANK10, SMH_BANK10); | |
| 757 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, 0, 0, SMH_BANK11, SMH_BANK11); | |
| 758 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, 0, 0, SMH_BANK12, SMH_BANK12); | |
| 759 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, SMH_BANK13, SMH_BANK13); | |
| 760 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, SMH_BANK14, SMH_BANK14); | |
| 761 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_BANK15, SMH_BANK15); | |
| 762 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK16, SMH_BANK16); | |
| 763 | 763 | |
| 764 | 764 | for (bank = 1; bank < 17; bank++) |
| 765 | 765 | { |
| r2418 | r2419 | |
|---|---|---|
| 451 | 451 | static DEVICE_IMAGE_LOAD( crvision_cart ) |
| 452 | 452 | { |
| 453 | 453 | int size = image_length(image); |
| 454 | running_machine *machine = image->machine; | |
| 454 | 455 | |
| 455 | 456 | switch (size) |
| 456 | 457 | { |
| 457 | 458 | case 0x1000: // 4K |
| 458 | 459 | image_fread(image, memory_region(REGION_CPU1) + 0x9000, 0x1000); |
| 459 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 460 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 460 | 461 | break; |
| 461 | 462 | |
| 462 | 463 | case 0x1800: // 6K |
| 463 | 464 | image_fread(image, memory_region(REGION_CPU1) + 0x9000, 0x1000); |
| 464 | 465 | image_fread(image, memory_region(REGION_CPU1) + 0x8800, 0x0800); |
| 465 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 466 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 466 | 467 | break; |
| 467 | 468 | |
| 468 | 469 | case 0x2000: // 8K |
| 469 | 470 | image_fread(image, memory_region(REGION_CPU1) + 0x8000, 0x2000); |
| 470 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 471 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 471 | 472 | break; |
| 472 | 473 | |
| 473 | 474 | case 0x2800: // 10K |
| 474 | 475 | image_fread(image, memory_region(REGION_CPU1) + 0x8000, 0x2000); |
| 475 | 476 | image_fread(image, memory_region(REGION_CPU1) + 0x5800, 0x0800); |
| 476 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 477 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2); | |
| 477 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 478 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2); | |
| 478 | 479 | break; |
| 479 | 480 | |
| 480 | 481 | case 0x3000: // 12K |
| 481 | 482 | image_fread(image, memory_region(REGION_CPU1) + 0x8000, 0x2000); |
| 482 | 483 | image_fread(image, memory_region(REGION_CPU1) + 0x5000, 0x1000); |
| 483 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 484 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2); | |
| 484 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1); | |
| 485 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2); | |
| 485 | 486 | break; |
| 486 | 487 | |
| 487 | 488 | case 0x4000: // 16K |
| 488 | 489 | image_fread(image, memory_region(REGION_CPU1) + 0xa000, 0x2000); |
| 489 | 490 | image_fread(image, memory_region(REGION_CPU1) + 0x8000, 0x2000); |
| 490 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 491 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK1); | |
| 491 | 492 | break; |
| 492 | 493 | |
| 493 | 494 | case 0x4800: // 18K |
| 494 | 495 | image_fread(image, memory_region(REGION_CPU1) + 0xa000, 0x2000); |
| 495 | 496 | image_fread(image, memory_region(REGION_CPU1) + 0x8000, 0x2000); |
| 496 | 497 | image_fread(image, memory_region(REGION_CPU1) + 0x4800, 0x0800); |
| 497 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, SMH_BANK1); | |
| 498 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2); | |
| 498 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, SMH_BANK1); | |
| 499 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2); | |
| 499 | 500 | break; |
| 500 | 501 | |
| 501 | 502 | default: |
| r2418 | r2419 | |
|---|---|---|
| 25 | 25 | #include "machine/pckeybrd.h" |
| 26 | 26 | #include "machine/8042kbdc.h" |
| 27 | 27 | #include "machine/pit8253.h" |
| 28 | #include "machine/idectrl.h" | |
| 28 | 29 | |
| 29 | 30 | /* Devices */ |
| 30 | 31 | #include "devices/mflopimg.h" |
| r2418 | r2419 | |
| 126 | 127 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 127 | 128 | MDRV_DEVICE_CONFIG( bebox_pic8259_slave_config ) |
| 128 | 129 | |
| 130 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, bebox_ide_interrupt ) /* FIXME */ | |
| 131 | ||
| 129 | 132 | /* video hardware */ |
| 130 | 133 | MDRV_IMPORT_FROM( pcvideo_vga ) |
| 131 | 134 | MDRV_SCREEN_MODIFY("main") |
| r2418 | r2419 | |
|---|---|---|
| 575 | 575 | amstrad_plus_lower_addr = (Data & 0x18) >> 3; // address of lower ROM area |
| 576 | 576 | if(amstrad_plus_lower_addr == 3) |
| 577 | 577 | { |
| 578 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_r); | |
| 579 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_r); | |
| 580 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_w); | |
| 581 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_w); | |
| 578 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_r); | |
| 579 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_r); | |
| 580 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_w); | |
| 581 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_w); | |
| 582 | 582 | amstrad_plus_asic_regpage = 1; // enable ASIC registers |
| 583 | 583 | } |
| 584 | 584 | else |
| 585 | 585 | { |
| 586 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); | |
| 587 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); | |
| 588 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); | |
| 589 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); | |
| 586 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); | |
| 587 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); | |
| 588 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); | |
| 589 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); | |
| 590 | 590 | amstrad_plus_asic_regpage = 0; // disable ASIC registers |
| 591 | 591 | } |
| 592 | 592 | // logerror("SYS: Secondary ROM select (lower ROM) - data = %02x - cart bank %i, addr %i\n",Data,amstrad_plus_lower,amstrad_plus_lower_addr); |
| r2418 | r2419 | |
| 2003 | 2003 | amstrad_vh_execute_crtc_cycles(param); |
| 2004 | 2004 | } |
| 2005 | 2005 | |
| 2006 | static void amstrad_common_init( | |
| 2006 | static void amstrad_common_init(running_machine *machine) | |
| 2007 | 2007 | { |
| 2008 | 2008 | aleste_mode = 0; |
| 2009 | 2009 | |
| r2418 | r2419 | |
| 2012 | 2012 | amstrad_CRTC_HS_Counter = 2; |
| 2013 | 2013 | previous_amstrad_UpperRom_data = 0xff; |
| 2014 | 2014 | |
| 2015 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1); | |
| 2016 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK2); | |
| 2015 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1); | |
| 2016 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK2); | |
| 2017 | 2017 | |
| 2018 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); | |
| 2019 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); | |
| 2018 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); | |
| 2019 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); | |
| 2020 | 2020 | |
| 2021 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK5); | |
| 2022 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK6); | |
| 2021 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK5); | |
| 2022 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK6); | |
| 2023 | 2023 | |
| 2024 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK7); | |
| 2025 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK8); | |
| 2024 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK7); | |
| 2025 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK8); | |
| 2026 | 2026 | |
| 2027 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK9); | |
| 2028 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK10); | |
| 2027 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK9); | |
| 2028 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK10); | |
| 2029 | 2029 | |
| 2030 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); | |
| 2031 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); | |
| 2030 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); | |
| 2031 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); | |
| 2032 | 2032 | |
| 2033 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK13); | |
| 2034 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK14); | |
| 2033 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK13); | |
| 2034 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK14); | |
| 2035 | 2035 | |
| 2036 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK15); | |
| 2037 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK16); | |
| 2036 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK15); | |
| 2037 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK16); | |
| 2038 | 2038 | |
| 2039 | 2039 | cpunum_reset(0); |
| 2040 | 2040 | if(amstrad_system_type == SYSTEM_CPC) |
| r2418 | r2419 | |
| 2089 | 2089 | } |
| 2090 | 2090 | |
| 2091 | 2091 | Amstrad_ROM_Table[7] = &memory_region(REGION_CPU1)[0x018000]; |
| 2092 | amstrad_common_init(); | |
| 2092 | amstrad_common_init(machine); | |
| 2093 | 2093 | amstrad_reset_machine(machine); |
| 2094 | 2094 | |
| 2095 | 2095 | multiface_init(); |
| r2418 | r2419 | |
| 2132 | 2132 | amstrad_plus_dma_clear = 1; // by default, DMA interrupts must be cleared by writing to the DSCR (&6c0f) |
| 2133 | 2133 | amstrad_plus_irq_cause = 6; |
| 2134 | 2134 | |
| 2135 | amstrad_common_init(); | |
| 2135 | amstrad_common_init(machine); | |
| 2136 | 2136 | amstrad_reset_machine(machine); |
| 2137 | 2137 | amstrad_plus_asic_ram[0x2805] = 0x01; // interrupt vector is undefined at startup, except that bit 0 is always 1. |
| 2138 | 2138 | AmstradCPC_GA_SetRamConfiguration(); |
| r2418 | r2419 | |
| 2181 | 2181 | amstrad_plus_dma_clear = 1; // by default, DMA interrupts must be cleared by writing to the DSCR (&6c0f) |
| 2182 | 2182 | amstrad_plus_irq_cause = 6; |
| 2183 | 2183 | |
| 2184 | amstrad_common_init(); | |
| 2184 | amstrad_common_init(machine); | |
| 2185 | 2185 | amstrad_reset_machine(machine); |
| 2186 | 2186 | amstrad_plus_asic_ram[0x2805] = 0x01; // interrupt vector is undefined at startup, except that bit 0 is always 1. |
| 2187 | 2187 | AmstradCPC_GA_SetRamConfiguration(); |
| r2418 | r2419 | |
| 2200 | 2200 | Amstrad_ROM_Table[i] = &memory_region(REGION_CPU1)[0x014000]; |
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | amstrad_common_init(); | |
| 2203 | amstrad_common_init(machine); | |
| 2204 | 2204 | kccomp_reset_machine(machine); |
| 2205 | 2205 | |
| 2206 | 2206 | /* bit 1 = /TEST. When 0, KC compact will enter data transfer |
| r2418 | r2419 | |
| 2230 | 2230 | |
| 2231 | 2231 | Amstrad_ROM_Table[3] = &memory_region(REGION_CPU1)[0x01c000]; // MSX-DOS / BIOS |
| 2232 | 2232 | Amstrad_ROM_Table[7] = &memory_region(REGION_CPU1)[0x018000]; // AMSDOS |
| 2233 | amstrad_common_init(); | |
| 2233 | amstrad_common_init(machine); | |
| 2234 | 2234 | amstrad_reset_machine(machine); |
| 2235 | 2235 | |
| 2236 | 2236 | nec765_init(&aleste_8272_interface,NEC765A,NEC765_RDY_PIN_CONNECTED); |
| r2418 | r2419 | |
|---|---|---|
| 104 | 104 | } |
| 105 | 105 | if (rh) |
| 106 | 106 | { |
| 107 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, (bank * 0x4000), | |
| 107 | memory_install_read8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, (bank * 0x4000), | |
| 108 | 108 | (bank * 0x4000) + 0x3FFF, 0, 0, rh); |
| 109 | 109 | } |
| 110 | 110 | if (wh) |
| 111 | 111 | { |
| 112 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, (bank * 0x4000), | |
| 112 | memory_install_write8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, (bank * 0x4000), | |
| 113 | 113 | (bank * 0x4000) + 0x3FFF, 0, 0, wh); |
| 114 | 114 | } |
| 115 | 115 | } |
| r2418 | r2419 | |
|---|---|---|
| 47 | 47 | AM_RANGE( 0x88, 0x88) AM_WRITE( AY8910_control_port_0_w ) |
| 48 | 48 | AM_RANGE( 0x8c, 0x8c) AM_WRITE( AY8910_write_port_0_w ) |
| 49 | 49 | AM_RANGE( 0x90, 0x90) AM_READ( AY8910_read_port_0_r ) |
| 50 | AM_RANGE( 0x96, 0x97) AM_WRITE( svi318_ppi_w ) | |
| 51 | AM_RANGE( 0x98, 0x9a) AM_READ( svi318_ppi_r ) | |
| 50 | AM_RANGE( 0x96, 0x97) AM_DEVWRITE( PPI8255, "ppi8255", svi318_ppi_w ) | |
| 51 | AM_RANGE( 0x98, 0x9a) AM_DEVREAD( PPI8255, "ppi8255", svi318_ppi_r ) | |
| 52 | 52 | ADDRESS_MAP_END |
| 53 | 53 | |
| 54 | 54 | static ADDRESS_MAP_START( svi328_806_io, ADDRESS_SPACE_IO, 8 ) |
| r2418 | r2419 | |
| 62 | 62 | AM_RANGE( 0x88, 0x88) AM_WRITE( AY8910_control_port_0_w ) |
| 63 | 63 | AM_RANGE( 0x8c, 0x8c) AM_WRITE( AY8910_write_port_0_w ) |
| 64 | 64 | AM_RANGE( 0x90, 0x90) AM_READ( AY8910_read_port_0_r ) |
| 65 | AM_RANGE( 0x96, 0x97) AM_WRITE( svi318_ppi_w ) | |
| 66 | AM_RANGE( 0x98, 0x9a) AM_READ( svi318_ppi_r ) | |
| 65 | AM_RANGE( 0x96, 0x97) AM_DEVWRITE( PPI8255, "ppi8255", svi318_ppi_w ) | |
| 66 | AM_RANGE( 0x98, 0x9a) AM_DEVREAD( PPI8255, "ppi8255", svi318_ppi_r ) | |
| 67 | 67 | ADDRESS_MAP_END |
| 68 | 68 | |
| 69 | 69 | /* |
| r2418 | r2419 | |
|---|---|---|
| 527 | 527 | genesis_sram_active = 1; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, genesis_sram_start & 0x3fffff, (genesis_sram_start + genesis_sram_len - 1) & 0x3fffff, 0, 0, genesis_sram_read); | |
| 530 | memory_install_read16_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, genesis_sram_start & 0x3fffff, (genesis_sram_start + genesis_sram_len - 1) & 0x3fffff, 0, 0, genesis_sram_read); | |
| 531 | 531 | |
| 532 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, genesis_sram_start & 0x3fffff, (genesis_sram_start + genesis_sram_len - 1) & 0x3fffff, 0, 0, genesis_sram_write); | |
| 533 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa130f0, 0xa130f1, 0, 0, genesis_sram_toggle); | |
| 532 | memory_install_write16_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, genesis_sram_start & 0x3fffff, (genesis_sram_start + genesis_sram_len - 1) & 0x3fffff, 0, 0, genesis_sram_write); | |
| 533 | memory_install_write16_handler(image->machine, 0, ADDRESS_SPACE_PROGRAM, 0xa130f0, 0xa130f1, 0, 0, genesis_sram_toggle); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | return INIT_PASS; |
| r2418 | r2419 | |
| 991 | 991 | |
| 992 | 992 | if (is_ssf2) |
| 993 | 993 | { |
| 994 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, genesis_ssf2_bank_w); | |
| 994 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, genesis_ssf2_bank_w); | |
| 995 | 995 | } |
| 996 | 996 | if (is_kaiju) |
| 997 | 997 | { |
| 998 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x7fffff, 0, 0, g_kaiju_bank_w ); | |
| 998 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x7fffff, 0, 0, g_kaiju_bank_w ); | |
| 999 | 999 | } |
| 1000 | 1000 | if (is_chifi3) |
| 1001 | 1001 | { |
| 1002 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x4fffff, 0, 0, g_chifi3_prot_r ); | |
| 1003 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000, 0x6fffff, 0, 0, g_chifi3_bank_w ); | |
| 1002 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x4fffff, 0, 0, g_chifi3_prot_r ); | |
| 1003 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000, 0x6fffff, 0, 0, g_chifi3_bank_w ); | |
| 1004 | 1004 | |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | if (is_radica) |
| 1008 | 1008 | { |
| 1009 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa1307f, 0, 0, radica_bank_select ); | |
| 1009 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa1307f, 0, 0, radica_bank_select ); | |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | if (is_kof99) { |
| 1013 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, kof99_0xA13000_r ); | |
| 1014 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13002, 0xA13003, 0, 0, kof99_0xA13002_r ); | |
| 1015 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA1303e, 0xA1303f, 0, 0, kof99_00A1303E_r ); | |
| 1013 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, kof99_0xA13000_r ); | |
| 1014 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13002, 0xA13003, 0, 0, kof99_0xA13002_r ); | |
| 1015 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA1303e, 0xA1303f, 0, 0, kof99_00A1303E_r ); | |
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | if (is_soulb) { |
| 1019 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, soulb_0x400006_r ); | |
| 1020 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, soulb_0x400002_r ); | |
| 1021 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, soulb_0x400004_r ); | |
| 1019 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, soulb_0x400006_r ); | |
| 1020 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, soulb_0x400002_r ); | |
| 1021 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, soulb_0x400004_r ); | |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | if (is_redcliff) |
| 1025 | 1025 | { |
| 1026 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, redclif_prot2_r ); | |
| 1027 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, redclif_prot_r ); | |
| 1026 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, redclif_prot2_r ); | |
| 1027 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, redclif_prot_r ); | |
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | if (is_mjlovr) |
| 1031 | 1031 | { |
| 1032 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, mjlovr_prot_1_r ); | |
| 1033 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x401000, 0x401001, 0, 0, mjlovr_prot_2_r ); | |
| 1032 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, mjlovr_prot_1_r ); | |
| 1033 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x401000, 0x401001, 0, 0, mjlovr_prot_2_r ); | |
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | 1036 | if (is_squir) |
| 1037 | 1037 | { |
| 1038 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, squirrel_king_extra_r); | |
| 1039 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, squirrel_king_extra_w); | |
| 1038 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, squirrel_king_extra_r); | |
| 1039 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, squirrel_king_extra_w); | |
| 1040 | 1040 | } |
| 1041 | 1041 | if (is_smous) |
| 1042 | 1042 | { |
| 1043 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, smous_prot_r ); | |
| 1043 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400007, 0, 0, smous_prot_r ); | |
| 1044 | 1044 | } |
| 1045 | 1045 | if (is_smb) |
| 1046 | 1046 | { |
| 1047 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa13001, 0, 0, smbro_prot_r ); | |
| 1047 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa13001, 0, 0, smbro_prot_r ); | |
| 1048 | 1048 | } |
| 1049 | 1049 | if (is_smb2) |
| 1050 | 1050 | { |
| 1051 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, smb2_extra_r); | |
| 1051 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, smb2_extra_r); | |
| 1052 | 1052 | } |
| 1053 | 1053 | if (is_19in1) |
| 1054 | 1054 | { |
| 1055 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13038, 0, 0, s19in1_bank); | |
| 1055 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13038, 0, 0, s19in1_bank); | |
| 1056 | 1056 | } |
| 1057 | 1057 | if (is_realtec) |
| 1058 | 1058 | { |
| 1059 | 1059 | realtek_old_bank_addr = -1; |
| 1060 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, realtec_400000_w); | |
| 1061 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x402000, 0x402001, 0, 0, realtec_402000_w); | |
| 1062 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x404000, 0x404001, 0, 0, realtec_404000_w); | |
| 1060 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, realtec_400000_w); | |
| 1061 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x402000, 0x402001, 0, 0, realtec_402000_w); | |
| 1062 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x404000, 0x404001, 0, 0, realtec_404000_w); | |
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | if (is_kof98) |
| 1066 | 1066 | { |
| 1067 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x480000, 0x480001, 0, 0, g_kof98_aa_r ); | |
| 1068 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800e0, 0x4800e1, 0, 0, g_kof98_aa_r ); | |
| 1069 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4824a0, 0x4824a1, 0, 0, g_kof98_aa_r ); | |
| 1070 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x488880, 0x488881, 0, 0, g_kof98_aa_r ); | |
| 1067 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x480000, 0x480001, 0, 0, g_kof98_aa_r ); | |
| 1068 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800e0, 0x4800e1, 0, 0, g_kof98_aa_r ); | |
| 1069 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4824a0, 0x4824a1, 0, 0, g_kof98_aa_r ); | |
| 1070 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x488880, 0x488881, 0, 0, g_kof98_aa_r ); | |
| 1071 | 1071 | |
| 1072 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4a8820, 0x4a8821, 0, 0, g_kof98_0a_r ); | |
| 1073 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f8820, 0x4f8821, 0, 0, g_kof98_00_r ); | |
| 1072 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4a8820, 0x4a8821, 0, 0, g_kof98_0a_r ); | |
| 1073 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f8820, 0x4f8821, 0, 0, g_kof98_00_r ); | |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | if (is_elfwor) |
| r2418 | r2419 | |
| 1078 | 1078 | /* |
| 1079 | 1079 | Elf Wor (Unl) - return (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). It is probably best to add handlers for all 4 addresses. |
| 1080 | 1080 | */ |
| 1081 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, elfwor_0x400000_r ); | |
| 1082 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, elfwor_0x400004_r ); | |
| 1083 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, elfwor_0x400002_r ); | |
| 1084 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, elfwor_0x400006_r ); | |
| 1081 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, elfwor_0x400000_r ); | |
| 1082 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, elfwor_0x400004_r ); | |
| 1083 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, elfwor_0x400002_r ); | |
| 1084 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, elfwor_0x400006_r ); | |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | if (is_lionk2) |
| 1088 | 1088 | { |
| 1089 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, lion2_prot1_w ); | |
| 1090 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, lion2_prot1_r ); | |
| 1091 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, lion2_prot2_w ); | |
| 1092 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, lion2_prot2_r ); | |
| 1089 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, lion2_prot1_w ); | |
| 1090 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, lion2_prot1_r ); | |
| 1091 | memory_install_write16_handler(machine, 0,ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, lion2_prot2_w ); | |
| 1092 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400006, 0x400007, 0, 0, lion2_prot2_r ); | |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | if (is_rx3) |
| 1096 | 1096 | { |
| 1097 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, rx3_extra_r); | |
| 1097 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, rx3_extra_r); | |
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | if (is_bugsl) |
| 1101 | 1101 | { |
| 1102 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, bugl_extra_r); | |
| 1102 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, bugl_extra_r); | |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | if (is_sbub) |
| 1106 | 1106 | { |
| 1107 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, sbub_extra1_r); | |
| 1108 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, sbub_extra2_r); | |
| 1107 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, sbub_extra1_r); | |
| 1108 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400002, 0x400003, 0, 0, sbub_extra2_r); | |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | /* install NOP handler for TMSS */ |
| 1112 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA14000, 0xA14003, 0, 0, genesis_TMSS_bank_w); | |
| 1112 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA14000, 0xA14003, 0, 0, genesis_TMSS_bank_w); | |
| 1113 | 1113 | |
| 1114 | 1114 | } |
| 1115 | 1115 |
| r2418 | r2419 | |
|---|---|---|
| 42 | 42 | #include "machine/smartmed.h" |
| 43 | 43 | #include "sound/5220intf.h" |
| 44 | 44 | #include "devices/harddriv.h" |
| 45 | #include "machine/idectrl.h" | |
| 45 | 46 | |
| 46 | 47 | static ADDRESS_MAP_START(memmap, ADDRESS_SPACE_PROGRAM, 16) |
| 47 | 48 | |
| r2418 | r2419 | |
| 263 | 264 | MDRV_VIDEO_START(ti99_4ev) |
| 264 | 265 | MDRV_VIDEO_UPDATE(generic_bitmapped) |
| 265 | 266 | |
| 267 | /* sound hardware */ | |
| 266 | 268 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 267 | 269 | MDRV_SOUND_ADD(DAC, 0) |
| 268 | 270 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| r2418 | r2419 | |
| 275 | 277 | MDRV_SOUND_ADD(TMS5220, 680000L) |
| 276 | 278 | MDRV_SOUND_CONFIG(tms5220interface) |
| 277 | 279 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 280 | ||
| 281 | /* devices */ | |
| 282 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 278 | 283 | MACHINE_DRIVER_END |
| 279 | 284 | |
| 280 | 285 |
| r2418 | r2419 | |
|---|---|---|
| 35 | 35 | #include "devices/harddriv.h" |
| 36 | 36 | #include "machine/smartmed.h" |
| 37 | 37 | #include "sound/5220intf.h" |
| 38 | #include "machine/idectrl.h" | |
| 38 | 39 | |
| 39 | 40 | /* |
| 40 | 41 | memory map |
| r2418 | r2419 | |
| 528 | 529 | MDRV_SOUND_ADD(TMS5220, 680000L) |
| 529 | 530 | MDRV_SOUND_CONFIG(tms5220interface) |
| 530 | 531 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 532 | ||
| 533 | /* devices */ | |
| 534 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 531 | 535 | MACHINE_DRIVER_END |
| 532 | 536 | |
| 533 | 537 | static MACHINE_DRIVER_START(ti99_4_50hz) |
| r2418 | r2419 | |
| 557 | 561 | MDRV_SOUND_ADD(WAVE, 0) |
| 558 | 562 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 559 | 563 | |
| 564 | /* devices */ | |
| 565 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 560 | 566 | MACHINE_DRIVER_END |
| 561 | 567 | |
| 562 | 568 | static MACHINE_DRIVER_START(ti99_4a_60hz) |
| r2418 | r2419 | |
| 585 | 591 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 586 | 592 | MDRV_SOUND_ADD(WAVE, 0) |
| 587 | 593 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 594 | ||
| 595 | /* devices */ | |
| 596 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 588 | 597 | MACHINE_DRIVER_END |
| 589 | 598 | |
| 590 | 599 | |
| r2418 | r2419 | |
| 614 | 623 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 615 | 624 | MDRV_SOUND_ADD(WAVE, 0) |
| 616 | 625 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 626 | ||
| 627 | /* devices */ | |
| 628 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 617 | 629 | MACHINE_DRIVER_END |
| 618 | 630 | |
| 619 | 631 | |
| r2418 | r2419 | |
| 651 | 663 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 652 | 664 | MDRV_SOUND_ADD(WAVE, 0) |
| 653 | 665 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 666 | ||
| 667 | /* devices */ | |
| 668 | MDRV_IDE_CONTROLLER_ADD( "ide", ~0, ti99_ide_interrupt ) /* FIXME */ | |
| 654 | 669 | MACHINE_DRIVER_END |
| 655 | 670 | |
| 656 | 671 |
| r2418 | r2419 | |
|---|---|---|
| 220 | 220 | |
| 221 | 221 | static DEVICE_IMAGE_LOAD( vc4000_cart ) |
| 222 | 222 | { |
| 223 | running_machine *machine = image->machine; | |
| 223 | 224 | int size = image_length(image); |
| 224 | 225 | |
| 225 | 226 | switch (size) |
| 226 | 227 | { |
| 227 | 228 | case 0x0800: // 2K |
| 228 | 229 | image_fread(image, memory_region(REGION_CPU1) + 0x0000, 0x0800); |
| 229 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 230 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 230 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 231 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 231 | 232 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x0000); |
| 232 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 233 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 233 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 234 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 234 | 235 | memory_set_bankptr(2, mess_ram); |
| 235 | 236 | memory_set_bankptr(6, mess_ram); |
| 236 | 237 | break; |
| 237 | 238 | |
| 238 | 239 | case 0x1000: // 4K |
| 239 | 240 | image_fread(image, memory_region(REGION_CPU1) + 0x0000, 0x1000); |
| 240 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 241 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 241 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 242 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 242 | 243 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x0000); |
| 243 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 244 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 244 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 245 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 245 | 246 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x0800); |
| 246 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK3); | |
| 247 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK7); | |
| 247 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK3); | |
| 248 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK7); | |
| 248 | 249 | memory_set_bankptr(3, mess_ram); |
| 249 | 250 | memory_set_bankptr(7, mess_ram); |
| 250 | 251 | break; |
| 251 | 252 | |
| 252 | 253 | case 0x1800: // 6K |
| 253 | 254 | image_fread(image, memory_region(REGION_CPU1) + 0x0000, 0x15FF); |
| 254 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 255 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 255 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK1); | |
| 256 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07FF, 0, 0, SMH_BANK5); | |
| 256 | 257 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x0000); |
| 257 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 258 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 258 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK2); | |
| 259 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0FFF, 0, 0, SMH_BANK6); | |
| 259 | 260 | memory_set_bankptr(2, memory_region(REGION_CPU1) + 0x0800); |
| 260 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK3); | |
| 261 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x15FF, 0, 0, SMH_BANK7); | |
| 261 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x15FF, 0, 0, SMH_BANK3); | |
| 262 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x15FF, 0, 0, SMH_BANK7); | |
| 262 | 263 | memory_set_bankptr(3, memory_region(REGION_CPU1) + 0x1000); |
| 263 | memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1BFF, 0, 0, SMH_BANK4); | |
| 264 | memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1BFF, 0, 0, SMH_BANK8); | |
| 264 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1BFF, 0, 0, SMH_BANK4); | |
| 265 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1BFF, 0, 0, SMH_BANK8); | |
| 265 | 266 | memory_set_bankptr(4, mess_ram); |
| 266 | 267 | memory_set_bankptr(8, mess_ram); |
| 267 | 268 | break; |
| r2418 | r2419 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | Source Changes: |
| 80 | 80 | ---------------- |
| 81 | - The core is based on MAME 0.124u | |
| 81 | - The core is based on MAME 0.124u3. This incorporates all features of the | |
| 82 | 82 | update to this core. [MAME team] |
| 83 | 83 | |
| 84 | 84 | - Major changes to transition MESS's device system onto MAME's device system. |
| Previous | 15994 Revisions | Next |